REGRESSION(r156846): Crashes with guard malloc
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-04-25  Antti Koivisto  <antti@apple.com>
2
3         REGRESSION(r156846): Crashes with guard malloc
4         https://bugs.webkit.org/show_bug.cgi?id=156984
5
6         Reviewed by Andreas Kling.
7
8         RenderElement::cachedFirstLineStyle() returns pointer to local std::unique_ptr.
9
10         * rendering/RenderElement.cpp:
11         (WebCore::RenderElement::uncachedFirstLineStyle):
12         (WebCore::RenderElement::cachedFirstLineStyle):
13         (WebCore::RenderElement::firstLineStyle):
14         (WebCore::firstLineStyleForCachedUncachedType): Deleted.
15
16             Don't try to use a single function for the cached and uncached cases. Separate the cases into the calling functions.
17
18 2016-04-25  Daniel Bates  <dabates@apple.com>
19
20         REGRESSION (r196012): Subresource may be blocked by Content Security Policy if it only matches 'self'
21         https://bugs.webkit.org/show_bug.cgi?id=156935
22         <rdar://problem/25351286>
23
24         Reviewed by Darin Adler.
25
26         Fixes an issue where subresource load may be blocked by the Content Security Policy (CSP) if its URL only
27         matched 'self'. In particular, the load would be blocked if initiated from a document that inherited the
28         origin of its owner document (e.g. the document contained in <iframe src="about:blank"></iframe>).
29
30         Following r196012 we compute and cache 'self' and its protocol on instantiation of a ContentSecurityPolicy
31         object for use when matching a URL against it. These cached values become out-of-date if the document
32         subsequently inherits the origin of its owner document. Therefore matches against 'self' will fail and
33         CSP will block a load if its not otherwise allowed by the policy. Previously we would compute 'self' when
34         parsing the definition of a source list and compute the protocol for 'self' each time we tried to match a
35         URL against 'self'. So, 'self' would always be up-to-date with respect to the origin of the document.
36
37         Tests: http/tests/security/contentSecurityPolicy/iframe-blank-url-programmatically-add-external-script.html
38                http/tests/security/contentSecurityPolicy/iframe-srcdoc-external-script.html
39
40         * page/csp/ContentSecurityPolicy.cpp:
41         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Extract out logic for computing and caching
42         'self' and its protocol into ContentSecurityPolicy::updateSourceSelf() and make use of this function.
43         (WebCore::ContentSecurityPolicy::updateSourceSelf): Computes and caches 'self' and its protocol with
44         respect to the specified SecurityOrigin.
45         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): Call ContentSecurityPolicy::updateSourceSelf()
46         to ensure that we have an up-to-date representation for 'self' and the protocol of 'self' which can
47         become out-of-date if the document inherited the origin of its owner document.
48         * page/csp/ContentSecurityPolicy.h:
49
50 2016-04-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
51
52         Drop [UsePointersEvenForNonNullableObjectArguments] from TextTrack
53         https://bugs.webkit.org/show_bug.cgi?id=156899
54
55         Reviewed by Chris Dumez.
56
57         No behavior changes.
58
59         * html/track/TextTrack.idl: Marking cue and region parameter as nullable.
60         Also marking cues and activeCues as nullable attributes.
61
62 2016-04-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
63
64         Drop [UsePointersEvenForNonNullableObjectArguments] from File API interfaces
65         https://bugs.webkit.org/show_bug.cgi?id=156898
66
67         Reviewed by Chris Dumez.
68
69         Making FileReaderSync API API throwing a TypeError in case of null parameters, in lieu of a NOT_FOUND_ERR.
70         Making FileReader API taking nullable parameters as a temporary fix.
71
72         Test: fast/files/workers/worker-file-reader-sync-bad-parameter.html
73
74         * Modules/websockets/WebSocketChannel.cpp:
75         (WebCore::WebSocketChannel::processOutgoingFrameQueue): Updated to cope with FileReaderLoader::start taking a Blob&.
76         * fileapi/FileReader.cpp:
77         (WebCore::FileReader::readAsArrayBuffer): Updated to cope with readInternal taking a Blob&.
78         (WebCore::FileReader::readAsBinaryString): Ditto.
79         (WebCore::FileReader::readAsText): Ditto.
80         (WebCore::FileReader::readAsDataURL): Ditto.
81         (WebCore::FileReader::readInternal):  Updated to cope with FileReaderLoader::start taking a Blob&.
82         * fileapi/FileReader.h:
83         * fileapi/FileReader.idl: Marking the readXX methods as taking a nullable blob parameter to keep compatibility, at least temporarily.
84         * fileapi/FileReaderLoader.cpp:
85         (WebCore::FileReaderLoader::start): It now takes a Blob& as input.
86         * fileapi/FileReaderLoader.h:
87         * fileapi/FileReaderSync.cpp:
88         (WebCore::FileReaderSync::readAsArrayBuffer): Taking a Blob& as input.
89         (WebCore::FileReaderSync::readAsBinaryString): Ditto.
90         (WebCore::FileReaderSync::readAsText): Ditto.
91         (WebCore::FileReaderSync::readAsDataURL): Ditto.
92         (WebCore::FileReaderSync::startLoading) Ditto.
93         * fileapi/FileReaderSync.h:
94         (WebCore::FileReaderSync::readAsText): Ditto.
95         * fileapi/FileReaderSync.idl:
96
97 2016-04-25  Manuel Rego Casasnovas  <rego@igalia.com>
98
99         [css-grid] Fix grid-template-columns|rows computed style with content alignment
100         https://bugs.webkit.org/show_bug.cgi?id=156793
101
102         Reviewed by Darin Adler.
103
104         Computed style of grid-template-columns and grid-template-rows properties
105         was including the distribution offset because of content alignment.
106         We should subtract that offset, like we do for the case of gaps,
107         when we're calculating the computed style.
108
109         Test: fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html
110
111         * css/CSSComputedStyleDeclaration.cpp:
112         (WebCore::valueForGridTrackList):
113         * rendering/RenderGrid.cpp:
114         (WebCore::RenderGrid::offsetBetweenTracks):
115         (WebCore::RenderGrid::populateGridPositions): Deleted FIXME.
116         * rendering/RenderGrid.h:
117
118 2016-04-25  Frederic Wang  <fwang@igalia.com>
119
120         Refactor RenderMathMLMenclose.
121         https://bugs.webkit.org/show_bug.cgi?id=155019
122
123         Reviewed by Sergio Villar Senin.
124
125         Tests: mathml/presentation/menclose-notation-equivalence.html
126                mathml/presentation/menclose-notation-values.html
127
128         We rewrite RenderMathMLMenclose so that layout functions correctly override the
129         behavior of RenderMathMLRow. We try and rely on the draft  of the MathML in HTML5
130         implementation note, to make easier to get consistency with other rendering engines
131         in the future. All notations are now drawn with GraphicContext functions instead of
132         mixing them with CSS style. To save memory space, the list of known notations are
133         now saved on a short integer using bit masks instead of a vector of string names.
134         Finally, we remove support for the radical notation so that we no longer need to
135         create an anonymous RenderMathMLRoot.
136
137         * mathml/MathMLMencloseElement.cpp: Remove code for some special notations and just
138         reimplement parsing of the notation attribute.
139         (WebCore::MathMLMencloseElement::MathMLMencloseElement): By default, the notation is longdiv.
140         (WebCore::MathMLMencloseElement::parseAttribute): By default, the list of notation is empty.
141         If there is no notation attribute, the default value longdiv is used.
142         Otherwise, we parse the notation attribute and add each notation, using some equivalences
143         for box, actuarial and madruwb.
144         (WebCore::MathMLMencloseElement::isPresentationAttribute): Deleted. No need to define
145         specific style for some notation.
146         (WebCore::MathMLMencloseElement::finishParsingChildren): Deleted. No need to add an
147         anonymous square root.
148         (WebCore::MathMLMencloseElement::collectStyleForPresentationAttribute): Deleted. No need to
149         define specific style for some notation.
150         (WebCore::MathMLMencloseElement::longDivLeftPadding): Deleted. RenderMathMLMenclose uses an
151         arbitrary size instead of measure a glyph.
152         * mathml/MathMLMencloseElement.h: Define simple bit mask for each notation, add a short
153         integer to store the list of notations together with helper functions. Remove old code.
154         * rendering/mathml/RenderMathMLMenclose.cpp: Rewrite RenderMathMLMenclose so that layout
155         functions correctly override the behavior of RenderMathMLRow.
156         (WebCore::RenderMathMLMenclose::RenderMathMLMenclose): Init m_ascent to 0.
157         (WebCore::RenderMathMLMenclose::ruleThickness): For now, we use the fallback value used by
158         for other bars. We may refine that in the future.
159         (WebCore::RenderMathMLMenclose::getSpaceAroundContent): Helper function to retrieve the
160         space to add around the content, depending on the notations specified. Note that for
161         notation circle, this spacing depends on the content size.
162         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths): Reimplement this function.
163         This is just adding left/right spacing around the content.
164         (WebCore::RenderMathMLMenclose::layoutBlock): Reimplement this function. We do the normal
165         RenderMathMLRow layout, adjust spacing and child position and
166         calculate m_ascent and m_contentRect.
167         (WebCore::RenderMathMLMenclose::firstLineBaseline): Implement this function.
168         We just return m_ascent.
169         (WebCore::drawLine): Helper function to draw a line using strokePath.
170         (WebCore::RenderMathMLMenclose::paint): We reimplement this function to draw
171         all notations using GraphicContext.
172         (WebCore::RenderMathMLMenclose::addChild): Deleted. No need to manage anonymous renderers.
173         (WebCore::RenderMathMLMenclose::updateLogicalHeight): Deleted. Height is now calculated
174         in layoutBlock.
175         (WebCore::RenderMathMLMenclose::checkNotationalValuesValidity): Deleted.
176         * rendering/mathml/RenderMathMLMenclose.h: Update member definitions.
177         * rendering/mathml/RenderMathMLRoot.cpp: We no longer need anonymous roots.
178         (WebCore::RenderMathMLRoot::RenderMathMLRoot): Deleted.
179         * rendering/mathml/RenderMathMLRoot.h: We no longer need anonymous roots.
180         * rendering/mathml/RenderMathMLRow.cpp: Allow to get the exact metrics of the chid row,
181         for use in RenderMathMLRoot.
182         (WebCore::RenderMathMLRow::computeLineVerticalStretch): rename parameters.
183         (WebCore::RenderMathMLRow::layoutRowItems): Set parameters to the final ascent, descent and
184         logical width of the chid row. Set the temporary logical width for RenderMathMenclose before
185         laying the children out.
186         (WebCore::RenderMathMLRow::layoutBlock): Rename parameters ; add a dummy logicalWidth
187         parameter.
188         * rendering/mathml/RenderMathMLRow.h: Make some functions accessible or overridable by
189         RenderMathMLRoot. Make layoutRowItems return the final ascent, descent and logical width
190         after the chid row is laid out.
191         * rendering/mathml/RenderMathMLSquareRoot.cpp: We no longer need anonymous roots.
192         (WebCore::RenderMathMLSquareRoot::RenderMathMLSquareRoot): Deleted.
193         (WebCore::RenderMathMLSquareRoot::createAnonymousWithParentRenderer): Deleted.
194         * rendering/mathml/RenderMathMLSquareRoot.h: We no longer need anonymous roots.
195
196 2016-04-25  Frederic Wang  <fwang@igalia.com>
197
198         Minor refactoring in RenderMathMLOperator
199         https://bugs.webkit.org/show_bug.cgi?id=156906
200
201         Reviewed by Martin Robinson.
202
203         No new tests, this is only minor refactoring that does not change the behavior.
204
205         * rendering/mathml/RenderMathMLOperator.cpp:
206         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack):
207         We rename the "state" integer to an "expected" enum indicating the next expected part.
208         (WebCore::RenderMathMLOperator::paintGlyph): We add a missing dot at the end of a sequence.
209         We also replace ceil(x+1) with ceil(x)+1 to get rid of the temporary variable.
210
211 2016-04-24  Chris Dumez  <cdumez@apple.com>
212
213         [Web IDL] Specify default values for boolean parameters
214         https://bugs.webkit.org/show_bug.cgi?id=156964
215
216         Reviewed by Darin Adler.
217
218         Specify default values for boolean parameters in our IDL files and
219         let the bindings generator use WTF::Optional<> for the ones without
220         a default value.
221
222         * CMakeLists.txt:
223         * Modules/indexeddb/IDBKeyRange.cpp:
224         * Modules/indexeddb/IDBKeyRange.h:
225         * Modules/indexeddb/IDBKeyRange.idl:
226         * WebCore.xcodeproj/project.pbxproj:
227         * bindings/js/JSBindingsAllInOne.cpp:
228
229         * bindings/js/JSDOMTokenListCustom.cpp: Removed.
230         We no longer need these custom bindings as the bindings generator
231         will now provide the implementation with an Optional<bool>, given
232         that the parameter has no default value.
233
234         * bindings/scripts/CodeGeneratorJS.pm:
235         (CanUseWTFOptionalForParameterType): Deleted.
236         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
237         (webkit_dom_test_obj_method_with_optional_boolean):
238         (webkit_dom_test_obj_method_with_optional_boolean_is_false):
239         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
240         * bindings/scripts/test/JS/JSTestObj.cpp:
241         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
242         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
243         * bindings/scripts/test/ObjC/DOMTestObj.h:
244         * bindings/scripts/test/ObjC/DOMTestObj.mm:
245         (-[DOMTestObj methodWithOptionalBoolean:]):
246         (-[DOMTestObj methodWithOptionalBooleanIsFalse:]):
247         * bindings/scripts/test/TestObj.idl:
248         * dom/Document.h:
249         * dom/Document.idl:
250         * dom/Element.idl:
251         * dom/EventTarget.idl:
252         * html/DOMTokenList.idl:
253
254 2016-04-24  Chris Dumez  <cdumez@apple.com>
255
256         Autogenerated IDBFactory.open() does the wrong thing if you pass an explicit 'undefined' as the second argument
257         https://bugs.webkit.org/show_bug.cgi?id=156939
258
259         Reviewed by Darin Adler.
260
261         As per WebIDL, if undefined is passed by JS for an optional parameter then
262         we should use its default value if it has one, or use the special value
263         "missing":
264         http://heycam.github.io/webidl/#es-overloads (step 10.4)
265
266         Our bindings generator was already mapping undefined to the parameter's
267         default value when present. However, it was missing the notion of
268         "missing" value when there no default value. This patch adds supports
269         for its by passing Optional<>(Nullopt) to the implementation in such
270         case. This means that the implementation will need to use WTF::Optional<>
271         type for parameters that do not have a default value. Thankfully though,
272         in most cases, we will be able to specify a default value in the IDL
273         so cases where we will need to use WTF::Optional<> will actually be
274         rare.
275
276         To avoid having to do too much refactoring in this patch, the support
277         for WTF::Optional is currently blacklisted for most IDL types. I will
278         gradually stop blacklisting each type in follow-up patches, as I either:
279         - Add default parameter values in our IDL (preferred)
280         - Use WTF::Optional<> in our implementation (when we cannot specify a
281           default value).
282
283         This patch fixes a bug with IDBFactory.open()'s second parameter (version)
284         for which undefined should not throw and indicate that the version
285         should not be changed. We now use WTF::Optional in the implementation to
286         distinguish this case and not throw.
287
288         No new tests, existing tests were updated / rebaselined.
289
290         * Modules/indexeddb/IDBFactory.cpp:
291         (WebCore::IDBFactory::open):
292         (WebCore::IDBFactory::openInternal): Deleted.
293         * Modules/indexeddb/IDBFactory.h:
294         * bindings/scripts/CodeGeneratorJS.pm:
295         (ShouldUseWTFOptionalForParameterType):
296         (GenerateParametersCheck):
297         * fileapi/Blob.idl:
298         * inspector/InspectorIndexedDBAgent.cpp:
299
300 2016-04-23  Chris Dumez  <cdumez@apple.com>
301
302         [WebIDL] Drop [Default] WebKit-IDL extended attribute
303         https://bugs.webkit.org/show_bug.cgi?id=156955
304
305         Reviewed by Darin Adler.
306
307         Drop [Default] WebKit-IDL extended attribute in favor of the standard
308         WebIDL syntax for parameters' default value.
309
310         Here is what it looks like:
311         [Default=NullString] optional DOMString a -> optional DOMString a = null
312         [Default=NullString] optional DOMString? a -> optional DOMString? a = null
313         [Default=Undefined] optional DOMString a -> optional DOMString a = "undefined"
314         [Default=Undefined] optional DOMString? a -> optional DOMString? a = null
315         [Default=Undefined] optional long a -> optional long a = 0
316         [Default=Undefined] optional bool a -> optional bool a = false
317         [Default=Undefined] optional unrestricted double a -> optional unrestricted double a = NaN
318         [Default=Undefined] optional unrestricted float a -> optional unrestricted float a = NaN
319         [Default=Undefined] optional sequence<DOMString> a -> optional sequence<DOMString> a = []
320
321         These do not cause any Web-Exposed behavior change. However, when getting
322         rid of [Default] started passing more parameters by derefence instead of
323         pointer (as is expected for parameters not marked as nullable). As a result,
324         I had to mark a few parameters as nullable in the IDL to maintain the
325         previous behavior. In some cases, the implementation was already throwing
326         when passing null. In such cases, I have not marked the type as nullable
327         so that the generated bindings now throw the exception instead of our
328         implementation code. In some cases, the exception being thrown is now
329         different. This is why some of the layout tests had to be rebaselined.
330
331         No new tests, existing tests have been rebaselined. No significant Web
332         exposed behavior change is expected from this patch, beside exceptions
333         type sometimes being different.
334
335         * Modules/encryptedmedia/MediaKeys.idl:
336         * Modules/fetch/FetchRequest.idl:
337         * Modules/gamepad/deprecated/GamepadList.idl:
338         * Modules/indexeddb/IDBDatabase.idl:
339         * Modules/mediastream/RTCStatsResponse.idl:
340         * Modules/notifications/Notification.idl:
341         * Modules/speech/SpeechSynthesisUtterance.idl:
342         * Modules/webaudio/AudioNode.idl:
343         * Modules/websockets/WebSocket.idl:
344         * bindings/scripts/CodeGeneratorJS.pm:
345         (GenerateParametersCheck):
346         * bindings/scripts/IDLAttributes.txt:
347         * bindings/scripts/IDLParser.pm:
348         (parseDefault):
349         (parseDefaultValue):
350         * bindings/scripts/test/TestInterface.idl:
351         * bindings/scripts/test/TestNamedConstructor.idl:
352         * bindings/scripts/test/TestObj.idl:
353         * bindings/scripts/test/TestOverrideBuiltins.idl:
354         * css/CSSKeyframesRule.idl:
355         * css/CSSMediaRule.idl:
356         * css/CSSPrimitiveValue.idl:
357         * css/CSSRuleList.idl:
358         * css/CSSStyleDeclaration.idl:
359         * css/CSSStyleSheet.idl:
360         * css/CSSSupportsRule.idl:
361         * css/CSSValueList.idl:
362         * css/MediaList.idl:
363         * css/MediaQueryList.idl:
364         * css/MediaQueryListListener.idl:
365         * css/StyleMedia.idl:
366         * css/StyleSheetList.idl:
367         * css/WebKitCSSFilterValue.idl:
368         * css/WebKitCSSMatrix.idl:
369         * css/WebKitCSSTransformValue.idl:
370         * dom/ClientRectList.idl:
371         * dom/Comment.idl:
372         * dom/CompositionEvent.idl:
373         * dom/CustomEvent.h:
374         * dom/CustomEvent.idl:
375         * dom/DOMImplementation.idl:
376         * dom/DOMStringList.idl:
377         * dom/DataTransferItem.idl:
378         * dom/DataTransferItemList.idl:
379         * dom/DeviceMotionEvent.idl:
380         * dom/DeviceOrientationEvent.idl:
381         * dom/Document.cpp:
382         (WebCore::Document::adoptNode):
383         * dom/Document.idl:
384         * dom/Element.cpp:
385         (WebCore::Element::setAttributeNode):
386         (WebCore::Element::setAttributeNodeNS):
387         (WebCore::Element::removeAttributeNode):
388         (WebCore::Element::parseAttributeName): Deleted.
389         * dom/Element.h:
390         * dom/Element.idl:
391         * dom/Event.idl:
392         * dom/HashChangeEvent.idl:
393         * dom/KeyboardEvent.idl:
394         * dom/MessageEvent.idl:
395         * dom/MouseEvent.idl:
396         * dom/MutationEvent.idl:
397         * dom/NamedNodeMap.cpp:
398         (WebCore::NamedNodeMap::setNamedItem):
399         (WebCore::NamedNodeMap::setNamedItemNS):
400         (WebCore::NamedNodeMap::item): Deleted.
401         * dom/NamedNodeMap.h:
402         * dom/NamedNodeMap.idl:
403         * dom/Node.idl:
404         * dom/NodeFilter.idl:
405         * dom/NonElementParentNode.idl:
406         * dom/OverflowEvent.idl:
407         * dom/Range.idl:
408         * dom/Text.idl:
409         * dom/TextEvent.idl:
410         * dom/TouchEvent.idl:
411         * dom/UIEvent.idl:
412         * dom/WheelEvent.idl:
413         * html/DOMFormData.idl:
414         * html/HTMLAllCollection.idl:
415         * html/HTMLAudioElement.idl:
416         * html/HTMLCanvasElement.idl:
417         * html/HTMLCollection.idl:
418         * html/HTMLDocument.idl:
419         * html/HTMLElement.cpp:
420         (WebCore::HTMLElement::insertAdjacentElement):
421         (WebCore::contextElementForInsertion): Deleted.
422         * html/HTMLElement.h:
423         * html/HTMLElement.idl:
424         * html/HTMLFormControlsCollection.idl:
425         * html/HTMLInputElement.idl:
426         * html/HTMLMediaElement.idl:
427         * html/HTMLOptionElement.idl:
428         * html/HTMLOptionsCollection.idl:
429         * html/HTMLSelectElement.idl:
430         * html/HTMLTableElement.idl:
431         * html/HTMLTableRowElement.idl:
432         * html/HTMLTableSectionElement.idl:
433         * html/HTMLTextAreaElement.idl:
434         * html/ImageData.idl:
435         * html/canvas/CanvasGradient.idl:
436         * html/canvas/CanvasRenderingContext2D.idl:
437         * html/canvas/DOMPath.idl:
438         * html/canvas/OESVertexArrayObject.idl:
439         * page/DOMSelection.cpp:
440         (WebCore::DOMSelection::extend):
441         (WebCore::DOMSelection::getRangeAt): Deleted.
442         * page/DOMSelection.h:
443         * page/DOMSelection.idl:
444         * page/DOMWindow.idl:
445         * page/History.idl:
446         * page/Performance.idl:
447         * page/WindowTimers.idl:
448         * plugins/DOMMimeTypeArray.idl:
449         * plugins/DOMPlugin.idl:
450         * plugins/DOMPluginArray.idl:
451         * storage/StorageEvent.idl:
452         * svg/SVGAnimationElement.idl:
453         * svg/SVGDocument.idl:
454         * svg/SVGElement.idl:
455         * svg/SVGFEDropShadowElement.idl:
456         * svg/SVGFEGaussianBlurElement.idl:
457         * svg/SVGFEMorphologyElement.idl:
458         * svg/SVGFilterElement.idl:
459         * svg/SVGGraphicsElement.idl:
460         * svg/SVGMarkerElement.idl:
461         * svg/SVGPathElement.idl:
462         * svg/SVGSVGElement.idl:
463         * svg/SVGTests.idl:
464         * svg/SVGTextContentElement.idl:
465         * xml/DOMParser.idl:
466         * xml/XMLSerializer.cpp:
467         (WebCore::XMLSerializer::serializeToString):
468         * xml/XMLSerializer.h:
469         * xml/XMLSerializer.idl:
470         * xml/XPathEvaluator.idl:
471         * xml/XPathExpression.idl:
472         * xml/XPathNSResolver.idl:
473         * xml/XPathResult.idl:
474         * xml/XSLTProcessor.idl:
475
476 2016-04-24  Antti Koivisto  <antti@apple.com>
477
478         RenderStyle should not be reference counted
479         https://bugs.webkit.org/show_bug.cgi?id=156846
480
481         Reviewed by Andreas Kling.
482
483         RenderStyle reference counts its substructures. We no longer share RenderStyle objects between normal renderers
484         so there is no reason to refcount the RenderStyles themselves too. Making it a non-refcounted type clarifies
485         ownership relations, reduces branchiness and saves some memory.
486
487         This patches switches mostly mechanically from Ref/RefPtr<RenderStyle> to std::unique_ptr<RenderStyle>. In
488         the future RenderStyle can be given regular value semantics.
489
490         * Modules/plugins/PluginReplacement.h:
491         (WebCore::PluginReplacement::scriptObject):
492         (WebCore::PluginReplacement::willCreateRenderer):
493         * Modules/plugins/QuickTimePluginReplacement.h:
494         * Modules/plugins/QuickTimePluginReplacement.mm:
495         (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement):
496         (WebCore::QuickTimePluginReplacement::createElementRenderer):
497         * Modules/plugins/YouTubePluginReplacement.cpp:
498         (WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
499         (WebCore::YouTubePluginReplacement::createElementRenderer):
500         * Modules/plugins/YouTubePluginReplacement.h:
501         * css/CSSComputedStyleDeclaration.cpp:
502         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
503         (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
504         (WebCore::updateStyleIfNeededForNode):
505         (WebCore::computeRenderStyleForProperty):
506         (WebCore::ComputedStyleExtractor::customPropertyValue):
507         (WebCore::ComputedStyleExtractor::propertyValue):
508         * css/MediaQueryEvaluator.cpp:
509         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
510         (WebCore::MediaQueryEvaluator::eval):
511         * css/MediaQueryEvaluator.h:
512
513             Clarify in code that MediaQueryEvaluator does not own the style.
514
515         * css/MediaQueryMatcher.cpp:
516         (WebCore::MediaQueryMatcher::mediaType):
517         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
518         (WebCore::MediaQueryMatcher::evaluate):
519         (WebCore::MediaQueryMatcher::matchMedia):
520         (WebCore::MediaQueryMatcher::styleResolverChanged):
521         (WebCore::MediaQueryMatcher::prepareEvaluator): Deleted.
522         * css/MediaQueryMatcher.h:
523         * css/StyleMedia.cpp:
524         (WebCore::StyleMedia::matchMedium):
525         * css/StyleResolver.cpp:
526         (WebCore::StyleResolver::State::clear):
527         (WebCore::StyleResolver::State::updateConversionData):
528         (WebCore::StyleResolver::State::setStyle):
529         (WebCore::StyleResolver::State::setParentStyle):
530
531             State owns the style explicitly set by setParentStyle but not the one given via constructor.
532
533         (WebCore::isAtShadowBoundary):
534         (WebCore::StyleResolver::styleForElement):
535         (WebCore::StyleResolver::styleForKeyframe):
536         (WebCore::StyleResolver::keyframeStylesForAnimation):
537         (WebCore::StyleResolver::pseudoStyleForElement):
538         (WebCore::StyleResolver::styleForPage):
539         (WebCore::StyleResolver::defaultStyleForElement):
540         (WebCore::StyleResolver::applyMatchedProperties):
541         (WebCore::StyleResolver::applyPropertyToStyle):
542         * css/StyleResolver.h:
543         (WebCore::ElementStyle::ElementStyle):
544         (WebCore::StyleResolver::style):
545         (WebCore::StyleResolver::parentStyle):
546         (WebCore::StyleResolver::setOverrideDocumentElementStyle):
547         (WebCore::StyleResolver::State::document):
548         (WebCore::StyleResolver::State::element):
549         (WebCore::StyleResolver::State::style):
550         (WebCore::StyleResolver::State::takeStyle):
551         (WebCore::StyleResolver::State::parentStyle):
552         (WebCore::StyleResolver::State::rootElementStyle):
553         (WebCore::StyleResolver::State::regionForStyling):
554         (WebCore::StyleResolver::State::setParentStyle): Deleted.
555         * dom/Document.cpp:
556         (WebCore::Document::recalcStyle):
557         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
558         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
559         (WebCore::Document::isPageBoxVisible):
560         (WebCore::Document::pageSizeAndMarginsInPixels):
561         (WebCore::Document::addAutoSizingNode):
562         (WebCore::Document::validateAutoSizingNodes):
563         (WebCore::Document::resetAutoSizingNodes):
564         (WebCore::Document::setFullScreenRenderer):
565         * dom/Document.h:
566         * dom/Element.cpp:
567         (WebCore::Element::rendererIsNeeded):
568         (WebCore::Element::createElementRenderer):
569         (WebCore::Element::resolveComputedStyle):
570         * dom/Element.h:
571         (WebCore::Element::copyNonAttributePropertiesFromElement):
572         * dom/ElementRareData.h:
573
574         ...
575
576         * page/animation/AnimationBase.h:
577         * page/animation/AnimationController.cpp:
578         (WebCore::AnimationControllerPrivate::receivedStartTimeResponse):
579         (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
580         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
581         (WebCore::AnimationController::cancelAnimations):
582         (WebCore::AnimationController::updateAnimations):
583
584             std::unique_ptr<RenderStyle& animatedStyle argument is now expected no be initially null and
585             is only set if a new style is created.
586
587         (WebCore::AnimationController::getAnimatedStyleForRenderer):
588         * page/animation/AnimationController.h:
589         * page/animation/AnimationControllerPrivate.h:
590         * page/animation/CompositeAnimation.cpp:
591         (WebCore::CompositeAnimation::updateTransitions):
592         (WebCore::CompositeAnimation::updateKeyframeAnimations):
593         (WebCore::CompositeAnimation::animate):
594         (WebCore::CompositeAnimation::getAnimatedStyle):
595         * page/animation/CompositeAnimation.h:
596         * page/animation/ImplicitAnimation.cpp:
597         (WebCore::ImplicitAnimation::ImplicitAnimation):
598         (WebCore::ImplicitAnimation::shouldSendEventForListener):
599         (WebCore::ImplicitAnimation::animate):
600         (WebCore::ImplicitAnimation::getAnimatedStyle):
601         (WebCore::ImplicitAnimation::onAnimationEnd):
602         (WebCore::ImplicitAnimation::reset):
603         * page/animation/ImplicitAnimation.h:
604         * page/animation/KeyframeAnimation.cpp:
605         (WebCore::KeyframeAnimation::KeyframeAnimation):
606         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
607         (WebCore::KeyframeAnimation::animate):
608         (WebCore::KeyframeAnimation::getAnimatedStyle):
609         * page/animation/KeyframeAnimation.h:
610         * rendering/RenderAttachment.cpp:
611         (WebCore::RenderAttachment::RenderAttachment):
612         * rendering/RenderAttachment.h:
613         * rendering/RenderBlock.cpp:
614         (WebCore::RenderBlock::RenderBlock):
615         (WebCore::RenderBlock::styleDidChange):
616         (WebCore::RenderBlock::clone):
617         (WebCore::RenderBlock::updateFirstLetterStyle):
618         (WebCore::RenderBlock::createFirstLetterRenderer):
619         * rendering/RenderBlock.h:
620         * rendering/RenderBlockFlow.cpp:
621         (WebCore::RenderBlockFlow::MarginInfo::MarginInfo):
622         (WebCore::RenderBlockFlow::RenderBlockFlow):
623         * rendering/RenderBlockFlow.h:
624         * rendering/RenderBox.cpp:
625         (WebCore::skipBodyBackground):
626         (WebCore::RenderBox::RenderBox):
627         * rendering/RenderBox.h:
628         * rendering/RenderBoxModelObject.cpp:
629         (WebCore::RenderBoxModelObject::suspendAnimations):
630         (WebCore::RenderBoxModelObject::RenderBoxModelObject):
631         * rendering/RenderBoxModelObject.h:
632         * rendering/RenderButton.cpp:
633         (WebCore::RenderButton::RenderButton):
634         (WebCore::RenderButton::setupInnerStyle):
635         * rendering/RenderButton.h:
636         * rendering/RenderCombineText.h:
637         * rendering/RenderDeprecatedFlexibleBox.cpp:
638         (WebCore::RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox):
639         * rendering/RenderDeprecatedFlexibleBox.h:
640         * rendering/RenderDetailsMarker.cpp:
641         (WebCore::RenderDetailsMarker::RenderDetailsMarker):
642         * rendering/RenderDetailsMarker.h:
643         * rendering/RenderElement.cpp:
644         (WebCore::controlStatesRendererMap):
645         (WebCore::RenderElement::RenderElement):
646         (WebCore::RenderElement::~RenderElement):
647         (WebCore::RenderElement::createFor):
648         (WebCore::firstLineStyleForCachedUncachedType):
649         (WebCore::RenderElement::uncachedFirstLineStyle):
650         (WebCore::RenderElement::cachedFirstLineStyle):
651         (WebCore::RenderElement::initializeStyle):
652         (WebCore::RenderElement::setStyle):
653         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
654         (WebCore::RenderElement::styleDidChange):
655         (WebCore::RenderElement::getCachedPseudoStyle):
656
657             Return plain pointer as the cache owns the style.
658
659         (WebCore::RenderElement::getUncachedPseudoStyle):
660
661             return std::unique_ptr<RenderStyle>
662
663         (WebCore::RenderElement::selectionColor):
664         (WebCore::RenderElement::selectionPseudoStyle):
665         (WebCore::RenderElement::selectionBackgroundColor):
666         * rendering/RenderElement.h:
667         (WebCore::RenderElement::hasInitializedStyle):
668         (WebCore::RenderElement::style):
669         (WebCore::RenderElement::element):
670         (WebCore::RenderElement::setStyleInternal):
671         * rendering/RenderEmbeddedObject.cpp:
672
673         ...
674
675         (WebCore::RenderImage::imageResource):
676         * rendering/RenderInline.cpp:
677         (WebCore::RenderInline::RenderInline):
678         (WebCore::updateStyleOfAnonymousBlockContinuations):
679         (WebCore::RenderInline::styleDidChange):
680
681             Continuations now get their own RenderStyles.
682
683         (WebCore::RenderInline::addChildIgnoringContinuation):
684         (WebCore::RenderInline::clone):
685         * rendering/RenderInline.h:
686         * rendering/RenderLayer.cpp:
687         (WebCore::RenderLayer::currentTransform):
688         (WebCore::RenderLayer::calculateClipRects):
689         * rendering/RenderLayer.h:
690
691         ...
692
693         * rendering/style/KeyframeList.cpp:
694         (WebCore::KeyframeList::operator==):
695         (WebCore::KeyframeList::insert):
696
697             KeyframeValue is now movable but not copyable type. Adjust accordingly.
698
699         * rendering/style/KeyframeList.h:
700         (WebCore::KeyframeValue::KeyframeValue):
701         (WebCore::KeyframeValue::setKey):
702         (WebCore::KeyframeValue::style):
703         (WebCore::KeyframeValue::setStyle):
704         (WebCore::KeyframeList::animationName):
705         (WebCore::KeyframeList::addProperty):
706         (WebCore::KeyframeList::containsProperty):
707         * rendering/style/RenderStyle.cpp:
708         (WebCore::defaultStyle):
709         (WebCore::RenderStyle::create):
710         (WebCore::RenderStyle::createDefaultStyle):
711         (WebCore::RenderStyle::createAnonymousStyleWithDisplay):
712         (WebCore::RenderStyle::clone):
713         (WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
714
715             Return std::unique_ptr<RenderStyle> instead of Ref<RenderStyle>.
716
717         (WebCore::RenderStyle::RenderStyle):
718         (WebCore::RenderStyle::~RenderStyle):
719         (WebCore::resolveAlignmentData):
720         (WebCore::RenderStyle::operator==):
721         (WebCore::RenderStyle::hasUniquePseudoStyle):
722         (WebCore::RenderStyle::getCachedPseudoStyle):
723         (WebCore::RenderStyle::addCachedPseudoStyle):
724         (WebCore::RenderStyle::isStyleAvailable): Deleted.
725         * rendering/style/RenderStyle.h:
726         (WebCore::RenderStyle::setStyleType):
727         (WebCore::RenderStyle::cachedPseudoStyles):
728         (WebCore::RenderStyle::initialIsolation):
729         (WebCore::RenderStyle::isPlaceholderStyle):
730         (WebCore::RenderStyle::setIsPlaceholderStyle):
731
732             Add placeholder style bit to rareNonInheritedData. We no longer rely on RenderStyle identity for this test.
733
734         (WebCore::RenderStyle::noninheritedFlagsMemoryOffset):
735         * rendering/style/SVGRenderStyle.cpp:
736         (WebCore::defaultSVGStyle):
737         (WebCore::SVGRenderStyle::createDefaultStyle):
738         * rendering/style/StyleRareNonInheritedData.cpp:
739         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
740         (WebCore::StyleRareNonInheritedData::operator==):
741         (WebCore::StyleRareNonInheritedData::contentDataEquivalent):
742         * rendering/style/StyleRareNonInheritedData.h:
743
744         ...
745
746         (WebCore::findRenderingRoot):
747         (WebCore::findRenderingRoots):
748         (WebCore::RenderTreeUpdater::commit):
749
750             Style::Update is no longer const as we move the styles from it to the render tree.
751
752         (WebCore::pseudoStyleCacheIsInvalid):
753         (WebCore::RenderTreeUpdater::updateElementRenderer):
754         (WebCore::moveToFlowThreadIfNeeded):
755         (WebCore::RenderTreeUpdater::createRenderer):
756         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
757         * style/RenderTreeUpdater.h:
758         * style/StyleResolveForDocument.cpp:
759         (WebCore::Style::resolveForDocument):
760         * style/StyleResolveForDocument.h:
761         * style/StyleSharingResolver.cpp:
762         (WebCore::Style::elementHasDirectionAuto):
763         (WebCore::Style::SharingResolver::resolve):
764         * style/StyleSharingResolver.h:
765         * style/StyleTreeResolver.cpp:
766         (WebCore::Style::ensurePlaceholderStyle):
767
768             Set the placeholder.
769
770         (WebCore::Style::TreeResolver::Parent::Parent):
771         (WebCore::Style::TreeResolver::pushScope):
772         (WebCore::Style::TreeResolver::pushEnclosingScope):
773         (WebCore::Style::TreeResolver::popScope):
774
775             Set and clear StyleResolver overrideDocumentElementStyle as needed. It is owned by the TreeResolver.
776
777         (WebCore::Style::TreeResolver::styleForElement):
778
779             Clone the placeholder style.
780
781         (WebCore::Style::TreeResolver::resolveElement):
782         (WebCore::Style::TreeResolver::pushParent):
783         (WebCore::Style::TreeResolver::resolveComposedTree):
784         (WebCore::Style::TreeResolver::resolve):
785
786             Adopt to the std::unique_ptr and ElementStyle move semantics.
787
788         * style/StyleTreeResolver.h:
789         (WebCore::Style::TreeResolver::scope):
790         * style/StyleUpdate.cpp:
791         (WebCore::Style::Update::elementUpdate):
792         (WebCore::Style::Update::textUpdate):
793         (WebCore::Style::Update::elementStyle):
794         (WebCore::Style::Update::addElement):
795         (WebCore::Style::Update::addText):
796         * style/StyleUpdate.h:
797         (WebCore::Style::Update::roots):
798         (WebCore::Style::Update::document):
799         * svg/SVGAElement.cpp:
800         (WebCore::SVGAElement::svgAttributeChanged):
801         (WebCore::SVGAElement::createElementRenderer):
802
803         ...
804
805 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
806
807         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaControlsHost
808         https://bugs.webkit.org/show_bug.cgi?id=156903
809
810         Reviewed by Chris Dumez.
811
812         No change of behavior.
813
814         * Modules/mediacontrols/MediaControlsHost.idl: Marking some parameters as nullable.
815
816 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
817
818         Drop [UsePointersEvenForNonNullableObjectArguments] from WebGLRenderingContext
819         https://bugs.webkit.org/show_bug.cgi?id=156909
820
821         Reviewed by Chris Dumez.
822
823         No change of behavior.
824
825         Marking a lot of method parameters as nullable.
826
827         * html/canvas/WebGLRenderingContextBase.idl:
828
829 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
830
831         Drop [UsePointersEvenForNonNullableObjectArguments] from WebSocket
832         https://bugs.webkit.org/show_bug.cgi?id=156897
833
834         Reviewed by Chris Dumez.
835
836         No change of behavior.
837
838         Updating WebSocket::send methods to take references, except for ArrayBufferView, which is not yet supported by the binding generator.
839
840         * Modules/websockets/WebSocket.cpp:
841         (WebCore::WebSocket::send):
842         * Modules/websockets/WebSocket.h:
843         * Modules/websockets/WebSocket.idl:
844
845 2016-04-23  Andy Estes  <aestes@apple.com>
846
847         Fix issues found by the clang static analyzer
848         https://bugs.webkit.org/show_bug.cgi?id=156956
849
850         Reviewed by Alexey Proskuryakov.
851
852         * editing/cocoa/DataDetection.mm:
853         (WebCore::DataDetection::detectContentInRange): Stored tz in a RetainPtr.
854         * platform/cf/KeyedDecoderCF.cpp:
855         (WebCore::KeyedDecoderCF::KeyedDecoderCF): If dynamic_cf_cast returned nullptr, the result of
856         CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr, then leaked/adopted it
857         into m_rootDictionary (to avoid retain count churn) if it is a CFDictionary.
858         * platform/ios/WebAVPlayerController.mm:
859         (-[WebAVPlayerController dealloc]): Released _externalPlaybackAirPlayDeviceLocalizedName.
860         (-[WebAVMediaSelectionOption dealloc]): Added to release _localizedDisplayName.
861         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
862         (-[WebAVPlayerLayer dealloc]): Released _pixelBufferAttributes.
863         * platform/network/cocoa/WebCoreNSURLSession.h: Removed the readwrite attributes from properties, since
864         properties are readwrite by default.
865         * platform/network/cocoa/WebCoreNSURLSession.mm: Removed @dynamic, which isn't necessary just for defining a custom getter.
866         (-[WebCoreNSURLSessionDataTask dealloc]): Added to release copied ivars.
867
868 2016-04-23  Dan Bernstein  <mitz@apple.com>
869
870         <rdar://problem/25894586> A project has failed to build because WTF_MAKE_FAST_ALLOCATED was not defined
871
872         Rubber-stamped by Chris Dumez.
873
874         Reverted the IntSize part of r199735, to let IntSize.h keep being used in another project.
875
876         * platform/graphics/IntSize.h:
877         (WebCore::IntSize::IntSize):
878
879 2016-04-23  Chris Dumez  <cdumez@apple.com>
880
881         Tie the DiagnosticLoggingClient's lifetime to the Page
882         https://bugs.webkit.org/show_bug.cgi?id=156938
883         <rdar://problem/25851499>
884
885         Reviewed by Antti Koivisto.
886
887         Tie the DiagnosticLoggingClient's lifetime to the Page rather than to the
888         MainFrame. The diagnostic logging client in WebKit2 requires the WebPage
889         to be alive in order to send IPC to the UIProcess. The WebPage owns the
890         Page and Page is not refCounted so the lifetime of the
891         DiagnosticLoggingClient should now be tied to the one of the WebPage as
892         well.
893
894         Previously, the DiagnosticLoggingClient would stay alive as long as the
895         MainFrame and could apparently in rare cases outlive the WebPage, thus
896         crashing when trying to send the IPC.
897
898         * history/PageCache.cpp:
899         (WebCore::logPageCacheFailureDiagnosticMessage):
900         (WebCore::canCachePage):
901         * html/HTMLMediaElement.cpp:
902         (WebCore::HTMLMediaElement::loadResource):
903         (WebCore::logMediaLoadRequest):
904         (WebCore::HTMLMediaElement::updatePlayState):
905         (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad):
906         * loader/EmptyClients.h:
907         * loader/FrameLoader.cpp:
908         (WebCore::logNavigation):
909         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
910         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
911         * loader/ResourceLoader.cpp:
912         (WebCore::logResourceResponseSource):
913         * loader/SubframeLoader.cpp:
914         (WebCore::logPluginRequest):
915         * loader/SubresourceLoader.cpp:
916         (WebCore::SubresourceLoader::willSendRequestInternal):
917         (WebCore::SubresourceLoader::didReceiveResponse):
918         (WebCore::logResourceLoaded):
919         * loader/cache/CachedResourceLoader.cpp:
920         (WebCore::logMemoryCacheResourceRequest):
921         (WebCore::logResourceRevalidationDecision):
922         * page/DiagnosticLoggingClient.h:
923         * page/MainFrame.cpp:
924         (WebCore::MainFrame::MainFrame): Deleted.
925         (WebCore::MainFrame::~MainFrame): Deleted.
926         (WebCore::MainFrame::diagnosticLoggingClient): Deleted.
927         * page/MainFrame.h:
928         * page/Page.cpp:
929         (WebCore::Page::Page):
930         (WebCore::Page::~Page):
931         (WebCore::Page::diagnosticLoggingClient):
932         * page/Page.h:
933
934 2016-04-22  Chris Dumez  <cdumez@apple.com>
935
936         Cannot access the SQLTransaction.constructor.prototype
937         https://bugs.webkit.org/show_bug.cgi?id=156613
938
939         Reviewed by Darin Adler.
940
941         Drop [NoInterfaceObject] from the following SQL interfaces:
942         Database, SQLError, SQLResultSet, SQLResultSetRowList and SQLTransaction.
943
944         This matches the specification:
945         https://dev.w3.org/html5/webdatabase/
946
947         This was causing the 'constructor' property to be wrong for these
948         interfaces as it would be a generic Object.
949
950         Test: storage/websql/transaction-prototype.html
951
952         * Modules/webdatabase/Database.idl:
953         * Modules/webdatabase/SQLError.idl:
954         * Modules/webdatabase/SQLResultSet.idl:
955         * Modules/webdatabase/SQLResultSetRowList.idl:
956         * Modules/webdatabase/SQLTransaction.idl:
957
958 2016-04-22  Joseph Pecoraro  <pecoraro@apple.com>
959
960         Web Inspector: Include columnNumber in event listener locations
961         https://bugs.webkit.org/show_bug.cgi?id=156927
962         <rdar://problem/25884584>
963
964         Reviewed by Brian Burg.
965
966         * inspector/InspectorDOMAgent.cpp:
967         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
968         Include the column number in the location as well.
969
970 2016-04-22  Brent Fulgham  <bfulgham@apple.com>
971
972         [Win] Unreviewed build fix.
973
974         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
975         (PlatformCALayerWin::isHidden):
976
977 2016-04-22  Jer Noble  <jer.noble@apple.com>
978
979         [iOS] Crash at -[WebAVPlayerLayer resolveBounds]
980         https://bugs.webkit.org/show_bug.cgi?id=156931
981         <rdar://problem/25865315> 
982
983         Reviewed by Eric Carlson.
984
985         When cloning the WebAVPlayerLayer, we must copy over the fullscreenInterface to the cloned layer.
986
987         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
988         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
989
990 2016-04-22  Chris Dumez  <cdumez@apple.com>
991
992         Crash under WebCore::DataDetection::detectContentInRange()
993         https://bugs.webkit.org/show_bug.cgi?id=156880
994         <rdar://problem/25622631>
995
996         Reviewed by Darin Adler.
997
998         We would sometimes crash under WebCore::DataDetection::detectContentInRange()
999         when dereferencing a null parentNode pointer. This patch adds a null check
1000         for parentNode in the for() loop. It also does some clean up and optimization
1001         since I was passing by.
1002
1003         * editing/cocoa/DataDetection.mm:
1004         (WebCore::DataDetection::detectContentInRange):
1005
1006 2016-04-22  Keith Miller  <keith_miller@apple.com>
1007
1008         buildObjectForEventListener should not call into JSC with a null ExecState
1009         https://bugs.webkit.org/show_bug.cgi?id=156923
1010
1011         Reviewed by Joseph Pecoraro.
1012
1013         If a user had disabled JavaScript on their page then the inspector tried to
1014         add an event listener we would fail to create an ExecState. Since we didn't
1015         check this ExecState was valid we would then attempt to stringify the value,
1016         which would cause JSC to crash.
1017
1018         * inspector/InspectorDOMAgent.cpp:
1019         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1020
1021 2016-04-22  Dean Jackson  <dino@apple.com>
1022
1023         Yet another attempt at fixing Windows.
1024
1025         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1026         (PlatformCALayerWin::isHidden):
1027         * platform/graphics/ca/win/PlatformCALayerWin.h:
1028
1029 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
1030
1031         Attempt to fix Windows build after r199862
1032
1033         Unreviewed build fix.
1034
1035         * platform/graphics/ca/win/PlatformCALayerWin.h:
1036
1037 2016-04-22  Brent Fulgham  <bfulgham@apple.com>
1038
1039         Anchor element 'ping' property should only apply to http/https destinations
1040         https://bugs.webkit.org/show_bug.cgi?id=156801
1041         <rdar://problem/25834419>
1042
1043         Reviewed by Chris Dumez.
1044
1045         Take advantage of the hyperlink auditing language "UAs may either ignore the
1046         ping attribute altogether, or selectively ignore URLs in the list (e.g. ignoring
1047         any third-party URLs)" to restrict pings to http/https targets. For details, see
1048         <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing>.
1049
1050         Tested by http/tests/navigation/ping-attribute tests.
1051
1052         * loader/PingLoader.cpp:
1053         (WebCore::PingLoader::sendPing): Ignore requests to ping anything outside the
1054         family of HTTP protocols (http/https).
1055
1056 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
1057
1058         Fix builds that do not support AVKit
1059
1060         Unreviewed build fix.
1061
1062         * platform/ios/WebAVPlayerController.h:
1063         * platform/ios/WebAVPlayerController.mm:
1064
1065 2016-04-22  Dave Hyatt  <hyatt@apple.com>
1066
1067         REGRESSION (r189567): The top of Facebook's messenger.com looks visually broken
1068         https://bugs.webkit.org/show_bug.cgi?id=156869
1069         <rdar://problem/23204668>
1070
1071         Reviewed by Zalan Bujtas.
1072
1073         Added fast/block/min-content-with-box-sizing.html
1074
1075         * rendering/RenderBox.cpp:
1076         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
1077
1078 2016-04-22  Antti Koivisto  <antti@apple.com>
1079
1080         TextAutoSizingKey should use normal refcounting
1081         https://bugs.webkit.org/show_bug.cgi?id=156893
1082
1083         Reviewed by Andreas Kling.
1084
1085         Get rid of special refcounting of style in favor of RefPtr. It also becomes a move-only type
1086         to support future switch to non-refcounted RenderStyle.
1087
1088         Also general cleanups and modernization.
1089
1090         * dom/Document.cpp:
1091         (WebCore::TextAutoSizingTraits::constructDeletedValue):
1092         (WebCore::TextAutoSizingTraits::isDeletedValue):
1093         (WebCore::Document::addAutoSizingNode):
1094         (WebCore::Document::validateAutoSizingNodes):
1095         (WebCore::Document::resetAutoSizingNodes):
1096
1097             Adopt to being move-only.
1098
1099         * rendering/TextAutoSizing.cpp:
1100         (WebCore::cloneRenderStyleWithState):
1101         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
1102
1103             Clone the style for safety against mutations. Cloning is cheap.
1104
1105         (WebCore::TextAutoSizingValue::numNodes):
1106         (WebCore::TextAutoSizingValue::adjustNodeSizes):
1107         (WebCore::TextAutoSizingValue::reset):
1108         (WebCore::TextAutoSizingKey::~TextAutoSizingKey): Deleted.
1109         (WebCore::TextAutoSizingKey::operator=): Deleted.
1110         (WebCore::TextAutoSizingKey::ref): Deleted.
1111         (WebCore::TextAutoSizingKey::deref): Deleted.
1112         * rendering/TextAutoSizing.h:
1113         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
1114         (WebCore::TextAutoSizingKey::style):
1115         (WebCore::TextAutoSizingKey::isDeleted):
1116         (WebCore::operator==):
1117         (WebCore::TextAutoSizingKey::doc): Deleted.
1118         (WebCore::TextAutoSizingKey::isValidDoc): Deleted.
1119         (WebCore::TextAutoSizingKey::isValidStyle): Deleted.
1120         (WebCore::TextAutoSizingKey::deletedKeyDoc): Deleted.
1121         (WebCore::TextAutoSizingKey::deletedKeyStyle): Deleted.
1122
1123             m_doc member is not used for anything except deleted value comparisons. Replace it with a bit.
1124
1125 2016-04-22  Chris Dumez  <cdumez@apple.com>
1126
1127         Crash under FontCache::purgeInactiveFontData()
1128         https://bugs.webkit.org/show_bug.cgi?id=156822
1129         <rdar://problem/25373970>
1130
1131         Reviewed by Darin Adler.
1132
1133         In some rare cases, the Font constructor would mutate the FontPlatformData
1134         that is being passed in. This is an issue because because our FontCache
1135         uses the FontPlatformData as key for the cached fonts. This could lead to
1136         crashes because the WTFMove() in FontCache::purgeInactiveFontData() would
1137         nullify values in our HashMap but we would then fail to remove them from
1138         the HashMap (because the key did not match). We would then reference the
1139         null font when looping again when doing font->hasOneRef().
1140
1141         This patch marks Font::m_platformData member as const to avoid such issues
1142         in the future and moves the code altering the FontPlatformData from the
1143         Font constructor into the FontPlatformData constructor. The purpose of
1144         that code was to initialize FontPlatformData::m_cgFont in case the CGFont
1145         passed in the constructor was null.
1146
1147         * platform/graphics/Font.h:
1148         * platform/graphics/FontCache.cpp:
1149         (WebCore::FontCache::fontForPlatformData):
1150         (WebCore::FontCache::purgeInactiveFontData):
1151         * platform/graphics/FontPlatformData.cpp:
1152         (WebCore::FontPlatformData::FontPlatformData):
1153         * platform/graphics/FontPlatformData.h:
1154         * platform/graphics/cocoa/FontCocoa.mm:
1155         (WebCore::webFallbackFontFamily): Deleted.
1156         (WebCore::Font::platformInit): Deleted.
1157         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1158         (WebCore::webFallbackFontFamily):
1159         (WebCore::FontPlatformData::setFallbackCGFont):
1160         * platform/graphics/win/FontPlatformDataCGWin.cpp:
1161         (WebCore::FontPlatformData::setFallbackCGFont):
1162
1163 2016-04-22  Chris Dumez  <cdumez@apple.com>
1164
1165         Support disabling at runtime IndexedDB constructors exposed to workers
1166         https://bugs.webkit.org/show_bug.cgi?id=156883
1167
1168         Reviewed by Darin Adler.
1169
1170         Support disabling at runtime IndexedDB constructors exposed to workers.
1171         Previously, constructors visibility to workers and window was constrolled
1172         by the same runtime flag.
1173
1174         * Modules/indexeddb/IDBCursor.idl:
1175         * Modules/indexeddb/IDBCursorWithValue.idl:
1176         * Modules/indexeddb/IDBDatabase.idl:
1177         * Modules/indexeddb/IDBFactory.idl:
1178         * Modules/indexeddb/IDBIndex.idl:
1179         * Modules/indexeddb/IDBKeyRange.idl:
1180         * Modules/indexeddb/IDBObjectStore.idl:
1181         * Modules/indexeddb/IDBOpenDBRequest.idl:
1182         * Modules/indexeddb/IDBRequest.idl:
1183         * Modules/indexeddb/IDBTransaction.idl:
1184         * Modules/indexeddb/IDBVersionChangeEvent.idl:
1185         * workers/WorkerGlobalScope.idl:
1186
1187 2016-04-22  Dean Jackson  <dino@apple.com>
1188
1189         Attempting to fix Windows build. Add isHidden implementation.
1190
1191         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1192         (PlatformCALayerWin::isHidden):
1193
1194 2016-04-22  Brady Eidson  <beidson@apple.com>
1195
1196         Attempt at a Windows build fix.
1197
1198         * workers/WorkerMessagingProxy.cpp:
1199         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1200
1201 2016-04-22  Dave Hyatt  <hyatt@apple.com>
1202
1203          -webkit-image-set doesn't work inside CSS variables
1204         https://bugs.webkit.org/show_bug.cgi?id=156915
1205         <rdar://problem/25473972>
1206
1207         Reviewed by Zalan Bujtas.
1208
1209         Added new tests in fast/hidpi.
1210
1211         * css/CSSPrimitiveValue.cpp:
1212         (WebCore::CSSPrimitiveValue::equals):
1213         (WebCore::CSSPrimitiveValue::buildParserValue):
1214
1215 2016-04-22  Commit Queue  <commit-queue@webkit.org>
1216
1217         Unreviewed, rolling out r199877.
1218         https://bugs.webkit.org/show_bug.cgi?id=156918
1219
1220         The LayoutTest added with this change is failing on all
1221         platforms. (Requested by ryanhaddad on #webkit).
1222
1223         Reverted changeset:
1224
1225         "REGRESSION (r189567): The top of Facebook's messenger.com
1226         looks visually broken"
1227         https://bugs.webkit.org/show_bug.cgi?id=156869
1228         http://trac.webkit.org/changeset/199877
1229
1230 2016-04-22  Brady Eidson  <beidson@apple.com>
1231
1232         Modern IDB: Rework the ownership/RefCounting model of IDBConnectionToServer and IDBConnectionProxy.
1233         https://bugs.webkit.org/show_bug.cgi?id=156916
1234
1235         Reviewed by Tim Horton.
1236
1237         No new tests (No behavior change).
1238
1239         * Modules/indexeddb/IDBFactory.cpp: Remove unneeded include.
1240         
1241         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1242         (WebCore::IDBClient::IDBConnectionProxy::ref): Ref the ConnectionToServer.
1243         (WebCore::IDBClient::IDBConnectionProxy::deref): Deref it.
1244         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer):
1245         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
1246         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
1247         (WebCore::IDBClient::IDBConnectionProxy::create): Deleted.
1248         * Modules/indexeddb/client/IDBConnectionProxy.h:
1249         
1250         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1251         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer): Create a proxy owned by this.
1252         (WebCore::IDBClient::IDBConnectionToServer::proxy): Expose it.
1253         * Modules/indexeddb/client/IDBConnectionToServer.h:
1254         
1255         * dom/Document.cpp:
1256         (WebCore::Document::idbConnectionProxy):
1257
1258         * WebCore.xcodeproj/project.pbxproj:
1259
1260 2016-04-22  Antti Koivisto  <antti@apple.com>
1261
1262         REGRESSION (r194898): Multi download of external SVG defs file by <use> xlinks:href (caching)
1263         https://bugs.webkit.org/show_bug.cgi?id=156368
1264         <rdar://problem/25611746>
1265
1266         Reviewed by Simon Fraser.
1267
1268         We would load svg resources with fragment identifier again because the encoding never matched.
1269
1270         Test: http/tests/svg/svg-use-external.html
1271
1272         * loader/TextResourceDecoder.cpp:
1273         (WebCore::TextResourceDecoder::setEncoding):
1274         (WebCore::TextResourceDecoder::hasEqualEncodingForCharset):
1275
1276             Encoding can depend on mime type. Add a comparison function that takes this into account.
1277
1278         (WebCore::findXMLEncoding):
1279         * loader/TextResourceDecoder.h:
1280         (WebCore::TextResourceDecoder::encoding):
1281         * loader/cache/CachedCSSStyleSheet.h:
1282         * loader/cache/CachedResource.h:
1283         (WebCore::CachedResource::textResourceDecoder):
1284
1285             Add a way to get the TextResourceDecoder from a cached resource.
1286
1287         * loader/cache/CachedResourceLoader.cpp:
1288         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
1289
1290             Use the new comparison function.
1291
1292         * loader/cache/CachedSVGDocument.h:
1293         * loader/cache/CachedScript.h:
1294         * loader/cache/CachedXSLStyleSheet.h:
1295
1296 2016-04-22  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1297
1298         Drop [UsePointersEvenForNonNullableObjectArguments] from InspectorFrontendHost
1299         https://bugs.webkit.org/show_bug.cgi?id=156908
1300
1301         Reviewed by Timothy Hatcher.
1302
1303         No change of behavior.
1304
1305         * inspector/InspectorFrontendHost.idl: Marking event parameter as nullable to keep compatibility.
1306
1307 2016-04-22  Chris Dumez  <cdumez@apple.com>
1308
1309         Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
1310         https://bugs.webkit.org/show_bug.cgi?id=156890
1311
1312         Reviewed by Darin Adler.
1313
1314         Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
1315         and clean up / modernize the code a bit. There is not significant Web-
1316         exposed behavior change except that MutationObserver.observe() now throws
1317         a different kind of exception (a TypeError as per Web IDL) when passed in
1318         a null Node.
1319
1320         No new tests, rebaselined existing test.
1321
1322         * bindings/js/JSMutationCallback.cpp:
1323         (WebCore::JSMutationCallback::call):
1324         * bindings/js/JSMutationCallback.h:
1325         * bindings/js/JSMutationObserverCustom.cpp:
1326         (WebCore::constructJSMutationObserver):
1327         * css/PropertySetCSSStyleDeclaration.cpp:
1328         * dom/ChildListMutationScope.cpp:
1329         (WebCore::ChildListMutationAccumulator::enqueueMutationRecord):
1330         * dom/MutationCallback.h:
1331         * dom/MutationObserver.cpp:
1332         (WebCore::MutationObserver::create):
1333         (WebCore::MutationObserver::MutationObserver):
1334         (WebCore::MutationObserver::observe):
1335         (WebCore::MutationObserver::takeRecords):
1336         (WebCore::MutationObserver::enqueueMutationRecord):
1337         (WebCore::MutationObserver::deliver):
1338         (WebCore::MutationObserver::disconnect): Deleted.
1339         * dom/MutationObserver.h:
1340         * dom/MutationObserver.idl:
1341         * dom/MutationObserverInterestGroup.cpp:
1342         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
1343         * dom/MutationObserverInterestGroup.h:
1344         * dom/MutationRecord.cpp:
1345         (WebCore::MutationRecord::createChildList):
1346         * dom/MutationRecord.h:
1347
1348 2016-04-22  Dave Hyatt  <hyatt@apple.com>
1349
1350         REGRESSION (r189567): The top of Facebook's messenger.com looks visually broken
1351         https://bugs.webkit.org/show_bug.cgi?id=156869
1352         <rdar://problem/23204668>
1353
1354         Reviewed by Zalan Bujtas.
1355
1356         Added fast/block/min-content-with-box-sizing.html
1357
1358         * rendering/RenderBox.cpp:
1359         (WebCore::RenderBox::computeContentLogicalHeight):
1360
1361 2016-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
1362
1363         [css-grid] Fix bug with positioned items in vertical writing mode
1364         https://bugs.webkit.org/show_bug.cgi?id=156870
1365
1366         Reviewed by Darin Adler.
1367
1368         In RenderGrid::offsetAndBreadthForPositionedChild() we were using
1369         directly borderLeft(), which is wrong in vertical writing modes.
1370
1371         To fix it we just need to use borderLogicalLeft() which is aware of
1372         the current writing mode.
1373
1374         Test: fast/css-grid-layout/grid-positioned-children-writing-modes.html
1375
1376         * rendering/RenderGrid.cpp:
1377         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1378
1379 2016-04-21  Zan Dobersek  <zdobersek@igalia.com>
1380
1381         REGRESSION(r199738): The ANGLE update broke accelerated compositing in GTK+ port
1382         https://bugs.webkit.org/show_bug.cgi?id=156789
1383
1384         Reviewed by Carlos Garcia Campos.
1385
1386         After the update, the ANGLE library has to be built with
1387         ANGLE_ENABLE_ESSL and ANGLE_ENABLE_GLSL definitions in order
1388         to compile in the support for the two translators that Linux-based
1389         ports using OpenGL ES or OpenGL require. Missing files are also added.
1390
1391         * CMakeLists.txt:
1392
1393 2016-04-21  Chris Dumez  <cdumez@apple.com>
1394
1395         Drop [UsePointersEvenForNonNullableObjectArguments] from Document
1396         https://bugs.webkit.org/show_bug.cgi?id=156881
1397
1398         Reviewed by Darin Adler.
1399
1400         Drop [UsePointersEvenForNonNullableObjectArguments] from Document. There
1401         is no major Web-exposed behavior change but the type of the exception
1402         being thrown when passing null or not enough parameters has changed for
1403         some of the API (It is now always a TypeError as per the Web IDL
1404         specification).
1405
1406         Tests: fast/dom/Document/adoptNode-null.html
1407                fast/dom/Document/importNode-null.html
1408
1409         * dom/ContainerNode.cpp:
1410         (WebCore::ContainerNode::takeAllChildrenFrom):
1411         (WebCore::ContainerNode::parserInsertBefore):
1412         (WebCore::ContainerNode::parserAppendChild):
1413         * dom/Document.cpp:
1414         (WebCore::Document::importNode):
1415         (WebCore::Document::adoptNode):
1416         (WebCore::Document::createNodeIterator):
1417         (WebCore::Document::createTreeWalker):
1418         (WebCore::Document::setBodyOrFrameset):
1419         (WebCore::Document::hasValidNamespaceForElements): Deleted.
1420         (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
1421         (WebCore::Document::scheduleStyleRecalc): Deleted.
1422         (WebCore::Document::unscheduleStyleRecalc): Deleted.
1423         (WebCore::Document::hasPendingStyleRecalc): Deleted.
1424         (WebCore::Document::hasPendingForcedStyleRecalc): Deleted.
1425         (WebCore::Document::recalcStyle): Deleted.
1426         (WebCore::Document::explicitClose): Deleted.
1427         * dom/Document.h:
1428         (WebCore::Document::importNode):
1429         * dom/Document.idl:
1430         * dom/NodeIterator.cpp:
1431         (WebCore::NodeIterator::NodeIterator):
1432         * dom/NodeIterator.h:
1433         (WebCore::NodeIterator::create):
1434
1435 2016-04-21  Frederic Wang  <fwang@igalia.com>
1436
1437         More improvements and explanations regarding resetting CSS properties on the <math> element
1438         https://bugs.webkit.org/show_bug.cgi?id=156840
1439
1440         Reviewed by Darin Adler.
1441
1442         We some follow-up improvements regarding CSS rules on the <math> element, after bug 133603:
1443         - We fix indenting to use 4 spaces.
1444         - We explain why we set -webkit-line-box-contain and add references to related bugs.
1445         - We explain why we reset some CSS spacing rules.
1446         - We explain why the direction is set to ltr.
1447         - We explain why font-family is set to a list of known math fonts and add reference
1448           to the wiki.
1449         - We mention the need to customize math fonts to get consistent style and add references to
1450           a bug report and to the wiki.
1451         - We described each of the math font listed and add some justification about their orders.
1452         - We better explain the section about fonts that do not satisfy the requirements for good
1453           mathematical rendering, reformulate why we still need them for iOS/Mac and we add some
1454           references to a bug report and to the wiki. Some fonts that not pre-installed were removed
1455           in r199773.
1456         - We add a FIXME comments for potential changes of CSS properties on the <math> tag.
1457
1458         We make the following changes to the lists of font-family:
1459         - We move "TeX Gyre Termes Math" into the Times group.
1460         - We move "Asana Math" into the Palatino group.
1461         - We remove iOS conditionals on "Symbol" and "Times New Roman".
1462
1463         No new tests, only order of math fonts that are not used by test framework is changed.
1464
1465         * css/mathml.css:
1466         (math): We merge the two math selectors, reorder some font-families, remove iOS ifdef and
1467         add more description.
1468
1469 2016-04-21  Dean Jackson  <dino@apple.com>
1470
1471         Backdrop Filter should not be visible if element has visibility:hidden
1472         https://bugs.webkit.org/show_bug.cgi?id=149318
1473         <rdar://problem/22749780>
1474
1475         Reviewed by Simon Fraser.
1476
1477         Make sure that backdrop filter layers take note of when
1478         the contents are visible or not.
1479
1480         Tests: css3/filters/backdrop/backdrop-with-visibility-hidden-changing.html
1481                css3/filters/backdrop/backdrop-with-visibility-hidden.html
1482                css3/filters/backdrop/backdrop-with-visibility-hidden-2.html
1483
1484         * platform/graphics/ca/GraphicsLayerCA.cpp:
1485         (WebCore::GraphicsLayerCA::updateContentsVisibility): Tell the backdrop layer about the
1486         change if there is one.
1487         (WebCore::GraphicsLayerCA::updateBackdropFilters): When we update filters, make
1488         sure to check the contents visibility.
1489         (WebCore::dumpInnerLayer): Output "hidden" if the layer is set as such.
1490         * platform/graphics/ca/PlatformCALayer.h: Add an isHidden method.
1491         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1492         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1493         (PlatformCALayerCocoa::isHidden): Call into CALayer isHidden.
1494
1495 2016-04-21  Zalan Bujtas  <zalan@apple.com>
1496
1497         RenderVideo should always update the intrinsic size before layout.
1498         https://bugs.webkit.org/show_bug.cgi?id=156878
1499
1500         Reviewed by Simon Fraser.
1501
1502         In order to layout video element properly we need to know the correct intrinsic size.
1503         This patch also asserts if we end up updating the intrinsic size right after finishing video renderer layout.
1504
1505         This issues was discovered as part of webkit.org/b/156245. (hence covered by existing tests)
1506
1507         * rendering/RenderVideo.cpp:
1508         (WebCore::RenderVideo::updateIntrinsicSize):
1509         (WebCore::RenderVideo::layout):
1510         (WebCore::RenderVideo::updatePlayer):
1511         * rendering/RenderVideo.h:
1512
1513 2016-04-21  Brady Eidson  <beidson@apple.com>
1514
1515         Modern IDB (Workers): Get the IDBConnectionProxy from the Document to the WorkerGlobalScope.
1516         https://bugs.webkit.org/show_bug.cgi?id=156877
1517
1518         Reviewed by Tim Horton.
1519
1520         No new tests (Covered by changes to existing tests).
1521
1522         * workers/WorkerMessagingProxy.cpp:
1523         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): This is the point on the main thread
1524           where we can get the IDBConnectionProxy from the Document and pass it down through Worker
1525           machinery so it can end up at the WorkerGlobalScope.
1526         
1527         Everything else is this patch is just passing it along as needed.
1528
1529         And cleaning up header style for neglected headers.
1530
1531         * workers/DedicatedWorkerGlobalScope.cpp:
1532         (WebCore::DedicatedWorkerGlobalScope::create):
1533         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
1534         * workers/DedicatedWorkerGlobalScope.h:
1535
1536         * workers/DedicatedWorkerThread.cpp:
1537         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
1538         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
1539         * workers/DedicatedWorkerThread.h:
1540         (WebCore::DedicatedWorkerThread::create):
1541         (WebCore::DedicatedWorkerThread::workerObjectProxy):
1542
1543         * workers/WorkerGlobalScope.cpp:
1544         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
1545         (WebCore::WorkerGlobalScope::idbConnectionProxy):
1546         * workers/WorkerGlobalScope.h:
1547
1548         * workers/WorkerThread.cpp:
1549         (WebCore::WorkerThread::WorkerThread):
1550         (WebCore::WorkerThread::idbConnectionProxy):
1551         * workers/WorkerThread.h:
1552         (WebCore::WorkerThread::threadID):
1553         (WebCore::WorkerThread::runLoop):
1554         (WebCore::WorkerThread::workerLoaderProxy):
1555         (WebCore::WorkerThread::workerReportingProxy):
1556         (WebCore::WorkerThread::getNotificationClient):
1557         (WebCore::WorkerThread::setNotificationClient):
1558         (WebCore::WorkerThread::workerGlobalScope):
1559
1560 2016-04-21  Anders Carlsson  <andersca@apple.com>
1561
1562         Fix crashes when loading SVG images.
1563
1564         * loader/EmptyClients.cpp:
1565         (WebCore::fillWithEmptyClients):
1566         Give the SVG page its own application cache storage.
1567
1568 2016-04-21  Anders Carlsson  <andersca@apple.com>
1569
1570         Get rid of ApplicationCacheStorage::singleton
1571         https://bugs.webkit.org/show_bug.cgi?id=156882
1572
1573         Reviewed by Tim Horton.
1574
1575         * loader/appcache/ApplicationCacheStorage.cpp:
1576         (WebCore::ApplicationCacheStorage::setCacheDirectory): Deleted.
1577         (WebCore::ApplicationCacheStorage::singleton): Deleted.
1578         * loader/appcache/ApplicationCacheStorage.h:
1579         * page/Page.cpp:
1580         (WebCore::Page::Page):
1581
1582 2016-04-21  Simon Fraser  <simon.fraser@apple.com>
1583
1584         ASSERTION FAILED: accumulation == TransformState::FlattenTransform in WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect
1585         https://bugs.webkit.org/show_bug.cgi?id=155362
1586
1587         Reviewed by Zalan Bujtas.
1588
1589         A particular configuration of composited RenderLayers with preserve-3d and clipping
1590         caused assertions because an ancestor clipping layer had masksToBounds() set, but
1591         a preserves3D() parent, triggering an assertion in GraphicsLayerCA::computeVisibleAndCoverageRect().
1592         Make two changes to address this:
1593
1594         First, CSS clip: and clip-path: should force flattening and override preserve-3d in
1595         the RenderStyle.
1596
1597         Second, don't accumulate transforms in GraphicsLayerCA through layers with masksToBounds().
1598
1599         Tests: compositing/clipping/preserve3d-flatten-assertion-nested.html
1600                compositing/clipping/preserve3d-flatten-assertion.html
1601
1602         * css/StyleResolver.cpp:
1603         (WebCore::StyleResolver::adjustRenderStyle):
1604         * platform/graphics/ca/GraphicsLayerCA.cpp:
1605         (WebCore::accumulatesTransform):
1606
1607 2016-04-21  Chris Dumez  <cdumez@apple.com>
1608
1609         Element::idForStyleResolution() is a foot-gun
1610         https://bugs.webkit.org/show_bug.cgi?id=156852
1611
1612         Reviewed by Darin Adler.
1613
1614         Element::idForStyleResolution() is a foot-gun. It requires the caller to check
1615         Element::hasID() first or it may end up crashing when dereferencing elementData()
1616         (e.g. see Bug 156806).
1617
1618         This patch updates Element::idForStyleResolution() to return nullAtom is the
1619         Element does not have an ID. I did not see a performance impact on Speedometer,
1620         Dromaeo DOM Core, Dromaeo CSS Selectors and our local performanceTests/.
1621
1622         * css/ElementRuleCollector.cpp:
1623         (WebCore::ElementRuleCollector::collectMatchingRules):
1624         * css/SelectorChecker.cpp:
1625         (WebCore::SelectorChecker::checkOne):
1626         * css/SelectorFilter.cpp:
1627         (WebCore::collectElementIdentifierHashes):
1628         * dom/Element.h:
1629         (WebCore::Element::idForStyleResolution):
1630         * rendering/RenderBlockFlow.cpp:
1631         (WebCore::needsAppleMailPaginationQuirk):
1632         * rendering/RenderTreeAsText.cpp:
1633         (WebCore::writeRenderRegionList):
1634         * style/StyleSharingResolver.cpp:
1635         (WebCore::Style::SharingResolver::canShareStyleWithElement):
1636
1637 2016-04-21  Brady Eidson  <beidson@apple.com>
1638
1639         Modern IDB (Workers): Move IDBConnectionProxy into IDBRequest and IDBDatabase.
1640         https://bugs.webkit.org/show_bug.cgi?id=156868
1641
1642         Reviewed by Tim Horton.
1643
1644         No new tests (No behavior change).
1645
1646         * Modules/indexeddb/IDBDatabase.cpp:
1647         (WebCore::IDBDatabase::create):
1648         (WebCore::IDBDatabase::IDBDatabase):
1649         (WebCore::IDBDatabase::~IDBDatabase):
1650         (WebCore::IDBDatabase::transaction):
1651         (WebCore::IDBDatabase::maybeCloseInServer):
1652         * Modules/indexeddb/IDBDatabase.h:
1653         (WebCore::IDBDatabase::connectionProxy):
1654         (WebCore::IDBDatabase::serverConnection):
1655
1656         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1657         (WebCore::IDBOpenDBRequest::createDeleteRequest):
1658         (WebCore::IDBOpenDBRequest::createOpenRequest):
1659         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
1660         (WebCore::IDBOpenDBRequest::onSuccess):
1661         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
1662         (WebCore::IDBOpenDBRequest::requestCompleted):
1663         (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest): Deleted.
1664         (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest): Deleted.
1665         * Modules/indexeddb/IDBOpenDBRequest.h:
1666
1667         * Modules/indexeddb/IDBRequest.cpp:
1668         (WebCore::IDBRequest::IDBRequest):
1669         (WebCore::IDBRequest::connectionToServer): Deleted.
1670         * Modules/indexeddb/IDBRequest.h:
1671         (WebCore::IDBRequest::connectionProxy):
1672
1673         * Modules/indexeddb/IDBTransaction.h:
1674
1675         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1676         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
1677         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
1678
1679 2016-04-21  Jiewen Tan  <jiewen_tan@apple.com>
1680
1681         [iOS] DumpRenderTree crashed in com.apple.WebCore: WebCore::ResourceLoadNotifier::didFailToLoad
1682         https://bugs.webkit.org/show_bug.cgi?id=156829
1683         <rdar://problem/23348217>
1684
1685         Reviewed by Daniel Bates.
1686
1687         Ensure that the frame associated with the ResourceLoadNotifier is kept alive when notifying the Web Inspector.
1688
1689         Covered by existing tests.
1690
1691         * loader/ResourceLoadNotifier.cpp:
1692         (WebCore::ResourceLoadNotifier::didFailToLoad):
1693         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
1694         (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
1695         (WebCore::ResourceLoadNotifier::dispatchDidReceiveData):
1696         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
1697         (WebCore::ResourceLoadNotifier::dispatchDidFailLoading):
1698
1699 2016-04-21  Brady Eidson  <beidson@apple.com>
1700
1701         Modern IDB (Workers): More IDBConnectionProxy refactoring.
1702         https://bugs.webkit.org/show_bug.cgi?id=156855
1703
1704         Reviewed by Darin Adler.
1705
1706         No new tests (Covered by changes to existing tests).
1707
1708         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1709         (WebCore::DOMWindowIndexedDatabase::indexedDB):
1710
1711         Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
1712         * Modules/indexeddb/IDBFactory.cpp:
1713         (WebCore::IDBFactory::create):
1714         (WebCore::IDBFactory::IDBFactory):
1715         (WebCore::IDBFactory::openInternal):
1716         (WebCore::IDBFactory::deleteDatabase):
1717         * Modules/indexeddb/IDBFactory.h:
1718
1719         Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
1720         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
1721         (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
1722         (WebCore::WorkerGlobalScopeIndexedDatabase::from):
1723         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
1724         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
1725
1726         Make IDBConnectionProxy ThreadSafeRefCounted:
1727         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1728         (WebCore::IDBClient::IDBConnectionProxy::create):
1729         * Modules/indexeddb/client/IDBConnectionProxy.h:
1730
1731         * dom/Document.cpp:
1732         (WebCore::Document::idbConnectionProxy):
1733         * dom/Document.h:
1734
1735 2016-04-21  Keith Miller  <keith_miller@apple.com>
1736
1737         WebScriptObject description swizzler should work in a multi-threaded world
1738         https://bugs.webkit.org/show_bug.cgi?id=156808
1739
1740         Reviewed by Geoffrey Garen.
1741
1742         A WebKit legacy API user might be running Objective-C code on another thread.
1743         Since we don't want to corrupt other thread's NSObject description method
1744         we use TLS to record if we are in the stringValue function. As an attempt to
1745         preserve any user swizzling we update the non-stringValue NSObject description
1746         method on each call to stringValue if it has changed. Additionally, the TLS
1747         needs to be a int because the user might call into stringValue, back into JS,
1748         then back into stringValue. If the TLS was a boolean then it would be unset
1749         at that point so when we return into the first stringValue call we would call
1750         the original NSObject description method rather than our override.
1751
1752         Test added to API tests: WebKit1.WebScriptObjectDescription
1753
1754         * bridge/objc/objc_instance.mm:
1755         (-[NSObject _web_description]):
1756         (ObjcInstance::stringValue):
1757         (swizzleNSObjectDescription): Deleted.
1758
1759 2016-04-21  Beth Dakin  <bdakin@apple.com>
1760
1761         Build fix.
1762
1763         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
1764         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
1765         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
1766         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
1767
1768 2016-04-21  Beth Dakin  <bdakin@apple.com>
1769
1770         32 bit build fix.
1771
1772         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
1773
1774 2016-04-21  Konstantin Tokarev  <annulen@yandex.ru>
1775
1776         Fixed compilation with !ENABLE(SVG_FONTS).
1777         https://bugs.webkit.org/show_bug.cgi?id=156850
1778
1779         Reviewed by Michael Catanzaro.
1780
1781         No new tests needed.
1782
1783         * css/CSSFontFaceSource.cpp:
1784         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
1785         Added missing ENABLE(SVG_FONTS) guards.
1786         * css/CSSFontFaceSource.h: Ditto.
1787         * platform/graphics/FontCascade.cpp: Ditto.
1788         * svg/SVGToOTFFontConversion.cpp:
1789         (WebCore::FontCascade::drawGlyphBuffer): Deleted extraneous
1790         !ENABLE(SVG_FONTS) guard.
1791
1792 2016-04-21  Beth Dakin  <bdakin@apple.com>
1793
1794         Remove reliance on WebAVMediaSelectionOptionMac for the 
1795         WebPlaybackControlsManager
1796         https://bugs.webkit.org/show_bug.cgi?id=156811
1797         -and corresponding-
1798         rdar://problem/25760523
1799
1800         Reviewed by Jer Noble.
1801
1802         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
1803         (-[WebPlaybackControlsManager setSeekableTimeRanges:]):
1804         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
1805         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
1806         (WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
1807         (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
1808         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
1809         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
1810         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
1811         (-[WebAVMediaSelectionOptionMac localizedDisplayName]): Deleted.
1812         (-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]): Deleted.
1813         (-[WebPlaybackControlsManager isSeeking]): Deleted.
1814         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): Deleted.
1815         (-[WebPlaybackControlsManager audioMediaSelectionOptions]): Deleted.
1816         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]): Deleted.
1817         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]): Deleted.
1818         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]): Deleted.
1819         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]): Deleted.
1820         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]): Deleted.
1821         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]): Deleted.
1822         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]): Deleted.
1823         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]): Deleted.
1824         (WebCore::mediaSelectionOptions): Deleted.
1825
1826 2016-04-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
1827
1828         REGRESSION(198782): ImageSource::subsamplingLevelForScale() does not cache the MaximumSubsamplingLevel for this ImageSource
1829         https://bugs.webkit.org/show_bug.cgi?id=156766
1830
1831         Reviewed by Darin Adler.
1832
1833         Ensure the MaximumSubsamplingLevel for the ImageSource is calculated
1834         only once and is cached for subsequent uses. 
1835         
1836         The image subsampling is on by default only for iOS. So the and this
1837         patch currently affects the iOS port.
1838
1839         * platform/graphics/ImageSource.cpp:
1840         (WebCore::ImageSource::cacheMetadata): Cache m_maximumSubsamplingLevel.
1841         Use m_frameCount as a flag for having_the_cache_done.
1842         (WebCore::ImageSource::subsamplingLevelForScale): Call cacheMetadata()
1843         before using m_maximumSubsamplingLevel.
1844         (WebCore::ImageSource::frameCount): Call cacheMetadata() before returning
1845         m_frameCount.
1846         * platform/graphics/ImageSource.h:
1847
1848 2016-04-21  Antoine Quint  <graouts@apple.com>
1849
1850         Creating a large number of WebGL contexts should recycle older contexts
1851         https://bugs.webkit.org/show_bug.cgi?id=156689
1852         <rdar://problem/19535330>
1853
1854         Reviewed by Dean Jackson.
1855
1856         We used to stop creating WebGL contexts once a maximum of 64 WebGL contexts had been
1857         created on a page. Other browsers have a limit of 16 concurrent active WebGL contexts
1858         and they lose older contexts when the developer creates a new context, logging a warning
1859         to the console. We now follow the same approach.
1860
1861         Tests: webgl/max-active-contexts-console-warning.html
1862                webgl/max-active-contexts-gc.html
1863                webgl/max-active-contexts-oldest-context-lost.html
1864                webgl/max-active-contexts-webglcontextlost-prevent-default.html
1865
1866         * html/canvas/WebGLRenderingContextBase.cpp:
1867         (WebCore::WebGLRenderingContextBase::recycleContext):
1868
1869         Prints a warning message to the console indicating that an older WebGL context
1870         will be lost to accomodate for the active contexts limit being reached and loses
1871         the provided context in a way that it may not be recovered by calling `event.preventDefault()`
1872         in the `webglcontextlost` event handler. Finally, we destroy the associated GraphicsContext3D
1873         since it will no longer be useful and it may hold large Open GL resources.
1874
1875         * html/canvas/WebGLRenderingContextBase.h:
1876         * platform/graphics/GraphicsContext3D.h:
1877
1878         Changed GraphicsContext3D::create to return RefPtr instead of PassRefPtr.
1879
1880         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1881         (WebCore::GraphicsContext3D::create):
1882         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
1883         (WebCore::GraphicsContext3D::create):
1884         * platform/graphics/mac/GraphicsContext3DMac.mm:
1885         (WebCore::activeContexts):
1886         (WebCore::GraphicsContext3D::create):
1887
1888         Check if we are at the active contexts limit (16) and recycle the oldest context
1889         in our active contexts list. Calling recycleContext() on a context will call the
1890         GraphicsContext3D destructor and remove it from the active contexts list there.
1891
1892         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1893
1894         Remove the deconstructed context from the active contexts list.
1895
1896         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1897         (WebCore::GraphicsContext3D::recycleContext):
1898         * platform/graphics/win/GraphicsContext3DWin.cpp:
1899         (WebCore::GraphicsContext3D::create):
1900
1901 2016-04-21  Dave Hyatt  <hyatt@apple.com>
1902
1903         Don't hyphenate the last word in a paragraph of text.
1904         https://bugs.webkit.org/show_bug.cgi?id=156803
1905
1906         Reviewed by Simon Fraser.
1907
1908         Added fast/text/hyphenate-avoid-orphaned-word.html
1909
1910         * rendering/RenderText.h:
1911         * rendering/line/BreakingContext.h:
1912         (WebCore::BreakingContext::handleText):
1913
1914 2016-04-21  Chris Dumez  <cdumez@apple.com>
1915
1916         Drop [UsePointersEvenForNonNullableObjectArguments] from Range
1917         https://bugs.webkit.org/show_bug.cgi?id=156805
1918
1919         Reviewed by Youenn Fablet.
1920
1921         No new tests, no web-exposed behavior change.
1922
1923         * accessibility/AXObjectCache.cpp:
1924         (WebCore::AXObjectCache::rangeForNodeContents):
1925         (WebCore::characterOffsetsInOrder):
1926         (WebCore::setRangeStartOrEndWithCharacterOffset):
1927         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
1928         (WebCore::AXObjectCache::previousBoundary):
1929         * accessibility/AccessibilityObject.cpp:
1930         (WebCore::AccessibilityObject::selectText):
1931         * accessibility/AccessibilityRenderObject.cpp:
1932         (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange):
1933         * dom/Node.cpp:
1934         (WebCore::Node::textRects):
1935         * dom/Range.cpp:
1936         (WebCore::Range::Range):
1937         (WebCore::Range::setDocument):
1938         (WebCore::Range::setStart):
1939         (WebCore::Range::setEnd):
1940         (WebCore::Range::isPointInRange):
1941         (WebCore::Range::comparePoint):
1942         (WebCore::Range::compareNode):
1943         (WebCore::Range::compareBoundaryPoints):
1944         (WebCore::Range::compareBoundaryPointsForBindings):
1945         (WebCore::Range::intersectsNode):
1946         (WebCore::Range::processContents):
1947         (WebCore::Range::insertNode):
1948         (WebCore::Range::checkNodeWOffset):
1949         (WebCore::Range::setStartAfter):
1950         (WebCore::Range::setEndBefore):
1951         (WebCore::Range::setEndAfter):
1952         (WebCore::Range::selectNode):
1953         (WebCore::Range::selectNodeContents):
1954         (WebCore::Range::surroundContents):
1955         (WebCore::Range::setStartBefore):
1956         (WebCore::Range::contains):
1957         (WebCore::rangesOverlap):
1958         (WebCore::rangeOfContents):
1959         (WebCore::boundaryNodeChildrenWillBeRemoved):
1960         (WebCore::boundaryTextNodesMerged):
1961         (WebCore::boundaryTextNodesSplit):
1962         (WebCore::Range::expand):
1963         (WebCore::checkForDifferentRootContainer): Deleted.
1964         (WebCore::highestAncestorUnderCommonRoot): Deleted.
1965         (WebCore::childOfCommonRootBeforeOffset): Deleted.
1966         (WebCore::deleteCharacterData): Deleted.
1967         (WebCore::Range::toString): Deleted.
1968         (WebCore::Range::toHTML): Deleted.
1969         (WebCore::Range::text): Deleted.
1970         (WebCore::Range::cloneRange): Deleted.
1971         (WebCore::Range::absoluteTextRects): Deleted.
1972         (WebCore::Range::absoluteTextQuads): Deleted.
1973         (WebCore::boundaryNodeChildrenChanged): Deleted.
1974         (WebCore::boundaryNodeWillBeRemoved): Deleted.
1975         (WebCore::Range::nodeWillBeRemoved): Deleted.
1976         (WebCore::boundaryTextRemoved): Deleted.
1977         (WebCore::Range::getBoundingClientRect): Deleted.
1978         (WebCore::Range::getBorderAndTextQuads): Deleted.
1979         * dom/Range.h:
1980         * dom/Range.idl:
1981         * dom/RangeBoundaryPoint.h:
1982         (WebCore::RangeBoundaryPoint::set):
1983         (WebCore::RangeBoundaryPoint::setToStartOfNode):
1984         (WebCore::RangeBoundaryPoint::setToEndOfNode):
1985         * editing/AlternativeTextController.cpp:
1986         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
1987         * editing/ApplyStyleCommand.cpp:
1988         (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
1989         * editing/Editor.cpp:
1990         (WebCore::Editor::advanceToNextMisspelling):
1991         (WebCore::Editor::rangeOfString):
1992         (WebCore::isFrameInRange):
1993         (WebCore::Editor::countMatchesForText):
1994         * editing/EditorCommand.cpp:
1995         (WebCore::unionDOMRanges):
1996         (WebCore::executeDeleteToMark):
1997         (WebCore::executeSelectToMark):
1998         * editing/FormatBlockCommand.cpp:
1999         (WebCore::FormatBlockCommand::formatRange):
2000         * editing/FrameSelection.cpp:
2001         (WebCore::FrameSelection::respondToNodeModification):
2002         * editing/InsertListCommand.cpp:
2003         (WebCore::InsertListCommand::doApplyForSingleParagraph):
2004         * editing/TextCheckingHelper.cpp:
2005         (WebCore::TextCheckingParagraph::offsetTo):
2006         * editing/TextIterator.cpp:
2007         (WebCore::CharacterIterator::range):
2008         (WebCore::BackwardsCharacterIterator::range):
2009         (WebCore::TextIterator::rangeFromLocationAndLength):
2010         (WebCore::TextIterator::getLocationAndLengthFromRange):
2011         (WebCore::findPlainText):
2012         * editing/VisiblePosition.cpp:
2013         (WebCore::setStart):
2014         (WebCore::setEnd):
2015         * editing/VisibleSelection.cpp:
2016         (WebCore::makeSearchRange):
2017         * editing/VisibleUnits.cpp:
2018         (WebCore::previousBoundary):
2019         (WebCore::nextBoundary):
2020         * editing/htmlediting.cpp:
2021         (WebCore::visiblePositionForIndexUsingCharacterIterator):
2022         (WebCore::isNodeVisiblyContainedWithin):
2023         * editing/htmlediting.h:
2024         * editing/mac/EditorMac.mm:
2025         (WebCore::Editor::adjustedSelectionRange):
2026         * page/ContextMenuController.cpp:
2027         (WebCore::ContextMenuController::contextMenuItemSelected):
2028         * page/DOMSelection.cpp:
2029         (WebCore::DOMSelection::addRange):
2030         * page/DragController.cpp:
2031         (WebCore::selectElement):
2032         * page/EventHandler.cpp:
2033         (WebCore::EventHandler::dispatchMouseEvent):
2034         * page/Page.cpp:
2035         (WebCore::Page::findStringMatchingRanges):
2036         * page/TextIndicator.cpp:
2037         (WebCore::hasNonInlineOrReplacedElements):
2038         * rendering/RenderNamedFlowThread.cpp:
2039         (WebCore::RenderNamedFlowThread::getRanges):
2040
2041 2016-04-21  Chris Dumez  <cdumez@apple.com>
2042
2043         Drop [UsePointersEvenForNonNullableObjectArguments] from DOMURL
2044         https://bugs.webkit.org/show_bug.cgi?id=156797
2045
2046         Reviewed by Youenn Fablet.
2047
2048         * html/DOMURL.cpp:
2049         (WebCore::DOMURL::create):
2050         * html/DOMURL.h:
2051         * html/DOMURL.idl:
2052
2053 2016-04-21  Claudio Saavedra  <csaavedra@igalia.com>
2054
2055         [GTK][EFL] Move non-glib/gtk platform implementations out of platform/gtk
2056         https://bugs.webkit.org/show_bug.cgi?id=156847
2057
2058         Reviewed by Carlos Garcia Campos.
2059
2060         The Language and Logging implementation don't really need glib, so
2061         rework them and move them to a new platform/unix directory so that
2062         they can be shared among Unix ports.
2063
2064         * PlatformEfl.cmake: Use the unix version.
2065         * PlatformGTK.cmake: Same.
2066         * platform/efl/LanguageEfl.cpp: Removed.
2067         * platform/efl/LoggingEfl.cpp: Removed.
2068         * platform/unix/LanguageUnix.cpp: Renamed from Source/WebCore/platform/gtk/LanguageGtk.cpp.
2069         (WebCore::platformLanguage):
2070         (WebCore::platformUserPreferredLanguages):
2071         * platform/unix/LoggingUnix.cpp: Renamed from Source/WebCore/platform/gtk/LoggingGtk.cpp.
2072         (WebCore::logLevelString):
2073
2074 2016-04-21  Nan Wang  <n_wang@apple.com>
2075
2076         AX: stringForTextMarkerRange returning empty string for document range
2077         https://bugs.webkit.org/show_bug.cgi?id=156819
2078
2079         Reviewed by Chris Fleizach.
2080
2081         Set text marker data with CharacterOffset when VisiblePosition is having PositionIsAfterAnchor
2082         or PositionIsAfterChildren anchor type, so that the character offset corresponds to the anchored
2083         node.
2084
2085         Test: accessibility/mac/text-marker-string-for-document-range.html
2086
2087         * accessibility/AXObjectCache.cpp:
2088         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
2089
2090 2016-04-20  Chris Dumez  <cdumez@apple.com>
2091
2092         Crash under WebCore::TextIterator::subrange()
2093         https://bugs.webkit.org/show_bug.cgi?id=156809
2094         <rdar://problem/21102730>
2095
2096         Reviewed by Ryosuke Niwa.
2097
2098         TextIterator::rangeFromLocationAndLength() may return null. However, we
2099         failed to do a null check before calling TextIterator::subrange() with
2100         that range.
2101
2102         No new tests, do not know how to reproduce.
2103
2104         * editing/AlternativeTextController.cpp:
2105         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2106
2107 2016-04-20  Brady Eidson  <beidson@apple.com>
2108
2109         Modern IDB (Workers): Remove IDBRequest/IDBOpenDBRequest's requirement to get an IDBServerConnection around.
2110         https://bugs.webkit.org/show_bug.cgi?id=156826
2111
2112         Reviewed by Alex Christensen.
2113
2114         No new tests (No behavior change, existing tests pass).
2115
2116         This doesn't appear to do much but make things a little more complicated, but it's the first of a few 
2117         small pushes in the right direction.
2118         
2119         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2120         (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest):
2121         (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest):
2122         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
2123         (WebCore::IDBOpenDBRequest::onSuccess):
2124         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
2125         (WebCore::IDBOpenDBRequest::requestCompleted):
2126         (WebCore::IDBOpenDBRequest::createDeleteRequest): Deleted.
2127         (WebCore::IDBOpenDBRequest::createOpenRequest): Deleted.
2128         * Modules/indexeddb/IDBOpenDBRequest.h:
2129         
2130         * Modules/indexeddb/IDBRequest.cpp:
2131         (WebCore::IDBRequest::IDBRequest):
2132         (WebCore::IDBRequest::connectionToServer):
2133         * Modules/indexeddb/IDBRequest.h:
2134         (WebCore::IDBRequest::connection): Deleted.
2135         
2136         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2137         (WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
2138         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer):
2139         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
2140         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
2141         * Modules/indexeddb/client/IDBConnectionProxy.h:
2142         (WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier):
2143         
2144         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2145         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
2146         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2147
2148 2016-04-20  John Wilander  <wilander@apple.com>
2149
2150         Add Subresource Integrity as "Under consideration".
2151         https://bugs.webkit.org/show_bug.cgi?id=156800
2152
2153         Reviewed by Alexey Proskuryakov.
2154
2155         No new tests needed.
2156
2157         * features.json:
2158             Added an entry for Subresource Integrity.
2159
2160 2016-04-20  Anders Carlsson  <andersca@apple.com>
2161
2162         Get rid of a couple of uses of ApplicationCacheStorage::singleton()
2163         https://bugs.webkit.org/show_bug.cgi?id=156818
2164
2165         Reviewed by Geoffrey Garen.
2166
2167         * loader/appcache/ApplicationCache.cpp:
2168         (WebCore::ApplicationCache::addResource):
2169         * loader/appcache/ApplicationCacheGroup.h:
2170         (WebCore::ApplicationCacheGroup::storage):
2171         * testing/Internals.cpp:
2172         (WebCore::Internals::resetToConsistentState):
2173         (WebCore::Internals::setApplicationCacheOriginQuota):
2174
2175 2016-04-20  Brady Eidson  <beidson@apple.com>
2176
2177         Modern IDB (Workers): Introduce "IDBConnectionProxy" for future threading abstraction, and adopt it in IDBFactory.
2178         https://bugs.webkit.org/show_bug.cgi?id=156810
2179
2180         Reviewed by Alex Christensen.
2181
2182         No new tests (Covered by changes to existing tests).
2183
2184         Add the IDBConnectionProxy object, including the ability to replicate IDBFactory functionality:
2185         * Modules/indexeddb/client/IDBConnectionProxy.cpp: Added.
2186         (WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
2187         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
2188         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
2189         * Modules/indexeddb/client/IDBConnectionProxy.h: 
2190         
2191         Add pure virtual IDBConnectionProxy accessor:
2192         * dom/ScriptExecutionContext.h: 
2193
2194         Implement it:
2195         * dom/Document.cpp:
2196         (WebCore::Document::idbConnectionProxy):
2197         * dom/Document.h:
2198         
2199         Implement it:
2200         * workers/WorkerGlobalScope.cpp:
2201         (WebCore::WorkerGlobalScope::idbConnectionProxy):
2202         * workers/WorkerGlobalScope.h:
2203         
2204         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2205         (WebCore::DOMWindowIndexedDatabase::indexedDB):
2206
2207
2208         Don't keep a reference to IDBConnectionToServer, but rather get at the context's IDBConnectionProxy:
2209         * Modules/indexeddb/IDBFactory.cpp:
2210         (WebCore::IDBFactory::create):
2211         (WebCore::IDBFactory::IDBFactory):
2212         (WebCore::IDBFactory::open):
2213         (WebCore::IDBFactory::openInternal):
2214         (WebCore::IDBFactory::deleteDatabase):
2215         * Modules/indexeddb/IDBFactory.h:
2216         * Modules/indexeddb/IDBFactory.idl:
2217
2218         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
2219         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
2220
2221         * Modules/indexeddb/client/IDBConnectionToServer.h:
2222
2223         * inspector/InspectorIndexedDBAgent.cpp:
2224
2225         * CMakeLists.txt:
2226         * WebCore.xcodeproj/project.pbxproj:
2227
2228 2016-04-20  Chris Dumez  <cdumez@apple.com>
2229
2230         Use Optional<size_t> for OrderIterator::m_orderIndex instead of int
2231         https://bugs.webkit.org/show_bug.cgi?id=156796
2232
2233         Reviewed by Anders Carlsson.
2234
2235         Use Optional<size_t> for OrderIterator::m_orderIndex instead of int
2236         (with invalid value of -1). m_orderIndex a vector index and therefore
2237         is in the range of an unsigned (type used internally by Vector, even
2238         though the index is exposed as size_t). Therefore, assigning it to an
2239         int is unsafe as it may overflow.
2240
2241         This may fix <rdar://problem/23410338> which is a top crasher.
2242
2243         * rendering/OrderIterator.cpp:
2244         (WebCore::OrderIterator::next):
2245         (WebCore::OrderIterator::reset):
2246         * rendering/OrderIterator.h:
2247
2248 2016-04-20  Chris Dumez  <cdumez@apple.com>
2249
2250         Crash under needsAppleMailPaginationQuirk()
2251         https://bugs.webkit.org/show_bug.cgi?id=156806
2252         <rdar://problem/23323479>
2253
2254         Reviewed by Simon Fraser.
2255
2256         Add check for element()->hasID() before calling element()->idForStyleResolution()
2257         so that we don't dereference a potentially null element()->elementData().
2258         Also stop repeatedly atomizing "messageContentContainer" and leverage
2259         the operator==(const AtomicString&, const char*) instead for performance.
2260
2261         * rendering/RenderBlockFlow.cpp:
2262         (WebCore::needsAppleMailPaginationQuirk):
2263
2264 2016-04-20  Brady Eidson  <beidson@apple.com>
2265
2266         Attempt to fix non-INDEXED_DATABASE_IN_WORKERS builds after r199779
2267
2268         * testing/InternalSettings.cpp:
2269         (WebCore::InternalSettings::Backup::Backup):
2270         (WebCore::InternalSettings::Backup::restoreTo):
2271         (WebCore::InternalSettings::setIndexedDBWorkersEnabled):
2272         * testing/InternalSettings.h:
2273
2274 2016-04-20  Chris Dumez  <cdumez@apple.com>
2275
2276         Potential overflow in RenderLayer::hitTestList()
2277         https://bugs.webkit.org/show_bug.cgi?id=156804
2278
2279         Reviewed by Simon Fraser.
2280
2281         Use size_t type instead of int to iterate over the Vector to make sure
2282         we don't overflow. This is a speculative fix for <rdar://problem/23249479>.
2283
2284         * rendering/RenderLayer.cpp:
2285         (WebCore::RenderLayer::hitTestList):
2286
2287 2016-04-20  Brady Eidson  <beidson@apple.com>
2288
2289         Modern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disabled in RuntimeEnabledFeatures.
2290         https://bugs.webkit.org/show_bug.cgi?id=156782
2291
2292         Reviewed by Alex Christensen.
2293
2294         Test: storage/indexeddb/modern/workers-disabled.html
2295               storage/indexeddb/modern/workers-enable.html
2296
2297         * Configurations/FeatureDefines.xcconfig:
2298
2299         ScriptExecutionContext shouldn't really be supplementable:
2300         * dom/ScriptExecutionContext.h:
2301
2302         WorkerGlobalScope should be supplementable.
2303         Also modernize this archaic header (pragma once, and re-indent):
2304         * workers/WorkerGlobalScope.h:
2305         
2306         Update for WorkerGlobalScope now being directly supplementable:
2307         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
2308         (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
2309         (WebCore::WorkerGlobalScopeIndexedDatabase::from):
2310         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
2311         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
2312         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:
2313         * Modules/notifications/WorkerGlobalScopeNotifications.cpp:
2314         (WebCore::WorkerGlobalScopeNotifications::WorkerGlobalScopeNotifications):
2315         (WebCore::WorkerGlobalScopeNotifications::from):
2316         (WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
2317         * Modules/notifications/WorkerGlobalScopeNotifications.h:
2318         
2319         Expose IndexedDBWorkers to RuntimeEnabledFeatures:
2320         * bindings/generic/RuntimeEnabledFeatures.cpp:
2321         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2322         * bindings/generic/RuntimeEnabledFeatures.h:
2323         (WebCore::RuntimeEnabledFeatures::setIndexedDBWorkersEnabled):
2324         (WebCore::RuntimeEnabledFeatures::indexedDBWorkersEnabled):
2325
2326         Expose IndexedDBWorkers to InternalSettings:
2327         * testing/InternalSettings.cpp:
2328         (WebCore::InternalSettings::Backup::Backup):
2329         (WebCore::InternalSettings::Backup::restoreTo):
2330         (WebCore::InternalSettings::setIndexedDBWorkersEnabled):
2331         * testing/InternalSettings.h:
2332         * testing/InternalSettings.idl:
2333
2334 2016-04-20  Dave Hyatt  <hyatt@apple.com>
2335
2336         Hangable punctuation measurement using the wrong indices.
2337         https://bugs.webkit.org/show_bug.cgi?id=155899
2338
2339         Reviewed by Simon Fraser.
2340
2341         New tests in fast/text.
2342
2343         * rendering/RenderBlockFlow.cpp:
2344         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
2345         * rendering/RenderText.cpp:
2346         (WebCore::RenderText::hangablePunctuationStartWidth):
2347         (WebCore::RenderText::hangablePunctuationEndWidth):
2348         (WebCore::RenderText::isHangableStopOrComma):
2349
2350 2016-04-20  Chris Dumez  <cdumez@apple.com>
2351
2352         Drop [UsePointersEvenForNonNullableObjectArguments] from several Canvas interfaces
2353         https://bugs.webkit.org/show_bug.cgi?id=156781
2354
2355         Reviewed by Darin Adler.
2356
2357         * html/canvas/CanvasRenderingContext2D.cpp:
2358         (WebCore::CanvasRenderingContext2D::fill):
2359         (WebCore::CanvasRenderingContext2D::stroke):
2360         (WebCore::CanvasRenderingContext2D::clip):
2361         (WebCore::CanvasRenderingContext2D::isPointInPath):
2362         (WebCore::CanvasRenderingContext2D::isPointInStroke):
2363         (WebCore::size):
2364         (WebCore::CanvasRenderingContext2D::drawImage):
2365         (WebCore::CanvasRenderingContext2D::drawImageFromRect):
2366         (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
2367         * html/canvas/CanvasRenderingContext2D.h:
2368         * html/canvas/CanvasRenderingContext2D.idl:
2369         * html/canvas/DOMPath.h:
2370         * html/canvas/DOMPath.idl:
2371         * html/canvas/WebGLDebugShaders.cpp:
2372         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
2373         * html/canvas/WebGLDebugShaders.h:
2374         * html/canvas/WebGLDebugShaders.idl:
2375
2376 2016-04-20  Chris Dumez  <cdumez@apple.com>
2377
2378         Drop [UsePointersEvenForNonNullableObjectArguments] from WebAudio
2379         https://bugs.webkit.org/show_bug.cgi?id=156777
2380
2381         Reviewed by Darin Adler.
2382
2383         Drop [UsePointersEvenForNonNullableObjectArguments] from WebAudio and
2384         modernize the interface a bit.
2385
2386         There is no major Web-exposed behavioral change except for
2387         the exception type thrown when passing null (now always TypeError).
2388         Tests were updated to add coverage for this.
2389
2390         * Modules/webaudio/AsyncAudioDecoder.cpp:
2391         (WebCore::AsyncAudioDecoder::decodeAsync):
2392         (WebCore::AsyncAudioDecoder::DecodingTask::DecodingTask):
2393         (WebCore::AsyncAudioDecoder::DecodingTask::decode): Deleted.
2394         * Modules/webaudio/AsyncAudioDecoder.h:
2395         (WebCore::AsyncAudioDecoder::DecodingTask::audioData):
2396         * Modules/webaudio/AudioContext.cpp:
2397         (WebCore::AudioContext::lazyInitialize):
2398         (WebCore::AudioContext::createBuffer):
2399         (WebCore::AudioContext::decodeAudioData):
2400         (WebCore::AudioContext::createBufferSource):
2401         (WebCore::AudioContext::createMediaElementSource):
2402         (WebCore::AudioContext::createMediaStreamSource):
2403         (WebCore::AudioContext::createMediaStreamDestination):
2404         (WebCore::AudioContext::createScriptProcessor):
2405         (WebCore::AudioContext::createBiquadFilter):
2406         (WebCore::AudioContext::createWaveShaper):
2407         (WebCore::AudioContext::createPanner):
2408         (WebCore::AudioContext::createConvolver):
2409         (WebCore::AudioContext::createDynamicsCompressor):
2410         (WebCore::AudioContext::createAnalyser):
2411         (WebCore::AudioContext::createGain):
2412         (WebCore::AudioContext::createDelay):
2413         (WebCore::AudioContext::createChannelSplitter):
2414         (WebCore::AudioContext::createChannelMerger):
2415         (WebCore::AudioContext::createOscillator):
2416         (WebCore::AudioContext::createPeriodicWave):
2417         (WebCore::AudioContext::derefFinishedSourceNodes):
2418         (WebCore::AudioContext::refNode):
2419         (WebCore::AudioContext::derefNode):
2420         (WebCore::AudioContext::notifyNodeFinishedProcessing): Deleted.
2421         (WebCore::AudioContext::derefUnfinishedSourceNodes): Deleted.
2422         (WebCore::AudioContext::lock): Deleted.
2423         * Modules/webaudio/AudioContext.h:
2424         * Modules/webaudio/AudioContext.idl:
2425         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
2426         (WebCore::MediaElementAudioSourceNode::create):
2427         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
2428         (WebCore::MediaElementAudioSourceNode::process):
2429         * Modules/webaudio/MediaElementAudioSourceNode.h:
2430         (WebCore::MediaElementAudioSourceNode::mediaElement):
2431         * Modules/webaudio/OscillatorNode.idl:
2432
2433 2016-04-20  Brady Eidson  <beidson@apple.com>
2434
2435         Addressing additional review feedback for:
2436         Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
2437         https://bugs.webkit.org/show_bug.cgi?id=156760
2438
2439         * Modules/indexeddb/IDBVersionChangeEvent.h:
2440
2441 2016-04-20  Frederic Wang  <fwang@igalia.com>
2442
2443         Use OpenType MATH fonts by default
2444         https://bugs.webkit.org/show_bug.cgi?id=133603
2445
2446         Reviewed by Alejandro G. Castro.
2447
2448         No new tests. This is already tested by pixel tests like roots.xhtml.
2449         However, new math fonts are not used during test execution.
2450
2451         * css/mathml.css:
2452         (math): We use only a list of known OpenType fonts with a MATH table but keep some pre-installed fallback fonts for OS X and iOS.
2453
2454 2016-04-20  Claudio Saavedra  <csaavedra@igalia.com>
2455
2456         [GTK] Move GTK+-independent platform code to platform/glib
2457         https://bugs.webkit.org/show_bug.cgi?id=156787
2458
2459         Reviewed by Carlos Garcia Campos.
2460
2461         There is plenty of code in platform/gtk that is independent from the GTK+ library.
2462         Move those files to platform/glib so that they can be reused by other GLib-based ports.
2463
2464         Also clean some style warnings in those files.
2465
2466         * PlatformGTK.cmake: Move the files.
2467         * platform/glib/EventLoopGlib.cpp: Renamed from Source/WebCore/platform/gtk/EventLoopGtk.cpp.
2468         (WebCore::EventLoop::cycle):
2469         * platform/glib/FileSystemGlib.cpp: Renamed from Source/WebCore/platform/gtk/FileSystemGtk.cpp.
2470         (WebCore::filenameToString):
2471         (WebCore::unescapedFilename):
2472         (WebCore::fileSystemRepresentation):
2473         (WebCore::filenameForDisplay):
2474         (WebCore::fileExists):
2475         (WebCore::deleteFile):
2476         (WebCore::deleteEmptyDirectory):
2477         (WebCore::getFileStat):
2478         (WebCore::getFileSize):
2479         (WebCore::getFileCreationTime):
2480         (WebCore::getFileModificationTime):
2481         (WebCore::getFileMetadata):
2482         (WebCore::pathByAppendingComponent):
2483         (WebCore::makeAllDirectories):
2484         (WebCore::homeDirectoryPath):
2485         (WebCore::pathGetFileName):
2486         (WebCore::applicationDirectoryPath):
2487         (WebCore::sharedResourcesPath):
2488         (WebCore::getVolumeFreeSizeForPath):
2489         (WebCore::directoryName):
2490         (WebCore::listDirectory):
2491         (WebCore::openTemporaryFile):
2492         (WebCore::openFile):
2493         (WebCore::closeFile):
2494         (WebCore::seekFile):
2495         (WebCore::writeToFile):
2496         (WebCore::readFromFile):
2497         (WebCore::unloadModule):
2498         (WebCore::hardLinkOrCopyFile):
2499         * platform/glib/GamepadsGlib.cpp: Renamed from Source/WebCore/platform/gtk/GamepadsGtk.cpp.
2500         (WebCore::GamepadDeviceGlib::GamepadDeviceGlib):
2501         (WebCore::GamepadDeviceGlib::~GamepadDeviceGlib):
2502         (WebCore::GamepadDeviceGlib::readCallback):
2503         (WebCore::GamepadsGlib::GamepadsGlib):
2504         (WebCore::GamepadsGlib::~GamepadsGlib):
2505         (WebCore::GamepadsGlib::registerDevice):
2506         (WebCore::GamepadsGlib::unregisterDevice):
2507         (WebCore::GamepadsGlib::updateGamepadList):
2508         (WebCore::GamepadsGlib::onUEventCallback):
2509         (WebCore::GamepadsGlib::isGamepadDevice):
2510         (WebCore::sampleGamepads):
2511         * platform/glib/SharedBufferGlib.cpp: Renamed from Source/WebCore/platform/gtk/SharedBufferGtk.cpp.
2512         (WebCore::SharedBuffer::createFromReadingFile):
2513
2514 2016-04-20  Frederic Wang  <fwang@igalia.com>
2515
2516         Refactor RenderMathMLSpace to avoid using flexbox
2517         https://bugs.webkit.org/show_bug.cgi?id=155168
2518
2519         Reviewed by Martin Robinson.
2520
2521         No new tests, already covered by existing tests. The behavior of mspace-prefered-width-expected is not specified by the MathML recommendation, we update that test to match our new behavior.
2522
2523         * rendering/mathml/RenderMathMLSpace.cpp: Implement layout functions without passing by flebox.
2524         (WebCore::RenderMathMLSpace::computePreferredLogicalWidths): Implement this function.
2525         (WebCore::RenderMathMLSpace::layoutBlock): Implement this function.
2526         (WebCore::RenderMathMLSpace::computeIntrinsicLogicalWidths): Deleted.
2527         (WebCore::RenderMathMLSpace::updateLogicalWidth): Deleted.
2528         (WebCore::RenderMathMLSpace::updateLogicalHeight): Deleted.
2529         * rendering/mathml/RenderMathMLSpace.h: Update function declarations.
2530
2531 2016-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2532
2533         [Cairo] Crash in GraphicsContext::drawFocusRing when painting is disabled
2534         https://bugs.webkit.org/show_bug.cgi?id=156785
2535
2536         Reviewed by Žan Doberšek.
2537
2538         This happens for example when view state changes to focus and paint is called from
2539         FrameView::updateControlTints() with a graphics context that doesn't have a platform context. Layout test
2540         fast/images/image-map-outline-with-scale-transform.html sometimes crashes because of this.
2541
2542         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2543         (WebCore::GraphicsContext::drawFocusRing): Return early if painting is disabled.
2544
2545 2016-04-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2546
2547         REGRESSION(r198782): SHOULD NEVER BE REACHED failure in ImageSource::setData since r198782
2548         https://bugs.webkit.org/show_bug.cgi?id=156690
2549
2550         Reviewed by Michael Catanzaro.
2551
2552         The assertion is wrong, because it assumes that ImageDecoder::create() always returns a valid pointer, which is
2553         only true for the CG implementation. The non CG implementation can return nullptr if there isn't enough data to
2554         figure out the image format or if the image format is not supported. This is causing several crashes in the
2555         debug bots.
2556
2557         * platform/graphics/ImageSource.cpp:
2558         (WebCore::ImageSource::setData): Remove the invalid ASSERT and return early if we fail to create the decoder.
2559         (WebCore::ImageSource::ensureDecoderIsCreated): Deleted.
2560         * platform/graphics/ImageSource.h:
2561
2562 2016-04-19  Brent Fulgham  <bfulgham@apple.com>
2563
2564         Remove remaining bits of dynamic <link> rel='icon' loading
2565         https://bugs.webkit.org/show_bug.cgi?id=156727
2566
2567         Reviewed by Darin Adler.
2568
2569         Don't call 'shouldLoadLink' for 'icon' link types. It performs no
2570         useful checks for 'icon' types, and emits the non-standard
2571         'onbeforeload' event.
2572
2573         This work finishes up https://webkit.org/b/153151, where we removed
2574         FrameLoaderClient::dispatchDidChangeIcons() and related code.
2575
2576         Test: webarchive/test-link-rel-subresource-beforeload.html
2577
2578         * loader/LinkLoader.cpp:
2579         (WebCore::LinkLoader::loadLink): Remove unneeded call to 'shouldLoadLink'.
2580
2581 2016-04-19  Chris Dumez  <cdumez@apple.com>
2582
2583         AudioBufferSourceNode.buffer should be nullable
2584         https://bugs.webkit.org/show_bug.cgi?id=156769
2585
2586         Reviewed by Darin Adler.
2587
2588         AudioBufferSourceNode.buffer should be nullable as per the
2589         specification:
2590         https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode
2591
2592         Our implementation was initially returning null when getting
2593         AudioBufferSourceNode.buffer, which is correct. However, it would
2594         throw a TypeError when trying to set the attribute to null. Our
2595         implementation setter actually supported setting the buffer to
2596         null but the custom bindings for the setter would not.
2597
2598         This patch does the following:
2599         - Get rid of the custom bindings for the AudioBufferSourceNode.buffer
2600           setter. We can have the bindings generator generate the same code
2601           by using [StrictTypeChecking]. The custom bindinds were also throwing
2602           a TypeError if the input AudioBuffer had too many channels but this
2603           does not seem to be possible.
2604         - Mark AudioBufferSourceNode.buffer as nullable in the IDL so that
2605           we no longer throw when the JS tries to assign null, but instead
2606           calls AudioBufferSourceNode::setBuffer(nullptr)
2607
2608         No new test, updated webaudio/audiobuffersource-channels.html
2609
2610         * CMakeLists.txt:
2611         * Modules/webaudio/AudioBufferSourceNode.cpp:
2612         (WebCore::AudioBufferSourceNode::setBuffer):
2613         * Modules/webaudio/AudioBufferSourceNode.h:
2614         * Modules/webaudio/AudioBufferSourceNode.idl:
2615         * Modules/webaudio/AudioContext.h:
2616         * WebCore.xcodeproj/project.pbxproj:
2617         * bindings/js/JSAudioBufferSourceNodeCustom.cpp: Removed.
2618
2619 2016-04-19  Brady Eidson  <beidson@apple.com>
2620
2621         Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
2622         https://bugs.webkit.org/show_bug.cgi?id=156760
2623
2624         Reviewed by Darin Adler (and looked over by Chris Dumez and Alex Christensen).
2625
2626         Test: storage/indexeddb/modern/idbversionchangeevent-constructor.html
2627
2628         Add WorkerGlobalScopeConstructors to the xcodeproj:
2629         * WebCore.xcodeproj/project.pbxproj:
2630
2631         Remove the completely irrelevant webkit* prefixed constructors from DOMWindow:
2632         * page/DOMWindow.idl:
2633
2634         Remove the poor way most objects were exposed on the WorkerGlobalScope:
2635         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:
2636
2637         Expose most of the objects on the WorkerGlobalScope the correct way:
2638         * Modules/indexeddb/IDBCursor.idl:
2639         * Modules/indexeddb/IDBCursorWithValue.idl:
2640         * Modules/indexeddb/IDBDatabase.idl:
2641         * Modules/indexeddb/IDBFactory.idl:
2642         * Modules/indexeddb/IDBIndex.idl:
2643         * Modules/indexeddb/IDBKeyRange.idl:
2644         * Modules/indexeddb/IDBObjectStore.idl:
2645         * Modules/indexeddb/IDBOpenDBRequest.idl:
2646         * Modules/indexeddb/IDBRequest.idl:
2647         * Modules/indexeddb/IDBTransaction.idl:
2648
2649         Make IDBVersionChangeEvent constructible:        
2650         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
2651         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
2652         (WebCore::IDBVersionChangeEvent::newVersion): Deleted.
2653         * Modules/indexeddb/IDBVersionChangeEvent.h:
2654         * Modules/indexeddb/IDBVersionChangeEvent.idl:
2655
2656         * bindings/js/JSDictionary.h:
2657         (WebCore::JSDictionary::convertValue): Add a templated form of convertValue that
2658           handles Optional<>s.
2659
2660 2016-04-19  Alex Christensen  <achristensen@webkit.org>
2661
2662         Build fix after r199738
2663
2664         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
2665         (WebCore::GraphicsContext3D::GraphicsContext3D):
2666         * platform/graphics/win/GraphicsContext3DWin.cpp:
2667         (WebCore::GraphicsContext3D::GraphicsContext3D):
2668
2669 2016-04-19  Keith Miller  <keith_miller@apple.com>
2670
2671         ObjcInstance::stringValue should not call NSObject's description method
2672         https://bugs.webkit.org/show_bug.cgi?id=156758
2673
2674         Reviewed by Geoffrey Garen.
2675
2676         This patch makes it so that we no longer call NSObject's description method without first
2677         swizzling the implementation for WebScriptObjects. We restore the incomming NSObject's
2678         description method once we have finished generating the string.
2679
2680         Test: platform/mac/fast/objc/webScriptObject-does-not-call-description-on-nsobject.html
2681
2682         * bridge/objc/objc_instance.mm:
2683         (swizzleNSObjectDescription):
2684         (ObjcInstance::stringValue):
2685
2686 2016-04-19  Alex Christensen  <achristensen@webkit.org>
2687
2688         Update ANGLE
2689         https://bugs.webkit.org/show_bug.cgi?id=156755
2690
2691         Reviewed by Dean Jackson.
2692
2693         * CMakeLists.txt:
2694         * platform/graphics/ANGLEWebKitBridge.h:
2695         (WebCore::ANGLEWebKitBridge::getResources):
2696         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2697         (WebCore::GraphicsContext3D::GraphicsContext3D):
2698         Continue to compile successfully with new ANGLE.
2699
2700 2016-04-19  Chris Dumez  <cdumez@apple.com>
2701
2702         Mark more classes as WTF_MAKE_FAST_ALLOCATED
2703         https://bugs.webkit.org/show_bug.cgi?id=156732
2704
2705         Reviewed by Darin Adler.
2706
2707         * css/CSSImageGeneratorValue.h:
2708         * css/DocumentRuleSets.h:
2709         * css/MediaQueryMatcher.h:
2710         * css/RuleFeature.h:
2711         * css/StyleResolver.h:
2712         * dom/ActiveDOMCallbackMicrotask.h:
2713         * dom/DocumentSharedObjectPool.h:
2714         * dom/MutationObserver.cpp:
2715         * dom/MutationObserverInterestGroup.h:
2716         * dom/MutationObserverRegistration.h:
2717         * dom/ScriptExecutionContext.cpp:
2718         * dom/SlotAssignment.h:
2719         * html/HTMLCollection.h:
2720         * html/canvas/CanvasRenderingContext2D.cpp:
2721         * html/parser/HTMLToken.h:
2722         * html/parser/XSSAuditorDelegate.h:
2723         * loader/FrameLoader.cpp:
2724         * loader/SubframeLoader.h:
2725         * page/AutoscrollController.h:
2726         * page/csp/ContentSecurityPolicySource.h:
2727         * platform/cf/RunLoopObserver.h:
2728         * platform/graphics/FloatQuad.h:
2729         * platform/graphics/FloatRoundedRect.h:
2730         * platform/graphics/IntSize.h:
2731         * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
2732         * platform/graphics/cg/ImageDecoderCG.h:
2733         * platform/graphics/cocoa/IOSurface.h:
2734         * platform/graphics/displaylists/DisplayList.h:
2735         * platform/graphics/mac/ComplexTextController.h:
2736         * platform/graphics/mac/FontCustomPlatformData.h:
2737         * platform/mac/PowerObserverMac.h:
2738         * platform/network/DataURLDecoder.cpp:
2739         * platform/text/PlatformLocale.h:
2740         * rendering/TextAutosizer.h:
2741         * style/StyleUpdate.h:
2742         * xml/XMLHttpRequestUpload.h:
2743
2744 2016-04-18  Ada Chan  <adachan@apple.com>
2745
2746         Context menu items related to fullscreen should be specific to standard fullscreen
2747         https://bugs.webkit.org/show_bug.cgi?id=156723
2748         <rdar://problem/25452632>
2749
2750         Reviewed by Darin Adler.
2751
2752         Introduce HTMLMediaElement::isStandardFullscreen() that the HitTestResult code can use
2753         when handling the validation and selection of fullscreen-related context menu items.
2754
2755         * html/HTMLMediaElement.cpp:
2756         (WebCore::HTMLMediaElement::isStandardFullscreen):
2757         (WebCore::HTMLMediaElement::toggleStandardFullscreenState):
2758         Renamed to make it clear that it's for toggling standard fullscreen. Call the new
2759         HTMLMediaElement::isStandardFullscreen().
2760         * html/HTMLMediaElement.h:
2761         * rendering/HitTestResult.cpp:
2762         (WebCore::HitTestResult::mediaIsInFullscreen):
2763         Use HTMLMediaElement::isStandardFullscreen().
2764         (WebCore::HitTestResult::toggleMediaFullscreenState):
2765         Call the renamed HTMLMediaElement::toggleStandardFullscreenState().
2766
2767 2016-04-19  Brady Eidson  <beidson@apple.com>
2768
2769         Modern IDB: ObjectStore Blob Support.
2770         https://bugs.webkit.org/show_bug.cgi?id=143193
2771
2772         Reviewed by Alex Christensen.
2773
2774         Tests: imported/blink/storage/indexeddb/blob-basics-metadata.html
2775                imported/blink/storage/indexeddb/blob-delete-objectstore-db.html
2776                imported/blink/storage/indexeddb/blob-valid-after-deletion.html
2777                imported/blink/storage/indexeddb/blob-valid-before-commit.html
2778                imported/blink/storage/indexeddb/empty-blob-file.html
2779                storage/indexeddb/modern/blob-simple.html
2780
2781         Most of the work has been done already.
2782         
2783         Besides a handful of tweaks to that work, all this really does is remove the clause
2784         that prevents blob URLs from going into the database.
2785
2786         * Modules/indexeddb/IDBObjectStore.cpp:
2787         (WebCore::IDBObjectStore::putOrAdd): Only disallow blobs if private browsing is enabled
2788           (Making that work is already covered by another bug)
2789           
2790         * Modules/indexeddb/IDBTransaction.cpp:
2791         (WebCore::IDBTransaction::putOrAddOnServer):
2792
2793         * Modules/indexeddb/IDBValue.cpp:
2794         (WebCore::IDBValue::IDBValue):
2795
2796         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2797         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
2798         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
2799
2800         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2801         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
2802
2803         * platform/network/BlobRegistryImpl.cpp:
2804         (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
2805
2806         * platform/sql/SQLiteFileSystem.cpp:
2807         (WebCore::SQLiteFileSystem::deleteDatabaseFile): Delete all database-related files 
2808           now that we use WAL mode.
2809
2810 2016-04-19  Sergio Villar Senin  <svillar@igalia.com>
2811
2812         [css-grid] Use the margin box for non-auto minimum sizes
2813         https://bugs.webkit.org/show_bug.cgi?id=156711
2814
2815         Reviewed by Darin Adler.
2816
2817         When computing the min-size of items with non-auto minimum height/width we are incorrectly
2818         returning the size of the border box, and thus incorrectly ignoring the margins of the item.
2819
2820         This is a follow up patch of r199153 were we added the missing border and paddings for
2821         heights. Contrary to that, we were not including margins for both axis.
2822
2823         This CL requires 3 different interrelated changes:
2824         - Add the margins to the min-size returned by minSizeForChild (might require a layout).
2825         - Refactor and extract width computations from logicalHeightForChild(); not totally
2826         mandatory but pretty logical and helpful.
2827         - Use a new update function to isolate the computation of the override width.
2828
2829         Test: fast/css-grid-layout/min-width-margin-box.html
2830
2831         * rendering/RenderBox.cpp:
2832         (WebCore::RenderBox::computeInlineDirectionMargins): Added const to a parameter.
2833         * rendering/RenderBox.h:
2834         * rendering/RenderGrid.cpp:
2835         (WebCore::RenderGrid::computeTrackSizesForDirection): Initialize the sizingOperation.
2836         (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Ditto.
2837         (WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
2838         (WebCore::RenderGrid::logicalHeightForChild): Renamed from logicalContentHeightForChild as
2839         it no longer returns the content size but the outer size.
2840         (WebCore::RenderGrid::minSizeForChild):
2841         (WebCore::RenderGrid::updateOverrideContainingBlockContentLogicalWidthForChild): Extracted
2842         from logicalHeightForChild().
2843         (WebCore::RenderGrid::minContentForChild): Update override width if needed.
2844         (WebCore::RenderGrid::maxContentForChild): Ditto.
2845         (WebCore::RenderGrid::computeMarginLogicalSizeForChild): Generalized from
2846         computeMarginLogicalHeightForChild(), it can now compute also margins for the inline
2847         direction.
2848         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
2849         (WebCore::RenderGrid::logicalContentHeightForChild): Deleted.
2850         (WebCore::RenderGrid::computeMarginLogicalHeightForChild): Deleted.
2851         * rendering/RenderGrid.h:
2852
2853 2016-04-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2854
2855         [Cairo] GraphicsContext::drawFocusRing methods are not consistent to each other
2856         https://bugs.webkit.org/show_bug.cgi?id=156742
2857
2858         Reviewed by Martin Robinson.
2859
2860         We are rendering the focus ring differently depending on whether a path is used or a vector of rectangles. This
2861         is causing that some reftests fail because they assume we always render the focus ring the same way. For example
2862         fast/images/image-map-outline-in-positioned-container.html, when rendering the test
2863         GraphicsContext::drawFocusRing is called with a path, and when rendering the reference it's called with a vector
2864         of rectangles, producing different results.
2865
2866         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2867         (WebCore::GraphicsContext::drawFocusRing): When receiving a vector of rectangles, build a Path from the given
2868         rectangles and call drawFocusRing() with the built path to ensure consistency.
2869
2870 2016-04-19  Antti Koivisto  <antti@apple.com>
2871
2872         Move FontSelectorClient to a file of its own
2873         https://bugs.webkit.org/show_bug.cgi?id=156738
2874
2875         Reviewed by Carlos Garcia Campos.
2876
2877         So modifying FontSelector does not trigger world rebuild via Document.h.
2878
2879         * WebCore.xcodeproj/project.pbxproj:
2880         * css/CSSFontSelector.cpp:
2881         * dom/Document.h:
2882         * html/canvas/CanvasRenderingContext2D.h:
2883         * platform/graphics/FontSelector.h:
2884         (WebCore::FontSelectorClient::~FontSelectorClient): Deleted.
2885         * platform/graphics/FontSelectorClient.h: Added.
2886         (WebCore::FontSelectorClient::~FontSelectorClient):
2887
2888 2016-04-19  Joanmarie Diggs  <jdiggs@igalia.com>
2889
2890         [GTK] accessibility/gtk/entry-and-password.html is failing since r194847
2891         https://bugs.webkit.org/show_bug.cgi?id=153062
2892
2893         Reviewed by Carlos Garcia Campos.
2894
2895         The changes in r194847 include using WebCore's rendering for the CapsLock indicator.
2896         As a side effect, password inputs gained a TextControlInnerTextElement child from
2897         the Shadow DOM. If we include that child in the accessibility tree, the child will
2898         emit focus and text notifications that suggest the user is no longer in the control.
2899         This can be especially problematic for screen reader users with key echo enabled
2900         when typing in a password input. To fix this, prune TextControlInnerTextElement
2901         children from the accessibility tree for ATK.
2902
2903         No new tests as existing coverage caught this regression. Also modified the
2904         auto-fill-crash.html test whose expectations include the children count for
2905         a text input.
2906
2907         * accessibility/atk/AccessibilityObjectAtk.cpp:
2908         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
2909
2910 2016-04-18  Brady Eidson  <beidson@apple.com>
2911
2912         Modern IDB (Blob support): When reading Blobs from the database, grant the Networking process sandbox access to the files.
2913         https://bugs.webkit.org/show_bug.cgi?id=156640
2914
2915         Reviewed by Alex Christensen.
2916
2917         No new tests (No change in behavior, as blobs in IDB are not yet enabled,
2918                       but when they are enabled testing will cover this).
2919
2920         * Modules/indexeddb/shared/IDBResultData.h: Export some stuff
2921         
2922         * fileapi/ThreadableBlobRegistry.cpp:
2923         (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): Account for 
2924           BlobRegistry change described below.
2925         
2926         * platform/network/BlobRegistry.h: Change registerBlobURLOptionallyFileBacked to take a 
2927           BlobDataFileReference instead of a raw path, to allow WK2 to include a sandbox extension.
2928         
2929         * platform/network/BlobRegistryImpl.cpp:
2930         (WebCore::BlobRegistryImpl::registerBlobURL): Account for BlobRegistry change described above.
2931         (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked): Use the passed in 
2932           BlobDataFileHandle, and also register the BlobResourceHandle constructor.
2933         * platform/network/BlobRegistryImpl.h:
2934
2935 2016-04-18  Alex Christensen  <achristensen@webkit.org>
2936
2937         Fix iOS build after r199701
2938
2939         * platform/ios/WebAVPlayerController.mm:
2940
2941 2016-04-18  Darin Adler  <darin@apple.com>
2942
2943         Updated binding test result to reflect the change to not use Deprecated::ScriptValue.
2944
2945         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated with new script.
2946
2947 2016-04-18  Darin Adler  <darin@apple.com>
2948
2949         Remove all use of Deprecated::ScriptValue in generated bindings
2950         https://bugs.webkit.org/show_bug.cgi?id=156706
2951
2952         Reviewed by Brady Eidson.
2953
2954         * Modules/indexeddb/IDBCursor.idl: Removed unneeded [ImplementationReturnType=JSValue].
2955         * Modules/indexeddb/IDBCursorWithValue.idl: Ditto.
2956
2957         * Modules/indexeddb/IDBKeyRange.cpp:
2958         (WebCore::IDBKeyRange::lowerValue): Deleted.
2959         (WebCore::IDBKeyRange::upperValue): Deleted.
2960         (WebCore::IDBKeyRange::only): Changed to take ExecState since the old code just used
2961         the ScriptExecutionContext to get back to the (potentially wrong) ExecState. Also kept
2962         one overload that takes ScriptExecutionContext because I could not change all callers.
2963         (WebCore::IDBKeyRange::lowerBound): Ditto.
2964         (WebCore::IDBKeyRange::upperBound): Ditto.
2965         (WebCore::IDBKeyRange::bound): Ditto.
2966
2967         * Modules/indexeddb/IDBKeyRange.h: Updated for above.
2968
2969         * Modules/indexeddb/IDBKeyRange.idl: Use [ImplementationReturnType=IDBKey].
2970         Use ScriptState instead of ScriptExecutionContext.
2971
2972         * Modules/streams/ReadableStreamSource.h: Take JSValue instead of Deprecated::ScriptValue
2973         for the ignored argument to the cancel function.
2974
2975         * bindings/js/IDBBindingUtilities.cpp:
2976         (WebCore::toJS): Renamed idbKeyToJSValue to this, the traditional name used in the
2977         bindings generator for all these functions. Also changed to take references.
2978         (WebCore::injectIDBKeyIntoScriptValue): Updated to call with the new name and types.
2979         (WebCore::idbKeyDataToScriptValue): Ditto.
2980
2981         * bindings/js/IDBBindingUtilities.h: Added declaration of toJS for IDBKey.
2982
2983         * bindings/scripts/CodeGeneratorJS.pm: Use JSC::JSValue instead of Deprecated::ScriptValue
2984         for the "any" type.
2985         (JSValueToNative): Just return the value with no transformation when type is "any".
2986         (NativeToJSValue): Changed default behavior for "any" to just pass the value as is with
2987         no transfomration. Removed unused ImplementationReturnType case for inside Document.
2988         Removed JSValue case since it's the default now. Added IDBKey case that matches the
2989         IDBKeyPath case (still wondering if we can do those without an attribute). Removed bogus
2990         second check for type "any".
2991
2992 2016-04-18  Martin Robinson  <mrobinson@igalia.com>
2993
2994         [GTK] Possible off-by-one in hyphenation code
2995         https://bugs.webkit.org/show_bug.cgi?id=156661
2996
2997         Reviewed by Michael Catanzaro.
2998
2999         No new tests. This is covered by older tests.
3000
3001         * platform/text/hyphen/HyphenationLibHyphen.cpp:
3002         (WebCore::lastHyphenLocation): Fix an off by one error in hyphen location.
3003
3004 2016-04-18  Eric Carlson  <eric.carlson@apple.com>
3005
3006         [OSX] AVKit is not available on all systems
3007         https://bugs.webkit.org/show_bug.cgi?id=156724
3008         <rdar://problem/25501587>
3009
3010         Reviewed by Dean Jackson.
3011
3012         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Add _OPTIONAL to all
3013           AVKit softlink macros.
3014         * platform/ios/WebAVPlayerController.mm: Ditto.
3015         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm: Ditto.
3016         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Ditto.
3017         * platform/mac/WebPlaybackSessionInterfaceMac.mm: Ditto.
3018         * platform/mac/WebVideoFullscreenInterfaceMac.mm: Ditto.
3019
3020 2016-04-18  Gavin Barraclough  <barraclough@apple.com>
3021
3022         WebKit should adopt journal_mode=wal for all SQLite databases.
3023         https://bugs.webkit.org/show_bug.cgi?id=133496
3024
3025         Reviewed by Brady Eidson.
3026
3027         Enabling sqlite3 WAL mode on iOS causes a test failure, but appears just be something that should fail still failing, only in a different way.
3028         Enabling & marking test as failing for now. Tracking test failure here:
3029             https://bugs.webkit.org/show_bug.cgi?id=156718
3030
3031         * platform/sql/SQLiteDatabase.cpp:
3032         (WebCore::SQLiteDatabase::open):
3033             - enable on iOS.
3034
3035 2016-04-18  Brent Fulgham  <bfulgham@apple.com>
3036
3037         Remove support for X-Frame-Options in `<meta>`
3038         https://bugs.webkit.org/show_bug.cgi?id=156625
3039         <rdar://problem/25748714>
3040
3041         Rubberstamped by Darin Adler.
3042
3043         * dom/Document.cpp:
3044         (WebCore::Document::processHttpEquiv): Revise messaging based on Darin's comments.
3045
3046 2016-04-18  Chris Dumez  <cdumez@apple.com>
3047
3048         Crash in ElementDescendantIterator::operator--() when calling m_ancestorSiblingStack.last()
3049         https://bugs.webkit.org/show_bug.cgi?id=156715
3050         <rdar://problem/25750864>
3051
3052         Reviewed by Antti Koivisto.
3053
3054         Fix correctness of ElementDescendantIterator::operator--(). The last element
3055         in the m_ancestorSiblingStack stack is nullptr. However, if our parent does
3056         not have a sibling, m_current->nextSibling() == m_ancestorSiblingStack.last()
3057         would be true and we would end up removing the nullptr element from
3058         m_ancestorSiblingStack. We would crash on a follow-up call to operator--()
3059         because m_ancestorSiblingStack.last() would do an out-of-bound access, given
3060         that m_ancestorSiblingStack is empty.
3061
3062         Test: fast/dom/collection-backward-traversal-crash.html
3063
3064         * dom/ElementDescendantIterator.h:
3065         (WebCore::ElementDescendantIterator::operator--):
3066
3067 2016-04-18  Anders Carlsson  <andersca@apple.com>
3068
3069         Fix build with newer versions of clang.
3070         rdar://problem/25749769
3071
3072         Forward declare performClose:.
3073
3074         * platform/mac/WebCoreFullScreenWindow.mm:
3075
3076 2016-04-18  Tina Liu  <iting_liu@apple.com>
3077
3078         Declare a virtual function in PluginStrategy to be implemented by subclasses.
3079         https://bugs.webkit.org/show_bug.cgi?id=156540
3080
3081         Reviewed by Anders Carlsson.
3082
3083         * plugins/PluginStrategy.h:
3084
3085 2016-04-18  Eric Carlson  <eric.carlson@apple.com>
3086
3087         [iOS] don't toggle playback when media engine rate changes
3088         https://bugs.webkit.org/show_bug.cgi?id=156705
3089         <rdar://problem/25779175>
3090
3091         Reviewed by Jer Noble.
3092
3093         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3094         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged): Don't send the play/pause command
3095           unless the player item state is >= MediaPlayerAVPlayerItemStatusPlaybackBufferFull and
3096           the rate change is unexpected.
3097
3098 2016-04-18  Chris Dumez  <cdumez@apple.com>
3099
3100         Unreviewed, fix iOS9 build after r199682.
3101
3102         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3103         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
3104
3105 2016-04-18  Chris Dumez  <cdumez@apple.com>
3106
3107         [WK2][iOS] Only adjust network responses' MIME type for QuickLook in the context of a main resource load
3108         https://bugs.webkit.org/show_bug.cgi?id=156639
3109         <rdar://problem/25765848>
3110
3111         Reviewed by Alex Christensen.
3112
3113         Only adjust network responses' MIME type for QuickLook in the context of a main
3114         resource load since we can only preview main resources with QuickLook. This
3115         avoids doing unnecessary work during page load. Also, this makes it a lot less
3116         likely to dlopen() the QuickLook library during page load since we now only
3117         adjust MIME type for QuickLook for main resources, and main resources usually
3118         have the well-known 'text/html' MIME type for which we know we will not use
3119         QuickLook.
3120
3121         After this change, we no longer need to dlopen() the QuickLook library in the
3122         NetworkProcess in the context of the PLT. We would previously dlopen() the
3123         library during the first page load, thus significantly slowing it down. As a
3124         result, we see a ~22% speed up in the PLT's first page load and a 0.9-1% overall
3125         PLT progression.
3126
3127         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3128         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3129         Pass flag to adjustMIMETypeIfNecessary() indicated if this is a main resource load.
3130
3131         * platform/network/ios/WebCoreURLResponseIOS.mm:
3132         (WebCore::adjustMIMETypeIfNecessary):
3133         Only adjust the MIME type for QuickLook if the isMainResourceLoad parameter is true.
3134
3135         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3136         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
3137         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3138         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3139         Only adjust the MIME type for QuickLook if the isMainResourceLoad parameter is true.
3140
3141         * platform/network/mac/WebCoreURLResponse.h:
3142         * platform/network/mac/WebCoreURLResponse.mm:
3143         (WebCore::adjustMIMETypeIfNecessary):
3144
3145 2016-04-18  Brent Fulgham  <bfulgham@apple.com>
3146
3147         CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
3148         https://bugs.webkit.org/show_bug.cgi?id=153151
3149         <rdar://problem/24383176>
3150
3151         Reviewed by Darin Adler.
3152
3153         Remove the unused dynamic favicon code and tests.
3154
3155         * loader/EmptyClients.h:
3156         * loader/FrameLoaderClient.h:
3157         * loader/LinkLoader.cpp:
3158         (WebCore::LinkLoader::loadLink):
3159
3160 2016-04-15  Jer Noble  <jer.noble@apple.com>
3161
3162         [Mac][EME] Protected content over HLS is not notified when a HDCP violation occurs.
3163         https://bugs.webkit.org/show_bug.cgi?id=156633
3164
3165         Reviewed by Eric Carlson.
3166
3167         Pass through the existing "outputObscuredDueToInsufficientExternalProtection" status as an
3168         error, similarly to what we do for CDMSessionMediaSourceAVFObjC.
3169
3170         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
3171         (WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC): Deleted.
3172         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
3173         (SOFT_LINK_CLASS):
3174         (-[WebCDMSessionAVFoundationObjCListener initWithParent:player:]):
3175         (-[WebCDMSessionAVFoundationObjCListener invalidate]):
3176         (-[WebCDMSessionAVFoundationObjCListener observeValueForKeyPath:ofObject:change:context:]):
3177         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
3178         (WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC):
3179         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
3180         (WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
3181         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3182         (WebCore::MediaPlayerPrivateAVFoundationObjC::avPlayer):
3183
3184 2016-04-18  Chris Dumez  <cdumez@apple.com>
3185
3186         Unreviewed, rolling out r199644.
3187
3188         Seems to have caused a 1-2% regression on warm PLT
3189
3190         Reverted changeset:
3191
3192         "[WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess"
3193         https://bugs.webkit.org/show_bug.cgi?id=156639
3194         http://trac.webkit.org/changeset/199644
3195
3196 2016-04-17  Darin Adler  <darin@apple.com>
3197
3198         Get rid of IDBAny
3199         https://bugs.webkit.org/show_bug.cgi?id=156681
3200
3201         Reviewed by Brady Eidson.
3202
3203         IDBAny is not part of the public interface of Indexed Database.
3204         It was an implementation technique used to help create language bindings for
3205         functions that have to deal with types that aren't easly expressed with the
3206         normal IDL and C++ type system.
3207
3208         What was particularly dangerous about IDBAny is that it can be used to store
3209         arbitrary JavaScript objects and it's not easy to handle garbage collection and
3210         reference cycles when they are hidden behind this class's abstraction. It's also
3211         a needless extra layer, a reference counted object just to carry the types from
3212         the bindings to the C++ DOM implementation.
3213
3214         Ths patch also does many small style tweaks.
3215
3216         * CMakeLists.txt: Removed IDBAny source files. Added JSIDBRequestCustom.cpp.
3217         * DerivedSources.cpp: Ditto.
3218         * DerivedSources.make: Ditto.
3219         * WebCore.xcodeproj/project.pbxproj: Ditto.
3220
3221         * Modules/indexeddb/IDBAny.cpp: Removed.
3222         * Modules/indexeddb/IDBAny.h: Removed.
3223         * Modules/indexeddb/IDBAny.idl: Removed.
3224
3225         * Modules/indexeddb/IDBCursor.cpp: Added includes needed now that headers don't
3226         include as much.
3227         (WebCore::IDBCursor::stringToDirection): Removed unneeded IDBCursor namespacing.
3228         (WebCore::IDBCursor::directionToString): Ditto.
3229         (WebCore::IDBCursor::IDBCursor): Removed creation of IDBAny object.
3230         (WebCore::IDBCursor::direction): Removed unneeded IDBCursor namespacing.
3231         (WebCore::IDBCursor::key): Moved this function to the header.
3232         (WebCore::IDBCursor::primaryKey): Ditto.
3233         (WebCore::IDBCursor::value): Ditto.
3234         (WebCore::IDBCursor::source): Deleted this function; replaced with multiple
3235         type-specific functions; all but one will return null.
3236         (WebCore::IDBCursor::update): Take JSValue instead of Deprecated::ScriptValue.
3237         (WebCore::IDBCursor::advance): Take unsigned instead of unsigned long.
3238         Fell prey to the confusion because "unsigned long" in IDL means "unsigned" in C++.
3239         (WebCore::IDBCursor::continueFunction): Take JSValue instead of Deprecated::ScriptValue.
3240         (WebCore::IDBCursor::uncheckedIterateCursor): Take unsigned instead of unsigned long.
3241         (WebCore::IDBCursor::setGetResult): Rewrote to get the VM pointer from the
3242         ScriptExecutionContext here instead of inside the binding utilities functions.
3243
3244         * Modules/indexeddb/IDBCursor.h: Removed many unneeded includes.
3245         Changed key, primaryKey, and value to no longer take an unneeded ExecState.
3246         Made more functions private.
3247
3248         * Modules/indexeddb/IDBCursor.idl: Changed type of "source" to "any", which matches
3249         the IDB specification, rather than "IDBAny". Added [CustomGetter] so we can write the
3250         getter that understands the multiple possible values. Removed unneeded
3251         [CallWith=ScriptState] from key and primaryKey attributes.
3252
3253         * Modules/indexeddb/IDBCursorWithValue.h: Marked the class final.
3254         * Modules/indexeddb/IDBCursorWithValue.idl: Removed unneeded [CallWith=ScriptState]
3255         from the value attribute.
3256
3257         * Modules/indexeddb/IDBDatabase.cpp: Added now-needed include.
3258         * Modules/indexeddb/IDBDatabase.h: Removed this header's include of itself!
3259
3260         * Modules/indexeddb/IDBFactory.cpp: Added some now-needed includes.
3261         (WebCore::IDBFactory::~IDBFactory): Moved this out of the header file.
3262         (WebCore::IDBFactory::getDatabaseNames): Removed function that always returns nullptr.
3263         (WebCore::IDBFactory::open): Removed unneeded release() calls when returning a RefPtr.
3264         (WebCore::IDBFactory::cmp): Take JSValue instead of Deprecated::ScriptValue.
3265         Also removed unneeded typecast.
3266
3267         * Modules/indexeddb/IDBFactory.h: Removed many unneeded includes.
3268         Removed the getDatabaseNames function. We still need a solution here, but there is
3269         no reason to keep the placeholder function that returns nullptr here.
3270
3271         * Modules/indexeddb/IDBIndex.cpp:
3272         (WebCore::IDBIndex::keyPathAny): Removed.
3273         (WebCore::IDBIndex::openCursor): Take JSValue instead of Deprecated::ScriptValue.
3274         (WebCore::IDBIndex::count): Ditto.
3275         (WebCore::IDBIndex::openKeyCursor): Ditto.
3276         (WebCore::IDBIndex::get): Ditto.
3277         (WebCore::IDBIndex::getKey): Ditto.
3278
3279         * Modules/indexeddb/IDBIndex.h: Removed many unneeded includes, including this file
3280         including itself. Marked class final. Updated for above changes.
3281
3282         * Modules/indexeddb/IDBIndex.idl: Changed type of "keyPath" to "any", which matches
3283         the IDB specification, rather than "IDBAny". Specified [ImplementationReturnType=IDBKeyPath]
3284         so the code generator creates the appropriate code to convert from an IDBKeyPath.
3285         In the future, we may find a way to do this without an explicit attribute in the IDL
3286         file but this is fine for now.
3287
3288         * Modules/indexeddb/IDBKeyRange.cpp:
3289         (WebCore::IDBKeyRange::create): Moved this here from the header. Use booleans instead
3290         of enums because all the call sites outside this class are using booleans.
3291         (WebCore::IDBKeyRange::IDBKeyRange): Updated to use booleans.
3292         (WebCore::IDBKeyRange::~IDBKeyRange): Moved here from the header.
3293         (WebCore::IDBKeyRange::lowerValue): Removed now-unneeded get().
3294         (WebCore::IDBKeyRange::upperValue): Ditto.
3295         (WebCore::IDBKeyRange::only): Take JSValue instead of Deprecated::ScriptValue.
3296         (WebCore::IDBKeyRange::lowerBound): Updated for above changes.
3297         (WebCore::IDBKeyRange::upperBound): Ditto.
3298         (WebCore::IDBKeyRange::bound): Ditto.
3299         (WebCore::IDBKeyRange::isOnlyKey): Removed assertions that lower and upper are not null;
3300         there is no real guarantee of this! Rewrote and streamlined and it handles the null case now.
3301
3302         * Modules/indexeddb/IDBKeyRange.h: Removed unneeded includes. Changed class to use booleans
3303         instead of enums for m_isLowerOpen and m_isUpperOpen. Moved functions into the cpp file.
3304
3305         * Modules/indexeddb/IDBKeyRangeData.cpp:
3306         (WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange): Updated to use booleans instead of enums.
3307
3308         * Modules/indexeddb/IDBObjectStore.cpp:
3309         (WebCore::IDBObjectStore::name): Changed return type to const String& to cut down on
3310         reference count churn.
3311         (WebCore::IDBObjectStore::keyPathAny): Deleted.
3312         (WebCore::IDBObjectStore::keyPath): Changed return type to const IDBKeyPath& to cut down on
3313         unnecessary copies.
3314         (WebCore::IDBObjectStore::openCursor): Take JSValue instead of Deprecated::SCriptValue.
3315         (WebCore::IDBObjectStore::get): Ditto.
3316         (WebCore::IDBObjectStore::putOrAdd): Ditto. Removed peculiar adoptRef/leakRef that was not needed.
3317         (WebCore::IDBObjectStore::deleteFunction): Ditto.
3318         (WebCore::IDBObjectStore::modernDelete): Ditto. Use releaseNonNull for better efficiency.
3319         (WebCore::IDBObjectStore::count): Ditto.
3320
3321         * Modules/indexeddb/IDBObjectStore.h: Removed unneeded includes and changed types as mentioned
3322         above in the cpp file function descriptions.
3323
3324         * Modules/indexeddb/IDBObjectStore.idl: Changed type of "keyPath" to "any" and
3325         specified [ImplementationReturnType=IDBKeyPath] as above in IDBIndex.idl.
3326
3327         * Modules/indexeddb/IDBOpenDBRequest.cpp: Added now-needed includes.
3328         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): Removed unneeded assertions
3329         that depend on how m_result is implemented, which changed.
3330         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): Call setResultToUndefined
3331         instead of setting m_result directly.
3332         (WebCore::IDBOpenDBRequest::onSuccess): Call setResult instead of setting m_result and
3333         m_readyState directly.
3334         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):: Ditto. Also use WTFMove to set
3335         m_transaction instead of peculiar adoptRef/leakRef.
3336         (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): Call setResultToUndefined
3337         instead of setting m_result directly.
3338
3339         * Modules/indexeddb/IDBOpenDBRequest.h: Marked the class final. Removed some unneeded headers
3340         and made more things private.
3341
3342         * Modules/indexeddb/IDBRequest.cpp:
3343         (WebCore::IDBRequest::IDBRequest): Don't initialize m_source any more. Instead initialize
3344         m_objectStoreSource and m_indexSource, preserving the old behavior and not setting m_cursorSource
3345         even when passed an IDBCursor.
3346         (WebCore::IDBRequest::~IDBRequest): Simplify the code that calls clearRequest on the result
3347         if it's a cursor. The logic is now simply a null check.
3348         (WebCore::IDBRequest::result): Deleted. The logic is now in a custom binding.
3349         (WebCore::IDBRequest::error): Updated to use m_isDone instead of m_readyState.
3350         (WebCore::IDBRequest::source): Deleted. The logic is now in a custom binding.
3351         (WebCore::IDBRequest::setSource): Set m_objectStoreSource, m_indexSource, and m_cursorSource
3352         instead of setting m_source.
3353         (WebCore::IDBRequest::readyState): Updated to use m_isDone instead of m_readyState.
3354         (WebCore::IDBRequest::sourceObjectStoreIdentifier): Use m_objectStoreSource and
3355         m_indexSource instead of using m_source. To preserve current behavior, this this does not
3356         use m_cursorSource since the old code did not handle IDBCursor.
3357         (WebCore::IDBRequest::sourceIndexIdentifier): Use m_indexSource instead of m_source, preserving
3358         current behavior.
3359         (WebCore::IDBRequest::requestedIndexRecordType): Ditto.
3360         (WebCore::IDBRequest::dispatchEvent): Updated to use m_isDone instead of m_readyState.
3361         (WebCore::IDBRequest::setResult): Rewrote to use the clearResult function so we don't
3362         have to repeat the code to clear result pointers. Also take a reference.
3363         (WebCore::IDBRequest::setResultToStructuredClone): Ditto.
3364         (WebCore::IDBRequest::clearResult): Clear out m_scriptResult, m_cursorResult, and m_databaseResult
3365         instead of m_result.
3366         (WebCore::IDBRequest::setResultToUndefined): Set m_scriptResult instead of m_result.
3367         (WebCore::IDBRequest::resultCursor): Use m_cursorResult instead of m_result.
3368         (WebCore::IDBRequest::willIterateCursor): Updated to use m_isDone instead of m_readyState.
3369         Also call setResultToUndefined instead of setting m_result.
3370         (WebCore::IDBRequest::didOpenOrIterateCursor): Call setResultToUndefined and set m_cursorResult
3371         instead of setting m_result.
3372         (WebCore::IDBRequest::requestCompleted): Updated to use m_isDone instead of m_readyState.
3373         (WebCore::IDBRequest::setResult): Added for use by the derived class; sets m_databaseResult.
3374
3375         * Modules/indexeddb/IDBRequest.h: Removed unneeded includes. Removed unused IDBRequestReadyState,
3376         since that's now done with strings. Added cursorResult, databaseResult, scriptResult,
3377         objectStoreSource, indexSource, and cursorSource function members and corresponding data members.
3378         Later we might re-cast this as some sort of union, but for now these separate functions seem fine.
3379         Removed unused modernResult function. Made more things private.
3380
3381         * Modules/indexeddb/IDBRequest.idl: Use "any" instead of "IDBAny" for "result" and "source".
3382
3383         * Modules/indexeddb/IDBTransaction.cpp: Added now-needed includes.
3384         (WebCore::IDBTransaction::didGetRecordOnServer): Updated to call the version of setResult that takes
3385         a reference.
3386         (WebCore::IDBTransaction::didPutOrAddOnServer): Ditto.
3387         * Modules/indexeddb/IDBTransaction.h: Removed unneeded includes, derive privately from ActiveDOMObject.
3388         Removed some unneeded WebCore prefixes.
3389
3390         * Modules/indexeddb/server/MemoryIndex.h: Added now-needed include.
3391
3392         * Modules/indexeddb/server/MemoryObjectStore.cpp: Added now-needed includes.
3393         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): Remove unneeded get() call.
3394         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): Ditto.
3395
3396         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Added now-needed includes.
3397         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord): Remove unneeded get() call.
3398         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): Ditto.
3399
3400         * Modules/indexeddb/server/SQLiteIDBCursor.cpp: Added now-needed include.
3401
3402         * Modules/indexeddb/server/UniqueIDBDatabase.cpp: Added now-needed includes.
3403         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Updated to use JSValue.
3404
3405         * Modules/indexeddb/server/UniqueIDBDatabase.h: Added now-needed forward declaration of JSC::VM.
3406
3407         * bindings/js/IDBBindingUtilities.cpp: Added now-needed includes.
3408         (WebCore::deserializeIDBValueToJSValue): Return JSValue instead of Strong<Unknown>.
3409         (WebCore::deserializeIDBValueDataToJSValue): Ditto.
3410         (WebCore::idbKeyDataToScriptValue): Ditto.
3411         (WebCore::toJS): Added an overload of toJS for IDBKeyPath here. Moved here from JSIDBAnyCustom.cpp.
3412
3413         * bindings/js/IDBBindingUtilities.h: Removed unneeded include. Changed return types to JSValue.
3414         Added the toJS function for IDBKeyPath.
3415
3416         * bindings/js/JSIDBAnyCustom.cpp: Removed.
3417
3418         * bindings/js/JSIDBCursorCustom.cpp: Added some now-needed includes.
3419         (WebCore::JSIDBCursor::visitAdditionalChildren): Removed ann unneeded type cast.
3420         (WebCore::JSIDBCursor::source): Added. Converts either the index source or the object source into
3421         a JSValue.
3422
3423         * bindings/js/JSIDBRequestCustom.cpp: Added.
3424         (WebCore::JSIDBRequest::result): Added. Throws an exception if isDone is false and then converts
3425         cursor result, database result, or script result into a JSValue.
3426         (WebCore::JSIDBRequest::source): Added. Converts the cursor source, index source, or object store
3427         source into a JSValue.
3428
3429         * bindings/scripts/CodeGeneratorJS.pm:
3430         (NativeToJSValue): Tweaked the code for array slightly. Added an ImplementationReturnType case
3431         for IDBKeyPath. The code that's generated is pretty generic, just a call to toJS with the conventional
3432         arguments, so at some point we may be able to do this with C++ overloading and not require a
3433         special case in the code generator.
3434
3435         * inspector/InspectorIndexedDBAgent.cpp: Put #if 0 around the getDatabaseNames code, which was
3436         dormant and not working.
3437         (WebCore::OpenDatabaseCallback::handleEvent): Changed this to use IDBOpenDBRequest::databaseResult
3438         instead of calling the result function checking for an exception and then doing type checking.
3439         (WebCore::idbKeyRangeFromKeyRange): Updated to use booleans for key range bound open state.
3440         (WebCore::OpenCursorCallback::handleEvent): Same kind of change as for OpenDatabaseCallback above.
3441         Also use simpler interface to key, primaryKey, and value.
3442         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames): Put #if 0 around the getDatabaseNames
3443         code, which was dormant and not working. Needs to be re-implemented.
3444
3445 2016-04-18  Eric Carlson  <eric.carlson@apple.com>
3446
3447         Media element "user gesture for fullscreen" restriction is never lifted
3448         https://bugs.webkit.org/show_bug.cgi?id=156547
3449         <rdar://problem/25707814>
3450
3451         Reviewed by Jer Noble.
3452
3453         Test: media/video-fullscreen-restriction-removed.html
3454
3455         * html/MediaElementSession.cpp:
3456         (WebCore::MediaElementSession::playbackPermitted): Check fullscreenPermitted rather than
3457           checking for a user gesture because the restriction can be removed.
3458
3459 2016-04-18  Frederic Wang  <fwang@igalia.com>
3460
3461         Refactor RenderMathMLScripts layout to avoid using flexbox
3462         https://bugs.webkit.org/show_bug.cgi?id=153917
3463
3464         Reviewed by Martin Robinson.
3465
3466         Tests: mathml/mathml-in-html5/subsup-parameters-1.html
3467                mathml/opentype/large-operators-italic-correction.html
3468
3469         Reimplement RenderMathMLScripts without any flexbox or anonymous.
3470         We also rely on parameters from the MATH table to improve rendering.
3471
3472         * css/mathml.css:
3473         (msub > * + * + *, msup > * + * + *, msubsup > * + * + * + *, msub > mprescripts, msup > mprescripts, msubsup > mprescripts, msub > none, msup > none, msubsup > none, mmultiscripts > mprescripts ~ mprescripts, mmultiscripts > mprescripts ~ mprescripts ~ *): Deleted.
3474         Invalid markup for scripts is now just hidden.
3475         * rendering/mathml/RenderMathMLOperator.h: ditto.
3476         * rendering/mathml/RenderMathMLScripts.cpp:
3477         (WebCore::RenderMathMLScripts::unembellishedOperator): Reimplemented.
3478         (WebCore::RenderMathMLScripts::getBaseAndScripts): Helper function to verify whether the
3479         child list is valid and retrieve pointers on important children.
3480         (WebCore::RenderMathMLScripts::spaceAfterScript): Helper function to get the
3481         space after a script.
3482         (WebCore::RenderMathMLScripts::italicCorrection): Helper function to read the
3483         italic correction of a largeop base.
3484         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Implement this function.
3485         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Helper function to get
3486         the maximum ascent/descent of all the scripts and determine the minimal
3487         sub/sup shifts to apply.
3488         (WebCore::RenderMathMLScripts::mirrorIfNeeded): Helper function to calculate the horizontal
3489         offset depending on the directionality.
3490         (WebCore::RenderMathMLScripts::layoutBlock): Implement this function.
3491         (WebCore::RenderMathMLScripts::firstLineBaseline): Implement this function.
3492         (WebCore::RenderMathMLScripts::paintChildren): Implement this function.
3493         (WebCore::RenderMathMLScripts::RenderMathMLScripts): Deleted.
3494         (WebCore::RenderMathMLScripts::base): Deleted.
3495         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): Deleted.