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