8a58cfff3295bb0f455abb5c449f84683a8916b4
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-04-26  Ada Chan  <adachan@apple.com>
2
3         Set WebVideoFullscreenInterfaceMac up as a client of WebPlaybackSessionInterfaceMac to listen for playback state changes
4         https://bugs.webkit.org/show_bug.cgi?id=157008
5
6         Reviewed by Jer Noble.
7
8         For WebVideoFullscreenInterfaceMac to be notified when the playback rate changes in
9         WebPlaybackSessionInterfaceMac, add a new WebPlaybackSessionInterfaceMacClient base
10         class that WebVideoFullscreenInterfaceMac implements, similar to the WebPlaybackSessionInterfaceAVKitClient
11         on iOS. WebVideoFullscreenInterfaceMac sets itself as a client of WebPlaybackSessionInterfaceMac
12         so WebPlaybackSessionInterfaceMac can notify WebVideoFullscreenInterfaceMac whenever the
13         playback rate changes.
14
15         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
16         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface):
17         We should not change the WebPlaybackSessionModelMediaElement's interface here since WebPlaybackSessionManager
18         has already set that up when creating the context for this media element.
19         (WebVideoFullscreenModelVideoElement::setVideoElement):
20         We should not change the WebPlaybackSessionModelMediaElement's media element here because
21         this will be called with NULL when the fullscreen context is cleaned up, but the
22         WebPlaybackSessionModelMediaElement might still need to stay around. We'll make sure the
23         WebPlaybackSessionModelMediaElement's media element is set when setting up the fullscreen
24         context in WebVideoFullscreenManager::enterVideoFullscreenForVideoElement().
25
26         * platform/mac/WebPlaybackSessionInterfaceMac.h:
27         (WebCore::WebPlaybackSessionInterfaceMacClient::~WebPlaybackSessionInterfaceMacClient):
28
29         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
30         (WebCore::WebPlaybackSessionInterfaceMac::setClient):
31         Set the client. Notify the client about the current playback state.
32         (WebCore::WebPlaybackSessionInterfaceMac::setRate):
33         If a client is set, let that client know about the change in playback rate.
34
35         * platform/mac/WebVideoFullscreenInterfaceMac.h:
36         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
37         (WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
38         Set itself as a client of WebPlaybackSessionInterfaceMac.
39         (WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac):
40         Make sure WebPlaybackSessionInterfaceMac won't hold onto a stale pointer to itself.
41         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
42         We don't have to update the WebVideoFullscreenInterfaceMac's rate here anymore. The change
43         in playback rate in WebPlaybackSessionInterfaceMac should trigger
44         WebVideoFullscreenInterfaceMac::rateChanged() to be called.
45         (WebCore::WebVideoFullscreenInterfaceMac::rateChanged):
46         Pass in both the isPlaying state and the playback rate to WebVideoFullscreenInterfaceMacObjC.
47
48 2016-04-27  Brady Eidson  <beidson@apple.com>
49
50         Modernize platform/CrossThreadCopier.h style.
51         https://bugs.webkit.org/show_bug.cgi?id=157106
52
53         Reviewed by Alex Christensen.
54
55         No new tests (No change in behavior).
56
57         * platform/CrossThreadCopier.h:
58         (WebCore::CrossThreadCopierPassThrough::copy):
59         (WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper):
60         (WebCore::AllowCrossThreadAccessWrapper::value):
61         (WebCore::AllowCrossThreadAccess):
62         (WebCore::AllowAccessLaterWrapper::AllowAccessLaterWrapper):
63         (WebCore::AllowAccessLaterWrapper::value):
64         (WebCore::AllowAccessLater):
65
66 2016-04-27  Filip Pizlo  <fpizlo@apple.com>
67
68         Speculative fix for null pointer dereference.
69         rdar://problem/25964854
70
71         Reviewed by Michael Saboff.
72
73         * platform/mac/Language.mm:
74         (WebCore::isValidICUCountryCode):
75
76 2016-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
77
78         Clean up Font::removeFromSystemFallbackCache()
79         https://bugs.webkit.org/show_bug.cgi?id=157093
80
81         Reviewed by Darin Adler.
82
83         Fonts have a bit which represents whether or not the system fallback cache references them.
84         This bit gets set to 1 when they are inserted into the system fallback cache, but was not
85         being reset back to 0 when it was removed.
86
87         This is benign, since the old codepath has no effect. However, we can speed up the function
88         by properly updating this bit.
89
90         No new tests because there is no behavior change.
91
92         * platform/graphics/Font.cpp:
93         (WebCore::Font::removeFromSystemFallbackCache):
94
95 2016-04-27  Adam Bergkvist  <adam.bergkvist@ericsson.com>
96
97         WebRTC: RTCIceCandidate don't need a custom bindings
98         https://bugs.webkit.org/show_bug.cgi?id=157074
99
100         Reviewed by Eric Carlson.
101
102         Removed custom constructor and replaced custom attribute getters with
103         nullable types. Removed custom binding from builds.
104
105         Testing: Updated existing test.
106
107         * CMakeLists.txt:
108         * Modules/mediastream/RTCIceCandidate.idl:
109         * WebCore.xcodeproj/project.pbxproj:
110         * bindings/js/JSRTCIceCandidateCustom.cpp: Removed.
111         (WebCore::constructJSRTCIceCandidate): Deleted.
112         (WebCore::JSRTCIceCandidate::sdpMid): Deleted.
113         (WebCore::JSRTCIceCandidate::sdpMLineIndex): Deleted.
114
115 2016-04-27  Chris Dumez  <cdumez@apple.com>
116
117         Unreviewed, rolling out r199383.
118
119         Seems to have caused a 0.5% PLT regression on iOS
120
121         Reverted changeset:
122
123         "[iOS] do not exit AirPlay when the screen locks"
124         https://bugs.webkit.org/show_bug.cgi?id=156502
125         http://trac.webkit.org/changeset/199383
126
127 2016-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
128
129         Remove unnecessary HashMap from Font
130         https://bugs.webkit.org/show_bug.cgi?id=157090
131
132         Reviewed by Darin Adler.
133
134         There were only ever a maximum of 2 keys in the hashmap.
135
136         No new tests because there is no behavior change.
137
138         * platform/graphics/Font.h:
139         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
140         (WebCore::Font::getCFStringAttributes):
141
142 2016-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
143
144         Rename DerivedFontData to DerivedFonts
145         https://bugs.webkit.org/show_bug.cgi?id=157092
146
147         Reviewed by Darin Adler.
148
149         This is a follow-up to r178510 where we named SimpleFontData to Font.
150         This patch didn't include renaming DerivedFontData to DerivedFonts.
151
152         No new tests because there is no behavior change.
153
154         * platform/graphics/Font.cpp:
155         (WebCore::Font::verticalRightOrientationFont):
156         (WebCore::Font::uprightOrientationFont):
157         (WebCore::Font::smallCapsFont):
158         (WebCore::Font::noSynthesizableFeaturesFont):
159         (WebCore::Font::emphasisMarkFont):
160         (WebCore::Font::brokenIdeographFont):
161         (WebCore::Font::nonSyntheticItalicFont):
162         (WebCore::Font::DerivedFonts::~DerivedFonts):
163         (WebCore::Font::DerivedFontData::~DerivedFontData): Deleted.
164         * platform/graphics/Font.h:
165         (WebCore::Font::DerivedFonts::DerivedFonts):
166         (WebCore::Font::DerivedFontData::DerivedFontData): Deleted.
167
168 2016-04-27  Chris Dumez  <cdumez@apple.com>
169
170         [Web IDL] Clean up support for [Clamp] IDL extended attribute
171         https://bugs.webkit.org/show_bug.cgi?id=157060
172
173         Reviewed by Darin Adler.
174
175         Clean up support for [Clamp] IDL extended attribute:
176         1.  Move [Clamp] handling in the bindings generator from the parameter
177             conversion to JSValueToNative(). This has the benefit of
178             simplifying the parameter conversion code, adding support for [Clamp]
179             on non-readonly attributes, and improving consistency by handling
180             this in the same place as [EnforceRange].
181         2.  Add 'Clamp' to the IntegerConversionConfiguration enumeration in
182             JSDOMbindings.h and add support for it to the various toInt*() /
183             toUInt*() functions, similary to [EnforceRange]. Call these from
184             the generated bindings.
185
186         * bindings/js/JSDOMBinding.cpp:
187         (WebCore::toSmallerInt):
188         (WebCore::toSmallerUInt):
189         (WebCore::toInt32EnforceRange):
190         (WebCore::toInt32Clamp):
191         (WebCore::toUInt32Clamp):
192         (WebCore::toUInt32EnforceRange):
193         (WebCore::toInt64):
194         (WebCore::toUInt64):
195         (WebCore::toUInt8): Deleted.
196         (WebCore::toUInt16): Deleted.
197         * bindings/js/JSDOMBinding.h:
198         (WebCore::toInt32):
199         (WebCore::toUInt32):
200         * bindings/scripts/CodeGeneratorJS.pm:
201         (JSValueToNative):
202         (GenerateParametersCheck): Deleted.
203         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
204         (webkit_dom_test_obj_set_property):
205         (webkit_dom_test_obj_get_property):
206         (webkit_dom_test_obj_class_init):
207         (webkit_dom_test_obj_class_method_with_enforce_range):
208         (webkit_dom_test_obj_get_clamped_short_attr):
209         (webkit_dom_test_obj_set_clamped_short_attr):
210         (webkit_dom_test_obj_get_enforce_range_short_attr):
211         (webkit_dom_test_obj_set_enforce_range_short_attr):
212         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
213         * bindings/scripts/test/JS/JSTestObj.cpp:
214         (WebCore::jsTestObjClampedShortAttr):
215         (WebCore::jsTestObjEnforceRangeShortAttr):
216         (WebCore::setJSTestObjClampedShortAttr):
217         (WebCore::setJSTestObjEnforceRangeShortAttr):
218         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
219         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
220         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional): Deleted.
221         (WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted.
222         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
223         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
224         (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction): Deleted.
225         * bindings/scripts/test/ObjC/DOMTestObj.h:
226         * bindings/scripts/test/ObjC/DOMTestObj.mm:
227         (-[DOMTestObj clampedShortAttr]):
228         (-[DOMTestObj setClampedShortAttr:]):
229         (-[DOMTestObj enforceRangeShortAttr]):
230         (-[DOMTestObj setEnforceRangeShortAttr:]):
231         (-[DOMTestObj classMethodWithEnforceRange:objArgsLong:]):
232         * bindings/scripts/test/TestObj.idl:
233
234 2016-04-27  Daniel Bates  <dabates@apple.com>
235
236         CSP: Add app-specific workaround for Ecobee and Quora
237         https://bugs.webkit.org/show_bug.cgi?id=157005
238         <rdar://problem/25560776>
239
240         Reviewed by Brent Fulgham.
241
242         * page/Settings.in: Add setting allowContentSecurityPolicySourceStarToMatchAnyProtocol (disabled by default).
243         * page/csp/ContentSecurityPolicy.cpp:
244         (WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol): Added.
245         * page/csp/ContentSecurityPolicy.h:
246         * page/csp/ContentSecurityPolicySourceList.cpp:
247         (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar): Modified to return true
248         if ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol() evaluates to true.
249         * platform/RuntimeApplicationChecks.h:
250         * platform/RuntimeApplicationChecks.mm:
251         (WebCore::IOSApplication::isEcobee): Added.
252         (WebCore::IOSApplication::isQuora): Added.
253
254 2016-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
255
256         REGRESSION(r200094): [FreeType] Vertical text is broken after r200094
257         https://bugs.webkit.org/show_bug.cgi?id=157066
258
259         Reviewed by Martin Robinson.
260
261         The problem is that Freetype implementation needs to call buildScaledFont() when orientation, SyntheticOblique
262         or size change, but the new static clone methods don't do that. I think it's the time to stop using our own
263         header for FontPlatformData for the FreeType implementation to make cross-platform changes easier and prevent
264         regressions like this in the future.
265
266         * CMakeLists.txt: Compile FontPlatformData.cpp for all ports.
267         * PlatformMac.cmake: Remove FontPlatformData.cpp.
268         * PlatformWin.cmake: Ditto.
269         * platform/graphics/FontPlatformData.cpp: We need our own clone methods in the FreeType backend.
270         * platform/graphics/FontPlatformData.h: Move FreeType specific methods and members from the old header file.
271         * platform/graphics/cairo/CairoUtilities.cpp:
272         (WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Move CairoFtFaceLocker implementation here from
273         HarfBuzzFaceCairo.cpp to make it available to other classes, and make it handle the case of
274         cairo_ft_scaled_font_lock_face() returning nullptr.
275         (WebCore::CairoFtFaceLocker::~CairoFtFaceLocker):
276         * platform/graphics/cairo/CairoUtilities.h:
277         (WebCore::CairoFtFaceLocker::ftFace):
278         * platform/graphics/freetype/FontCacheFreeType.cpp:
279         (WebCore::findBestFontGivenFallbacks): Move the fallbacks implementation to FontPlatformData where it belongs
280         and here simply use FontPlatformData::fallbacks().
281         * platform/graphics/freetype/FontPlatformData.h: Removed.
282         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
283         (WebCore::FontPlatformData::FontPlatformData): Remove members already initialized in the header.
284         (WebCore::FontPlatformData::operator=): Add missing members to be copied.
285         (WebCore::FontPlatformData::~FontPlatformData): Do not free m_scaledFont manually since we are now using a smart pointer.
286         (WebCore::FontPlatformData::cloneWithOrientation): Call buildScaledFont() like setOrientation() did.
287         (WebCore::FontPlatformData::cloneWithSyntheticOblique): Call buildScaledFont() like setSyntheticOblique() did.
288         (WebCore::FontPlatformData::cloneWithSize): Call buildScaledFont().
289         (WebCore::FontPlatformData::fallbacks): Lazily initialize fallbacks if needed and return it.
290         (WebCore::FontPlatformData::platformIsEqual): Only compare FreeType specific members.
291         (WebCore::FontPlatformData::buildScaledFont): Use RefPtr for m_scaledFont.
292         (WebCore::FontPlatformData::hasCompatibleCharmap): Use CairoFtFaceLocker.
293         (WebCore::FontPlatformData::openTypeTable): Update to return RefPtr instead of PassRefPtr and use CairoFtFaceLocker.
294         (WebCore::FontPlatformData::operator==): Deleted.
295         (WebCore::FontPlatformData::setOrientation): Deleted.
296         (WebCore::FontPlatformData::setSyntheticOblique): Deleted.
297         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
298         (WebCore::GlyphPage::fill): Use CairoFtFaceLocker.
299         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
300         (WebCore::Font::platformInit): Ditto.
301         (WebCore::Font::canRenderCombiningCharacterSequence): Ditto.
302         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
303         (WebCore::harfBuzzCairoGetTable): Ditto.
304         (WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Deleted.
305         (WebCore::CairoFtFaceLocker::lock): Deleted.
306         (WebCore::CairoFtFaceLocker::~CairoFtFaceLocker): Deleted.
307
308 2016-04-27  Hunseop Jeong  <hs85.jeong@samsung.com>
309
310         [EFL][GTK] Volume slider only changes volume when thumb is released, not while dragging
311         https://bugs.webkit.org/show_bug.cgi?id=156970
312
313         Reviewed by Xabier Rodriguez-Calvar.
314
315         Volume slider have to change the volume while dragging the thumb. 
316
317         Test: media/video-volume-slider-drag.html 
318
319         * Modules/mediacontrols/mediaControlsBase.js:
320         (Controller.prototype.createControls): Use the 'input' event instead of the 'change' to
321         check the changed value correctly.
322         (Controller.prototype.handleMaxButtonClicked):
323         (Controller.prototype.handleVolumeSliderInput): Renamed from handleVolumeSliderChange.
324         (Controller.prototype.handleVolumeSliderChange): Deleted. 
325
326 2016-04-27  Youenn Fablet  <youenn.fablet@crf.canon.fr>
327
328         [Fetch API] Remove FetchResponse::redirect overload
329         https://bugs.webkit.org/show_bug.cgi?id=157034
330
331         Reviewed by Darin Adler.
332
333         No change of behavior.
334
335         * Modules/fetch/FetchResponse.h:
336
337 2016-04-27  Csaba Osztrogon√°c  <ossy@webkit.org>
338
339         [Mac][cmake] Unreviewed speculative buildfix after r200116, just for fun.
340
341         * PlatformMac.cmake:
342
343 2016-04-27  Saam barati  <sbarati@apple.com>
344
345         JSC should have an option to allow global const redeclarations
346         https://bugs.webkit.org/show_bug.cgi?id=157006
347
348         Reviewed by Geoffrey Garen.
349
350         This patch makes the JS VM not throw global const redeclaration
351         errors when the application is iBooks.
352
353         * bindings/js/JSDOMWindowBase.cpp:
354         (WebCore::JSDOMWindowBase::commonVM):
355         * page/Settings.h:
356         (WebCore::Settings::shouldUseHighResolutionTimers):
357         (WebCore::Settings::globalConstRedeclarationShouldThrow):
358         (WebCore::Settings::backgroundShouldExtendBeyondPage):
359
360 2016-04-26  John Wilander  <wilander@apple.com>
361
362         Support legacy HTTP headers in WebSockets
363         https://bugs.webkit.org/show_bug.cgi?id=157057
364
365         Reviewed by Brent Fulgham.
366
367         No new tests since these headers are not officially supported and should not be used.
368
369         * platform/network/HTTPHeaderNames.in:
370             Added four legacy headers needed to support older WebSockets servers.
371             Two of them are in the draft from August 2010: https://whatwg.org/specs/web-socket-protocol/
372
373 2016-04-26  Dean Jackson  <dino@apple.com>
374
375         RTL native <select> buttons should have arrows on left
376         https://bugs.webkit.org/show_bug.cgi?id=157055
377         <rdar://problem/25894428>
378
379         Reviewed by Myles Maxfield.
380
381         If the text direction is right-to-left, the select popup
382         buttons should have the arrows on the left side.
383
384         Test: fast/forms/select-writing-direction-natural.html
385
386         * rendering/RenderThemeMac.h:
387         * rendering/RenderThemeMac.mm:
388         (WebCore::RenderThemeMac::popupButtonPadding): Takes a direction parameter.
389         (WebCore::RenderThemeMac::popupInternalPaddingBox): Checks the direction for the padding.
390         (WebCore::RenderThemeMac::setPopupButtonCellState): Tell the button to put the
391         arrows on the correct side.
392         (WebCore::RenderThemeMac::popupButton): Deleted an unnecessary comment.
393
394 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
395
396         [WK2] [OS X] Create API for switching RTL scrollbar policy
397         https://bugs.webkit.org/show_bug.cgi?id=156948
398         <rdar://problem/25707757>
399
400         Reviewed by Darin Adler.
401
402         There are two schools of thought for where to put scrollbars in RTL environments.
403         The first is that we should obey the content's "dir" attribute, specified on each
404         element. The second is that we should be consistent with the platform (AppKit's)
405         behavior.
406
407         There are some situations where the placement should be done according to the
408         content. For example, this policy would be used in web browsers.
409
410         However, there are also places where web content is designed to fit seamlessly
411         amongst native content. In this situation, the placement of the scrollbars should
412         be done according to the view.
413
414         Because WebKit doesn't know which of these situations it is operating within, this
415         patch adds a new API property, userInterfaceDirectionPolicy, to
416         WKWebViewConfigurationPolicy. This allows clients to instruct us which policy to
417         abide by. It is plumbed to the web process inside the WebPreferencesStore and is
418         ultimately held inside the Page's Settings object.
419
420         This Setting is consulted by RenderLayerModelObject, which serves as a good
421         centralized place for this policy implementation. This is the class which decides
422         if we should be consulting its RenderStyle or the platform itself when we decide
423         where to put the scrollbars.
424
425         Putting this decision inside the renderer is important because ScrollableArea
426         often needs to know if scrollbars should be put on the left, but ScrollableArea
427         doesn't know anything about RenderStyles. Therefore, the renderer must be the
428         intermediary between ScrollableArea and the RenderStyle. (ScrollableArea also
429         doesn't directly know anything about renderers either; however, each of the
430         subclasses knows about an appropriate renderer.) Therefore, ScrollableArea gets
431         a new virtual method which is implemented by the RenderLayerModelObject.
432
433         Tests: fast/scrolling/rtl-scrollbars*.html
434
435         * WebCore.xcodeproj/project.pbxproj: ScrollableAreaMac.mm is no longer necessary.
436         * page/FrameView.cpp:
437         (WebCore::FrameView::shouldPlaceBlockDirectionScrollbarOnLeft): Overridden
438         ScrollableArea function.
439         * page/FrameView.h:
440         * page/Settings.h:
441         * page/Settings.in:
442         * platform/ScrollView.cpp: Adding two new settings: One to know if we should
443         consult with the RenderStyle or the platform, and the other is whether or not
444         the platform considers itself to be RTL.
445         (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin): Update to
446         use new mechanism.
447         (WebCore::ScrollView::updateScrollbars): Ditto.
448         (WebCore::ScrollView::scrollCornerRect): Ditto.
449         (WebCore::ScrollView::locationOfContents): Ditto.
450         * platform/ScrollableArea.cpp:
451         (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. This was the old
452         mechanism.
453         (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. Ditto.
454         * platform/ScrollableArea.h:
455         * platform/mac/ScrollableAreaMac.mm: Removed.
456         (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted.
457         (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted.
458         * platform/mac/ScrollbarThemeMac.mm:
459         (WebCore::ScrollbarThemeMac::didCreateScrollerImp): Update to use new
460         mechanism.
461         * platform/text/WritingMode.h: These enums should match what's in WebKit2.
462         * rendering/RenderBlock.cpp:
463         (WebCore::RenderBlock::logicalLeftOffsetForContent): Update to use new mechanism.
464         (WebCore::RenderBlock::logicalRightOffsetForContent): Ditto.
465         * rendering/RenderBlockFlow.cpp:
466         (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): Ditto.
467         * rendering/RenderBox.cpp: Ditto.
468         (WebCore::RenderBox::contentBoxRect):
469         (WebCore::RenderBox::overflowClipRect):
470         (WebCore::RenderBox::computePositionedLogicalWidth):
471         (WebCore::RenderBox::layoutOverflowRectForPropagation):
472         * rendering/RenderBoxModelObject.cpp: Ditto.
473         (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
474         * rendering/RenderLayer.cpp:
475         (WebCore::RenderLayer::resize): Ditto.
476         (WebCore::cornerStart): Migrate to use references.
477         (WebCore::cornerRect): Ditto.
478         (WebCore::RenderLayer::scrollCornerRect): Ditto.
479         (WebCore::resizerCornerRect): Ditto.
480         (WebCore::RenderLayer::scrollCornerAndResizerRect): Ditto.
481         (WebCore::RenderLayer::verticalScrollbarStart): Update to use new mechanism.
482         (WebCore::RenderLayer::horizontalScrollbarStart): Ditto.
483         (WebCore::RenderLayer::offsetFromResizeCorner): Ditto.
484         (WebCore::RenderLayer::positionOverflowControls): Migrate to use references.
485         (WebCore::RenderLayer::computeScrollDimensions): Ditto.
486         (WebCore::RenderLayer::overflowControlsIntersectRect): Ditto.
487         (WebCore::RenderLayer::drawPlatformResizerImage): Update to use new mechanism.
488         (WebCore::RenderLayer::paintResizer): Migrate to use references.
489         (WebCore::RenderLayer::isPointInResizeControl): Ditto.
490         (WebCore::RenderLayer::hitTestOverflowControls): Ditto.
491         (WebCore::RenderLayer::hitTestResizerInFragments): Ditto.
492         * rendering/RenderLayer.h: ScrollableArea override
493         * rendering/RenderLayerCompositor.cpp:
494         (WebCore::RenderLayerCompositor::positionForClipLayer): Update to use new
495         mechanism.
496         * rendering/RenderLayerModelObject.cpp:
497         (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft):
498         This is the meat of this patch. This is where we decide if we should be
499         interrogating the RenderStyle or the underlying platform.
500         * rendering/RenderLayerModelObject.h:
501         * rendering/RenderListBox.cpp: Update to use new mechanism.
502         (WebCore::RenderListBox::itemBoundingBoxRect):
503         (WebCore::RenderListBox::paintScrollbar):
504         (WebCore::RenderListBox::isPointInOverflowControl):
505         (WebCore::RenderListBox::listIndexAtOffset):
506         (WebCore::RenderListBox::controlClipRect):
507         (WebCore::RenderListBox::invalidateScrollbarRect):
508         (WebCore::RenderListBox::convertFromScrollbarToContainingView):
509         (WebCore::RenderListBox::convertFromContainingViewToScrollbar):
510         * rendering/RenderListBox.h:
511         * rendering/RenderView.cpp: Ditto.
512         (WebCore::RenderView::repaintViewRectangle):
513         * rendering/style/RenderStyle.cpp:
514         (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft): This
515         function is now much dumber. It just inspects its own style.
516         * testing/InternalSettings.cpp: Allow mocking.
517         (WebCore::InternalSettings::Backup::Backup):
518         (WebCore::InternalSettings::Backup::restoreTo):
519         (WebCore::InternalSettings::verticalScrollbarLocationPolicy):
520         (WebCore::InternalSettings::setVerticalScrollbarLocationPolicy):
521         (WebCore::InternalSettings::systemLayoutDirection):
522         (WebCore::InternalSettings::setSystemLayoutDirection):
523         * testing/InternalSettings.h:
524         * testing/InternalSettings.idl:
525
526 2016-04-26  Chris Dumez  <cdumez@apple.com>
527
528         [Web IDL] Specify default values for optional parameters of type 'unsigned long'
529         https://bugs.webkit.org/show_bug.cgi?id=157043
530
531         Reviewed by Alex Christensen.
532
533         Specify default values for optional parameters of type 'unsigned long' and let
534         the bindings generator use WTF::Optional<> for the parameters that do not have
535         such default value.
536
537         * Modules/webaudio/AudioContext.cpp:
538         (WebCore::AudioContext::createScriptProcessor): Deleted.
539         (WebCore::AudioContext::createChannelSplitter): Deleted.
540         (WebCore::AudioContext::createChannelMerger): Deleted.
541         * Modules/webaudio/AudioContext.h:
542         * Modules/webaudio/AudioContext.idl:
543         * bindings/scripts/CodeGeneratorJS.pm:
544         (CanUseWTFOptionalForParameter): Deleted.
545         * css/CSSStyleSheet.cpp:
546         (WebCore::CSSStyleSheet::addRule):
547         * css/CSSStyleSheet.h:
548         * inspector/InspectorStyleSheet.cpp:
549         (WebCore::InspectorStyleSheet::addRule):
550
551 2016-04-26  Ryosuke Niwa  <rniwa@webkit.org>
552
553         ASSERTION FAILED: m_templateInsertionModes.isEmpty() in WebCore::HTMLTreeBuilder::finished
554         https://bugs.webkit.org/show_bug.cgi?id=143519
555
556         Reviewed by Darin Adler.
557
558         The assertion failure was caused by our parser inconsistently following the spec. Fixed it by making our HTML parser
559         match the latest HTML5 specification. See inline comments below.
560
561         Tests: fast/dom/HTMLTemplateElement/parsing-template-with-frameset.html
562                html5lib/generated/run-template-data.html
563                html5lib/generated/run-template-write.html
564                imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html
565                imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html
566                imported/w3c/web-platform-tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/end-tag-frameset.html
567
568         * html/parser/HTMLTreeBuilder.cpp:
569         (WebCore::HTMLTreeBuilder::processStartTagForInBody): When parsing a template element for 'in body' insertion mode,
570         we process the token using the rules for 'in head' insertion mode, which sets the frameset-ok flag to "not ok".
571         In addition, 'in template' insertion mode should not special case a start tag whose tag name is "frame". Instead,
572         fallback to using 'in body' insertion mode.
573         https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
574         (WebCore::HTMLTreeBuilder::processStartTag): 'in frameset' insertion mode should not special case a start tag whose
575         tag name is "template": https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inframeset
576         (WebCore::HTMLTreeBuilder::processEndTag): Ditto for an end tag whose name is "template".
577         (WebCore::HTMLTreeBuilder::processStartTagForInHead): When parsing a template element in 'in head' inserting mode,
578         we set the frameset-ok flag to "not ok": https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
579
580 2016-04-26  Filip Pizlo  <fpizlo@apple.com>
581
582         WebCore on Mac ignores the user's preferred region (country) while getting the language
583         https://bugs.webkit.org/show_bug.cgi?id=156993
584
585         Reviewed by Geoffrey Garen.
586
587         This is tested by the NavigatorLanguage API test.
588         
589         WebCore was previously getting the list of preferred languages, and for each one, deducing
590         the default region. That's wrong, since for example it doesn't respect the user's choice (in
591         System Preferences) to display dates/calenders/etc according to a different region (like how
592         I have my machine set to en-pl right now).
593         
594         It might be possible for the country code we get via kCFLocaleCountryCode to be something
595         that our ICU doesn't handle. To defend against this, we search for the resulting country
596         code in ICU's ISO countries list. If it doesn't appear in that list, we fall back on old
597         behavior.
598
599         * platform/mac/Language.mm:
600         (WebCore::httpStyleLanguageCode):
601         (WebCore::isValidICUCountryCode):
602         (WebCore::platformUserPreferredLanguages):
603
604 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
605
606         Use auto-generated operators in FontPlatformData
607         https://bugs.webkit.org/show_bug.cgi?id=157037
608
609         Reviewed by Geoffrey Garen.
610
611         The only reason why they weren't used before is because Cairo was
612         using a raw pointer. However, RefPtr supports Cairo types, so this
613         patch migrates that pointer to a RefPtr. Therefore, we can remove
614         our custom operators (because they work the same way as auto-
615         generated ones do).
616
617         No new tests because there is no behavior change.
618
619         * platform/graphics/FontPlatformData.cpp:
620         (WebCore::FontPlatformData::FontPlatformData): Deleted.
621         (WebCore::FontPlatformData::operator=): Deleted.
622         * platform/graphics/FontPlatformData.h:
623         (WebCore::FontPlatformData::scaledFont):
624         (WebCore::FontPlatformData::hash):
625         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
626         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
627         (WebCore::FontPlatformData::platformDataInit): Deleted.
628         (WebCore::FontPlatformData::platformDataAssign): Deleted.
629         * platform/graphics/win/FontPlatformDataCGWin.cpp:
630         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
631         (WebCore::FontPlatformData::platformDataInit): Deleted.
632         (WebCore::FontPlatformData::platformDataAssign): Deleted.
633         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
634         (WebCore::FontPlatformData::platformDataInit):
635         (WebCore::FontPlatformData::FontPlatformData):
636         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
637         (WebCore::FontPlatformData::platformDataAssign): Deleted.
638         * platform/graphics/win/FontPlatformDataWin.cpp:
639         (WebCore::FontPlatformData::FontPlatformData): Deleted.
640
641 2016-04-26  Zalan Bujtas  <zalan@apple.com>
642
643         Add renderer address and needslayout state to inlineboxtree dump.
644         https://bugs.webkit.org/show_bug.cgi?id=157035
645
646         Reviewed by Simon Fraser.
647
648         * rendering/InlineBox.cpp:
649         (WebCore::InlineBox::showLineBox):
650         * rendering/InlineTextBox.cpp:
651         (WebCore::InlineTextBox::showLineBox):
652         * rendering/SimpleLineLayoutFunctions.cpp:
653         (WebCore::SimpleLineLayout::printPrefix):
654
655 2016-04-26  Fujii Hironori  <Hironori.Fujii@sony.com>
656
657         [curl] Requests interrupted when using https via proxy
658         https://bugs.webkit.org/show_bug.cgi?id=157028
659
660         Reviewed by Alex Christensen.
661
662         A proxy responds "200 Connection Established" to a CONNECT
663         method.  This response doesn't have Content-Type, then the
664         request is canceled due to a unsupported MIME type. This is not
665         a real response from the recipient server. It should not be
666         processed normally. Just ignore the response.
667
668         * platform/network/curl/ResourceHandleManager.cpp:
669         (WebCore::headerCallback):
670         Do nothing if httpCode is 0. This is the case of "200 Connection Established".
671
672 2016-04-26  Chris Dumez  <cdumez@apple.com>
673
674         Drop Dictionary from CanUseWTFOptionalForParameter()
675         https://bugs.webkit.org/show_bug.cgi?id=157023
676
677         Reviewed by Darin Adler.
678
679         As per Web IDL, optional dictionary parameters are always considered to have
680         a default value of an empty dictionary, unless otherwise specified. There is
681         therefore never any need to use Optional<> for it. Just implement this
682         behavior in the bindings generator and drop blacklisting of Dictionary from
683         CanUseWTFOptionalForParameter().
684
685         * bindings/scripts/CodeGeneratorJS.pm:
686         (GenerateParametersCheck):
687         (CanUseWTFOptionalForParameter): Deleted.
688         * bindings/scripts/test/JS/JSTestObj.cpp:
689         (WebCore::jsTestObjPrototypeFunctionOptionsObject):
690
691 2016-04-26  Antti Koivisto  <antti@apple.com>
692
693         RenderElement::style() should return const RenderStyle
694         https://bugs.webkit.org/show_bug.cgi?id=157016
695
696         Reviewed by Geoff Garen.
697
698         Style should be changed via setStyle, not by mutating it directly.
699
700         Pulling this string turns RenderStyle const in many places.
701
702         * accessibility/AccessibilityObject.cpp:
703         (WebCore::startOfStyleRange):
704         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
705         (getAttributeSetForAccessibilityObject):
706         * bindings/objc/DOM.mm:
707         (-[DOMNode innerFrameQuad]):
708         (-[DOMNode computedFontSize]):
709         * css/CSSComputedStyleDeclaration.cpp:
710         (WebCore::createPositionListForLayer):
711         (WebCore::positionOffsetValue):
712         (WebCore::ComputedStyleExtractor::currentColorOrValidColor):
713         (WebCore::getTransitionPropertyValue):
714         (WebCore::scrollSnapDestination):
715         (WebCore::scrollSnapPoints):
716         (WebCore::scrollSnapCoordinates):
717         (WebCore::logUnimplementedPropertyID):
718         (WebCore::fontFamilyFromStyle):
719         (WebCore::lineHeightFromStyle):
720         (WebCore::fontSizeFromStyle):
721         (WebCore::fontStyleFromStyle):
722         (WebCore::fontVariantFromStyle):
723         (WebCore::fontWeightFromStyle):
724         (WebCore::fontSynthesisFromStyle):
725         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
726         (WebCore::paddingOrMarginIsRendererDependent):
727         (WebCore::convertToRegionBreak):
728         (WebCore::isLayoutDependent):
729         (WebCore::updateStyleIfNeededForNode):
730         (WebCore::computeRenderStyleForProperty):
731         (WebCore::ComputedStyleExtractor::propertyValue):
732         (WebCore::CSSComputedStyleDeclaration::length):
733         (WebCore::CSSComputedStyleDeclaration::item):
734         (WebCore::ComputedStyleExtractor::propertyMatches):
735         * css/CSSComputedStyleDeclaration.h:
736         * css/CSSToLengthConversionData.cpp:
737         (WebCore::CSSToLengthConversionData::viewportWidthFactor):
738         (WebCore::CSSToLengthConversionData::viewportHeightFactor):
739         (WebCore::CSSToLengthConversionData::viewportMinFactor):
740         (WebCore::CSSToLengthConversionData::viewportMaxFactor):
741         * css/CSSToLengthConversionData.h:
742         (WebCore::CSSToLengthConversionData::CSSToLengthConversionData):
743         (WebCore::CSSToLengthConversionData::style):
744         (WebCore::CSSToLengthConversionData::rootStyle):
745         (WebCore::CSSToLengthConversionData::computingFontSize):
746         (WebCore::CSSToLengthConversionData::copyWithAdjustedZoom):
747         * css/CSSToStyleMap.cpp:
748         (WebCore::CSSToStyleMap::style):
749         (WebCore::CSSToStyleMap::rootElementStyle):
750         * css/CSSToStyleMap.h:
751         * css/MediaQueryEvaluator.cpp:
752         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
753         * css/MediaQueryEvaluator.h:
754         * css/SVGCSSComputedStyleDeclaration.cpp:
755         (WebCore::strokeDashArrayToCSSValueList):
756         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
757         (WebCore::ComputedStyleExtractor::svgPropertyValue):
758         * css/SourceSizeList.cpp:
759         (WebCore::match):
760         (WebCore::defaultLength):
761         (WebCore::computeLength):
762         (WebCore::parseSizesAttribute):
763         * css/StyleBuilderCustom.h:
764         (WebCore::ApplyPropertyBorderImageModifier::applyValue):
765         (WebCore::ApplyPropertyBorderImageModifier::getValue):
766         (WebCore::StyleBuilderCustom::applyInheritClip):
767         (WebCore::StyleBuilderCustom::applyInheritCounter):
768         (WebCore::StyleBuilderCustom::applyValueContent):
769         (WebCore::StyleBuilderCustom::applyValueAlt):
770         * css/StyleResolver.cpp:
771         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
772         (WebCore::StyleResolver::State::State):
773         (WebCore::isAtShadowBoundary):
774         (WebCore::StyleResolver::styleForElement):
775         (WebCore::StyleResolver::keyframeStylesForAnimation):
776         (WebCore::StyleResolver::pseudoStyleForElement):
777         (WebCore::StyleResolver::applyProperty):
778         (WebCore::StyleResolver::checkForTextSizeAdjust):
779         (WebCore::StyleResolver::checkForZoomChange):
780         (WebCore::StyleResolver::checkForGenericFamilyChange):
781         * css/StyleResolver.h:
782         (WebCore::StyleResolver::style):
783         (WebCore::StyleResolver::parentStyle):
784         (WebCore::StyleResolver::rootElementStyle):
785         (WebCore::StyleResolver::element):
786         (WebCore::StyleResolver::document):
787         (WebCore::StyleResolver::documentSettings):
788         (WebCore::StyleResolver::State::State):
789         (WebCore::StyleResolver::State::takeStyle):
790         (WebCore::StyleResolver::State::parentStyle):
791         (WebCore::StyleResolver::State::rootElementStyle):
792         (WebCore::StyleResolver::State::regionForStyling):
793         (WebCore::StyleResolver::State::elementLinkState):
794         * dom/Document.cpp:
795         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
796         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
797         (WebCore::Document::setVisuallyOrdered):
798         (WebCore::Document::createParser):
799         * dom/Document.h:
800         * dom/Element.cpp:
801         (WebCore::Element::styleResolver):
802         (WebCore::Element::resolveStyle):
803         (WebCore::checkForEmptyStyleChange):
804         (WebCore::checkForSiblingStyleChanges):
805         (WebCore::beforeOrAfterPseudoElement):
806         (WebCore::Element::existingComputedStyle):
807         (WebCore::Element::resolveComputedStyle):
808         (WebCore::Element::computedStyle):
809         (WebCore::Element::didDetachRenderers):
810         (WebCore::Element::resolveCustomStyle):
811         * dom/Element.h:
812         * dom/Node.cpp:
813         (WebCore::computeEditabilityFromComputedStyle):
814         (WebCore::Node::pseudoAwareLastChild):
815         (WebCore::Node::computedStyle):
816         * dom/Node.h:
817         * dom/NodeRenderStyle.h:
818         (WebCore::Node::renderStyle):
819         * dom/PseudoElement.cpp:
820         (WebCore::PseudoElement::clearHostElement):
821         (WebCore::PseudoElement::resolveCustomStyle):
822         * dom/PseudoElement.h:
823         * editing/ApplyBlockElementCommand.cpp:
824         (WebCore::isNewLineAtPosition):
825         (WebCore::ApplyBlockElementCommand::renderStyleOfEnclosingTextNode):
826         (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
827         (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
828         * editing/ApplyBlockElementCommand.h:
829         * editing/EditingStyle.cpp:
830         (WebCore::EditingStyle::init):
831         (WebCore::EditingStyle::removeTextFillAndStrokeColorsIfNeeded):
832         * editing/EditingStyle.h:
833         * editing/Editor.h:
834         * editing/SimplifyMarkupCommand.cpp:
835         (WebCore::SimplifyMarkupCommand::doApply):
836         * editing/cocoa/EditorCocoa.mm:
837         (WebCore::Editor::styleForSelectionStart):
838         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle):
839         * editing/ios/EditorIOS.mm:
840         (WebCore::Editor::fontForSelection):
841         (WebCore::Editor::fontAttributesForSelectionStart):
842         * editing/mac/EditorMac.mm:
843         (WebCore::Editor::fontForSelection):
844         (WebCore::Editor::fontAttributesForSelectionStart):
845         * html/HTMLTitleElement.cpp:
846         (WebCore::HTMLTitleElement::computedTextWithDirection):
847         * html/canvas/CanvasRenderingContext2D.cpp:
848         (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate):
849         (WebCore::CanvasRenderingContext2D::FontProxy::initialize):
850         (WebCore::CanvasRenderingContext2D::setFont):
851         (WebCore::CanvasRenderingContext2D::setTextBaseline):
852         (WebCore::CanvasRenderingContext2D::toTextDirection):
853         (WebCore::CanvasRenderingContext2D::drawTextInternal):
854         * html/canvas/CanvasRenderingContext2D.h:
855         * html/parser/HTMLResourcePreloader.cpp:
856         (WebCore::HTMLResourcePreloader::preload):
857         (WebCore::mediaAttributeMatches):
858         * html/shadow/SliderThumbElement.cpp:
859         (WebCore::RenderSliderThumb::RenderSliderThumb):
860         (WebCore::RenderSliderThumb::updateAppearance):
861         (WebCore::RenderSliderContainer::layout):
862         (WebCore::SliderThumbElement::hostInput):
863         (WebCore::SliderThumbElement::resolveCustomStyle):
864         (WebCore::SliderContainerElement::createElementRenderer):
865         (WebCore::SliderContainerElement::resolveCustomStyle):
866         * html/shadow/SliderThumbElement.h:
867         * html/shadow/TextControlInnerElements.cpp:
868         (WebCore::TextControlInnerElement::create):
869         (WebCore::TextControlInnerElement::resolveCustomStyle):
870         (WebCore::TextControlInnerTextElement::renderer):
871         (WebCore::TextControlInnerTextElement::resolveCustomStyle):
872         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
873         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
874         * html/shadow/TextControlInnerElements.h:
875         * page/EventHandler.cpp:
876         (WebCore::EventHandler::selectCursor):
877         * page/animation/AnimationBase.cpp:
878         (WebCore::solveStepsFunction):
879         (WebCore::AnimationBase::AnimationBase):
880         * page/animation/AnimationBase.h:
881         (WebCore::AnimationBase::~AnimationBase):
882         (WebCore::AnimationBase::renderer):
883         (WebCore::AnimationBase::animation):
884         (WebCore::AnimationBase::setAnimation):
885         * page/animation/AnimationController.cpp:
886         (WebCore::AnimationController::cancelAnimations):
887         (WebCore::AnimationController::updateAnimations):
888         * page/animation/AnimationController.h:
889         * page/animation/CompositeAnimation.cpp:
890         (WebCore::CompositeAnimation::clearRenderer):
891         (WebCore::CompositeAnimation::updateTransitions):
892         (WebCore::CompositeAnimation::updateKeyframeAnimations):
893         (WebCore::CompositeAnimation::animate):
894         * page/animation/CompositeAnimation.h:
895         * page/animation/ImplicitAnimation.cpp:
896         (WebCore::ImplicitAnimation::ImplicitAnimation):
897         (WebCore::ImplicitAnimation::shouldSendEventForListener):
898         (WebCore::ImplicitAnimation::animate):
899         (WebCore::ImplicitAnimation::sendTransitionEvent):
900         (WebCore::ImplicitAnimation::reset):
901         * page/animation/ImplicitAnimation.h:
902         (WebCore::ImplicitAnimation::create):
903         * page/animation/KeyframeAnimation.cpp:
904         (WebCore::KeyframeAnimation::KeyframeAnimation):
905         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
906         (WebCore::KeyframeAnimation::animate):
907         * page/animation/KeyframeAnimation.h:
908         * page/ios/FrameIOS.mm:
909         (WebCore::ancestorRespondingToScrollWheelEvents):
910         * rendering/FlowThreadController.cpp:
911         (WebCore::FlowThreadController::styleDidChange):
912         * rendering/InlineFlowBox.cpp:
913         (WebCore::clipRectForNinePieceImageStrip):
914         * rendering/RenderBlock.cpp:
915         (WebCore::RenderBlock::styleDidChange):
916         (WebCore::RenderBlock::lineHeight):
917         (WebCore::RenderBlock::firstLineBlock):
918         (WebCore::styleForFirstLetter):
919         (WebCore::RenderBlock::updateFirstLetterStyle):
920         (WebCore::RenderBlock::createFirstLetterRenderer):
921         * rendering/RenderBlockFlow.cpp:
922         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
923         (WebCore::calculateMinimumPageHeight):
924         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
925         * rendering/RenderBox.cpp:
926         (WebCore::RenderBox::styleDidChange):
927         (WebCore::RenderBox::borderRadii):
928         (WebCore::RenderBox::enclosingFloatPaintingLayer):
929         (WebCore::RenderBox::logicalVisualOverflowRectForPropagation):
930         (WebCore::RenderBox::visualOverflowRectForPropagation):
931         (WebCore::RenderBox::logicalLayoutOverflowRectForPropagation):
932         (WebCore::RenderBox::layoutOverflowRectForPropagation):
933         * rendering/RenderBox.h:
934         (WebCore::RenderBox::applyTopLeftLocationOffset):
935         (WebCore::RenderBox::hasRenderOverflow):
936         (WebCore::RenderBox::hasVisualOverflow):
937         * rendering/RenderBoxModelObject.cpp:
938         (WebCore::RenderBoxModelObject::backgroundRoundedRectAdjustedForBleedAvoidance):
939         (WebCore::applyBoxShadowForBackground):
940         * rendering/RenderButton.cpp:
941         (WebCore::RenderButton::addChild):
942         (WebCore::RenderButton::styleWillChange):
943         (WebCore::RenderButton::styleDidChange):
944         (WebCore::RenderButton::setupInnerStyle):
945         (WebCore::RenderButton::layout):
946         * rendering/RenderDeprecatedFlexibleBox.cpp:
947         (WebCore::RenderDeprecatedFlexibleBox::styleWillChange):
948         * rendering/RenderElement.cpp:
949         (WebCore::RenderElement::createFor):
950         (WebCore::RenderElement::uncachedFirstLineStyle):
951         (WebCore::RenderElement::cachedFirstLineStyle):
952         (WebCore::RenderElement::firstLineStyle):
953         (WebCore::RenderElement::styleWillChange):
954         (WebCore::RenderElement::addControlStatesForRenderer):
955         (WebCore::RenderElement::getCachedPseudoStyle):
956         (WebCore::RenderElement::getMutableCachedPseudoStyle):
957         (WebCore::RenderElement::getUncachedPseudoStyle):
958         (WebCore::RenderElement::paintOutline):
959         * rendering/RenderElement.h:
960         (WebCore::RenderElement::hasInitializedStyle):
961         (WebCore::RenderElement::style):
962         (WebCore::RenderElement::mutableStyle):
963         (WebCore::RenderElement::element):
964         (WebCore::RenderObject::isRenderInline):
965         (WebCore::RenderObject::style):
966         (WebCore::RenderObject::firstLineStyle):
967         * rendering/RenderEmbeddedObject.cpp:
968         (WebCore::RenderEmbeddedObject::layout):
969         * rendering/RenderFlowThread.cpp:
970         (WebCore::RenderFlowThread::RenderFlowThread):
971         (WebCore::RenderFlowThread::createFlowThreadStyle):
972         * rendering/RenderFlowThread.h:
973         * rendering/RenderImage.cpp:
974         (WebCore::RenderImage::layoutShadowControls):
975         * rendering/RenderInline.cpp:
976         (WebCore::RenderInline::styleDidChange):
977         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
978         (WebCore::RenderInline::paintOutline):
979         * rendering/RenderLayer.cpp:
980         (WebCore::RenderLayer::setupClipPath):
981         * rendering/RenderListBox.cpp:
982         (WebCore::RenderListBox::paintScrollbar):
983         (WebCore::itemOffsetForAlignment):
984         (WebCore::RenderListBox::paintItemForeground):
985         (WebCore::RenderListBox::paintItemBackground):
986         * rendering/RenderListMarker.cpp:
987         (WebCore::RenderListMarker::updateMargins):
988         (WebCore::RenderListMarker::lineHeight):
989         * rendering/RenderMarquee.cpp:
990         (WebCore::RenderMarquee::computePosition):
991         (WebCore::RenderMarquee::updateMarqueeStyle):
992         * rendering/RenderMenuList.cpp:
993         (WebCore::RenderMenuList::adjustInnerStyle):
994         (RenderMenuList::updateOptionsWidth):
995         (RenderMenuList::itemStyle):
996         * rendering/RenderMultiColumnFlowThread.cpp:
997         (WebCore::isValidColumnSpanner):
998         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
999         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
1000         * rendering/RenderMultiColumnSpannerPlaceholder.h:
1001         * rendering/RenderNamedFlowFragment.cpp:
1002         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
1003         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
1004         * rendering/RenderNamedFlowFragment.h:
1005         * rendering/RenderObject.cpp:
1006         (WebCore::RenderObject::innerLineHeight):
1007         (WebCore::decorationColor):
1008         (WebCore::RenderObject::getTextDecorationColorsAndStyles):
1009         * rendering/RenderObject.h:
1010         (WebCore::RenderObject::minPreferredLogicalWidth):
1011         (WebCore::RenderObject::maxPreferredLogicalWidth):
1012         * rendering/RenderTable.cpp:
1013         (WebCore::RenderTable::computePreferredLogicalWidths):
1014         * rendering/RenderTableSection.cpp:
1015         (WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
1016         (WebCore::physicalBorderForDirection):
1017         * rendering/RenderText.h:
1018         (WebCore::RenderText::characterAt):
1019         (WebCore::RenderText::style):
1020         (WebCore::RenderText::firstLineStyle):
1021         (WebCore::RenderText::getCachedPseudoStyle):
1022         * rendering/RenderTextControl.cpp:
1023         (WebCore::RenderTextControl::styleDidChange):
1024         * rendering/RenderTextControlMultiLine.cpp:
1025         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
1026         * rendering/RenderTextControlSingleLine.cpp:
1027         (WebCore::RenderTextControlSingleLine::layout):
1028         (WebCore::RenderTextControlSingleLine::styleDidChange):
1029         * rendering/RenderTextFragment.cpp:
1030         (WebCore::RenderTextFragment::styleDidChange):
1031         * rendering/RenderThemeGtk.cpp:
1032         (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
1033         (WebCore::borderRadiiFromStyle):
1034         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
1035         (WebCore::RenderThemeGtk::paintMediaSliderThumb):
1036         (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
1037         * rendering/SimpleLineLayoutFunctions.cpp:
1038         (WebCore::SimpleLineLayout::paintFlow):
1039         (WebCore::SimpleLineLayout::hitTestFlow):
1040         * rendering/TextAutoSizing.cpp:
1041         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
1042         * rendering/TextAutoSizing.h:
1043         (WebCore::TextAutoSizingKey::style):
1044         (WebCore::TextAutoSizingKey::isDeleted):
1045         * rendering/TextPaintStyle.cpp:
1046         (WebCore::computeTextSelectionPaintStyle):
1047         * rendering/line/BreakingContext.h:
1048         * rendering/mathml/RenderMathMLRoot.cpp:
1049         (WebCore::RenderMathMLRoot::layout):
1050         * rendering/style/RenderStyle.h:
1051         (WebCore::RenderStyle::setColumnRuleWidth):
1052         (WebCore::RenderStyle::resetColumnRule):
1053         (WebCore::RenderStyle::setColumnSpan):
1054         (WebCore::RenderStyle::inheritColumnPropertiesFrom):
1055         (WebCore::RenderStyle::setTransform):
1056         (WebCore::RenderStyle::setTransformOriginX):
1057         (WebCore::RenderStyle::setTransformOriginY):
1058         * rendering/svg/SVGInlineTextBox.cpp:
1059         (WebCore::SVGInlineTextBox::positionForOffset):
1060         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
1061         (WebCore::SVGInlineTextBox::localSelectionRect):
1062         (WebCore::SVGInlineTextBox::paintSelectionBackground):
1063         (WebCore::SVGInlineTextBox::paint):
1064         (WebCore::SVGInlineTextBox::acquirePaintingResource):
1065         (WebCore::SVGInlineTextBox::releasePaintingResource):
1066         (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
1067         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
1068         (WebCore::SVGInlineTextBox::constructTextRun):
1069         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
1070         (WebCore::SVGInlineTextBox::paintTextWithShadows):
1071         (WebCore::SVGInlineTextBox::paintText):
1072         * rendering/svg/SVGInlineTextBox.h:
1073         * rendering/svg/SVGPathData.cpp:
1074         (WebCore::updatePathFromCircleElement):
1075         (WebCore::updatePathFromEllipseElement):
1076         (WebCore::updatePathFromRectElement):
1077         * rendering/svg/SVGRenderingContext.cpp:
1078         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1079         * style/StyleTreeResolver.cpp:
1080         (WebCore::Style::TreeResolver::Parent::Parent):
1081         (WebCore::Style::TreeResolver::popScope):
1082         (WebCore::Style::TreeResolver::styleForElement):
1083         (WebCore::Style::TreeResolver::pushParent):
1084         (WebCore::Style::TreeResolver::resolveComposedTree):
1085         * style/StyleTreeResolver.h:
1086         (WebCore::Style::TreeResolver::scope):
1087         * style/StyleUpdate.cpp:
1088         (WebCore::Style::Update::textUpdate):
1089         (WebCore::Style::Update::elementStyle):
1090         (WebCore::Style::Update::addElement):
1091         * style/StyleUpdate.h:
1092         (WebCore::Style::Update::document):
1093         * svg/SVGElement.cpp:
1094         (WebCore::SVGElement::synchronizeSystemLanguage):
1095         (WebCore::SVGElement::resolveCustomStyle):
1096         (WebCore::SVGElement::setUseOverrideComputedStyle):
1097         (WebCore::SVGElement::computedStyle):
1098         * svg/SVGElement.h:
1099         * svg/SVGElementRareData.h:
1100         (WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
1101         (WebCore::SVGElementRareData::overrideComputedStyle):
1102         * svg/SVGGraphicsElement.cpp:
1103         (WebCore::SVGGraphicsElement::animatedLocalTransform):
1104         * svg/SVGLengthContext.cpp:
1105         (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits):
1106         (WebCore::renderStyleForLengthResolving):
1107         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS):
1108         (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits):
1109         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS):
1110         (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits):
1111         * svg/SVGStopElement.cpp:
1112         (WebCore::SVGStopElement::stopColorIncludingOpacity):
1113         * svg/SVGTextElement.cpp:
1114         (WebCore::SVGTextElement::animatedLocalTransform):
1115
1116 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
1117
1118         Make FontPlatformData immutable
1119         https://bugs.webkit.org/show_bug.cgi?id=157024
1120
1121         Reviewed by Darin Adler.
1122
1123         This patch deletes all functions which modify a FontPlatformData once
1124         it has been created. This makes for a cleaner design.
1125
1126         No new tests because there is no behavior change.
1127
1128         * platform/graphics/Font.cpp:
1129         (WebCore::Font::verticalRightOrientationFont):
1130         (WebCore::Font::nonSyntheticItalicFont):
1131         * platform/graphics/FontPlatformData.cpp:
1132         (WebCore::FontPlatformData::FontPlatformData):
1133         (WebCore::FontPlatformData::cloneWithOrientation):
1134         (WebCore::FontPlatformData::cloneWithSyntheticOblique):
1135         * platform/graphics/FontPlatformData.h:
1136         (WebCore::FontPlatformData::setIsSystemFont): Deleted.
1137         (WebCore::FontPlatformData::setSize): Deleted.
1138         (WebCore::FontPlatformData::setOrientation): Deleted.
1139         (WebCore::FontPlatformData::setSyntheticOblique): Deleted.
1140         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1141         (WebCore::FontCache::systemFallbackForCharacters):
1142         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1143         (WebCore::FontCascade::drawGlyphs):
1144         * platform/graphics/cocoa/FontCocoa.mm:
1145         (WebCore::Font::platformInit):
1146         (WebCore::Font::platformCharWidthInit):
1147         (WebCore::createDerivativeFont):
1148         (WebCore::Font::createFontWithoutSynthesizableFeatures):
1149         (WebCore::Font::platformCreateScaledFont):
1150         (WebCore::Font::platformWidthForGlyph):
1151         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1152         (WebCore::FontPlatformData::openTypeTable):
1153         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
1154         (WebCore::FontPlatformData::platformDataInit):
1155
1156 2016-04-26  Ryan Haddad  <ryanhaddad@apple.com>
1157
1158         Unreviewed, rolling out r200089.
1159
1160         This change causes API test failures
1161
1162         Reverted changeset:
1163
1164         "WebCore on Mac ignores the user's preferred region (country)
1165         while getting the language"
1166         https://bugs.webkit.org/show_bug.cgi?id=156993
1167         http://trac.webkit.org/changeset/200089
1168
1169 2016-04-26  Brent Fulgham  <bfulgham@apple.com>
1170
1171         GuardMalloc crash in WebCore::HTMLFrameElementBase::marginHeight() 
1172         https://bugs.webkit.org/show_bug.cgi?id=157020
1173         <rdar://problem/25148315>
1174
1175         Reviewed by Darin Adler.
1176
1177         Calls to setIntegralAttribute triggers event handling code, which can cause
1178         the underlying m_frameOwnerElement member to be deleted. We could clone this
1179         object, but since we only want the width and height we should just read them
1180         while we know the object is in a good state, then execute the potentially
1181         mutating methods.
1182
1183         Tested by imported/blink/fast/dom/HTMLBodyElement/body-inserting-iframe-crash.html.
1184
1185         * html/HTMLBodyElement.cpp:
1186         (WebCore::HTMLBodyElement::insertedInto): Read margin width and height before
1187         calling setIntegralAttribute.
1188
1189 2016-04-25  Filip Pizlo  <fpizlo@apple.com>
1190
1191         WebCore on Mac ignores the user's preferred region (country) while getting the language
1192         https://bugs.webkit.org/show_bug.cgi?id=156993
1193
1194         Reviewed by Geoffrey Garen.
1195
1196         I don't know how to test this since this depends on user settings.
1197         
1198         WebCore was previously getting the list of preferred languages, and for each one, deducing
1199         the default region. That's wrong, since for example it doesn't respect the user's choice (in
1200         System Preferences) to display dates/calenders/etc according to a different region (like how
1201         I have my machine set to en-pl right now).
1202         
1203         It might be possible for the country code we get via kCFLocaleCountryCode to be something
1204         that our ICU doesn't handle. To defend against this, we search for the resulting country
1205         code in ICU's ISO countries list. If it doesn't appear in that list, we fall back on old
1206         behavior.
1207
1208         * platform/mac/Language.mm:
1209         (WebCore::httpStyleLanguageCode):
1210         (WebCore::platformUserPreferredLanguages):
1211
1212 2016-04-26  Chris Dumez  <cdumez@apple.com>
1213
1214         [Web IDL] Specify default values for optional parameters of TypedArray types
1215         https://bugs.webkit.org/show_bug.cgi?id=157017
1216
1217         Reviewed by Darin Adler.
1218
1219         Specify default values for optional parameters of TypedArray types and let
1220         the bindings generator use WTF::Optional<> for the ones that do not have a
1221         default value.
1222
1223         * bindings/scripts/CodeGeneratorJS.pm:
1224         (CanUseWTFOptionalForParameter): Deleted.
1225         * html/HTMLMediaElement.cpp:
1226         (WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
1227         (WebCore::HTMLMediaElement::webkitAddKey):
1228         (WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
1229         * html/HTMLMediaElement.h:
1230         * html/HTMLMediaElement.idl:
1231
1232 2016-04-26  Chris Dumez  <cdumez@apple.com>
1233
1234         [Web IDL] Specify default values for optional parameters of type 'long' / 'unrestricted double'
1235         https://bugs.webkit.org/show_bug.cgi?id=157012
1236
1237         Reviewed by Darin Adler.
1238
1239         Specify default values for optional parameters of type 'long' / 'unrestricted double'
1240         and let the bindings generator use WTF::Optional<> for the ones that do not have a
1241         default value.
1242
1243         * Modules/mediastream/RTCDTMFSender.cpp:
1244         (WebCore::RTCDTMFSender::insertDTMF):
1245         (WebCore::RTCDTMFSender::didPlayTone): Deleted.
1246         * Modules/mediastream/RTCDTMFSender.h:
1247         * Modules/webaudio/AudioBufferSourceNode.cpp:
1248         (WebCore::AudioBufferSourceNode::start):
1249         (WebCore::AudioBufferSourceNode::startPlaying): Deleted.
1250         * Modules/webaudio/AudioBufferSourceNode.h:
1251         * Modules/webaudio/AudioBufferSourceNode.idl:
1252         * Modules/webaudio/AudioContext.cpp:
1253         (WebCore::AudioContext::createDelay): Deleted.
1254         * Modules/webaudio/AudioContext.h:
1255         * Modules/webaudio/AudioContext.idl:
1256         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1257         (WebCore::AudioScheduledSourceNode::start): Deleted.
1258         (WebCore::AudioScheduledSourceNode::stop): Deleted.
1259         * Modules/webaudio/AudioScheduledSourceNode.h:
1260         * Modules/webaudio/OscillatorNode.idl:
1261         * bindings/scripts/CodeGeneratorJS.pm:
1262         (CanUseWTFOptionalForParameter): Deleted.
1263         * bindings/scripts/test/JS/JSTestObj.cpp:
1264         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
1265         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
1266         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
1267         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
1268         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
1269         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
1270         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
1271         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue): Deleted.
1272         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString): Deleted.
1273         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): Deleted.
1274         (WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted.
1275         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): Deleted.
1276         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted.
1277         * html/HTMLInputElement.idl:
1278         * page/WindowTimers.idl:
1279         * testing/Internals.h:
1280         * testing/Internals.idl:
1281
1282 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1283
1284         Drop [UsePointersEvenForNonNullableObjectArguments] from SpeechSynthesis
1285         https://bugs.webkit.org/show_bug.cgi?id=156901
1286
1287         Reviewed by Darin Adler.
1288
1289         SpeechSynthesis.speak will now throw in case of bad parameters instead of silently failing.
1290         Started refactoring to use more references where possible.
1291
1292         Covered by updated test.
1293
1294         * Modules/speech/SpeechSynthesis.cpp:
1295         (WebCore::SpeechSynthesis::startSpeakingImmediately): Refactored to get a reference.
1296         (WebCore::SpeechSynthesis::speak):
1297         (WebCore::SpeechSynthesis::fireEvent):
1298         (WebCore::SpeechSynthesis::handleSpeakingCompleted): Removing first item in utteranceQueue unconditionally,
1299         since that would crash in Debug mode otherwise.
1300         (WebCore::SpeechSynthesis::boundaryEventOccurred):
1301         (WebCore::SpeechSynthesis::didStartSpeaking):
1302         (WebCore::SpeechSynthesis::didPauseSpeaking):
1303         (WebCore::SpeechSynthesis::didResumeSpeaking):
1304         (WebCore::SpeechSynthesis::didFinishSpeaking):
1305         (WebCore::SpeechSynthesis::speakingErrorOccurred):
1306         * Modules/speech/SpeechSynthesis.h:
1307         * Modules/speech/SpeechSynthesis.idl:
1308
1309 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1310
1311         Drop [UsePointersEvenForNonNullableObjectArguments] from WebKitNamedFlow
1312         https://bugs.webkit.org/show_bug.cgi?id=156979
1313
1314         Reviewed by Chris Dumez.
1315
1316         No change of behavior.
1317
1318         * dom/WebKitNamedFlow.idl: Marking contentNode parameter as nullable.
1319
1320 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1321
1322         Drop [UsePointersEvenForNonNullableObjectArguments] from EventTarget
1323         https://bugs.webkit.org/show_bug.cgi?id=156977
1324
1325         Reviewed by Chris Dumez.
1326
1327         No change of behavior.
1328
1329         * dom/EventTarget.idl:
1330
1331 2016-04-25  Ryosuke Niwa  <rniwa@webkit.org>
1332
1333         Remove the build flag for template elements
1334         https://bugs.webkit.org/show_bug.cgi?id=157022
1335
1336         Reviewed by Daniel Bates.
1337
1338         Removed the build flag.
1339
1340         * Configurations/FeatureDefines.xcconfig:
1341         * DerivedSources.cpp:
1342         * bindings/js/JSHTMLTemplateElementCustom.cpp:
1343         (WebCore::JSHTMLTemplateElement::content):
1344         * css/html.css:
1345         (summary::-webkit-details-marker):
1346         (template):
1347         (bdi, output):
1348         * dom/ContainerNode.cpp:
1349         (WebCore::isInTemplateContent):
1350         (WebCore::containsConsideringHostElements):
1351         (WebCore::ContainerNode::parserInsertBefore):
1352         (WebCore::ContainerNode::parserAppendChild):
1353         * dom/Document.cpp:
1354         (WebCore::Document::Document):
1355         (WebCore::Document::~Document):
1356         (WebCore::Document::getCachedLocale):
1357         (WebCore::Document::ensureTemplateDocument):
1358         (WebCore::Document::fonts):
1359         * dom/Document.h:
1360         (WebCore::Document::setTemplateDocumentHost):
1361         (WebCore::Document::templateDocumentHost):
1362         (WebCore::Document::hasDisabledFieldsetElement):
1363         (WebCore::Document::textEncoding):
1364         (WebCore::Document::templateDocument):
1365         * dom/Element.cpp:
1366         (WebCore::Element::setInnerHTML):
1367         * dom/Node.cpp:
1368         (WebCore::Node::containsIncludingHostElements):
1369         (WebCore::Node::pseudoAwarePreviousSibling):
1370         * dom/TemplateContentDocumentFragment.h:
1371         * editing/MarkupAccumulator.cpp:
1372         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
1373         * editing/markup.cpp:
1374         (WebCore::createFragmentForInnerOuterHTML):
1375         * html/HTMLTagNames.in:
1376         * html/HTMLTemplateElement.cpp:
1377         (WebCore::HTMLTemplateElement::didMoveToNewDocument):
1378         * html/HTMLTemplateElement.h:
1379         * html/HTMLTemplateElement.idl:
1380         * html/parser/HTMLConstructionSite.cpp:
1381         (WebCore::insert):
1382         (WebCore::HTMLConstructionSite::insertTextNode):
1383         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
1384         (WebCore::HTMLConstructionSite::findFosterSite):
1385         * html/parser/HTMLElementStack.cpp:
1386         (WebCore::HTMLNames::isScopeMarker):
1387         (WebCore::HTMLNames::isTableScopeMarker):
1388         (WebCore::HTMLNames::isTableBodyScopeMarker):
1389         (WebCore::HTMLNames::isTableRowScopeMarker):
1390         (WebCore::HTMLElementStack::inSelectScope):
1391         (WebCore::HTMLElementStack::hasTemplateInHTMLScope):
1392         (WebCore::HTMLElementStack::htmlElement):
1393         * html/parser/HTMLElementStack.h:
1394         * html/parser/HTMLPreloadScanner.cpp:
1395         (WebCore::TokenPreloadScanner::scan):
1396         * html/parser/HTMLPreloadScanner.h:
1397         * html/parser/HTMLStackItem.h:
1398         (WebCore::isSpecialNode):
1399         * html/parser/HTMLTreeBuilder.cpp:
1400         (WebCore::HTMLTreeBuilder::isParsingTemplateContents):
1401         (WebCore::HTMLTreeBuilder::isParsingFragmentOrTemplateContents):
1402         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
1403         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
1404         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
1405         (WebCore::HTMLTreeBuilder::processTemplateStartTag):
1406         (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
1407         (WebCore::HTMLTreeBuilder::processColgroupEndTagForInColumnGroup):
1408         (WebCore::HTMLTreeBuilder::processStartTagForInTable):
1409         (WebCore::HTMLTreeBuilder::processStartTag):
1410         (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
1411         (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
1412         (WebCore::HTMLTreeBuilder::processEndTagForInCell):
1413         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
1414         (WebCore::HTMLTreeBuilder::processEndTag):
1415         (WebCore::HTMLTreeBuilder::processCharacterBuffer):
1416         (WebCore::HTMLTreeBuilder::processEndOfFile):
1417         (WebCore::HTMLTreeBuilder::processStartTagForInHead):
1418         (WebCore::HTMLTreeBuilder::finished):
1419         * html/parser/HTMLTreeBuilder.h:
1420         * inspector/InspectorDOMAgent.cpp:
1421         (WebCore::InspectorDOMAgent::buildObjectForNode):
1422         * inspector/InspectorInstrumentation.h:
1423         (WebCore::InspectorInstrumentation::instrumentingAgentsForDocument):
1424         * xml/parser/XMLDocumentParserLibxml2.cpp:
1425         (WebCore::XMLDocumentParser::startElementNs):
1426
1427 2016-04-25  Jiewen Tan  <jiewen_tan@apple.com>
1428
1429         [iOS] ftp links crash @ WebCore::FTPDirectoryDocumentParser::appendEntry
1430         https://bugs.webkit.org/show_bug.cgi?id=157019
1431         <rdar://problem/24292650>
1432
1433         Reviewed by Chris Dumez.
1434
1435         Create separate Ref<Element> object for every row element instead of reusing
1436         one because Ref<>'s operator=() does not allow assignment after a WTFMove().
1437
1438         * html/FTPDirectoryDocument.cpp:
1439         (WebCore::FTPDirectoryDocumentParser::appendEntry):
1440
1441 2016-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
1442
1443         [Cocoa] Guarantee FontPlatformData's m_cgFont is never nullptr
1444         https://bugs.webkit.org/show_bug.cgi?id=156929
1445
1446         Reviewed by Darin Adler.
1447
1448         After some investigation, it turns out that there is no place where it is meaningful
1449         to pass us a null CoreText font. Therefore, the CoreGraphics font is also never null.
1450
1451         We should simply check for these null values at the ingestion site in order to
1452         make the guarantee internally of having non-null values.
1453
1454         * platform/graphics/FontPlatformData.cpp:
1455         (WebCore::FontPlatformData::FontPlatformData): Because the pointer is never null, we
1456         can delete the code which handles that case.
1457         * platform/graphics/FontPlatformData.h:
1458         * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Ditto.
1459         (WebCore::webFallbackFontFamily): Deleted.
1460         (WebCore::FontPlatformData::setFallbackCGFont): Deleted.
1461         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1462         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Asking the
1463         CTRun for its kCTFontAttributeName will always return non-null.
1464         * platform/graphics/mac/FontCustomPlatformData.cpp:
1465         (WebCore::FontCustomPlatformData::fontPlatformData): Once we have a font descriptor,
1466         CTFontCreateWithFontDescriptor() will always return non-null. We check if the font
1467         descriptor is null elsewhere.
1468         * platform/mac/DragImageMac.mm: The fonts in this file are gotten by asking for the
1469         system font, which will always return non-null.
1470         (WebCore::fontFromNSFont):
1471         (WebCore::widthWithFont):
1472         (WebCore::drawAtPoint):
1473         (WebCore::createDragImageForLink):
1474
1475 2016-04-25  Chris Dumez  <cdumez@apple.com>
1476
1477         Crash under MemoryCache::remove()
1478         https://bugs.webkit.org/show_bug.cgi?id=157000
1479         <rdar://problem/23344660>
1480
1481         Reviewed by Andreas Kling.
1482
1483         MemoryCache::evictResources() was caching the number of resources ('size')
1484         in the cache for a particular sessionID, and then proceed to call
1485         MemoryCache::remove() 'size' times using the first item in the HashMap
1486         each time. This was unsafe because resources may be ref'ing each other
1487         and therefore removing one may cause other resources to get removed as
1488         well. In such case, we would call remove() too many times and crash because
1489         we dereferenced resources.begin()->value (with the HashMap being empty).
1490
1491         This patch avoids the issue by copying the resources to a Vector and
1492         ref'ing them first, before going on to remove each one from the cache.
1493
1494         * loader/cache/MemoryCache.cpp:
1495         (WebCore::MemoryCache::forEachSessionResource):
1496         (WebCore::MemoryCache::evictResources):
1497         * loader/cache/MemoryCache.h:
1498
1499 2016-04-25  Chris Dumez  <cdumez@apple.com>
1500
1501         Crash under WebCore::MutationObserver::deliverAllMutations()
1502         https://bugs.webkit.org/show_bug.cgi?id=156997
1503         <rdar://problem/16542323>
1504
1505         Reviewed by Ryosuke Niwa.
1506
1507         The crash traces indicate that we may derefence a null pointer when
1508         dereferencing MutationCallback::scriptExecutationContext() in
1509         MutationObserver::canDeliver(). This can happen when the script
1510         execution context gets destroyed as a JSMutationCallback is an
1511         ActiveDOMObject, which is a ContextDestructionObserver.
1512
1513         This patch refactors the code so that MutationObserver::canDeliver()
1514         now simply asks JSMutationCallback if it can invoke its callback.
1515         JSMutationCallback makes this decision using
1516         ActiveDOMCallback::canInvokeCallback() which does a proper null
1517         check of the ScriptExecutationContext. This avoids some code
1518         duplication and fixes the crash.
1519
1520         * bindings/js/JSMutationCallback.h:
1521         * dom/MutationCallback.h:
1522         * dom/MutationObserver.cpp:
1523         (WebCore::MutationObserver::canDeliver):
1524
1525 2016-04-25  Brady Eidson  <beidson@apple.com>
1526
1527         Fix a flaky test after r200032
1528
1529         * fileapi/File.cpp:
1530         (WebCore::File::lastModified): This used to return a date object which did a WTF::timeClip on the double,
1531           but now that we're returning a raw double we need to WTF::timeClip it ourselves.
1532
1533 2016-04-25  Chris Dumez  <cdumez@apple.com>
1534
1535         [Web IDL] Specify default values for optional parameters of type 'float' / 'unrestricted float'
1536         https://bugs.webkit.org/show_bug.cgi?id=156995
1537
1538         Reviewed by Darin Adler.
1539
1540         Specify default values for optional parameters of type 'float' / 'unrestricted float'
1541         and let the bindings generator use WTF::Optional<> for the ones that do not have a
1542         default value.
1543
1544         * bindings/scripts/CodeGeneratorJS.pm:
1545         (CanUseWTFOptionalForParameter): Deleted.
1546         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1547         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
1548         * html/canvas/CanvasRenderingContext2D.cpp:
1549         (WebCore::CanvasRenderingContext2D::setStrokeColor):
1550         (WebCore::CanvasRenderingContext2D::setFillColor):
1551         (WebCore::CanvasRenderingContext2D::setShadow):
1552         (WebCore::CanvasRenderingContext2D::fillText):
1553         (WebCore::CanvasRenderingContext2D::strokeText):
1554         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1555         (WebCore::CanvasRenderingContext2D::clearShadow): Deleted.
1556         (WebCore::normalizeSpaces): Deleted.
1557         (WebCore::CanvasRenderingContext2D::measureText): Deleted.
1558         * html/canvas/CanvasRenderingContext2D.h:
1559         * html/canvas/CanvasRenderingContext2D.idl:
1560         * testing/Internals.idl:
1561
1562 2016-04-25  Brent Fulgham  <bfulgham@apple.com>
1563
1564         Add port 4190 (managesieve) to port blacklist
1565         https://bugs.webkit.org/show_bug.cgi?id=156986
1566         <rdar://problem/9119470>
1567
1568         Reviewed by Daniel Bates.
1569
1570         Tested by security/block-test.html.
1571
1572         * platform/URL.cpp:
1573         (WebCore::portAllowed): Add 4190 to the port blacklist.
1574
1575 2016-04-25  Nan Wang  <n_wang@apple.com>
1576
1577         AX: Crash at -[WebAccessibilityObjectWrapper accessibilityAttributeValue:] + 4391
1578         https://bugs.webkit.org/show_bug.cgi?id=156987
1579
1580         Reviewed by Chris Fleizach.
1581
1582         When we hit test on a slider indicator asking for the value when the parent slider's
1583         accessibility object is not created or the parent slider has been removed, it will cause
1584         crash. Fixed it by adding a check to see if the object is detached from the parent. 
1585
1586         Test: accessibility/mac/slider-thumb-value-crash.html
1587
1588         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1589         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1590
1591 2016-04-25  Jer Noble  <jer.noble@apple.com>
1592
1593         WebKitPlaybackSessionModelMediaElement should initialize the interface added by setWebPlaybackSessionInterface() with initial data
1594         https://bugs.webkit.org/show_bug.cgi?id=156996
1595
1596         Reviewed by Beth Dakin.
1597
1598         Notify the interface of the current values in the media element when the model is given an interface.
1599
1600         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1601         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
1602
1603 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
1604
1605         Toggling animation-play-state can re-start a finished animation
1606         https://bugs.webkit.org/show_bug.cgi?id=156731
1607
1608         Reviewed by Dean Jackson.
1609
1610         After an animation completed, CompositeAnimation::updateKeyframeAnimations() cleared
1611         all state that the animation had run on the element, so changing the value of some
1612         animation property triggered the animation to run again. This is wrong, since animation-name
1613         still applied to the element.
1614
1615         Fix by keeping state for keyframe animations in the Done state in the m_keyframeAnimations
1616         map. This allows for the removal of the index property on KeyframeAnimation.
1617
1618         Tests: animations/change-completed-animation-transform.html
1619                animations/change-completed-animation.html
1620
1621         * page/animation/AnimationBase.cpp:
1622         (WebCore::AnimationBase::timeToNextService):
1623         * page/animation/AnimationBase.h:
1624         (WebCore::AnimationBase::isAnimatingProperty):
1625         * page/animation/CompositeAnimation.cpp: Add animations that should stick around to AnimationNameMap,
1626         and swap with m_keyframeAnimations at the end.
1627         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1628         * page/animation/KeyframeAnimation.cpp:
1629         (WebCore::KeyframeAnimation::KeyframeAnimation):
1630         (WebCore::KeyframeAnimation::getAnimatedStyle):
1631         * page/animation/KeyframeAnimation.h:
1632
1633 2016-04-25  Alberto Garcia  <berto@igalia.com>
1634
1635         [GTK] Crashes if DISPLAY is unset
1636         https://bugs.webkit.org/show_bug.cgi?id=156972
1637
1638         Reviewed by Carlos Garcia Campos.
1639
1640         If DISPLAY is unset then m_display will be NULL, crashing WebKit
1641         when XCloseDisplay is called in the PlatformDisplayX11 destructor.
1642
1643         * platform/graphics/x11/PlatformDisplayX11.cpp:
1644         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
1645
1646 2016-04-25  Ryan Haddad  <ryanhaddad@apple.com>
1647
1648         Update JS bindings test results after r200037
1649
1650         Unreviewed test gardening.
1651
1652         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1653         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
1654
1655 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
1656
1657         play-state not parsed as part of animation shorthand
1658         https://bugs.webkit.org/show_bug.cgi?id=156959
1659
1660         Reviewed by Darin Adler.
1661
1662         We failed to parse animation-play-state as part of the animation shorthand, contrary
1663         to the spec and other browsers.
1664
1665         Fix for both the prefixed and unprefixed properties. There is some compat risk here,
1666         but only changing unprefixed behavior will probably lead to more author confusion.
1667
1668         Test: animations/play-state-in-shorthand.html
1669
1670         * css/CSSParser.cpp:
1671         (WebCore::CSSParser::parseAnimationShorthand):
1672         * css/CSSPropertyNames.in:
1673         * css/StylePropertyShorthand.cpp:
1674         (WebCore::animationShorthandForParsing): Remove the long comment which is no longer relevant
1675         now that the behavior has been written into the spec.
1676
1677 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
1678
1679         Negative animation-delay is treated as 0s
1680         https://bugs.webkit.org/show_bug.cgi?id=141008
1681
1682         Reviewed by Daniel Bates.
1683         
1684         Fix keyframe animations which start in the paused state.
1685         
1686         Explicitly move such animations from the new to the paused state, and
1687         set m_pauseTime to 0, rather than leaving it at -1. Fix getElapsedTime()
1688         to compute a correct time elapsed time for such animations, which takes
1689         negative delay into account correctly.
1690         
1691         Fix assertions which need to account for the new transition of New -> PlayStatePaused.
1692
1693         Test: animations/play-state-start-paused.html
1694
1695         * page/animation/AnimationBase.cpp:
1696         (WebCore::AnimationBase::updateStateMachine):
1697         (WebCore::AnimationBase::getElapsedTime):
1698         * page/animation/KeyframeAnimation.cpp:
1699         (WebCore::KeyframeAnimation::animate):
1700
1701 2016-04-25  Antti Koivisto  <antti@apple.com>
1702
1703         Inline RenderStyle into RenderElement
1704         https://bugs.webkit.org/show_bug.cgi?id=156981
1705
1706         Reviewed by Andreas Kling.
1707
1708         We can save memory and reduce indirection of style access by inlining RenderStyle to RenderElement.
1709
1710         This patch also makes RenderStyle moveable and switches from std::unique_ptr<RenderStyle> to RenderStyle&&
1711         in many places where ownership is passed.
1712
1713         * Modules/plugins/PluginReplacement.h:
1714         (WebCore::PluginReplacement::scriptObject):
1715         (WebCore::PluginReplacement::willCreateRenderer):
1716         * Modules/plugins/QuickTimePluginReplacement.h:
1717         * Modules/plugins/QuickTimePluginReplacement.mm:
1718         (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement):
1719         (WebCore::QuickTimePluginReplacement::createElementRenderer):
1720         * Modules/plugins/YouTubePluginReplacement.cpp:
1721         (WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
1722         (WebCore::YouTubePluginReplacement::createElementRenderer):
1723         * Modules/plugins/YouTubePluginReplacement.h:
1724         * css/StyleResolver.cpp:
1725         (WebCore::StyleResolver::styleForElement):
1726         (WebCore::StyleResolver::styleForKeyframe):
1727         (WebCore::StyleResolver::pseudoStyleForElement):
1728         (WebCore::StyleResolver::styleForPage):
1729         (WebCore::StyleResolver::defaultStyleForElement):
1730         (WebCore::StyleResolver::addToMatchedPropertiesCache):
1731         (WebCore::StyleResolver::applyPropertyToStyle):
1732         * dom/Document.cpp:
1733         (WebCore::Document::recalcStyle):
1734         (WebCore::Document::webkitWillEnterFullScreenForElement):
1735         (WebCore::Document::setFullScreenRenderer):
1736         * dom/Element.cpp:
1737         (WebCore::Element::rendererIsNeeded):
1738         (WebCore::Element::createElementRenderer):
1739         * dom/Element.h:
1740         (WebCore::Element::copyNonAttributePropertiesFromElement):
1741         * dom/PseudoElement.cpp:
1742         (WebCore::PseudoElement::resolveCustomStyle):
1743         (WebCore::PseudoElement::didAttachRenderers):
1744         (WebCore::PseudoElement::didRecalcStyle):
1745         * html/BaseButtonInputType.cpp:
1746         (WebCore::BaseButtonInputType::appendFormData):
1747         (WebCore::BaseButtonInputType::createInputRenderer):
1748         * html/BaseButtonInputType.h:
1749         * html/FileInputType.cpp:
1750         (WebCore::FileInputType::handleDOMActivateEvent):
1751         (WebCore::FileInputType::createInputRenderer):
1752         * html/FileInputType.h:
1753         * html/HTMLAppletElement.cpp:
1754         (WebCore::HTMLAppletElement::rendererIsNeeded):
1755         (WebCore::HTMLAppletElement::createElementRenderer):
1756
1757         ...
1758
1759 2016-04-25  Eric Carlson  <eric.carlson@apple.com>
1760
1761         Stop listening for "media can start" notifications when media player is cleared
1762         https://bugs.webkit.org/show_bug.cgi?id=156985
1763         <rdar://problem/23158505>
1764
1765         Reviewed by Jer Noble.
1766
1767         No new tests, I have not been able to create a test that reliably reproduces this.
1768
1769         * html/HTMLMediaElement.cpp:
1770         (WebCore::HTMLMediaElement::loadInternal): Add logging.
1771         (WebCore::HTMLMediaElement::selectMediaResource): Assert and return early if there is
1772           no media player.
1773         (WebCore::HTMLMediaElement::clearMediaPlayer): Stop listening for can start notifications.
1774         (WebCore::HTMLMediaElement::visibilityStateChanged): Add logging.
1775         (WebCore::HTMLMediaElement::mediaCanStart): Ditto.
1776
1777 2016-04-25  Chris Dumez  <cdumez@apple.com>
1778
1779         [Web IDL] Specify default values for parameters of type 'unsigned short'
1780         https://bugs.webkit.org/show_bug.cgi?id=156967
1781
1782         Reviewed by Darin Adler.
1783
1784         Specify default values for parameters of type 'unsigned short' and let
1785         the bindings generator use WTF::Optional<> for the ones without a
1786         default value.
1787
1788         * bindings/scripts/CodeGeneratorJS.pm:
1789         (CanUseWTFOptionalForParameter):
1790         (GenerateParametersCheck):
1791         * testing/Internals.cpp:
1792         (WebCore::Internals::layerTreeAsText): Deleted.
1793         (WebCore::Internals::displayListForElement): Deleted.
1794         (WebCore::Internals::replayDisplayListForElement): Deleted.
1795         * testing/Internals.h:
1796         * testing/Internals.idl:
1797
1798 2016-04-25  Per Arne Vollan  <peavo@outlook.com>
1799
1800         [Win][IndexedDB] Fix build errors.
1801         https://bugs.webkit.org/show_bug.cgi?id=156713
1802
1803         Reviewed by Alex Christensen.
1804
1805         Fix compile and link errors when building with IndexedDB enabled.
1806
1807         * Modules/indexeddb/IDBCursor.h:
1808         * Modules/indexeddb/IDBTransaction.cpp:
1809         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1810         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1811         * PlatformWin.cmake:
1812         * platform/win/FileSystemWin.cpp:
1813         (WebCore::hardLinkOrCopyFile):
1814
1815 2016-04-25  Brady Eidson  <beidson@apple.com>
1816
1817         Implement latest File object spec (including its constructor).
1818         https://bugs.webkit.org/show_bug.cgi?id=156511
1819
1820         Reviewed by Darin Adler.
1821
1822         Test: fast/files/file-constructor.html
1823
1824         * CMakeLists.txt:
1825         * WebCore.xcodeproj/project.pbxproj:
1826
1827         * bindings/js/JSDictionary.cpp:
1828         (WebCore::JSDictionary::convertValue):
1829         * bindings/js/JSDictionary.h:
1830
1831         * bindings/js/JSFileCustom.cpp: Added.
1832         (WebCore::constructJSFile):
1833
1834         * fileapi/File.cpp:
1835         (WebCore::File::File):
1836         (WebCore::File::lastModified):
1837         (WebCore::File::lastModifiedDate): Deleted.
1838         * fileapi/File.h:
1839         * fileapi/File.idl:
1840
1841
1842
1843 2016-04-25  Antti Koivisto  <antti@apple.com>
1844
1845         REGRESSION(r156846): Crashes with guard malloc
1846         https://bugs.webkit.org/show_bug.cgi?id=156984
1847
1848         Reviewed by Andreas Kling.
1849
1850         RenderElement::cachedFirstLineStyle() returns pointer to local std::unique_ptr.
1851
1852         * rendering/RenderElement.cpp:
1853         (WebCore::RenderElement::uncachedFirstLineStyle):
1854         (WebCore::RenderElement::cachedFirstLineStyle):
1855         (WebCore::RenderElement::firstLineStyle):
1856         (WebCore::firstLineStyleForCachedUncachedType): Deleted.
1857
1858             Don't try to use a single function for the cached and uncached cases. Separate the cases into the calling functions.
1859
1860 2016-04-25  Daniel Bates  <dabates@apple.com>
1861
1862         REGRESSION (r196012): Subresource may be blocked by Content Security Policy if it only matches 'self'
1863         https://bugs.webkit.org/show_bug.cgi?id=156935
1864         <rdar://problem/25351286>
1865
1866         Reviewed by Darin Adler.
1867
1868         Fixes an issue where subresource load may be blocked by the Content Security Policy (CSP) if its URL only
1869         matched 'self'. In particular, the load would be blocked if initiated from a document that inherited the
1870         origin of its owner document (e.g. the document contained in <iframe src="about:blank"></iframe>).
1871
1872         Following r196012 we compute and cache 'self' and its protocol on instantiation of a ContentSecurityPolicy
1873         object for use when matching a URL against it. These cached values become out-of-date if the document
1874         subsequently inherits the origin of its owner document. Therefore matches against 'self' will fail and
1875         CSP will block a load if its not otherwise allowed by the policy. Previously we would compute 'self' when
1876         parsing the definition of a source list and compute the protocol for 'self' each time we tried to match a
1877         URL against 'self'. So, 'self' would always be up-to-date with respect to the origin of the document.
1878
1879         Tests: http/tests/security/contentSecurityPolicy/iframe-blank-url-programmatically-add-external-script.html
1880                http/tests/security/contentSecurityPolicy/iframe-srcdoc-external-script.html
1881
1882         * page/csp/ContentSecurityPolicy.cpp:
1883         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Extract out logic for computing and caching
1884         'self' and its protocol into ContentSecurityPolicy::updateSourceSelf() and make use of this function.
1885         (WebCore::ContentSecurityPolicy::updateSourceSelf): Computes and caches 'self' and its protocol with
1886         respect to the specified SecurityOrigin.
1887         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): Call ContentSecurityPolicy::updateSourceSelf()
1888         to ensure that we have an up-to-date representation for 'self' and the protocol of 'self' which can
1889         become out-of-date if the document inherited the origin of its owner document.
1890         * page/csp/ContentSecurityPolicy.h:
1891
1892 2016-04-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1893
1894         Drop [UsePointersEvenForNonNullableObjectArguments] from TextTrack
1895         https://bugs.webkit.org/show_bug.cgi?id=156899
1896
1897         Reviewed by Chris Dumez.
1898
1899         No behavior changes.
1900
1901         * html/track/TextTrack.idl: Marking cue and region parameter as nullable.
1902         Also marking cues and activeCues as nullable attributes.
1903
1904 2016-04-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1905
1906         Drop [UsePointersEvenForNonNullableObjectArguments] from File API interfaces
1907         https://bugs.webkit.org/show_bug.cgi?id=156898
1908
1909         Reviewed by Chris Dumez.
1910
1911         Making FileReaderSync API API throwing a TypeError in case of null parameters, in lieu of a NOT_FOUND_ERR.
1912         Making FileReader API taking nullable parameters as a temporary fix.
1913
1914         Test: fast/files/workers/worker-file-reader-sync-bad-parameter.html
1915
1916         * Modules/websockets/WebSocketChannel.cpp:
1917         (WebCore::WebSocketChannel::processOutgoingFrameQueue): Updated to cope with FileReaderLoader::start taking a Blob&.
1918         * fileapi/FileReader.cpp:
1919         (WebCore::FileReader::readAsArrayBuffer): Updated to cope with readInternal taking a Blob&.
1920         (WebCore::FileReader::readAsBinaryString): Ditto.
1921         (WebCore::FileReader::readAsText): Ditto.
1922         (WebCore::FileReader::readAsDataURL): Ditto.
1923         (WebCore::FileReader::readInternal):  Updated to cope with FileReaderLoader::start taking a Blob&.
1924         * fileapi/FileReader.h:
1925         * fileapi/FileReader.idl: Marking the readXX methods as taking a nullable blob parameter to keep compatibility, at least temporarily.
1926         * fileapi/FileReaderLoader.cpp:
1927         (WebCore::FileReaderLoader::start): It now takes a Blob& as input.
1928         * fileapi/FileReaderLoader.h:
1929         * fileapi/FileReaderSync.cpp:
1930         (WebCore::FileReaderSync::readAsArrayBuffer): Taking a Blob& as input.
1931         (WebCore::FileReaderSync::readAsBinaryString): Ditto.
1932         (WebCore::FileReaderSync::readAsText): Ditto.
1933         (WebCore::FileReaderSync::readAsDataURL): Ditto.
1934         (WebCore::FileReaderSync::startLoading) Ditto.
1935         * fileapi/FileReaderSync.h:
1936         (WebCore::FileReaderSync::readAsText): Ditto.
1937         * fileapi/FileReaderSync.idl:
1938
1939 2016-04-25  Manuel Rego Casasnovas  <rego@igalia.com>
1940
1941         [css-grid] Fix grid-template-columns|rows computed style with content alignment
1942         https://bugs.webkit.org/show_bug.cgi?id=156793
1943
1944         Reviewed by Darin Adler.
1945
1946         Computed style of grid-template-columns and grid-template-rows properties
1947         was including the distribution offset because of content alignment.
1948         We should subtract that offset, like we do for the case of gaps,
1949         when we're calculating the computed style.
1950
1951         Test: fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html
1952
1953         * css/CSSComputedStyleDeclaration.cpp:
1954         (WebCore::valueForGridTrackList):
1955         * rendering/RenderGrid.cpp:
1956         (WebCore::RenderGrid::offsetBetweenTracks):
1957         (WebCore::RenderGrid::populateGridPositions): Deleted FIXME.
1958         * rendering/RenderGrid.h:
1959
1960 2016-04-25  Frederic Wang  <fwang@igalia.com>
1961
1962         Refactor RenderMathMLMenclose.
1963         https://bugs.webkit.org/show_bug.cgi?id=155019
1964
1965         Reviewed by Sergio Villar Senin.
1966
1967         Tests: mathml/presentation/menclose-notation-equivalence.html
1968                mathml/presentation/menclose-notation-values.html
1969
1970         We rewrite RenderMathMLMenclose so that layout functions correctly override the
1971         behavior of RenderMathMLRow. We try and rely on the draft  of the MathML in HTML5
1972         implementation note, to make easier to get consistency with other rendering engines
1973         in the future. All notations are now drawn with GraphicContext functions instead of
1974         mixing them with CSS style. To save memory space, the list of known notations are
1975         now saved on a short integer using bit masks instead of a vector of string names.
1976         Finally, we remove support for the radical notation so that we no longer need to
1977         create an anonymous RenderMathMLRoot.
1978
1979         * mathml/MathMLMencloseElement.cpp: Remove code for some special notations and just
1980         reimplement parsing of the notation attribute.
1981         (WebCore::MathMLMencloseElement::MathMLMencloseElement): By default, the notation is longdiv.
1982         (WebCore::MathMLMencloseElement::parseAttribute): By default, the list of notation is empty.
1983         If there is no notation attribute, the default value longdiv is used.
1984         Otherwise, we parse the notation attribute and add each notation, using some equivalences
1985         for box, actuarial and madruwb.
1986         (WebCore::MathMLMencloseElement::isPresentationAttribute): Deleted. No need to define
1987         specific style for some notation.
1988         (WebCore::MathMLMencloseElement::finishParsingChildren): Deleted. No need to add an
1989         anonymous square root.
1990         (WebCore::MathMLMencloseElement::collectStyleForPresentationAttribute): Deleted. No need to
1991         define specific style for some notation.
1992         (WebCore::MathMLMencloseElement::longDivLeftPadding): Deleted. RenderMathMLMenclose uses an
1993         arbitrary size instead of measure a glyph.
1994         * mathml/MathMLMencloseElement.h: Define simple bit mask for each notation, add a short
1995         integer to store the list of notations together with helper functions. Remove old code.
1996         * rendering/mathml/RenderMathMLMenclose.cpp: Rewrite RenderMathMLMenclose so that layout
1997         functions correctly override the behavior of RenderMathMLRow.
1998         (WebCore::RenderMathMLMenclose::RenderMathMLMenclose): Init m_ascent to 0.
1999         (WebCore::RenderMathMLMenclose::ruleThickness): For now, we use the fallback value used by
2000         for other bars. We may refine that in the future.
2001         (WebCore::RenderMathMLMenclose::getSpaceAroundContent): Helper function to retrieve the
2002         space to add around the content, depending on the notations specified. Note that for
2003         notation circle, this spacing depends on the content size.
2004         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths): Reimplement this function.
2005         This is just adding left/right spacing around the content.
2006         (WebCore::RenderMathMLMenclose::layoutBlock): Reimplement this function. We do the normal
2007         RenderMathMLRow layout, adjust spacing and child position and
2008         calculate m_ascent and m_contentRect.
2009         (WebCore::RenderMathMLMenclose::firstLineBaseline): Implement this function.
2010         We just return m_ascent.
2011         (WebCore::drawLine): Helper function to draw a line using strokePath.
2012         (WebCore::RenderMathMLMenclose::paint): We reimplement this function to draw
2013         all notations using GraphicContext.
2014         (WebCore::RenderMathMLMenclose::addChild): Deleted. No need to manage anonymous renderers.
2015         (WebCore::RenderMathMLMenclose::updateLogicalHeight): Deleted. Height is now calculated
2016         in layoutBlock.
2017         (WebCore::RenderMathMLMenclose::checkNotationalValuesValidity): Deleted.
2018         * rendering/mathml/RenderMathMLMenclose.h: Update member definitions.
2019         * rendering/mathml/RenderMathMLRoot.cpp: We no longer need anonymous roots.
2020         (WebCore::RenderMathMLRoot::RenderMathMLRoot): Deleted.
2021         * rendering/mathml/RenderMathMLRoot.h: We no longer need anonymous roots.
2022         * rendering/mathml/RenderMathMLRow.cpp: Allow to get the exact metrics of the chid row,
2023         for use in RenderMathMLRoot.
2024         (WebCore::RenderMathMLRow::computeLineVerticalStretch): rename parameters.
2025         (WebCore::RenderMathMLRow::layoutRowItems): Set parameters to the final ascent, descent and
2026         logical width of the chid row. Set the temporary logical width for RenderMathMenclose before
2027         laying the children out.
2028         (WebCore::RenderMathMLRow::layoutBlock): Rename parameters ; add a dummy logicalWidth
2029         parameter.
2030         * rendering/mathml/RenderMathMLRow.h: Make some functions accessible or overridable by
2031         RenderMathMLRoot. Make layoutRowItems return the final ascent, descent and logical width
2032         after the chid row is laid out.
2033         * rendering/mathml/RenderMathMLSquareRoot.cpp: We no longer need anonymous roots.
2034         (WebCore::RenderMathMLSquareRoot::RenderMathMLSquareRoot): Deleted.
2035         (WebCore::RenderMathMLSquareRoot::createAnonymousWithParentRenderer): Deleted.
2036         * rendering/mathml/RenderMathMLSquareRoot.h: We no longer need anonymous roots.
2037
2038 2016-04-25  Frederic Wang  <fwang@igalia.com>
2039
2040         Minor refactoring in RenderMathMLOperator
2041         https://bugs.webkit.org/show_bug.cgi?id=156906
2042
2043         Reviewed by Martin Robinson.
2044
2045         No new tests, this is only minor refactoring that does not change the behavior.
2046
2047         * rendering/mathml/RenderMathMLOperator.cpp:
2048         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack):
2049         We rename the "state" integer to an "expected" enum indicating the next expected part.
2050         (WebCore::RenderMathMLOperator::paintGlyph): We add a missing dot at the end of a sequence.
2051         We also replace ceil(x+1) with ceil(x)+1 to get rid of the temporary variable.
2052
2053 2016-04-24  Chris Dumez  <cdumez@apple.com>
2054
2055         [Web IDL] Specify default values for boolean parameters
2056         https://bugs.webkit.org/show_bug.cgi?id=156964
2057
2058         Reviewed by Darin Adler.
2059
2060         Specify default values for boolean parameters in our IDL files and
2061         let the bindings generator use WTF::Optional<> for the ones without
2062         a default value.
2063
2064         * CMakeLists.txt:
2065         * Modules/indexeddb/IDBKeyRange.cpp:
2066         * Modules/indexeddb/IDBKeyRange.h:
2067         * Modules/indexeddb/IDBKeyRange.idl:
2068         * WebCore.xcodeproj/project.pbxproj:
2069         * bindings/js/JSBindingsAllInOne.cpp:
2070
2071         * bindings/js/JSDOMTokenListCustom.cpp: Removed.
2072         We no longer need these custom bindings as the bindings generator
2073         will now provide the implementation with an Optional<bool>, given
2074         that the parameter has no default value.
2075
2076         * bindings/scripts/CodeGeneratorJS.pm:
2077         (CanUseWTFOptionalForParameterType): Deleted.
2078         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2079         (webkit_dom_test_obj_method_with_optional_boolean):
2080         (webkit_dom_test_obj_method_with_optional_boolean_is_false):
2081         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2082         * bindings/scripts/test/JS/JSTestObj.cpp:
2083         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
2084         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
2085         * bindings/scripts/test/ObjC/DOMTestObj.h:
2086         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2087         (-[DOMTestObj methodWithOptionalBoolean:]):
2088         (-[DOMTestObj methodWithOptionalBooleanIsFalse:]):
2089         * bindings/scripts/test/TestObj.idl:
2090         * dom/Document.h:
2091         * dom/Document.idl:
2092         * dom/Element.idl:
2093         * dom/EventTarget.idl:
2094         * html/DOMTokenList.idl:
2095
2096 2016-04-24  Chris Dumez  <cdumez@apple.com>
2097
2098         Autogenerated IDBFactory.open() does the wrong thing if you pass an explicit 'undefined' as the second argument
2099         https://bugs.webkit.org/show_bug.cgi?id=156939
2100
2101         Reviewed by Darin Adler.
2102
2103         As per WebIDL, if undefined is passed by JS for an optional parameter then
2104         we should use its default value if it has one, or use the special value
2105         "missing":
2106         http://heycam.github.io/webidl/#es-overloads (step 10.4)
2107
2108         Our bindings generator was already mapping undefined to the parameter's
2109         default value when present. However, it was missing the notion of
2110         "missing" value when there no default value. This patch adds supports
2111         for its by passing Optional<>(Nullopt) to the implementation in such
2112         case. This means that the implementation will need to use WTF::Optional<>
2113         type for parameters that do not have a default value. Thankfully though,
2114         in most cases, we will be able to specify a default value in the IDL
2115         so cases where we will need to use WTF::Optional<> will actually be
2116         rare.
2117
2118         To avoid having to do too much refactoring in this patch, the support
2119         for WTF::Optional is currently blacklisted for most IDL types. I will
2120         gradually stop blacklisting each type in follow-up patches, as I either:
2121         - Add default parameter values in our IDL (preferred)
2122         - Use WTF::Optional<> in our implementation (when we cannot specify a
2123           default value).
2124
2125         This patch fixes a bug with IDBFactory.open()'s second parameter (version)
2126         for which undefined should not throw and indicate that the version
2127         should not be changed. We now use WTF::Optional in the implementation to
2128         distinguish this case and not throw.
2129
2130         No new tests, existing tests were updated / rebaselined.
2131
2132         * Modules/indexeddb/IDBFactory.cpp:
2133         (WebCore::IDBFactory::open):
2134         (WebCore::IDBFactory::openInternal): Deleted.
2135         * Modules/indexeddb/IDBFactory.h:
2136         * bindings/scripts/CodeGeneratorJS.pm:
2137         (ShouldUseWTFOptionalForParameterType):
2138         (GenerateParametersCheck):
2139         * fileapi/Blob.idl:
2140         * inspector/InspectorIndexedDBAgent.cpp:
2141
2142 2016-04-23  Chris Dumez  <cdumez@apple.com>
2143
2144         [WebIDL] Drop [Default] WebKit-IDL extended attribute
2145         https://bugs.webkit.org/show_bug.cgi?id=156955
2146
2147         Reviewed by Darin Adler.
2148
2149         Drop [Default] WebKit-IDL extended attribute in favor of the standard
2150         WebIDL syntax for parameters' default value.
2151
2152         Here is what it looks like:
2153         [Default=NullString] optional DOMString a -> optional DOMString a = null
2154         [Default=NullString] optional DOMString? a -> optional DOMString? a = null
2155         [Default=Undefined] optional DOMString a -> optional DOMString a = "undefined"
2156         [Default=Undefined] optional DOMString? a -> optional DOMString? a = null
2157         [Default=Undefined] optional long a -> optional long a = 0
2158         [Default=Undefined] optional bool a -> optional bool a = false
2159         [Default=Undefined] optional unrestricted double a -> optional unrestricted double a = NaN
2160         [Default=Undefined] optional unrestricted float a -> optional unrestricted float a = NaN
2161         [Default=Undefined] optional sequence<DOMString> a -> optional sequence<DOMString> a = []
2162
2163         These do not cause any Web-Exposed behavior change. However, when getting
2164         rid of [Default] started passing more parameters by derefence instead of
2165         pointer (as is expected for parameters not marked as nullable). As a result,
2166         I had to mark a few parameters as nullable in the IDL to maintain the
2167         previous behavior. In some cases, the implementation was already throwing
2168         when passing null. In such cases, I have not marked the type as nullable
2169         so that the generated bindings now throw the exception instead of our
2170         implementation code. In some cases, the exception being thrown is now
2171         different. This is why some of the layout tests had to be rebaselined.
2172
2173         No new tests, existing tests have been rebaselined. No significant Web
2174         exposed behavior change is expected from this patch, beside exceptions
2175         type sometimes being different.
2176
2177         * Modules/encryptedmedia/MediaKeys.idl:
2178         * Modules/fetch/FetchRequest.idl:
2179         * Modules/gamepad/deprecated/GamepadList.idl:
2180         * Modules/indexeddb/IDBDatabase.idl:
2181         * Modules/mediastream/RTCStatsResponse.idl:
2182         * Modules/notifications/Notification.idl:
2183         * Modules/speech/SpeechSynthesisUtterance.idl:
2184         * Modules/webaudio/AudioNode.idl:
2185         * Modules/websockets/WebSocket.idl:
2186         * bindings/scripts/CodeGeneratorJS.pm:
2187         (GenerateParametersCheck):
2188         * bindings/scripts/IDLAttributes.txt:
2189         * bindings/scripts/IDLParser.pm:
2190         (parseDefault):
2191         (parseDefaultValue):
2192         * bindings/scripts/test/TestInterface.idl:
2193         * bindings/scripts/test/TestNamedConstructor.idl:
2194         * bindings/scripts/test/TestObj.idl:
2195         * bindings/scripts/test/TestOverrideBuiltins.idl:
2196         * css/CSSKeyframesRule.idl:
2197         * css/CSSMediaRule.idl:
2198         * css/CSSPrimitiveValue.idl:
2199         * css/CSSRuleList.idl:
2200         * css/CSSStyleDeclaration.idl:
2201         * css/CSSStyleSheet.idl:
2202         * css/CSSSupportsRule.idl:
2203         * css/CSSValueList.idl:
2204         * css/MediaList.idl:
2205         * css/MediaQueryList.idl:
2206         * css/MediaQueryListListener.idl:
2207         * css/StyleMedia.idl:
2208         * css/StyleSheetList.idl:
2209         * css/WebKitCSSFilterValue.idl:
2210         * css/WebKitCSSMatrix.idl:
2211         * css/WebKitCSSTransformValue.idl:
2212         * dom/ClientRectList.idl:
2213         * dom/Comment.idl:
2214         * dom/CompositionEvent.idl:
2215         * dom/CustomEvent.h:
2216         * dom/CustomEvent.idl:
2217         * dom/DOMImplementation.idl:
2218         * dom/DOMStringList.idl:
2219         * dom/DataTransferItem.idl:
2220         * dom/DataTransferItemList.idl:
2221         * dom/DeviceMotionEvent.idl:
2222         * dom/DeviceOrientationEvent.idl:
2223         * dom/Document.cpp:
2224         (WebCore::Document::adoptNode):
2225         * dom/Document.idl:
2226         * dom/Element.cpp:
2227         (WebCore::Element::setAttributeNode):
2228         (WebCore::Element::setAttributeNodeNS):
2229         (WebCore::Element::removeAttributeNode):
2230         (WebCore::Element::parseAttributeName): Deleted.
2231         * dom/Element.h:
2232         * dom/Element.idl:
2233         * dom/Event.idl:
2234         * dom/HashChangeEvent.idl:
2235         * dom/KeyboardEvent.idl:
2236         * dom/MessageEvent.idl:
2237         * dom/MouseEvent.idl:
2238         * dom/MutationEvent.idl:
2239         * dom/NamedNodeMap.cpp:
2240         (WebCore::NamedNodeMap::setNamedItem):
2241         (WebCore::NamedNodeMap::setNamedItemNS):
2242         (WebCore::NamedNodeMap::item): Deleted.
2243         * dom/NamedNodeMap.h:
2244         * dom/NamedNodeMap.idl:
2245         * dom/Node.idl:
2246         * dom/NodeFilter.idl:
2247         * dom/NonElementParentNode.idl:
2248         * dom/OverflowEvent.idl:
2249         * dom/Range.idl:
2250         * dom/Text.idl:
2251         * dom/TextEvent.idl:
2252         * dom/TouchEvent.idl:
2253         * dom/UIEvent.idl:
2254         * dom/WheelEvent.idl:
2255         * html/DOMFormData.idl:
2256         * html/HTMLAllCollection.idl:
2257         * html/HTMLAudioElement.idl:
2258         * html/HTMLCanvasElement.idl:
2259         * html/HTMLCollection.idl:
2260         * html/HTMLDocument.idl:
2261         * html/HTMLElement.cpp:
2262         (WebCore::HTMLElement::insertAdjacentElement):
2263         (WebCore::contextElementForInsertion): Deleted.
2264         * html/HTMLElement.h:
2265         * html/HTMLElement.idl:
2266         * html/HTMLFormControlsCollection.idl:
2267         * html/HTMLInputElement.idl:
2268         * html/HTMLMediaElement.idl:
2269         * html/HTMLOptionElement.idl:
2270         * html/HTMLOptionsCollection.idl:
2271         * html/HTMLSelectElement.idl:
2272         * html/HTMLTableElement.idl:
2273         * html/HTMLTableRowElement.idl:
2274         * html/HTMLTableSectionElement.idl:
2275         * html/HTMLTextAreaElement.idl:
2276         * html/ImageData.idl:
2277         * html/canvas/CanvasGradient.idl:
2278         * html/canvas/CanvasRenderingContext2D.idl:
2279         * html/canvas/DOMPath.idl:
2280         * html/canvas/OESVertexArrayObject.idl:
2281         * page/DOMSelection.cpp:
2282         (WebCore::DOMSelection::extend):
2283         (WebCore::DOMSelection::getRangeAt): Deleted.
2284         * page/DOMSelection.h:
2285         * page/DOMSelection.idl:
2286         * page/DOMWindow.idl:
2287         * page/History.idl:
2288         * page/Performance.idl:
2289         * page/WindowTimers.idl:
2290         * plugins/DOMMimeTypeArray.idl:
2291         * plugins/DOMPlugin.idl:
2292         * plugins/DOMPluginArray.idl:
2293         * storage/StorageEvent.idl:
2294         * svg/SVGAnimationElement.idl:
2295         * svg/SVGDocument.idl:
2296         * svg/SVGElement.idl:
2297         * svg/SVGFEDropShadowElement.idl:
2298         * svg/SVGFEGaussianBlurElement.idl:
2299         * svg/SVGFEMorphologyElement.idl:
2300         * svg/SVGFilterElement.idl:
2301         * svg/SVGGraphicsElement.idl:
2302         * svg/SVGMarkerElement.idl:
2303         * svg/SVGPathElement.idl:
2304         * svg/SVGSVGElement.idl:
2305         * svg/SVGTests.idl:
2306         * svg/SVGTextContentElement.idl:
2307         * xml/DOMParser.idl:
2308         * xml/XMLSerializer.cpp:
2309         (WebCore::XMLSerializer::serializeToString):
2310         * xml/XMLSerializer.h:
2311         * xml/XMLSerializer.idl:
2312         * xml/XPathEvaluator.idl:
2313         * xml/XPathExpression.idl:
2314         * xml/XPathNSResolver.idl:
2315         * xml/XPathResult.idl:
2316         * xml/XSLTProcessor.idl:
2317
2318 2016-04-24  Antti Koivisto  <antti@apple.com>
2319
2320         RenderStyle should not be reference counted
2321         https://bugs.webkit.org/show_bug.cgi?id=156846
2322
2323         Reviewed by Andreas Kling.
2324
2325         RenderStyle reference counts its substructures. We no longer share RenderStyle objects between normal renderers
2326         so there is no reason to refcount the RenderStyles themselves too. Making it a non-refcounted type clarifies
2327         ownership relations, reduces branchiness and saves some memory.
2328
2329         This patches switches mostly mechanically from Ref/RefPtr<RenderStyle> to std::unique_ptr<RenderStyle>. In
2330         the future RenderStyle can be given regular value semantics.
2331
2332         * Modules/plugins/PluginReplacement.h:
2333         (WebCore::PluginReplacement::scriptObject):
2334         (WebCore::PluginReplacement::willCreateRenderer):
2335         * Modules/plugins/QuickTimePluginReplacement.h:
2336         * Modules/plugins/QuickTimePluginReplacement.mm:
2337         (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement):
2338         (WebCore::QuickTimePluginReplacement::createElementRenderer):
2339         * Modules/plugins/YouTubePluginReplacement.cpp:
2340         (WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
2341         (WebCore::YouTubePluginReplacement::createElementRenderer):
2342         * Modules/plugins/YouTubePluginReplacement.h:
2343         * css/CSSComputedStyleDeclaration.cpp:
2344         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
2345         (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
2346         (WebCore::updateStyleIfNeededForNode):
2347         (WebCore::computeRenderStyleForProperty):
2348         (WebCore::ComputedStyleExtractor::customPropertyValue):
2349         (WebCore::ComputedStyleExtractor::propertyValue):
2350         * css/MediaQueryEvaluator.cpp:
2351         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
2352         (WebCore::MediaQueryEvaluator::eval):
2353         * css/MediaQueryEvaluator.h:
2354
2355             Clarify in code that MediaQueryEvaluator does not own the style.
2356
2357         * css/MediaQueryMatcher.cpp:
2358         (WebCore::MediaQueryMatcher::mediaType):
2359         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
2360         (WebCore::MediaQueryMatcher::evaluate):
2361         (WebCore::MediaQueryMatcher::matchMedia):
2362         (WebCore::MediaQueryMatcher::styleResolverChanged):
2363         (WebCore::MediaQueryMatcher::prepareEvaluator): Deleted.
2364         * css/MediaQueryMatcher.h:
2365         * css/StyleMedia.cpp:
2366         (WebCore::StyleMedia::matchMedium):
2367         * css/StyleResolver.cpp:
2368         (WebCore::StyleResolver::State::clear):
2369         (WebCore::StyleResolver::State::updateConversionData):
2370         (WebCore::StyleResolver::State::setStyle):
2371         (WebCore::StyleResolver::State::setParentStyle):
2372
2373             State owns the style explicitly set by setParentStyle but not the one given via constructor.
2374
2375         (WebCore::isAtShadowBoundary):
2376         (WebCore::StyleResolver::styleForElement):
2377         (WebCore::StyleResolver::styleForKeyframe):
2378         (WebCore::StyleResolver::keyframeStylesForAnimation):
2379         (WebCore::StyleResolver::pseudoStyleForElement):
2380         (WebCore::StyleResolver::styleForPage):
2381         (WebCore::StyleResolver::defaultStyleForElement):
2382         (WebCore::StyleResolver::applyMatchedProperties):
2383         (WebCore::StyleResolver::applyPropertyToStyle):
2384         * css/StyleResolver.h:
2385         (WebCore::ElementStyle::ElementStyle):
2386         (WebCore::StyleResolver::style):
2387         (WebCore::StyleResolver::parentStyle):
2388         (WebCore::StyleResolver::setOverrideDocumentElementStyle):
2389         (WebCore::StyleResolver::State::document):
2390         (WebCore::StyleResolver::State::element):
2391         (WebCore::StyleResolver::State::style):
2392         (WebCore::StyleResolver::State::takeStyle):
2393         (WebCore::StyleResolver::State::parentStyle):
2394         (WebCore::StyleResolver::State::rootElementStyle):
2395         (WebCore::StyleResolver::State::regionForStyling):
2396         (WebCore::StyleResolver::State::setParentStyle): Deleted.
2397         * dom/Document.cpp:
2398         (WebCore::Document::recalcStyle):
2399         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2400         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
2401         (WebCore::Document::isPageBoxVisible):
2402         (WebCore::Document::pageSizeAndMarginsInPixels):
2403         (WebCore::Document::addAutoSizingNode):
2404         (WebCore::Document::validateAutoSizingNodes):
2405         (WebCore::Document::resetAutoSizingNodes):
2406         (WebCore::Document::setFullScreenRenderer):
2407         * dom/Document.h:
2408         * dom/Element.cpp:
2409         (WebCore::Element::rendererIsNeeded):
2410         (WebCore::Element::createElementRenderer):
2411         (WebCore::Element::resolveComputedStyle):
2412         * dom/Element.h:
2413         (WebCore::Element::copyNonAttributePropertiesFromElement):
2414         * dom/ElementRareData.h:
2415
2416         ...
2417
2418         * page/animation/AnimationBase.h:
2419         * page/animation/AnimationController.cpp:
2420         (WebCore::AnimationControllerPrivate::receivedStartTimeResponse):
2421         (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
2422         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
2423         (WebCore::AnimationController::cancelAnimations):
2424         (WebCore::AnimationController::updateAnimations):
2425
2426             std::unique_ptr<RenderStyle& animatedStyle argument is now expected no be initially null and
2427             is only set if a new style is created.
2428
2429         (WebCore::AnimationController::getAnimatedStyleForRenderer):
2430         * page/animation/AnimationController.h:
2431         * page/animation/AnimationControllerPrivate.h:
2432         * page/animation/CompositeAnimation.cpp:
2433         (WebCore::CompositeAnimation::updateTransitions):
2434         (WebCore::CompositeAnimation::updateKeyframeAnimations):
2435         (WebCore::CompositeAnimation::animate):
2436         (WebCore::CompositeAnimation::getAnimatedStyle):
2437         * page/animation/CompositeAnimation.h:
2438         * page/animation/ImplicitAnimation.cpp:
2439         (WebCore::ImplicitAnimation::ImplicitAnimation):
2440         (WebCore::ImplicitAnimation::shouldSendEventForListener):
2441         (WebCore::ImplicitAnimation::animate):
2442         (WebCore::ImplicitAnimation::getAnimatedStyle):
2443         (WebCore::ImplicitAnimation::onAnimationEnd):
2444         (WebCore::ImplicitAnimation::reset):
2445         * page/animation/ImplicitAnimation.h:
2446         * page/animation/KeyframeAnimation.cpp:
2447         (WebCore::KeyframeAnimation::KeyframeAnimation):
2448         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
2449         (WebCore::KeyframeAnimation::animate):
2450         (WebCore::KeyframeAnimation::getAnimatedStyle):
2451         * page/animation/KeyframeAnimation.h:
2452         * rendering/RenderAttachment.cpp:
2453         (WebCore::RenderAttachment::RenderAttachment):
2454         * rendering/RenderAttachment.h:
2455         * rendering/RenderBlock.cpp:
2456         (WebCore::RenderBlock::RenderBlock):
2457         (WebCore::RenderBlock::styleDidChange):
2458         (WebCore::RenderBlock::clone):
2459         (WebCore::RenderBlock::updateFirstLetterStyle):
2460         (WebCore::RenderBlock::createFirstLetterRenderer):
2461         * rendering/RenderBlock.h:
2462         * rendering/RenderBlockFlow.cpp:
2463         (WebCore::RenderBlockFlow::MarginInfo::MarginInfo):
2464         (WebCore::RenderBlockFlow::RenderBlockFlow):
2465         * rendering/RenderBlockFlow.h:
2466         * rendering/RenderBox.cpp:
2467         (WebCore::skipBodyBackground):
2468         (WebCore::RenderBox::RenderBox):
2469         * rendering/RenderBox.h:
2470         * rendering/RenderBoxModelObject.cpp:
2471         (WebCore::RenderBoxModelObject::suspendAnimations):
2472         (WebCore::RenderBoxModelObject::RenderBoxModelObject):
2473         * rendering/RenderBoxModelObject.h:
2474         * rendering/RenderButton.cpp:
2475         (WebCore::RenderButton::RenderButton):
2476         (WebCore::RenderButton::setupInnerStyle):
2477         * rendering/RenderButton.h:
2478         * rendering/RenderCombineText.h:
2479         * rendering/RenderDeprecatedFlexibleBox.cpp:
2480         (WebCore::RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox):
2481         * rendering/RenderDeprecatedFlexibleBox.h:
2482         * rendering/RenderDetailsMarker.cpp:
2483         (WebCore::RenderDetailsMarker::RenderDetailsMarker):
2484         * rendering/RenderDetailsMarker.h:
2485         * rendering/RenderElement.cpp:
2486         (WebCore::controlStatesRendererMap):
2487         (WebCore::RenderElement::RenderElement):
2488         (WebCore::RenderElement::~RenderElement):
2489         (WebCore::RenderElement::createFor):
2490         (WebCore::firstLineStyleForCachedUncachedType):
2491         (WebCore::RenderElement::uncachedFirstLineStyle):
2492         (WebCore::RenderElement::cachedFirstLineStyle):
2493         (WebCore::RenderElement::initializeStyle):
2494         (WebCore::RenderElement::setStyle):
2495         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
2496         (WebCore::RenderElement::styleDidChange):
2497         (WebCore::RenderElement::getCachedPseudoStyle):
2498
2499             Return plain pointer as the cache owns the style.
2500
2501         (WebCore::RenderElement::getUncachedPseudoStyle):
2502
2503             return std::unique_ptr<RenderStyle>
2504
2505         (WebCore::RenderElement::selectionColor):
2506         (WebCore::RenderElement::selectionPseudoStyle):
2507         (WebCore::RenderElement::selectionBackgroundColor):
2508         * rendering/RenderElement.h:
2509         (WebCore::RenderElement::hasInitializedStyle):
2510         (WebCore::RenderElement::style):
2511         (WebCore::RenderElement::element):
2512         (WebCore::RenderElement::setStyleInternal):
2513         * rendering/RenderEmbeddedObject.cpp:
2514
2515         ...
2516
2517         (WebCore::RenderImage::imageResource):
2518         * rendering/RenderInline.cpp:
2519         (WebCore::RenderInline::RenderInline):
2520         (WebCore::updateStyleOfAnonymousBlockContinuations):
2521         (WebCore::RenderInline::styleDidChange):
2522
2523             Continuations now get their own RenderStyles.
2524
2525         (WebCore::RenderInline::addChildIgnoringContinuation):
2526         (WebCore::RenderInline::clone):
2527         * rendering/RenderInline.h:
2528         * rendering/RenderLayer.cpp:
2529         (WebCore::RenderLayer::currentTransform):
2530         (WebCore::RenderLayer::calculateClipRects):
2531         * rendering/RenderLayer.h:
2532
2533         ...
2534
2535         * rendering/style/KeyframeList.cpp:
2536         (WebCore::KeyframeList::operator==):
2537         (WebCore::KeyframeList::insert):
2538
2539             KeyframeValue is now movable but not copyable type. Adjust accordingly.
2540
2541         * rendering/style/KeyframeList.h:
2542         (WebCore::KeyframeValue::KeyframeValue):
2543         (WebCore::KeyframeValue::setKey):
2544         (WebCore::KeyframeValue::style):
2545         (WebCore::KeyframeValue::setStyle):
2546         (WebCore::KeyframeList::animationName):
2547         (WebCore::KeyframeList::addProperty):
2548         (WebCore::KeyframeList::containsProperty):
2549         * rendering/style/RenderStyle.cpp:
2550         (WebCore::defaultStyle):
2551         (WebCore::RenderStyle::create):
2552         (WebCore::RenderStyle::createDefaultStyle):
2553         (WebCore::RenderStyle::createAnonymousStyleWithDisplay):
2554         (WebCore::RenderStyle::clone):
2555         (WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
2556
2557             Return std::unique_ptr<RenderStyle> instead of Ref<RenderStyle>.
2558
2559         (WebCore::RenderStyle::RenderStyle):
2560         (WebCore::RenderStyle::~RenderStyle):
2561         (WebCore::resolveAlignmentData):
2562         (WebCore::RenderStyle::operator==):
2563         (WebCore::RenderStyle::hasUniquePseudoStyle):
2564         (WebCore::RenderStyle::getCachedPseudoStyle):
2565         (WebCore::RenderStyle::addCachedPseudoStyle):
2566         (WebCore::RenderStyle::isStyleAvailable): Deleted.
2567         * rendering/style/RenderStyle.h:
2568         (WebCore::RenderStyle::setStyleType):
2569         (WebCore::RenderStyle::cachedPseudoStyles):
2570         (WebCore::RenderStyle::initialIsolation):
2571         (WebCore::RenderStyle::isPlaceholderStyle):
2572         (WebCore::RenderStyle::setIsPlaceholderStyle):
2573
2574             Add placeholder style bit to rareNonInheritedData. We no longer rely on RenderStyle identity for this test.
2575
2576         (WebCore::RenderStyle::noninheritedFlagsMemoryOffset):
2577         * rendering/style/SVGRenderStyle.cpp:
2578         (WebCore::defaultSVGStyle):
2579         (WebCore::SVGRenderStyle::createDefaultStyle):
2580         * rendering/style/StyleRareNonInheritedData.cpp:
2581         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2582         (WebCore::StyleRareNonInheritedData::operator==):
2583         (WebCore::StyleRareNonInheritedData::contentDataEquivalent):
2584         * rendering/style/StyleRareNonInheritedData.h:
2585
2586         ...
2587
2588         (WebCore::findRenderingRoot):
2589         (WebCore::findRenderingRoots):
2590         (WebCore::RenderTreeUpdater::commit):
2591
2592             Style::Update is no longer const as we move the styles from it to the render tree.
2593
2594         (WebCore::pseudoStyleCacheIsInvalid):
2595         (WebCore::RenderTreeUpdater::updateElementRenderer):
2596         (WebCore::moveToFlowThreadIfNeeded):
2597         (WebCore::RenderTreeUpdater::createRenderer):
2598         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
2599         * style/RenderTreeUpdater.h:
2600         * style/StyleResolveForDocument.cpp:
2601         (WebCore::Style::resolveForDocument):
2602         * style/StyleResolveForDocument.h:
2603         * style/StyleSharingResolver.cpp:
2604         (WebCore::Style::elementHasDirectionAuto):
2605         (WebCore::Style::SharingResolver::resolve):
2606         * style/StyleSharingResolver.h:
2607         * style/StyleTreeResolver.cpp:
2608         (WebCore::Style::ensurePlaceholderStyle):
2609
2610             Set the placeholder.
2611
2612         (WebCore::Style::TreeResolver::Parent::Parent):
2613         (WebCore::Style::TreeResolver::pushScope):
2614         (WebCore::Style::TreeResolver::pushEnclosingScope):
2615         (WebCore::Style::TreeResolver::popScope):
2616
2617             Set and clear StyleResolver overrideDocumentElementStyle as needed. It is owned by the TreeResolver.
2618
2619         (WebCore::Style::TreeResolver::styleForElement):
2620
2621             Clone the placeholder style.
2622
2623         (WebCore::Style::TreeResolver::resolveElement):
2624         (WebCore::Style::TreeResolver::pushParent):
2625         (WebCore::Style::TreeResolver::resolveComposedTree):
2626         (WebCore::Style::TreeResolver::resolve):
2627
2628             Adopt to the std::unique_ptr and ElementStyle move semantics.
2629
2630         * style/StyleTreeResolver.h:
2631         (WebCore::Style::TreeResolver::scope):
2632         * style/StyleUpdate.cpp:
2633         (WebCore::Style::Update::elementUpdate):
2634         (WebCore::Style::Update::textUpdate):
2635         (WebCore::Style::Update::elementStyle):
2636         (WebCore::Style::Update::addElement):
2637         (WebCore::Style::Update::addText):
2638         * style/StyleUpdate.h:
2639         (WebCore::Style::Update::roots):
2640         (WebCore::Style::Update::document):
2641         * svg/SVGAElement.cpp:
2642         (WebCore::SVGAElement::svgAttributeChanged):
2643         (WebCore::SVGAElement::createElementRenderer):
2644
2645         ...
2646
2647 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2648
2649         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaControlsHost
2650         https://bugs.webkit.org/show_bug.cgi?id=156903
2651
2652         Reviewed by Chris Dumez.
2653
2654         No change of behavior.
2655
2656         * Modules/mediacontrols/MediaControlsHost.idl: Marking some parameters as nullable.
2657
2658 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2659
2660         Drop [UsePointersEvenForNonNullableObjectArguments] from WebGLRenderingContext
2661         https://bugs.webkit.org/show_bug.cgi?id=156909
2662
2663         Reviewed by Chris Dumez.
2664
2665         No change of behavior.
2666
2667         Marking a lot of method parameters as nullable.
2668
2669         * html/canvas/WebGLRenderingContextBase.idl:
2670
2671 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2672
2673         Drop [UsePointersEvenForNonNullableObjectArguments] from WebSocket
2674         https://bugs.webkit.org/show_bug.cgi?id=156897
2675
2676         Reviewed by Chris Dumez.
2677
2678         No change of behavior.
2679
2680         Updating WebSocket::send methods to take references, except for ArrayBufferView, which is not yet supported by the binding generator.
2681
2682         * Modules/websockets/WebSocket.cpp:
2683         (WebCore::WebSocket::send):
2684         * Modules/websockets/WebSocket.h:
2685         * Modules/websockets/WebSocket.idl:
2686
2687 2016-04-23  Andy Estes  <aestes@apple.com>
2688
2689         Fix issues found by the clang static analyzer
2690         https://bugs.webkit.org/show_bug.cgi?id=156956
2691
2692         Reviewed by Alexey Proskuryakov.
2693
2694         * editing/cocoa/DataDetection.mm:
2695         (WebCore::DataDetection::detectContentInRange): Stored tz in a RetainPtr.
2696         * platform/cf/KeyedDecoderCF.cpp:
2697         (WebCore::KeyedDecoderCF::KeyedDecoderCF): If dynamic_cf_cast returned nullptr, the result of
2698         CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr, then leaked/adopted it
2699         into m_rootDictionary (to avoid retain count churn) if it is a CFDictionary.
2700         * platform/ios/WebAVPlayerController.mm:
2701         (-[WebAVPlayerController dealloc]): Released _externalPlaybackAirPlayDeviceLocalizedName.
2702         (-[WebAVMediaSelectionOption dealloc]): Added to release _localizedDisplayName.
2703         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2704         (-[WebAVPlayerLayer dealloc]): Released _pixelBufferAttributes.
2705         * platform/network/cocoa/WebCoreNSURLSession.h: Removed the readwrite attributes from properties, since
2706         properties are readwrite by default.
2707         * platform/network/cocoa/WebCoreNSURLSession.mm: Removed @dynamic, which isn't necessary just for defining a custom getter.
2708         (-[WebCoreNSURLSessionDataTask dealloc]): Added to release copied ivars.
2709
2710 2016-04-23  Dan Bernstein  <mitz@apple.com>
2711
2712         <rdar://problem/25894586> A project has failed to build because WTF_MAKE_FAST_ALLOCATED was not defined
2713
2714         Rubber-stamped by Chris Dumez.
2715
2716         Reverted the IntSize part of r199735, to let IntSize.h keep being used in another project.
2717
2718         * platform/graphics/IntSize.h:
2719         (WebCore::IntSize::IntSize):
2720
2721 2016-04-23  Chris Dumez  <cdumez@apple.com>
2722
2723         Tie the DiagnosticLoggingClient's lifetime to the Page
2724         https://bugs.webkit.org/show_bug.cgi?id=156938
2725         <rdar://problem/25851499>
2726
2727         Reviewed by Antti Koivisto.
2728
2729         Tie the DiagnosticLoggingClient's lifetime to the Page rather than to the
2730         MainFrame. The diagnostic logging client in WebKit2 requires the WebPage
2731         to be alive in order to send IPC to the UIProcess. The WebPage owns the
2732         Page and Page is not refCounted so the lifetime of the
2733         DiagnosticLoggingClient should now be tied to the one of the WebPage as
2734         well.
2735
2736         Previously, the DiagnosticLoggingClient would stay alive as long as the
2737         MainFrame and could apparently in rare cases outlive the WebPage, thus
2738         crashing when trying to send the IPC.
2739
2740         * history/PageCache.cpp:
2741         (WebCore::logPageCacheFailureDiagnosticMessage):
2742         (WebCore::canCachePage):
2743         * html/HTMLMediaElement.cpp:
2744         (WebCore::HTMLMediaElement::loadResource):
2745         (WebCore::logMediaLoadRequest):
2746         (WebCore::HTMLMediaElement::updatePlayState):
2747         (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad):
2748         * loader/EmptyClients.h:
2749         * loader/FrameLoader.cpp:
2750         (WebCore::logNavigation):
2751         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2752         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2753         * loader/ResourceLoader.cpp:
2754         (WebCore::logResourceResponseSource):
2755         * loader/SubframeLoader.cpp:
2756         (WebCore::logPluginRequest):
2757         * loader/SubresourceLoader.cpp:
2758         (WebCore::SubresourceLoader::willSendRequestInternal):
2759         (WebCore::SubresourceLoader::didReceiveResponse):
2760         (WebCore::logResourceLoaded):
2761         * loader/cache/CachedResourceLoader.cpp:
2762         (WebCore::logMemoryCacheResourceRequest):
2763         (WebCore::logResourceRevalidationDecision):
2764         * page/DiagnosticLoggingClient.h:
2765         * page/MainFrame.cpp:
2766         (WebCore::MainFrame::MainFrame): Deleted.
2767         (WebCore::MainFrame::~MainFrame): Deleted.
2768         (WebCore::MainFrame::diagnosticLoggingClient): Deleted.
2769         * page/MainFrame.h:
2770         * page/Page.cpp:
2771         (WebCore::Page::Page):
2772         (WebCore::Page::~Page):
2773         (WebCore::Page::diagnosticLoggingClient):
2774         * page/Page.h:
2775
2776 2016-04-22  Chris Dumez  <cdumez@apple.com>
2777
2778         Cannot access the SQLTransaction.constructor.prototype
2779         https://bugs.webkit.org/show_bug.cgi?id=156613
2780
2781         Reviewed by Darin Adler.
2782
2783         Drop [NoInterfaceObject] from the following SQL interfaces:
2784         Database, SQLError, SQLResultSet, SQLResultSetRowList and SQLTransaction.
2785
2786         This matches the specification:
2787         https://dev.w3.org/html5/webdatabase/
2788
2789         This was causing the 'constructor' property to be wrong for these
2790         interfaces as it would be a generic Object.
2791
2792         Test: storage/websql/transaction-prototype.html
2793
2794         * Modules/webdatabase/Database.idl:
2795         * Modules/webdatabase/SQLError.idl:
2796         * Modules/webdatabase/SQLResultSet.idl:
2797         * Modules/webdatabase/SQLResultSetRowList.idl:
2798         * Modules/webdatabase/SQLTransaction.idl:
2799
2800 2016-04-22  Joseph Pecoraro  <pecoraro@apple.com>
2801
2802         Web Inspector: Include columnNumber in event listener locations
2803         https://bugs.webkit.org/show_bug.cgi?id=156927
2804         <rdar://problem/25884584>
2805
2806         Reviewed by Brian Burg.
2807
2808         * inspector/InspectorDOMAgent.cpp:
2809         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2810         Include the column number in the location as well.
2811
2812 2016-04-22  Brent Fulgham  <bfulgham@apple.com>
2813
2814         [Win] Unreviewed build fix.
2815
2816         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2817         (PlatformCALayerWin::isHidden):
2818
2819 2016-04-22  Jer Noble  <jer.noble@apple.com>
2820
2821         [iOS] Crash at -[WebAVPlayerLayer resolveBounds]
2822         https://bugs.webkit.org/show_bug.cgi?id=156931
2823         <rdar://problem/25865315> 
2824
2825         Reviewed by Eric Carlson.
2826
2827         When cloning the WebAVPlayerLayer, we must copy over the fullscreenInterface to the cloned layer.
2828
2829         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2830         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
2831
2832 2016-04-22  Chris Dumez  <cdumez@apple.com>
2833
2834         Crash under WebCore::DataDetection::detectContentInRange()
2835         https://bugs.webkit.org/show_bug.cgi?id=156880
2836         <rdar://problem/25622631>
2837
2838         Reviewed by Darin Adler.
2839
2840         We would sometimes crash under WebCore::DataDetection::detectContentInRange()
2841         when dereferencing a null parentNode pointer. This patch adds a null check
2842         for parentNode in the for() loop. It also does some clean up and optimization
2843         since I was passing by.
2844
2845         * editing/cocoa/DataDetection.mm:
2846         (WebCore::DataDetection::detectContentInRange):
2847
2848 2016-04-22  Keith Miller  <keith_miller@apple.com>
2849
2850         buildObjectForEventListener should not call into JSC with a null ExecState
2851         https://bugs.webkit.org/show_bug.cgi?id=156923
2852
2853         Reviewed by Joseph Pecoraro.
2854
2855         If a user had disabled JavaScript on their page then the inspector tried to
2856         add an event listener we would fail to create an ExecState. Since we didn't
2857         check this ExecState was valid we would then attempt to stringify the value,
2858         which would cause JSC to crash.
2859
2860         * inspector/InspectorDOMAgent.cpp:
2861         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2862
2863 2016-04-22  Dean Jackson  <dino@apple.com>
2864
2865         Yet another attempt at fixing Windows.
2866
2867         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2868         (PlatformCALayerWin::isHidden):
2869         * platform/graphics/ca/win/PlatformCALayerWin.h:
2870
2871 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
2872
2873         Attempt to fix Windows build after r199862
2874
2875         Unreviewed build fix.
2876
2877         * platform/graphics/ca/win/PlatformCALayerWin.h:
2878
2879 2016-04-22  Brent Fulgham  <bfulgham@apple.com>
2880
2881         Anchor element 'ping' property should only apply to http/https destinations
2882         https://bugs.webkit.org/show_bug.cgi?id=156801
2883         <rdar://problem/25834419>
2884
2885         Reviewed by Chris Dumez.
2886
2887         Take advantage of the hyperlink auditing language "UAs may either ignore the
2888         ping attribute altogether, or selectively ignore URLs in the list (e.g. ignoring
2889         any third-party URLs)" to restrict pings to http/https targets. For details, see
2890         <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing>.
2891
2892         Tested by http/tests/navigation/ping-attribute tests.
2893
2894         * loader/PingLoader.cpp:
2895         (WebCore::PingLoader::sendPing): Ignore requests to ping anything outside the
2896         family of HTTP protocols (http/https).
2897
2898 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
2899
2900         Fix builds that do not support AVKit
2901
2902         Unreviewed build fix.
2903
2904         * platform/ios/WebAVPlayerController.h:
2905         * platform/ios/WebAVPlayerController.mm:
2906
2907 2016-04-22  Dave Hyatt  <hyatt@apple.com>
2908
2909         REGRESSION (r189567): The top of Facebook's messenger.com looks visually broken
2910         https://bugs.webkit.org/show_bug.cgi?id=156869
2911         <rdar://problem/23204668>
2912
2913         Reviewed by Zalan Bujtas.
2914
2915         Added fast/block/min-content-with-box-sizing.html
2916
2917         * rendering/RenderBox.cpp:
2918         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
2919
2920 2016-04-22  Antti Koivisto  <antti@apple.com>
2921
2922         TextAutoSizingKey should use normal refcounting
2923         https://bugs.webkit.org/show_bug.cgi?id=156893
2924
2925         Reviewed by Andreas Kling.
2926
2927         Get rid of special refcounting of style in favor of RefPtr. It also becomes a move-only type
2928         to support future switch to non-refcounted RenderStyle.
2929
2930         Also general cleanups and modernization.
2931
2932         * dom/Document.cpp:
2933         (WebCore::TextAutoSizingTraits::constructDeletedValue):
2934         (WebCore::TextAutoSizingTraits::isDeletedValue):
2935         (WebCore::Document::addAutoSizingNode):
2936         (WebCore::Document::validateAutoSizingNodes):
2937         (WebCore::Document::resetAutoSizingNodes):
2938
2939             Adopt to being move-only.
2940
2941         * rendering/TextAutoSizing.cpp:
2942         (WebCore::cloneRenderStyleWithState):
2943         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
2944
2945             Clone the style for safety against mutations. Cloning is cheap.
2946
2947         (WebCore::TextAutoSizingValue::numNodes):
2948         (WebCore::TextAutoSizingValue::adjustNodeSizes):
2949         (WebCore::TextAutoSizingValue::reset):
2950         (WebCore::TextAutoSizingKey::~TextAutoSizingKey): Deleted.
2951         (WebCore::TextAutoSizingKey::operator=): Deleted.
2952         (WebCore::TextAutoSizingKey::ref): Deleted.
2953         (WebCore::TextAutoSizingKey::deref): Deleted.
2954         * rendering/TextAutoSizing.h:
2955         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
2956         (WebCore::TextAutoSizingKey::style):
2957         (WebCore::TextAutoSizingKey::isDeleted):
2958         (WebCore::operator==):
2959         (WebCore::TextAutoSizingKey::doc): Deleted.
2960         (WebCore::TextAutoSizingKey::isValidDoc): Deleted.
2961         (WebCore::TextAutoSizingKey::isValidStyle): Deleted.
2962         (WebCore::TextAutoSizingKey::deletedKeyDoc): Deleted.
2963         (WebCore::TextAutoSizingKey::deletedKeyStyle): Deleted.
2964
2965             m_doc member is not used for anything except deleted value comparisons. Replace it with a bit.
2966
2967 2016-04-22  Chris Dumez  <cdumez@apple.com>
2968
2969         Crash under FontCache::purgeInactiveFontData()
2970         https://bugs.webkit.org/show_bug.cgi?id=156822
2971         <rdar://problem/25373970>
2972
2973         Reviewed by Darin Adler.
2974
2975         In some rare cases, the Font constructor would mutate the FontPlatformData
2976         that is being passed in. This is an issue because because our FontCache
2977         uses the FontPlatformData as key for the cached fonts. This could lead to
2978         crashes because the WTFMove() in FontCache::purgeInactiveFontData() would
2979         nullify values in our HashMap but we would then fail to remove them from
2980         the HashMap (because the key did not match). We would then reference the
2981         null font when looping again when doing font->hasOneRef().
2982
2983         This patch marks Font::m_platformData member as const to avoid such issues
2984         in the future and moves the code altering the FontPlatformData from the
2985         Font constructor into the FontPlatformData constructor. The purpose of
2986         that code was to initialize FontPlatformData::m_cgFont in case the CGFont
2987         passed in the constructor was null.
2988
2989         * platform/graphics/Font.h:
2990         * platform/graphics/FontCache.cpp:
2991         (WebCore::FontCache::fontForPlatformData):
2992         (WebCore::FontCache::purgeInactiveFontData):
2993         * platform/graphics/FontPlatformData.cpp:
2994         (WebCore::FontPlatformData::FontPlatformData):
2995         * platform/graphics/FontPlatformData.h:
2996         * platform/graphics/cocoa/FontCocoa.mm:
2997         (WebCore::webFallbackFontFamily): Deleted.
2998         (WebCore::Font::platformInit): Deleted.
2999         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3000         (WebCore::webFallbackFontFamily):
3001         (WebCore::FontPlatformData::setFallbackCGFont):
3002         * platform/graphics/win/FontPlatformDataCGWin.cpp:
3003         (WebCore::FontPlatformData::setFallbackCGFont):
3004
3005 2016-04-22  Chris Dumez  <cdumez@apple.com>
3006
3007         Support disabling at runtime IndexedDB constructors exposed to workers
3008         https://bugs.webkit.org/show_bug.cgi?id=156883
3009
3010         Reviewed by Darin Adler.
3011
3012         Support disabling at runtime IndexedDB constructors exposed to workers.
3013         Previously, constructors visibility to workers and window was constrolled
3014         by the same runtime flag.
3015
3016         * Modules/indexeddb/IDBCursor.idl:
3017         * Modules/indexeddb/IDBCursorWithValue.idl:
3018         * Modules/indexeddb/IDBDatabase.idl:
3019         * Modules/indexeddb/IDBFactory.idl:
3020         * Modules/indexeddb/IDBIndex.idl:
3021         * Modules/indexeddb/IDBKeyRange.idl:
3022         * Modules/indexeddb/IDBObjectStore.idl:
3023         * Modules/indexeddb/IDBOpenDBRequest.idl:
3024         * Modules/indexeddb/IDBRequest.idl:
3025         * Modules/indexeddb/IDBTransaction.idl:
3026         * Modules/indexeddb/IDBVersionChangeEvent.idl:
3027         * workers/WorkerGlobalScope.idl:
3028
3029 2016-04-22  Dean Jackson  <dino@apple.com>
3030
3031         Attempting to fix Windows build. Add isHidden implementation.
3032
3033         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3034         (PlatformCALayerWin::isHidden):
3035
3036 2016-04-22  Brady Eidson  <beidson@apple.com>
3037
3038         Attempt at a Windows build fix.
3039
3040         * workers/WorkerMessagingProxy.cpp:
3041         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
3042
3043 2016-04-22  Dave Hyatt  <hyatt@apple.com>
3044
3045          -webkit-image-set doesn't work inside CSS variables
3046         https://bugs.webkit.org/show_bug.cgi?id=156915
3047         <rdar://problem/25473972>
3048
3049         Reviewed by Zalan Bujtas.
3050
3051         Added new tests in fast/hidpi.
3052
3053         * css/CSSPrimitiveValue.cpp:
3054         (WebCore::CSSPrimitiveValue::equals):
3055         (WebCore::CSSPrimitiveValue::buildParserValue):
3056
3057 2016-04-22  Commit Queue  <commit-queue@webkit.org>
3058
3059         Unreviewed, rolling out r199877.
3060         https://bugs.webkit.org/show_bug.cgi?id=156918
3061
3062         The LayoutTest added with this change is failing on all
3063         platforms. (Requested by ryanhaddad on #webkit).
3064
3065         Reverted changeset:
3066
3067         "REGRESSION (r189567): The top of Facebook's messenger.com
3068         looks visually broken"
3069         https://bugs.webkit.org/show_bug.cgi?id=156869
3070         http://trac.webkit.org/changeset/199877
3071
3072 2016-04-22  Brady Eidson  <beidson@apple.com>
3073
3074         Modern IDB: Rework the ownership/RefCounting model of IDBConnectionToServer and IDBConnectionProxy.
3075         https://bugs.webkit.org/show_bug.cgi?id=156916
3076
3077         Reviewed by Tim Horton.
3078
3079         No new tests (No behavior change).
3080
3081         * Modules/indexeddb/IDBFactory.cpp: Remove unneeded include.
3082         
3083         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3084         (WebCore::IDBClient::IDBConnectionProxy::ref): Ref the ConnectionToServer.
3085         (WebCore::IDBClient::IDBConnectionProxy::deref): Deref it.
3086         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer):
3087         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
3088         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
3089         (WebCore::IDBClient::IDBConnectionProxy::create): Deleted.
3090         * Modules/indexeddb/client/IDBConnectionProxy.h:
3091         
3092         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3093         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer): Create a proxy owned by this.
3094         (WebCore::IDBClient::IDBConnectionToServer::proxy): Expose it.
3095         * Modules/indexeddb/client/IDBConnectionToServer.h:
3096         
3097         * dom/Document.cpp:
3098         (WebCore::Document::idbConnectionProxy):
3099
3100         * WebCore.xcodeproj/project.pbxproj:
3101
3102 2016-04-22  Antti Koivisto  <antti@apple.com>
3103
3104         REGRESSION (r194898): Multi download of external SVG defs file by <use> xlinks:href (caching)
3105         https://bugs.webkit.org/show_bug.cgi?id=156368
3106         <rdar://problem/25611746>
3107
3108         Reviewed by Simon Fraser.
3109
3110         We would load svg resources with fragment identifier again because the encoding never matched.
3111
3112         Test: http/tests/svg/svg-use-external.html
3113
3114         * loader/TextResourceDecoder.cpp:
3115         (WebCore::TextResourceDecoder::setEncoding):
3116         (WebCore::TextResourceDecoder::hasEqualEncodingForCharset):
3117
3118             Encoding can depend on mime type. Add a comparison function that takes this into account.
3119
3120         (WebCore::findXMLEncoding):
3121         * loader/TextResourceDecoder.h:
3122         (WebCore::TextResourceDecoder::encoding):
3123         * loader/cache/CachedCSSStyleSheet.h:
3124         * loader/cache/CachedResource.h:
3125         (WebCore::CachedResource::textResourceDecoder):
3126
3127             Add a way to get the TextResourceDecoder from a cached resource.
3128
3129         * loader/cache/CachedResourceLoader.cpp:
3130         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
3131
3132             Use the new comparison function.
3133
3134         * loader/cache/CachedSVGDocument.h:
3135         * loader/cache/CachedScript.h:
3136         * loader/cache/CachedXSLStyleSheet.h:
3137
3138 2016-04-22  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3139
3140         Drop [UsePointersEvenForNonNullableObjectArguments] from InspectorFrontendHost
3141         https://bugs.webkit.org/show_bug.cgi?id=156908
3142
3143         Reviewed by Timothy Hatcher.
3144
3145         No change of behavior.
3146
3147         * inspector/InspectorFrontendHost.idl: Marking event parameter as nullable to keep compatibility.
3148
3149 2016-04-22  Chris Dumez  <cdumez@apple.com>
3150
3151         Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
3152         https://bugs.webkit.org/show_bug.cgi?id=156890
3153
3154         Reviewed by Darin Adler.
3155
3156         Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
3157         and clean up / modernize the code a bit. There is not significant Web-
3158         exposed behavior change except that MutationObserver.observe() now throws
3159         a different kind of exception (a TypeError as per Web IDL) when passed in
3160         a null Node.
3161
3162         No new tests, rebaselined existing test.
3163
3164         * bindings/js/JSMutationCallback.cpp:
3165         (WebCore::JSMutationCallback::call):
3166         * bindings/js/JSMutationCallback.h:
3167         * bindings/js/JSMutationObserverCustom.cpp:
3168         (WebCore::constructJSMutationObserver):
3169         * css/PropertySetCSSStyleDeclaration.cpp:
3170         * dom/ChildListMutationScope.cpp:
3171         (WebCore::ChildListMutationAccumulator::enqueueMutationRecord):
3172         * dom/MutationCallback.h:
3173         * dom/MutationObserver.cpp:
3174         (WebCore::MutationObserver::create):
3175         (WebCore::MutationObserver::MutationObserver):
3176         (WebCore::MutationObserver::observe):
3177         (WebCore::MutationObserver::takeRecords):
3178         (WebCore::MutationObserver::enqueueMutationRecord):
3179         (WebCore::MutationObserver::deliver):
3180         (WebCore::MutationObserver::disconnect): Deleted.
3181         * dom/MutationObserver.h:
3182         * dom/MutationObserver.idl:
3183         * dom/MutationObserverInterestGroup.cpp:
3184         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
3185         * dom/MutationObserverInterestGroup.h:
3186         * dom/MutationRecord.cpp:
3187         (WebCore::MutationRecord::createChildList):
3188         * dom/MutationRecord.h:
3189
3190 2016-04-22  Dave Hyatt  <hyatt@apple.com>
3191
3192         REGRESSION (r189567): The top of Facebook's messenger.com looks visually broken
3193         https://bugs.webkit.org/show_bug.cgi?id=156869
3194         <rdar://problem/23204668>
3195
3196         Reviewed by Zalan Bujtas.
3197
3198         Added fast/block/min-content-with-box-sizing.html
3199
3200         * rendering/RenderBox.cpp:
3201         (WebCore::RenderBox::computeContentLogicalHeight):
3202
3203 2016-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
3204
3205         [css-grid] Fix bug with positioned items in vertical writing mode
3206         https://bugs.webkit.org/show_bug.cgi?id=156870
3207
3208         Reviewed by Darin Adler.
3209
3210         In RenderGrid::offsetAndBreadthForPositionedChild() we were using
3211         directly borderLeft(), which is wrong in vertical writing modes.
3212
3213         To fix it we just need to use borderLogicalLeft() which is aware of
3214         the current writing mode.
3215
3216         Test: fast/css-grid-layout/grid-positioned-children-writing-modes.html
3217
3218         * rendering/RenderGrid.cpp:
3219         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
3220
3221 2016-04-21  Zan Dobersek  <zdobersek@igalia.com>
3222
3223         REGRESSION(r199738): The ANGLE update broke accelerated compositing in GTK+ port
3224         https://bugs.webkit.org/show_bug.cgi?id=156789
3225
3226         Reviewed by Carlos Garcia Campos.
3227
3228         After the update, the ANGLE library has to be built with
3229         ANGLE_ENABLE_ESSL and ANGLE_ENABLE_GLSL definitions in order
3230         to compile in the support for the two translators that Linux-based
3231         ports using OpenGL ES or OpenGL require. Missing files are also added.
3232
3233         * CMakeLists.txt:
3234
3235 2016-04-21  Chris Dumez  <cdumez@apple.com>
3236
3237         Drop [UsePointersEvenForNonNullableObjectArguments] from Document
3238         https://bugs.webkit.org/show_bug.cgi?id=156881
3239
3240         Reviewed by Darin Adler.
3241
3242         Drop [UsePointersEvenForNonNullableObjectArguments] from Document. There
3243         is no major Web-exposed behavior change but the type of the exception
3244         being thrown when passing null or not enough parameters has changed for
3245         some of the API (It is now always a TypeError as per the Web IDL
3246         specification).
3247
3248         Tests: fast/dom/Document/adoptNode-null.html
3249                fast/dom/Document/importNode-null.html
3250
3251         * dom/ContainerNode.cpp:
3252         (WebCore::ContainerNode::takeAllChildrenFrom):
3253         (WebCore::ContainerNode::parserInsertBefore):
3254         (WebCore::ContainerNode::parserAppendChild):
3255         * dom/Document.cpp:
3256         (WebCore::Document::importNode):
3257         (WebCore::Document::adoptNode):
3258         (WebCore::Document::createNodeIterator):
3259         (WebCore::Document::createTreeWalker):
3260         (WebCore::Document::setBodyOrFrameset):
3261         (WebCore::Document::hasValidNamespaceForElements): Deleted.
3262         (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
3263         (WebCore::Document::scheduleStyleRecalc): Deleted.
3264         (WebCore::Document::unscheduleStyleRecalc): Deleted.
3265         (WebCore::Document::hasPendingStyleRecalc): Deleted.
3266         (WebCore::Document::hasPendingForcedStyleRecalc): Deleted.
3267         (WebCore::Document::recalcStyle): Deleted.
3268         (WebCore::Document::explicitClose): Deleted.
3269         * dom/Document.h:
3270         (WebCore::Document::importNode):
3271         * dom/Document.idl:
3272         * dom/NodeIterator.cpp:
3273         (WebCore::NodeIterator::NodeIterator):
3274         * dom/NodeIterator.h:
3275         (WebCore::NodeIterator::create):
3276
3277 2016-04-21  Frederic Wang  <fwang@igalia.com>
3278
3279         More improvements and explanations regarding resetting CSS properties on the <math> element
3280         https://bugs.webkit.org/show_bug.cgi?id=156840
3281
3282         Reviewed by Darin Adler.
3283
3284         We some follow-up improvements regarding CSS rules on the <math> element, after bug 133603:
3285         - We fix indenting to use 4 spaces.
3286         - We explain why we set -webkit-line-box-contain and add references to related bugs.
3287         - We explain why we reset some CSS spacing rules.
3288         - We explain why the direction is set to ltr.
3289         - We explain why font-family is set to a list of known math fonts and add reference
3290           to the wiki.
3291         - We mention the need to customize math fonts to get consistent style and add references to
3292           a bug report and to the wiki.
3293         - We described each of the math font listed and add some justification about their orders.
3294         - We better explain the section about fonts that do not satisfy the requirements for good
3295           mathematical rendering, reformulate why we still need them for iOS/Mac and we add some
3296           references to a bug report and to the wiki. Some fonts that not pre-installed were removed
3297           in r199773.
3298         - We add a FIXME comments for potential changes of CSS properties on the <math> tag.
3299
3300         We make the following changes to the lists of font-family:
3301         - We move "TeX Gyre Termes Math" into the Times group.
3302         - We move "Asana Math" into the Palatino group.
3303         - We remove iOS conditionals on "Symbol" and "Times New Roman".
3304
3305         No new tests, only order of math fonts that are not used by test framework is changed.
3306
3307         * css/mathml.css:
3308         (math): We merge the two math selectors, reorder some font-families, remove iOS ifdef and
3309         add more description.
3310
3311 2016-04-21  Dean Jackson  <dino@apple.com>
3312
3313         Backdrop Filter should not be visible if element has visibility:hidden
3314         https://bugs.webkit.org/show_bug.cgi?id=149318
3315         <rdar://problem/22749780>
3316
3317         Reviewed by Simon Fraser.
3318
3319         Make sure that backdrop filter layers take note of when
3320         the contents are visible or not.
3321
3322         Tests: css3/filters/backdrop/backdrop-with-visibility-hidden-changing.html
3323                css3/filters/backdrop/backdrop-with-visibility-hidden.html
3324                css3/filters/backdrop/backdrop-with-visibility-hidden-2.html
3325
3326         * platform/graphics/ca/GraphicsLayerCA.cpp:
3327         (WebCore::GraphicsLayerCA::updateContentsVisibility): Tell the backdrop layer about the
3328         change if there is one.
3329         (WebCore::GraphicsLayerCA::updateBackdropFilters): When we update filters, make
3330         sure to check the contents visibility.
3331         (WebCore::dumpInnerLayer): Output "hidden" if the layer is set as such.
3332         * platform/graphics/ca/PlatformCALayer.h: Add an isHidden method.
3333         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
3334         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3335         (PlatformCALayerCocoa::isHidden): Call into CALayer isHidden.
3336
3337 2016-04-21  Zalan Bujtas  <zalan@apple.com>
3338
3339         RenderVideo should always update the intrinsic size before layout.
3340         https://bugs.webkit.org/show_bug.cgi?id=156878
3341
3342         Reviewed by Simon Fraser.
3343
3344         In order to layout video element properly we need to know the correct intrinsic size.
3345         This patch also asserts if we end up updating the intrinsic size right after finishing video renderer layout.
3346
3347         This issues was discovered as part of webkit.org/b/156245. (hence covered by existing tests)
3348
3349         * rendering/RenderVideo.cpp:
3350         (WebCore::RenderVideo::updateIntrinsicSize):
3351         (WebCore::RenderVideo::layout):
3352         (WebCore::RenderVideo::updatePlayer):
3353         * rendering/RenderVideo.h:
3354
3355 2016-04-21  Brady Eidson  <beidson@apple.com>
3356
3357         Modern IDB (Workers): Get the IDBConnectionProxy from the Document to the WorkerGlobalScope.
3358         https://bugs.webkit.org/show_bug.cgi?id=156877
3359
3360         Reviewed by Tim Horton.
3361
3362         No new tests (Covered by changes to existing tests).
3363
3364         * workers/WorkerMessagingProxy.cpp:
3365         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): This is the point on the main thread
3366           where we can get the IDBConnectionProxy from the Document and pass it down through Worker
3367           machinery so it can end up at the WorkerGlobalScope.
3368         
3369         Everything else is this patch is just passing it along as needed.
3370
3371         And cleaning up header style for neglected headers.
3372
3373         * workers/DedicatedWorkerGlobalScope.cpp:
3374         (WebCore::DedicatedWorkerGlobalScope::create):
3375         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
3376         * workers/DedicatedWorkerGlobalScope.h:
3377
3378         * workers/DedicatedWorkerThread.cpp:
3379         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
3380         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
3381         * workers/DedicatedWorkerThread.h:
3382         (WebCore::DedicatedWorkerThread::create):
3383         (WebCore::DedicatedWorkerThread::workerObjectProxy):
3384
3385         * workers/WorkerGlobalScope.cpp:
3386         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
3387         (WebCore::WorkerGlobalScope::idbConnectionProxy):
3388         * workers/WorkerGlobalScope.h:
3389
3390         * workers/WorkerThread.cpp:
3391         (WebCore::WorkerThread::WorkerThread):
3392         (WebCore::WorkerThread::idbConnectionProxy):
3393         * workers/WorkerThread.h:
3394         (WebCore::WorkerThread::threadID):
3395         (WebCore::WorkerThread::runLoop):
3396         (WebCore::WorkerThread::workerLoaderProxy):
3397         (WebCore::WorkerThread::workerReportingProxy):
3398         (WebCore::WorkerThread::getNotificationClient):
3399         (WebCore::WorkerThread::setNotificationClient):
3400         (WebCore::WorkerThread::workerGlobalScope):
3401
3402 2016-04-21  Anders Carlsson  <andersca@apple.com>
3403
3404         Fix crashes when loading SVG images.
3405
3406         * loader/EmptyClients.cpp:
3407         (WebCore::fillWithEmptyClients):
3408         Give the SVG page its own application cache storage.
3409
3410 2016-04-21  Anders Carlsson  <andersca@apple.com>
3411
3412         Get rid of ApplicationCacheStorage::singleton
3413         https://bugs.webkit.org/show_bug.cgi?id=156882
3414
3415         Reviewed by Tim Horton.
3416
3417         * loader/appcache/ApplicationCacheStorage.cpp:
3418         (WebCore::ApplicationCacheStorage::setCacheDirectory): Deleted.
3419         (WebCore::ApplicationCacheStorage::singleton): Deleted.
3420         * loader/appcache/ApplicationCacheStorage.h:
3421         * page/Page.cpp:
3422         (WebCore::Page::Page):
3423
3424 2016-04-21  Simon Fraser  <simon.fraser@apple.com>
3425
3426         ASSERTION FAILED: accumulation == TransformState::FlattenTransform in WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect
3427         https://bugs.webkit.org/show_bug.cgi?id=155362
3428
3429         Reviewed by Zalan Bujtas.
3430
3431         A particular configuration of composited RenderLayers with preserve-3d and clipping
3432         caused assertions because an ancestor clipping layer had masksToBounds() set, but
3433         a preserves3D() parent, triggering an assertion in GraphicsLayerCA::computeVisibleAndCoverageRect().
3434         Make two changes to address this:
3435
3436         First, CSS clip: and clip-path: should force flattening and override preserve-3d in
3437         the RenderStyle.
3438
3439         Second, don't accumulate transforms in GraphicsLayerCA through layers with masksToBounds().
3440
3441         Tests: compositing/clipping/preserve3d-flatten-assertion-nested.html
3442                compositing/clipping/preserve3d-flatten-assertion.html
3443
3444         * css/StyleResolver.cpp:
3445         (WebCore::StyleResolver::adjustRenderStyle):
3446         * platform/graphics/ca/GraphicsLayerCA.cpp:
3447         (WebCore::accumulatesTransform):
3448
3449 2016-04-21  Chris Dumez  <cdumez@apple.com>
3450
3451         Element::idForStyleResolution() is a foot-gun
3452         https://bugs.webkit.org/show_bug.cgi?id=156852
3453
3454         Reviewed by Darin Adler.
3455
3456         Element::idForStyleResolution() is a foot-gun. It requires the caller to check
3457         Element::hasID() first or it may end up crashing when dereferencing elementData()
3458         (e.g. see Bug 156806).
3459
3460         This patch updates Element::idForStyleResolution() to return nullAtom is the
3461         Element does not have an ID. I did not see a performance impact on Speedometer,
3462         Dromaeo DOM Core, Dromaeo CSS Selectors and our local performanceTests/.
3463
3464         * css/ElementRuleCollector.cpp:
3465         (WebCore::ElementRuleCollector::collectMatchingRules):
3466         * css/SelectorChecker.cpp:
3467         (WebCore::SelectorChecker::checkOne):
3468         * css/SelectorFilter.cpp:
3469         (WebCore::collectElementIdentifierHashes):
3470         * dom/Element.h:
3471         (WebCore::Element::idForStyleResolution):
3472         * rendering/RenderBlockFlow.cpp:
3473         (WebCore::needsAppleMailPaginationQuirk):
3474         * rendering/RenderTreeAsText.cpp:
3475         (WebCore::writeRenderRegionList):
3476         * style/StyleSharingResolver.cpp:
3477         (WebCore::Style::SharingResolver::canShareStyleWithElement):
3478
3479 2016-04-21  Brady Eidson  <beidson@apple.com>
3480
3481         Modern IDB (Workers): Move IDBConnectionProxy into IDBRequest and IDBDatabase.
3482         https://bugs.webkit.org/show_bug.cgi?id=156868
3483
3484         Reviewed by Tim Horton.
3485
3486         No new tests (No behavior change).
3487
3488         * Modules/indexeddb/IDBDatabase.cpp:
3489         (WebCore::IDBDatabase::create):
3490         (WebCore::IDBDatabase::IDBDatabase):
3491         (WebCore::IDBDatabase::~IDBDatabase):
3492         (WebCore::IDBDatabase::transaction):
3493         (WebCore::IDBDatabase::maybeCloseInServer):
3494         * Modules/indexeddb/IDBDatabase.h:
3495         (WebCore::IDBDatabase::connectionProxy):
3496         (WebCore::IDBDatabase::serverConnection):
3497
3498         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3499         (WebCore::IDBOpenDBRequest::createDeleteRequest):
3500         (WebCore::IDBOpenDBRequest::createOpenRequest):
3501         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
3502         (WebCore::IDBOpenDBRequest::onSuccess):
3503         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
3504         (WebCore::IDBOpenDBRequest::requestCompleted):
3505         (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest): Deleted.
3506         (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest): Deleted.
3507         * Modules/indexeddb/IDBOpenDBRequest.h:
3508
3509         * Modules/indexeddb/IDBRequest.cpp:
3510         (WebCore::IDBRequest::IDBRequest):
3511         (WebCore::IDBRequest::connectionToServer): Deleted.
3512         * Modules/indexeddb/IDBRequest.h:
3513         (WebCore::IDBRequest::connectionProxy):
3514
3515         * Modules/indexeddb/IDBTransaction.h:
3516
3517         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3518         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
3519         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
3520
3521 2016-04-21  Jiewen Tan  <jiewen_tan@apple.com>
3522
3523         [iOS] DumpRenderTree crashed in com.apple.WebCore: WebCore::ResourceLoadNotifier::didFailToLoad
3524         https://bugs.webkit.org/show_bug.cgi?id=156829
3525         <rdar://problem/23348217>
3526
3527         Reviewed by Daniel Bates.
3528
3529         Ensure that the frame associated with the ResourceLoadNotifier is kept alive when notifying the Web Inspector.
3530
3531         Covered by existing tests.
3532
3533         * loader/ResourceLoadNotifier.cpp:
3534         (WebCore::ResourceLoadNotifier::didFailToLoad):
3535         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
3536         (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
3537         (WebCore::ResourceLoadNotifier::dispatchDidReceiveData):
3538         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
3539         (WebCore::ResourceLoadNotifier::dispatchDidFailLoading):
3540
3541 2016-04-21  Brady Eidson  <beidson@apple.com>
3542
3543         Modern IDB (Workers): More IDBConnectionProxy refactoring.
3544         https://bugs.webkit.org/show_bug.cgi?id=156855
3545
3546         Reviewed by Darin Adler.
3547
3548         No new tests (Covered by changes to existing tests).
3549
3550         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
3551         (WebCore::DOMWindowIndexedDatabase::indexedDB):
3552
3553         Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
3554         * Modules/indexeddb/IDBFactory.cpp:
3555         (WebCore::IDBFactory::create):
3556         (WebCore::IDBFactory::IDBFactory):
3557         (WebCore::IDBFactory::openInternal):
3558         (WebCore::IDBFactory::deleteDatabase):
3559         * Modules/indexeddb/IDBFactory.h:
3560
3561         Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
3562         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
3563         (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
3564         (WebCore::WorkerGlobalScopeIndexedDatabase::from):
3565         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
3566         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
3567
3568         Make IDBConnectionProxy ThreadSafeRefCounted:
3569         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3570         (WebCore::IDBClient::IDBConnectionProxy::create):
3571         * Modules/indexeddb/client/IDBConnectionProxy.h:
3572
3573         * dom/Document.cpp:
3574         (WebCore::Document::idbConnectionProxy):
3575         * dom/Document.h:
3576
3577 2016-04-21  Keith Miller  <keith_miller@apple.com>
3578
3579         WebScriptObject description swizzler should work in a multi-threaded world
3580         https://bugs.webkit.org/show_bug.cgi?id=156808
3581
3582         Reviewed by Geoffrey Garen.
3583
3584         A WebKit legacy API user might be running Objective-C code on another thread.
3585         Since we don't want to corrupt other thread's NSObject description method
3586         we use TLS to record if we are in the stringValue function. As an attempt to
3587         preserve any user swizzling we update the non-stringValue NSObject description
3588         method on each call to stringValue if it has changed. Additionally, the TLS
3589         needs to be a int because the user might call into stringValue, back into JS,
3590         then back into stringValue. If the TLS was a boolean then it would be unset
3591         at that point so when we return into the first stringValue call we would call
3592         the original NSObject description method rather than our override.
3593
3594         Test added to API tests: WebKit1.WebScriptObjectDescription
3595
3596         * bridge/objc/objc_instance.mm:
3597         (-[NSObject _web_description]):
3598         (ObjcInstance::stringValue):
3599         (swizzleNSObjectDescription): Deleted.
3600
3601 2016-04-21  Beth Dakin  <bdakin@apple.com>
3602
3603         Build fix.
3604
3605         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
3606         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
3607         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
3608         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
3609
3610 2016-04-21  Beth Dakin  <bdakin@apple.com>
3611
3612         32 bit build fix.
3613
3614         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
3615
3616 2016-04-21  Konstantin Tokarev  <annulen@yandex.ru>
3617
3618         Fixed compilation with !ENABLE(SVG_FONTS).
3619         https://bugs.webkit.org/show_bug.cgi?id=156850
3620
3621         Reviewed by Michael Catanzaro.
3622
3623         No new tests needed.
3624
3625         * css/CSSFontFaceSource.cpp:
3626         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
3627         Added missing ENABLE(SVG_FONTS) guards.
3628         * css/CSSFontFaceSource.h: Ditto.
3629         * platform/graphics/FontCascade.cpp: Ditto.
3630         * svg/SVGToOTFFontConversion.cpp:
3631         (WebCore::FontCascade::drawGlyphBuffer): Deleted extraneous
3632         !ENABLE(SVG_FONTS) guard.
3633
3634 2016-04-21  Beth Dakin  <bdakin@apple.com>
3635
3636         Remove reliance on WebAVMediaSelectionOptionMac for the 
3637         WebPlaybackControlsManager
3638         https://bugs.webkit.org/show_bug.cgi?id=156811
3639         -and corresponding-
3640         rdar://problem/25760523
3641
3642         Reviewed by Jer Noble.
3643
3644         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
3645         (-[WebPlaybackControlsManager setSeekableTimeRanges:]):
3646         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
3647         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
3648         (WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
3649         (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
3650         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
3651         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
3652         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
3653         (-[WebAVMediaSelectionOptionMac localizedDisplayName]): Deleted.
3654         (-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]): Deleted.
3655         (-[WebPlaybackControlsManager isSeeking]): Deleted.
3656         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): Deleted.
3657         (-[WebPlaybackControlsManager audioMediaSelectionOptions]): Deleted.
3658         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]): Deleted.
3659         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]): Deleted.
3660         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]): Deleted.
3661         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]): Deleted.
3662         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]): Deleted.
3663         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]): Deleted.
3664         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]): Deleted.
3665         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]): Deleted.
3666         (WebCore::mediaSelectionOptions): Deleted.
3667
3668 2016-04-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
3669
3670         REGRESSION(198782): ImageSource::subsamplingLevelForScale() does not cache the MaximumSubsamplingLevel for this ImageSource
3671         https://bugs.webkit.org/show_bug.cgi?id=156766
3672
3673         Reviewed by Darin Adler.
3674
3675         Ensure the MaximumSubsamplingLevel for the ImageSource is calculated
3676         only once and is cached for subsequent uses. 
3677         
3678         The image subsampling is on by default only for iOS. So the and this
3679         patch currently affects the iOS port.
3680
3681         * platform/graphics/ImageSource.cpp:
3682         (WebCore::ImageSource::cacheMetadata): Cache m_maximumSubsamplingLevel.
3683         Use m_frameCount as a flag for having_the_cache_done.
3684         (WebCore::ImageSource::subsamplingLevelForScale): Call cacheMetadata()
3685         before using m_maximumSubsamplingLevel.
3686         (WebCore::ImageSource::frameCount): Call cacheMetadata() before returning
3687         m_frameCount.
3688         * platform/graphics/ImageSource.h:
3689
3690 2016-04-21  Antoine Quint  <graouts@apple.com>
3691
3692         Creating a large number of WebGL contexts should recycle older contexts
3693         https://bugs.webkit.org/show_bug.cgi?id=156689
3694         <rdar://problem/19535330>
3695
3696         Reviewed by Dean Jackson.
3697
3698         We used to stop creating WebGL contexts once a maximum of 64 WebGL contexts had been
3699         created on a page. Other browsers have a limit of 16 concurrent active WebGL contexts
3700         and they lose older contexts when the developer creates a new context, logging a warning
3701         to the console. We now follow the same approach.
3702
3703         Tests: webgl/max-active-contexts-console-warning.html
3704                webgl/max-active-contexts-gc.html
3705                webgl/max-active-contexts-oldest-context-lost.html
3706                webgl/max-active-contexts-webglcontextlost-prevent-default.html
3707
3708         * html/canvas/WebGLRenderingContextBase.cpp:
3709         (WebCore::WebGLRenderingContextBase::recycleContext):
3710
3711         Prints a warning message to the console indicating that an older WebGL context
3712         will be lost to accomodate for the active contexts limit being reached and loses
3713         the provided context in a way that it may not be recovered by calling `event.preventDefault()`
3714         in the `webglcontextlost` event handler. Finally, we destroy the associated GraphicsContext3D
3715         since it will no longer be useful and it may hold large Open GL resources.
3716
3717         * html/canvas/WebGLRenderingContextBase.h:
3718         * platform/graphics/GraphicsContext3D.h:
3719
3720         Changed GraphicsContext3D::create to return RefPtr instead of PassRefPtr.
3721
3722         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3723         (WebCore::GraphicsContext3D::create):
3724         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
3725         (WebCore::GraphicsContext3D::create):
3726         * platform/graphics/mac/GraphicsContext3DMac.mm:
3727         (WebCore::activeContexts):
3728         (WebCore::GraphicsContext3D::create):
3729
3730         Check if we are at the active contexts limit (16) and recycle the oldest context
3731         in our active contexts list. Calling recycleContext() on a context will call the
3732         GraphicsContext3D destructor and remove it from the active contexts list there.
3733
3734         (WebCore::GraphicsContext3D::~GraphicsContext3D):
3735
3736         Remove the deconstructed context from the active contexts list.
3737
3738         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3739         (WebCore::GraphicsContext3D::recycleContext):
3740         * platform/graphics/win/GraphicsContext3DWin.cpp:
3741         (WebCore::GraphicsContext3D::create):
3742
3743 2016-04-21  Dave Hyatt  <hyatt@apple.com>
3744
3745         Don't hyphenate the last word in a paragraph of text.
3746         https://bugs.webkit.org/show_bug.cgi?id=156803
3747
3748         Reviewed by Simon Fraser.
3749
3750         Added fast/text/hyphenate-avoid-orphaned-word.html
3751
3752         * rendering/RenderText.h:
3753         * rendering/line/BreakingContext.h:
3754         (WebCore::BreakingContext::handleText):
3755
3756 2016-04-21  Chris Dumez  <cdumez@apple.com>
3757
3758         Drop [UsePointersEvenForNonNullableObjectArguments] from Range
3759         https://bugs.webkit.org/show_bug.cgi?id=156805
3760
3761         Reviewed by Youenn Fablet.
3762
3763         No new tests, no web-exposed behavior change.
3764
3765         * accessibility/AXObjectCache.cpp:
3766         (WebCore::AXObjectCache::rangeForNodeContents):
3767         (WebCore::characterOffsetsInOrder):
3768         (WebCore::setRangeStartOrEndWithCharacterOffset):
3769         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
3770         (WebCore::AXObjectCache::previousBoundary):
3771         * accessibility/AccessibilityObject.cpp:
3772         (WebCore::AccessibilityObject::selectText):
3773         * accessibility/AccessibilityRenderObject.cpp:
3774         (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange):
3775         * dom/Node.cpp:
3776         (WebCore::Node::textRects):
3777         * dom/Range.cpp:
3778         (WebCore::Range::Range):
3779         (WebCore::Range::setDocument):
3780         (WebCore::Range::setStart):
3781         (WebCore::Range::setEnd):
3782         (WebCore::Range::isPointInRange):
3783         (WebCore::Range::comparePoint):
3784         (WebCore::Range::compareNode):
3785         (WebCore::Range::compareBoundaryPoints):
3786         (WebCore::Range::compareBoundaryPointsForBindings):
3787         (WebCore::Range::intersectsNode):
3788         (WebCore::Range::processContents):
3789         (WebCore::Range::insertNode):
3790         (WebCore::Range::checkNodeWOffset):
3791         (WebCore::Range::setStartAfter):
3792         (WebCore::Range::setEndBefore):
3793         (WebCore::Range::setEndAfter):
3794         (WebCore::Range::selectNode):
3795         (WebCore::Range::selectNodeContents):
3796         (WebCore::Range::surroundContents):
3797         (WebCore::Range::setStartBefore):
3798         (WebCore::Range::contains):
3799         (WebCore::rangesOverlap):
3800         (WebCore::rangeOfContents):
3801         (WebCore::boundaryNodeChildrenWillBeRemoved):
3802         (WebCore::boundaryTextNodesMerged):
3803         (WebCore::boundaryTextNodesSplit):
3804         (WebCore::Range::expand):
3805         (WebCore::checkForDifferentRootContainer): Deleted.
3806         (WebCore::highestAncestorUnderCommonRoot): Deleted.
3807         (WebCore::childOfCommonRootBeforeOffset): Deleted.
3808         (WebCore::deleteCharacterData): Deleted.
3809         (WebCore::Range::toString): Deleted.
3810         (WebCore::Range::toHTML): Deleted.
3811         (WebCore::Range::text): Deleted.
3812         (WebCore::Range::cloneRange): Deleted.
3813         (WebCore::Range::absoluteTextRects): Deleted.
3814         (WebCore::Range::absoluteTextQuads): Deleted.
3815         (WebCore::boundaryNodeChildrenChanged): Deleted.
3816         (WebCore::boundaryNodeWillBeRemoved): Deleted.
3817         (WebCore::Range::nodeWillBeRemoved): Deleted.
3818         (WebCore::boundaryTextRemoved): Deleted.
3819         (WebCore::Range::getBoundingClientRect): Deleted.
3820         (WebCore::Range::getBorderAndTextQuads): Deleted.
3821         * dom/Range.h:
3822         * dom/Range.idl:
3823         * dom/RangeBoundaryPoint.h:
3824         (WebCore::RangeBoundaryPoint::set):
3825         (WebCore::RangeBoundaryPoint::setToStartOfNode):
3826         (WebCore::RangeBoundaryPoint::setToEndOfNode):
3827         * editing/AlternativeTextController.cpp:
3828         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
3829         * editing/ApplyStyleCommand.cpp:
3830         (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
3831         * editing/Editor.cpp:
3832         (WebCore::Editor::advanceToNextMisspelling):
3833         (WebCore::Editor::rangeOfString):
3834         (WebCore::isFrameInRange):
3835         (WebCore::Editor::countMatchesForText):
3836         * editing/EditorCommand.cpp:
3837         (WebCore::unionDOMRanges):
3838         (WebCore::executeDeleteToMark):
3839         (WebCore::executeSelectToMark):
3840         * editing/FormatBlockCommand.cpp:
3841         (WebCore::FormatBlockCommand::formatRange):
3842         * editing/FrameSelection.cpp:
3843         (WebCore::FrameSelection::respondToNodeModification):
3844         * editing/InsertListCommand.cpp:
3845         (WebCore::InsertListCommand::doApplyForSingleParagraph):
3846         * editing/TextCheckingHelper.cpp:
3847         (WebCore::TextCheckingParagraph::offsetTo):
3848         * editing/TextIterator.cpp:
3849         (WebCore::CharacterIterator::range):
3850         (WebCore::BackwardsCharacterIterator::range):
3851         (WebCore::TextIterator::rangeFromLocationAndLength):
3852         (WebCore::TextIterator::getLocationAndLengthFromRange):
3853         (WebCore::findPlainText):
3854         * editing/VisiblePosition.cpp:
3855         (WebCore::setStart):
3856         (WebCore::setEnd):
3857         * editing/VisibleSelection.cpp:
3858         (WebCore::makeSearchRange):
3859         * editing/VisibleUnits.cpp:
3860         (WebCore::previousBoundary):
3861         (WebCore::nextBoundary):
3862         * editing/htmlediting.cpp:
3863         (WebCore::visiblePositionForIndexUsingCharacterIterator):
3864         (WebCore::isNodeVisiblyContainedWithin):
3865         * editing/htmlediting.h:
3866         * editing/mac/EditorMac.mm:
3867         (WebCore::Editor::adjustedSelectionRange):
3868         * page/ContextMenuController.cpp:
3869         (WebCore::ContextMenuController::contextMenuItemSelected):
3870         * page/DOMSelection.cpp:
3871         (WebCore::DOMSelection::addRange):
3872         * page/DragController.cpp:
3873         (WebCore::selectElement):
3874         * page/EventHandler.cpp:
3875         (WebCore::EventHandler::dispatchMouseEvent):
3876         * page/Page.cpp:
3877         (WebCore::Page::findStringMatchingRanges):
3878         * page/TextIndicator.cpp:
3879         (WebCore::hasNonInlineOrReplacedElements):
3880         * rendering/RenderNamedFlowThread.cpp:
3881         (WebCore::RenderNamedFlowThread::getRanges):
3882
3883 2016-04-21  Chris Dumez  <cdumez@apple.com>
3884
3885         Drop [UsePointersEvenForNonNullableObjectArguments] from DOMURL
3886         https://bugs.webkit.org/show_bug.cgi?id=156797
3887
3888         Reviewed by Youenn Fablet.
3889
3890         * html/DOMURL.cpp:
3891         (WebCore::DOMURL::create):
3892         * html/DOMURL.h:
3893         * html/DOMURL.idl:
3894
3895 2016-04-21  Claudio Saavedra  <csaavedra@igalia.com>
3896
3897         [GTK][EFL] Move non-glib/gtk platform implementations out of platform/gtk
3898         https://bugs.webkit.org/show_bug.cgi?id=156847
3899
3900         Reviewed by Carlos Garcia Campos.
3901
3902         The Language and Logging implementation don't really need glib, so
3903         rework them and move them to a new platform/unix directory so that
3904         they can be shared among Unix ports.
3905
3906         * PlatformEfl.cmake: Use the unix version.
3907         * PlatformGTK.cmake: Same.
3908         * platform/efl/LanguageEfl.cpp: Removed.
3909         * platform/efl/LoggingEfl.cpp: Removed.
3910         * platform/unix/LanguageUnix.cpp: Renamed from Source/WebCore/platform/gtk/LanguageGtk.cpp.
3911         (WebCore::platformLanguage):
3912         (WebCore::platformUserPreferredLanguages):
3913         * platform/unix/LoggingUnix.cpp: Renamed from Source/WebCore/platform/gtk/LoggingGtk.cpp.
3914         (WebCore::logLevelString):
3915
3916 2016-04-21  Nan Wang  <n_wang@apple.com>
3917
3918         AX: stringForTextMarkerRange returning empty string for document range
3919         https://bugs.webkit.org/show_bug.cgi?id=156819
3920
3921         Reviewed by Chris Fleizach.
3922
3923         Set text marker data with CharacterOffset when VisiblePosition is having PositionIsAfterAnchor
3924         or PositionIsAfterChildren anchor type, so that the character offset corresponds to the anchored
3925         node.
3926
3927         Test: accessibility/mac/text-marker-string-for-document-range.html
3928
3929         * accessibility/AXObjectCache.cpp:
3930         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
3931
3932 2016-04-20  Chris Dumez  <cdumez@apple.com>
3933
3934         Crash under WebCore::TextIterator::subrange()
3935         https://bugs.webkit.org/show_bug.cgi?id=156809
3936         <rdar://problem/21102730>
3937
3938         Reviewed by Ryosuke Niwa.
3939
3940         TextIterator::rangeFromLocationAndLength() may return null. However, we
3941         failed to do a null check before calling TextIterator::subrange() with
3942         that range.
3943
3944         No new tests, do not know how to reproduce.
3945
3946         * editing/AlternativeTextController.cpp:
3947         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
3948
3949 2016-04-20  Brady Eidson  <beidson@apple.com>
3950
3951         Modern IDB (Workers): Remove IDBRequest/IDBOpenDBRequest's requirement to get an IDBServerConnection around.
3952         https://bugs.webkit.org/show_bug.cgi?id=156826
3953
3954         Reviewed by Alex Christensen.
3955
3956         No new tests (No behavior change, existing tests pass).
3957
3958         This doesn't appear to do much but make things a little more complicated, but it's the first of a few 
3959         small pushes in the right direction.
3960         
3961         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3962         (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest):
3963         (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest):
3964         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
3965         (WebCore::IDBOpenDBRequest::onSuccess):
3966         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
3967         (WebCore::IDBOpenDBRequest::requestCompleted):
3968         (WebCore::IDBOpenDBRequest::createDeleteRequest): Deleted.
3969         (WebCore::IDBOpenDBRequest::createOpenRequest): Deleted.
3970         * Modules/indexeddb/IDBOpenDBRequest.h:
3971         
3972         * Modules/indexeddb/IDBRequest.cpp:
3973         (WebCore::IDBRequest::IDBRequest):
3974         (WebCore::IDBRequest::connectionToServer):
3975         * Modules/indexeddb/IDBRequest.h:
3976         (WebCore::IDBRequest::connection): Deleted.
3977         
3978         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3979         (WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
3980         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer):
3981         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
3982         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
3983         * Modules/indexeddb/client/IDBConnectionProxy.h:
3984         (WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier):
3985         
3986         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3987         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
3988         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
3989
3990 2016-04-20  John Wilander  <wilander@apple.com>
3991
3992         Add Subresource Integrity as "Under consideration".
3993         https://bugs.webkit.org/show_bug.cgi?id=156800
3994
3995         Reviewed by Alexey Proskuryakov.
3996
3997         No new tests needed.
3998
3999         * features.json:
4000             Added an entry for Subresource Integrity.
4001
4002 2016-04-20  Anders Carlsson  <andersca@apple.com>
4003
4004         Get rid of a couple of uses of ApplicationCacheStorage::singleton()
4005         https://bugs.webkit.org/show_bug.cgi?id=156818
4006
4007         Reviewed by Geoffrey Garen.
4008
4009         * loader/appcache/ApplicationCache.cpp:
4010         (WebCore::ApplicationCache::addResource):
4011         * loader/appcache/ApplicationCacheGroup.h:
4012         (WebCore::ApplicationCacheGroup::storage):
4013         * testing/Internals.cpp:
4014         (WebCore::Internals::resetToConsistentState):
4015         (WebCore::Internals::setApplicationCacheOriginQuota):
4016
4017 2016-04-20  Brady Eidson  <beidson@apple.com>
4018
4019         Modern IDB (Workers): Introduce "IDBConnectionProxy" for future threading abstraction, and adopt it in IDBFactory.
4020         https://bugs.webkit.org/show_bug.cgi?id=156810
4021
4022         Reviewed by Alex Christensen.
4023
4024         No new tests (Covered by changes to existing tests).