27228c004ae0a91ce3b6109c5136fc1be599cad5
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-04-29  Chris Dumez  <cdumez@apple.com>
2
3         Node.nodeName should not be nullable
4         https://bugs.webkit.org/show_bug.cgi?id=157211
5
6         Reviewed by Ryosuke Niwa.
7
8         Node.nodeName should not be nullable as per the specification:
9         https://dom.spec.whatwg.org/#interface-node
10
11         Our implementation never returns null anyway. However, having
12         it as nullable in the IDL means we use jsStringOrNull() instead
13         of jsStringWithCache(), thus doing an unnecessary null check.
14
15         This should not be observable by JS.
16
17         * dom/Node.idl:
18
19 2016-04-29  Commit Queue  <commit-queue@webkit.org>
20
21         Unreviewed, rolling out r200150 and r200256.
22         https://bugs.webkit.org/show_bug.cgi?id=157216
23
24         This change introduced flakiness in existing CJK LayoutTests.
25         Also reverting the change that marked the tests as flaky.
26         (Requested by ryanhaddad on #webkit).
27
28         Reverted changesets:
29
30         "Clean up Font::removeFromSystemFallbackCache()"
31         https://bugs.webkit.org/show_bug.cgi?id=157093
32         http://trac.webkit.org/changeset/200150
33
34         "Marking fast/ruby/ruby-expansion-cjk.html and fast/ruby/ruby-
35         expansion-cjk-4.html as flaky on Mac"
36         https://bugs.webkit.org/show_bug.cgi?id=157197
37         http://trac.webkit.org/changeset/200256
38
39 2016-04-29  Antonio Gomes  <tonikitoo@webkit.org>
40
41         <select multiple> padding should react when scrolling
42
43         https://bugs.webkit.org/show_bug.cgi?id=156590
44         https://bugs.webkit.org/show_bug.cgi?id=156591
45
46         Reviewed by Reviewed by Darin Adler.
47
48         Tests: fast/forms/listbox-respects-padding-bottom.html
49                fast/forms/listbox-top-padding-do-not-clip-items.html
50
51         Non-dropdown listboxes have support to padding-{top,bottom} implemented similarly
52         to the border model: the padding area does not move when the listbox' content gets scrolled,
53         but instead it clips out its content.
54         This is not consistent with other browsers and is not consistent with the CSS box model.
55
56         This in practice, if a <select> has padding-top set, the padding-top area will clip out listbox'
57         content as one scrolls upwards.
58         It also means that if padding-bottom is set, when one scrolls all the way to the bottom
59         of the listbox content, padding-bottom is not respected.
60
61         In order to fix these two problems, and make WebKit match Blink with respect to the the way
62         padding-{top,bottom} are handled, patch adds two class member variables that control the number
63         of list items (i.e. <option>s) that can be painted over the current listbox' padding area.
64
65         In short, depending on the scroll position and the amount of space available in the padding top/bottom
66         areas, items are painted or not on top of it, mimic'ing the CSS box model behavior of other browsers.
67
68         Note that this is specific solution is worth it to pursue on the short/mid term, but a long-term solution
69         to this problem and many other listbox discrepancies on WebKit's implementation, would be to reimplement
70         RenderListBox class in terms of RenderLayer. This will be a follow up work.
71
72         * rendering/RenderListBox.cpp:
73         (WebCore::RenderListBox::updateFromElement):
74         (WebCore::RenderListBox::numVisibleItems):
75         (WebCore::RenderListBox::paintObject):
76         (WebCore::RenderListBox::scrollToRevealElementAtListIndex):
77         (WebCore::RenderListBox::listIndexIsVisible):
78         (WebCore::RenderListBox::maximumNumberOfItemsThatFitInPaddingBottomArea):
79         (WebCore::RenderListBox::numberOfVisibleItemsInPaddingTop):
80         (WebCore::RenderListBox::numberOfVisibleItemsInPaddingBottom):
81         (WebCore::RenderListBox::computeFirstIndexesVisibleInPaddingTopBottomAreas):
82         (WebCore::RenderListBox::scrollTo):
83         * rendering/RenderListBox.h:
84
85 2016-04-29  Eric Carlson  <eric.carlson@apple.com>
86
87         [Mac] AirPlay fails if target is set before AVPlayer has been created
88         https://bugs.webkit.org/show_bug.cgi?id=157147
89         <rdar://problem/24197592>
90
91         Reviewed by Jer Noble.
92
93         Test: media/media-source/media-source-airplay.html
94
95         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
96         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Clear flag before calling
97           setShouldPlayToPlaybackTarget so it does the necessary setup.
98
99         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
100         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): Return false if the mock
101           MSE source has been registered.
102         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Return 'not supported' if
103           isAvailable is false.
104         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Fail if isAvailable is false.
105         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless): Cleanup.
106
107         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
108         (WebCore::registered): Global accessor.
109         (WebCore::MockMediaPlayerMediaSource::isRegistered): 
110         (WebCore::MockMediaPlayerMediaSource::registerMediaEngine): Set registered to true.
111         (WebCore::MockMediaPlayerMediaSource::setWirelessPlaybackTarget): New, remember the target.
112         (WebCore::MockMediaPlayerMediaSource::setShouldPlayToPlaybackTarget): New, remember the setting.
113         (WebCore::MockMediaPlayerMediaSource::isCurrentPlaybackTargetWireless):
114         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
115
116         * testing/Internals.cpp:
117         (WebCore::Internals::initializeMockMediaSource): Don't disable AVFoundation.
118
119 2016-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
120
121         [RTL Scrollbars] REGRESSION(r200116): Positioned contents can overlap RTL scrollbars
122         https://bugs.webkit.org/show_bug.cgi?id=157164
123         <rdar://problem/25993610>
124
125         Reviewed by Darin Adler.
126
127         There was some code left over from the old implementation of RTL_SCROLLBARS
128         which had some faulty assumptions about the interaction between direction
129         and scrollbar placement. In particular, once we began obeying the "dir"
130         attribute in r200116, these assumptions were no longer valid.
131
132         Test: fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html
133               scrollbars/rtl/div-absolute.html
134               scrollbars/rtl/div-horizontal.html
135
136         * rendering/InlineFlowBox.h:
137         (WebCore::InlineFlowBox::layoutOverflowRect):
138         * rendering/RenderBlock.cpp:
139         (WebCore::RenderBlock::computeOverflow): Deleted.
140         * rendering/RenderBox.cpp:
141         (WebCore::RenderBox::layoutOverflowRectForPropagation):
142         * rendering/RenderLayer.cpp:
143         (WebCore::RenderLayer::computeScrollDimensions):
144
145 2016-04-29  Nan Wang  <n_wang@apple.com>
146
147         AX: CharacterOffset not working correctly with composed characters and collapsed white spaces
148         https://bugs.webkit.org/show_bug.cgi?id=157190
149
150         Reviewed by Chris Fleizach.
151
152         When navigating emoji, next/previous text marker call is only moving by one character. Fixed it by
153         using the helper function in Position to get the real character count for the composed character sequence.
154         Also there's another issue with collapsed white spaces, TextIterator emits only one space. So we have to 
155         use the actual space length to create the CharacterOffset in order to generate valid Range object from it.
156
157         New test cases in accessibility/text-marker/text-marker-previous-next.html.
158
159         * accessibility/AXObjectCache.cpp:
160         (WebCore::AXObjectCache::traverseToOffsetInRange):
161         (WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
162         (WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset):
163         (WebCore::AXObjectCache::nextNode):
164         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
165         (WebCore::AXObjectCache::nextCharacterOffset):
166         (WebCore::AXObjectCache::previousCharacterOffset):
167         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
168
169 2016-04-28  Jer Noble  <jer.noble@apple.com>
170
171         WebPlaybackControlsManager should not be owned by the WebPlaybackSessionInterfaceMac.
172         https://bugs.webkit.org/show_bug.cgi?id=157155
173         <rdar://problem/25991724>
174
175         Reviewed by Beth Dakin.
176
177         Move the WebPlaybackControlsManager class into its own header and implementation files.
178
179         * WebCore.xcodeproj/project.pbxproj:
180         * platform/mac/WebPlaybackControlsManager.h: Added.
181         * platform/mac/WebPlaybackControlsManager.mm: Added.
182         (-[WebPlaybackControlsManager timing]): Moved from WebPlaybackSessionInterfaceMac.
183         (-[WebPlaybackControlsManager setTiming:]): Ditto.
184         (-[WebPlaybackControlsManager seekableTimeRanges]): Ditto.
185         (-[WebPlaybackControlsManager setSeekableTimeRanges:]): Ditto.
186         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]): Ditto.
187         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]): Ditto.
188         * platform/mac/WebPlaybackSessionInterfaceMac.h:
189         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
190         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
191         (-[WebPlaybackControlsManager initWithWebPlaybackSessionInterfaceMac:]): Deleted.
192         (-[WebPlaybackControlsManager timing]): Deleted.
193         (-[WebPlaybackControlsManager setTiming:]): Deleted.
194         (-[WebPlaybackControlsManager seekableTimeRanges]): Deleted.
195         (-[WebPlaybackControlsManager setSeekableTimeRanges:]): Deleted.
196         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]): Deleted.
197         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]): Deleted.
198         (WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager): Deleted.
199
200 2016-04-29  Commit Queue  <commit-queue@webkit.org>
201
202         Unreviewed, rolling out r200232.
203         https://bugs.webkit.org/show_bug.cgi?id=157189
204
205         This change broke the Mac CMake build and its LayoutTest is
206         failing and/or flaky on all platforms (Requested by ryanhaddad
207         on #webkit).
208
209         Reverted changeset:
210
211         "Move ResourceTiming behind a runtime flag"
212         https://bugs.webkit.org/show_bug.cgi?id=157133
213         http://trac.webkit.org/changeset/200232
214
215 2016-04-29  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
216
217         [GTK] Fix build failure introduced by r199738
218         https://bugs.webkit.org/show_bug.cgi?id=157182
219
220         Reviewed by Alex Christensen.
221
222         * CMakeLists.txt:
223
224 2016-04-29  Brady Eidson  <beidson@apple.com>
225
226         Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and other small cleanup.
227         https://bugs.webkit.org/show_bug.cgi?id=157185
228
229         Reviewed by Anders Carlsson.
230
231         No new tests (Code cleanup, no change in behavior).
232
233         * platform/CrossThreadCopier.cpp:
234         (WebCore::IndexedDB::TransactionMode>::copy): Deleted.
235         (WebCore::IndexedDB::CursorDirection>::copy): Deleted.
236         (WebCore::IndexedDB::CursorType>::copy): Deleted.
237         (WebCore::IDBGetResult>::copy): Deleted.
238         (WebCore::IDBKeyData>::copy): Deleted.
239         (WebCore::IDBKeyRangeData>::copy): Deleted.
240         (WebCore::IDBDatabaseInfo>::copy): Deleted.
241         (WebCore::IDBDatabaseIdentifier>::copy): Deleted.
242         (WebCore::IDBTransactionInfo>::copy): Deleted.
243         (WebCore::IDBResourceIdentifier>::copy): Deleted.
244         (WebCore::IDBError>::copy): Deleted.
245         (WebCore::IDBObjectStoreInfo>::copy): Deleted.
246         (WebCore::IDBIndexInfo>::copy): Deleted.
247         (WebCore::IDBCursorInfo>::copy): Deleted.
248         (WebCore::IDBValue>::copy): Deleted.
249
250         * platform/CrossThreadCopier.h:
251         (WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper): Deleted dead code.
252         (WebCore::AllowCrossThreadAccessWrapper::value): Deleted dead code.
253         (WebCore::AllowCrossThreadAccess): Deleted dead code.
254         (WebCore::AllowAccessLaterWrapper::AllowAccessLaterWrapper): Deleted dead code.
255         (WebCore::AllowAccessLaterWrapper::value): Deleted dead code.
256         (WebCore::AllowAccessLater): Deleted dead code.
257
258 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
259
260         Wheel Event Not Fired For `body,html { height:100% }`
261         https://bugs.webkit.org/show_bug.cgi?id=148450
262
263         Reviewed by Brent Fulgham.
264         
265         EventHandler::handleWheelEvent() didn't pass the Active flag in the HitTestRequest,
266         which causes code in RenderLayer::hitTest() to fail to fall back to returning the
267         root layer if no other element is hit. "Active" is in the default flags,
268         so just create the HitTestRequest with the default flags.
269
270         Test: fast/events/wheel-event-outside-body.html
271
272         * page/EventHandler.cpp:
273         (WebCore::EventHandler::handleWheelEvent):
274
275 2016-04-29  Chris Dumez  <cdumez@apple.com>
276
277         [Web IDL] Specify default values for optional parameters of wrapper types
278         https://bugs.webkit.org/show_bug.cgi?id=157161
279
280         Reviewed by Darin Adler.
281
282         Specify default values for optional parameters of wrapper types.
283
284         * Modules/indexeddb/IDBIndex.cpp:
285         (WebCore::IDBIndex::count): Deleted.
286         * Modules/indexeddb/IDBIndex.h:
287         * Modules/indexeddb/IDBIndex.idl:
288         * Modules/indexeddb/IDBObjectStore.cpp:
289         (WebCore::IDBObjectStore::count): Deleted.
290         * Modules/indexeddb/IDBObjectStore.h:
291         * Modules/indexeddb/IDBObjectStore.idl:
292         * Modules/mediastream/RTCPeerConnection.cpp:
293         (WebCore::RTCPeerConnection::createDataChannel): Deleted.
294         * Modules/mediastream/RTCPeerConnection.h:
295         * Modules/mediastream/RTCPeerConnection.idl:
296
297         * bindings/scripts/CodeGeneratorJS.pm:
298         (WillConvertUndefinedToDefaultParameterValue):
299         Optimization to avoid generating a ternary if the default
300         value of a wrapper type parameter is null, since undefined
301         will already convert to null for those.
302
303         (GenerateParametersCheck):
304         Use null as implicit default value for nullable parameters, given that Web IDL
305         converts undefined to null for such parameters:
306         http://heycam.github.io/webidl/#es-nullable-type
307
308         (CanUseWTFOptionalForParameter):
309         Drop the check for wrapper types.
310
311         * bindings/scripts/test/*:
312         Improve bindings tests coverage / rebaseline.
313
314         * css/MediaQueryList.idl:
315         * css/MediaQueryListListener.idl:
316         * dom/Document.idl:
317
318         * html/canvas/DOMPath.idl:
319         The previous syntax was working because the bindings was generating an early
320         return if addPath() was called with only one parameter, calling the
321         implementation method with only 1 parameter. However, since we no longer
322         generate early returns for optional parameters, we now have to use a slightly
323         different syntax to maintain the previous behavior. This is only temporary,
324         I just did not want to deal with SVG tear off types in this patch since they
325         are very special in the bindings generator.
326
327         * page/DOMSelection.idl:
328         The node parameter to extend() was confusingly marked as optional. However,
329         when omitted, it would get translated into null, which would throw an
330         exception since the type is not nullable. Since the specification says 'node'
331         should not be optional, and since there is no behavior change, I dropped
332         the 'optional'. The only web-exposed difference is the message provided with
333         the TypeError that is thrown when called without enough parameters. The new
334         message is more accurate (see rebaselined layout test).
335
336         * svg/SVGMarkerElement.idl:
337         The parameter for setOrientToAngle() was confusingly marked as optional and
338         having a default value of null. However, the bindings would throw a TypeError
339         if called with no parameters or when calling it with null. This is because
340         this is an SVG Tear off type and the bindings always throw when passing null
341         for an SVG Tear off type. I therefore updated the IDL to reflect the actual
342         behavior (no actual behavior change). The new IDL also now matches the spec:
343         http://www.w3.org/TR/SVG2/painting.html#InterfaceSVGMarkerElement
344
345         * svg/SVGSVGElement.idl:
346         Same comments as for SVGMarkerElement. The new IDL matches the actual
347         behavior and is closer to the specification. I added FIXME comments for when
348         it does not match the specification:
349         http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSVGElement
350         I did not change web-exposed behavior in this patch.
351
352         * svg/SVGTextContentElement.idl:
353         Same as above. No actual behavior change.
354
355         * testing/Internals.cpp:
356         * testing/Internals.h:
357         * testing/Internals.idl:
358         * xml/XPathEvaluator.idl:
359
360 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
361
362         [ATK] Expose the value of aria-roledescription via an AtkObject attribute
363         https://bugs.webkit.org/show_bug.cgi?id=146719
364
365         Reviewed by Chris Fleizach.
366
367         The author-provided value is now exposed via an AtkObject attribute.
368
369         Implementation is already covered by aria-roledescription.html. The ATK
370         expectations are slightly different than those for AX API because falling
371         back on the default role description is done by assistive technologies.
372         That this fall back is needed is identified by the lack of an author-
373         provided value. Thus we do not wish to expose the default role description
374         in our implementation.
375
376         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
377         (webkitAccessibleGetAttributes):
378
379 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
380
381         [ATK] accessibility/aria-current-global-attribute.html has been failed since r198303
382         https://bugs.webkit.org/show_bug.cgi?id=155935
383
384         Reviewed by Chris Fleizach.
385
386         In ATK, the text of span elements is typically exposed through the parent
387         element, unless the span has some attribute requiring inclusion in the
388         accessibility tree. We were not checking for the presence of global ARIA
389         attributes (including aria-current), other than describedby and role.
390         The fix is to also check AccessibilityObject::supportsARIAAttributes().
391
392         No new tests. This issue was caught as a result of a failing test.
393
394         * accessibility/atk/AccessibilityObjectAtk.cpp:
395         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
396
397 2016-04-29  Chris Dumez  <cdumez@apple.com>
398
399         [Web IDL] Drop 'any' type handling from CanUseWTFOptionalForParameter()
400         https://bugs.webkit.org/show_bug.cgi?id=157152
401
402         Reviewed by Darin Adler.
403
404         Drop 'any' type handling from CanUseWTFOptionalForParameter(). Always
405         use undefined as default value for parameters of type 'any' unless
406         specified otherwise.
407
408         * Modules/indexeddb/IDBCursor.cpp:
409         (WebCore::IDBCursor::continueFunction): Deleted.
410         * Modules/indexeddb/IDBCursor.h:
411         * Modules/indexeddb/IDBObjectStore.cpp:
412         (WebCore::IDBObjectStore::add): Deleted.
413         (WebCore::IDBObjectStore::putOrAdd): Deleted.
414         * Modules/indexeddb/IDBObjectStore.h:
415         * bindings/scripts/CodeGeneratorJS.pm:
416
417         (WillConvertUndefinedToDefaultParameterValue):
418         Fix optimization for optional DOMString attributes whose default value
419         is the string "undefined". I also added bindings test coverage for it.
420
421         (GenerateParametersCheck):
422         (CanUseWTFOptionalForParameter): Deleted.
423         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
424         (webkit_dom_test_obj_method_with_optional_string_is_undefined):
425         (webkit_dom_test_obj_method_with_optional_any):
426         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
427         * bindings/scripts/test/JS/JSTestObj.cpp:
428         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
429         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
430         * bindings/scripts/test/ObjC/DOMTestObj.h:
431         * bindings/scripts/test/ObjC/DOMTestObj.mm:
432         (-[DOMTestObj methodWithOptionalStringIsUndefined:]):
433         (-[DOMTestObj methodWithOptionalAny:]):
434         * bindings/scripts/test/TestObj.idl:
435         * testing/Internals.h:
436
437 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
438
439         AX: [ATK] Expose elements with ARIA's "text" role
440         https://bugs.webkit.org/show_bug.cgi?id=157160
441
442         Reviewed by Chris Fleizach.
443
444         WebCore Accessibility's StaticTextRole is used for exposed RenderText
445         objects and for the ARIA "text" role. The former should be folded into
446         the parent element; the latter should not be, but was. Now we check to
447         see which type we have when building the accessibility tree. Also map
448         the "text" role to ATK_ROLE_STATIC.
449
450         We already have sufficient test coverage. Three previously-failing tests
451         are now passing.
452
453         * accessibility/atk/AccessibilityObjectAtk.cpp:
454         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
455         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
456         (atkRole):
457
458 2016-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
459
460         [FreeType] ASSERTION FAILED: !lookupForWriting(Extractor::extract(entry)).second in FontCache::getVerticalData()
461         https://bugs.webkit.org/show_bug.cgi?id=157132
462
463         Reviewed by Darin Adler.
464
465         I've noticed that some tests fail randomly in the GTK+ debug bot due to an assertion in HashMap when getting
466         vertical data from the FontCache. I don't know exactly what's wrong, but looks like a problem with the
467         FontVerticalDataCache hash traits implementation. Looking at the code, I've realized that we could simplify
468         everything by reusing the FontDataCache hash and traits, since we are actually using the
469         FontPlatformData::hash() in the end in both cases. Also, I don't see why we need to get the vertical data from
470         the FontPlatformData while it's actually cached by the font cache. We could just use the FontCache directly
471         passing only the FontPlatformData. These changes seem to fix the crashes and make the code a lot simpler.
472
473         * platform/graphics/Font.cpp:
474         (WebCore::Font::Font): Use FontCache::verticalData().
475         * platform/graphics/FontCache.cpp:
476         (WebCore::fontVerticalDataCache):
477         (WebCore::FontCache::verticalData):
478         (WebCore::FontCache::purgeInactiveFontData): Also remove the cached vertical data when removing a font.
479         (WebCore::FontCache::invalidate): Clear also the vertical data.
480         * platform/graphics/FontCache.h:
481         * platform/graphics/FontPlatformData.h:
482         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
483         (WebCore::FontPlatformData::openTypeTable): Deleted.
484         * platform/graphics/opentype/OpenTypeVerticalData.h: Remove the m_inFontCache member that is now unused.
485
486 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
487
488         Remove UsePointersEvenForNonNullableObjectArguments keyword
489         https://bugs.webkit.org/show_bug.cgi?id=156844
490
491         Reviewed by Darin Adler.
492
493         No change of behavior.
494
495         * bindings/scripts/CodeGenerator.pm:
496         (ShouldPassWrapperByReference): Removed UsePointersEvenForNonNullableObjectArguments support.
497         * bindings/scripts/IDLAttributes.txt: Removed UsePointersEvenForNonNullableObjectArguments.
498
499 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
500
501         FetchResponse should return a ReadableStream even if disturbed
502         https://bugs.webkit.org/show_bug.cgi?id=156911
503
504         Reviewed by Darin Adler.
505
506         Covered by rebased test.
507
508         * Modules/fetch/FetchResponse.cpp:
509         (WebCore::FetchResponse::createReadableStreamSource): Asserting in case response is disturbed.
510         * bindings/js/JSFetchResponseCustom.cpp:
511         (WebCore::JSFetchResponse::body): Creating a locked empty readable stream if response is disturbed.
512         * bindings/js/ReadableStreamController.cpp:
513         (WebCore::createReadableStream): Constructing a readable stream even if source is null.
514         (WebCore::getReadableStreamReader): Retrieving the reader from a readable stream. Stream must not be locked.
515         * bindings/js/ReadableStreamController.h:
516
517 2016-04-29  Yoav Weiss  <yoav@yoav.ws>
518
519         Move ResourceTiming behind a runtime flag
520         https://bugs.webkit.org/show_bug.cgi?id=157133
521
522         Reviewed by Alex Christensen.
523
524         Move the ResourceTiming API from being behind a build time flag to be behind an
525         off-by-default runtime flag, that can be turned on using internals.
526
527         Tests: fast/dom/Window/window-properties-performance-resource-timing.html
528                http/tests/performance/performance-resource-timing-entries.html
529
530         * DerivedSources.make: Added idl files for PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming.
531         * WebCore.xcodeproj/project.pbxproj: Added the various Performance* files to the project.
532         * bindings/generic/RuntimeEnabledFeatures.cpp: Added ResourceTiming as a runtime flag.
533         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
534         * bindings/generic/RuntimeEnabledFeatures.h: Added ResourceTiming as a runtime flag.
535         (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
536         (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
537         * bindings/js/JSPerformanceEntryCustom.cpp: Removed #if for ResourceTiming. Added build flag around UserTiming related h files.
538         (WebCore::toJS): Deleted.
539         * dom/EventNames.h: Renamed webkitresourcetimingbufferfull to resourcetimingbufferfull.
540         * loader/DocumentThreadableLoader.cpp: Replace #if for ResourceTiming with runtime flag.
541         (WebCore::DocumentThreadableLoader::loadRequest):
542         * loader/ResourceLoadNotifier.cpp: Replace #if for ResourceTiming with runtime flag.
543         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
544         * loader/cache/CachedResourceLoader.cpp: Replace #if for ResourceTiming with runtime flag.
545         (WebCore::CachedResourceLoader::revalidateResource):
546         (WebCore::CachedResourceLoader::loadResource):
547         (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation):
548         (WebCore::CachedResourceLoader::loadDone):
549         * loader/cache/CachedResourceLoader.h: Remove #if for ResourceTiming.
550         * page/Performance.cpp: Remove #if for ResourceTiming.
551         (WebCore::Performance::Performance): Removed #if for ResourceTiming related initialization.
552         (WebCore::Performance::webkitGetEntries): Renamed to getEntries.
553         (WebCore::Performance::webkitGetEntriesByType): Renamed to getEntriesByType.
554         (WebCore::Performance::webkitGetEntriesByName): Renamed to getEntriesByName.
555         * page/Performance.h: Remove #if for ResourceTiming.
556         * page/Performance.idl: Replace #if for ResourceTiming with runtime flag.
557         * page/PerformanceEntry.cpp: Remove the PERFORMANCE_TIMELINE build flag.
558         * page/PerformanceEntry.h: Remove the PERFORMANCE_TIMELINE build flag.
559         * page/PerformanceEntry.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
560         * page/PerformanceEntryList.cpp: Remove the PERFORMANCE_TIMELINE build flag.
561         * page/PerformanceEntryList.h: Remove the PERFORMANCE_TIMELINE build flag.
562         * page/PerformanceEntryList.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
563         * page/PerformanceResourceTiming.cpp: Remove the RESOURCE_TIMING build flag.
564         * page/PerformanceResourceTiming.h: Remove the RESOURCE_TIMING build flag.
565         * page/PerformanceResourceTiming.idl: Replace the RESOURCE_TIMING build flag with runtime flag.
566         * testing/Internals.cpp: Add a method that enables ResourceTiming.
567         (WebCore::Internals::setResourceTimingSupport):
568         * testing/Internals.h: Add a method that enables ResourceTiming.
569         * testing/Internals.idl: Add a method that enables ResourceTiming.
570
571 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
572
573         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaStream interfaces
574         https://bugs.webkit.org/show_bug.cgi?id=156905
575
576         Reviewed by Darin Adler.
577
578         Removing UsePointersEvenForNonNullableObjectArguments from MediaStream, RTCPeerConnection and RTCRtpSender.
579         Updating methods to take references and making some related refactoring.
580
581         Test: fast/mediastream/MediaStream-add-remove-null-undefined-tracks.html
582         Changes also covered by updated tests.
583
584         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
585         (WebCore::MediaEndpointPeerConnection::createOfferTask):
586         * Modules/mediastream/MediaStream.cpp:
587         (WebCore::MediaStream::create):
588         (WebCore::MediaStream::addTrack):
589         (WebCore::MediaStream::removeTrack):
590         (WebCore::MediaStream::didAddTrack):
591         (WebCore::MediaStream::didRemoveTrack):
592         (WebCore::MediaStream::internalAddTrack):
593         (WebCore::MediaStream::internalRemoveTrack):
594         * Modules/mediastream/MediaStream.h:
595         * Modules/mediastream/MediaStream.idl:
596         * Modules/mediastream/RTCDataChannel.cpp:
597         (WebCore::RTCDataChannel::send):
598         * Modules/mediastream/RTCDataChannel.h:
599         * Modules/mediastream/RTCDataChannel.idl:
600         * Modules/mediastream/RTCPeerConnection.cpp:
601         (WebCore::RTCPeerConnection::addTrack):
602         (WebCore::RTCPeerConnection::removeTrack):
603         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
604         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
605         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
606         (WebCore::RTCPeerConnection::privateGetStats):
607         (WebCore::RTCPeerConnection::queuedCreateOffer): Deleted.
608         (WebCore::RTCPeerConnection::localDescription): Deleted.
609         (WebCore::RTCPeerConnection::currentLocalDescription): Deleted.
610         (WebCore::RTCPeerConnection::remoteDescription): Deleted.
611         (WebCore::RTCPeerConnection::currentRemoteDescription): Deleted.
612         (WebCore::RTCPeerConnection::signalingState): Deleted.
613         (WebCore::RTCPeerConnection::createDataChannel): Deleted.
614         (WebCore::RTCPeerConnection::close): Deleted.
615         * Modules/mediastream/RTCPeerConnection.h:
616         * Modules/mediastream/RTCPeerConnection.idl:
617         * Modules/mediastream/RTCRtpReceiver.cpp:
618         (WebCore::RTCRtpReceiver::RTCRtpReceiver):
619         * Modules/mediastream/RTCRtpReceiver.h:
620         (WebCore::RTCRtpReceiver::create):
621         * Modules/mediastream/RTCRtpSender.cpp:
622         (WebCore::RTCRtpSender::RTCRtpSender):
623         (WebCore::RTCRtpSender::replaceTrack):
624         * Modules/mediastream/RTCRtpSender.h:
625         (WebCore::RTCRtpSender::create):
626         * Modules/mediastream/RTCRtpSender.idl:
627         * Modules/mediastream/RTCRtpSenderReceiverBase.h:
628         (WebCore::RTCRtpSenderReceiverBase::track):
629         (WebCore::RTCRtpSenderReceiverBase::RTCRtpSenderReceiverBase):
630
631 2016-04-28  Daniel Bates  <dabates@apple.com>
632
633         Remove extraneous space characters from parameter list for RenderListBox::paintItem()
634         that were added in r200190 (https://bugs.webkit.org/show_bug.cgi?id=157117).
635
636         * rendering/RenderListBox.h:
637
638 2016-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
639
640         AX: [ATK] Expose subscript and superscript format style groups using ATK_ROLE_SUBSCRIPT and ATK_ROLE_SUPERSCRIPT
641         https://bugs.webkit.org/show_bug.cgi?id=157158
642
643         Reviewed by Chris Fleizach.
644
645         r200214 caused the sup and sub elements to be exposed as ATK_ROLE_STATIC.
646         While this exposure is much better than folding the text into the parent
647         element, ATK has roles for subscript and superscript, so use them instead.
648
649         The roles-exposed.html and roles-computedRoleString.html tests were updated
650         to reflect the new behavior.
651
652         * accessibility/AccessibilityObject.cpp:
653         (WebCore::AccessibilityObject::isSubscriptStyleGroup):
654         (WebCore::AccessibilityObject::isSuperscriptStyleGroup):
655         * accessibility/AccessibilityObject.h:
656         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
657         (atkRole):
658
659 2016-04-28  Zalan Bujtas  <zalan@apple.com>
660
661         Content disappears on mouse over.
662         https://bugs.webkit.org/show_bug.cgi?id=157073
663         <rdar://problem/24389168>
664
665         Reviewed by Simon Fraser.
666
667         When a redundant inlinebox is found after constructing the line, we remove it from the tree.
668         The remove operation marks the ancestor tree dirty (and this newly constructed line is supposed to be clean).
669         This patch resets this dirty flag on the boxes all the way up to the rootlinebox.
670         Previously we only cleared the rootinlinebox and we ended up with dirty inlineflowboxes.
671
672         Test: fast/text/text-node-remains-dirty-after-calling-surroundContents.html
673
674         * rendering/BidiRun.h:
675         (WebCore::BidiRun::setBox):
676         * rendering/RenderBlockFlow.h:
677         * rendering/RenderBlockLineLayout.cpp:
678         (WebCore::RenderBlockFlow::constructLine):
679         (WebCore::RenderBlockFlow::removeLineBoxIfNeeded):
680         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine):
681         * rendering/RenderBox.cpp:
682         (WebCore::RenderBox::positionLineBox): Deleted.
683         * rendering/RenderText.cpp:
684         (WebCore::RenderText::setText):
685         (WebCore::RenderText::positionLineBox): Deleted.
686
687 2016-04-28  John Wilander  <wilander@apple.com>
688
689         Allow non-standard HTTP headers in WebSocket handshake
690         https://bugs.webkit.org/show_bug.cgi?id=157157
691
692         Reviewed by Brent Fulgham.
693
694         No new tests since https://bugs.webkit.org/show_bug.cgi?id=157095
695         tests that non-standard headers are allowed.
696
697         * Modules/websockets/WebSocketHandshake.cpp:
698         (WebCore::WebSocketHandshake::readHTTPHeaders):
699             Changed from fail to allow for unrecognized headers.
700             This was the behavior before https://bugs.webkit.org/show_bug.cgi?id=155602.
701         * platform/network/HTTPHeaderNames.in:
702             Removed whitelisted legacy headers since we now allow all non-standard headers.
703
704 2016-04-27  Brent Fulgham  <bfulgham@apple.com>
705
706         Make sure we don't mishandle HTMLFrameOwnerElement lifecycle
707         https://bugs.webkit.org/show_bug.cgi?id=157040
708
709         Reviewed by Chris Dumez.
710
711         Protect a couple of sites where event handling could result in the owning frame
712         being destroyed during execution.
713
714         Tested by fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash.html.
715
716         * inspector/InspectorDOMAgent.cpp:
717         (WebCore::InspectorDOMAgent::didCommitLoad):
718         * rendering/RenderLayer.cpp:
719         (WebCore::RenderLayer::scrollRectToVisible):
720
721 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
722
723         [css-grid] Add CSS Grid Layout runtime flag
724         https://bugs.webkit.org/show_bug.cgi?id=157134
725
726         Reviewed by Simon Fraser.
727
728         Add CSS Grid Layout runtime flag enabled by default.
729         Disable parsing of CSS Grid Layout properties
730         if the runtime flag is not enabled.
731         Expose runtime flag through internals to verify that
732         it's working as expected.
733
734         Test: fast/css-grid-layout/grid-disable.html
735
736         * bindings/generic/RuntimeEnabledFeatures.cpp:
737         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
738         * bindings/generic/RuntimeEnabledFeatures.h:
739         (WebCore::RuntimeEnabledFeatures::setCSSGridLayoutEnabled):
740         (WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
741         * css/CSSParser.cpp:
742         (WebCore::CSSParserContext::CSSParserContext):
743         (WebCore::operator==):
744         (WebCore::isValidKeywordPropertyAndValue):
745         (WebCore::CSSParser::parseValue):
746         (WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition):
747         (WebCore::CSSParser::parseGridPosition):
748         (WebCore::CSSParser::parseGridItemPositionShorthand):
749         (WebCore::CSSParser::parseGridGapShorthand):
750         (WebCore::CSSParser::parseGridTemplateColumns):
751         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
752         (WebCore::CSSParser::parseGridTemplateShorthand):
753         (WebCore::CSSParser::parseGridShorthand):
754         (WebCore::CSSParser::parseGridAreaShorthand):
755         (WebCore::CSSParser::parseSingleGridAreaLonghand):
756         (WebCore::CSSParser::parseGridLineNames):
757         (WebCore::CSSParser::parseGridTrackList):
758         (WebCore::CSSParser::parseGridTrackRepeatFunction):
759         (WebCore::CSSParser::parseGridTrackSize):
760         (WebCore::CSSParser::parseGridBreadth):
761         (WebCore::CSSParser::parseGridAutoFlow):
762         (WebCore::CSSParser::parseGridTemplateAreasRow):
763         (WebCore::CSSParser::parseGridTemplateAreas):
764         (WebCore::CSSParser::iscSSGridLayoutEnabled):
765         * css/CSSParser.h:
766         * css/CSSParserMode.h:
767         * dom/Document.cpp:
768         (WebCore::Document::isCSSGridLayoutEnabled):
769         * dom/Document.h:
770         * testing/Internals.cpp:
771         (WebCore::Internals::setCSSGridLayoutEnabled):
772         * testing/Internals.h:
773         * testing/Internals.idl:
774
775 2016-04-28  Chris Fleizach  <cfleizach@apple.com>
776
777         AX: superscript content exposed as plain text; VoiceOver does not speak or pause to make this understandable
778         https://bugs.webkit.org/show_bug.cgi?id=157122
779         <rdar://problem/21231487>
780
781         Reviewed by Daniel Bates.
782
783         Expose role types for subscript and superscript.
784
785         Modified: accessibility/mac/subroles-for-formatted-groups.html
786
787         * accessibility/AccessibilityObject.cpp:
788         (WebCore::AccessibilityObject::isStyleFormatGroup):
789         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
790         (-[WebAccessibilityObjectWrapper subrole]):
791
792 2016-04-28  Brady Eidson  <beidson@apple.com>
793
794         inspector/indexeddb/requestDatabaseNames.html is flaky on Mac.
795         https://bugs.webkit.org/show_bug.cgi?id=157141
796
797         Reviewed by Alex Christensen.
798
799         Test: inspector/indexeddb/deleteDatabaseNamesWithSpace.html
800
801         * platform/FileSystem.cpp:
802         (WebCore::decodeFromFilename): Advance iterator after decoding.
803
804 2016-04-28  Dan Bernstein  <mitz@apple.com>
805
806         <rdar://problem/25986324> WebKit build broken with error: undeclared selector 'childViewControllerForWhitePointAdaptivityStyle'
807
808         Fixed the build by removing use of API that no longer does anything.
809
810         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
811         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Revert to using a plain UIViewController.
812         (createFullScreenVideoRootViewControllerClass): Deleted.
813         (allocWebFullScreenVideoRootViewControllerInstance): Deleted.
814
815 2016-04-28  Brady Eidson  <beidson@apple.com>
816
817         Modern IDB: Reimplement Web Inspector code that was tied to Legacy IDB.
818         https://bugs.webkit.org/show_bug.cgi?id=154686
819
820         Reviewed by Alex Christensen.
821
822         No new tests (Inspector folks will have to write them if they're possible).
823
824         * inspector/InspectorIndexedDBAgent.cpp: Reimplement missing functionality mostly with code that was 
825           removed in http://trac.webkit.org/changeset/197131/trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
826
827 2016-04-28  Daniel Bates  <dabates@apple.com>
828
829         Fix the Apple Internal OS X build
830
831         * platform/graphics/mac/PDFDocumentImageMac.mm:
832         (WebCore::PDFDocumentImage::drawPDFPage): Ignore deprecation warning for -[PDFPage drawWithBox:].
833
834 2016-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
835
836         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaSource interfaces
837         https://bugs.webkit.org/show_bug.cgi?id=156904
838
839         Reviewed by Darin Adler.
840
841         MediaSource::addSourceBuffer will now throw a TypeError if a null parameter is passed.
842         MediaSource::removeSourceBuffer will now throw a TypeError if a null parameter is passed.
843         SourceBuffer::appendBuffer will now throw a TypeError if a null parameter is passed.
844
845         Did some refactoring to use more references.
846
847         Covered by updated test.
848
849         * Modules/mediasource/MediaSource.cpp:
850         (WebCore::MediaSource::endOfStream):
851         (WebCore::MediaSource::addSourceBuffer):
852         (WebCore::MediaSource::removeSourceBuffer):
853         * Modules/mediasource/MediaSource.h:
854         * Modules/mediasource/MediaSource.idl:
855         * Modules/mediasource/SourceBuffer.cpp:
856         (WebCore::SourceBuffer::appendBuffer):
857         * Modules/mediasource/SourceBuffer.h:
858         * Modules/mediasource/SourceBuffer.idl:
859         * Modules/mediasource/SourceBufferList.cpp:
860         (WebCore::SourceBufferList::add):
861         (WebCore::SourceBufferList::remove):
862         * Modules/mediasource/SourceBufferList.h:
863
864 2016-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
865
866         Drop [UsePointersEvenForNonNullableObjectArguments] from Node
867         https://bugs.webkit.org/show_bug.cgi?id=156978
868
869         Reviewed by Chris Dumez.
870
871         No change of behavior.
872
873         * dom/Node.idl: Marking some parameters nullable.
874
875 2016-04-27  Ada Chan  <adachan@apple.com>
876
877         Set overflow: hidden on ::-webkit-media-controls in mediaControlsApple.css
878         https://bugs.webkit.org/show_bug.cgi?id=157110
879
880         Reviewed by Eric Carlson.
881
882         Test: fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls.html
883
884         This matches what we do in mediaControlsiOS.css.
885
886         * Modules/mediacontrols/mediaControlsApple.css:
887         (::-webkit-media-controls):
888
889 2016-04-28  Chris Dumez  <cdumez@apple.com>
890
891         [Web IDL] Specify default values for optional parameters of type 'DOMString'
892         https://bugs.webkit.org/show_bug.cgi?id=157116
893
894         Reviewed by Darin Adler.
895
896         Specify default values for optional parameters of type 'DOMString' so
897         that this default value is used if the parameter is either omitted or
898         undefined. For parameters of type DOMString and that are not nullable,
899         the bindings generator now uses the null string as implicit default
900         value (unless explicitely specified otherwise in the IDL). This
901         simplifies the IDL a little and makes it a bit less confusing (it is
902         a bit weird to see something like "optional DOMString param = null",
903         considering the parameter is not nullable). I also think it makes
904         more sense to use the null String() rather than Optional<String> in
905         this case.
906
907         No new tests, existing tests were rebaselined.
908
909         * Modules/encryptedmedia/MediaKeys.idl:
910         * Modules/indexeddb/IDBDatabase.idl:
911         * Modules/indexeddb/IDBIndex.h:
912         * Modules/indexeddb/IDBIndex.idl:
913         * Modules/indexeddb/IDBObjectStore.cpp:
914         (WebCore::IDBObjectStore::openCursor): Deleted.
915         * Modules/indexeddb/IDBObjectStore.h:
916         * Modules/indexeddb/IDBObjectStore.idl:
917         * Modules/speech/SpeechSynthesisUtterance.idl:
918         * Modules/websockets/WebSocket.idl:
919         * bindings/scripts/CodeGeneratorJS.pm:
920         (GenerateParametersCheck):
921         (CanUseWTFOptionalForParameter): Deleted.
922         * bindings/scripts/test/JS/JSTestObj.cpp:
923         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
924         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
925         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue): Deleted.
926         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
927         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
928         * bindings/scripts/test/TestNamedConstructor.idl:
929         * css/FontFaceSet.cpp:
930         * css/FontFaceSet.h:
931         * css/FontFaceSet.idl:
932         * css/WebKitCSSMatrix.idl:
933         * dom/Comment.idl:
934         * dom/DOMImplementation.idl:
935         * dom/DataTransfer.cpp:
936         (WebCore::DataTransfer::clearData):
937         (WebCore::DataTransfer::getData): Deleted.
938         * dom/DataTransfer.h:
939         * dom/Document.idl:
940         * dom/Text.idl:
941         * fileapi/FileReader.cpp:
942         (WebCore::FileReader::readAsDataURL): Deleted.
943         * fileapi/FileReader.h:
944         * fileapi/FileReaderSync.h:
945         * fileapi/FileReaderSync.idl:
946         * html/HTMLAudioElement.idl:
947         * html/HTMLInputElement.idl:
948
949         * html/HTMLMediaElement.cpp:
950         (WebCore::HTMLMediaElement::addTextTrack):
951         Throw a TypeError if the 'kind' parameter is not a valid string in the
952         TextTrackKind enum:
953         https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
954
955         We previously threw a SYNTAX_ERR instead of a TypeError in such case,
956         which was not correct as per Web IDL specification.
957
958         * html/HTMLMediaElement.h:
959         * html/HTMLMediaElement.idl:
960         * html/HTMLOptionElement.idl:
961         * html/HTMLTextAreaElement.idl:
962         * html/canvas/CanvasRenderingContext2D.cpp:
963         (WebCore::CanvasRenderingContext2D::setShadow):
964         * html/canvas/CanvasRenderingContext2D.h:
965         * page/Performance.idl:
966
967 2016-04-28  Antonio Gomes  <tonikitoo@webkit.org>
968
969         Factor out the "paint item" logic in RenderListBox into a helper
970         https://bugs.webkit.org/show_bug.cgi?id=157117
971
972         Reviewed by Daniel Bates.
973
974         Patch factors out the duplicated painting logic in RenderListBox::paintObject()
975         into a member function named paintItem.
976
977         This is in preparation for bug 156590.
978         No new tests, since there is no behavior change.
979
980         * rendering/RenderListBox.cpp:
981         (WebCore::RenderListBox::paintItem):
982         (WebCore::RenderListBox::paintObject):
983         * rendering/RenderListBox.h:
984
985 2016-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
986
987         AX: [ATK] We need to be smarter about flattening and the accessible text implementation
988         https://bugs.webkit.org/show_bug.cgi?id=144639
989
990         Reviewed by Chris Fleizach.
991
992         Defer to WebCore Accessibility more regarding when to include anonymous blocks in the
993         accessibility tree. Explicitly flatten menu items, headings, list items, and paragraphs
994         in order to preserve the expected platform behavior for backwards compatibility. Also
995         map anonymous table parts to DivRole rather than GroupRole for GTK and EFL because ATK
996         has separate roles for generic text block elements and other generic containers.
997
998         Tests: accessibility/gtk/nested-block-element-children.html
999                accessibility/gtk/spans-paragraphs-and-divs-tree.html
1000
1001         * accessibility/AccessibilityRenderObject.cpp:
1002         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1003         * accessibility/atk/AccessibilityObjectAtk.cpp:
1004         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
1005
1006 2016-04-28  Frederic Wang  <fred.wang@free.fr>
1007
1008         RenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from getDisplayStyleLargeOperator
1009         https://bugs.webkit.org/show_bug.cgi?id=156910
1010
1011         Reviewed by Alejandro G. Castro.
1012
1013         No new tests, the behavior is not changed.
1014
1015         * rendering/mathml/RenderMathMLOperator.cpp:
1016         (WebCore::RenderMathMLOperator::italicCorrection): We do not need to pass m_textContent to
1017         getDisplayStyleLargeOperator.
1018         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): We use getBaseGlyph and do
1019         not pass m_textContent to getDisplayStyleLargeOperator or findStretchyData.
1020         (WebCore::RenderMathMLOperator::getBaseGlyph): Introduce a helper function to retrieve the
1021         base glyph and do some validity checks.
1022         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): We remove the character
1023         parameter as it is always m_textContent.
1024         We use getBaseGlyph and replace primaryFont with baseGlyph.font.
1025         (WebCore::RenderMathMLOperator::findStretchyData): Ditto.
1026         (WebCore::RenderMathMLOperator::updateStyle): We do not pass m_textContent to
1027         getDisplayStyleLargeOperator or findStretchyData.
1028         * rendering/mathml/RenderMathMLOperator.h: Declare getBaseGlyph and remove the parameter
1029         from getDisplayStyleLargeOperator and findStretchyData.
1030
1031 2016-04-28  Commit Queue  <commit-queue@webkit.org>
1032
1033         Unreviewed, rolling out r200185.
1034         https://bugs.webkit.org/show_bug.cgi?id=157131
1035
1036         Bad temporary file added unintentionally (Requested by fredw
1037         on #webkit).
1038
1039         Reverted changeset:
1040
1041         "RenderMathMLOperator refactoring: introduce getBaseGlyph and
1042         remove parameter from getDisplayStyleLargeOperator"
1043         https://bugs.webkit.org/show_bug.cgi?id=156910
1044         http://trac.webkit.org/changeset/200185
1045
1046 2016-04-28  Frederic Wang  <fred.wang@free.fr>
1047
1048         RenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from getDisplayStyleLargeOperator
1049         https://bugs.webkit.org/show_bug.cgi?id=156910
1050
1051         Reviewed by Alejandro G. Castro.
1052
1053         No new tests, the behavior is not changed.
1054
1055         * rendering/mathml/RenderMathMLOperator.cpp:
1056         (WebCore::RenderMathMLOperator::italicCorrection): We do not need to pass m_textContent
1057         to getDisplayStyleLargeOperator.
1058         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): We use getBaseGlyph and do
1059         not pass m_textContent to getDisplayStyleLargeOperator or findStretchyData.
1060         (WebCore::RenderMathMLOperator::getBaseGlyph): Introduce a helper function to retrieve the
1061         base glyph and do some validity checks.
1062         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): We remove the character
1063         parameter as it is always m_textContent.
1064         We use getBaseGlyph and replace primaryFont with baseGlyph.font.
1065         (WebCore::RenderMathMLOperator::findStretchyData): Ditto.
1066         (WebCore::RenderMathMLOperator::updateStyle): We do not pass m_textContent to
1067         getDisplayStyleLargeOperator or findStretchyData.
1068         * rendering/mathml/RenderMathMLOperator.h: Declare getBaseGlyph and remove the parameter
1069         from getDisplayStyleLargeOperator and findStretchyData.
1070
1071 2016-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1072
1073         REGRESSION(r199659): Web Process crash when RenderTheme::adjustMenuListStyle is called with a null element
1074         https://bugs.webkit.org/show_bug.cgi?id=157127
1075
1076         Reviewed by Sergio Villar Senin.
1077
1078         This happens for example with tests fast/css/appearance-with-pseudo-elements-in-quirks-mode.html and
1079         fast/css/appearance-with-pseudo-elements.html.
1080
1081         * rendering/RenderThemeGtk.cpp:
1082         (WebCore::RenderThemeGtk::adjustMenuListStyle): Do not change the style color if the given element is nullptr.
1083
1084 2016-04-28  Sergio Villar Senin  <svillar@igalia.com>
1085
1086         [css-grid] Store auto-repeat information in style
1087         https://bugs.webkit.org/show_bug.cgi?id=157097
1088
1089         Reviewed by Darin Adler.
1090
1091         This is the second step to implement auto-repeat. This patch provides the necessary
1092         machinery to store the auto-repeat data extracted by the parser in the RenderStyle class. We
1093         are not doing anything with that information yet, it will be used later to compute the
1094         number of auto-repeat tracks in a follow up patch.
1095
1096         No new tests required as there is no change in behavior yet (we're just storing the info we
1097         already get from the parser).
1098
1099         * css/CSSComputedStyleDeclaration.cpp:
1100         (WebCore::valueForGridTrackList): Check also that the auto-repeat list of tracks is empty.
1101         * css/StyleBuilderConverter.h:
1102         (WebCore::createGridLineNamesList): Refactored from createGridTrackList.
1103         (WebCore::StyleBuilderConverter::createGridTrackList): Extract auto-repeat data from the
1104         parser. Also gathered all the out arguments in a single new struct called TracksData.
1105         * css/StyleBuilderCustom.h: Added new macro SET_TRACKS_DATA which properly sets the info
1106         from TracksData struct into style.
1107         (WebCore::StyleBuilderCustom::applyValueWebkitGridTemplateColumns): Store auto-repeat data
1108         in RenderStyle.
1109         (WebCore::StyleBuilderCustom::applyValueWebkitGridTemplateRows): Ditto.
1110         * rendering/style/RenderStyle.h: Add methods and attributes for auto-repeat data.
1111         * rendering/style/RenderStyleConstants.h: New AutoRepeatType enumerated type.
1112         * rendering/style/StyleGridData.cpp:
1113         (WebCore::StyleGridData::StyleGridData): Add auto-repeat data.
1114         * rendering/style/StyleGridData.h:
1115         (WebCore::StyleGridData::operator==): Check also auto-repeat data.
1116
1117 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
1118
1119         [css-grid] Fix alignment with content distribution
1120         https://bugs.webkit.org/show_bug.cgi?id=156623
1121
1122         Reviewed by Sergio Villar Senin.
1123
1124         We were only subtracting the distribution offset for items spanning
1125         several tracks, but not for items in a single cell.
1126         We should actually subtract the offset in that situation too,
1127         the same that we do for the grid gaps.
1128
1129         Test: fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html
1130
1131         * rendering/RenderGrid.cpp:
1132         (WebCore::RenderGrid::columnAxisOffsetForChild): Subtract distribution
1133         offset like we do for gaps.
1134         (WebCore::RenderGrid::rowAxisOffsetForChild): Ditto.
1135
1136 2016-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1137
1138         [GTK] Overlay scrollbars with steppers enabled render incorrectly
1139         https://bugs.webkit.org/show_bug.cgi?id=156988
1140
1141         Reviewed by Michael Catanzaro.
1142
1143         Fix rendering of scrollbars when using GTK+ themes having stepper buttons.
1144
1145         * platform/gtk/RenderThemeGadget.cpp:
1146         (WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget): Receive the box orientation as constructor parameter.
1147         (WebCore::RenderThemeBoxGadget::preferredSize): Fix the preferred size calculation taking into account the box orientation.
1148         (WebCore::RenderThemeScrollbarGadget::renderStepper): New method to render scrollbar steppers.
1149         * platform/gtk/RenderThemeGadget.h:
1150         (WebCore::RenderThemeGadget::context): Make this public instead of protected.
1151         * platform/gtk/ScrollAnimatorGtk.cpp:
1152         (WebCore::ScrollAnimatorGtk::updateOverlayScrollbarsOpacity): Invalidate the whole scrollbars instead of just
1153         the thumb when opacity changes, because themes can actually render the trough or even stepper buttons when in
1154         indicator mode too.
1155         * platform/gtk/ScrollbarThemeGtk.cpp:
1156         (WebCore::ScrollbarThemeGtk::hasButtons): Properly implement this method instead of returning true unconditionally.
1157         (WebCore::contentsGadgetForLayout): Pass orientation to RenderThemeBoxGadget constructor.
1158         (WebCore::ScrollbarThemeGtk::trackRect): Fix the calculation of the track rect taking stepper buttons into account.
1159         (WebCore::ScrollbarThemeGtk::backButtonRect): Fix the calculation of the stepper button rectangle.
1160         (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
1161         (WebCore::ScrollbarThemeGtk::paint): Use RenderThemeScrollbarGadget::renderStepper() to render the stepper
1162         buttons, and fix the calculation of the steppers button rectangle.
1163         (WebCore::ScrollbarThemeGtk::handleMousePressEvent): Handle clicks on stepper buttons.
1164         (WebCore::ScrollbarThemeGtk::scrollbarThickness): Fix the calculation of the scrollbar thickness.
1165         (WebCore::ScrollbarThemeGtk::minimumThumbLength): Pass orientation to RenderThemeBoxGadget constructor.
1166         * platform/gtk/ScrollbarThemeGtk.h:
1167         * rendering/RenderThemeGtk.cpp:
1168         (WebCore::menuListColor): Ditto.
1169         (WebCore::RenderThemeGtk::popupInternalPaddingBox): Ditto.
1170         (WebCore::RenderThemeGtk::paintMenuList): Ditto.
1171
1172 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
1173
1174         SVG SMIL animations run at less than 60fps
1175         https://bugs.webkit.org/show_bug.cgi?id=157119
1176         rdar://problem/25971304
1177
1178         Reviewed by Tim Horton.
1179         
1180         If you re-fetch current time while doing animation computations you're gonna have
1181         a bad time.
1182         
1183         More specifically, SMILTimeContainer::startTimer() re-fetched elapsedTime() when
1184         computing the delay for the next timer fire, then clamped to 16.667ms, so the timer
1185         would actually be scheduled at intervals greater than desired, causing a ~54fps framerate.
1186         
1187         Fix by using the elapsedTime fetched at the start of animation processing.
1188
1189         Tested by iOS content-animation performance tests.
1190
1191         * svg/SVGSVGElement.cpp:
1192         (WebCore::SVGSVGElement::SVGSVGElement): Just cleanup.
1193         * svg/animation/SMILTimeContainer.cpp:
1194         (WebCore::SMILTimeContainer::notifyIntervalsChanged):
1195         (WebCore::SMILTimeContainer::resume):
1196         (WebCore::SMILTimeContainer::startTimer):
1197         (WebCore::SMILTimeContainer::updateAnimations):
1198         * svg/animation/SMILTimeContainer.h:
1199
1200 2016-04-27  Brady Eidson  <beidson@apple.com>
1201
1202         Build fix followup to r200163
1203         
1204         Unreviewed.
1205
1206         * platform/efl/FileSystemEfl.cpp:
1207         (WebCore::stringFromFileSystemRepresentation): At least stub this out for now until EFL folks can do better.
1208
1209 2016-04-27  Saam barati  <sbarati@apple.com>
1210
1211         Move the implementation of Settings::globalConstRedeclarationShouldThrow into the cpp file
1212         https://bugs.webkit.org/show_bug.cgi?id=157109
1213
1214         Rubber-stamped by Geoffrey Garen.
1215
1216         * page/Settings.cpp:
1217         (WebCore::Settings::networkInterfaceName):
1218         (WebCore::Settings::globalConstRedeclarationShouldThrow):
1219         * page/Settings.h:
1220         (WebCore::Settings::shouldUseHighResolutionTimers):
1221         (WebCore::Settings::backgroundShouldExtendBeyondPage):
1222         (WebCore::Settings::globalConstRedeclarationShouldThrow): Deleted.
1223
1224 2016-04-27  Dean Jackson  <dino@apple.com>
1225
1226         RTL non-native <select> buttons should have arrows on the left
1227         https://bugs.webkit.org/show_bug.cgi?id=157112
1228         <rdar://problem/25894441>
1229
1230         Reviewed by Simon Fraser.
1231
1232         The <select> elements that are completely rendered by WebCore
1233         (i.e. not the native controls) always assumed that they
1234         were left-to-right.
1235
1236         This change allows the button to handle both directions,
1237         swapping the side the little arrows are rendered on, as
1238         well as the padding of the text label.
1239
1240         Test: fast/forms/select-non-native-rendering-direction.html
1241
1242         * rendering/RenderMenuList.cpp:
1243         (RenderMenuList::clientPaddingLeft): This must take into account
1244         the direction of the element.
1245         (RenderMenuList::clientPaddingRight): Ditto.
1246         * rendering/RenderThemeMac.mm: Change the left and right constants
1247         to use the terms before and after.
1248         (WebCore::RenderThemeMac::paintMenuListButtonDecorations): The left
1249         and right positions must take the direction into account, which
1250         means different calculations.
1251         (WebCore::RenderThemeMac::popupInternalPaddingBox): Similarly for
1252         the padding that is used to position the text label.
1253
1254 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
1255
1256         CSS and SVG animations should run at 60fps
1257         https://bugs.webkit.org/show_bug.cgi?id=157113
1258         rdar://problem/24337280
1259         rdar://problem/24337328
1260
1261         Reviewed by Dean Jackson.
1262
1263         For both CSS and SVG animations we used a 0.025s frame interval, which translates to
1264         40fps. That caused these animations to look extra janky compared with accelerated
1265         animations.
1266
1267         So use a 16.667ms frame interval for both.
1268
1269         Tested by content-animation benchmark tests.
1270
1271         * page/animation/AnimationController.cpp:
1272         * svg/animation/SMILTime.h:
1273         * svg/animation/SMILTimeContainer.cpp:
1274         (WebCore::SMILTimeContainer::updateAnimations):
1275         * svg/animation/SVGSMILElement.cpp:
1276         (WebCore::SVGSMILElement::calculateNextProgressTime):
1277
1278 2016-04-27  Brady Eidson  <beidson@apple.com>
1279
1280         Modern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.
1281         https://bugs.webkit.org/show_bug.cgi?id=157072
1282
1283         Reviewed by Alex Christensen.
1284
1285         No new tests (Covered by changes to existing test).
1286
1287         Implement a new "getAllDatabaseNames" call on IDBFactory.
1288         
1289         It is not exposed to the DOM, and is meant solely for internal WebInspector use.
1290
1291         * Modules/indexeddb/DOMWindowIndexedDatabase.h: Export some stuff to WebCoreTestSupport
1292
1293         * Modules/indexeddb/IDBDatabase.cpp:
1294         (WebCore::IDBDatabase::createObjectStore):
1295
1296         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1297         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
1298         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1299
1300         * Modules/indexeddb/IDBFactory.cpp:
1301         (WebCore::IDBFactory::getAllDatabaseNames):
1302         * Modules/indexeddb/IDBFactory.h:
1303
1304         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1305         (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNames):
1306         * Modules/indexeddb/client/IDBConnectionProxy.h:
1307
1308         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1309         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
1310         (WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNames):
1311         * Modules/indexeddb/client/IDBConnectionToServer.h:
1312         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1313
1314         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
1315         (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames):
1316         * Modules/indexeddb/server/IDBConnectionToClient.h:
1317         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
1318
1319         * Modules/indexeddb/server/IDBServer.cpp:
1320         (WebCore::IDBServer::IDBServer::getAllDatabaseNames):
1321         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames): Do the actual work of getting 
1322           the appropriate directory listing and converting the paths to database names.
1323         (WebCore::IDBServer::IDBServer::didGetAllDatabaseNames):
1324         * Modules/indexeddb/server/IDBServer.h:
1325
1326         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1327         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromEncodedFilename): Helper for IDBServer.
1328         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1329
1330         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1331         (WebCore::InProcessIDBServer::getAllDatabaseNames):
1332         (WebCore::InProcessIDBServer::didGetAllDatabaseNames):
1333         * Modules/indexeddb/shared/InProcessIDBServer.h:
1334
1335         * inspector/InspectorIndexedDBAgent.cpp:
1336         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames): Use the new IDBFactory API to
1337           asynchronously get the list of database names.
1338
1339         * platform/CrossThreadCopier.cpp:
1340         (WebCore::SecurityOriginData>::copy):
1341         (WebCore::Vector<String>>::copy):
1342         * platform/CrossThreadCopier.h:
1343
1344         * platform/FileSystem.cpp:
1345         (WebCore::decodeFromFilename): Perform the reverse of encodeForFilename.
1346         * platform/FileSystem.h:
1347
1348         * platform/cf/FileSystemCF.cpp:
1349         (WebCore::stringFromFileSystemRepresentation):
1350
1351         * platform/glib/FileSystemGlib.cpp:
1352         (WebCore::stringFromFileSystemRepresentation):
1353         
1354         * platform/posix/FileSystemPOSIX.cpp:
1355         (WebCore::lastComponentOfPathIgnoringTrailingSlash): Utility for peeling off the last component
1356           of a multi-component path.
1357         (WebCore::listDirectory): This was broken when returning filenames with UTF in them. Fix it.
1358         
1359         * platform/mac/WebCoreNSURLExtras.mm: Move the static hex digit utility functions to WTF.
1360         (WebCore::userVisibleString):
1361         (WebCore::isUserVisibleURL):
1362         (WebCore::isHexDigit): Deleted.
1363         (WebCore::hexDigit): Deleted.
1364         (WebCore::hexDigitValue): Deleted.
1365     
1366
1367 2016-04-27  Enrica Casucci  <enrica@apple.com>
1368
1369         Refactor findExplodedTextNodeAtPoint to move core functionality in RenderBlockFlow.
1370         https://bugs.webkit.org/show_bug.cgi?id=157076
1371
1372         Reviewed by Simon Fraser.
1373
1374         * bindings/objc/DOMUIKitExtensions.mm:
1375         (-[DOMNode findExplodedTextNodeAtPoint:]):
1376         * rendering/RenderBlockFlow.cpp:
1377         (WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
1378         * rendering/RenderBlockFlow.h:
1379         * rendering/RenderText.h:
1380
1381 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
1382
1383         [iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable
1384         https://bugs.webkit.org/show_bug.cgi?id=157107
1385         rdar://problem/25943577
1386
1387         Reviewed by Tim Horton.
1388
1389         Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.
1390
1391         * page/FrameView.cpp:
1392         (WebCore::FrameView::adjustTiledBackingScrollability):
1393         * page/Page.h:
1394         (WebCore::Page::enclosedInScrollableAncestorView):
1395         (WebCore::Page::setEnclosedInScrollableAncestorView):
1396         (WebCore::Page::enclosedInScrollView): Deleted.
1397         (WebCore::Page::setEnclosedInScrollView): Deleted.
1398
1399 2016-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1400
1401         [SOUP] Implement PlatformCookieJar::addCookie
1402         https://bugs.webkit.org/show_bug.cgi?id=156295
1403
1404         Reviewed by Carlos Garcia Campos.
1405
1406         * platform/network/soup/CookieJarSoup.cpp:
1407         (WebCore::msToSoupDate):
1408         (WebCore::toSoupCookie):
1409         (WebCore::addCookie):
1410
1411 2016-04-27  Chris Dumez  <cdumez@apple.com>
1412
1413         Let the bindings generator use WTF::Optional for optional parameters using [Clamp]
1414         https://bugs.webkit.org/show_bug.cgi?id=157077
1415
1416         Reviewed by Darin Adler.
1417
1418         Let the bindings generator use WTF::Optional for optional parameters using [Clamp],
1419         if they do not have a default value.
1420
1421         * Modules/websockets/WebSocket.cpp:
1422         (WebCore::WebSocket::close):
1423         * Modules/websockets/WebSocket.h:
1424         * Modules/websockets/WebSocket.idl:
1425         * bindings/scripts/CodeGeneratorJS.pm:
1426         (CanUseWTFOptionalForParameter): Deleted.
1427
1428 2016-04-26  Ada Chan  <adachan@apple.com>
1429
1430         Set WebVideoFullscreenInterfaceMac up as a client of WebPlaybackSessionInterfaceMac to listen for playback state changes
1431         https://bugs.webkit.org/show_bug.cgi?id=157008
1432
1433         Reviewed by Jer Noble.
1434
1435         For WebVideoFullscreenInterfaceMac to be notified when the playback rate changes in
1436         WebPlaybackSessionInterfaceMac, add a new WebPlaybackSessionInterfaceMacClient base
1437         class that WebVideoFullscreenInterfaceMac implements, similar to the WebPlaybackSessionInterfaceAVKitClient
1438         on iOS. WebVideoFullscreenInterfaceMac sets itself as a client of WebPlaybackSessionInterfaceMac
1439         so WebPlaybackSessionInterfaceMac can notify WebVideoFullscreenInterfaceMac whenever the
1440         playback rate changes.
1441
1442         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
1443         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface):
1444         We should not change the WebPlaybackSessionModelMediaElement's interface here since WebPlaybackSessionManager
1445         has already set that up when creating the context for this media element.
1446         (WebVideoFullscreenModelVideoElement::setVideoElement):
1447         We should not change the WebPlaybackSessionModelMediaElement's media element here because
1448         this will be called with NULL when the fullscreen context is cleaned up, but the
1449         WebPlaybackSessionModelMediaElement might still need to stay around. We'll make sure the
1450         WebPlaybackSessionModelMediaElement's media element is set when setting up the fullscreen
1451         context in WebVideoFullscreenManager::enterVideoFullscreenForVideoElement().
1452
1453         * platform/mac/WebPlaybackSessionInterfaceMac.h:
1454         (WebCore::WebPlaybackSessionInterfaceMacClient::~WebPlaybackSessionInterfaceMacClient):
1455
1456         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
1457         (WebCore::WebPlaybackSessionInterfaceMac::setClient):
1458         Set the client. Notify the client about the current playback state.
1459         (WebCore::WebPlaybackSessionInterfaceMac::setRate):
1460         If a client is set, let that client know about the change in playback rate.
1461
1462         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1463         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1464         (WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
1465         Set itself as a client of WebPlaybackSessionInterfaceMac.
1466         (WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac):
1467         Make sure WebPlaybackSessionInterfaceMac won't hold onto a stale pointer to itself.
1468         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
1469         We don't have to update the WebVideoFullscreenInterfaceMac's rate here anymore. The change
1470         in playback rate in WebPlaybackSessionInterfaceMac should trigger
1471         WebVideoFullscreenInterfaceMac::rateChanged() to be called.
1472         (WebCore::WebVideoFullscreenInterfaceMac::rateChanged):
1473         Pass in both the isPlaying state and the playback rate to WebVideoFullscreenInterfaceMacObjC.
1474
1475 2016-04-27  Brady Eidson  <beidson@apple.com>
1476
1477         Modernize platform/CrossThreadCopier.h style.
1478         https://bugs.webkit.org/show_bug.cgi?id=157106
1479
1480         Reviewed by Alex Christensen.
1481
1482         No new tests (No change in behavior).
1483
1484         * platform/CrossThreadCopier.h:
1485         (WebCore::CrossThreadCopierPassThrough::copy):
1486         (WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper):
1487         (WebCore::AllowCrossThreadAccessWrapper::value):
1488         (WebCore::AllowCrossThreadAccess):
1489         (WebCore::AllowAccessLaterWrapper::AllowAccessLaterWrapper):
1490         (WebCore::AllowAccessLaterWrapper::value):
1491         (WebCore::AllowAccessLater):
1492
1493 2016-04-27  Filip Pizlo  <fpizlo@apple.com>
1494
1495         Speculative fix for null pointer dereference.
1496         rdar://problem/25964854
1497
1498         Reviewed by Michael Saboff.
1499
1500         * platform/mac/Language.mm:
1501         (WebCore::isValidICUCountryCode):
1502
1503 2016-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
1504
1505         Clean up Font::removeFromSystemFallbackCache()
1506         https://bugs.webkit.org/show_bug.cgi?id=157093
1507
1508         Reviewed by Darin Adler.
1509
1510         Fonts have a bit which represents whether or not the system fallback cache references them.
1511         This bit gets set to 1 when they are inserted into the system fallback cache, but was not
1512         being reset back to 0 when it was removed.
1513
1514         This is benign, since the old codepath has no effect. However, we can speed up the function
1515         by properly updating this bit.
1516
1517         No new tests because there is no behavior change.
1518
1519         * platform/graphics/Font.cpp:
1520         (WebCore::Font::removeFromSystemFallbackCache):
1521
1522 2016-04-27  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1523
1524         WebRTC: RTCIceCandidate don't need a custom bindings
1525         https://bugs.webkit.org/show_bug.cgi?id=157074
1526
1527         Reviewed by Eric Carlson.
1528
1529         Removed custom constructor and replaced custom attribute getters with
1530         nullable types. Removed custom binding from builds.
1531
1532         Testing: Updated existing test.
1533
1534         * CMakeLists.txt:
1535         * Modules/mediastream/RTCIceCandidate.idl:
1536         * WebCore.xcodeproj/project.pbxproj:
1537         * bindings/js/JSRTCIceCandidateCustom.cpp: Removed.
1538         (WebCore::constructJSRTCIceCandidate): Deleted.
1539         (WebCore::JSRTCIceCandidate::sdpMid): Deleted.
1540         (WebCore::JSRTCIceCandidate::sdpMLineIndex): Deleted.
1541
1542 2016-04-27  Chris Dumez  <cdumez@apple.com>
1543
1544         Unreviewed, rolling out r199383.
1545
1546         Seems to have caused a 0.5% PLT regression on iOS
1547
1548         Reverted changeset:
1549
1550         "[iOS] do not exit AirPlay when the screen locks"
1551         https://bugs.webkit.org/show_bug.cgi?id=156502
1552         http://trac.webkit.org/changeset/199383
1553
1554 2016-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
1555
1556         Remove unnecessary HashMap from Font
1557         https://bugs.webkit.org/show_bug.cgi?id=157090
1558
1559         Reviewed by Darin Adler.
1560
1561         There were only ever a maximum of 2 keys in the hashmap.
1562
1563         No new tests because there is no behavior change.
1564
1565         * platform/graphics/Font.h:
1566         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1567         (WebCore::Font::getCFStringAttributes):
1568
1569 2016-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
1570
1571         Rename DerivedFontData to DerivedFonts
1572         https://bugs.webkit.org/show_bug.cgi?id=157092
1573
1574         Reviewed by Darin Adler.
1575
1576         This is a follow-up to r178510 where we named SimpleFontData to Font.
1577         This patch didn't include renaming DerivedFontData to DerivedFonts.
1578
1579         No new tests because there is no behavior change.
1580
1581         * platform/graphics/Font.cpp:
1582         (WebCore::Font::verticalRightOrientationFont):
1583         (WebCore::Font::uprightOrientationFont):
1584         (WebCore::Font::smallCapsFont):
1585         (WebCore::Font::noSynthesizableFeaturesFont):
1586         (WebCore::Font::emphasisMarkFont):
1587         (WebCore::Font::brokenIdeographFont):
1588         (WebCore::Font::nonSyntheticItalicFont):
1589         (WebCore::Font::DerivedFonts::~DerivedFonts):
1590         (WebCore::Font::DerivedFontData::~DerivedFontData): Deleted.
1591         * platform/graphics/Font.h:
1592         (WebCore::Font::DerivedFonts::DerivedFonts):
1593         (WebCore::Font::DerivedFontData::DerivedFontData): Deleted.
1594
1595 2016-04-27  Chris Dumez  <cdumez@apple.com>
1596
1597         [Web IDL] Clean up support for [Clamp] IDL extended attribute
1598         https://bugs.webkit.org/show_bug.cgi?id=157060
1599
1600         Reviewed by Darin Adler.
1601
1602         Clean up support for [Clamp] IDL extended attribute:
1603         1.  Move [Clamp] handling in the bindings generator from the parameter
1604             conversion to JSValueToNative(). This has the benefit of
1605             simplifying the parameter conversion code, adding support for [Clamp]
1606             on non-readonly attributes, and improving consistency by handling
1607             this in the same place as [EnforceRange].
1608         2.  Add 'Clamp' to the IntegerConversionConfiguration enumeration in
1609             JSDOMbindings.h and add support for it to the various toInt*() /
1610             toUInt*() functions, similary to [EnforceRange]. Call these from
1611             the generated bindings.
1612
1613         * bindings/js/JSDOMBinding.cpp:
1614         (WebCore::toSmallerInt):
1615         (WebCore::toSmallerUInt):
1616         (WebCore::toInt32EnforceRange):
1617         (WebCore::toInt32Clamp):
1618         (WebCore::toUInt32Clamp):
1619         (WebCore::toUInt32EnforceRange):
1620         (WebCore::toInt64):
1621         (WebCore::toUInt64):
1622         (WebCore::toUInt8): Deleted.
1623         (WebCore::toUInt16): Deleted.
1624         * bindings/js/JSDOMBinding.h:
1625         (WebCore::toInt32):
1626         (WebCore::toUInt32):
1627         * bindings/scripts/CodeGeneratorJS.pm:
1628         (JSValueToNative):
1629         (GenerateParametersCheck): Deleted.
1630         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1631         (webkit_dom_test_obj_set_property):
1632         (webkit_dom_test_obj_get_property):
1633         (webkit_dom_test_obj_class_init):
1634         (webkit_dom_test_obj_class_method_with_enforce_range):
1635         (webkit_dom_test_obj_get_clamped_short_attr):
1636         (webkit_dom_test_obj_set_clamped_short_attr):
1637         (webkit_dom_test_obj_get_enforce_range_short_attr):
1638         (webkit_dom_test_obj_set_enforce_range_short_attr):
1639         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1640         * bindings/scripts/test/JS/JSTestObj.cpp:
1641         (WebCore::jsTestObjClampedShortAttr):
1642         (WebCore::jsTestObjEnforceRangeShortAttr):
1643         (WebCore::setJSTestObjClampedShortAttr):
1644         (WebCore::setJSTestObjEnforceRangeShortAttr):
1645         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
1646         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
1647         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional): Deleted.
1648         (WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted.
1649         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1650         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
1651         (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction): Deleted.
1652         * bindings/scripts/test/ObjC/DOMTestObj.h:
1653         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1654         (-[DOMTestObj clampedShortAttr]):
1655         (-[DOMTestObj setClampedShortAttr:]):
1656         (-[DOMTestObj enforceRangeShortAttr]):
1657         (-[DOMTestObj setEnforceRangeShortAttr:]):
1658         (-[DOMTestObj classMethodWithEnforceRange:objArgsLong:]):
1659         * bindings/scripts/test/TestObj.idl:
1660
1661 2016-04-27  Daniel Bates  <dabates@apple.com>
1662
1663         CSP: Add app-specific workaround for Ecobee and Quora
1664         https://bugs.webkit.org/show_bug.cgi?id=157005
1665         <rdar://problem/25560776>
1666
1667         Reviewed by Brent Fulgham.
1668
1669         * page/Settings.in: Add setting allowContentSecurityPolicySourceStarToMatchAnyProtocol (disabled by default).
1670         * page/csp/ContentSecurityPolicy.cpp:
1671         (WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol): Added.
1672         * page/csp/ContentSecurityPolicy.h:
1673         * page/csp/ContentSecurityPolicySourceList.cpp:
1674         (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar): Modified to return true
1675         if ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol() evaluates to true.
1676         * platform/RuntimeApplicationChecks.h:
1677         * platform/RuntimeApplicationChecks.mm:
1678         (WebCore::IOSApplication::isEcobee): Added.
1679         (WebCore::IOSApplication::isQuora): Added.
1680
1681 2016-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1682
1683         REGRESSION(r200094): [FreeType] Vertical text is broken after r200094
1684         https://bugs.webkit.org/show_bug.cgi?id=157066
1685
1686         Reviewed by Martin Robinson.
1687
1688         The problem is that Freetype implementation needs to call buildScaledFont() when orientation, SyntheticOblique
1689         or size change, but the new static clone methods don't do that. I think it's the time to stop using our own
1690         header for FontPlatformData for the FreeType implementation to make cross-platform changes easier and prevent
1691         regressions like this in the future.
1692
1693         * CMakeLists.txt: Compile FontPlatformData.cpp for all ports.
1694         * PlatformMac.cmake: Remove FontPlatformData.cpp.
1695         * PlatformWin.cmake: Ditto.
1696         * platform/graphics/FontPlatformData.cpp: We need our own clone methods in the FreeType backend.
1697         * platform/graphics/FontPlatformData.h: Move FreeType specific methods and members from the old header file.
1698         * platform/graphics/cairo/CairoUtilities.cpp:
1699         (WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Move CairoFtFaceLocker implementation here from
1700         HarfBuzzFaceCairo.cpp to make it available to other classes, and make it handle the case of
1701         cairo_ft_scaled_font_lock_face() returning nullptr.
1702         (WebCore::CairoFtFaceLocker::~CairoFtFaceLocker):
1703         * platform/graphics/cairo/CairoUtilities.h:
1704         (WebCore::CairoFtFaceLocker::ftFace):
1705         * platform/graphics/freetype/FontCacheFreeType.cpp:
1706         (WebCore::findBestFontGivenFallbacks): Move the fallbacks implementation to FontPlatformData where it belongs
1707         and here simply use FontPlatformData::fallbacks().
1708         * platform/graphics/freetype/FontPlatformData.h: Removed.
1709         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1710         (WebCore::FontPlatformData::FontPlatformData): Remove members already initialized in the header.
1711         (WebCore::FontPlatformData::operator=): Add missing members to be copied.
1712         (WebCore::FontPlatformData::~FontPlatformData): Do not free m_scaledFont manually since we are now using a smart pointer.
1713         (WebCore::FontPlatformData::cloneWithOrientation): Call buildScaledFont() like setOrientation() did.
1714         (WebCore::FontPlatformData::cloneWithSyntheticOblique): Call buildScaledFont() like setSyntheticOblique() did.
1715         (WebCore::FontPlatformData::cloneWithSize): Call buildScaledFont().
1716         (WebCore::FontPlatformData::fallbacks): Lazily initialize fallbacks if needed and return it.
1717         (WebCore::FontPlatformData::platformIsEqual): Only compare FreeType specific members.
1718         (WebCore::FontPlatformData::buildScaledFont): Use RefPtr for m_scaledFont.
1719         (WebCore::FontPlatformData::hasCompatibleCharmap): Use CairoFtFaceLocker.
1720         (WebCore::FontPlatformData::openTypeTable): Update to return RefPtr instead of PassRefPtr and use CairoFtFaceLocker.
1721         (WebCore::FontPlatformData::operator==): Deleted.
1722         (WebCore::FontPlatformData::setOrientation): Deleted.
1723         (WebCore::FontPlatformData::setSyntheticOblique): Deleted.
1724         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
1725         (WebCore::GlyphPage::fill): Use CairoFtFaceLocker.
1726         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1727         (WebCore::Font::platformInit): Ditto.
1728         (WebCore::Font::canRenderCombiningCharacterSequence): Ditto.
1729         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1730         (WebCore::harfBuzzCairoGetTable): Ditto.
1731         (WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Deleted.
1732         (WebCore::CairoFtFaceLocker::lock): Deleted.
1733         (WebCore::CairoFtFaceLocker::~CairoFtFaceLocker): Deleted.
1734
1735 2016-04-27  Hunseop Jeong  <hs85.jeong@samsung.com>
1736
1737         [EFL][GTK] Volume slider only changes volume when thumb is released, not while dragging
1738         https://bugs.webkit.org/show_bug.cgi?id=156970
1739
1740         Reviewed by Xabier Rodriguez-Calvar.
1741
1742         Volume slider have to change the volume while dragging the thumb. 
1743
1744         Test: media/video-volume-slider-drag.html 
1745
1746         * Modules/mediacontrols/mediaControlsBase.js:
1747         (Controller.prototype.createControls): Use the 'input' event instead of the 'change' to
1748         check the changed value correctly.
1749         (Controller.prototype.handleMaxButtonClicked):
1750         (Controller.prototype.handleVolumeSliderInput): Renamed from handleVolumeSliderChange.
1751         (Controller.prototype.handleVolumeSliderChange): Deleted. 
1752
1753 2016-04-27  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1754
1755         [Fetch API] Remove FetchResponse::redirect overload
1756         https://bugs.webkit.org/show_bug.cgi?id=157034
1757
1758         Reviewed by Darin Adler.
1759
1760         No change of behavior.
1761
1762         * Modules/fetch/FetchResponse.h:
1763
1764 2016-04-27  Csaba Osztrogon√°c  <ossy@webkit.org>
1765
1766         [Mac][cmake] Unreviewed speculative buildfix after r200116, just for fun.
1767
1768         * PlatformMac.cmake:
1769
1770 2016-04-27  Saam barati  <sbarati@apple.com>
1771
1772         JSC should have an option to allow global const redeclarations
1773         https://bugs.webkit.org/show_bug.cgi?id=157006
1774
1775         Reviewed by Geoffrey Garen.
1776
1777         This patch makes the JS VM not throw global const redeclaration
1778         errors when the application is iBooks.
1779
1780         * bindings/js/JSDOMWindowBase.cpp:
1781         (WebCore::JSDOMWindowBase::commonVM):
1782         * page/Settings.h:
1783         (WebCore::Settings::shouldUseHighResolutionTimers):
1784         (WebCore::Settings::globalConstRedeclarationShouldThrow):
1785         (WebCore::Settings::backgroundShouldExtendBeyondPage):
1786
1787 2016-04-26  John Wilander  <wilander@apple.com>
1788
1789         Support legacy HTTP headers in WebSockets
1790         https://bugs.webkit.org/show_bug.cgi?id=157057
1791
1792         Reviewed by Brent Fulgham.
1793
1794         No new tests since these headers are not officially supported and should not be used.
1795
1796         * platform/network/HTTPHeaderNames.in:
1797             Added four legacy headers needed to support older WebSockets servers.
1798             Two of them are in the draft from August 2010: https://whatwg.org/specs/web-socket-protocol/
1799
1800 2016-04-26  Dean Jackson  <dino@apple.com>
1801
1802         RTL native <select> buttons should have arrows on left
1803         https://bugs.webkit.org/show_bug.cgi?id=157055
1804         <rdar://problem/25894428>
1805
1806         Reviewed by Myles Maxfield.
1807
1808         If the text direction is right-to-left, the select popup
1809         buttons should have the arrows on the left side.
1810
1811         Test: fast/forms/select-writing-direction-natural.html
1812
1813         * rendering/RenderThemeMac.h:
1814         * rendering/RenderThemeMac.mm:
1815         (WebCore::RenderThemeMac::popupButtonPadding): Takes a direction parameter.
1816         (WebCore::RenderThemeMac::popupInternalPaddingBox): Checks the direction for the padding.
1817         (WebCore::RenderThemeMac::setPopupButtonCellState): Tell the button to put the
1818         arrows on the correct side.
1819         (WebCore::RenderThemeMac::popupButton): Deleted an unnecessary comment.
1820
1821 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
1822
1823         [WK2] [OS X] Create API for switching RTL scrollbar policy
1824         https://bugs.webkit.org/show_bug.cgi?id=156948
1825         <rdar://problem/25707757>
1826
1827         Reviewed by Darin Adler.
1828
1829         There are two schools of thought for where to put scrollbars in RTL environments.
1830         The first is that we should obey the content's "dir" attribute, specified on each
1831         element. The second is that we should be consistent with the platform (AppKit's)
1832         behavior.
1833
1834         There are some situations where the placement should be done according to the
1835         content. For example, this policy would be used in web browsers.
1836
1837         However, there are also places where web content is designed to fit seamlessly
1838         amongst native content. In this situation, the placement of the scrollbars should
1839         be done according to the view.
1840
1841         Because WebKit doesn't know which of these situations it is operating within, this
1842         patch adds a new API property, userInterfaceDirectionPolicy, to
1843         WKWebViewConfigurationPolicy. This allows clients to instruct us which policy to
1844         abide by. It is plumbed to the web process inside the WebPreferencesStore and is
1845         ultimately held inside the Page's Settings object.
1846
1847         This Setting is consulted by RenderLayerModelObject, which serves as a good
1848         centralized place for this policy implementation. This is the class which decides
1849         if we should be consulting its RenderStyle or the platform itself when we decide
1850         where to put the scrollbars.
1851
1852         Putting this decision inside the renderer is important because ScrollableArea
1853         often needs to know if scrollbars should be put on the left, but ScrollableArea
1854         doesn't know anything about RenderStyles. Therefore, the renderer must be the
1855         intermediary between ScrollableArea and the RenderStyle. (ScrollableArea also
1856         doesn't directly know anything about renderers either; however, each of the
1857         subclasses knows about an appropriate renderer.) Therefore, ScrollableArea gets
1858         a new virtual method which is implemented by the RenderLayerModelObject.
1859
1860         Tests: fast/scrolling/rtl-scrollbars*.html
1861
1862         * WebCore.xcodeproj/project.pbxproj: ScrollableAreaMac.mm is no longer necessary.
1863         * page/FrameView.cpp:
1864         (WebCore::FrameView::shouldPlaceBlockDirectionScrollbarOnLeft): Overridden
1865         ScrollableArea function.
1866         * page/FrameView.h:
1867         * page/Settings.h:
1868         * page/Settings.in:
1869         * platform/ScrollView.cpp: Adding two new settings: One to know if we should
1870         consult with the RenderStyle or the platform, and the other is whether or not
1871         the platform considers itself to be RTL.
1872         (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin): Update to
1873         use new mechanism.
1874         (WebCore::ScrollView::updateScrollbars): Ditto.
1875         (WebCore::ScrollView::scrollCornerRect): Ditto.
1876         (WebCore::ScrollView::locationOfContents): Ditto.
1877         * platform/ScrollableArea.cpp:
1878         (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. This was the old
1879         mechanism.
1880         (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. Ditto.
1881         * platform/ScrollableArea.h:
1882         * platform/mac/ScrollableAreaMac.mm: Removed.
1883         (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted.
1884         (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted.
1885         * platform/mac/ScrollbarThemeMac.mm:
1886         (WebCore::ScrollbarThemeMac::didCreateScrollerImp): Update to use new
1887         mechanism.
1888         * platform/text/WritingMode.h: These enums should match what's in WebKit2.
1889         * rendering/RenderBlock.cpp:
1890         (WebCore::RenderBlock::logicalLeftOffsetForContent): Update to use new mechanism.
1891         (WebCore::RenderBlock::logicalRightOffsetForContent): Ditto.
1892         * rendering/RenderBlockFlow.cpp:
1893         (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): Ditto.
1894         * rendering/RenderBox.cpp: Ditto.
1895         (WebCore::RenderBox::contentBoxRect):
1896         (WebCore::RenderBox::overflowClipRect):
1897         (WebCore::RenderBox::computePositionedLogicalWidth):
1898         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1899         * rendering/RenderBoxModelObject.cpp: Ditto.
1900         (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
1901         * rendering/RenderLayer.cpp:
1902         (WebCore::RenderLayer::resize): Ditto.
1903         (WebCore::cornerStart): Migrate to use references.
1904         (WebCore::cornerRect): Ditto.
1905         (WebCore::RenderLayer::scrollCornerRect): Ditto.
1906         (WebCore::resizerCornerRect): Ditto.
1907         (WebCore::RenderLayer::scrollCornerAndResizerRect): Ditto.
1908         (WebCore::RenderLayer::verticalScrollbarStart): Update to use new mechanism.
1909         (WebCore::RenderLayer::horizontalScrollbarStart): Ditto.
1910         (WebCore::RenderLayer::offsetFromResizeCorner): Ditto.
1911         (WebCore::RenderLayer::positionOverflowControls): Migrate to use references.
1912         (WebCore::RenderLayer::computeScrollDimensions): Ditto.
1913         (WebCore::RenderLayer::overflowControlsIntersectRect): Ditto.
1914         (WebCore::RenderLayer::drawPlatformResizerImage): Update to use new mechanism.
1915         (WebCore::RenderLayer::paintResizer): Migrate to use references.
1916         (WebCore::RenderLayer::isPointInResizeControl): Ditto.
1917         (WebCore::RenderLayer::hitTestOverflowControls): Ditto.
1918         (WebCore::RenderLayer::hitTestResizerInFragments): Ditto.
1919         * rendering/RenderLayer.h: ScrollableArea override
1920         * rendering/RenderLayerCompositor.cpp:
1921         (WebCore::RenderLayerCompositor::positionForClipLayer): Update to use new
1922         mechanism.
1923         * rendering/RenderLayerModelObject.cpp:
1924         (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft):
1925         This is the meat of this patch. This is where we decide if we should be
1926         interrogating the RenderStyle or the underlying platform.
1927         * rendering/RenderLayerModelObject.h:
1928         * rendering/RenderListBox.cpp: Update to use new mechanism.
1929         (WebCore::RenderListBox::itemBoundingBoxRect):
1930         (WebCore::RenderListBox::paintScrollbar):
1931         (WebCore::RenderListBox::isPointInOverflowControl):
1932         (WebCore::RenderListBox::listIndexAtOffset):
1933         (WebCore::RenderListBox::controlClipRect):
1934         (WebCore::RenderListBox::invalidateScrollbarRect):
1935         (WebCore::RenderListBox::convertFromScrollbarToContainingView):
1936         (WebCore::RenderListBox::convertFromContainingViewToScrollbar):
1937         * rendering/RenderListBox.h:
1938         * rendering/RenderView.cpp: Ditto.
1939         (WebCore::RenderView::repaintViewRectangle):
1940         * rendering/style/RenderStyle.cpp:
1941         (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft): This
1942         function is now much dumber. It just inspects its own style.
1943         * testing/InternalSettings.cpp: Allow mocking.
1944         (WebCore::InternalSettings::Backup::Backup):
1945         (WebCore::InternalSettings::Backup::restoreTo):
1946         (WebCore::InternalSettings::verticalScrollbarLocationPolicy):
1947         (WebCore::InternalSettings::setVerticalScrollbarLocationPolicy):
1948         (WebCore::InternalSettings::systemLayoutDirection):
1949         (WebCore::InternalSettings::setSystemLayoutDirection):
1950         * testing/InternalSettings.h:
1951         * testing/InternalSettings.idl:
1952
1953 2016-04-26  Chris Dumez  <cdumez@apple.com>
1954
1955         [Web IDL] Specify default values for optional parameters of type 'unsigned long'
1956         https://bugs.webkit.org/show_bug.cgi?id=157043
1957
1958         Reviewed by Alex Christensen.
1959
1960         Specify default values for optional parameters of type 'unsigned long' and let
1961         the bindings generator use WTF::Optional<> for the parameters that do not have
1962         such default value.
1963
1964         * Modules/webaudio/AudioContext.cpp:
1965         (WebCore::AudioContext::createScriptProcessor): Deleted.
1966         (WebCore::AudioContext::createChannelSplitter): Deleted.
1967         (WebCore::AudioContext::createChannelMerger): Deleted.
1968         * Modules/webaudio/AudioContext.h:
1969         * Modules/webaudio/AudioContext.idl:
1970         * bindings/scripts/CodeGeneratorJS.pm:
1971         (CanUseWTFOptionalForParameter): Deleted.
1972         * css/CSSStyleSheet.cpp:
1973         (WebCore::CSSStyleSheet::addRule):
1974         * css/CSSStyleSheet.h:
1975         * inspector/InspectorStyleSheet.cpp:
1976         (WebCore::InspectorStyleSheet::addRule):
1977
1978 2016-04-26  Ryosuke Niwa  <rniwa@webkit.org>
1979
1980         ASSERTION FAILED: m_templateInsertionModes.isEmpty() in WebCore::HTMLTreeBuilder::finished
1981         https://bugs.webkit.org/show_bug.cgi?id=143519
1982
1983         Reviewed by Darin Adler.
1984
1985         The assertion failure was caused by our parser inconsistently following the spec. Fixed it by making our HTML parser
1986         match the latest HTML5 specification. See inline comments below.
1987
1988         Tests: fast/dom/HTMLTemplateElement/parsing-template-with-frameset.html
1989                html5lib/generated/run-template-data.html
1990                html5lib/generated/run-template-write.html
1991                imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html
1992                imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html
1993                imported/w3c/web-platform-tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/end-tag-frameset.html
1994
1995         * html/parser/HTMLTreeBuilder.cpp:
1996         (WebCore::HTMLTreeBuilder::processStartTagForInBody): When parsing a template element for 'in body' insertion mode,
1997         we process the token using the rules for 'in head' insertion mode, which sets the frameset-ok flag to "not ok".
1998         In addition, 'in template' insertion mode should not special case a start tag whose tag name is "frame". Instead,
1999         fallback to using 'in body' insertion mode.
2000         https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
2001         (WebCore::HTMLTreeBuilder::processStartTag): 'in frameset' insertion mode should not special case a start tag whose
2002         tag name is "template": https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inframeset
2003         (WebCore::HTMLTreeBuilder::processEndTag): Ditto for an end tag whose name is "template".
2004         (WebCore::HTMLTreeBuilder::processStartTagForInHead): When parsing a template element in 'in head' inserting mode,
2005         we set the frameset-ok flag to "not ok": https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
2006
2007 2016-04-26  Filip Pizlo  <fpizlo@apple.com>
2008
2009         WebCore on Mac ignores the user's preferred region (country) while getting the language
2010         https://bugs.webkit.org/show_bug.cgi?id=156993
2011
2012         Reviewed by Geoffrey Garen.
2013
2014         This is tested by the NavigatorLanguage API test.
2015         
2016         WebCore was previously getting the list of preferred languages, and for each one, deducing
2017         the default region. That's wrong, since for example it doesn't respect the user's choice (in
2018         System Preferences) to display dates/calenders/etc according to a different region (like how
2019         I have my machine set to en-pl right now).
2020         
2021         It might be possible for the country code we get via kCFLocaleCountryCode to be something
2022         that our ICU doesn't handle. To defend against this, we search for the resulting country
2023         code in ICU's ISO countries list. If it doesn't appear in that list, we fall back on old
2024         behavior.
2025
2026         * platform/mac/Language.mm:
2027         (WebCore::httpStyleLanguageCode):
2028         (WebCore::isValidICUCountryCode):
2029         (WebCore::platformUserPreferredLanguages):
2030
2031 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
2032
2033         Use auto-generated operators in FontPlatformData
2034         https://bugs.webkit.org/show_bug.cgi?id=157037
2035
2036         Reviewed by Geoffrey Garen.
2037
2038         The only reason why they weren't used before is because Cairo was
2039         using a raw pointer. However, RefPtr supports Cairo types, so this
2040         patch migrates that pointer to a RefPtr. Therefore, we can remove
2041         our custom operators (because they work the same way as auto-
2042         generated ones do).
2043
2044         No new tests because there is no behavior change.
2045
2046         * platform/graphics/FontPlatformData.cpp:
2047         (WebCore::FontPlatformData::FontPlatformData): Deleted.
2048         (WebCore::FontPlatformData::operator=): Deleted.
2049         * platform/graphics/FontPlatformData.h:
2050         (WebCore::FontPlatformData::scaledFont):
2051         (WebCore::FontPlatformData::hash):
2052         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2053         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
2054         (WebCore::FontPlatformData::platformDataInit): Deleted.
2055         (WebCore::FontPlatformData::platformDataAssign): Deleted.
2056         * platform/graphics/win/FontPlatformDataCGWin.cpp:
2057         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
2058         (WebCore::FontPlatformData::platformDataInit): Deleted.
2059         (WebCore::FontPlatformData::platformDataAssign): Deleted.
2060         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2061         (WebCore::FontPlatformData::platformDataInit):
2062         (WebCore::FontPlatformData::FontPlatformData):
2063         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
2064         (WebCore::FontPlatformData::platformDataAssign): Deleted.
2065         * platform/graphics/win/FontPlatformDataWin.cpp:
2066         (WebCore::FontPlatformData::FontPlatformData): Deleted.
2067
2068 2016-04-26  Zalan Bujtas  <zalan@apple.com>
2069
2070         Add renderer address and needslayout state to inlineboxtree dump.
2071         https://bugs.webkit.org/show_bug.cgi?id=157035
2072
2073         Reviewed by Simon Fraser.
2074
2075         * rendering/InlineBox.cpp:
2076         (WebCore::InlineBox::showLineBox):
2077         * rendering/InlineTextBox.cpp:
2078         (WebCore::InlineTextBox::showLineBox):
2079         * rendering/SimpleLineLayoutFunctions.cpp:
2080         (WebCore::SimpleLineLayout::printPrefix):
2081
2082 2016-04-26  Fujii Hironori  <Hironori.Fujii@sony.com>
2083
2084         [curl] Requests interrupted when using https via proxy
2085         https://bugs.webkit.org/show_bug.cgi?id=157028
2086
2087         Reviewed by Alex Christensen.
2088
2089         A proxy responds "200 Connection Established" to a CONNECT
2090         method.  This response doesn't have Content-Type, then the
2091         request is canceled due to a unsupported MIME type. This is not
2092         a real response from the recipient server. It should not be
2093         processed normally. Just ignore the response.
2094
2095         * platform/network/curl/ResourceHandleManager.cpp:
2096         (WebCore::headerCallback):
2097         Do nothing if httpCode is 0. This is the case of "200 Connection Established".
2098
2099 2016-04-26  Chris Dumez  <cdumez@apple.com>
2100
2101         Drop Dictionary from CanUseWTFOptionalForParameter()
2102         https://bugs.webkit.org/show_bug.cgi?id=157023
2103
2104         Reviewed by Darin Adler.
2105
2106         As per Web IDL, optional dictionary parameters are always considered to have
2107         a default value of an empty dictionary, unless otherwise specified. There is
2108         therefore never any need to use Optional<> for it. Just implement this
2109         behavior in the bindings generator and drop blacklisting of Dictionary from
2110         CanUseWTFOptionalForParameter().
2111
2112         * bindings/scripts/CodeGeneratorJS.pm:
2113         (GenerateParametersCheck):
2114         (CanUseWTFOptionalForParameter): Deleted.
2115         * bindings/scripts/test/JS/JSTestObj.cpp:
2116         (WebCore::jsTestObjPrototypeFunctionOptionsObject):
2117
2118 2016-04-26  Antti Koivisto  <antti@apple.com>
2119
2120         RenderElement::style() should return const RenderStyle
2121         https://bugs.webkit.org/show_bug.cgi?id=157016
2122
2123         Reviewed by Geoff Garen.
2124
2125         Style should be changed via setStyle, not by mutating it directly.
2126
2127         Pulling this string turns RenderStyle const in many places.
2128
2129         * accessibility/AccessibilityObject.cpp:
2130         (WebCore::startOfStyleRange):
2131         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2132         (getAttributeSetForAccessibilityObject):
2133         * bindings/objc/DOM.mm:
2134         (-[DOMNode innerFrameQuad]):
2135         (-[DOMNode computedFontSize]):
2136         * css/CSSComputedStyleDeclaration.cpp:
2137         (WebCore::createPositionListForLayer):
2138         (WebCore::positionOffsetValue):
2139         (WebCore::ComputedStyleExtractor::currentColorOrValidColor):
2140         (WebCore::getTransitionPropertyValue):
2141         (WebCore::scrollSnapDestination):
2142         (WebCore::scrollSnapPoints):
2143         (WebCore::scrollSnapCoordinates):
2144         (WebCore::logUnimplementedPropertyID):
2145         (WebCore::fontFamilyFromStyle):
2146         (WebCore::lineHeightFromStyle):
2147         (WebCore::fontSizeFromStyle):
2148         (WebCore::fontStyleFromStyle):
2149         (WebCore::fontVariantFromStyle):
2150         (WebCore::fontWeightFromStyle):
2151         (WebCore::fontSynthesisFromStyle):
2152         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
2153         (WebCore::paddingOrMarginIsRendererDependent):
2154         (WebCore::convertToRegionBreak):
2155         (WebCore::isLayoutDependent):
2156         (WebCore::updateStyleIfNeededForNode):
2157         (WebCore::computeRenderStyleForProperty):
2158         (WebCore::ComputedStyleExtractor::propertyValue):
2159         (WebCore::CSSComputedStyleDeclaration::length):
2160         (WebCore::CSSComputedStyleDeclaration::item):
2161         (WebCore::ComputedStyleExtractor::propertyMatches):
2162         * css/CSSComputedStyleDeclaration.h:
2163         * css/CSSToLengthConversionData.cpp:
2164         (WebCore::CSSToLengthConversionData::viewportWidthFactor):
2165         (WebCore::CSSToLengthConversionData::viewportHeightFactor):
2166         (WebCore::CSSToLengthConversionData::viewportMinFactor):
2167         (WebCore::CSSToLengthConversionData::viewportMaxFactor):
2168         * css/CSSToLengthConversionData.h:
2169         (WebCore::CSSToLengthConversionData::CSSToLengthConversionData):
2170         (WebCore::CSSToLengthConversionData::style):
2171         (WebCore::CSSToLengthConversionData::rootStyle):
2172         (WebCore::CSSToLengthConversionData::computingFontSize):
2173         (WebCore::CSSToLengthConversionData::copyWithAdjustedZoom):
2174         * css/CSSToStyleMap.cpp:
2175         (WebCore::CSSToStyleMap::style):
2176         (WebCore::CSSToStyleMap::rootElementStyle):
2177         * css/CSSToStyleMap.h:
2178         * css/MediaQueryEvaluator.cpp:
2179         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
2180         * css/MediaQueryEvaluator.h:
2181         * css/SVGCSSComputedStyleDeclaration.cpp:
2182         (WebCore::strokeDashArrayToCSSValueList):
2183         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
2184         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2185         * css/SourceSizeList.cpp:
2186         (WebCore::match):
2187         (WebCore::defaultLength):
2188         (WebCore::computeLength):
2189         (WebCore::parseSizesAttribute):
2190         * css/StyleBuilderCustom.h:
2191         (WebCore::ApplyPropertyBorderImageModifier::applyValue):
2192         (WebCore::ApplyPropertyBorderImageModifier::getValue):
2193         (WebCore::StyleBuilderCustom::applyInheritClip):
2194         (WebCore::StyleBuilderCustom::applyInheritCounter):
2195         (WebCore::StyleBuilderCustom::applyValueContent):
2196         (WebCore::StyleBuilderCustom::applyValueAlt):
2197         * css/StyleResolver.cpp:
2198         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
2199         (WebCore::StyleResolver::State::State):
2200         (WebCore::isAtShadowBoundary):
2201         (WebCore::StyleResolver::styleForElement):
2202         (WebCore::StyleResolver::keyframeStylesForAnimation):
2203         (WebCore::StyleResolver::pseudoStyleForElement):
2204         (WebCore::StyleResolver::applyProperty):
2205         (WebCore::StyleResolver::checkForTextSizeAdjust):
2206         (WebCore::StyleResolver::checkForZoomChange):
2207         (WebCore::StyleResolver::checkForGenericFamilyChange):
2208         * css/StyleResolver.h:
2209         (WebCore::StyleResolver::style):
2210         (WebCore::StyleResolver::parentStyle):
2211         (WebCore::StyleResolver::rootElementStyle):
2212         (WebCore::StyleResolver::element):
2213         (WebCore::StyleResolver::document):
2214         (WebCore::StyleResolver::documentSettings):
2215         (WebCore::StyleResolver::State::State):
2216         (WebCore::StyleResolver::State::takeStyle):
2217         (WebCore::StyleResolver::State::parentStyle):
2218         (WebCore::StyleResolver::State::rootElementStyle):
2219         (WebCore::StyleResolver::State::regionForStyling):
2220         (WebCore::StyleResolver::State::elementLinkState):
2221         * dom/Document.cpp:
2222         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2223         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
2224         (WebCore::Document::setVisuallyOrdered):
2225         (WebCore::Document::createParser):
2226         * dom/Document.h:
2227         * dom/Element.cpp:
2228         (WebCore::Element::styleResolver):
2229         (WebCore::Element::resolveStyle):
2230         (WebCore::checkForEmptyStyleChange):
2231         (WebCore::checkForSiblingStyleChanges):
2232         (WebCore::beforeOrAfterPseudoElement):
2233         (WebCore::Element::existingComputedStyle):
2234         (WebCore::Element::resolveComputedStyle):
2235         (WebCore::Element::computedStyle):
2236         (WebCore::Element::didDetachRenderers):
2237         (WebCore::Element::resolveCustomStyle):
2238         * dom/Element.h:
2239         * dom/Node.cpp:
2240         (WebCore::computeEditabilityFromComputedStyle):
2241         (WebCore::Node::pseudoAwareLastChild):
2242         (WebCore::Node::computedStyle):
2243         * dom/Node.h:
2244         * dom/NodeRenderStyle.h:
2245         (WebCore::Node::renderStyle):
2246         * dom/PseudoElement.cpp:
2247         (WebCore::PseudoElement::clearHostElement):
2248         (WebCore::PseudoElement::resolveCustomStyle):
2249         * dom/PseudoElement.h:
2250         * editing/ApplyBlockElementCommand.cpp:
2251         (WebCore::isNewLineAtPosition):
2252         (WebCore::ApplyBlockElementCommand::renderStyleOfEnclosingTextNode):
2253         (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
2254         (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
2255         * editing/ApplyBlockElementCommand.h:
2256         * editing/EditingStyle.cpp:
2257         (WebCore::EditingStyle::init):
2258         (WebCore::EditingStyle::removeTextFillAndStrokeColorsIfNeeded):
2259         * editing/EditingStyle.h:
2260         * editing/Editor.h:
2261         * editing/SimplifyMarkupCommand.cpp:
2262         (WebCore::SimplifyMarkupCommand::doApply):
2263         * editing/cocoa/EditorCocoa.mm:
2264         (WebCore::Editor::styleForSelectionStart):
2265         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle):
2266         * editing/ios/EditorIOS.mm:
2267         (WebCore::Editor::fontForSelection):
2268         (WebCore::Editor::fontAttributesForSelectionStart):
2269         * editing/mac/EditorMac.mm:
2270         (WebCore::Editor::fontForSelection):
2271         (WebCore::Editor::fontAttributesForSelectionStart):
2272         * html/HTMLTitleElement.cpp:
2273         (WebCore::HTMLTitleElement::computedTextWithDirection):
2274         * html/canvas/CanvasRenderingContext2D.cpp:
2275         (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate):
2276         (WebCore::CanvasRenderingContext2D::FontProxy::initialize):
2277         (WebCore::CanvasRenderingContext2D::setFont):
2278         (WebCore::CanvasRenderingContext2D::setTextBaseline):
2279         (WebCore::CanvasRenderingContext2D::toTextDirection):
2280         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2281         * html/canvas/CanvasRenderingContext2D.h:
2282         * html/parser/HTMLResourcePreloader.cpp:
2283         (WebCore::HTMLResourcePreloader::preload):
2284         (WebCore::mediaAttributeMatches):
2285         * html/shadow/SliderThumbElement.cpp:
2286         (WebCore::RenderSliderThumb::RenderSliderThumb):
2287         (WebCore::RenderSliderThumb::updateAppearance):
2288         (WebCore::RenderSliderContainer::layout):
2289         (WebCore::SliderThumbElement::hostInput):
2290         (WebCore::SliderThumbElement::resolveCustomStyle):
2291         (WebCore::SliderContainerElement::createElementRenderer):
2292         (WebCore::SliderContainerElement::resolveCustomStyle):
2293         * html/shadow/SliderThumbElement.h:
2294         * html/shadow/TextControlInnerElements.cpp:
2295         (WebCore::TextControlInnerElement::create):
2296         (WebCore::TextControlInnerElement::resolveCustomStyle):
2297         (WebCore::TextControlInnerTextElement::renderer):
2298         (WebCore::TextControlInnerTextElement::resolveCustomStyle):
2299         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
2300         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
2301         * html/shadow/TextControlInnerElements.h:
2302         * page/EventHandler.cpp:
2303         (WebCore::EventHandler::selectCursor):
2304         * page/animation/AnimationBase.cpp:
2305         (WebCore::solveStepsFunction):
2306         (WebCore::AnimationBase::AnimationBase):
2307         * page/animation/AnimationBase.h:
2308         (WebCore::AnimationBase::~AnimationBase):
2309         (WebCore::AnimationBase::renderer):
2310         (WebCore::AnimationBase::animation):
2311         (WebCore::AnimationBase::setAnimation):
2312         * page/animation/AnimationController.cpp:
2313         (WebCore::AnimationController::cancelAnimations):
2314         (WebCore::AnimationController::updateAnimations):
2315         * page/animation/AnimationController.h:
2316         * page/animation/CompositeAnimation.cpp:
2317         (WebCore::CompositeAnimation::clearRenderer):
2318         (WebCore::CompositeAnimation::updateTransitions):
2319         (WebCore::CompositeAnimation::updateKeyframeAnimations):
2320         (WebCore::CompositeAnimation::animate):
2321         * page/animation/CompositeAnimation.h:
2322         * page/animation/ImplicitAnimation.cpp:
2323         (WebCore::ImplicitAnimation::ImplicitAnimation):
2324         (WebCore::ImplicitAnimation::shouldSendEventForListener):
2325         (WebCore::ImplicitAnimation::animate):
2326         (WebCore::ImplicitAnimation::sendTransitionEvent):
2327         (WebCore::ImplicitAnimation::reset):
2328         * page/animation/ImplicitAnimation.h:
2329         (WebCore::ImplicitAnimation::create):
2330         * page/animation/KeyframeAnimation.cpp:
2331         (WebCore::KeyframeAnimation::KeyframeAnimation):
2332         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
2333         (WebCore::KeyframeAnimation::animate):
2334         * page/animation/KeyframeAnimation.h:
2335         * page/ios/FrameIOS.mm:
2336         (WebCore::ancestorRespondingToScrollWheelEvents):
2337         * rendering/FlowThreadController.cpp:
2338         (WebCore::FlowThreadController::styleDidChange):
2339         * rendering/InlineFlowBox.cpp:
2340         (WebCore::clipRectForNinePieceImageStrip):
2341         * rendering/RenderBlock.cpp:
2342         (WebCore::RenderBlock::styleDidChange):
2343         (WebCore::RenderBlock::lineHeight):
2344         (WebCore::RenderBlock::firstLineBlock):
2345         (WebCore::styleForFirstLetter):
2346         (WebCore::RenderBlock::updateFirstLetterStyle):
2347         (WebCore::RenderBlock::createFirstLetterRenderer):
2348         * rendering/RenderBlockFlow.cpp:
2349         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
2350         (WebCore::calculateMinimumPageHeight):
2351         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
2352         * rendering/RenderBox.cpp:
2353         (WebCore::RenderBox::styleDidChange):
2354         (WebCore::RenderBox::borderRadii):
2355         (WebCore::RenderBox::enclosingFloatPaintingLayer):
2356         (WebCore::RenderBox::logicalVisualOverflowRectForPropagation):
2357         (WebCore::RenderBox::visualOverflowRectForPropagation):
2358         (WebCore::RenderBox::logicalLayoutOverflowRectForPropagation):
2359         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2360         * rendering/RenderBox.h:
2361         (WebCore::RenderBox::applyTopLeftLocationOffset):
2362         (WebCore::RenderBox::hasRenderOverflow):
2363         (WebCore::RenderBox::hasVisualOverflow):
2364         * rendering/RenderBoxModelObject.cpp:
2365         (WebCore::RenderBoxModelObject::backgroundRoundedRectAdjustedForBleedAvoidance):
2366         (WebCore::applyBoxShadowForBackground):
2367         * rendering/RenderButton.cpp:
2368         (WebCore::RenderButton::addChild):
2369         (WebCore::RenderButton::styleWillChange):
2370         (WebCore::RenderButton::styleDidChange):
2371         (WebCore::RenderButton::setupInnerStyle):
2372         (WebCore::RenderButton::layout):
2373         * rendering/RenderDeprecatedFlexibleBox.cpp:
2374         (WebCore::RenderDeprecatedFlexibleBox::styleWillChange):
2375         * rendering/RenderElement.cpp:
2376         (WebCore::RenderElement::createFor):
2377         (WebCore::RenderElement::uncachedFirstLineStyle):
2378         (WebCore::RenderElement::cachedFirstLineStyle):
2379         (WebCore::RenderElement::firstLineStyle):
2380         (WebCore::RenderElement::styleWillChange):
2381         (WebCore::RenderElement::addControlStatesForRenderer):
2382         (WebCore::RenderElement::getCachedPseudoStyle):
2383         (WebCore::RenderElement::getMutableCachedPseudoStyle):
2384         (WebCore::RenderElement::getUncachedPseudoStyle):
2385         (WebCore::RenderElement::paintOutline):
2386         * rendering/RenderElement.h:
2387         (WebCore::RenderElement::hasInitializedStyle):
2388         (WebCore::RenderElement::style):
2389         (WebCore::RenderElement::mutableStyle):
2390         (WebCore::RenderElement::element):
2391         (WebCore::RenderObject::isRenderInline):
2392         (WebCore::RenderObject::style):
2393         (WebCore::RenderObject::firstLineStyle):
2394         * rendering/RenderEmbeddedObject.cpp:
2395         (WebCore::RenderEmbeddedObject::layout):
2396         * rendering/RenderFlowThread.cpp:
2397         (WebCore::RenderFlowThread::RenderFlowThread):
2398         (WebCore::RenderFlowThread::createFlowThreadStyle):
2399         * rendering/RenderFlowThread.h:
2400         * rendering/RenderImage.cpp:
2401         (WebCore::RenderImage::layoutShadowControls):
2402         * rendering/RenderInline.cpp:
2403         (WebCore::RenderInline::styleDidChange):
2404         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
2405         (WebCore::RenderInline::paintOutline):
2406         * rendering/RenderLayer.cpp:
2407         (WebCore::RenderLayer::setupClipPath):
2408         * rendering/RenderListBox.cpp:
2409         (WebCore::RenderListBox::paintScrollbar):
2410         (WebCore::itemOffsetForAlignment):
2411         (WebCore::RenderListBox::paintItemForeground):
2412         (WebCore::RenderListBox::paintItemBackground):
2413         * rendering/RenderListMarker.cpp:
2414         (WebCore::RenderListMarker::updateMargins):
2415         (WebCore::RenderListMarker::lineHeight):
2416         * rendering/RenderMarquee.cpp:
2417         (WebCore::RenderMarquee::computePosition):
2418         (WebCore::RenderMarquee::updateMarqueeStyle):
2419         * rendering/RenderMenuList.cpp:
2420         (WebCore::RenderMenuList::adjustInnerStyle):
2421         (RenderMenuList::updateOptionsWidth):
2422         (RenderMenuList::itemStyle):
2423         * rendering/RenderMultiColumnFlowThread.cpp:
2424         (WebCore::isValidColumnSpanner):
2425         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
2426         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
2427         * rendering/RenderMultiColumnSpannerPlaceholder.h:
2428         * rendering/RenderNamedFlowFragment.cpp:
2429         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
2430         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
2431         * rendering/RenderNamedFlowFragment.h:
2432         * rendering/RenderObject.cpp:
2433         (WebCore::RenderObject::innerLineHeight):
2434         (WebCore::decorationColor):
2435         (WebCore::RenderObject::getTextDecorationColorsAndStyles):
2436         * rendering/RenderObject.h:
2437         (WebCore::RenderObject::minPreferredLogicalWidth):
2438         (WebCore::RenderObject::maxPreferredLogicalWidth):
2439         * rendering/RenderTable.cpp:
2440         (WebCore::RenderTable::computePreferredLogicalWidths):
2441         * rendering/RenderTableSection.cpp:
2442         (WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
2443         (WebCore::physicalBorderForDirection):
2444         * rendering/RenderText.h:
2445         (WebCore::RenderText::characterAt):
2446         (WebCore::RenderText::style):
2447         (WebCore::RenderText::firstLineStyle):
2448         (WebCore::RenderText::getCachedPseudoStyle):
2449         * rendering/RenderTextControl.cpp:
2450         (WebCore::RenderTextControl::styleDidChange):
2451         * rendering/RenderTextControlMultiLine.cpp:
2452         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
2453         * rendering/RenderTextControlSingleLine.cpp:
2454         (WebCore::RenderTextControlSingleLine::layout):
2455         (WebCore::RenderTextControlSingleLine::styleDidChange):
2456         * rendering/RenderTextFragment.cpp:
2457         (WebCore::RenderTextFragment::styleDidChange):
2458         * rendering/RenderThemeGtk.cpp:
2459         (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
2460         (WebCore::borderRadiiFromStyle):
2461         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
2462         (WebCore::RenderThemeGtk::paintMediaSliderThumb):
2463         (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
2464         * rendering/SimpleLineLayoutFunctions.cpp:
2465         (WebCore::SimpleLineLayout::paintFlow):
2466         (WebCore::SimpleLineLayout::hitTestFlow):
2467         * rendering/TextAutoSizing.cpp:
2468         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
2469         * rendering/TextAutoSizing.h:
2470         (WebCore::TextAutoSizingKey::style):
2471         (WebCore::TextAutoSizingKey::isDeleted):
2472         * rendering/TextPaintStyle.cpp:
2473         (WebCore::computeTextSelectionPaintStyle):
2474         * rendering/line/BreakingContext.h:
2475         * rendering/mathml/RenderMathMLRoot.cpp:
2476         (WebCore::RenderMathMLRoot::layout):
2477         * rendering/style/RenderStyle.h:
2478         (WebCore::RenderStyle::setColumnRuleWidth):
2479         (WebCore::RenderStyle::resetColumnRule):
2480         (WebCore::RenderStyle::setColumnSpan):
2481         (WebCore::RenderStyle::inheritColumnPropertiesFrom):
2482         (WebCore::RenderStyle::setTransform):
2483         (WebCore::RenderStyle::setTransformOriginX):
2484         (WebCore::RenderStyle::setTransformOriginY):
2485         * rendering/svg/SVGInlineTextBox.cpp:
2486         (WebCore::SVGInlineTextBox::positionForOffset):
2487         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
2488         (WebCore::SVGInlineTextBox::localSelectionRect):
2489         (WebCore::SVGInlineTextBox::paintSelectionBackground):
2490         (WebCore::SVGInlineTextBox::paint):
2491         (WebCore::SVGInlineTextBox::acquirePaintingResource):
2492         (WebCore::SVGInlineTextBox::releasePaintingResource):
2493         (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
2494         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
2495         (WebCore::SVGInlineTextBox::constructTextRun):
2496         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
2497         (WebCore::SVGInlineTextBox::paintTextWithShadows):
2498         (WebCore::SVGInlineTextBox::paintText):
2499         * rendering/svg/SVGInlineTextBox.h:
2500         * rendering/svg/SVGPathData.cpp:
2501         (WebCore::updatePathFromCircleElement):
2502         (WebCore::updatePathFromEllipseElement):
2503         (WebCore::updatePathFromRectElement):
2504         * rendering/svg/SVGRenderingContext.cpp:
2505         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2506         * style/StyleTreeResolver.cpp:
2507         (WebCore::Style::TreeResolver::Parent::Parent):
2508         (WebCore::Style::TreeResolver::popScope):
2509         (WebCore::Style::TreeResolver::styleForElement):
2510         (WebCore::Style::TreeResolver::pushParent):
2511         (WebCore::Style::TreeResolver::resolveComposedTree):
2512         * style/StyleTreeResolver.h:
2513         (WebCore::Style::TreeResolver::scope):
2514         * style/StyleUpdate.cpp:
2515         (WebCore::Style::Update::textUpdate):
2516         (WebCore::Style::Update::elementStyle):
2517         (WebCore::Style::Update::addElement):
2518         * style/StyleUpdate.h:
2519         (WebCore::Style::Update::document):
2520         * svg/SVGElement.cpp:
2521         (WebCore::SVGElement::synchronizeSystemLanguage):
2522         (WebCore::SVGElement::resolveCustomStyle):
2523         (WebCore::SVGElement::setUseOverrideComputedStyle):
2524         (WebCore::SVGElement::computedStyle):
2525         * svg/SVGElement.h:
2526         * svg/SVGElementRareData.h:
2527         (WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
2528         (WebCore::SVGElementRareData::overrideComputedStyle):
2529         * svg/SVGGraphicsElement.cpp:
2530         (WebCore::SVGGraphicsElement::animatedLocalTransform):
2531         * svg/SVGLengthContext.cpp:
2532         (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits):
2533         (WebCore::renderStyleForLengthResolving):
2534         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS):
2535         (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits):
2536         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS):
2537         (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits):
2538         * svg/SVGStopElement.cpp:
2539         (WebCore::SVGStopElement::stopColorIncludingOpacity):
2540         * svg/SVGTextElement.cpp:
2541         (WebCore::SVGTextElement::animatedLocalTransform):
2542
2543 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
2544
2545         Make FontPlatformData immutable
2546         https://bugs.webkit.org/show_bug.cgi?id=157024
2547
2548         Reviewed by Darin Adler.
2549
2550         This patch deletes all functions which modify a FontPlatformData once
2551         it has been created. This makes for a cleaner design.
2552
2553         No new tests because there is no behavior change.
2554
2555         * platform/graphics/Font.cpp:
2556         (WebCore::Font::verticalRightOrientationFont):
2557         (WebCore::Font::nonSyntheticItalicFont):
2558         * platform/graphics/FontPlatformData.cpp:
2559         (WebCore::FontPlatformData::FontPlatformData):
2560         (WebCore::FontPlatformData::cloneWithOrientation):
2561         (WebCore::FontPlatformData::cloneWithSyntheticOblique):
2562         * platform/graphics/FontPlatformData.h:
2563         (WebCore::FontPlatformData::setIsSystemFont): Deleted.
2564         (WebCore::FontPlatformData::setSize): Deleted.
2565         (WebCore::FontPlatformData::setOrientation): Deleted.
2566         (WebCore::FontPlatformData::setSyntheticOblique): Deleted.
2567         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2568         (WebCore::FontCache::systemFallbackForCharacters):
2569         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2570         (WebCore::FontCascade::drawGlyphs):
2571         * platform/graphics/cocoa/FontCocoa.mm:
2572         (WebCore::Font::platformInit):
2573         (WebCore::Font::platformCharWidthInit):
2574         (WebCore::createDerivativeFont):
2575         (WebCore::Font::createFontWithoutSynthesizableFeatures):
2576         (WebCore::Font::platformCreateScaledFont):
2577         (WebCore::Font::platformWidthForGlyph):
2578         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2579         (WebCore::FontPlatformData::openTypeTable):
2580         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2581         (WebCore::FontPlatformData::platformDataInit):
2582
2583 2016-04-26  Ryan Haddad  <ryanhaddad@apple.com>
2584
2585         Unreviewed, rolling out r200089.
2586
2587         This change causes API test failures
2588
2589         Reverted changeset:
2590
2591         "WebCore on Mac ignores the user's preferred region (country)
2592         while getting the language"
2593         https://bugs.webkit.org/show_bug.cgi?id=156993
2594         http://trac.webkit.org/changeset/200089
2595
2596 2016-04-26  Brent Fulgham  <bfulgham@apple.com>
2597
2598         GuardMalloc crash in WebCore::HTMLFrameElementBase::marginHeight() 
2599         https://bugs.webkit.org/show_bug.cgi?id=157020
2600         <rdar://problem/25148315>
2601
2602         Reviewed by Darin Adler.
2603
2604         Calls to setIntegralAttribute triggers event handling code, which can cause
2605         the underlying m_frameOwnerElement member to be deleted. We could clone this
2606         object, but since we only want the width and height we should just read them
2607         while we know the object is in a good state, then execute the potentially
2608         mutating methods.
2609
2610         Tested by imported/blink/fast/dom/HTMLBodyElement/body-inserting-iframe-crash.html.
2611
2612         * html/HTMLBodyElement.cpp:
2613         (WebCore::HTMLBodyElement::insertedInto): Read margin width and height before
2614         calling setIntegralAttribute.
2615
2616 2016-04-25  Filip Pizlo  <fpizlo@apple.com>
2617
2618         WebCore on Mac ignores the user's preferred region (country) while getting the language
2619         https://bugs.webkit.org/show_bug.cgi?id=156993
2620
2621         Reviewed by Geoffrey Garen.
2622
2623         I don't know how to test this since this depends on user settings.
2624         
2625         WebCore was previously getting the list of preferred languages, and for each one, deducing
2626         the default region. That's wrong, since for example it doesn't respect the user's choice (in
2627         System Preferences) to display dates/calenders/etc according to a different region (like how
2628         I have my machine set to en-pl right now).
2629         
2630         It might be possible for the country code we get via kCFLocaleCountryCode to be something
2631         that our ICU doesn't handle. To defend against this, we search for the resulting country
2632         code in ICU's ISO countries list. If it doesn't appear in that list, we fall back on old
2633         behavior.
2634
2635         * platform/mac/Language.mm:
2636         (WebCore::httpStyleLanguageCode):
2637         (WebCore::platformUserPreferredLanguages):
2638
2639 2016-04-26  Chris Dumez  <cdumez@apple.com>
2640
2641         [Web IDL] Specify default values for optional parameters of TypedArray types
2642         https://bugs.webkit.org/show_bug.cgi?id=157017
2643
2644         Reviewed by Darin Adler.
2645
2646         Specify default values for optional parameters of TypedArray types and let
2647         the bindings generator use WTF::Optional<> for the ones that do not have a
2648         default value.
2649
2650         * bindings/scripts/CodeGeneratorJS.pm:
2651         (CanUseWTFOptionalForParameter): Deleted.
2652         * html/HTMLMediaElement.cpp:
2653         (WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
2654         (WebCore::HTMLMediaElement::webkitAddKey):
2655         (WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
2656         * html/HTMLMediaElement.h:
2657         * html/HTMLMediaElement.idl:
2658
2659 2016-04-26  Chris Dumez  <cdumez@apple.com>
2660
2661         [Web IDL] Specify default values for optional parameters of type 'long' / 'unrestricted double'
2662         https://bugs.webkit.org/show_bug.cgi?id=157012
2663
2664         Reviewed by Darin Adler.
2665
2666         Specify default values for optional parameters of type 'long' / 'unrestricted double'
2667         and let the bindings generator use WTF::Optional<> for the ones that do not have a
2668         default value.
2669
2670         * Modules/mediastream/RTCDTMFSender.cpp:
2671         (WebCore::RTCDTMFSender::insertDTMF):
2672         (WebCore::RTCDTMFSender::didPlayTone): Deleted.
2673         * Modules/mediastream/RTCDTMFSender.h:
2674         * Modules/webaudio/AudioBufferSourceNode.cpp:
2675         (WebCore::AudioBufferSourceNode::start):
2676         (WebCore::AudioBufferSourceNode::startPlaying): Deleted.
2677         * Modules/webaudio/AudioBufferSourceNode.h:
2678         * Modules/webaudio/AudioBufferSourceNode.idl:
2679         * Modules/webaudio/AudioContext.cpp:
2680         (WebCore::AudioContext::createDelay): Deleted.
2681         * Modules/webaudio/AudioContext.h:
2682         * Modules/webaudio/AudioContext.idl:
2683         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2684         (WebCore::AudioScheduledSourceNode::start): Deleted.
2685         (WebCore::AudioScheduledSourceNode::stop): Deleted.
2686         * Modules/webaudio/AudioScheduledSourceNode.h:
2687         * Modules/webaudio/OscillatorNode.idl:
2688         * bindings/scripts/CodeGeneratorJS.pm:
2689         (CanUseWTFOptionalForParameter): Deleted.
2690         * bindings/scripts/test/JS/JSTestObj.cpp:
2691         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
2692         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
2693         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
2694         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
2695         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
2696         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
2697         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
2698         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue): Deleted.
2699         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString): Deleted.
2700         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): Deleted.
2701         (WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted.
2702         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): Deleted.
2703         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted.
2704         * html/HTMLInputElement.idl:
2705         * page/WindowTimers.idl:
2706         * testing/Internals.h:
2707         * testing/Internals.idl:
2708
2709 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2710
2711         Drop [UsePointersEvenForNonNullableObjectArguments] from SpeechSynthesis
2712         https://bugs.webkit.org/show_bug.cgi?id=156901
2713
2714         Reviewed by Darin Adler.
2715
2716         SpeechSynthesis.speak will now throw in case of bad parameters instead of silently failing.
2717         Started refactoring to use more references where possible.
2718
2719         Covered by updated test.
2720
2721         * Modules/speech/SpeechSynthesis.cpp:
2722         (WebCore::SpeechSynthesis::startSpeakingImmediately): Refactored to get a reference.
2723         (WebCore::SpeechSynthesis::speak):
2724         (WebCore::SpeechSynthesis::fireEvent):
2725         (WebCore::SpeechSynthesis::handleSpeakingCompleted): Removing first item in utteranceQueue unconditionally,
2726         since that would crash in Debug mode otherwise.
2727         (WebCore::SpeechSynthesis::boundaryEventOccurred):
2728         (WebCore::SpeechSynthesis::didStartSpeaking):
2729         (WebCore::SpeechSynthesis::didPauseSpeaking):
2730         (WebCore::SpeechSynthesis::didResumeSpeaking):
2731         (WebCore::SpeechSynthesis::didFinishSpeaking):
2732         (WebCore::SpeechSynthesis::speakingErrorOccurred):
2733         * Modules/speech/SpeechSynthesis.h:
2734         * Modules/speech/SpeechSynthesis.idl:
2735
2736 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2737
2738         Drop [UsePointersEvenForNonNullableObjectArguments] from WebKitNamedFlow
2739         https://bugs.webkit.org/show_bug.cgi?id=156979
2740
2741         Reviewed by Chris Dumez.
2742
2743         No change of behavior.
2744
2745         * dom/WebKitNamedFlow.idl: Marking contentNode parameter as nullable.
2746
2747 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2748
2749         Drop [UsePointersEvenForNonNullableObjectArguments] from EventTarget
2750         https://bugs.webkit.org/show_bug.cgi?id=156977
2751
2752         Reviewed by Chris Dumez.
2753
2754         No change of behavior.
2755
2756         * dom/EventTarget.idl:
2757
2758 2016-04-25  Ryosuke Niwa  <rniwa@webkit.org>
2759
2760         Remove the build flag for template elements
2761         https://bugs.webkit.org/show_bug.cgi?id=157022
2762
2763         Reviewed by Daniel Bates.
2764
2765         Removed the build flag.
2766
2767         * Configurations/FeatureDefines.xcconfig:
2768         * DerivedSources.cpp:
2769         * bindings/js/JSHTMLTemplateElementCustom.cpp:
2770         (WebCore::JSHTMLTemplateElement::content):
2771         * css/html.css:
2772         (summary::-webkit-details-marker):
2773         (template):
2774         (bdi, output):
2775         * dom/ContainerNode.cpp:
2776         (WebCore::isInTemplateContent):
2777         (WebCore::containsConsideringHostElements):
2778         (WebCore::ContainerNode::parserInsertBefore):
2779         (WebCore::ContainerNode::parserAppendChild):
2780         * dom/Document.cpp:
2781         (WebCore::Document::Document):
2782         (WebCore::Document::~Document):
2783         (WebCore::Document::getCachedLocale):
2784         (WebCore::Document::ensureTemplateDocument):
2785         (WebCore::Document::fonts):
2786         * dom/Document.h:
2787         (WebCore::Document::setTemplateDocumentHost):
2788         (WebCore::Document::templateDocumentHost):
2789         (WebCore::Document::hasDisabledFieldsetElement):
2790         (WebCore::Document::textEncoding):
2791         (WebCore::Document::templateDocument):
2792         * dom/Element.cpp:
2793         (WebCore::Element::setInnerHTML):
2794         * dom/Node.cpp:
2795         (WebCore::Node::containsIncludingHostElements):
2796         (WebCore::Node::pseudoAwarePreviousSibling):
2797         * dom/TemplateContentDocumentFragment.h:
2798         * editing/MarkupAccumulator.cpp:
2799         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
2800         * editing/markup.cpp:
2801         (WebCore::createFragmentForInnerOuterHTML):
2802         * html/HTMLTagNames.in:
2803         * html/HTMLTemplateElement.cpp:
2804         (WebCore::HTMLTemplateElement::didMoveToNewDocument):
2805         * html/HTMLTemplateElement.h:
2806         * html/HTMLTemplateElement.idl:
2807         * html/parser/HTMLConstructionSite.cpp:
2808         (WebCore::insert):
2809         (WebCore::HTMLConstructionSite::insertTextNode):
2810         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
2811         (WebCore::HTMLConstructionSite::findFosterSite):
2812         * html/parser/HTMLElementStack.cpp:
2813         (WebCore::HTMLNames::isScopeMarker):
2814         (WebCore::HTMLNames::isTableScopeMarker):
2815         (WebCore::HTMLNames::isTableBodyScopeMarker):
2816         (WebCore::HTMLNames::isTableRowScopeMarker):
2817         (WebCore::HTMLElementStack::inSelectScope):
2818         (WebCore::HTMLElementStack::hasTemplateInHTMLScope):
2819         (WebCore::HTMLElementStack::htmlElement):
2820         * html/parser/HTMLElementStack.h:
2821         * html/parser/HTMLPreloadScanner.cpp:
2822         (WebCore::TokenPreloadScanner::scan):
2823         * html/parser/HTMLPreloadScanner.h:
2824         * html/parser/HTMLStackItem.h:
2825         (WebCore::isSpecialNode):
2826         * html/parser/HTMLTreeBuilder.cpp:
2827         (WebCore::HTMLTreeBuilder::isParsingTemplateContents):
2828         (WebCore::HTMLTreeBuilder::isParsingFragmentOrTemplateContents):
2829         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
2830         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
2831         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
2832         (WebCore::HTMLTreeBuilder::processTemplateStartTag):
2833         (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
2834         (WebCore::HTMLTreeBuilder::processColgroupEndTagForInColumnGroup):
2835         (WebCore::HTMLTreeBuilder::processStartTagForInTable):
2836         (WebCore::HTMLTreeBuilder::processStartTag):
2837         (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
2838         (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
2839         (WebCore::HTMLTreeBuilder::processEndTagForInCell):
2840         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
2841         (WebCore::HTMLTreeBuilder::processEndTag):
2842         (WebCore::HTMLTreeBuilder::processCharacterBuffer):
2843         (WebCore::HTMLTreeBuilder::processEndOfFile):
2844         (WebCore::HTMLTreeBuilder::processStartTagForInHead):
2845         (WebCore::HTMLTreeBuilder::finished):
2846         * html/parser/HTMLTreeBuilder.h:
2847         * inspector/InspectorDOMAgent.cpp:
2848         (WebCore::InspectorDOMAgent::buildObjectForNode):
2849         * inspector/InspectorInstrumentation.h:
2850         (WebCore::InspectorInstrumentation::instrumentingAgentsForDocument):
2851         * xml/parser/XMLDocumentParserLibxml2.cpp:
2852         (WebCore::XMLDocumentParser::startElementNs):
2853
2854 2016-04-25  Jiewen Tan  <jiewen_tan@apple.com>
2855
2856         [iOS] ftp links crash @ WebCore::FTPDirectoryDocumentParser::appendEntry
2857         https://bugs.webkit.org/show_bug.cgi?id=157019
2858         <rdar://problem/24292650>
2859
2860         Reviewed by Chris Dumez.
2861
2862         Create separate Ref<Element> object for every row element instead of reusing
2863         one because Ref<>'s operator=() does not allow assignment after a WTFMove().
2864
2865         * html/FTPDirectoryDocument.cpp:
2866         (WebCore::FTPDirectoryDocumentParser::appendEntry):
2867
2868 2016-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2869
2870         [Cocoa] Guarantee FontPlatformData's m_cgFont is never nullptr
2871         https://bugs.webkit.org/show_bug.cgi?id=156929
2872
2873         Reviewed by Darin Adler.
2874
2875         After some investigation, it turns out that there is no place where it is meaningful
2876         to pass us a null CoreText font. Therefore, the CoreGraphics font is also never null.
2877
2878         We should simply check for these null values at the ingestion site in order to
2879         make the guarantee internally of having non-null values.
2880
2881         * platform/graphics/FontPlatformData.cpp:
2882         (WebCore::FontPlatformData::FontPlatformData): Because the pointer is never null, we
2883         can delete the code which handles that case.
2884         * platform/graphics/FontPlatformData.h:
2885         * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Ditto.
2886         (WebCore::webFallbackFontFamily): Deleted.
2887         (WebCore::FontPlatformData::setFallbackCGFont): Deleted.
2888         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2889         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Asking the
2890         CTRun for its kCTFontAttributeName will always return non-null.
2891         * platform/graphics/mac/FontCustomPlatformData.cpp:
2892         (WebCore::FontCustomPlatformData::fontPlatformData): Once we have a font descriptor,
2893         CTFontCreateWithFontDescriptor() will always return non-null. We check if the font
2894         descriptor is null elsewhere.
2895         * platform/mac/DragImageMac.mm: The fonts in this file are gotten by asking for the
2896         system font, which will always return non-null.
2897         (WebCore::fontFromNSFont):
2898         (WebCore::widthWithFont):
2899         (WebCore::drawAtPoint):
2900         (WebCore::createDragImageForLink):
2901
2902 2016-04-25  Chris Dumez  <cdumez@apple.com>
2903
2904         Crash under MemoryCache::remove()
2905         https://bugs.webkit.org/show_bug.cgi?id=157000
2906         <rdar://problem/23344660>
2907
2908         Reviewed by Andreas Kling.
2909
2910         MemoryCache::evictResources() was caching the number of resources ('size')
2911         in the cache for a particular sessionID, and then proceed to call
2912         MemoryCache::remove() 'size' times using the first item in the HashMap
2913         each time. This was unsafe because resources may be ref'ing each other
2914         and therefore removing one may cause other resources to get removed as
2915         well. In such case, we would call remove() too many times and crash because
2916         we dereferenced resources.begin()->value (with the HashMap being empty).
2917
2918         This patch avoids the issue by copying the resources to a Vector and
2919         ref'ing them first, before going on to remove each one from the cache.
2920
2921         * loader/cache/MemoryCache.cpp:
2922         (WebCore::MemoryCache::forEachSessionResource):
2923         (WebCore::MemoryCache::evictResources):
2924         * loader/cache/MemoryCache.h:
2925
2926 2016-04-25  Chris Dumez  <cdumez@apple.com>
2927
2928         Crash under WebCore::MutationObserver::deliverAllMutations()
2929         https://bugs.webkit.org/show_bug.cgi?id=156997
2930         <rdar://problem/16542323>
2931
2932         Reviewed by Ryosuke Niwa.
2933
2934         The crash traces indicate that we may derefence a null pointer when
2935         dereferencing MutationCallback::scriptExecutationContext() in
2936         MutationObserver::canDeliver(). This can happen when the script
2937         execution context gets destroyed as a JSMutationCallback is an
2938         ActiveDOMObject, which is a ContextDestructionObserver.
2939
2940         This patch refactors the code so that MutationObserver::canDeliver()
2941         now simply asks JSMutationCallback if it can invoke its callback.
2942         JSMutationCallback makes this decision using
2943         ActiveDOMCallback::canInvokeCallback() which does a proper null
2944         check of the ScriptExecutationContext. This avoids some code
2945         duplication and fixes the crash.
2946
2947         * bindings/js/JSMutationCallback.h:
2948         * dom/MutationCallback.h:
2949         * dom/MutationObserver.cpp:
2950         (WebCore::MutationObserver::canDeliver):
2951
2952 2016-04-25  Brady Eidson  <beidson@apple.com>
2953
2954         Fix a flaky test after r200032
2955
2956         * fileapi/File.cpp:
2957         (WebCore::File::lastModified): This used to return a date object which did a WTF::timeClip on the double,
2958           but now that we're returning a raw double we need to WTF::timeClip it ourselves.
2959
2960 2016-04-25  Chris Dumez  <cdumez@apple.com>
2961
2962         [Web IDL] Specify default values for optional parameters of type 'float' / 'unrestricted float'
2963         https://bugs.webkit.org/show_bug.cgi?id=156995
2964
2965         Reviewed by Darin Adler.
2966
2967         Specify default values for optional parameters of type 'float' / 'unrestricted float'
2968         and let the bindings generator use WTF::Optional<> for the ones that do not have a
2969         default value.
2970
2971         * bindings/scripts/CodeGeneratorJS.pm:
2972         (CanUseWTFOptionalForParameter): Deleted.
2973         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2974         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
2975         * html/canvas/CanvasRenderingContext2D.cpp:
2976         (WebCore::CanvasRenderingContext2D::setStrokeColor):
2977         (WebCore::CanvasRenderingContext2D::setFillColor):
2978         (WebCore::CanvasRenderingContext2D::setShadow):
2979         (WebCore::CanvasRenderingContext2D::fillText):
2980         (WebCore::CanvasRenderingContext2D::strokeText):
2981         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2982         (WebCore::CanvasRenderingContext2D::clearShadow): Deleted.
2983         (WebCore::normalizeSpaces): Deleted.
2984         (WebCore::CanvasRenderingContext2D::measureText): Deleted.
2985         * html/canvas/CanvasRenderingContext2D.h:
2986         * html/canvas/CanvasRenderingContext2D.idl:
2987         * testing/Internals.idl:
2988
2989 2016-04-25  Brent Fulgham  <bfulgham@apple.com>
2990
2991         Add port 4190 (managesieve) to port blacklist
2992         https://bugs.webkit.org/show_bug.cgi?id=156986
2993         <rdar://problem/9119470>
2994
2995         Reviewed by Daniel Bates.
2996
2997         Tested by security/block-test.html.
2998
2999         * platform/URL.cpp:
3000         (WebCore::portAllowed): Add 4190 to the port blacklist.
3001
3002 2016-04-25  Nan Wang  <n_wang@apple.com>
3003
3004         AX: Crash at -[WebAccessibilityObjectWrapper accessibilityAttributeValue:] + 4391
3005         https://bugs.webkit.org/show_bug.cgi?id=156987
3006
3007         Reviewed by Chris Fleizach.
3008
3009         When we hit test on a slider indicator asking for the value when the parent slider's
3010         accessibility object is not created or the parent slider has been removed, it will cause
3011         crash. Fixed it by adding a check to see if the object is detached from the parent. 
3012
3013         Test: accessibility/mac/slider-thumb-value-crash.html
3014
3015         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3016         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3017
3018 2016-04-25  Jer Noble  <jer.noble@apple.com>
3019
3020         WebKitPlaybackSessionModelMediaElement should initialize the interface added by setWebPlaybackSessionInterface() with initial data
3021         https://bugs.webkit.org/show_bug.cgi?id=156996
3022
3023         Reviewed by Beth Dakin.
3024
3025         Notify the interface of the current values in the media element when the model is given an interface.
3026
3027         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
3028         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
3029
3030 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
3031
3032         Toggling animation-play-state can re-start a finished animation
3033         https://bugs.webkit.org/show_bug.cgi?id=156731
3034
3035         Reviewed by Dean Jackson.
3036
3037         After an animation completed, CompositeAnimation::updateKeyframeAnimations() cleared
3038         all state that the animation had run on the element, so changing the value of some
3039         animation property triggered the animation to run again. This is wrong, since animation-name
3040         still applied to the element.
3041
3042         Fix by keeping state for keyframe animations in the Done state in the m_keyframeAnimations
3043         map. This allows for the removal of the index property on KeyframeAnimation.
3044
3045         Tests: animations/change-completed-animation-transform.html
3046                animations/change-completed-animation.html
3047
3048         * page/animation/AnimationBase.cpp:
3049         (WebCore::AnimationBase::timeToNextService):
3050         * page/animation/AnimationBase.h:
3051         (WebCore::AnimationBase::isAnimatingProperty):
3052         * page/animation/CompositeAnimation.cpp: Add animations that should stick around to AnimationNameMap,
3053         and swap with m_keyframeAnimations at the end.
3054         (WebCore::CompositeAnimation::updateKeyframeAnimations):
3055         * page/animation/KeyframeAnimation.cpp:
3056         (WebCore::KeyframeAnimation::KeyframeAnimation):
3057         (WebCore::KeyframeAnimation::getAnimatedStyle):
3058         * page/animation/KeyframeAnimation.h:
3059
3060 2016-04-25  Alberto Garcia  <berto@igalia.com>
3061
3062         [GTK] Crashes if DISPLAY is unset
3063         https://bugs.webkit.org/show_bug.cgi?id=156972
3064
3065         Reviewed by Carlos Garcia Campos.
3066
3067         If DISPLAY is unset then m_display will be NULL, crashing WebKit
3068         when XCloseDisplay is called in the PlatformDisplayX11 destructor.
3069
3070         * platform/graphics/x11/PlatformDisplayX11.cpp:
3071         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
3072
3073 2016-04-25  Ryan Haddad  <ryanhaddad@apple.com>
3074
3075         Update JS bindings test results after r200037
3076
3077         Unreviewed test gardening.
3078
3079         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3080         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
3081
3082 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
3083
3084         play-state not parsed as part of animation shorthand
3085         https://bugs.webkit.org/show_bug.cgi?id=156959
3086
3087         Reviewed by Darin Adler.
3088
3089         We failed to parse animation-play-state as part of the animation shorthand, contrary
3090         to the spec and other browsers.
3091
3092         Fix for both the prefixed and unprefixed properties. There is some compat risk here,
3093         but only changing unprefixed behavior will probably lead to more author confusion.
3094
3095         Test: animations/play-state-in-shorthand.html
3096
3097         * css/CSSParser.cpp:
3098         (WebCore::CSSParser::parseAnimationShorthand):
3099         * css/CSSPropertyNames.in:
3100         * css/StylePropertyShorthand.cpp:
3101         (WebCore::animationShorthandForParsing): Remove the long comment which is no longer relevant
3102         now that the behavior has been written into the spec.
3103
3104 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
3105
3106         Negative animation-delay is treated as 0s
3107         https://bugs.webkit.org/show_bug.cgi?id=141008
3108
3109         Reviewed by Daniel Bates.
3110         
3111         Fix keyframe animations which start in the paused state.
3112         
3113         Explicitly move such animations from the new to the paused state, and
3114         set m_pauseTime to 0, rather than leaving it at -1. Fix getElapsedTime()
3115         to compute a correct time elapsed time for such animations, which takes
3116         negative delay into account correctly.
3117         
3118         Fix assertions which need to account for the new transition of New -> PlayStatePaused.
3119
3120         Test: animations/play-state-start-paused.html
3121
3122         * page/animation/AnimationBase.cpp:
3123         (WebCore::AnimationBase::updateStateMachine):
3124         (WebCore::AnimationBase::getElapsedTime):
3125         * page/animation/KeyframeAnimation.cpp:
3126         (WebCore::KeyframeAnimation::animate):
3127
3128 2016-04-25  Antti Koivisto  <antti@apple.com>
3129
3130         Inline RenderStyle into RenderElement
3131         https://bugs.webkit.org/show_bug.cgi?id=156981
3132
3133         Reviewed by Andreas Kling.
3134
3135         We can save memory and reduce indirection of style access by inlining RenderStyle to RenderElement.
3136
3137         This patch also makes RenderStyle moveable and switches from std::unique_ptr<RenderStyle> to RenderStyle&&
3138         in many places where ownership is passed.
3139
3140         * Modules/plugins/PluginReplacement.h:
3141         (WebCore::PluginReplacement::scriptObject):
3142         (WebCore::PluginReplacement::willCreateRenderer):
3143         * Modules/plugins/QuickTimePluginReplacement.h:
3144         * Modules/plugins/QuickTimePluginReplacement.mm:
3145         (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement):
3146         (WebCore::QuickTimePluginReplacement::createElementRenderer):
3147         * Modules/plugins/YouTubePluginReplacement.cpp:
3148         (WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
3149         (WebCore::YouTubePluginReplacement::createElementRenderer):
3150         * Modules/plugins/YouTubePluginReplacement.h:
3151         * css/StyleResolver.cpp:
3152         (WebCore::StyleResolver::styleForElement):
3153         (WebCore::StyleResolver::styleForKeyframe):
3154         (WebCore::StyleResolver::pseudoStyleForElement):
3155         (WebCore::StyleResolver::styleForPage):
3156         (WebCore::StyleResolver::defaultStyleForElement):
3157         (WebCore::StyleResolver::addToMatchedPropertiesCache):
3158         (WebCore::StyleResolver::applyPropertyToStyle):
3159         * dom/Document.cpp:
3160         (WebCore::Document::recalcStyle):
3161         (WebCore::Document::webkitWillEnterFullScreenForElement):
3162         (WebCore::Document::setFullScreenRenderer):
3163         * dom/Element.cpp:
3164         (WebCore::Element::rendererIsNeeded):
3165         (WebCore::Element::createElementRenderer):
3166         * dom/Element.h:
3167         (WebCore::Element::copyNonAttributePropertiesFromElement):
3168         * dom/PseudoElement.cpp:
3169         (WebCore::PseudoElement::resolveCustomStyle):
3170         (WebCore::PseudoElement::didAttachRenderers):
3171         (WebCore::PseudoElement::didRecalcStyle):
3172         * html/BaseButtonInputType.cpp:
3173         (WebCore::BaseButtonInputType::appendFormData):
3174         (WebCore::BaseButtonInputType::createInputRenderer):
3175         * html/BaseButtonInputType.h:
3176         * html/FileInputType.cpp:
3177         (WebCore::FileInputType::handleDOMActivateEvent):
3178         (WebCore::FileInputType::createInputRenderer):
3179         * html/FileInputType.h:
3180         * html/HTMLAppletElement.cpp:
3181         (WebCore::HTMLAppletElement::rendererIsNeeded):
3182         (WebCore::HTMLAppletElement::createElementRenderer):
3183
3184         ...
3185
3186 2016-04-25  Eric Carlson  <eric.carlson@apple.com>
3187
3188         Stop listening for "media can start" notifications when media player is cleared
3189         https://bugs.webkit.org/show_bug.cgi?id=156985
3190         <rdar://problem/23158505>
3191
3192         Reviewed by Jer Noble.
3193
3194         No new tests, I have not been able to create a test that reliably reproduces this.
3195
3196         * html/HTMLMediaElement.cpp:
3197         (WebCore::HTMLMediaElement::loadInternal): Add logging.
3198         (WebCore::HTMLMediaElement::selectMediaResource): Assert and return early if there is
3199           no media player.
3200         (WebCore::HTMLMediaElement::clearMediaPlayer): Stop listening for can start notifications.
3201         (WebCore::HTMLMediaElement::visibilityStateChanged): Add logging.
3202         (WebCore::HTMLMediaElement::mediaCanStart): Ditto.
3203
3204 2016-04-25  Chris Dumez  <cdumez@apple.com>
3205
3206         [Web IDL] Specify default values for parameters of type 'unsigned short'
3207         https://bugs.webkit.org/show_bug.cgi?id=156967
3208
3209         Reviewed by Darin Adler.
3210
3211         Specify default values for parameters of type 'unsigned short' and let
3212         the bindings generator use WTF::Optional<> for the ones without a
3213         default value.
3214
3215         * bindings/scripts/CodeGeneratorJS.pm:
3216         (CanUseWTFOptionalForParameter):
3217         (GenerateParametersCheck):
3218         * testing/Internals.cpp:
3219         (WebCore::Internals::layerTreeAsText): Deleted.
3220         (WebCore::Internals::displayListForElement): Deleted.
3221         (WebCore::Internals::replayDisplayListForElement): Deleted.
3222         * testing/Internals.h:
3223         * testing/Internals.idl:
3224
3225 2016-04-25  Per Arne Vollan  <peavo@outlook.com>
3226
3227         [Win][IndexedDB] Fix build errors.
3228         https://bugs.webkit.org/show_bug.cgi?id=156713
3229
3230         Reviewed by Alex Christensen.
3231
3232         Fix compile and link errors when building with IndexedDB enabled.
3233
3234         * Modules/indexeddb/IDBCursor.h:
3235         * Modules/indexeddb/IDBTransaction.cpp:
3236         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
3237         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3238         * PlatformWin.cmake:
3239         * platform/win/FileSystemWin.cpp:
3240         (WebCore::hardLinkOrCopyFile):
3241
3242 2016-04-25  Brady Eidson  <beidson@apple.com>
3243
3244         Implement latest File object spec (including its constructor).
3245         https://bugs.webkit.org/show_bug.cgi?id=156511
3246
3247         Reviewed by Darin Adler.
3248
3249         Test: fast/files/file-constructor.html
3250
3251         * CMakeLists.txt:
3252         * WebCore.xcodeproj/project.pbxproj:
3253
3254         * bindings/js/JSDictionary.cpp:
3255         (WebCore::JSDictionary::convertValue):
3256         * bindings/js/JSDictionary.h:
3257
3258         * bindings/js/JSFileCustom.cpp: Added.
3259         (WebCore::constructJSFile):
3260
3261         * fileapi/File.cpp:
3262         (WebCore::File::File):
3263         (WebCore::File::lastModified):
3264         (WebCore::File::lastModifiedDate): Deleted.
3265         * fileapi/File.h:
3266         * fileapi/File.idl:
3267
3268
3269
3270 2016-04-25  Antti Koivisto  <antti@apple.com>
3271
3272         REGRESSION(r156846): Crashes with guard malloc
3273         https://bugs.webkit.org/show_bug.cgi?id=156984
3274
3275         Reviewed by Andreas Kling.
3276
3277         RenderElement::cachedFirstLineStyle() returns pointer to local std::unique_ptr.
3278
3279         * rendering/RenderElement.cpp:
3280         (WebCore::RenderElement::uncachedFirstLineStyle):
3281         (WebCore::RenderElement::cachedFirstLineStyle):
3282         (WebCore::RenderElement::firstLineStyle):
3283         (WebCore::firstLineStyleForCachedUncachedType): Deleted.
3284
3285             Don't try to use a single function for the cached and uncached cases. Separate the cases into the calling functions.
3286
3287 2016-04-25  Daniel Bates  <dabates@apple.com>
3288
3289         REGRESSION (r196012): Subresource may be blocked by Content Security Policy if it only matches 'self'
3290         https://bugs.webkit.org/show_bug.cgi?id=156935
3291         <rdar://problem/25351286>
3292
3293         Reviewed by Darin Adler.
3294
3295         Fixes an issue where subresource load may be blocked by the Content Security Policy (CSP) if its URL only
3296         matched 'self'. In particular, the load would be blocked if initiated from a document that inherited the
3297         origin of its owner document (e.g. the document contained in <iframe src="about:blank"></iframe>).
3298
3299         Following r196012 we compute and cache 'self' and its protocol on instantiation of a ContentSecurityPolicy
3300         object for use when matching a URL against it. These cached values become out-of-date if the document
3301         subsequently inherits the origin of its owner document. Therefore matches against 'self' will fail and
3302         CSP will block a load if its not otherwise allowed by the policy. Previously we would compute 'self' when
3303         parsing the definition of a source list and compute the protocol for 'self' each time we tried to match a
3304         URL against 'self'. So, 'self' would always be up-to-date with respect to the origin of the document.
3305
3306         Tests: http/tests/security/contentSecurityPolicy/iframe-blank-url-programmatically-add-external-script.html
3307                http/tests/security/contentSecurityPolicy/iframe-srcdoc-external-script.html
3308
3309         * page/csp/ContentSecurityPolicy.cpp:
3310         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Extract out logic for computing and caching
3311         'self' and its protocol into ContentSecurityPolicy::updateSourceSelf() and make use of this function.
3312         (WebCore::ContentSecurityPolicy::updateSourceSelf): Computes and caches 'self' and its protocol with
3313         respect to the specified SecurityOrigin.
3314         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): Call ContentSecurityPolicy::updateSourceSelf()
3315         to ensure that we have an up-to-date representation for 'self' and the protocol of 'self' which can
3316         become out-of-date if the document inherited the origin of its owner document.
3317         * page/csp/ContentSecurityPolicy.h:
3318
3319 2016-04-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3320
3321         Drop [UsePointersEvenForNonNullableObjectArguments] from TextTrack
3322         https://bugs.webkit.org/show_bug.cgi?id=156899
3323
3324         Reviewed by Chris Dumez.
3325
3326         No behavior changes.
3327
3328         * html/track/TextTrack.idl: Marking cue and region parameter as nullable.
3329         Also marking cues and activeCues as nullable attributes.
3330
3331 2016-04-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3332
3333         Drop [UsePointersEvenForNonNullableObjectArguments] from File API interfaces
3334         https://bugs.webkit.org/show_bug.cgi?id=156898
3335
3336         Reviewed by Chris Dumez.
3337
3338         Making FileReaderSync API API throwing a TypeError in case of null parameters, in lieu of a NOT_FOUND_ERR.
3339         Making FileReader API taking nullable parameters as a temporary fix.
3340
3341         Test: fast/files/workers/worker-file-reader-sync-bad-parameter.html
3342
3343         * Modules/websockets/WebSocketChannel.cpp:
3344         (WebCore::WebSocketChannel::processOutgoingFrameQueue): Updated to cope with FileReaderLoader::start taking a Blob&.
3345         * fileapi/FileReader.cpp:
3346         (WebCore::FileReader::readAsArrayBuffer): Updated to cope with readInternal taking a Blob&.
3347         (WebCore::FileReader::readAsBinaryString): Ditto.
3348         (WebCore::FileReader::readAsText): Ditto.
3349         (WebCore::FileReader::readAsDataURL): Ditto.
3350         (WebCore::FileReader::readInternal):  Updated to cope with FileReaderLoader::start taking a Blob&.
3351         * fileapi/FileReader.h:
3352         * fileapi/FileReader.idl: Marking the readXX methods as taking a nullable blob parameter to keep compatibility, at least temporarily.
3353         * fileapi/FileReaderLoader.cpp:
3354         (WebCore::FileReaderLoader::start): It now takes a Blob& as input.
3355         * fileapi/FileReaderLoader.h:
3356         * fileapi/FileReaderSync.cpp:
3357         (WebCore::FileReaderSync::readAsArrayBuffer): Taking a Blob& as input.
3358         (WebCore::FileReaderSync::readAsBinaryString): Ditto.
3359         (WebCore::FileReaderSync::readAsText): Ditto.
3360         (WebCore::FileReaderSync::readAsDataURL): Ditto.
3361         (WebCore::FileReaderSync::startLoading) Ditto.
3362         * fileapi/FileReaderSync.h:
3363         (WebCore::FileReaderSync::readAsText): Ditto.
3364         * fileapi/FileReaderSync.idl:
3365
3366 2016-04-25  Manuel Rego Casasnovas  <rego@igalia.com>
3367
3368         [css-grid] Fix grid-template-columns|rows computed style with content alignment
3369         https://bugs.webkit.org/show_bug.cgi?id=156793
3370
3371         Reviewed by Darin Adler.
3372
3373         Computed style of grid-template-columns and grid-template-rows properties
3374         was including the distribution offset because of content alignment.
3375         We should subtract that offset, like we do for the case of gaps,
3376         when we're calculating the computed style.
3377
3378         Test: fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html
3379
3380         * css/CSSComputedStyleDeclaration.cpp:
3381         (WebCore::valueForGridTrackList):
3382         * rendering/RenderGrid.cpp:
3383         (WebCore::RenderGrid::offsetBetweenTracks):
3384         (WebCore::RenderGrid::populateGridPositions): Deleted FIXME.
3385         * rendering/RenderGrid.h:
3386
3387 2016-04-25  Frederic Wang  <fwang@igalia.com>
3388
3389         Refactor RenderMathMLMenclose.
3390         https://bugs.webkit.org/show_bug.cgi?id=155019
3391
3392         Reviewed by Sergio Villar Senin.
3393
3394         Tests: mathml/presentation/menclose-notation-equivalence.html
3395                mathml/presentation/menclose-notation-values.html
3396
3397         We rewrite RenderMathMLMenclose so that layout functions correctly override the
3398         behavior of RenderMathMLRow. We try and rely on the draft  of the MathML in HTML5
3399         implementation note, to make easier to get consistency with other rendering engines
3400         in the future. All notations are now drawn with GraphicContext functions instead of
3401         mixing them with CSS style. To save memory space, the list of known notations are
3402         now saved on a short integer using bit masks instead of a vector of string names.
3403         Finally, we remove support for the radical notation so that we no longer need to
3404         create an anonymous RenderMathMLRoot.
3405
3406         * mathml/MathMLMencloseElement.cpp: Remove code for some special notations and just
3407         reimplement parsing of the notation attribute.
3408         (WebCore::MathMLMencloseElement::MathMLMencloseElement): By default, the notation is longdiv.
3409         (WebCore::MathMLMencloseElement::parseAttribute): By default, the list of notation is empty.
3410         If there is no notation attribute, the default value longdiv is used.
3411         Otherwise, we parse the notation attribute and add each notation, using some equivalences
3412         for box, actuarial and madruwb.
3413         (WebCore::MathMLMencloseElement::isPresentationAttribute): Deleted. No need to define
3414         specific style for some notation.
3415         (WebCore::MathMLMencloseElement::finishParsingChildren): Deleted. No need to add an
3416         anonymous square root.
3417         (WebCore::MathMLMencloseElement::collectStyleForPresentationAttribute): Deleted. No need to
3418         define specific style for some notation.
3419         (WebCore::MathMLMencloseElement::longDivLeftPadding): Deleted. RenderMathMLMenclose uses an
3420         arbitrary size instead of measure a glyph.
3421         * mathml/MathMLMencloseElement.h: Define simple bit mask for each notation, add a short
3422         integer to store the list of notations together with helper functions. Remove old code.
3423         * rendering/mathml/RenderMathMLMenclose.cpp: Rewrite RenderMathMLMenclose so that layout
3424         functions correctly override the behavior of RenderMathMLRow.
3425         (WebCore::RenderMathMLMenclose::RenderMathMLMenclose): Init m_ascent to 0.
3426         (WebCore::RenderMathMLMenclose::ruleThickness): For now, we use the fallback value used by
3427         for other bars. We may refine that in the future.
3428         (WebCore::RenderMathMLMenclose::getSpaceAroundContent): Helper function to retrieve the
3429         space to add around the content, depending on the notations specified. Note that for
3430         notation circle, this spacing depends on the content size.
3431         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths): Reimplement this function.
3432         This is just adding left/right spacing around the content.
3433         (WebCore::RenderMathMLMenclose::layoutBlock): Reimplement this function. We do the normal
3434         RenderMathMLRow layout, adjust spacing and child position and
3435         calculate m_ascent and m_contentRect.
3436         (WebCore::RenderMathMLMenclose::firstLineBaseline): Implement this function.
3437         We just return m_ascent.
3438         (WebCore::drawLine): Helper function to draw a line using strokePath.
3439         (WebCore::RenderMathMLMenclose::paint): We reimplement this function to draw
3440         all notations using GraphicContext.
3441         (WebCore::RenderMathMLMenclose::addChild): Deleted. No need to manage anonymous renderers.
3442         (WebCore::RenderMathMLMenclose::updateLogicalHeight): Deleted. Height is now calculated
3443         in layoutBlock.
3444         (WebCore::RenderMathMLMenclose::checkNotationalValuesValidity): Deleted.
3445         * rendering/mathml/RenderMathMLMenclose.h: Update member definitions.
3446         * rendering/mathml/RenderMathMLRoot.cpp: We no longer need anonymous roots.
3447         (WebCore::RenderMathMLRoot::RenderMathMLRoot): Deleted.
3448         * rendering/mathml/RenderMathMLRoot.h: We no longer need anonymous roots.
3449         * rendering/mathml/RenderMathMLRow.cpp: Allow to get the exact metrics of the chid row,
3450         for use in RenderMathMLRoot.
3451         (WebCore::RenderMathMLRow::computeLineVerticalStretch): rename parameters.
3452         (WebCore::RenderMathMLRow::layoutRowItems): Set parameters to the final ascent, descent and
3453         logical width of the chid row. Set the temporary logical width for RenderMathMenclose before
3454         laying the children out.
3455         (WebCore::RenderMathMLRow::layoutBlock): Rename parameters ; add a dummy logicalWidth
3456         parameter.
3457         * rendering/mathml/RenderMathMLRow.h: Make some functions accessible or overridable by
3458         RenderMathMLRoot. Make layoutRowItems return the final ascent, descent and logical width
3459         after the chid row is laid out.
3460         * rendering/mathml/RenderMathMLSquareRoot.cpp: We no longer need anonymous roots.
3461         (WebCore::RenderMathMLSquareRoot::RenderMathMLSquareRoot): Deleted.
3462         (WebCore::RenderMathMLSquareRoot::createAnonymousWithParentRenderer): Deleted.
3463         * rendering/mathml/RenderMathMLSquareRoot.h: We no longer need anonymous roots.
3464
3465 2016-04-25  Frederic Wang  <fwang@igalia.com>
3466
3467         Minor refactoring in RenderMathMLOperator
3468         https://bugs.webkit.org/show_bug.cgi?id=156906
3469
3470         Reviewed by Martin Robinson.
3471
3472         No new tests, this is only minor refactoring that does not change the behavior.
3473
3474         * rendering/mathml/RenderMathMLOperator.cpp:
3475         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack):
3476         We rename the "state" integer to an "expected" enum indicating the next expected part.
3477         (WebCore::RenderMathMLOperator::paintGlyph): We add a missing dot at the end of a sequence.
3478         We also replace ceil(x+1) with ceil(x)+1 to get rid of the temporary variable.
3479
3480 2016-04-24  Chris Dumez  <cdumez@apple.com>
3481
3482         [Web IDL] Specify default values for boolean parameters
3483         https://bugs.webkit.org/show_bug.cgi?id=156964
3484
3485         Reviewed by Darin Adler.
3486
3487         Specify default values for boolean parameters in our IDL files and
3488         let the bindings generator use WTF::Optional<> for the ones without
3489         a default value.
3490
3491         * CMakeLists.txt:
3492         * Modules/indexeddb/IDBKeyRange.cpp:
3493         * Modules/indexeddb/IDBKeyRange.h:
3494         * Modules/indexeddb/IDBKeyRange.idl:
3495         * WebCore.xcodeproj/project.pbxproj:
3496         * bindings/js/JSBindingsAllInOne.cpp:
3497
3498         * bindings/js/JSDOMTokenListCustom.cpp: Removed.
3499         We no longer need these custom bindings as the bindings generator
3500         will now provide the implementation with an Optional<bool>, given
3501         that the parameter has no default value.
3502
3503         * bindings/scripts/CodeGeneratorJS.pm:
3504         (CanUseWTFOptionalForParameterType): Deleted.
3505         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3506         (webkit_dom_test_obj_method_with_optional_boolean):
3507         (webkit_dom_test_obj_method_with_optional_boolean_is_false):
3508         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3509         * bindings/scripts/test/JS/JSTestObj.cpp:
3510         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
3511         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
3512         * bindings/scripts/test/ObjC/DOMTestObj.h:
3513         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3514         (-[DOMTestObj methodWithOptionalBoolean:]):
3515         (-[DOMTestObj methodWithOptionalBooleanIsFalse:]):
3516         * bindings/scripts/test/TestObj.idl:
3517         * dom/Document.h:
3518         * dom/Document.idl:
3519         * dom/Element.idl:
3520         * dom/EventTarget.idl:
3521         * html/DOMTokenList.idl:
3522
3523 2016-04-24  Chris Dumez  <cdumez@apple.com>
3524
3525         Autogenerated IDBFactory.open() does the wrong thing if you pass an explicit 'undefined' as the second argument
3526         https://bugs.webkit.org/show_bug.cgi?id=156939
3527
3528         Reviewed by Darin Adler.
3529
3530         As per WebIDL, if undefined is passed by JS for an optional parameter then
3531         we should use its default value if it has one, or use the special value
3532         "missing":
3533         http://heycam.github.io/webidl/#es-overloads (step 10.4)
3534
3535         Our bindings generator was already mapping undefined to the parameter's
3536         default value when present. However, it was missing the notion of
3537         "missing" value when there no default value. This patch adds supports
3538         for its by passing Optional<>(Nullopt) to the implementation in such
3539         case. This means that the implementation will need to use WTF::Optional<>
3540         type for parameters that do not have a default value. Thankfully though,
3541         in most cases, we will be able to specify a default value in the IDL
3542         so cases where we will need to use WTF::Optional<> will actually be
3543         rare.
3544
3545         To avoid having to do too much refactoring in this patch, the support
3546         for WTF::Optional is currently blacklisted for most IDL types. I will
3547         gradually stop blacklisting each type in follow-up patches, as I either:
3548         - Add default parameter values in our IDL (preferred)
3549         - Use WTF::Optional<> in our implementation (when we cannot specify a
3550           default value).
3551
3552         This patch fixes a bug with IDBFactory.open()'s second parameter (version)
3553         for which undefined should not throw and indicate that the version
3554         should not be changed. We now use WTF::Optional in the implementation to
3555         distinguish this case and not throw.
3556
3557         No new tests, existing tests were updated / rebaselined.
3558
3559         * Modules/indexeddb/IDBFactory.cpp:
3560         (WebCore::IDBFactory::open):
3561         (WebCore::IDBFactory::openInternal): Deleted.
3562         * Modules/indexeddb/IDBFactory.h:
3563         * bindings/scripts/CodeGeneratorJS.pm:
3564         (ShouldUseWTFOptionalForParameterType):
3565         (GenerateParametersCheck):
3566         * fileapi/Blob.idl:
3567         * inspector/InspectorIndexedDBAgent.cpp:
3568
3569 2016-04-23  Chris Dumez  <cdumez@apple.com>
3570
3571         [WebIDL] Drop [Default] WebKit-IDL extended attribute
3572         https://bugs.webkit.org/show_bug.cgi?id=156955
3573
3574         Reviewed by Darin Adler.
3575
3576         Drop [Default] WebKit-IDL extended attribute in favor of the standard
3577         WebIDL syntax for parameters' default value.
3578
3579         Here is what it looks like:
3580         [Default=NullString] optional DOMString a -> optional DOMString a = null
3581         [Default=NullString] optional DOMString? a -> optional DOMString? a = null
3582         [Default=Undefined] optional DOMString a -> optional DOMString a = "undefined"
3583         [Default=Undefined] optional DOMString? a -> optional DOMString? a = null
3584         [Default=Undefined] optional long a -> optional long a = 0
3585         [Default=Undefined] optional bool a -> optional bool a = false
3586         [Default=Undefined] optional unrestricted double a -> optional unrestricted double a = NaN
3587         [Default=Undefined] optional unrestricted float a -> optional unrestricted float a = NaN
3588         [Default=Undefined] optional sequence<DOMString> a -> optional sequence<DOMString> a = []
3589
3590         These do not cause any Web-Exposed behavior change. However, when getting
3591         rid of [Default] started passing more parameters by derefence instead of
3592         pointer (as is expected for parameters not marked as nullable). As a result,
3593         I had to mark a few parameters as nullable in the IDL to maintain the
3594         previous behavior. In some cases, the implementation was already throwing
3595         when passing null. In such cases, I have not marked the type as nullable
3596         so that the generated bindings now throw the exception instead of our
3597         implementation code. In some cases, the exception being thrown is now
3598         different. This is why some of the layout tests had to be rebaselined.
3599
3600         No new tests, existing tests have been rebaselined. No significant Web
3601         exposed behavior change is expected from this patch, beside exceptions
3602         type sometimes being different.
3603
3604         * Modules/encryptedmedia/MediaKeys.idl:
3605         * Modules/fetch/FetchRequest.idl:
3606         * Modules/gamepad/deprecated/GamepadList.idl:
3607         * Modules/indexeddb/IDBDatabase.idl:
3608         * Modules/mediastream/RTCStatsResponse.idl:
3609         * Modules/notifications/Notification.idl:
3610         * Modules/speech/SpeechSynthesisUtterance.idl:
3611         * Modules/webaudio/AudioNode.idl:
3612         * Modules/websockets/WebSocket.idl:
3613         * bindings/scripts/CodeGeneratorJS.pm:
3614         (GenerateParametersCheck):
3615         * bindings/scripts/IDLAttributes.txt:
3616         * bindings/scripts/IDLParser.pm:
3617         (parseDefault):
3618         (parseDefaultValue):
3619         * bindings/scripts/test/TestInterface.idl:
3620         * bindings/scripts/test/TestNamedConstructor.idl:
3621         * bindings/scripts/test/TestObj.idl:
3622         * bindings/scripts/test/TestOverrideBuiltins.idl:
3623         * css/CSSKeyframesRule.idl:
3624         * css/CSSMediaRule.idl:
3625         * css/CSSPrimitiveValue.idl:
3626         * css/CSSRuleList.idl:
3627         * css/CSSStyleDeclaration.idl:
3628         * css/CSSStyleSheet.idl:
3629         * css/CSSSupportsRule.idl:
3630         * css/CSSValueList.idl:
3631         * css/MediaList.idl:
3632         * css/MediaQueryList.idl:
3633         * css/MediaQueryListListener.idl:
3634         * css/StyleMedia.idl:
3635         * css/StyleSheetList.idl:
3636         * css/WebKitCSSFilterValue.idl:
3637         * css/WebKitCSSMatrix.idl:
3638         * css/WebKitCSSTransformValue.idl:
3639         * dom/ClientRectList.idl:
3640         * dom/Comment.idl:
3641         * dom/CompositionEvent.idl:
3642         * dom/CustomEvent.h:
3643         * dom/CustomEvent.idl:
3644         * dom/DOMImplementation.idl:
3645         * dom/DOMStringList.idl:
3646         * dom/DataTransferItem.idl:
3647         * dom/DataTransferItemList.idl:
3648         * dom/DeviceMotionEvent.idl:
3649         * dom/DeviceOrientationEvent.idl:
3650         * dom/Document.cpp:
3651         (WebCore::Document::adoptNode):
3652         * dom/Document.idl:
3653         * dom/Element.cpp:
3654         (WebCore::Element::setAttributeNode):
3655         (WebCore::Element::setAttributeNodeNS):
3656         (WebCore::Element::removeAttributeNode):
3657         (WebCore::Element::parseAttributeName): Deleted.
3658         * dom/Element.h:
3659         * dom/Element.idl:
3660         * dom/Event.idl:
3661         * dom/HashChangeEvent.idl:
3662         * dom/KeyboardEvent.idl:
3663         * dom/MessageEvent.idl:
3664         * dom/MouseEvent.idl:
3665         * dom/MutationEvent.idl:
3666         * dom/NamedNodeMap.cpp:
3667         (WebCore::NamedNodeMap::setNamedItem):
3668         (WebCore::NamedNodeMap::setNamedItemNS):
3669         (WebCore::NamedNodeMap::item): Deleted.
3670         * dom/NamedNodeMap.h:
3671         * dom/NamedNodeMap.idl:
3672         * dom/Node.idl:
3673         * dom/NodeFilter.idl:
3674         * dom/NonElementParentNode.idl:
3675         * dom/OverflowEvent.idl:
3676         * dom/Range.idl:
3677         * dom/Text.idl:
3678         * dom/TextEvent.idl:
3679         * dom/TouchEvent.idl:
3680         * dom/UIEvent.idl:
3681         * dom/WheelEvent.idl:
3682         * html/DOMFormData.idl:
3683         * html/HTMLAllCollection.idl:
3684         * html/HTMLAudioElement.idl:
3685         * html/HTMLCanvasElement.idl:
3686         * html/HTMLCollection.idl:
3687         * html/HTMLDocument.idl:
3688         * html/HTMLElement.cpp:
3689         (WebCore::HTMLElement::insertAdjacentElement):
3690         (WebCore::contextElementForInsertion): Deleted.
3691         * html/HTMLElement.h:
3692         * html/HTMLElement.idl:
3693         * html/HTMLFormControlsCollection.idl:
3694         * html/HTMLInputElement.idl:
3695         * html/HTMLMediaElement.idl:
3696         * html/HTMLOptionElement.idl:
3697         * html/HTMLOptionsCollection.idl:
3698         * html/HTMLSelectElement.idl:
3699         * html/HTMLTableElement.idl:
3700         * html/HTMLTableRowElement.idl:
3701         * html/HTMLTableSectionElement.idl:
3702         * html/HTMLTextAreaElement.idl:
3703         * html/ImageData.idl:
3704         * html/canvas/CanvasGradient.idl:
3705         * html/canvas/CanvasRenderingContext2D.idl:
3706         * html/canvas/DOMPath.idl:
3707         * html/canvas/OESVertexArrayObject.idl:
3708         * page/DOMSelection.cpp:
3709         (WebCore::DOMSelection::extend):
3710         (WebCore::DOMSelection::getRangeAt): Deleted.
3711         * page/DOMSelection.h:
3712         * page/DOMSelection.idl:
3713         * page/DOMWindow.idl:
3714         * page/History.idl:
3715         * page/Performance.idl:
3716         * page/WindowTimers.idl:
3717         * plugins/DOMMimeTypeArray.idl:
3718         * plugins/DOMPlugin.idl:
3719         * plugins/DOMPluginArray.idl:
3720         * storage/StorageEvent.idl:
3721         * svg/SVGAnimationElement.idl:
3722         * svg/SVGDocument.idl:
3723         * svg/SVGElement.idl:
3724         * svg/SVGFEDropShadowElement.idl:
3725         * svg/SVGFEGaussianBlurElement.idl:
3726         * svg/SVGFEMorphologyElement.idl:
3727         * svg/SVGFilterElement.idl:
3728         * svg/SVGGraphicsElement.idl:
3729         * svg/SVGMarkerElement.idl:
3730         * svg/SVGPathElement.idl:
3731         * svg/SVGSVGElement.idl:
3732         * svg/SVGTests.idl:
3733         * svg/SVGTextContentElement.idl:
3734         * xml/DOMParser.idl:
3735         * xml/XMLSerializer.cpp:
3736         (WebCore::XMLSerializer::serializeToString):
3737         * xml/XMLSerializer.h:
3738         * xml/XMLSerializer.idl:
3739         * xml/XPathEvaluator.idl:
3740         * xml/XPathExpression.idl:
3741         * xml/XPathNSResolver.idl:
3742         * xml/XPathResult.idl:
3743         * xml/XSLTProcessor.idl:
3744
3745 2016-04-24  Antti Koivisto  <antti@apple.com>
3746
3747         RenderStyle should not be reference counted
3748         https://bugs.webkit.org/show_bug.cgi?id=156846
3749
3750         Reviewed by Andreas Kling.
3751
3752         RenderStyle reference counts its substructures. We no longer share RenderStyle objects between normal renderers
3753         so there is no reason to refcount the RenderStyles themselves too. Making it a non-refcounted type clarifies
3754         ownership relations, reduces branchiness and saves some memory.
3755
3756         This patches switches mostly mechanically from Ref/RefPtr<RenderStyle> to std::unique_ptr<RenderStyle>. In
3757         the future RenderStyle can be given regular value semantics.
3758
3759         * Modules/plugins/PluginReplacement.h:
3760         (WebCore::PluginReplacement::scriptObject):
3761         (WebCore::PluginReplacement::willCreateRenderer):
3762         * Modules/plugins/QuickTimePluginReplacement.h:
3763         * Modules/plugins/QuickTimePluginReplacement.mm:
3764         (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement):
3765         (WebCore::QuickTimePluginReplacement::createElementRenderer):
3766         * Modules/plugins/YouTubePluginReplacement.cpp:
3767         (WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
3768         (WebCore::YouTubePluginReplacement::createElementRenderer):
3769         * Modules/plugins/YouTubePluginReplacement.h:
3770         * css/CSSComputedStyleDeclaration.cpp:
3771         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
3772         (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
3773         (WebCore::updateStyleIfNeededForNode):
3774         (WebCore::computeRenderStyleForProperty):
3775         (WebCore::ComputedStyleExtractor::customPropertyValue):
3776         (WebCore::ComputedStyleExtractor::propertyValue):
3777         * css/MediaQueryEvaluator.cpp:
3778         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
3779         (WebCore::MediaQueryEvaluator::eval):
3780         * css/MediaQueryEvaluator.h:
3781
3782             Clarify in code that MediaQueryEvaluator does not own the style.
3783
3784         * css/MediaQueryMatcher.cpp:
3785         (WebCore::MediaQueryMatcher::mediaType):
3786         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
3787         (WebCore::MediaQueryMatcher::evaluate):
3788         (WebCore::MediaQueryMatcher::matchMedia):
3789         (WebCore::MediaQueryMatcher::styleResolverChanged):
3790         (WebCore::MediaQueryMatcher::prepareEvaluator): Deleted.
3791         * css/MediaQueryMatcher.h:
3792         * css/StyleMedia.cpp:
3793         (WebCore::StyleMedia::matchMedium):
3794         * css/StyleResolver.cpp:
3795         (WebCore::StyleResolver::State::clear):
3796         (WebCore::StyleResolver::State::updateConversionData):
3797         (WebCore::StyleResolver::State::setStyle):
3798         (WebCore::StyleResolver::State::setParentStyle):
3799
3800             State owns the style explicitly set by setParentStyle but not the one given via constructor.
3801
3802         (WebCore::isAtShadowBoundary):
3803         (WebCore::StyleResolver::styleForElement):
3804         (WebCore::StyleResolver::styleForKeyframe):
3805         (WebCore::StyleResolver::keyframeStylesForAnimation):
3806         (WebCore::StyleResolver::pseudoStyleForElement):
3807         (WebCore::StyleResolver::styleForPage):
3808         (WebCore::StyleResolver::defaultStyleForElement):
3809         (WebCore::StyleResolver::applyMatchedProperties):
3810         (WebCore::StyleResolver::applyPropertyToStyle):
3811         * css/StyleResolver.h:
3812         (WebCore::ElementStyle::ElementStyle):
3813         (WebCore::StyleResolver::style):
3814         (WebCore::StyleResolver::parentStyle):
3815         (WebCore::StyleResolver::setOverrideDocumentElementStyle):
3816         (WebCore::StyleResolver::State::document):
3817         (WebCore::StyleResolver::State::element):
3818         (WebCore::StyleResolver::State::style):
3819         (WebCore::StyleResolver::State::takeStyle):
3820         (WebCore::StyleResolver::State::parentStyle):
3821         (WebCore::StyleResolver::State::rootElementStyle):
3822         (WebCore::StyleResolver::State::regionForStyling):
3823         (WebCore::StyleResolver::State::setParentStyle): Deleted.
3824         * dom/Document.cpp:
3825         (WebCore::Document::recalcStyle):
3826         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
3827         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
3828         (WebCore::Document::isPageBoxVisible):
3829         (WebCore::Document::pageSizeAndMarginsInPixels):
3830         (WebCore::Document::addAutoSizingNode):
3831         (WebCore::Document::validateAutoSizingNodes):
3832         (WebCore::Document::resetAutoSizingNodes):
3833         (WebCore::Document::setFullScreenRenderer):
3834         * dom/Document.h:
3835         * dom/Element.cpp:
3836         (WebCore::Element::rendererIsNeeded):
3837         (WebCore::Element::createElementRenderer):
3838         (WebCore::Element::resolveComputedStyle):
3839         * dom/Element.h:
3840         (WebCore::Element::copyNonAttributePropertiesFromElement):
3841         * dom/ElementRareData.h:
3842
3843         ...
3844
3845         * page/animation/AnimationBase.h:
3846         * page/animation/AnimationController.cpp:
3847         (WebCore::AnimationControllerPrivate::receivedStartTimeResponse):
3848         (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
3849         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
3850         (WebCore::AnimationController::cancelAnimations):
3851         (WebCore::AnimationController::updateAnimations):
3852
3853             std::unique_ptr<RenderStyle& animatedStyle argument is now expected no be initially null and
3854             is only set if a new style is created.
3855
3856         (WebCore::AnimationController::getAnimatedStyleForRenderer):
3857         * page/animation/AnimationController.h:
3858         * page/animation/AnimationControllerPrivate.h:
3859         * page/animation/CompositeAnimation.cpp:
3860         (WebCore::CompositeAnimation::updateTransitions):
3861         (WebCore::CompositeAnimation::updateKeyframeAnimations):
3862         (WebCore::CompositeAnimation::animate):
3863         (WebCore::CompositeAnimation::getAnimatedStyle):
3864         * page/animation/CompositeAnimation.h:
3865         * page/animation/ImplicitAnimation.cpp:
3866         (WebCore::ImplicitAnimation::ImplicitAnimation):
3867         (WebCore::ImplicitAnimation::shouldSendEventForListener):
3868         (WebCore::ImplicitAnimation::animate):
3869         (WebCore::ImplicitAnimation::getAnimatedStyle):
3870         (WebCore::ImplicitAnimation::onAnimationEnd):
3871         (WebCore::ImplicitAnimation::reset):
3872         * page/animation/ImplicitAnimation.h:
3873         * page/animation/KeyframeAnimation.cpp:
3874         (WebCore::KeyframeAnimation::KeyframeAnimation):
3875         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
3876         (WebCore::KeyframeAnimation::animate):
3877         (WebCore::KeyframeAnimation::getAnimatedStyle):
3878         * page/animation/KeyframeAnimation.h:
3879         * rendering/RenderAttachment.cpp:
3880         (WebCore::RenderAttachment::RenderAttachment):
3881         * rendering/RenderAttachment.h:
3882         * rendering/RenderBlock.cpp:
3883         (WebCore::RenderBlock::RenderBlock):
3884         (WebCore::RenderBlock::styleDidChange):
3885         (WebCore::RenderBlock::clone):
3886         (WebCore::RenderBlock::updateFirstLetterStyle):
3887         (WebCore::RenderBlock::createFirstLetterRenderer):
3888         * rendering/RenderBlock.h:
3889         * rendering/RenderBlockFlow.cpp:
3890         (WebCore::RenderBlockFlow::MarginInfo::MarginInfo):
3891         (WebCore::RenderBlockFlow::RenderBlockFlow):
3892         * rendering/RenderBlockFlow.h:
3893         * rendering/RenderBox.cpp:
3894         (WebCore::skipBodyBackground):
3895         (WebCore::RenderBox::RenderBox):
3896         * rendering/RenderBox.h:
3897         * rendering/RenderBoxModelObject.cpp:
3898         (WebCore::RenderBoxModelObject::suspendAnimations):
3899         (WebCore::RenderBoxModelObject::RenderBoxModelObject):
3900         * rendering/RenderBoxModelObject.h:
3901         * rendering/RenderButton.cpp:
3902         (WebCore::RenderButton::RenderButton):
3903         (WebCore::RenderButton::setupInnerStyle):
3904         * rendering/RenderButton.h:
3905         * rendering/RenderCombineText.h:
3906         * rendering/RenderDeprecatedFlexibleBox.cpp:
3907         (WebCore::RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox):
3908         * rendering/RenderDeprecatedFlexibleBox.h:
3909         * rendering/RenderDetailsMarker.cpp:
3910         (WebCore::RenderDetailsMarker::RenderDetailsMarker):
3911         * rendering/RenderDetailsMarker.h:
3912         * rendering/RenderElement.cpp:
3913         (WebCore::controlStatesRendererMap):
3914         (WebCore::RenderElement::RenderElement):
3915         (WebCore::RenderElement::~RenderElement):
3916         (WebCore::RenderElement::createFor):
3917         (WebCore::firstLineStyleForCachedUncachedType):
3918         (WebCore::RenderElement::uncachedFirstLineStyle):
3919         (WebCore::RenderElement::cachedFirstLineStyle):
3920         (WebCore::RenderElement::initializeStyle):
3921         (WebCore::RenderElement::setStyle):
3922         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
3923         (WebCore::RenderElement::styleDidChange):
3924         (WebCore::RenderElement::getCachedPseudoStyle):
3925
3926             Return plain pointer as the cache owns the style.
3927
3928         (WebCore::RenderElement::getUncachedPseudoStyle):
3929
3930             return std::unique_ptr<RenderStyle>
3931
3932         (WebCore::RenderElement::selectionColor):
3933         (WebCore::RenderElement::selectionPseudoStyle):
3934         (WebCore::RenderElement::selectionBackgroundColor):
3935         * rendering/RenderElement.h:
3936         (WebCore::RenderElement::hasInitializedStyle):
3937         (WebCore::RenderElement::style):
3938         (WebCore::RenderElement::element):
3939         (WebCore::RenderElement::setStyleInternal):
3940         * rendering/RenderEmbeddedObject.cpp:
3941
3942         ...
3943
3944         (WebCore::RenderImage::imageResource):
3945         * rendering/RenderInline.cpp:
3946         (WebCore::RenderInline::RenderInline):
3947         (WebCore::updateStyleOfAnonymousBlockContinuations):
3948         (WebCore::RenderInline::styleDidChange):
3949
3950             Continuations now get their own RenderStyles.
3951
3952         (WebCore::RenderInline::addChildIgnoringContinuation):
3953         (WebCore::RenderInline::clone):
3954         * rendering/RenderInline.h:
3955         * rendering/RenderLayer.cpp:
3956         (WebCore::RenderLayer::currentTransform):
3957         (WebCore::RenderLayer::calculateClipRects):
3958         * rendering/RenderLayer.h:
3959
3960         ...
3961
3962         * rendering/style/KeyframeList.cpp:
3963         (WebCore::KeyframeList::operator==):
3964         (WebCore::KeyframeList::insert):
3965
3966             KeyframeValue is now movable but not copyable type. Adjust accordingly.
3967
3968         * rendering/style/KeyframeList.h:
3969         (WebCore::KeyframeValue::KeyframeValue):
3970         (WebCore::KeyframeValue::setKey):
3971         (WebCore::KeyframeValue::style):
3972         (WebCore::KeyframeValue::setStyle):
3973         (WebCore::KeyframeList::animationName):
3974         (WebCore::KeyframeList::addProperty):
3975         (WebCore::KeyframeList::containsProperty):