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