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