0367c9ccda64ceae0b7d196885be37214ee4bc75
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-09-11  Chris Dumez  <cdumez@apple.com>
2
3         Element.tagName should be upper-case for HTML elements in HTML documents
4         https://bugs.webkit.org/show_bug.cgi?id=148843
5         <rdar://problem/22559081>
6
7         Reviewed by Ryosuke Niwa.
8
9         Element.tagName should be upper-case for HTML elements in HTML documents,
10         as per the DOM specification:
11         https://dom.spec.whatwg.org/#dom-element-tagname
12
13         Previously, WebKit would fail to upper-case the tagname if the element's
14         tag had a prefix. This patch corrects this. This aligns our behavior with
15         Firefox, Chrome and IE.
16
17         No new tests, already covered by existing tests.
18
19         * html/HTMLElement.cpp:
20         (WebCore::HTMLElement::nodeName):
21
22 2015-09-11  Chris Dumez  <cdumez@apple.com>
23
24         document.body = "text" should throw a TypeError, not a HierarchyRequestError
25         https://bugs.webkit.org/show_bug.cgi?id=149057
26         <rdar://problem/22567157>
27
28         Reviewed by Ryosuke Niwa.
29
30         document.body = "text" should throw a TypeError, not a
31         HierarchyRequestError:
32         https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
33
34         This is because "text" is a DOMString and it cannot be converted into an
35         HTMLElement?. Therefore, the WebIDL specification says we should throw a
36         TypeError in this case.
37
38         Chrome and Firefox throw the right exception.
39
40         No new tests, already covered by existing test.
41
42         * dom/Document.idl:
43
44 2015-09-11  Andreas Kling  <akling@apple.com>
45
46         [JSC] Weak should only accept cell pointees.
47         <https://webkit.org/b/148955>
48
49         Reviewed by Geoffrey Garen.
50
51         Update WebCore bindings for the new Weak and Weak-related signatures.
52
53         * bindings/js/JSCSSRuleListCustom.cpp:
54         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
55         * bindings/js/JSCSSValueCustom.cpp:
56         (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots):
57         (WebCore::JSCSSValueOwner::finalize):
58         * bindings/js/JSCallbackData.cpp:
59         (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots):
60         * bindings/js/JSCallbackData.h:
61         * bindings/js/JSMutationObserverCustom.cpp:
62         (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots):
63         * bindings/js/JSNodeCustom.cpp:
64         (WebCore::isReachableFromDOM):
65         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
66         * bindings/js/JSNodeListCustom.cpp:
67         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
68         * bindings/js/JSTextTrackCueCustom.cpp:
69         (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
70         * bindings/js/WebCoreTypedArrayController.cpp:
71         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots):
72         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
73         * bindings/js/WebCoreTypedArrayController.h:
74         * bindings/scripts/CodeGeneratorJS.pm:
75         (GenerateHeader):
76         (GenerateImplementation):
77         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
78         (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots):
79         (WebCore::JSTestActiveDOMObjectOwner::finalize):
80         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
81         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
82         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
83         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
84         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
85         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
86         (WebCore::JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots):
87         (WebCore::JSTestCustomNamedGetterOwner::finalize):
88         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
89         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
90         (WebCore::JSTestEventConstructorOwner::isReachableFromOpaqueRoots):
91         (WebCore::JSTestEventConstructorOwner::finalize):
92         * bindings/scripts/test/JS/JSTestEventConstructor.h:
93         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
94         (WebCore::JSTestEventTargetOwner::isReachableFromOpaqueRoots):
95         (WebCore::JSTestEventTargetOwner::finalize):
96         * bindings/scripts/test/JS/JSTestEventTarget.h:
97         * bindings/scripts/test/JS/JSTestException.cpp:
98         (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
99         (WebCore::JSTestExceptionOwner::finalize):
100         * bindings/scripts/test/JS/JSTestException.h:
101         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
102         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
103         (WebCore::JSTestGenerateIsReachableOwner::finalize):
104         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
105         * bindings/scripts/test/JS/JSTestInterface.cpp:
106         (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
107         (WebCore::JSTestInterfaceOwner::finalize):
108         * bindings/scripts/test/JS/JSTestInterface.h:
109         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
110         (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots):
111         (WebCore::JSTestMediaQueryListListenerOwner::finalize):
112         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
113         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
114         (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots):
115         (WebCore::JSTestNamedConstructorOwner::finalize):
116         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
117         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
118         (WebCore::JSTestNondeterministicOwner::isReachableFromOpaqueRoots):
119         (WebCore::JSTestNondeterministicOwner::finalize):
120         * bindings/scripts/test/JS/JSTestNondeterministic.h:
121         * bindings/scripts/test/JS/JSTestObj.cpp:
122         (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots):
123         (WebCore::JSTestObjOwner::finalize):
124         * bindings/scripts/test/JS/JSTestObj.h:
125         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
126         (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots):
127         (WebCore::JSTestOverloadedConstructorsOwner::finalize):
128         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
129         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
130         (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
131         (WebCore::JSTestOverrideBuiltinsOwner::finalize):
132         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
133         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
134         (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots):
135         (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
136         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
137         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
138         (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
139         (WebCore::JSTestTypedefsOwner::finalize):
140         * bindings/scripts/test/JS/JSTestTypedefs.h:
141         * bindings/scripts/test/JS/JSattribute.cpp:
142         (WebCore::JSattributeOwner::isReachableFromOpaqueRoots):
143         (WebCore::JSattributeOwner::finalize):
144         * bindings/scripts/test/JS/JSattribute.h:
145         * bindings/scripts/test/JS/JSreadonly.cpp:
146         (WebCore::JSreadonlyOwner::isReachableFromOpaqueRoots):
147         (WebCore::JSreadonlyOwner::finalize):
148         * bindings/scripts/test/JS/JSreadonly.h:
149         * bridge/runtime_root.cpp:
150         (JSC::Bindings::RootObject::finalize):
151         * bridge/runtime_root.h:
152
153 2015-09-10  Chris Fleizach  <cfleizach@apple.com>
154
155         AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
156         https://bugs.webkit.org/show_bug.cgi?id=148891
157
158         Reviewed by Alexey Proskuryakov.
159
160         Asychronous focus setting DOES work on Yosemite, just not Mavericks.
161
162         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
163         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
164         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
165
166 2015-09-10  David Hyatt  <hyatt@apple.com>
167
168         [New Block-Inside-Inline Model] Self-collapsing block check needs to account for anonymous inline blocks
169         https://bugs.webkit.org/show_bug.cgi?id=149042
170
171         Reviewed by Dean Jackson.
172
173         Added new tests in fast/block/inside-inlines/
174
175         * rendering/InlineFlowBox.cpp:
176         * rendering/InlineFlowBox.h:
177         (WebCore::InlineFlowBox::anonymousInlineBlock):
178         Add a new accessor to get the anonymousInlineBlock() for lines that wrap them.
179
180         * rendering/RenderBlock.cpp:
181         (WebCore::RenderBlock::childrenPreventSelfCollapsing):
182         (WebCore::RenderBlock::isSelfCollapsingBlock):
183         isSelfCollapsingBlock() now calls a virtual method that checks lines/children called childrenPreventSelfCollapsing.
184         This lets us farm out the lines check to the derived RenderBlockFlow class.
185
186         * rendering/RenderBlock.h:
187         (WebCore::RenderBlock::childrenPreventSelfCollapsing):
188         Added new virtual method for checking children.
189
190         * rendering/RenderBlockFlow.cpp:
191         * rendering/RenderBlockFlow.h:
192         (WebCore::RenderBlockFlow::childrenPreventSelfCollapsing):
193         Overridden to ensure that blocks can still be self-collapsing if they only contain anonymous inline-block lines that
194         are also self-collapsing.
195
196 2015-09-10  Jinyoung Hur  <hur.ims@navercorp.com>
197
198         [WebGL][GLES] bad shaders should not be linked not only for GL but also for GL ES
199         https://bugs.webkit.org/show_bug.cgi?id=148794
200
201         Reviewed by Dean Jackson.
202
203         Checking bad shaders, precision matching and varyings packing are all valid for GL ES too.
204
205         Test: webgl/1.0.2/conformance/programs/program-test.html
206
207         * html/canvas/WebGLRenderingContextBase.cpp:
208         (WebCore::WebGLRenderingContextBase::linkProgram):
209
210 2015-09-10  Jinyoung Hur  <hur.ims@navercorp.com>
211
212         Static variables in GraphicsContext3DOpenGLCommon should be avoided because of the race condition
213         https://bugs.webkit.org/show_bug.cgi?id=148957
214
215         Reviewed by Dean Jackson.
216
217         There is no guarantee that only one thread calls GraphicsContext3D::compileShader() at a time so it would be 
218         better to use a thread local storage variable rather than use a static variable.
219
220         No new tests. No behavioural changes.
221
222         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
223         (WebCore::getCurrentNameHashMapForShader):
224         (WebCore::setCurrentNameHashMapForShader):
225         (WebCore::nameHashForShader):
226         (WebCore::GraphicsContext3D::compileShader):
227         (WebCore::GraphicsContext3D::mappedSymbolName):
228
229 2015-09-10  Chris Dumez  <cdumez@apple.com>
230
231         Node.appendChild(null) / replaceChild(null, null) / removeChild(null) / insertBefore(null, ref) should throw a TypeError
232         https://bugs.webkit.org/show_bug.cgi?id=148971
233         <rdar://problem/22560883>
234         <rdar://problem/22559225>
235
236         Reviewed by Ryosuke Niwa.
237
238         Node.appendChild(null) / replaceChild(null, null) / removeChild(null)
239         and insertBefore(null, ref) should throw a TypeError instead of a
240         NotFoundError, as per the specification:
241         https://dom.spec.whatwg.org/#node
242
243         The parameters are not nullable so the Web IDL specification says
244         we should throw a TypeError in this case.
245
246         This patch moves the null-checking from ContainerNode to the methods
247         on Node. The null-checking is supposed to be done by the bindings code
248         but our generator currently does not support this so we do the null
249         checking as close to the bindings as possible. The bindings code is
250         calling the methods on Node. This also makes sure we throw a TypeError
251         for null-argument when the Node is not a ContainerNode. For e.g.
252         Text.appendChild(null) should throw a TypeError too.
253
254         The methods on ContainerNode now take references insteaad of pointer
255         parameters now that the null-checking is done at the call site in
256         Node. This lead to a lot of code update as those methods are used
257         a lot throughout the code base.
258
259         No new tests, already covered by pre-existing layout tests.
260
261 2015-09-10  Daniel Bates  <dabates@apple.com>
262
263         Write a test to ensure we don't regress processing of tasks when page defers loading
264         https://bugs.webkit.org/show_bug.cgi?id=135882
265         <rdar://problem/22550497>
266
267         Reviewed by Darin Adler.
268
269         Towards adding a test for <https://bugs.webkit.org/show_bug.cgi?id=135688>, add a window.internals
270         function, setPageDefersLoading, to enable and disable whether the page defers loading.
271
272         Test: storage/websql/success-callback-when-page-defers-loading.html
273
274         * testing/Internals.cpp:
275         (WebCore::Internals::resetToConsistentState): Reset defers loading for the page to false.
276         (WebCore::Internals::setPageDefersLoading): Added.
277         * testing/Internals.h:
278         * testing/Internals.idl: Added IDL declaration setPageDefersLoading.
279
280 2015-09-10  Sergio Villar Senin  <svillar@igalia.com>
281
282         min-width/height should default to auto for flexbox items
283         https://bugs.webkit.org/show_bug.cgi?id=146020
284
285         Reviewed by David Hyatt.
286
287         Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
288
289         As specified here
290         http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
291         value of min-{width|height} is auto for flex items.
292
293         In case this patch breaks any website (as it's changing the
294         default value of those properties) the fix is likely to add:
295
296         min-width: 0;
297         min-height: 0;
298
299         to any relevant flexitems.
300
301         Test: css3/flexbox/min-size-auto.html
302
303         * css/CSSComputedStyleDeclaration.cpp:
304         (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
305         (WebCore::ComputedStyleExtractor::propertyValue): Return auto
306         for flex items if min-width/height is auto.
307         * css/CSSParser.cpp:
308         (WebCore::CSSParser::parseValue):
309         * html/shadow/SliderThumbElement.cpp:
310         * rendering/RenderBox.cpp:
311         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
312         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
313         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
314         (WebCore::RenderBox::computeLogicalHeight):
315         (WebCore::RenderBox::computeLogicalHeightUsing):
316         (WebCore::RenderBox::computeContentLogicalHeight):
317         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
318         (WebCore::RenderBox::computeReplacedLogicalWidth):
319         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
320         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
321         (WebCore::RenderBox::computeReplacedLogicalHeight):
322         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
323         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
324         (WebCore::RenderBox::availableLogicalHeightUsing):
325         (WebCore::RenderBox::computePositionedLogicalWidth):
326         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
327         (WebCore::RenderBox::computePositionedLogicalHeight):
328         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
329         * rendering/RenderBox.h:
330         * rendering/RenderButton.h:
331         * rendering/RenderFlexibleBox.cpp:
332         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
333         (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
334         (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
335         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
336         (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
337         * rendering/RenderFlexibleBox.h:
338         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
339         * rendering/RenderFullScreen.h:
340         * rendering/RenderGrid.cpp:
341         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
342         * rendering/RenderMediaControlElements.h:
343         * rendering/RenderMenuList.cpp:
344         (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
345         the min-width explicitly.
346         * rendering/RenderMenuList.h:
347         * rendering/RenderMultiColumnSet.cpp:
348         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
349         * rendering/RenderNamedFlowFragment.cpp:
350         (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
351         * rendering/RenderReplaced.cpp:
352         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
353         (WebCore::RenderReplaced::computeReplacedLogicalHeight):
354         * rendering/RenderSlider.h:
355         * rendering/RenderTextControl.h:
356         * rendering/RenderTextControlSingleLine.cpp:
357         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
358         the min-width explicitly.
359         * rendering/mathml/RenderMathMLBlock.h:
360         * rendering/style/RenderStyle.h:
361
362 2015-09-10  ChangSeok Oh  <changseok.oh@collabora.com>
363
364         [GTK] Volume bar is broken
365         https://bugs.webkit.org/show_bug.cgi?id=145639
366
367         Reviewed by Philippe Normand.
368
369         The ControlPart enum values' order has mismatched the one of values in CSSValueKeywords.in
370         after r180965. The MediaVolumeSliderPart should be prior to the MediaVolumeSliderContainerpart.
371
372         Tests: media/click-volume-bar-not-pausing.html
373                media/volume-bar-empty-when-muted.html
374
375         * platform/ThemeTypes.h:
376
377 2015-09-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
378
379         Remove all uses of PassRefPtr in WebCore/svg
380         https://bugs.webkit.org/show_bug.cgi?id=148472
381
382         Reviewed by Darin Adler.
383
384         Clean up all uses of PassRefPtr in WebCore/svg.
385
386         * Modules/webaudio/AudioScheduledSourceNode.cpp:
387         (WebCore::AudioScheduledSourceNode::addEventListener):
388         * Modules/webaudio/AudioScheduledSourceNode.h:
389         * Modules/webaudio/ScriptProcessorNode.cpp:
390         (WebCore::ScriptProcessorNode::addEventListener):
391         * Modules/webaudio/ScriptProcessorNode.h:
392         * dom/EventListenerMap.cpp:
393         (WebCore::copyListenersNotCreatedFromMarkupToTarget):
394         * dom/EventTarget.cpp:
395         (WebCore::EventTarget::addEventListener):
396         * dom/EventTarget.h:
397         * dom/MessagePort.cpp:
398         (WebCore::MessagePort::addEventListener):
399         * dom/MessagePort.h:
400         * dom/Node.cpp:
401         (WebCore::tryAddEventListener):
402         (WebCore::Node::addEventListener):
403         * dom/Node.h:
404         * html/HTMLMediaElement.cpp:
405         (WebCore::HTMLMediaElement::addEventListener):
406         * html/HTMLMediaElement.h:
407         * html/ImageDocument.cpp:
408         (WebCore::ImageDocument::createDocumentStructure):
409         * html/shadow/MediaControlsApple.cpp:
410         (WebCore::MediaControlsApple::showClosedCaptionTrackList):
411         * page/DOMWindow.cpp:
412         (WebCore::DOMWindow::addEventListener):
413         * page/DOMWindow.h:
414         * rendering/svg/RenderSVGResourceFilter.cpp:
415         (WebCore::RenderSVGResourceFilter::buildPrimitives):
416         * svg/SVGElement.cpp:
417         (WebCore::SVGElement::addEventListener):
418         * svg/SVGElement.h:
419         * svg/SVGPathElement.cpp:
420         (WebCore::SVGPathElement::pathSegListChanged):
421         * svg/SVGPathUtilities.cpp:
422         (WebCore::appendSVGPathByteStreamFromSVGPathSeg):
423         * svg/SVGPathUtilities.h:
424         * svg/SVGTRefElement.cpp:
425         (WebCore::SVGTRefTargetEventListener::attach):
426         (WebCore::SVGTRefElement::buildPendingResource):
427         * svg/graphics/filters/SVGFilterBuilder.cpp:
428         (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
429         * svg/graphics/filters/SVGFilterBuilder.h:
430
431 2015-09-09  Dewei Zhu  <dewei_zhu@apple.com>
432
433         Document.characterSet should return "UTF-8" instead of null by default.
434         https://bugs.webkit.org/show_bug.cgi?id=148810
435         <rdar://problem/22548727>
436
437         Reviewed by Ryosuke Niwa.
438
439         Document encoding should default to "UTF-8" as is specified in
440         https://dom.spec.whatwg.org/#concept-document-encoding. This behavior
441         is consistent with Firefox and Chrome.
442
443         * dom/Document.cpp:
444         (WebCore::Document::encoding): Returns nullAtom according to declearation.
445         (WebCore::Document::characterSetForBindings): Returns "UTF-8" by default instead of null String.
446         * dom/Document.h:
447         (WebCore::Document::charset):
448         (WebCore::Document::inputEncoding): Deleted.
449         (WebCore::Document::characterSet): Deleted.
450         * dom/Document.idl:
451         * dom/InlineStyleSheetOwner.cpp:
452         (WebCore::InlineStyleSheetOwner::createSheet):
453         * inspector/InspectorPageAgent.cpp:
454         (WebCore::InspectorPageAgent::mainResourceContent):
455         * inspector/InspectorResourceAgent.cpp:
456         (WebCore::InspectorResourceAgent::didFinishLoading):
457         (WebCore::InspectorResourceAgent::didFailLoading):
458         * loader/DocumentWriter.cpp:
459         (WebCore::DocumentWriter::createDecoderIfNeeded):
460         * loader/FormSubmission.cpp:
461         (WebCore::encodingFromAcceptCharset):
462
463 2015-09-09  Benjamin Poulain  <bpoulain@apple.com>
464
465         CSS general sibling selectors does not work without CSS JIT
466         https://bugs.webkit.org/show_bug.cgi?id=148987
467         rdar://problem/22559860
468
469         Reviewed by Andreas Kling.
470
471         When traversing with the indirect adjacent combinator, SelectorChecker
472         was not setting the style invalidation flag on the right element.
473
474         Tests: fast/css/indirect-adjacent-style-invalidation-1.html
475                fast/css/indirect-adjacent-style-invalidation-2.html
476                fast/css/indirect-adjacent-style-invalidation-3.html
477
478         * css/SelectorChecker.cpp:
479         (WebCore::SelectorChecker::matchRecursively):
480
481 2015-09-09  Joseph Pecoraro  <pecoraro@apple.com>
482
483         Web Inspector: Remove unused InspectorFrontendHost methods
484         https://bugs.webkit.org/show_bug.cgi?id=149013
485
486         Reviewed by Brian Burg.
487
488         * inspector/InspectorFrontendHost.cpp:
489         (WebCore::InspectorFrontendHost::canSaveAs): Deleted.
490         (WebCore::InspectorFrontendHost::canInspectWorkers): Deleted.
491         * inspector/InspectorFrontendHost.h:
492         * inspector/InspectorFrontendHost.idl:
493
494 2015-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
495
496         ASSERTION FAILED: typesettingFeatures & (Kerning | Ligatures) in WebCore::applyFontTransforms
497         https://bugs.webkit.org/show_bug.cgi?id=146194
498
499         Reviewed by Dean Jackson.
500
501         We might trigger shaping even if the author hasn't specified kerning or ligatures.
502
503         Test: fast/text/softbank-emoji-no-ligatures-nor-kerning.html
504
505         * platform/graphics/WidthIterator.cpp:
506         (WebCore::isSoftBankEmoji):
507         (WebCore::WidthIterator::applyFontTransforms):
508         (WebCore::WidthIterator::advanceInternal):
509         (WebCore::applyFontTransforms): Deleted.
510         * platform/graphics/WidthIterator.h:
511
512 2015-09-09  Chris Dumez  <cdumez@apple.com>
513
514         Setting document.title when there is no title and no head element should no nothing
515         https://bugs.webkit.org/show_bug.cgi?id=149005
516         <rdar://problem/22567524>
517
518         Reviewed by Ryosuke Niwa.
519
520         Setting document.title when there is no title element and no head
521         element should no nothing:
522         - https://html.spec.whatwg.org/multipage/dom.html#document.title
523
524         Firefox and Chrome comply with the specification. However, WebKit
525         was returning the updated title when querying document.title after
526         setting it.
527
528         No new tests, covered by existing tests.
529
530         * dom/Document.cpp:
531         (WebCore::Document::setTitle):
532
533 2015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
534
535         [css-grid] Percentage columns shouldn't include border and padding
536         https://bugs.webkit.org/show_bug.cgi?id=148978
537
538         Reviewed by Sergio Villar Senin.
539
540         Subtract border and padding when we're calculating the breadth of the
541         columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
542
543         Added test to check the behavior for both columns and rows.
544
545         Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
546
547         * rendering/RenderGrid.cpp:
548         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
549
550 2015-09-09  Commit Queue  <commit-queue@webkit.org>
551
552         Unreviewed, rolling out r189536 and r189538.
553         https://bugs.webkit.org/show_bug.cgi?id=149002
554
555         broke tests on mac (Requested by alexchristensen on #webkit).
556
557         Reverted changesets:
558
559         "min-width/height should default to auto for flexbox items"
560         https://bugs.webkit.org/show_bug.cgi?id=146020
561         http://trac.webkit.org/changeset/189536
562
563         "[css-grid] Percentage columns shouldn't include border and
564         padding"
565         https://bugs.webkit.org/show_bug.cgi?id=148978
566         http://trac.webkit.org/changeset/189538
567
568 2015-09-08  David Hyatt  <hyatt@apple.com>
569
570         REGRESSION: Inline-block baseline is wrong when zero-width replaced child is present
571         https://bugs.webkit.org/show_bug.cgi?id=147452
572         rdar://problem/21943074
573
574         Reviewed by Myles Maxfield.
575
576         Added new test in fast/inline-block
577
578         Treat zero width replaced elements the same as replaced elements with width. Instead of
579         clearing floats based off having no committed width, we instead track both committed
580         width and committed replaced objects. We do this with two new booleans in LineWidth
581         so that we know when we have uncomitted and committed replaced objects.
582
583         * rendering/line/BreakingContext.h:
584         (WebCore::BreakingContext::handleReplaced):
585         (WebCore::BreakingContext::handleText):
586         (WebCore::BreakingContext::canBreakAtThisPosition):
587         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
588         * rendering/line/LineWidth.cpp:
589         (WebCore::LineWidth::LineWidth):
590         (WebCore::LineWidth::commit):
591         (WebCore::LineWidth::applyOverhang):
592         * rendering/line/LineWidth.h:
593         (WebCore::LineWidth::committedWidth):
594         (WebCore::LineWidth::availableWidth):
595         (WebCore::LineWidth::logicalLeftOffset):
596         (WebCore::LineWidth::hasCommitted):
597         (WebCore::LineWidth::addUncommittedWidth):
598         (WebCore::LineWidth::addUncommittedReplacedWidth):
599
600 2015-09-09  Antti Koivisto  <antti@apple.com>
601
602         Split mixed font GlyphPage functionality to separate class
603         https://bugs.webkit.org/show_bug.cgi?id=148965
604
605         Reviewed by Myles Maxfield.
606
607         Currently GlyphPage class is used for both immutable single font case (in Font) and
608         for caching mixed font mappings (in FontCascadeFonts). It is cleaner to use separate
609         classed for these cases. This will also make future improvements easier.
610
611         * platform/graphics/Font.cpp:
612         (WebCore::Font::~Font):
613         (WebCore::fillGlyphPage):
614         (WebCore::createAndFillGlyphPage):
615         (WebCore::Font::glyphPage):
616         (WebCore::Font::glyphForCharacter):
617         (WebCore::Font::glyphDataForCharacter):
618         * platform/graphics/Font.h:
619         * platform/graphics/FontCascadeFonts.cpp:
620         (WebCore::MixedFontGlyphPage::MixedFontGlyphPage):
621         (WebCore::MixedFontGlyphPage::glyphDataForCharacter):
622         (WebCore::MixedFontGlyphPage::setGlyphDataForCharacter):
623         (WebCore::MixedFontGlyphPage::setGlyphDataForIndex):
624
625             Mixed font pages are now an implementation detail of FontCascadeFonts.
626
627         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::glyphDataForCharacter):
628         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setGlyphDataForCharacter):
629         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setSingleFontPage):
630
631             Cache entry is either shared single font GlyphPage or mutable MixedFontGlyphPage.
632
633         (WebCore::FontCascadeFonts::FontCascadeFonts):
634         (WebCore::FontCascadeFonts::glyphDataForCharacter):
635         (WebCore::FontCascadeFonts::pruneSystemFallbacks):
636         * platform/graphics/FontCascadeFonts.h:
637         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isNull):
638         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isMixedFont):
639         * platform/graphics/GlyphPage.h:
640
641             GlyphPage is now for single font mappings only.
642             Use regular allocation instead of variable size tricks.
643             It is always immutable after initialization (though currently a setter is still needed).
644
645         (WebCore::GlyphPage::create):
646         (WebCore::GlyphPage::~GlyphPage):
647         (WebCore::GlyphPage::count):
648         (WebCore::GlyphPage::indexForCharacter):
649         (WebCore::GlyphPage::glyphDataForCharacter):
650         (WebCore::GlyphPage::glyphForCharacter):
651         (WebCore::GlyphPage::glyphDataForIndex):
652         (WebCore::GlyphPage::glyphForIndex):
653         (WebCore::GlyphPage::setGlyphForIndex):
654         (WebCore::GlyphPage::font):
655         (WebCore::GlyphPage::GlyphPage):
656         (WebCore::GlyphPage::createForMixedFonts): Deleted.
657         (WebCore::GlyphPage::createCopyForMixedFonts): Deleted.
658         (WebCore::GlyphPage::createForSingleFont): Deleted.
659         (WebCore::GlyphPage::isImmutable): Deleted.
660         (WebCore::GlyphPage::setImmutable): Deleted.
661         (WebCore::GlyphPage::glyphAt): Deleted.
662         (WebCore::GlyphPage::fontForCharacter): Deleted.
663         (WebCore::GlyphPage::setGlyphDataForCharacter): Deleted.
664         (WebCore::GlyphPage::setGlyphDataForIndex): Deleted.
665         (WebCore::GlyphPage::hasPerGlyphFontData): Deleted.
666         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
667         (WebCore::GlyphPage::fill):
668         * platform/graphics/mac/GlyphPageMac.cpp:
669         (WebCore::GlyphPage::fill):
670         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
671         (WebCore::OpenTypeVerticalData::substituteWithVerticalGlyphs):
672         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
673         (WebCore::GlyphPage::fill):
674         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
675         (WebCore::GlyphPage::fill):
676         * svg/SVGFontData.cpp:
677         (WebCore::SVGFontData::applySVGGlyphSelection):
678         (WebCore::SVGFontData::fillSVGGlyphPage):
679         (WebCore::SVGFontData::fillBMPGlyphs):
680         (WebCore::SVGFontData::fillNonBMPGlyphs):
681         * svg/SVGFontData.h:
682         (WebCore::SVGFontData::verticalAdvanceY):
683
684 2015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
685
686         [css-grid] Percentage columns shouldn't include border and padding
687         https://bugs.webkit.org/show_bug.cgi?id=148978
688
689         Reviewed by Sergio Villar Senin.
690
691         Subtract border and padding when we're calculating the breadth of the
692         columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
693
694         Added test to check the behavior for both columns and rows.
695
696         Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
697
698         * rendering/RenderGrid.cpp:
699         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
700
701 2015-09-09  Chris Dumez  <cdumez@apple.com>
702
703         HTMLTableElement.tHead / tFoot / caption should be nullable
704         https://bugs.webkit.org/show_bug.cgi?id=148991
705
706         Reviewed by Ryosuke Niwa.
707
708         According to the specification, HTMLTableElement.tHead / tFoot / caption
709         should be nullable:
710         https://html.spec.whatwg.org/multipage/tables.html#htmltableelement
711
712         Upon assigning null, we are supposed to remove the existing tHead / tFoot
713         / caption element. However, we had a bug causing us to throw an exception
714         after removing the element. This is because we would try to insert a null
715         element and ContainerNode::insertBefore() throws when doing so.
716
717         Also, as per the specification, setting tHead / tFoot to something else
718         than a thead / tfoot element should throw a HierarchyRequestError:
719         https://html.spec.whatwg.org/multipage/tables.html#dom-table-thead
720         https://html.spec.whatwg.org/multipage/tables.html#dom-table-tfoot
721
722         Previously, WebKit did not check the tag and was happy inserting the
723         element as long as it was an HTMLTableSectionElement. This means that
724         you could set a tfoot by assigning table.tHead.
725
726         This patch corrects both bugs and adds test coverage for it.
727
728         Test: fast/dom/HTMLTableElement/nullable-attributes.html
729
730         * html/HTMLTableElement.cpp:
731         (WebCore::HTMLTableElement::setCaption):
732         Only call insertBefore() if newCaption is not null as insertBefore()
733         will throw an exception otherwise.
734
735         (WebCore::HTMLTableElement::setTHead):
736         - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
737           null or a <thead> element, as per the specification.
738         - Only call insertBefore() if newHead is not null as insertBefore()
739           will throw an exception otherwise.
740
741         (WebCore::HTMLTableElement::setTFoot):
742         - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
743           null or a <tfoot> element, as per the specification.
744         - Only call insertBefore() if newFoot is not null as insertBefore()
745           will throw an exception otherwise.
746
747         * html/HTMLTableElement.idl:
748         Use [StrictTypeChecking] for these 3 attributes so that the bindings
749         will throw a TypeError if the JS tries to assign a value with the
750         wrong type. When the implementation is called with null, we now know
751         this is because the JS assigned null (and not an invalid value).
752         This is important as assigning null is valid since those attributes
753         are nullable.
754
755 2015-06-26  Sergio Villar Senin  <svillar@igalia.com>
756
757         min-width/height should default to auto for flexbox items
758         https://bugs.webkit.org/show_bug.cgi?id=146020
759
760         Reviewed by David Hyatt.
761
762         Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
763
764         As specified here
765         http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
766         value of min-{width|height} is auto for flex items.
767
768         In case this patch breaks any website (as it's changing the
769         default value of those properties) the fix is likely to add:
770
771         min-width: 0;
772         min-height: 0;
773
774         to any relevant flexitems.
775
776         Test: css3/flexbox/min-size-auto.html
777
778         * css/CSSComputedStyleDeclaration.cpp:
779         (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
780         (WebCore::ComputedStyleExtractor::propertyValue): Return auto
781         for flex items if min-width/height is auto.
782         * css/CSSParser.cpp:
783         (WebCore::CSSParser::parseValue):
784         * html/shadow/SliderThumbElement.cpp:
785         * rendering/RenderBox.cpp:
786         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
787         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
788         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
789         (WebCore::RenderBox::computeLogicalHeight):
790         (WebCore::RenderBox::computeLogicalHeightUsing):
791         (WebCore::RenderBox::computeContentLogicalHeight):
792         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
793         (WebCore::RenderBox::computeReplacedLogicalWidth):
794         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
795         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
796         (WebCore::RenderBox::computeReplacedLogicalHeight):
797         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
798         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
799         (WebCore::RenderBox::availableLogicalHeightUsing):
800         (WebCore::RenderBox::computePositionedLogicalWidth):
801         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
802         (WebCore::RenderBox::computePositionedLogicalHeight):
803         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
804         * rendering/RenderBox.h:
805         * rendering/RenderButton.h:
806         * rendering/RenderFlexibleBox.cpp:
807         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
808         (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
809         (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
810         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
811         (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
812         * rendering/RenderFlexibleBox.h:
813         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
814         * rendering/RenderFullScreen.h:
815         * rendering/RenderGrid.cpp:
816         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
817         * rendering/RenderMediaControlElements.h:
818         * rendering/RenderMenuList.cpp:
819         (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
820         the min-width explicitly.
821         * rendering/RenderMenuList.h:
822         * rendering/RenderMultiColumnSet.cpp:
823         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
824         * rendering/RenderNamedFlowFragment.cpp:
825         (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
826         * rendering/RenderReplaced.cpp:
827         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
828         (WebCore::RenderReplaced::computeReplacedLogicalHeight):
829         * rendering/RenderSlider.h:
830         * rendering/RenderTextControl.h:
831         * rendering/RenderTextControlSingleLine.cpp:
832         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
833         the min-width explicitly.
834         * rendering/mathml/RenderMathMLBlock.h:
835         * rendering/style/RenderStyle.h:
836
837 2015-09-08  Joseph Pecoraro  <pecoraro@apple.com>
838
839         Web Inspector: No need for [Custom] Implementation of some InspectorFrontendHost methods
840         https://bugs.webkit.org/show_bug.cgi?id=148990
841
842         Reviewed by Timothy Hatcher.
843
844         * bindings/js/JSInspectorFrontendHostCustom.cpp:
845         (WebCore::JSInspectorFrontendHost::platform): Deleted.
846         (WebCore::JSInspectorFrontendHost::port): Deleted.
847         * inspector/InspectorFrontendHost.cpp:
848         (WebCore::InspectorFrontendHost::platform):
849         (WebCore::InspectorFrontendHost::port):
850         * inspector/InspectorFrontendHost.h:
851         * inspector/InspectorFrontendHost.idl:
852         Uncustomize a few basic functions.
853
854 2015-09-08  Michael Catanzaro  <mcatanzaro@igalia.com>
855
856         Crash when WebCore::SQLiteFileSystem::openDatabase is called from multiple threads
857         https://bugs.webkit.org/show_bug.cgi?id=143245
858
859         Reviewed by Darin Adler.
860
861         sqlite3_initialize is documented to be thread-safe, and to be called automatically by the
862         library when needed, so applications should never need to call it directly. The problem is,
863         it's not thread-safe: we have documented instances of GNOME Builder, Devhelp, Epiphany, and
864         cinnamon-screensaver crashing when sqlite3_initialize is called simultaneously in separate
865         threads (usually inside sqlite3_open). So call it manually, guarded using std::call_once, to
866         make sure that the library is fully initialized before the first call to sqlite3_open. It's
867         a good idea to do this regardless, because the documentation says it could be required in
868         a future release of SQLite. (Though the use of std::call_once should not be needed, and is
869         only used to attempt to work around the crashes.)
870
871         This is a workaround for an SQLite bug that might have been fixed upstream, but the SQLite
872         developers are not really confident in the thread-safety of this function, and have advised
873         that we carry the workaround. Seems like a good idea.
874
875         * platform/sql/SQLiteDatabase.cpp:
876         (WebCore::SQLiteDatabase::SQLiteDatabase):
877
878 2015-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
879
880         Unify symbolTablePut in JSLexicalEnvironment and JSSymbolTableObject
881         https://bugs.webkit.org/show_bug.cgi?id=148783
882
883         Reviewed by Geoffrey Garen.
884
885         No behavior change.
886
887         * bindings/js/JSDOMWindowBase.cpp:
888         (WebCore::JSDOMWindowBase::updateDocument):
889
890 2015-09-08  Brian Burg  <bburg@apple.com>
891
892         Several inspector-protocol tests are flaky with GuardMalloc
893         https://bugs.webkit.org/show_bug.cgi?id=136715
894
895         Reviewed by Joseph Pecoraro.
896
897         Sometimes, the async dispatch task can outlive its owning frontend client.
898         To avoid problems, make it refcounted instead and add a protector reference.
899
900         No new tests, covered by existing tests.
901
902         * inspector/InspectorFrontendClientLocal.cpp:
903         (WebCore::InspectorBackendDispatchTask::create):
904         (WebCore::InspectorBackendDispatchTask::dispatch):
905         (WebCore::InspectorBackendDispatchTask::reset):
906         (WebCore::InspectorBackendDispatchTask::timerFired):
907         (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
908         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
909         (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
910         * inspector/InspectorFrontendClientLocal.h:
911
912 2015-09-08  Chris Dumez  <cdumez@apple.com>
913
914         new Comment(undefined) / new Text(undefined) should use default's empty string
915         https://bugs.webkit.org/show_bug.cgi?id=148973
916         <rdar://problem/22548042>
917
918         Reviewed by Ryosuke Niwa.
919
920         new Comment(undefined) / new Text(undefined) should use default's empty string instead of converting
921         undefined to the "undefined" string:
922         - https://dom.spec.whatwg.org/#interface-comment (parameter is optional, default value is empty String)
923         - https://dom.spec.whatwg.org/#text (ditto)
924
925         undefined should be treated as if the parameter is missing, in the case the parameter is optional, as
926         per the Web IDL specification. This patch aligns WebKit's behavior with the specification and the
927         behavior of Firefox and Chrome.
928
929         No new tests, already covered by existing tests.
930
931         * bindings/scripts/CodeGeneratorJS.pm:
932         (GenerateParametersCheck):
933         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
934         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
935         * bindings/scripts/test/JS/JSTestObj.cpp:
936         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
937
938 2015-09-08  Chris Dumez  <cdumez@apple.com>
939
940         document.importNode(node, deep): deep's default value should be false
941         https://bugs.webkit.org/show_bug.cgi?id=148959
942         <rdar://problem/22558915>
943
944         Reviewed by Alexey Proskuryakov.
945
946         Switch deep parameter's default value for document.importNode() to
947         false, as per the latest DOM specification:
948         - https://dom.spec.whatwg.org/#interface-document
949         - https://dom.spec.whatwg.org/#dom-document-importnode
950
951         Firefox and Chrome follow the specification. However, WebKit was using
952         "true" for deep's default value.
953
954         No new tests, already covered by:
955         imported/w3c/web-platform-tests/dom/nodes/Document-importNode.html
956
957         * dom/Document.h:
958         (WebCore::Document::importNode):
959
960 2015-09-08  Per Arne Vollan  <peavo@outlook.com>
961
962         [Win][HighDPI] Video window placement is incorrect.
963         https://bugs.webkit.org/show_bug.cgi?id=148954
964
965         Reviewed by Alex Christensen.
966
967         We need to scale window dimensions with device scale factor.
968
969         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
970         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
971
972 2015-09-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
973
974         Reduce uses of PassRefPtr in fileapi
975         https://bugs.webkit.org/show_bug.cgi?id=148952
976
977         Reviewed by Andreas Kling.
978
979         Remove all uses of PassRefPtr in return type. Argument uses of PassRefPtr will be
980         removed in near future.
981
982         * fileapi/FileError.h:
983         (WebCore::FileError::create):
984         * fileapi/FileReader.cpp:
985         (WebCore::FileReader::arrayBufferResult):
986         * fileapi/FileReader.h:
987         * fileapi/FileReaderLoader.cpp:
988         (WebCore::FileReaderLoader::arrayBufferResult):
989         * fileapi/FileReaderLoader.h:
990         * fileapi/FileReaderSync.cpp:
991         (WebCore::FileReaderSync::readAsArrayBuffer):
992         * fileapi/FileReaderSync.h:
993         * fileapi/ThreadableBlobRegistry.cpp:
994         (WebCore::ThreadableBlobRegistry::getCachedOrigin):
995         * fileapi/ThreadableBlobRegistry.h:
996
997 2015-09-07  Chris Fleizach  <cfleizach@apple.com>
998
999         AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
1000         https://bugs.webkit.org/show_bug.cgi?id=148891
1001
1002         Reviewed by Mario Sanchez Prada.
1003
1004         Undo the asynchronous dispatch of accessibility setting values on pre El Capitan machines
1005         because it causes focus to not sync correctly.
1006
1007         Test: accessibility/mac/focus-moves-cursor.html
1008
1009         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1010         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
1011         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1012
1013 2015-09-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1014
1015         [CoordinatedGraphics] Remove ScrollingStateScrollingNodeCoordinatedGraphics.cpp
1016         https://bugs.webkit.org/show_bug.cgi?id=148931
1017
1018         Reviewed by Csaba Osztrogonác.
1019
1020         ScrollingStateScrollingNodeCoordinatedGraphics.cpp implements nothing. Removed it.
1021
1022         * PlatformEfl.cmake:
1023         * PlatformGTK.cmake:
1024         * WebCore.vcxproj/WebCore.vcxproj:
1025         * WebCore.vcxproj/WebCore.vcxproj.filters:
1026         * page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp: Removed.
1027
1028 2015-09-07  Daniel Bates  <dabates@apple.com>
1029
1030         ASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::get(); update form
1031         association after subtree insertion
1032         https://bugs.webkit.org/show_bug.cgi?id=148919
1033         <rdar://problem/21868036>
1034
1035         Reviewed by Andy Estes.
1036
1037         Currently we update the form association of a form control upon insertion into
1038         the document. Instead we should update the form association of a form control
1039         after its containing subtree is inserted into the document to avoid an assertion
1040         failure when the containing subtree has an element whose id is identical to both
1041         the id of some other element in the document and the name of the form referenced
1042         by the inserted form control.
1043
1044         Tests: fast/forms/update-form-owner-in-moved-subtree-assertion-failure-2.html
1045                fast/forms/update-form-owner-in-moved-subtree-assertion-failure-3.html
1046                fast/forms/update-form-owner-in-moved-subtree-assertion-failure-4.html
1047                fast/forms/update-form-owner-in-moved-subtree-assertion-failure.html
1048
1049         * html/FormAssociatedElement.cpp:
1050         (WebCore::FormAssociatedElement::insertedInto): Moved resetFormOwner() from here
1051         to {HTMLFormControlElement, HTMLObjectElement}::finishedInsertingSubtree().
1052         * html/HTMLFormControlElement.cpp:
1053         (WebCore::HTMLFormControlElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree
1054         so that HTMLFormControlElement::finishedInsertingSubtree() is called.
1055         (WebCore::HTMLFormControlElement::finishedInsertingSubtree): Added; turn around and
1056         call FormAssociatedElement::resetFormOwner().
1057         * html/HTMLFormControlElement.h:
1058         * html/HTMLInputElement.cpp:
1059         (WebCore::HTMLInputElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
1060         that HTMLInputElement::finishedInsertingSubtree() is called and move logic to update radio button
1061         group from here...
1062         (WebCore::HTMLInputElement::finishedInsertingSubtree): to here.
1063         * html/HTMLInputElement.h:
1064         * html/HTMLObjectElement.cpp:
1065         (WebCore::HTMLObjectElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
1066         that HTMLObjectElement::finishedInsertingSubtree() is called.
1067         (WebCore::HTMLObjectElement::finishedInsertingSubtree): Added; turn around and
1068         call FormAssociatedElement::resetFormOwner().
1069         * html/HTMLObjectElement.h:
1070         * html/HTMLSelectElement.cpp:
1071         (WebCore::HTMLSelectElement::insertedInto): Modified to return the result of
1072         HTMLFormControlElementWithState::insertedInto(), which may schedule a callback after subtree
1073         insertion.
1074         * html/HTMLTextFormControlElement.cpp:
1075         (WebCore::HTMLTextFormControlElement::insertedInto): Ditto.
1076
1077 2015-09-07  Antti Koivisto  <antti@apple.com>
1078
1079         Remove GlyphPage::mayUseMixedFontsWhenFilling
1080         https://bugs.webkit.org/show_bug.cgi?id=148928
1081
1082         Reviewed by Dan Bernstein.
1083
1084         http://trac.webkit.org/188566 removed support for composite fonts. We never need to use mixed
1085         glyph pages for fonts anymore.
1086
1087         * platform/graphics/Font.cpp:
1088         (WebCore::createAndFillGlyphPage):
1089         * platform/graphics/GlyphPage.h:
1090         (WebCore::GlyphPage::GlyphPage):
1091         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
1092         * platform/graphics/mac/GlyphPageMac.cpp:
1093         (WebCore::shouldUseCoreText):
1094         (WebCore::GlyphPage::fill):
1095         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
1096
1097 2015-09-07  Antti Koivisto  <antti@apple.com>
1098
1099         Remove unneeded offset and length arguments from glyph page filling functions
1100         https://bugs.webkit.org/show_bug.cgi?id=148929
1101
1102         Reviewed by Andreas Kling.
1103
1104         They are always passed 0/GlyphPage::size.
1105
1106         * platform/graphics/Font.cpp:
1107         (WebCore::Font::~Font):
1108         (WebCore::fillGlyphPage):
1109         (WebCore::createAndFillGlyphPage):
1110         * platform/graphics/Font.h:
1111         * platform/graphics/GlyphPage.h:
1112         (WebCore::GlyphPage::setGlyphDataForIndex):
1113         * platform/graphics/mac/GlyphPageMac.cpp:
1114         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling):
1115         (WebCore::GlyphPage::fill):
1116         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
1117         (WebCore::GlyphPage::fill):
1118         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
1119         (WebCore::GlyphPage::fill):
1120         * svg/SVGFontData.cpp:
1121         (WebCore::SVGFontData::applySVGGlyphSelection):
1122         (WebCore::SVGFontData::fillSVGGlyphPage):
1123         (WebCore::SVGFontData::fillBMPGlyphs):
1124         (WebCore::SVGFontData::fillNonBMPGlyphs):
1125         * svg/SVGFontData.h:
1126         (WebCore::SVGFontData::verticalAdvanceY):
1127
1128 2015-09-06  Chris Dumez  <cdumez@apple.com>
1129
1130         dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
1131         https://bugs.webkit.org/show_bug.cgi?id=148800
1132         <rdar://problem/22565782>
1133         <rdar://problem/22565485>
1134
1135         Reviewed by Geoffrey Garen.
1136
1137         dispatchEvent() should throw an InvalidStateError if the event's
1138         initialized flag is not set or its dispatch flag is set, and should
1139         allow dispatching events with an empty type as long as it is
1140         initialized:
1141         https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
1142
1143         Previously, WebKit relied on the event type being empty to throw a
1144         UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
1145         exception type is outdated and initializing Event.type to an empty
1146         string is legal.
1147
1148         No new tests, already covered by existing tests that were rebaselined.
1149
1150         * dom/Event.cpp:
1151         (WebCore::Event::Event):
1152         (WebCore::Event::initEvent):
1153         * dom/Event.h:
1154         (WebCore::Event::isInitialized):
1155         * dom/EventTarget.cpp:
1156         (WebCore::EventTarget::dispatchEvent):
1157
1158 2015-09-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1159
1160         XHR2 timeout property should allow late updates
1161         https://bugs.webkit.org/show_bug.cgi?id=98156
1162
1163         Reviewed by Darin Adler.
1164
1165         Adding a timer within XMLHttpRequest to handle timeouts for asynchronous requests.
1166         This allows easy update of the timeout even after request is sent.
1167         Timeout is still handled by the network backend for synchronous requests (Web worker context).
1168
1169         Covered by updated tests.
1170
1171         * xml/XMLHttpRequest.cpp:
1172         (WebCore::XMLHttpRequest::XMLHttpRequest): Adding timeout timer initialization.
1173         (WebCore::XMLHttpRequest::setTimeout): Updating timeout timer state if request is sent.
1174         (WebCore::XMLHttpRequest::createRequest): Starting timeout timer if needed.
1175         (WebCore::XMLHttpRequest::internalAbort): Stopping timeout timer if needed.
1176         (WebCore::XMLHttpRequest::didFail): Adding comment.
1177         (WebCore::XMLHttpRequest::didFinishLoading): Stopping timeout timer if needed.
1178         * xml/XMLHttpRequest.h:
1179
1180 2015-09-05  Jaehun Lim  <ljaehun.lim@samsung.com>
1181
1182         Remove unused macros from StyleResolver.cpp
1183         https://bugs.webkit.org/show_bug.cgi?id=148163
1184
1185         Reviewed by Andreas Kling.
1186
1187         HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL are not used after
1188         StyleBuilder refactoring.
1189
1190         No new tests because there is no behavior change.
1191
1192         * css/StyleResolver.cpp:
1193         Remove HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL.
1194
1195 2015-09-05  Brian Burg  <bburg@apple.com>
1196
1197         Web Inspector: tighten up lifetimes for Agent-owned objects, and initialize agents using contexts
1198         https://bugs.webkit.org/show_bug.cgi?id=148625
1199
1200         Reviewed by Joseph Pecoraro.
1201
1202         All agents own their domain-specific frontend and backend dispatchers. Change so that
1203         they are initialized in constructors rather than when a frontend connects or disconnects.
1204         This may cause additional memory use, but this can be counteracted by lazily creating
1205         some agents that are not required for other agents to function (i.e., runtime and page agents).
1206
1207         To avoid adding frontend/backend dispatcher arguments to every single agent constructor,
1208         change agent construction to take a AgentContext or a subclass of it. This provides agents with
1209         references to objects in the owning InspectorEnvironment subclass that are guaranteed to
1210         outlive all agents. AgentContext and its subclasses follow the existing Agent class hierarchy.
1211
1212         No new tests, no behavior changed.
1213
1214         * bindings/js/WorkerScriptDebugServer.cpp:
1215         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
1216         (WebCore::WorkerScriptDebugServer::addListener):
1217         (WebCore::WorkerScriptDebugServer::removeListener):
1218         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
1219         * bindings/js/WorkerScriptDebugServer.h:
1220         * inspector/InspectorApplicationCacheAgent.cpp:
1221         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
1222         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
1223         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
1224         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
1225         * inspector/InspectorApplicationCacheAgent.h:
1226         * inspector/InspectorCSSAgent.cpp:
1227         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
1228         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
1229         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
1230         * inspector/InspectorCSSAgent.h:
1231         * inspector/InspectorController.cpp:
1232         (WebCore::InspectorController::InspectorController):
1233         * inspector/InspectorDOMAgent.cpp:
1234         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
1235         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
1236         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
1237         * inspector/InspectorDOMAgent.h:
1238         * inspector/InspectorDOMDebuggerAgent.cpp:
1239         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
1240         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
1241         (WebCore::InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend):
1242         * inspector/InspectorDOMDebuggerAgent.h:
1243         * inspector/InspectorDOMStorageAgent.cpp:
1244         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
1245         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
1246         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1247         (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend):
1248         * inspector/InspectorDOMStorageAgent.h:
1249         * inspector/InspectorDatabaseAgent.cpp:
1250         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
1251         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
1252         (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend):
1253         * inspector/InspectorDatabaseAgent.h:
1254         * inspector/InspectorIndexedDBAgent.cpp:
1255         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
1256         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
1257         (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend):
1258         * inspector/InspectorIndexedDBAgent.h:
1259         * inspector/InspectorInstrumentation.cpp:
1260         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
1261         * inspector/InspectorLayerTreeAgent.cpp:
1262         (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
1263         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
1264         (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend):
1265         * inspector/InspectorLayerTreeAgent.h:
1266         * inspector/InspectorPageAgent.cpp:
1267         (WebCore::InspectorPageAgent::InspectorPageAgent):
1268         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
1269         (WebCore::InspectorPageAgent::enable):
1270         (WebCore::InspectorPageAgent::reload):
1271         (WebCore::InspectorPageAgent::navigate):
1272         (WebCore::InspectorPageAgent::getCookies):
1273         (WebCore::InspectorPageAgent::deleteCookie):
1274         (WebCore::InspectorPageAgent::getResourceTree):
1275         (WebCore::InspectorPageAgent::searchInResources):
1276         (WebCore::InspectorPageAgent::getScriptExecutionStatus):
1277         (WebCore::InspectorPageAgent::setScriptExecutionDisabled):
1278         (WebCore::InspectorPageAgent::mainFrame):
1279         (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
1280         (WebCore::InspectorPageAgent::buildObjectForFrame):
1281         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
1282         (WebCore::InspectorPageAgent::setEmulatedMedia):
1283         (WebCore::InspectorPageAgent::getCompositingBordersVisible):
1284         (WebCore::InspectorPageAgent::setCompositingBordersVisible):
1285         (WebCore::InspectorPageAgent::snapshotNode):
1286         (WebCore::InspectorPageAgent::snapshotRect):
1287         (WebCore::InspectorPageAgent::archive):
1288         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
1289         * inspector/InspectorPageAgent.h:
1290         * inspector/InspectorReplayAgent.cpp:
1291         (WebCore::InspectorReplayAgent::InspectorReplayAgent):
1292         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
1293         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
1294         * inspector/InspectorReplayAgent.h:
1295         * inspector/InspectorResourceAgent.cpp:
1296         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
1297         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
1298         (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend):
1299         * inspector/InspectorResourceAgent.h:
1300         * inspector/InspectorTimelineAgent.cpp:
1301         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
1302         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
1303         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
1304         (WebCore::InspectorTimelineAgent::page):
1305         * inspector/InspectorTimelineAgent.h:
1306         * inspector/InspectorWebAgentBase.h:
1307         (WebCore::WebAgentContext::WebAgentContext):
1308         (WebCore::PageAgentContext::PageAgentContext):
1309         (WebCore::WorkerAgentContext::WorkerAgentContext):
1310         (WebCore::InspectorAgentBase::InspectorAgentBase):
1311         * inspector/InspectorWorkerAgent.cpp:
1312         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
1313         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
1314         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
1315         * inspector/InspectorWorkerAgent.h:
1316         * inspector/PageConsoleAgent.cpp:
1317         (WebCore::PageConsoleAgent::PageConsoleAgent):
1318         * inspector/PageConsoleAgent.h:
1319         * inspector/PageDebuggerAgent.cpp:
1320         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
1321         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
1322         (WebCore::PageDebuggerAgent::breakpointActionLog):
1323         (WebCore::PageDebuggerAgent::injectedScriptForEval):
1324         * inspector/PageDebuggerAgent.h:
1325         * inspector/PageRuntimeAgent.cpp:
1326         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
1327         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
1328         (WebCore::PageRuntimeAgent::injectedScriptForEval):
1329         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
1330         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend):
1331         * inspector/PageRuntimeAgent.h:
1332         * inspector/WebConsoleAgent.cpp:
1333         (WebCore::WebConsoleAgent::WebConsoleAgent):
1334         * inspector/WebConsoleAgent.h:
1335         * inspector/WebDebuggerAgent.cpp:
1336         (WebCore::WebDebuggerAgent::WebDebuggerAgent):
1337         * inspector/WebDebuggerAgent.h:
1338         * inspector/WorkerConsoleAgent.cpp:
1339         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
1340         * inspector/WorkerConsoleAgent.h:
1341         * inspector/WorkerDebuggerAgent.cpp:
1342         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
1343         (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
1344         (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
1345         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
1346         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
1347         * inspector/WorkerDebuggerAgent.h:
1348         * inspector/WorkerInspectorController.cpp:
1349         (WebCore::WorkerInspectorController::WorkerInspectorController):
1350         * inspector/WorkerRuntimeAgent.cpp:
1351         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
1352         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
1353         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
1354         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
1355         * inspector/WorkerRuntimeAgent.h:
1356
1357 2015-09-04  Brian Burg  <bburg@apple.com>
1358
1359         Web Inspector: agents should send messages through FrontendRouter instead of FrontendChannel
1360         https://bugs.webkit.org/show_bug.cgi?id=148492
1361
1362         Reviewed by Joseph Pecoraro.
1363
1364         Replace uses of FrontendChannel with FrontendRouter. Minor code cleanup along the way.
1365
1366         No new tests, no behavior changed.
1367
1368         * WebCore.vcxproj/WebCore.vcxproj:
1369         * WebCore.vcxproj/WebCore.vcxproj.filters:
1370         * WebCore.xcodeproj/project.pbxproj:
1371         * inspector/InspectorApplicationCacheAgent.cpp:
1372         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
1373         * inspector/InspectorApplicationCacheAgent.h:
1374         * inspector/InspectorCSSAgent.cpp:
1375         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
1376         * inspector/InspectorCSSAgent.h:
1377         * inspector/InspectorController.cpp:
1378         (WebCore::InspectorController::connectFrontend):
1379         (WebCore::InspectorController::~InspectorController): No need to call discardAgents().
1380         * inspector/InspectorDOMAgent.cpp:
1381         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
1382         * inspector/InspectorDOMAgent.h:
1383         * inspector/InspectorDOMDebuggerAgent.cpp:
1384         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
1385         * inspector/InspectorDOMDebuggerAgent.h:
1386         * inspector/InspectorDOMStorageAgent.cpp:
1387         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
1388         * inspector/InspectorDOMStorageAgent.h:
1389         * inspector/InspectorDatabaseAgent.cpp:
1390         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
1391         * inspector/InspectorDatabaseAgent.h:
1392         * inspector/InspectorForwarding.h: Removed.
1393         * inspector/InspectorIndexedDBAgent.cpp:
1394         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
1395         * inspector/InspectorIndexedDBAgent.h:
1396         * inspector/InspectorLayerTreeAgent.cpp:
1397         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
1398         * inspector/InspectorLayerTreeAgent.h:
1399         * inspector/InspectorPageAgent.cpp:
1400         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
1401         * inspector/InspectorPageAgent.h:
1402         * inspector/InspectorReplayAgent.cpp:
1403         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
1404         * inspector/InspectorReplayAgent.h:
1405         * inspector/InspectorResourceAgent.cpp:
1406         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
1407         * inspector/InspectorResourceAgent.h:
1408         * inspector/InspectorTimelineAgent.cpp:
1409         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
1410         * inspector/InspectorTimelineAgent.h:
1411         * inspector/InspectorWebAgentBase.h:
1412         * inspector/InspectorWorkerAgent.cpp:
1413         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
1414         * inspector/InspectorWorkerAgent.h:
1415         * inspector/PageRuntimeAgent.cpp:
1416         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
1417         * inspector/PageRuntimeAgent.h:
1418         * inspector/WorkerInspectorController.cpp:
1419         (WebCore::WorkerInspectorController::connectFrontend):
1420         * inspector/WorkerInspectorController.h:
1421         * inspector/WorkerRuntimeAgent.cpp:
1422         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
1423         * inspector/WorkerRuntimeAgent.h:
1424         * page/PageDebuggable.cpp:
1425         * testing/Internals.cpp:
1426
1427 2015-09-05  Joseph Pecoraro  <pecoraro@apple.com>
1428
1429         Add a new ResourceLoaderOption to avoid page defers loading mechanisms for inspector
1430         https://bugs.webkit.org/show_bug.cgi?id=148727
1431
1432         Reviewed by Antti Koivisto.
1433
1434         This will be tested shortly by inspector tests.
1435
1436         * loader/ResourceLoaderOptions.h:
1437         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
1438         (WebCore::ResourceLoaderOptions::defersLoadingPolicy):
1439         (WebCore::ResourceLoaderOptions::setDefersLoadingPolicy):
1440         Add a new policy for defers loading. The default is to allow defers loading.
1441
1442         * loader/ResourceLoader.cpp:
1443         (WebCore::ResourceLoader::ResourceLoader):
1444         (WebCore::ResourceLoader::init):
1445         (WebCore::ResourceLoader::setDefersLoading):
1446         Respect the defers loading policy whenever we would set defers loading status.
1447
1448         * inspector/InspectorResourceAgent.cpp:
1449         (WebCore::InspectorResourceAgent::loadResource):
1450         Switch from incorrectly changing the defersLoading state of the loader
1451         to setting an option to disallow defers loading entirely for the loader.
1452
1453         * loader/DocumentLoader.cpp:
1454         (WebCore::DocumentLoader::startLoadingMainResource):
1455         * loader/MediaResourceLoader.cpp:
1456         (WebCore::MediaResourceLoader::start):
1457         * loader/NetscapePlugInStreamLoader.cpp:
1458         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
1459         * loader/cache/CachedResourceLoader.cpp:
1460         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
1461         (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
1462         * loader/icon/IconLoader.cpp:
1463         (WebCore::IconLoader::startLoading):
1464         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1465         (WebCore::WebCoreAVCFResourceLoader::startLoading):
1466         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1467         (WebCore::WebCoreAVFResourceLoader::startLoading):
1468         Add the new value to instance of the longhand ResourceLoaderOptions constructor.
1469
1470 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
1471
1472         Rename members of CanvasRenderingContext2D::State
1473         https://bugs.webkit.org/show_bug.cgi?id=148889
1474
1475         Reviewed by Tim Horton.
1476
1477         CanvasRenderingContext2D::State is a struct, so its members should not start with m_.
1478
1479         No new tests because there is no behavior change.
1480
1481         * html/canvas/CanvasRenderingContext2D.cpp:
1482         (WebCore::CanvasRenderingContext2D::State::State):
1483         (WebCore::CanvasRenderingContext2D::State::operator=):
1484         (WebCore::CanvasRenderingContext2D::restore):
1485         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
1486         (WebCore::CanvasRenderingContext2D::setFillStyle):
1487         (WebCore::CanvasRenderingContext2D::lineWidth):
1488         (WebCore::CanvasRenderingContext2D::setLineWidth):
1489         (WebCore::CanvasRenderingContext2D::lineCap):
1490         (WebCore::CanvasRenderingContext2D::setLineCap):
1491         (WebCore::CanvasRenderingContext2D::lineJoin):
1492         (WebCore::CanvasRenderingContext2D::setLineJoin):
1493         (WebCore::CanvasRenderingContext2D::miterLimit):
1494         (WebCore::CanvasRenderingContext2D::setMiterLimit):
1495         (WebCore::CanvasRenderingContext2D::shadowOffsetX):
1496         (WebCore::CanvasRenderingContext2D::setShadowOffsetX):
1497         (WebCore::CanvasRenderingContext2D::shadowOffsetY):
1498         (WebCore::CanvasRenderingContext2D::setShadowOffsetY):
1499         (WebCore::CanvasRenderingContext2D::shadowBlur):
1500         (WebCore::CanvasRenderingContext2D::setShadowBlur):
1501         (WebCore::CanvasRenderingContext2D::shadowColor):
1502         (WebCore::CanvasRenderingContext2D::setShadowColor):
1503         (WebCore::CanvasRenderingContext2D::getLineDash):
1504         (WebCore::CanvasRenderingContext2D::setLineDash):
1505         (WebCore::CanvasRenderingContext2D::setWebkitLineDash):
1506         (WebCore::CanvasRenderingContext2D::lineDashOffset):
1507         (WebCore::CanvasRenderingContext2D::setLineDashOffset):
1508         (WebCore::CanvasRenderingContext2D::applyLineDash):
1509         (WebCore::CanvasRenderingContext2D::globalAlpha):
1510         (WebCore::CanvasRenderingContext2D::setGlobalAlpha):
1511         (WebCore::CanvasRenderingContext2D::globalCompositeOperation):
1512         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation):
1513         (WebCore::CanvasRenderingContext2D::scale):
1514         (WebCore::CanvasRenderingContext2D::rotate):
1515         (WebCore::CanvasRenderingContext2D::translate):
1516         (WebCore::CanvasRenderingContext2D::transform):
1517         (WebCore::CanvasRenderingContext2D::setTransform):
1518         (WebCore::CanvasRenderingContext2D::setStrokeColor):
1519         (WebCore::CanvasRenderingContext2D::setFillColor):
1520         (WebCore::CanvasRenderingContext2D::fillInternal):
1521         (WebCore::CanvasRenderingContext2D::strokeInternal):
1522         (WebCore::CanvasRenderingContext2D::clipInternal):
1523         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
1524         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
1525         (WebCore::CanvasRenderingContext2D::clearRect):
1526         (WebCore::CanvasRenderingContext2D::fillRect):
1527         (WebCore::CanvasRenderingContext2D::strokeRect):
1528         (WebCore::CanvasRenderingContext2D::setShadow):
1529         (WebCore::CanvasRenderingContext2D::applyShadow):
1530         (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
1531         (WebCore::CanvasRenderingContext2D::drawImage):
1532         (WebCore::CanvasRenderingContext2D::transformAreaToDevice):
1533         (WebCore::CanvasRenderingContext2D::rectContainsCanvas):
1534         (WebCore::CanvasRenderingContext2D::compositeBuffer):
1535         (WebCore::CanvasRenderingContext2D::didDraw):
1536         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
1537         (WebCore::CanvasRenderingContext2D::font):
1538         (WebCore::CanvasRenderingContext2D::setFont):
1539         (WebCore::CanvasRenderingContext2D::textAlign):
1540         (WebCore::CanvasRenderingContext2D::setTextAlign):
1541         (WebCore::CanvasRenderingContext2D::textBaseline):
1542         (WebCore::CanvasRenderingContext2D::setTextBaseline):
1543         (WebCore::CanvasRenderingContext2D::direction):
1544         (WebCore::CanvasRenderingContext2D::setDirection):
1545         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1546         (WebCore::CanvasRenderingContext2D::inflateStrokeRect):
1547         (WebCore::CanvasRenderingContext2D::imageSmoothingEnabled):
1548         (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled):
1549         * html/canvas/CanvasRenderingContext2D.h:
1550
1551 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
1552
1553         Crash when font completes downloading after calling 2D canvas setText() multiple times
1554         https://bugs.webkit.org/show_bug.cgi?id=148789
1555
1556         Reviewed by Darin Adler.
1557
1558         The CSSFontSelector has a list of clients, and when fonts complete downloading, these
1559         clients get a call back. CanvasRenderingContext2D::State is one such of these clients. However,
1560         the CSSFontSelector may be destroyed and recreated at any time. We were getting into a case
1561         where multiple CSSFontSelectors were thinking that the same CanvasRenderingContext2D::State were
1562         their client. When the CanvasRenderingContext2D::State was destroyed, it only unregistered
1563         itself from one of the CSSFontSelectors, which means the CSSFontSelector left over has a dangling
1564         pointer to it.
1565
1566         The solution is to implement a new helper class, FontProxy, to hold the
1567         CanvasRenderingContext2D::State's font, and maintain the invariant that this object is always
1568         registered to exactly one CSSFontSelector, and this CSSFontSelector is the one which is associated
1569         with the FontProxy's FontCascade object. This patch maintains this invariant, as well as protecting
1570         all access to the State's FontCascade object so no one can reach in and change it without going
1571         through functions which maintain the invariant.
1572
1573         Test: fast/canvas/font-selector-crash.html
1574
1575         * css/CSSFontSelector.cpp:
1576         (WebCore::CSSFontSelector::registerForInvalidationCallbacks):
1577         (WebCore::CSSFontSelector::unregisterForInvalidationCallbacks):
1578         (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
1579         * css/CSSFontSelector.h:
1580         * dom/Document.cpp:
1581         (WebCore::Document::fontsNeedUpdate):
1582         (WebCore::Document::fontSelector):
1583         (WebCore::Document::clearStyleResolver):
1584         * dom/Document.h:
1585         * html/canvas/CanvasRenderingContext2D.cpp:
1586         (WebCore::CanvasRenderingContext2D::State::State):
1587         (WebCore::CanvasRenderingContext2D::State::operator=):
1588         (WebCore::CanvasRenderingContext2D::FontProxy::~FontProxy):
1589         (WebCore::CanvasRenderingContext2D::FontProxy::FontProxy):
1590         (WebCore::CanvasRenderingContext2D::FontProxy::update):
1591         (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate):
1592         (WebCore::CanvasRenderingContext2D::FontProxy::initialize):
1593         (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
1594         (WebCore::CanvasRenderingContext2D::FontProxy::fontDescription):
1595         (WebCore::CanvasRenderingContext2D::FontProxy::width):
1596         (WebCore::CanvasRenderingContext2D::FontProxy::drawBidiText):
1597         (WebCore::CanvasRenderingContext2D::font):
1598         (WebCore::CanvasRenderingContext2D::setFont):
1599         (WebCore::CanvasRenderingContext2D::measureText):
1600         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1601         (WebCore::CanvasRenderingContext2D::State::~State): Deleted.
1602         (WebCore::CanvasRenderingContext2D::State::fontsNeedUpdate): Deleted.
1603         (WebCore::CanvasRenderingContext2D::accessFont): Deleted.
1604         * html/canvas/CanvasRenderingContext2D.h:
1605         * platform/graphics/FontSelector.h:
1606
1607 2015-09-04  Commit Queue  <commit-queue@webkit.org>
1608
1609         Unreviewed, rolling out r189386.
1610         https://bugs.webkit.org/show_bug.cgi?id=148883
1611
1612         Made several event dispatch tests assert (Requested by ap on
1613         #webkit).
1614
1615         Reverted changeset:
1616
1617         "dispatchEvent() should throw an InvalidStateError if the
1618         event's initialized flag is not set"
1619         https://bugs.webkit.org/show_bug.cgi?id=148800
1620         http://trac.webkit.org/changeset/189386
1621
1622 2015-09-04  Joseph Pecoraro  <pecoraro@apple.com>
1623
1624         Web Inspector: Add tests for DOM highlight commands
1625         https://bugs.webkit.org/show_bug.cgi?id=148786
1626
1627         Reviewed by Timothy Hatcher.
1628
1629         Tests: inspector/dom/hideHighlight.html
1630                inspector/dom/highlightFrame.html
1631                inspector/dom/highlightNode.html
1632                inspector/dom/highlightQuad.html
1633                inspector/dom/highlightRect.html
1634
1635         * inspector/InspectorDOMAgent.cpp:
1636         (WebCore::InspectorDOMAgent::highlightNode):
1637         (WebCore::InspectorDOMAgent::highlightFrame):
1638         Include an error if a frame is not found.
1639
1640         * inspector/InspectorOverlay.cpp:
1641         (WebCore::InspectorOverlay::highlightQuad):
1642         Should have been checking the usePageCoordinates state of the incoming
1643         highlight configuration, not the one that will be replaced.
1644
1645 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
1646
1647         Remove unnecessary compiler guards from mm files
1648         https://bugs.webkit.org/show_bug.cgi?id=148797
1649
1650         Reviewed by Dan Bernstein.
1651
1652         * bindings/objc/DOMInternal.mm:
1653         * bridge/objc/objc_instance.mm:
1654
1655 2015-09-04  Eric Carlson  <eric.carlson@apple.com>
1656
1657         [mediacontrols] Test AirPlay picker button
1658         https://bugs.webkit.org/show_bug.cgi?id=148836
1659
1660         Reviewed by Dean Jackson.
1661
1662         Test: media/controls/airplay-picker.html
1663
1664         * Modules/mediacontrols/mediaControlsApple.js:
1665         (Controller.prototype.getCurrentControlsStatus.elements.forEach.):
1666         (Controller.prototype.getCurrentControlsStatus):
1667
1668 2015-09-04  Chris Dumez  <cdumez@apple.com>
1669
1670         dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
1671         https://bugs.webkit.org/show_bug.cgi?id=148800
1672         <rdar://problem/22565782>
1673         <rdar://problem/22565485>
1674
1675         Reviewed by Geoffrey Garen.
1676
1677         dispatchEvent() should throw an InvalidStateError if the event's
1678         initialized flag is not set or its dispatch flag is set, and should
1679         allow dispatching events with an empty type as long as it is
1680         initialized:
1681         https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
1682
1683         Previously, WebKit relied on the event type being empty to throw a
1684         UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
1685         exception type is outdated and initializing Event.type to an empty
1686         string is legal.
1687
1688         No new tests, already covered by existing tests that were rebaselined.
1689
1690         * dom/Event.cpp:
1691         (WebCore::Event::Event):
1692         (WebCore::Event::initEvent):
1693         * dom/Event.h:
1694         (WebCore::Event::isInitialized):
1695         * dom/EventTarget.cpp:
1696         (WebCore::EventTarget::dispatchEvent):
1697
1698 2015-09-04  Beth Dakin  <bdakin@apple.com>
1699
1700         Speculative build fix.
1701
1702         * platform/spi/mac/NSEventSPI.h:
1703
1704 2015-09-04  Brian Burg  <bburg@apple.com>
1705
1706         Web Inspector: InspectorController should support multiple frontend channels
1707         https://bugs.webkit.org/show_bug.cgi?id=148538
1708
1709         Reviewed by Joseph Pecoraro.
1710
1711         No new tests, no behavior change from this patch. Teardown scenarios are
1712         covered by existing protocol and inspector tests running under DRT and WKTR.
1713
1714         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Added.
1715         * WebCore.vcxproj/WebCore.vcxproj:
1716         * inspector/InspectorClient.h: Stop using forwarded types.
1717         * inspector/InspectorController.cpp:
1718         (WebCore::InspectorController::InspectorController):
1719         (WebCore::InspectorController::inspectedPageDestroyed):
1720         (WebCore::InspectorController::hasLocalFrontend):
1721         (WebCore::InspectorController::hasRemoteFrontend):
1722         (WebCore::InspectorController::connectFrontend):
1723         (WebCore::InspectorController::disconnectFrontend):
1724         (WebCore::InspectorController::disconnectAllFrontends): Added. Disconnects all
1725         frontends and signals DisconnectReason::InspectedTargetDestroyed.
1726
1727         (WebCore::InspectorController::show):
1728         (WebCore::InspectorController::close):
1729         (WebCore::InspectorController::dispatchMessageFromFrontend):
1730         * inspector/InspectorController.h: Add default value for isAutomaticInspection.
1731         * inspector/InspectorDatabaseAgent.cpp:
1732         * inspector/InspectorIndexedDBAgent.cpp:
1733         * inspector/InspectorResourceAgent.cpp:
1734         * inspector/WorkerInspectorController.cpp: Use a router with a singleton channel
1735         that forwards messages over to the main page.
1736
1737         (WebCore::WorkerInspectorController::WorkerInspectorController):
1738         (WebCore::WorkerInspectorController::connectFrontend):
1739         (WebCore::WorkerInspectorController::disconnectFrontend):
1740         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
1741         * inspector/WorkerInspectorController.h:
1742         * page/PageDebuggable.cpp:
1743         (WebCore::PageDebuggable::disconnect):
1744         * page/PageDebuggable.h:
1745         * testing/Internals.cpp: Clear the frontend client before disconnecting frontend channel.
1746         (WebCore::Internals::openDummyInspectorFrontend):
1747         (WebCore::Internals::closeDummyInspectorFrontend):
1748
1749 2015-09-04  Jer Noble  <jer.noble@apple.com>
1750
1751         [iOS] Enable media layout tests to run simultaneously by ignoring system-level interruptions
1752         https://bugs.webkit.org/show_bug.cgi?id=148807
1753
1754         Reviewed by Eric Carlson.
1755
1756         Add an internal property that, when set, will cause system-level interruption notifications
1757         (e.g., due to simultaneous media playback in separate processes) to be ignored by the
1758         PlatformMediaSessionManager, and cause the media playback sessions to continue normally, if
1759         inaudibly.
1760
1761         * platform/audio/PlatformMediaSessionManager.h:
1762         (WebCore::PlatformMediaSessionManager::willIgnoreSystemInterruptions):
1763         (WebCore::PlatformMediaSessionManager::setWillIgnoreSystemInterruptions):
1764         * platform/audio/ios/MediaSessionManagerIOS.mm:
1765         (-[WebMediaSessionHelper interruption:]):
1766         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
1767         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
1768         (-[WebMediaSessionHelper applicationWillResignActive:]):
1769         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
1770         * testing/Internals.cpp:
1771         (WebCore::Internals::resetToConsistentState):
1772
1773 2015-09-04  Beth Dakin  <bdakin@apple.com>
1774
1775         Need to be able to test default behaviors on force click
1776         https://bugs.webkit.org/show_bug.cgi?id=148758
1777
1778         Reviewed by Tim Horton.
1779
1780         WKTR needs access to this.
1781         * platform/spi/mac/NSEventSPI.h:
1782
1783 2015-09-04  Dean Jackson  <dino@apple.com>
1784
1785         [mediacontrols] Test the ordering of elements in the controls panel
1786         https://bugs.webkit.org/show_bug.cgi?id=148804
1787         <rdar://problem/22579232>
1788
1789         Reviewed by Eric Carlson.
1790
1791         Add information about various controls elements to the status object.
1792
1793         Test: media/controls/elementOrder.html
1794
1795         * Modules/mediacontrols/mediaControlsApple.js:
1796
1797 2015-09-03  Dean Jackson  <dino@apple.com>
1798
1799         [mediacontrols] Expose bounding rectangles and computed style to testing
1800         https://bugs.webkit.org/show_bug.cgi?id=148755
1801         <rdar://problems/22567757>
1802
1803         Reviewed by Eric Carlson.
1804
1805         Expose more information on the internal objects to the testing
1806         framework, in particular the bounding client rectangle for an
1807         element as well as its computed style.
1808
1809         These new features are tested by media/controls/statusDisplay*.
1810
1811         * Modules/mediacontrols/mediaControlsApple.js:
1812         (Controller.prototype.getCurrentControlsStatus): Rearrage things so
1813         that it iterates over a list of objects, adding the common things
1814         as well as any extra property values.
1815
1816 2015-09-04  Chris Dumez  <cdumez@apple.com>
1817
1818         Document.body should return the first body / frameset child of the html element
1819         https://bugs.webkit.org/show_bug.cgi?id=148787
1820         <rdar://problem/22566850>
1821
1822         Reviewed by Ryosuke Niwa.
1823
1824         Document.body should return the *first* body / frameset child of the html
1825         element as per the specification:
1826         https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2
1827
1828         Chrome and Firefox both behave correctly. However, WebKit was prioritizing
1829         frameset over body. This patch fixes this.
1830
1831         No new tests, already covered by existing test.
1832
1833         * dom/Document.cpp:
1834         (WebCore::Document::bodyOrFrameset):
1835
1836 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
1837
1838         Fix the !ENABLE(VIDEO) build after r189023
1839         https://bugs.webkit.org/show_bug.cgi?id=148796
1840
1841         Reviewed by Eric Carlson.
1842
1843         * testing/Internals.idl:
1844
1845 2015-09-04  Ryosuke Niwa  <rniwa@webkit.org>
1846
1847         Range.isPointInRange check root node before verifying offset
1848         https://bugs.webkit.org/show_bug.cgi?id=148776
1849
1850         isPointInRange should never throw WrongDocumentError
1851         https://bugs.webkit.org/show_bug.cgi?id=148779
1852
1853         Reviewed by Darin Adler.
1854
1855         Fixed two bugs since they were inter-dependent on each other.
1856
1857         We use the same trick we used for comparePoint in r189327 to avoid O(n) operation in common cases
1858         and return false when either calls to compareBoundaryPoints yields a WrongDocumentError.
1859
1860         No new tests since this is covered by an existing W3C test.
1861
1862         * dom/Range.cpp:
1863         (WebCore::Range::isPointInRange):
1864         (WebCore::Range::comparePoint):
1865
1866 2015-09-03  Commit Queue  <commit-queue@webkit.org>
1867
1868         Unreviewed, rolling out r189338.
1869         https://bugs.webkit.org/show_bug.cgi?id=148785
1870
1871         Caused tons of crashes (Requested by cdumez on #webkit).
1872
1873         Reverted changeset:
1874
1875         "Web Inspector: InspectorController should support multiple
1876         frontend channels"
1877         https://bugs.webkit.org/show_bug.cgi?id=148538
1878         http://trac.webkit.org/changeset/189338
1879
1880 2015-09-03  Brian Burg  <bburg@apple.com>
1881
1882         Web Inspector: InspectorController should support multiple frontend channels
1883         https://bugs.webkit.org/show_bug.cgi?id=148538
1884
1885         Reviewed by Joseph Pecoraro.
1886
1887         No new tests, no behavior change from this patch. Teardown scenarios are
1888         covered by existing protocol and inspector tests running under DRT and WKTR.
1889
1890         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Added.
1891         * WebCore.vcxproj/WebCore.vcxproj:
1892         * inspector/InspectorClient.h: Stop using forwarded types.
1893         * inspector/InspectorController.cpp:
1894         (WebCore::InspectorController::InspectorController):
1895         (WebCore::InspectorController::inspectedPageDestroyed):
1896         (WebCore::InspectorController::hasLocalFrontend):
1897         (WebCore::InspectorController::hasRemoteFrontend):
1898         (WebCore::InspectorController::connectFrontend):
1899         (WebCore::InspectorController::disconnectFrontend):
1900         (WebCore::InspectorController::disconnectAllFrontends): Added. Disconnects all
1901         frontends and signals DisconnectReason::InspectedTargetDestroyed.
1902
1903         (WebCore::InspectorController::show):
1904         (WebCore::InspectorController::close):
1905         (WebCore::InspectorController::dispatchMessageFromFrontend):
1906         * inspector/InspectorController.h: Add default value for isAutomaticInspection.
1907         * inspector/InspectorDatabaseAgent.cpp:
1908         * inspector/InspectorIndexedDBAgent.cpp:
1909         * inspector/InspectorResourceAgent.cpp:
1910         * inspector/WorkerInspectorController.cpp: Use a router with a singleton channel
1911         that forwards messages over to the main page.
1912
1913         (WebCore::WorkerInspectorController::WorkerInspectorController):
1914         (WebCore::WorkerInspectorController::connectFrontend):
1915         (WebCore::WorkerInspectorController::disconnectFrontend):
1916         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
1917         * inspector/WorkerInspectorController.h:
1918         * page/PageDebuggable.cpp:
1919         (WebCore::PageDebuggable::disconnect):
1920         * page/PageDebuggable.h:
1921         * testing/Internals.cpp: Clear the frontend client before disconnecting frontend channel.
1922         (WebCore::Internals::openDummyInspectorFrontend):
1923         (WebCore::Internals::closeDummyInspectorFrontend):
1924
1925 2015-09-03  Jinyoung Hur  <hur.ims@navercorp.com>
1926
1927         [Texmap] highp precision should be used conditionally for fragment shaders on OpenGL ES
1928         https://bugs.webkit.org/show_bug.cgi?id=143993
1929
1930         Reviewed by Martin Robinson.
1931
1932         There are some GPUs that do not support the GL_OES_fragment_precision_high extension. (e.g., Mali-T624)
1933         Therefore, highp precision should be used in shader fragments conditionally using a proper preprocessor,
1934         GL_FRAGMENT_PRECISION_HIGH.
1935         Without this patch, nothing will be displayed on the screen if the running platform doesn't support the
1936         GL_OES_fragment_precision_high extension.
1937
1938         No new tests, covered by existing tests.
1939
1940         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
1941
1942 2015-09-03  Ryosuke Niwa  <rniwa@webkit.org>
1943
1944         Range.comparePoint shouldn't throw an exception if the range and the node are in the same detached tree
1945         https://bugs.webkit.org/show_bug.cgi?id=148733
1946
1947         Reviewed by Chris Dumez.
1948
1949         Don't throw WRONG_DOCUMENT_ERR when refNode is not in the document. The new behavior matches DOM4 as well
1950         as the behavior of Firefox. See https://dom.spec.whatwg.org/#dom-range-comparepoint
1951
1952         WRONG_DOCUMENT_ERR is still thrown by compareBoundaryPoints later in the function when the root nodes of
1953         refNode and boundary points are different.
1954
1955         There is one subtlety here that we need to throw WRONG_DOCUMENT_ERR instead of INDEX_SIZE_ERR when refNode
1956         and the boundary points don't share the same root node even if (refNode, offset) pair is invalid since
1957         DOM4 spec checks the former condition first. We implement this behavior by first validating the offset
1958         and then explicitly checking for the root node difference if the former check failed to avoid the latter
1959         O(n) check in common cases.
1960
1961         Test: fast/dom/Range/range-comparePoint-detached-nodes.html
1962
1963         * dom/Range.cpp:
1964         (WebCore::Range::comparePoint):
1965
1966 2015-09-03  Jer Noble  <jer.noble@apple.com>
1967
1968         [iOS] Playback does not pause when deselecting route and locking screen.
1969         https://bugs.webkit.org/show_bug.cgi?id=148724
1970
1971         Reviewed by Eric Carlson.
1972
1973         When deselecting a route, the route change notification can be delayed for some amount
1974         of time. If the screen is locked before the notification is fired, the PlatformMediaSessionManager
1975         can refuse to pause the video when entering the background due to a wireless playback route
1976         still being active.
1977
1978         When the media element transitions from having an active route to not having one (or vice versa),
1979         re-run the interruption check. In order to correctly determine, when that occurs, whether
1980         we are in an 'application background' state, cache that value to an ivar when handling
1981         application{Will,Did}Enter{Background,Foreground}.
1982
1983         Because we only want to run this step during an actual transition between playing to a route ->
1984         playing locally, cache the value of isPlayingToWirelessPlayback to another ivar, and only
1985         inform the PlatformMediaSessionManager when that value actually changes.
1986
1987         * html/HTMLMediaElement.cpp:
1988         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
1989         * platform/audio/PlatformMediaSession.cpp:
1990         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTargetChanged): Set or clear m_isPlayingToWirelessPlaybackTarget.
1991         * platform/audio/PlatformMediaSession.h:
1992         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget): Simple getter.
1993         * platform/audio/PlatformMediaSessionManager.cpp:
1994         (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground): Set m_isApplicationInBackground.
1995         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground): Ditto.
1996         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground): Clear m_isApplicationInBackground.
1997         (WebCore::PlatformMediaSessionManager::sessionIsPlayingToWirelessPlaybackTargetChanged): Run interruption
1998             if application is in background.
1999
2000 2015-09-03  Brady Eidson  <beidson@apple.com>
2001
2002         Move SecurityOriginData from WK2 to WebCore.
2003         https://bugs.webkit.org/show_bug.cgi?id=148739
2004
2005         Reviewed by Tim Horton.
2006
2007         This will be needed for upcoming IndexedDB work.
2008
2009         No new tests (No behavior change.)
2010
2011         * CMakeLists.txt:
2012         * WebCore.xcodeproj/project.pbxproj:
2013         
2014         * page/SecurityOriginData.cpp: Renamed from Source/WebKit2/Shared/SecurityOriginData.cpp.
2015         (WebCore::SecurityOriginData::fromSecurityOrigin):
2016         (WebCore::SecurityOriginData::fromFrame):
2017         (WebCore::SecurityOriginData::securityOrigin):
2018         (WebCore::SecurityOriginData::isolatedCopy):
2019         (WebCore::operator==):
2020         * page/SecurityOriginData.h: Renamed from Source/WebKit2/Shared/SecurityOriginData.h.
2021         (WebCore::SecurityOriginData::encode):
2022         (WebCore::SecurityOriginData::decode):
2023
2024 2015-09-03  Zalan Bujtas  <zalan@apple.com>
2025
2026         New clang warns about boolean checks for |this| pointer in RenderObject debug methods
2027         https://bugs.webkit.org/show_bug.cgi?id=136599
2028
2029         Remove unnecessary null checking.
2030
2031         Reviewed by David Kilzer.
2032
2033         Not testable.
2034
2035         * rendering/RenderObject.cpp:
2036         (WebCore::RenderObject::showRenderObject): Deleted.
2037         (WebCore::RenderObject::showRenderSubTreeAndMark): Deleted.
2038
2039 2015-09-03  Adenilson Cavalcanti  <cavalcantii@gmail.com>
2040
2041         Improve access specifier use in RenderObject
2042         https://bugs.webkit.org/show_bug.cgi?id=148745
2043
2044         Reviewed by Myles C. Maxfield.
2045
2046         No new tests, no change in behavior.
2047
2048         * rendering/RenderObject.h:
2049         (WebCore::RenderObject::setPreviousSibling):
2050         (WebCore::RenderObject::setNextSibling):
2051         (WebCore::RenderObject::isSetNeedsLayoutForbidden):
2052         (WebCore::RenderObject::setNeedsLayoutIsForbidden):
2053
2054 2015-09-03  Alexey Proskuryakov  <ap@apple.com>
2055
2056         Test Russian ".рф" domain support
2057         https://bugs.webkit.org/show_bug.cgi?id=148721
2058
2059         Reviewed by Darin Adler.
2060
2061         Test: fast/url/user-visible/rf.html
2062
2063         * html/URLUtils.h: Made this header file work with Objective-C.
2064
2065         * WebCore.xcodeproj/project.pbxproj:
2066         * bindings/scripts/CodeGeneratorJS.pm:
2067         * testing/Internals.cpp:
2068         (WebCore::Internals::getCurrentMediaControlsStatusForElement):
2069         (WebCore::Internals::userVisibleString):
2070         * testing/Internals.h:
2071         * testing/Internals.idl:
2072         * testing/Internals.mm: Added.
2073         (WebCore::Internals::userVisibleString):
2074
2075 2015-09-03  Chris Dumez  <cdumez@apple.com>
2076
2077         document.createEvent("eventname") should do a case-insensitive match on the event name
2078         https://bugs.webkit.org/show_bug.cgi?id=148738
2079         <rdar://problem/22558709>
2080
2081         Reviewed by Andreas Kling.
2082
2083         document.createEvent("eventname") should do a case-insensitive match on the event name:
2084         https://dom.spec.whatwg.org/#dom-document-createevent
2085
2086         WebKit was doing a case-sensitive match. Firefox and Chrome match the specification.
2087
2088         No new tests, already covered by:
2089         http/tests/w3c/dom/nodes/Document-createEvent.html (rebaselined)
2090
2091         * dom/make_event_factory.pl:
2092         (generateImplementation):
2093
2094 2015-09-02  Ryosuke Niwa  <rniwa@webkit.org>
2095
2096         MutationObserver should accept attributeFilter, attributeOldValue, and characterDataOldValue on their own
2097         https://bugs.webkit.org/show_bug.cgi?id=148716
2098
2099         Reviewed by Chris Dumez.
2100
2101         According to DOM4 [1], MutationObserver accepts characterDataOldValue, attributeOldValue and attributeFilter options
2102         on their own when characterData and attributes options are omitted. It throws only when characterData and attributes
2103         options are explicitly set to false.
2104
2105         Fixed our implementation accordingly. Existing tests as well as ones imported from W3C covers this.
2106
2107         [1] http://www.w3.org/TR/2015/WD-dom-20150618/#interface-mutationobserver
2108
2109         * dom/MutationObserver.cpp:
2110         (WebCore::MutationObserver::observe):
2111
2112 2015-09-02  Andreas Kling  <akling@apple.com>
2113
2114         ScrollbarThemes should be returned by reference.
2115         <https://webkit.org/b/147551>
2116
2117         Reviewed by Zalan Bujtas.
2118
2119         There's always a ScrollbarTheme of some type, so have ScrollbarTheme getters
2120         return references all around.
2121
2122         * css/SelectorCheckerTestFunctions.h:
2123         (WebCore::scrollbarMatchesDoubleButtonPseudoClass):
2124         (WebCore::scrollbarMatchesSingleButtonPseudoClass):
2125         (WebCore::scrollbarMatchesNoButtonPseudoClass):
2126         * html/shadow/SpinButtonElement.cpp:
2127         (WebCore::SpinButtonElement::startRepeatingTimer):
2128         * page/PageOverlay.cpp:
2129         (WebCore::PageOverlay::bounds):
2130         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
2131         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
2132         * platform/ScrollView.cpp:
2133         (WebCore::ScrollView::paintScrollCorner):
2134         (WebCore::ScrollView::paintOverhangAreas):
2135         * platform/ScrollableArea.cpp:
2136         (WebCore::ScrollableArea::setScrollbarOverlayStyle):
2137         * platform/Scrollbar.cpp:
2138         (WebCore::Scrollbar::maxOverlapBetweenPages):
2139         (WebCore::Scrollbar::Scrollbar):
2140         (WebCore::Scrollbar::~Scrollbar):
2141         (WebCore::Scrollbar::offsetDidChange):
2142         (WebCore::Scrollbar::updateThumb):
2143         (WebCore::Scrollbar::paint):
2144         (WebCore::Scrollbar::autoscrollTimerFired):
2145         (WebCore::thumbUnderMouse):
2146         (WebCore::Scrollbar::autoscrollPressedPart):
2147         (WebCore::Scrollbar::startTimerIfNeeded):
2148         (WebCore::Scrollbar::moveThumb):
2149         (WebCore::Scrollbar::setHoveredPart):
2150         (WebCore::Scrollbar::setPressedPart):
2151         (WebCore::Scrollbar::mouseMoved):
2152         (WebCore::Scrollbar::mouseUp):
2153         (WebCore::Scrollbar::mouseDown):
2154         (WebCore::Scrollbar::setEnabled):
2155         (WebCore::Scrollbar::isOverlayScrollbar):
2156         * platform/Scrollbar.h:
2157         (WebCore::Scrollbar::theme):
2158         * platform/ScrollbarTheme.cpp:
2159         (WebCore::ScrollbarTheme::theme):
2160         * platform/ScrollbarTheme.h:
2161         * platform/efl/ScrollbarThemeEfl.cpp:
2162         (WebCore::ScrollbarTheme::nativeTheme):
2163         * platform/gtk/ScrollbarThemeGtk.cpp:
2164         (WebCore::ScrollbarTheme::nativeTheme):
2165         * platform/ios/ScrollbarThemeIOS.mm:
2166         (WebCore::ScrollbarTheme::nativeTheme):
2167         * platform/mac/ScrollAnimatorMac.mm:
2168         (macScrollbarTheme):
2169         * platform/mac/ScrollbarThemeMac.mm:
2170         (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
2171         (+[WebScrollbarPrefsObserver behaviorPrefsChanged:]):
2172         (WebCore::ScrollbarTheme::nativeTheme):
2173         * platform/win/PopupMenuWin.cpp:
2174         (WebCore::PopupMenuWin::calculatePositionAndSize):
2175         (WebCore::AccessiblePopupMenu::accLocation):
2176         (WebCore::AccessiblePopupMenu::accHitTest):
2177         * platform/win/ScrollbarThemeSafari.cpp:
2178         (WebCore::ScrollbarTheme::nativeTheme):
2179         * platform/win/ScrollbarThemeWin.cpp:
2180         (WebCore::ScrollbarTheme::nativeTheme):
2181         * rendering/RenderBox.cpp:
2182         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior):
2183         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior):
2184         * rendering/RenderLayer.cpp:
2185         (WebCore::cornerRect):
2186         (WebCore::styleRequiresScrollbar):
2187         (WebCore::styleDefinesAutomaticScrollbar):
2188         * rendering/RenderScrollbar.cpp:
2189         (WebCore::RenderScrollbar::updateScrollbarPart):
2190         * rendering/RenderScrollbarPart.cpp:
2191         (WebCore::calcScrollbarThicknessUsing):
2192         (WebCore::RenderScrollbarPart::styleDidChange):
2193         (WebCore::RenderScrollbarPart::imageChanged):
2194         * rendering/RenderScrollbarTheme.cpp:
2195         (WebCore::RenderScrollbarTheme::paintTickmarks):
2196         * rendering/RenderScrollbarTheme.h:
2197         * rendering/RenderTextControl.cpp:
2198         (WebCore::RenderTextControl::scrollbarThickness):
2199
2200 2015-09-02  Ryosuke Niwa  <rniwa@webkit.org>
2201
2202         Node.textContent = undefined should be equivalent to textContent = ""
2203         https://bugs.webkit.org/show_bug.cgi?id=148729
2204
2205         Reviewed by Darin Adler.
2206
2207         Assigning undefined to textContent should be equivalent to assigning an empty string to it like innerHTML.
2208         This is because textContent is defined as an DOMString? attribute in DOM4 [1] and WebIDL defines ECMAScript
2209         undefined to be treated as null for nullable types [2].
2210
2211         The new behavior matches that of Firefox and Chrome.
2212
2213         [1] https://dom.spec.whatwg.org/#node
2214         [2] https://heycam.github.io/webidl/#es-nullable-type
2215         
2216         * dom/Node.idl:
2217
2218 2015-09-02  Alex Christensen  <achristensen@webkit.org>
2219
2220         Make bison grammar compatible with bison 2.1
2221         https://bugs.webkit.org/show_bug.cgi?id=148731
2222
2223         Reviewed by Tim Horton.
2224
2225         * css/CSSGrammar.y.in:
2226         * xml/XPathGrammar.y:
2227         Move all union fields to one union so bison 2.1 generates equivalent output.
2228
2229 2015-09-02  Dean Jackson  <dino@apple.com>
2230
2231         Add some Houdini specs to the features list
2232         https://bugs.webkit.org/show_bug.cgi?id=148722
2233         <rdar://problem/22545319>
2234
2235         Reviewed by Eric Carlson.
2236
2237         Add the two CSS Houdini specs that have some actual
2238         content to the features list: custom painting and
2239         custom property registration.
2240
2241         * features.json:
2242
2243 2015-09-02  Brady Eidson  <beidson@apple.com>
2244
2245         Import W3C IndexedDB tests.
2246         https://bugs.webkit.org/show_bug.cgi?id=148713
2247
2248         Reviewed by Tim Horton' rubber stamp.
2249
2250         Tests: imported/w3c/indexeddb/*
2251
2252         * Modules/indexeddb/IDBDatabase.cpp:
2253         (WebCore::IDBDatabase::onVersionChange): Remove invalid assert - version goes back to 0 when initial
2254           versionChange transaction is aborted.
2255
2256 2015-09-02  Dean Jackson  <dino@apple.com>
2257
2258         Separate WebGL 1 and WebGL 2 in the features file.
2259
2260         Unreviewed.
2261
2262         * features.json:
2263
2264 2015-09-02  Dean Jackson  <dino@apple.com>
2265
2266         Reset the status label when the media is playable
2267         https://bugs.webkit.org/show_bug.cgi?id=148704
2268         <rdar://problem/22541939>
2269
2270         Reviewed by Eric Carlson.
2271
2272         Flakiness on the bots uncovered a situation where we
2273         hide the status label but left it with incorrect content.
2274
2275         Covered by the existing statusDisplay test.
2276
2277         * Modules/mediacontrols/mediaControlsApple.js:
2278         (Controller.prototype.updateStatusDisplay): Only set to loading if we're not yet playable.
2279
2280 2015-09-02  Chris Fleizach  <cfleizach@apple.com>
2281
2282         AX: WebKit does not expose max/min value of <progress> element
2283         https://bugs.webkit.org/show_bug.cgi?id=148707
2284
2285         Reviewed by Mario Sanchez Prada.
2286
2287         Allow native progress indicator elements to report min/max values by rewriting special
2288         case code for ARIA progress bars.
2289
2290         Test: accessibility/mac/progress-element-min-max.html
2291
2292         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2293         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2294
2295 2015-09-02  Hyemi Shin  <hyemi.sin@samsung.com>
2296
2297         [GStreamer] Simplify linking pads in AudioDestination and correct old comment.
2298         https://bugs.webkit.org/show_bug.cgi?id=148702
2299
2300         Reviewed by Philippe Normand.
2301
2302         Simplify linking src pad of webkitAudioSrc and sink pad of audioConvert
2303         to one line because implementation changed not to use seperate function
2304         to complete building rest of pipelines.
2305         Correct old comment also there is no more wavparse element.
2306
2307         No new tests, no behavior change.
2308
2309         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
2310         (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
2311
2312 2015-09-02  Chris Dumez  <cdumez@apple.com>
2313
2314         document.createProcessingInstruction() does not behave according to specification
2315         https://bugs.webkit.org/show_bug.cgi?id=148710
2316
2317         Reviewed by Ryosuke Niwa.
2318
2319         document.createProcessingInstruction() does not behave according to
2320         specification:
2321         https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
2322
2323         The following changes were made in this patch to match the specification
2324         and the behavior of Firefox / Chrome:
2325         1. document.createProcessingInstruction() now works for HTML documents.
2326         2. Throw an InvalidCharacterError if the data contains "?>" (step 2 of spec)
2327
2328         No new tests, already covered by existing tests that are rebaselined in
2329         this patch.
2330
2331         * dom/Document.cpp:
2332         (WebCore::Document::createProcessingInstruction):
2333
2334 2015-09-02  Chris Dumez  <cdumez@apple.com>
2335
2336         http/tests/w3c/dom/nodes/Element-matches.html is flaky
2337         https://bugs.webkit.org/show_bug.cgi?id=148615
2338
2339         Reviewed by Ryosuke Niwa.
2340
2341         Several newly-imported w3c tests were flaky due to the :target
2342         pseudo-class selectors sometimes giving different results. The
2343         issue seems to be that this type of selector relies on the
2344         Document::cssTarget() element to do the matching. We update
2345         this cssTarget Element in FrameView's scrollToFragment() /
2346         scrollToAnchor(). This is called from
2347         scrollToFragmentWithParentBoundary() which is called by
2348         FrameLoader's finishedParsing() and loadInSameDocument().
2349
2350         In the first one, it is called *after* calling checkComplete()
2351         which fires the onload event. However, in the second method,
2352         it is called *before*. This patch updates finishedParsing()
2353         so that scrollToFragmentWithParentBoundary() is called *before*
2354         firing the onload event, consistently with loadInSameDocument().
2355         This makes sure that JavaScript executed in an onload event
2356         handler will get accurate results for :target pseudo-class
2357         selectors.
2358
2359         No new tests, covered by:
2360         http/tests/w3c/dom/nodes/Element-matches.html
2361         http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml.xhtml
2362
2363         * loader/FrameLoader.cpp:
2364         (WebCore::FrameLoader::finishedParsing):
2365
2366 2015-09-02  Zan Dobersek  <zdobersek@igalia.com>
2367
2368         Construct default winding string arguments in CanvasRenderingContext2D from ASCIILiteral objects
2369         https://bugs.webkit.org/show_bug.cgi?id=148441
2370
2371         Reviewed by Darin Adler.
2372
2373         * html/canvas/CanvasRenderingContext2D.h: Use ASCIILiteral objects to construct
2374         the default values for the winding arguments. This will avoid copying the string
2375         data every time the methods are invoked with the default argument value.
2376
2377 2015-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2378
2379         Unreviewed. Fix GObject DOM bindings API breaks after r189182.
2380
2381         Several methods are no longer raising exceptions after
2382         r189182. Add them to the list, but also handle the case where the
2383         methods are called inside the class, to add the nullptr parameter
2384         for the GError.
2385
2386         * bindings/scripts/CodeGeneratorGObject.pm:
2387         (GenerateProperty):
2388         (FunctionUsedToRaiseException):
2389
2390 2015-09-01  Ryosuke Niwa  <rniwa@webkit.org>
2391
2392         Rename ShadowRoot::hostElement to shadowRoot::host to match the latest spec
2393         https://bugs.webkit.org/show_bug.cgi?id=148694
2394
2395         Address the review comments by Chris.
2396
2397         * dom/Element.cpp:
2398         (WebCore::Element::removeShadowRoot):
2399         * dom/Node.cpp:
2400         (WebCore::Node::shadowHost):
2401         * dom/ShadowRoot.cpp:
2402         (WebCore::ShadowRoot::ShadowRoot):
2403         * dom/ShadowRoot.h:
2404
2405 2015-09-01  Zalan Bujtas  <zalan@apple.com>
2406
2407         Recompute maximum outline size only when outline changes.
2408         https://bugs.webkit.org/show_bug.cgi?id=148576
2409
2410         Reviewed by Andreas Kling.
2411
2412         We should only recompute the cached maximum outline size when
2413         either the outline size (offset/width) or the style (from or to
2414         auto) changes.
2415         Setting 'outline-style: auto' can change the final outline width as 'auto' triggers
2416         the focus ring mode. In this mode, we ignore outline-width and use the platform default value instead.  
2417
2418         Covered by existing test cases.
2419
2420         * rendering/RenderElement.cpp:
2421         (WebCore::RenderElement::computeMaxOutlineSize):
2422         (WebCore::RenderElement::styleWillChange):
2423         (WebCore::RenderElement::initializeStyle): Deleted.
2424         (WebCore::RenderElement::setStyle): Deleted.
2425         * rendering/RenderElement.h:
2426
2427 2015-09-01  Chris Dumez  <cdumez@apple.com>
2428
2429         Range API should throw a TypeError for null Node parameters
2430         https://bugs.webkit.org/show_bug.cgi?id=148692
2431
2432         Reviewed by Ryosuke Niwa.
2433
2434         Range API should throw a TypeError for null Node parameters. We currently
2435         throw a NotFoundError.
2436
2437         As per the DOM specification, the Node arguments are not optional nor
2438         nullable [1]:
2439         https://dom.spec.whatwg.org/#range
2440
2441         Therefore, as per the Web IDL specification, we should throw a TypeError
2442         if the Node parameter is null or missing:
2443         https://heycam.github.io/webidl/#es-interface (step 1).
2444
2445         [1] https://heycam.github.io/webidl/#es-nullable-type
2446
2447         No new tests, covered by existing tests which have been
2448         rebaselined.
2449
2450         * dom/Range.cpp:
2451         (WebCore::Range::setStart):
2452         (WebCore::Range::setEnd):
2453         (WebCore::Range::isPointInRange):
2454         (WebCore::Range::comparePoint):
2455         (WebCore::Range::compareNode):
2456         (WebCore::Range::compareBoundaryPoints):
2457         (WebCore::Range::intersectsNode):
2458         (WebCore::Range::insertNode):
2459         (WebCore::Range::setStartAfter):
2460         (WebCore::Range::setEndBefore):
2461         (WebCore::Range::setEndAfter):
2462         (WebCore::Range::selectNode):
2463         (WebCore::Range::selectNodeContents):
2464         (WebCore::Range::surroundContents):
2465         (WebCore::Range::setStartBefore):
2466         Set the Exception code to TypeError instead of NOT_FOUND_ERR if
2467         the Node parameter is null.
2468
2469         * dom/Range.idl:
2470         Stop marking the Node parameters as optional. They are not optional in
2471         the specification and they are not really optional in our implementation.
2472         Previously, if the Node parameter was missing, we would call the
2473         implementation with a null pointer and the implementation would throw a
2474         NotFoundError. Now that they are mandatory, the bindings will directly
2475         throw a TypeError (as per the Web IDL spec) if the Node parameter is
2476         missing. However, if the JavaScript explicitely passes null or undefined,
2477         the implementation will still be called with a null pointer (because
2478         our bindings generator does not distinguish nullable / non-nullable
2479         parameters). For this reason, we still need to handle null pointers on
2480         the implementation side.
2481
2482 2015-09-01  Ryosuke Niwa  <rniwa@webkit.org>
2483
2484         Rename ShadowRoot::hostElement to shadowRoot::host to match the latest spec
2485         https://bugs.webkit.org/show_bug.cgi?id=148694
2486
2487         Reviewed by Chris Dumez.
2488
2489         Renamed ShadowRoot::hostElement to ShadowRoot::host to match the latest shadow DOM spec.
2490         This will help us implementing shadow DOM in near future.
2491
2492         * dom/ContainerNodeAlgorithms.cpp:
2493         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
2494         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument):
2495         * dom/Element.cpp:
2496         (WebCore::Element::addShadowRoot):
2497         (WebCore::Element::removeShadowRoot):
2498         * dom/EventDispatcher.cpp:
2499         (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
2500         (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope):
2501         (WebCore::shouldEventCrossShadowBoundary):
2502         (WebCore::EventPath::EventPath):
2503         * dom/Node.cpp:
2504         (WebCore::Node::shadowHost):
2505         (WebCore::Node::deprecatedShadowAncestorNode):
2506         (WebCore::Node::parentOrShadowHostElement):
2507         * dom/NodeRenderingTraversal.cpp:
2508         (WebCore::NodeRenderingTraversal::traverseParent):
2509         * dom/ShadowRoot.cpp:
2510         (WebCore::ShadowRoot::setInnerHTML):
2511         (WebCore::ShadowRoot::setResetStyleInheritance):
2512         * dom/ShadowRoot.h:
2513         (WebCore::Node::parentOrShadowHostNode):
2514         * dom/Text.cpp:
2515         (WebCore::isSVGShadowText):
2516         * dom/TreeScope.cpp:
2517         (WebCore::TreeScope::focusedElement):
2518         * html/shadow/ContentDistributor.cpp:
2519         (WebCore::ContentDistributor::ensureDistribution):
2520         * html/shadow/InsertionPoint.cpp:
2521         (WebCore::InsertionPoint::insertedInto):
2522         (WebCore::InsertionPoint::removedFrom):
2523         * page/DragController.cpp:
2524         (WebCore::asFileInput):
2525         * page/EventHandler.cpp:
2526         (WebCore::EventHandler::handleMousePressEvent):
2527         * page/FocusController.cpp:
2528         (WebCore::FocusNavigationScope::owner):
2529         * rendering/RenderLayer.cpp:
2530         (WebCore::rendererForScrollbar):
2531         * style/StyleResolveTree.cpp:
2532         (WebCore::Style::attachShadowRoot):
2533         (WebCore::Style::resolveShadowTree):
2534         * svg/SVGElement.cpp:
2535         (WebCore::SVGElement::correspondingUseElement):
2536
2537 2015-09-01  Chris Dumez  <cdumez@apple.com>
2538
2539         NodeFilter should be a callback interface
2540         https://bugs.webkit.org/show_bug.cgi?id=148415
2541
2542         Reviewed by Geoffrey Garen.
2543
2544         NodeFilter is now a callback interface, instead of a regular interface,
2545         as per the DOM specification:
2546         https://dom.spec.whatwg.org/#interface-nodefilter
2547
2548         One major difference is that TreeWalker.filter / NodeIterator is
2549         supposed to be a Function / Object (passed by JavaScript), but it was a
2550         JSNodeFilter wrapper in WebKit. Also, window.NodeFilter is not supposed
2551         to have a prototype property.
2552
2553         This behavior is consistent with Firefox. However, Chrome still has its
2554         own NodeFilter wrapper.
2555
2556         Tests:
2557         http/tests/w3c/dom/traversal/NodeIterator-expected.html (rebaselined)
2558         http/tests/w3c/dom/traversal/TreeWalker.html (rebaselined)
2559
2560         * CMakeLists.txt:
2561         * WebCore.vcxproj/WebCore.vcxproj:
2562         * WebCore.vcxproj/WebCore.vcxproj.filters:
2563         * WebCore.xcodeproj/project.pbxproj:
2564         Add / Remove files to the project files.
2565
2566         * dom/NodeFilterCondition.cpp:
2567         (WebCore::NodeFilterCondition::acceptNode):
2568         * dom/NodeFilterCondition.h:
2569         * bindings/gobject/GObjectNodeFilterCondition.cpp:
2570         (WebCore::GObjectNodeFilterCondition::acceptNode):
2571         * bindings/gobject/GObjectNodeFilterCondition.h:
2572         * bindings/objc/ObjCNodeFilterCondition.h:
2573         * bindings/objc/ObjCNodeFilterCondition.mm:
2574         (WebCore::ObjCNodeFilterCondition::acceptNode):
2575         Drop ExecState parameter as it is not used.
2576
2577         * bindings/gobject/WebKitDOMNodeFilter.cpp:
2578         (WebKit::core):
2579         Use NativeNodeFilter type instead of NodeFilter. NodeFilter is now
2580         a pure interface with 2 subclasses: NativeNodeFilter for the native
2581         bindings and JSNodeFilter for the JS bindings.
2582
2583         * bindings/js/JSBindingsAllInOne.cpp:
2584         Drop JSNodeFilterCondition.cpp as it was removed.
2585
2586         * bindings/js/JSCallbackData.cpp:
2587         (WebCore::JSCallbackData::invokeCallback):
2588         Throw a TypeError if the callback object being invoked is not callable
2589         and does not have a callable property with the expected name. There
2590         are several layout tests covering this (including w3c ones). Previously,
2591         NodeFilter was not using the generic JSCallbackData and the exception
2592         throwing was in JSNodeFilterCondition::acceptNode() instead.
2593
2594         * bindings/js/JSNodeFilterCondition.cpp: Removed.
2595         * bindings/js/JSNodeFilterCondition.h: Removed.
2596         Drop this class. JSNodeFilter / JSNodeFilterCustom now basically take
2597         care of all this.
2598
2599         * bindings/js/JSNodeFilterCustom.cpp:
2600         (WebCore::JSNodeFilter::acceptNode):
2601         Complete rewrite. This file is now only used to provide a custom
2602         implementation for JSNodeFilter::acceptNode(). The code is similar to
2603         what was previously done in JSNodeFilterCondition::acceptNode().
2604         There are several reasons we need custom bindings here:
2605         - The bindings generator does not handle yet callback functions
2606           returning anything else than a boolean.
2607         - The specification clearly states that we need to rethrow exceptions
2608           thrown by the callback function. However, the default behavior of
2609           our bindings is to simply report the exception.
2610
2611         * bindings/scripts/CodeGeneratorGObject.pm:
2612         Only skip functions that have parameters that are callback *functions*,
2613         not callback *interfaces*. Callback interfaces are very similar to
2614         interfaces and the generator is able to handle them. This change was
2615         needed for the GTK bindings generator would no longer generate bindings
2616         for Document.createNodeIterator() / Document.createTreeWalker(), now
2617         that NodeFilter is a callback interface instead of a regular interface.
2618
2619         * bindings/scripts/CodeGeneratorJS.pm:
2620         (GenerateCallbackHeader):
2621         (GenerateCallbackImplementation):
2622         Generate a toJS() function for callback interfaces as well. Previously,
2623         we would only generate those for regular interfaces. This is needed
2624         because NodeFilter is now a callback interface and it is exposed to
2625         JS via NodeIterator.filter / TreeWalker.filter. The implementation
2626         merely returns the callback object / function inside the JSCalbackData
2627         so the JS gets back the object / function it passed in.
2628
2629         * bindings/scripts/CodeGeneratorObjC.pm:
2630         Tweak the ObjC bindings generator to use NativeNodeFilter class instead
2631         of NodeFilter as NodeFilter is now a pure interfaces. Native bindings
2632         are now expected to use the NativeNodeFilter subclass instead.
2633
2634         * bindings/scripts/test/JS/JSTestCallback.cpp:
2635         * bindings/scripts/test/JS/JSTestCallback.h:
2636         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2637         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
2638         Rebaseline bindings tests now that we generate toJS() functions for
2639         callback functions / interfaces.
2640
2641         * dom/DOMAllInOne.cpp:
2642         Drop NodeFilter.cpp as it was removed.
2643
2644         * dom/NativeNodeFilter.cpp: Added.
2645         * dom/NativeNodeFilter.h: Added.
2646         Introduce new NativeNodeFilter class which subclasses the NodeFilter
2647         interface and is used by native bindings. Its accept() implementation
2648         uses NodeFilterCondition object internally to filter the nodes instead
2649         of a JS callback.
2650
2651         * dom/NodeFilter.cpp: Removed.
2652         * dom/NodeFilter.h:
2653         Make NodeFilter a pure interface. Its previous code is now either in
2654         NativeNodeFilter of JSNodeFilter.
2655
2656         * dom/NodeFilter.idl:
2657         Make NodeFilter a callback interface instead of a regular interface,
2658         as per the DOM specification. Also have its accept() operation return
2659         an unsigned short instead of a short to match the specification.
2660         The ObjC version still returns a short though for backward
2661         compatibility.
2662
2663         * dom/NodeFilterCondition.cpp:
2664         (WebCore::NodeFilterCondition::acceptNode):
2665         * dom/NodeFilterCondition.h:
2666
2667         * dom/NodeIterator.cpp:
2668         * dom/NodeIterator.h:
2669         * dom/NodeIterator.idl:
2670         * dom/Traversal.cpp:
2671         * dom/Traversal.h:
2672         * dom/TreeWalker.cpp:
2673         * dom/TreeWalker.h:
2674         * dom/TreeWalker.idl:
2675         Stop passing ExecState to TreeWalker / NodeIterator functions. It no
2676         longer seems to be needed as we now use the JSCallbackData abstraction
2677         for invoking JS.
2678
2679 2015-09-01  Chris Dumez  <cdumez@apple.com>
2680
2681         Range.insersectsNode(node) is supposed to return true if node.parent is null
2682         https://bugs.webkit.org/show_bug.cgi?id=148687
2683
2684         Reviewed by Ryosuke Niwa.
2685
2686         Range.insersectsNode(node) is supposed to return true if node.parent is
2687         null:
2688         https://dom.spec.whatwg.org/#dom-range-intersectsnode (step 3)
2689
2690         Previously, WebKit would throw a NotFoundError, apparently to match
2691         Firefox's behavior. However, these days, Firefox complies with the
2692         specification and returns true here.
2693
2694         No new tests, already covered by:
2695         http/tests/w3c/dom/ranges/Range-intersectsNode.html (rebaselined)
2696
2697         * dom/Range.cpp:
2698         (WebCore::Range::intersectsNode):
2699
2700 2015-09-01  Brian Burg  <bburg@apple.com>
2701
2702         Web Inspector: tighten up lifetimes for InspectorController-owned objects; add brace initializers to agents
2703         https://bugs.webkit.org/show_bug.cgi?id=148612
2704
2705         Reviewed by Joseph Pecoraro.
2706
2707         Both InjectedScriptManager and AgentRegistry (thus all agents) are
2708         owned by [Worker]InspectorController. So, use references.
2709
2710         InstrumentingAgents is morally owned by InspectorController as well, but
2711         must be a Ref for now since instrumentation cookies take a strong reference.
2712
2713         Add brace initalizers for scalar and pointer members in agent classes.
2714
2715         No new tests, no behavior change.
2716
2717         * inspector/InspectorApplicationCacheAgent.cpp:
2718         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
2719         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
2720         (WebCore::InspectorApplicationCacheAgent::enable):
2721         * inspector/InspectorApplicationCacheAgent.h:
2722         * inspector/InspectorCSSAgent.cpp:
2723         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
2724         (WebCore::InspectorCSSAgent::enable):
2725         (WebCore::InspectorCSSAgent::disable):
2726         * inspector/InspectorCSSAgent.h:
2727         * inspector/InspectorConsoleInstrumentation.h:
2728         (WebCore::InspectorInstrumentation::addMessageToConsole):
2729         (WebCore::InspectorInstrumentation::consoleCount):
2730         (WebCore::InspectorInstrumentation::startProfiling):
2731         (WebCore::InspectorInstrumentation::stopProfiling):
2732         * inspector/InspectorController.cpp:
2733         (WebCore::InspectorController::InspectorController):
2734         (WebCore::InspectorController::connectFrontend):
2735         (WebCore::InspectorController::disconnectFrontend):
2736         (WebCore::InspectorController::disconnectAllFrontends):
2737         * inspector/InspectorController.h:
2738         * inspector/InspectorDOMAgent.cpp:
2739         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
2740         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
2741         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
2742         (WebCore::InspectorDOMAgent::focusNode):
2743         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
2744         (WebCore::InspectorDOMAgent::nodeForObjectId):
2745         (WebCore::InspectorDOMAgent::resolveNode):
2746         * inspector/InspectorDOMAgent.h:
2747         * inspector/InspectorDOMDebuggerAgent.cpp:
2748         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
2749         (WebCore::InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent):
2750         (WebCore::InspectorDOMDebuggerAgent::debuggerWasEnabled):
2751         (WebCore::InspectorDOMDebuggerAgent::disable):
2752         * inspector/InspectorDOMDebuggerAgent.h:
2753         * inspector/InspectorDOMStorageAgent.cpp:
2754         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
2755         (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent):
2756         * inspector/InspectorDOMStorageAgent.h:
2757         * inspector/InspectorDatabaseAgent.cpp:
2758         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
2759         (WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent):
2760         * inspector/InspectorDatabaseAgent.h:
2761         * inspector/InspectorIndexedDBAgent.cpp:
2762         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
2763         (WebCore::InspectorIndexedDBAgent::requestData):
2764         * inspector/InspectorIndexedDBAgent.h:
2765         * inspector/InspectorInstrumentation.cpp:
2766         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
2767         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
2768         * inspector/InspectorInstrumentation.h:
2769         (WebCore::InspectorInstrumentation::mouseDidMoveOverElement):
2770         (WebCore::InspectorInstrumentation::scriptsEnabled):
2771         (WebCore::InspectorInstrumentation::didScroll):
2772         (WebCore::InspectorInstrumentation::markResourceAsCached):
2773         (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
2774         (WebCore::InspectorInstrumentation::willRunJavaScriptDialog):
2775         (WebCore::InspectorInstrumentation::sessionCreated):
2776         (WebCore::InspectorInstrumentation::sessionLoaded):
2777         (WebCore::InspectorInstrumentation::sessionModified):
2778         (WebCore::InspectorInstrumentation::segmentCreated):
2779         (WebCore::InspectorInstrumentation::segmentCompleted):
2780         (WebCore::InspectorInstrumentation::segmentLoaded):
2781         (WebCore::InspectorInstrumentation::segmentUnloaded):
2782         (WebCore::InspectorInstrumentation::captureStarted):
2783         (WebCore::InspectorInstrumentation::captureStopped):
2784         (WebCore::InspectorInstrumentation::playbackStarted):
2785         (WebCore::InspectorInstrumentation::playbackPaused):
2786         (WebCore::InspectorInstrumentation::playbackFinished):
2787         (WebCore::InspectorInstrumentation::playbackHitPosition):
2788         * inspector/InspectorLayerTreeAgent.cpp:
2789         (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
2790         (WebCore::InspectorLayerTreeAgent::enable):
2791         (WebCore::InspectorLayerTreeAgent::disable):
2792         (WebCore::InspectorLayerTreeAgent::layersForNode):
2793         (WebCore::InspectorLayerTreeAgent::idForNode):
2794         * inspector/InspectorLayerTreeAgent.h:
2795         * inspector/InspectorPageAgent.cpp:
2796         (WebCore::InspectorPageAgent::InspectorPageAgent):
2797         (WebCore::InspectorPageAgent::timestamp):
2798         (WebCore::InspectorPageAgent::enable):
2799         (WebCore::InspectorPageAgent::disable):
2800         (WebCore::InspectorPageAgent::frameStartedLoading):
2801         (WebCore::InspectorPageAgent::snapshotNode):
2802         * inspector/InspectorPageAgent.h:
2803         * inspector/InspectorReplayAgent.cpp:
2804         (WebCore::InspectorReplayAgent::InspectorReplayAgent):
2805         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
2806         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
2807         * inspector/InspectorReplayAgent.h:
2808         * inspector/InspectorResourceAgent.cpp:
2809         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
2810         (WebCore::InspectorResourceAgent::~InspectorResourceAgent):
2811         (WebCore::InspectorResourceAgent::timestamp):
2812         (WebCore::InspectorResourceAgent::enable):
2813         (WebCore::InspectorResourceAgent::disable):
2814         * inspector/InspectorResourceAgent.h:
2815         * inspector/InspectorTimelineAgent.cpp:
2816         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
2817         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
2818         (WebCore::InspectorTimelineAgent::internalStart):
2819         (WebCore::InspectorTimelineAgent::internalStop):
2820         (WebCore::InspectorTimelineAgent::timestamp):
2821         (WebCore::InspectorTimelineAgent::startFromConsole):
2822         (WebCore::InspectorTimelineAgent::willCallFunction):
2823         (WebCore::InspectorTimelineAgent::willEvaluateScript):
2824         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
2825         * inspector/InspectorTimelineAgent.h:
2826         * inspector/InspectorWebAgentBase.h:
2827         (WebCore::InspectorAgentBase::InspectorAgentBase):
2828         * inspector/InspectorWorkerAgent.cpp:
2829         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
2830         (WebCore::InspectorWorkerAgent::~InspectorWorkerAgent):
2831         * inspector/InspectorWorkerAgent.h:
2832         * inspector/InstrumentingAgents.cpp:
2833         (WebCore::InstrumentingAgents::InstrumentingAgents): Deleted.
2834         * inspector/InstrumentingAgents.h:
2835         (WebCore::InstrumentingAgents::create):
2836         * inspector/PageConsoleAgent.cpp:
2837         (WebCore::PageConsoleAgent::PageConsoleAgent):
2838         (WebCore::PageConsoleAgent::addInspectedNode):
2839         * inspector/PageConsoleAgent.h:
2840         * inspector/PageDebuggerAgent.cpp:
2841         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
2842         (WebCore::PageDebuggerAgent::enable):
2843         (WebCore::PageDebuggerAgent::disable):
2844         (WebCore::PageDebuggerAgent::injectedScriptForEval):
2845         * inspector/PageDebuggerAgent.h:
2846         * inspector/PageRuntimeAgent.cpp:
2847         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
2848         (WebCore::PageRuntimeAgent::injectedScriptForEval):
2849         (WebCore::PageRuntimeAgent::notifyContextCreated):
2850         * inspector/PageRuntimeAgent.h:
2851         * inspector/WebConsoleAgent.cpp:
2852         (WebCore::WebConsoleAgent::WebConsoleAgent):
2853         (WebCore::WebConsoleAgent::frameWindowDiscarded):
2854         (WebCore::WebConsoleAgent::didFinishXHRLoading):
2855         (WebCore::WebConsoleAgent::didReceiveResponse):
2856         (WebCore::WebConsoleAgent::didFailLoading):
2857         * inspector/WebConsoleAgent.h:
2858         * inspector/WebDebuggerAgent.cpp:
2859         (WebCore::WebDebuggerAgent::WebDebuggerAgent):
2860         (WebCore::WebDebuggerAgent::enable):
2861         (WebCore::WebDebuggerAgent::disable):
2862         * inspector/WebDebuggerAgent.h:
2863         * inspector/WorkerConsoleAgent.cpp:
2864         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
2865         * inspector/WorkerConsoleAgent.h:
2866         * inspector/WorkerDebuggerAgent.cpp:
2867         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
2868         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
2869         * inspector/WorkerDebuggerAgent.h:
2870         * inspector/WorkerInspectorController.cpp:
2871         (WebCore::WorkerInspectorController::WorkerInspectorController):
2872         * inspector/WorkerInspectorController.h:
2873         * inspector/WorkerRuntimeAgent.cpp:
2874         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
2875         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
2876         * inspector/WorkerRuntimeAgent.h:
2877
2878 2015-09-01  Jinyoung Hur  <hur.ims@navercorp.com>
2879
2880         [Cairo][WebGL] Upload the accelerated canvas as a texture by copying via GPU directly
2881         https://bugs.webkit.org/show_bug.cgi?id=148631
2882
2883         Reviewed by Dean Jackson.
2884
2885         When an accelerated canvas needs to be uploaded as a gl texture, it would be better to copy it to 
2886         texture directly via GPU using glCopyTexImage2D. 
2887         Note that GPU copy can not always be enabled because, with premultiplyAlpha and flipY unpack option,
2888         it seems hard to be implemented in a way of direct GPU copy.
2889
2890         No new tests because there is no behavior change.
2891
2892         * html/canvas/WebGLRenderingContextBase.cpp:
2893         (WebCore::WebGLRenderingContextBase::texImage2D):
2894         * platform/graphics/ImageBuffer.cpp:
2895         (WebCore::ImageBuffer::copyToPlatformTexture):
2896         * platform/graphics/ImageBuffer.h:
2897         * platform/graphics/cairo/ImageBufferCairo.cpp:
2898         (WebCore::ImageBuffer::copyToPlatformTexture):
2899
2900 2015-08-31  Dean Jackson  <dino@apple.com>
2901
2902         [mediacontrols] Add tests for the status display label
2903         https://bugs.webkit.org/show_bug.cgi?id=148656
2904         <rdar://problem/22509779>
2905
2906         Reviewed by Eric Carlson.
2907
2908         Export the StatusDisplay element and its current content.
2909
2910         Tests: media/controls/statusDisplay.html
2911                media/controls/statusDisplayBad.html
2912
2913         * Modules/mediacontrols/mediaControlsApple.js:
2914         (Controller.prototype.getCurrentControlsStatus):
2915
2916 2015-08-31  Dean Jackson  <dino@apple.com>
2917
2918         [mediacontrols] Add a test for the show controls button
2919         https://bugs.webkit.org/show_bug.cgi?id=148655
2920         <rdar://problem/22509688>
2921
2922         Reviewed by Eric Carlson.
2923
2924         We'll add a list of control elements to the status object,
2925         so we can query the state of buttons, etc. Begin with the
2926         Show Controls button (used for accessibility).
2927
2928         There are also some drive-by whitespace changes.
2929
2930         Test: media/controls/showControlsButton.html
2931
2932         * Modules/mediacontrols/mediaControlsApple.js:
2933         (Controller.prototype.get idiom): Differentiate between iOS and
2934         OS X. This isn't necessary at the moment, but will come in
2935         handy later.
2936         (Controller.prototype.createControls): Whitespace.
2937         (Controller.prototype.getCurrentControlsStatus): Add the information
2938         on the Show Controls button.
2939         * Modules/mediacontrols/mediaControlsiOS.js:
2940         (ControllerIOS.prototype.get idiom):
2941
2942 2015-09-01  Joseph Pecoraro  <pecoraro@apple.com>
2943
2944         Possible CFArray leak in MediaPlayerPrivateAVFoundationCF.cpp
2945         https://bugs.webkit.org/show_bug.cgi?id=148668
2946
2947         Reviewed by Eric Carlson.
2948
2949         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2950         (WebCore::mimeTypeCache): Deleted.
2951         (WebCore::avfMIMETypes):
2952         Fix the leak in avfMIMETypes. Consolidate on the single implementation.
2953         Note that avfMIMETypes lowercased the inputs and mimeTypeCache did not,
2954         but we now match MediaPlayerPrivateAVFoundationObjC which has one version
2955         that lowercased inputs as well.
2956
2957         (WebCore::MediaPlayerPrivateAVFoundationCF::getSupportedTypes):
2958         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
2959         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
2960         Convert to th enew verison.
2961
2962 2015-09-01  Javier Fernandez  <jfernandez@igalia.com>
2963
2964         [CSS Grid Layout] Layout is wrong for flex factor sum between 0 and 1
2965         https://bugs.webkit.org/show_bug.cgi?id=148645
2966
2967         Reviewed by Darin Adler.
2968
2969         This patch ensures that we don't normalize the individual tracks
2970         to fill the space. More precisely, when we sum up the flexes, that
2971         tells us how many "units" of flex need to fit into the free
2972         space. We then figure out what size to assign to the flex unit
2973         based on that, and send that back to the individual items, sizing
2974         them appropriately to their flex value.
2975
2976         This way we get flex fraction values applied correctly so they fill
2977         the available space in the indicated proportion. This approach has
2978         an additional advantage of dealing with division by 0 when reducing
2979         automatically the flex value.
2980
2981         Test: fast/css-grid-layout/flex-factor-sum-less-than-1.html
2982
2983         * rendering/RenderGrid.cpp:
2984         (WebCore::RenderGrid::computeNormalizedFractionBreadth):
2985
2986 2015-08-31  Commit Queue  <commit-queue@webkit.org>
2987
2988         Unreviewed, rolling out r189198.
2989         https://bugs.webkit.org/show_bug.cgi?id=148670
2990
2991         "Caused http/tests/navigation/anchor-frames-same-origin.html
2992         to fail on WebKit1" (Requested by cdumez on #webkit).
2993
2994         Reverted changeset:
2995
2996         "http/tests/w3c/dom/nodes/Element-matches.html is flaky"
2997         https://bugs.webkit.org/show_bug.cgi?id=148615
2998         http://trac.webkit.org/changeset/189198
2999
3000 2015-08-31  Joseph Pecoraro  <pecoraro@apple.com>
3001
3002         Remove unused #define
3003         https://bugs.webkit.org/show_bug.cgi?id=148667
3004
3005         Reviewed by Benjamin Poulain.
3006
3007         * platform/network/cf/ResourceResponseCFNet.cpp:
3008
3009 2015-08-31  Chris Dumez  <cdumez@apple.com>
3010
3011         Range API is throwing wrong exception type
3012         https://bugs.webkit.org/show_bug.cgi?id=148648
3013
3014         Reviewed by Ryosuke Niwa.
3015
3016         The RangeException type does not exist in the latest DOM specification.
3017         Instead, the Range API is throwing regular DOMExceptions [1]:
3018         https://dom.spec.whatwg.org/#range
3019
3020         The error codes also differ. RangeException.INVALID_NODE_TYPE_ERR (2)
3021         is replaced with DOMException.INVALID_NODE_TYPE_ERR (24).
3022         RangeException.BAD_BOUNDARYPOINTS_ERR (1) is replaced by
3023         DOMException.INVALID_STATE_ERR (11), as per:
3024         https://dom.spec.whatwg.org/#dom-range-surroundcontents (step 1).
3025
3026         This patch aligns WebKit's behavior with the specification and with
3027         other browsers (tested Firefox and Chrome).
3028
3029         [1] https://heycam.github.io/webidl/#dfn-DOMException
3030
3031         No new tests, covered by existing tests (rebaselined):
3032         http/tests/w3c/dom/ranges/Range-comparePoint.html
3033         http/tests/w3c/dom/ranges/Range-isPointInRange.html
3034         http/tests/w3c/dom/ranges/Range-selectNode.html
3035         http/tests/w3c/dom/ranges/Range-set.html
3036         http/tests/w3c/dom/ranges/Range-surroundContents.html
3037
3038         * CMakeLists.txt:
3039         * DerivedSources.cpp:
3040         * DerivedSources.make:
3041         * WebCore.vcxproj/WebCore.vcxproj:
3042         * WebCore.vcxproj/WebCore.vcxproj.filters:
3043         * WebCore.xcodeproj/project.pbxproj:
3044         * bindings/js/JSExceptionBase.cpp:
3045         (WebCore::toExceptionBase): Deleted.
3046         * dom/DOMAllInOne.cpp:
3047         * dom/DOMExceptions.in:
3048         * dom/Range.cpp:
3049         (WebCore::Range::insertNode):
3050         (WebCore::Range::checkNodeWOffset):
3051         (WebCore::Range::checkNodeBA):
3052         (WebCore::Range::selectNode):
3053         (WebCore::Range::selectNodeContents):
3054         (WebCore::Range::surroundContents):
3055         * dom/RangeException.cpp: Removed.
3056         * dom/RangeException.h: Removed.
3057         * dom/RangeException.idl: Removed.
3058
3059 2015-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
3060
3061         [ES6] Introduce ModuleProgramExecutable families and compile Module code to bytecode
3062         https://bugs.webkit.org/show_bug.cgi?id=148581
3063
3064         Reviewed by Saam Barati.
3065
3066         Add the ModuleProgramExecutable case.
3067
3068         * testing/Internals.cpp:
3069         (WebCore::Internals::parserMetaData):
3070
3071 2015-08-31  Brent Fulgham  <bfulgham@apple.com>
3072
3073         [Win] WebKit cannot load pages based on "file://" URLs
3074         https://bugs.webkit.org/show_bug.cgi?id=148596
3075         <rdar://problem/22432585>
3076
3077         Reviewed by Dean Jackson.
3078
3079         * platform/URL.cpp:
3080         (WebCore::URL::URL): Work around bug that causes this assertion to fire on
3081         the Apple Windows build.
3082         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3083         (WebCore::adjustMIMETypeIfNecessary): Added. If the URL is for a local file,
3084         determine the MIME type based on extension. Otherwise use the default MIME type.
3085         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse): If
3086         the CFURLResponse has no MIME type, call 'adjustMIMETypeIfNecessary'.
3087
3088 2015-08-31  Chris Dumez  <cdumez@apple.com>
3089
3090         http/tests/w3c/dom/nodes/Element-matches.html is flaky
3091         https://bugs.webkit.org/show_bug.cgi?id=148615
3092
3093         Reviewed by Ryosuke Niwa.
3094
3095         Several newly-imported w3c tests were flaky due to the :target
3096         pseudo-class selectors sometimes giving different results. The
3097         issue seems to be that this type of selector relies on the
3098         Document::cssTarget() element to do the matching. We update
3099         this cssTarget Element in FrameView's scrollToFragment() /
3100         scrollToAnchor(). This is called from
3101         scrollToFragmentWithParentBoundary() which is called by
3102         FrameLoader's finishedParsing() and loadInSameDocument().
3103
3104         In the first one, it is called *after* calling checkComplete()
3105         which fires the onload event. However, in the second method,
3106         it is called *before*. This patch updates finishedParsing()
3107         so that scrollToFragmentWithParentBoundary() is called *before*
3108         firing the onload event, consistently with loadInSameDocument().
3109         This makes sure that JavaScript executed in an onload event
3110         handler will get accurate results for :target pseudo-class
3111         selectors.
3112
3113         No new tests, covered by:
3114         http/tests/w3c/dom/nodes/Element-matches.html
3115         http/tests/w3c/dom/nodes/ParentNode-querySelector-All-xhtml.xhtml
3116
3117         * loader/FrameLoader.cpp:
3118         (WebCore::FrameLoader::finishedParsing):
3119
3120 2015-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
3121
3122         The error handler of ReadableJSStream should own stream object
3123         https://bugs.webkit.org/show_bug.cgi?id=148653
3124
3125         Reviewed by Sam Weinig.
3126
3127         ReadableJSStream's m_errorFunction does not own the readable stream.
3128         So when this error callback is executed asynchronously through Promises,
3129         the stream could be already destroyed.
3130         The fulfill callback which is jointly configured with this error callback
3131         owns the stream. However, when the promise is rejected, the following things
3132         occur.
3133
3134         1. Promise clears the fulfill handlers immediately.
3135         2. queue the reject handlers to the microtask queue.
3136         3. When draining the microtasks, the rejected handler will be executed.
3137
3138         At the time of 2 or 3, the references to the fulfill handlers are already discarded.
3139         So when GC occurs at the time of 2 or 3, it will collect the fulfill handlers and the
3140         stream object owned by the fulfill handlers even if the error callback will touch the
3141         stream object later.
3142
3143         Before r189124, this fault does not occur. This is because the std::function in the
3144         fulfill handler is not destroyed before that patch. Since the std::function owns the
3145         stream object, the std::function and the stream object were leaked and never destroyed.
3146         After that patch, the std::function in the fulfill handler becomes destroyed. And it
3147         makes this fault happen.
3148
3149         In this patch, we separate the error callback from the stream object. Previously, the
3150         error callback resides in the stream object as the member. To avoid the cyclic references,
3151         this error callback did not own the stream object. But this causes this fault.
3152         Instead of caching the error callback in the stream object, we always create the error
3153         callback, when it is needed. The created error callback owns the stream object as well as
3154         the fulfill callbacks owns the stream object.
3155
3156         No behavior change.
3157
3158         * bindings/js/ReadableJSStream.cpp:
3159         (WebCore::createGenericErrorRejectedFunction):
3160         (WebCore::ReadableJSStream::doStart):
3161         (WebCore::ReadableJSStream::doPull):
3162         (WebCore::ReadableJSStream::ReadableJSStream): Deleted.
3163         * bindings/js/ReadableJSStream.h:
3164
3165 2015-08-26  Andy Estes  <aestes@apple.com>
3166
3167         [Content Filtering] Determine navigation and content policy before continuing to filter a load
3168         https://bugs.webkit.org/show_bug.cgi?id=148506
3169
3170         Reviewed by Brady Eidson.
3171
3172         Prior to this change, ContentFilter would hide from DocumentLoader all CachedRawResourceClient callbacks until
3173         a decision was made, then replay the missed callbacks. This approach interacted poorly with some features of
3174         the loader, notably appcache and downloads. In the case of appcache, DocumentLoader might not have a chance to
3175         check for substitute data until the original load has finished, wasting bandwidth, and might receive duplicate
3176         or out-of-order callbacks. In the case of downloads, it would often be too late to convert the existing
3177         connection to a download, leading to restarted downloads or outright failures.
3178
3179         Bandaids were put in place for these issues in r188150, r188486, and r188851 to fix crashes or serious
3180         regressions in behavior, but these weren't complete fixes. They did not solve any of the duplicate data loading
3181         problems, and they did not make downloads work reliably in all cases.
3182
3183         This patch rolls out the bandaids (but keeps their tests) and replaces them with a more robust fix. Instead of
3184         hiding callbacks from DocumentLoader, ContentFilter now delivers willSendRequest(), redirectReceived(), and
3185         responseReceived() to DocumentLoader immediately, and cancels filtering if DocumentLoader decides to ignore the
3186         load, download it, or load substitute data. ContentFilter continues to buffer incoming data to prevent partial
3187         rendering of blocked content.
3188
3189         The existing tests for r188150 and r188851 were kept, the test for r188486 was rewritten to be specific to
3190         content filtering, and new tests were added to cover the case where ContentFilter is still undecided after a
3191         load finishes.
3192
3193         Tests: contentfiltering/allow-never.html
3194                contentfiltering/block-never.html
3195                ContentFiltering.AllowDownloadAfterAddData
3196                ContentFiltering.AllowDownloadAfterFinishedAddingData
3197                ContentFiltering.AllowDownloadAfterRedirect
3198                ContentFiltering.AllowDownloadAfterResponse
3199                ContentFiltering.AllowDownloadAfterWillSendRequest
3200                ContentFiltering.AllowDownloadNever
3201                ContentFiltering.BlockDownloadAfterAddData
3202                ContentFiltering.BlockDownloadAfterFinishedAddingData
3203                ContentFiltering.BlockDownloadAfterRedirect
3204                ContentFiltering.BlockDownloadAfterResponse
3205                ContentFiltering.BlockDownloadAfterWillSendRequest
3206                ContentFiltering.BlockDownloadNever
3207
3208         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
3209         (WebCore::JSMockContentFilterSettings::decisionPoint): Taught to handle DecisionPoint::Never, and rewrote to
3210         not need a set of const uint8_ts that mirror the DecisionPoint enum.
3211         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
3212         (WebCore::toJSValue): Rewrote to not need a set of const uint8_ts that mirror the Decision enum.
3213         (WebCore::toDecision): Ditto.
3214         * loader/ContentFilter.cpp:
3215         (WebCore::ContentFilter::createIfEnabled): Renamed from createIfNeeded, and changed to take a DocumentLoader&
3216         instead of a DecisionFunction.
3217         (WebCore::ContentFilter::ContentFilter):
3218         (WebCore::ContentFilter::responseReceived): If m_state != Blocked after filtering, call DocumentLoader::responseReceived().
3219         (WebCore::ContentFilter::dataReceived): If m_state == Allowed after filtering, deliver buffered data to DocumentLoader.
3220         If no filtering was necessary, call DocumentLoader::dataReceived() directly.
3221         (WebCore::ContentFilter::redirectReceived): If m_state != Blocked after filtering, call DocumentLoader::redirectReceived().
3222         (WebCore::ContentFilter::notifyFinished): If an error occured, call DocumentLoader::notifyFinished() immediately and return.
3223         If m_state != Blocked after filtering, deliver buffered data to DocumentLoader and call DocumentLoader::notifyFinished().
3224         If no filtering was necessary and m_state != Blocked, call DocumentLoader::notifyFinished() directly.
3225         (WebCore::ContentFilter::didDecide): Called DocumentLoader::contentFilterDidDecide() instead of m_decisionFunction().
3226         (WebCore::ContentFilter::deliverResourceData): Added a helper function to deliver buffered data to DocumentLoader.
3227         (WebCore::ContentFilter::createIfNeeded): Renamed to createIfEnabled().
3228         * loader/ContentFilter.h:
3229         * loader/DocumentLoader.cpp:
3230         (WebCore::DocumentLoader::DocumentLoader):
3231         (WebCore::DocumentLoader::willSendRequest): Stopped asserting that redirectResponse is null and made it part of
3232         the if condition instead, since willSendRequest() will now be called on redirects when there is an active ContentFilter.
3233         (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClient() instead of becomeMainResourceClientIfFilterAllows().
3234         (WebCore::DocumentLoader::becomeMainResourceClient): Renamed from becomeMainResourceClientIfFilterAllows().
3235         Only called ContentFilter::startFilteringMainResource() if the filter state is Initialized, since ContentFilter
3236         might have already made a decision in willSendRequest().
3237         (WebCore::DocumentLoader::contentFilterDidDecide): Stopped deleting m_contentFilter, since it will continue to deliver callbacks
3238         even after making a decision. Fixed a bug where we were creating two copies of ContentFilter's replacement data.
3239         (WebCore::DocumentLoader::syntheticRedirectReceived): Deleted.
3240         (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): Renamed to becomeMainResourceClient().
3241         * loader/DocumentLoader.h:
3242         * loader/EmptyClients.h:
3243         * loader/FrameLoaderClient.h:
3244         * loader/ResourceLoader.cpp:
3245         (WebCore::ResourceLoader::willSendRequestInternal): Removed part of r188851.
3246         * loader/SubresourceLoader.cpp:
3247         (WebCore::SubresourceLoader::didReceiveResponse): Removed part of r188486.
3248         * loader/SubresourceLoader.h:
3249         * loader/cache/CachedRawResource.cpp:
3250         (WebCore::CachedRawResource::didAddClient): Removed part of r188150.
3251         * loader/cache/CachedRawResourceClient.h:
3252         (WebCore::CachedRawResourceClient::syntheticRedirectReceived): Removed part of r188150.
3253         * testing/MockContentFilterSettings.h: Defined DecisionPoint::Never.
3254         * testing/MockContentFilterSettings.idl: Defined DECISION_POINT_NEVER.
3255
3256 2015-08-31  Chris Dumez  <cdumez@apple.com>
3257
3258         Unreviewed, rebaseline bindings tests after r189184.
3259
3260 2015-08-31  Chris Dumez  <cdumez@apple.com>
3261
3262         NodeFilter.SHOW_ALL has wrong value on 32-bit
3263         https://bugs.webkit.org/show_bug.cgi?id=148602
3264
3265         Reviewed by Geoffrey Garen.
3266
3267         NodeFilter.SHOW_ALL has wrong value on 32-bit. This is because
3268         NodeFilter.SHOW_ALL is an unsigned long whose value is 0xFFFFFFFF but
3269         our bindings code is casting it to an intptr_t type which is not wide
3270         enough on 32-bit.
3271
3272         No new tests, already covered by fast/dom/node-filter-interface.html
3273         which is now unskipped on Windows / 32bit.
3274
3275         * bindings/scripts/CodeGeneratorJS.pm:
3276         (GenerateHashTableValueArray):
3277         Generate extra curly brackets to initialize the new union member.
3278         Also cast to long long the constant instead of intptr_t.
3279
3280         * dom/NodeFilter.h:
3281         Explicitly mark the enum underlying type to be an unsigned long
3282         to make sure it can hold the value for SHOW_ALL on all platforms.
3283         On Windows, it seems the default underlying type is an int for
3284         e.g.
3285
3286 2015-08-31  Chris Dumez  <cdumez@apple.com>
3287
3288         Range.detach() / NodeIterator.detach() should be no-ops as per the latest DOM specification
3289         https://bugs.webkit.org/show_bug.cgi?id=148454
3290
3291         Reviewed by Ryosuke Niwa.
3292
3293         Range.detach() / NodeIterator.detach() should be no-ops as per the
3294         latest DOM specification:
3295         - https://dom.spec.whatwg.org/#dom-range-detach
3296         - https://dom.spec.whatwg.org/#dom-nodeiterator-detach
3297
3298         These are already no-ops in Firefox:
3299         - https://bugzilla.mozilla.org/show_bug.cgi?id=702948
3300         - https://bugzilla.mozilla.org/show_bug.cgi?id=823549
3301
3302         and Chrome:
3303         - https://src.chromium.org/viewvc/blink?revision=173010&view=revision
3304         - https://src.chromium.org/viewvc/blink?revision=172768&view=revision
3305
3306         Tests: fast/dom/Range/range-detach-noop.html
3307                fast/dom/node-iterator-detach-noop.html
3308
3309         * accessibility/AccessibilityObject.cpp:
3310         (WebCore::AccessibilityObject::selectText):
3311         (WebCore::AccessibilityObject::stringForVisiblePositionRange):
3312         (WebCore::AccessibilityObject::lengthForVisiblePositionRange):
3313         * accessibility/atk/WebKitAccessibleUtil.cpp:
3314         (selectionBelongsToObject):
3315         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3316         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
3317         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
3318         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3319         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]):
3320         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
3321         * bindings/scripts/CodeGeneratorGObject.pm:
3322         (FunctionUsedToRaiseException):
3323         * dom/DocumentMarkerController.cpp:
3324         (WebCore::DocumentMarkerController::addMarker):
3325         (WebCore::DocumentMarkerController::addTextMatchMarker):
3326         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker):
3327         (WebCore::DocumentMarkerController::addDictationResultMarker):
3328         (WebCore::DocumentMarkerController::removeMarkers):
3329         (WebCore::DocumentMarkerController::markersInRange):
3330         (DocumentMarkerController::setMarkersActive):
3331         (DocumentMarkerController::hasMarkers):
3332         (DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
3333         * dom/NodeIterator.cpp:
3334         (WebCore::NodeIterator::nextNode):
3335         (WebCore::NodeIterator::previousNode):
3336         (WebCore::NodeIterator::detach):
3337         (WebCore::NodeIterator::NodeIterator): Deleted.
3338         (WebCore::NodeIterator::nodeWillBeRemoved): Deleted.
3339         (WebCore::NodeIterator::updateForNodeRemoval): Deleted.
3340         * dom/NodeIterator.h:
3341         (WebCore::NodeIterator::nextNode):
3342         (WebCore::NodeIterator::previousNode):
3343         * dom/NodeIterator.idl:
3344         * dom/Range.cpp:
3345         (WebCore::Range::commonAncestorContainer):
3346         (WebCore::Range::setStart):
3347         (WebCore::Range::setEnd):
3348         (WebCore::Range::collapse):
3349         (WebCore::Range::isPointInRange):
3350         (WebCore::Range::comparePoint):
3351         (WebCore::Range::compareNode):
3352         (WebCore::Range::compareBoundaryPoints):
3353         (WebCore::Range::boundaryPointsValid):
3354         (WebCore::Range::deleteContents):
3355         (WebCore::Range::processContents):
3356         (WebCore::Range::processContentsBetweenOffsets):
3357         (WebCore::Range::processAncestorsAndTheirSiblings):
3358         (WebCore::Range::extractContents):
3359         (WebCore::Range::cloneContents):
3360         (WebCore::Range::insertNode):
3361         (WebCore::Range::toString):
3362         (WebCore::Range::text):
3363         (WebCore::Range::createContextualFragment):
3364         (WebCore::Range::detach):
3365         (WebCore::Range::cloneRange):
3366         (WebCore::Range::surroundContents):
3367         (WebCore::Range::checkDeleteExtract):
3368         (WebCore::Range::containedByReadOnly):
3369         (WebCore::Range::firstNode):
3370         (WebCore::Range::shadowRoot):
3371         (WebCore::Range::pastLastNode):
3372         (WebCore::Range::absoluteTextRects):
3373         (WebCore::Range::absoluteTextQuads):
3374         (WebCore::Range::collectSelectionRects):
3375         (WebCore::Range::formatForDebugger):
3376         (WebCore::Range::contains):
3377         (WebCore::rangesOverlap):
3378         (WebCore::Range::getBorderAndTextQuads):
3379         (WebCore::Range::boundingRectInternal):
3380         (showTree):
3381         (WebCore::checkForDifferentRootContainer): Deleted.
3382         (WebCore::lengthOfContentsInNode): Deleted.
3383         (WebCore::Range::processNodes): Deleted.
3384         (WebCore::Range::checkNodeWOffset): Deleted.
3385         (WebCore::Range::checkNodeBA): Deleted.
3386         (WebCore::Range::setStartAfter): Deleted.
3387         (WebCore::Range::setEndBefore): Deleted.
3388         (WebCore::Range::setEndAfter): Deleted.
3389         (WebCore::Range::selectNode): Deleted.
3390         (WebCore::intervalsSufficientlyOverlap): Deleted.
3391         (WebCore::coalesceSelectionRects): Deleted.
3392         (WebCore::areRangesEqual): Deleted.
3393         (WebCore::boundaryTextNodesSplit): Deleted.
3394         (WebCore::Range::textNodeSplit): Deleted.
3395         (WebCore::Range::expand): Deleted.
3396         * dom/Range.h:
3397         (WebCore::Range::startContainer):
3398         (WebCore::Range::endContainer):
3399         (WebCore::Range::collapsed):
3400         (WebCore::Range::commonAncestorContainer):
3401         * dom/Range.idl:
3402         * editing/AlternativeTextController.cpp:
3403         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
3404         (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
3405         (WebCore::AlternativeTextController::markReversed):
3406         (WebCore::AlternativeTextController::markCorrection):
3407         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
3408         (WebCore::AlternativeTextController::applyDictationAlternative):
3409         * editing/EditingStyle.cpp:
3410         (WebCore::EditingStyle::styleAtSelectionStart):
3411         * editing/Editor.cpp:
3412         (WebCore::Editor::canDeleteRange):
3413         (WebCore::Editor::shouldDeleteRange):
3414         (WebCore::Editor::advanceToNextMisspelling):
3415         (WebCore::Editor::markMisspellingsOrBadGrammar):
3416         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
3417         (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
3418         (WebCore::Editor::markAndReplaceFor):
3419         (WebCore::Editor::changeBackToReplacedString):
3420         (WebCore::Editor::firstRectForRange):
3421         (WebCore::Editor::rangeOfString):
3422         (WebCore::Editor::countMatchesForText):
3423         (WebCore::Editor::scanRangeForTelephoneNumbers):
3424         (WebCore::isFrameInRange): Deleted.
3425         * editing/EditorCommand.cpp:
3426         (WebCore::expandSelectionToGranularity):
3427         (WebCore::unionDOMRanges):
3428         * editing/FormatBlockCommand.cpp:
3429         (WebCore::FormatBlockCommand::elementForFormatBlockCommand):
3430         * editing/FrameSelection.cpp:
3431         (WebCore::FrameSelection::setSelectedRange):
3432         (WebCore::FrameSelection::wordOffsetInRange):
3433         (WebCore::FrameSelection::spaceFollowsWordInRange):
3434         (WebCore::FrameSelection::selectionAtDocumentStart): Deleted.
3435         * editing/MarkupAccumulator.cpp:
3436         (WebCore::MarkupAccumulator::appendText):
3437         * editing/SpellChecker.cpp:
3438         (WebCore::SpellCheckRequest::SpellCheckRequest):
3439         (WebCore::SpellChecker::isCheckable):
3440         * editing/SpellingCorrectionCommand.cpp:
3441         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
3442         * editing/TextCheckingHelper.cpp:
3443         (WebCore::expandToParagraphBoundary):
3444         (WebCore::TextCheckingParagraph::offsetTo):
3445         (WebCore::TextCheckingParagraph::offsetAsRange):
3446         (WebCore::TextCheckingHelper::findFirstMisspelling):
3447         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
3448         (WebCore::TextCheckingHelper::findFirstGrammarDetail):
3449         (WebCore::TextCheckingHelper::isUngrammatical):
3450         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
3451         * editing/TextIterator.cpp:
3452         (WebCore::TextIterator::TextIterator):
3453         (WebCore::TextIterator::node):
3454         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
3455         (WebCore::CharacterIterator::range):
3456         (WebCore::characterSubrange):
3457         (WebCore::BackwardsCharacterIterator::range):
3458         (WebCore::TextIterator::rangeFromLocationAndLength):
3459         (WebCore::TextIterator::getLocationAndLengthFromRange):
3460         (WebCore::collapsedToBoundary):
3461         (WebCore::findPlainText):
3462         (WebCore::BackwardsCharacterIterator::BackwardsCharacterIterator): Deleted.
3463         (WebCore::BackwardsCharacterIterator::advance): Deleted.
3464         (WebCore::plainText): Deleted.
3465         * editing/VisibleUnits.cpp:
3466         (WebCore::previousBoundary):
3467         * editing/cocoa/HTMLConverter.mm:
3468         (HTMLConverter::_processText):
3469         (HTMLConverter::_traverseNode):
3470         (HTMLConverter::_traverseFooterNode):
3471         (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
3472         (WebCore::editingAttributedStringFromRange):
3473         * editing/mac/EditorMac.mm:
3474         (WebCore::Editor::adjustedSelectionRange):
3475         * editing/markup.cpp:
3476         (WebCore::StyledMarkupAccumulator::renderedText):
3477         (WebCore::StyledMarkupAccumulator::stringValueForRange):
3478         (WebCore::highestAncestorToWrapMarkup):
3479         (WebCore::createMarkupInternal):
3480         (WebCore::createFullMarkup):
3481         (WebCore::urlToMarkup): Deleted.
3482         * loader/archive/cf/LegacyWebArchive.cpp:
3483         (WebCore::LegacyWebArchive::create):
3484         * page/ContextMenuController.cpp:
3485         (WebCore::ContextMenuController::contextMenuItemSelected):
3486         * page/DOMSelection.cpp:
3487         (WebCore::DOMSelection::deleteFromDocument):
3488         (WebCore::DOMSelection::containsNode):
3489         * page/TextIndicator.cpp:
3490         (WebCore::TextIndicator::createWithRange):
3491         * page/ios/FrameIOS.mm:
3492         (WebCore::Frame::indexCountOfWordPrecedingSelection):
3493         (WebCore::Frame::wordsInCurrentParagraph):
3494         * platform/win/PasteboardWin.cpp:
3495         (WebCore::Pasteboard::writeRangeToDataObject):
3496         (WebCore::Pasteboard::writeSelection):
3497         * rendering/RenderNamedFlowThread.cpp:
3498         (WebCore::RenderNamedFlowThread::getRanges):
3499         * rendering/RenderObject.cpp:
3500         (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
3501
3502 2015-08-31  Myles C. Maxfield  <mmaxfield@apple.com>
3503
3504         [Cocoa] Unify showGlyphsWithAdvances
3505         https://bugs.webkit.org/show_bug.cgi?id=148565
3506
3507         Reviewed by Dean Jackson.
3508
3509         None of the fonts created for WebKit have the renderingMode of
3510         NSFontAntialiasedIntegerAdvancementsRenderingMode and are already printer fonts.
3511
3512         No new tests because there is no behavior change.
3513
3514         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3515         (WebCore::setCGFontRenderingMode):
3516         (WebCore::FontCascade::drawGlyphs):
3517
3518 2015-08-31  Tim Horton  <timothy_horton@apple.com>
3519
3520         iOS WebKit2 find-in-page doesn't support multi-line results, is often blank
3521         https://bugs.webkit.org/show_bug.cgi?id=148599
3522         <rdar://problem/17914031>
3523
3524         Reviewed by Beth Dakin.
3525
3526         * editing/FrameSelection.cpp:
3527         (WebCore::FrameSelection::getClippedVisibleTextRectangles):
3528         (WebCore::FrameSelection::getTextRectangles):
3529         * editing/FrameSelection.h:
3530         * page/TextIndicator.cpp:
3531         (WebCore::initializeIndicator):
3532         * page/TextIndicator.h:
3533         Make it possible to create a TextIndicator that isn't clipped to the visible rect,
3534         because iOS find-in-page TextIndicators persist while scrolling the page,
3535         and are already constrained to the document rect anyway.
3536
3537 2015-08-31  Michael Catanzaro  <mcatanzaro@igalia.com>
3538
3539         [Freetype] FontCache::strengthOfFirstAlias leaks an FcPattern
3540         https://bugs.webkit.org/show_bug.cgi?id=148624
3541
3542         Reviewed by Martin Robinson.
3543
3544         Using the normal RefPtr constructor causes the FcPattern to be reffed one extra time. Even
3545         though the FcPattern is intentionally leaked to FcFontSetAdd down below, the FcPattern has
3546         its own refcount and now it's screwed up. Just completely stop using RefPtr for these
3547         FcPatterns, since the potential for confusion regarding leakRef combined with Fontconfig
3548         refcounting far outweighs the benefit of using a smart pointer.
3549
3550         * platform/graphics/freetype/FontCacheFreeType.cpp:
3551         (WebCore::strengthOfFirstAlias):
3552
3553 2015-08-31  Javier Fernandez  <jfernandez@igalia.com>
3554
3555         [CSS Grid Layout] auto-margins alignment does not work for heights
3556         https://bugs.webkit.org/show_bug.cgi?id=148071
3557
3558         Reviewed by Sergio Villar Senin.
3559
3560         We still had pending to align grid items horizontally via auto-margins
3561         alignment. We already landed a patch in r188582 to implement the
3562         column-axis alignment and this patch implements the expected behavior in
3563         the row-axis.
3564
3565         This patch also removes the logic in RenderBox, so we reduce grid related
3566         code dependencies in the general layout logic. We can do that because this
3567         patch manages that in the layoutGridItems function by resetting grid item's
3568         margin and logicalTop (if it does not need to perform a layout, which it
3569         would do the job anyway).
3570
3571         No new tests, we just need to adapt some cases of the ones we already have.
3572
3573         * rendering/RenderBox.cpp:
3574         (WebCore::RenderBox::styleDidChange): Deleted.
3575         (WebCore::RenderBox::willBeRemovedFromTree): Deleted.
3576         (WebCore::RenderBox::updateFromStyle): Deleted.
3577         * rendering/RenderGrid.cpp:
3578         (WebCore::RenderGrid::layoutGridItems):
3579         (WebCore::RenderGrid::resetAutoMarginsAndLogicalTopInColumnAxis):
3580         (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded):
3581         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
3582         (WebCore::RenderGrid::hasAutoMarginsInRowAxis): Deleted.
3583         * rendering/RenderGrid.h:
3584
3585 2015-08-31  Alexey Proskuryakov  <ap@apple.com>
3586
3587         Build fix.
3588
3589         * page/EventHandler.h:
3590         (WebCore::EventHandler::immediateActionStage): Don't export an inline function,
3591         to avoid "weak external symbol" errors.
3592
3593 2015-08-31  Enrica Casucci  <enrica@apple.com>
3594
3595         Incorrect cursor movement for U+26F9, U+1F3CB with variations.
3596         https://bugs.webkit.org/show_bug.cgi?id=148629
3597         rdar://problem/22492366
3598
3599         Reviewed by Ryosuke Niwa.
3600
3601         Updating text break iterator rules to correctly handle those two emoji with variations.
3602
3603         * platform/text/TextBreakIterator.cpp:
3604         (WebCore::cursorMovementIterator):
3605
3606 2015-07-31  Sergio Villar Senin  <svillar@igalia.com>
3607
3608         [css-grid] Grid containers reporting wrong preferred widths
3609         https://bugs.webkit.org/show_bug.cgi?id=147486
3610
3611         Reviewed by Darin Adler.
3612
3613         RenderGrid used to have its own overwritten version of
3614         computePreferredLogicalWidths() because we didn't have an
3615         implementation of computeIntrinsicLogicalWidths(). That
3616         implementation was not as complete as RenderBlock's because it
3617         was not taking into account min/max-width restrictions.
3618
3619         Provided that computeIntrinsicLogicalWidths() has been there
3620         for some time we can safelly kill our overwrite and use
3621         RenderBlock's version which addresses all the FIXMEs we had in
3622         our code.
3623
3624         * rendering/RenderGrid.cpp:
3625         * rendering/RenderGrid.h:
3626
3627 2015-08-31  Sungmann Cho  <sungmann.cho@navercorp.com>
3628
3629         Fix the WinCairo build after landing of webkit.org/b/148561.
3630         https://bugs.webkit.org/show_bug.cgi?id=148627
3631
3632         Reviewed by Myles C. Maxfield.
3633
3634         No new tests, no behavior change.
3635
3636         * platform/graphics/win/ImageCairoWin.cpp:
3637         (WebCore::BitmapImage::getHBITMAPOfSize):
3638         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3639         (WebCore::MediaPlayerPrivateMediaFoundation::paint):
3640         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3641
3642 2015-08-31  Antti Koivisto  <antti@apple.com>
3643
3644         REGRESSION (r188820): fast/dom/HTMLObjectElement/object-as-frame.html is flaky
3645         https://bugs.webkit.org/show_bug.cgi?id=148533
3646
3647         Reviewed by Chris Dumez.
3648
3649         <object> element may cause document load event fire too early. By making data URL
3650         loading faster r188820 made this condition more likely to trigger in this test.
3651
3652         * loader/SubframeLoader.cpp:
3653         (WebCore::SubframeLoader::loadSubframe):
3654
3655             Post-parsing style recalc may trigger loads for <object> elements. If all other loads have already
3656             completed this may cause load event to fire synchronously from the initial empty document construction.
3657
3658             Fix by preventing load events during subframe initialization. They will be fired if needed by the
3659             subsequent explicit call to FrameLoader::checkCompleted.
3660
3661 2015-08-30  Ryuan Choi  <ryuan.choi@navercorp.com>
3662
3663         [CoordinatedGraphics] Remove unnecessary two virtual methods from TiledBackingStoreClient
3664         https://bugs.webkit.org/show_bug.cgi?id=147137
3665
3666         Reviewed by Gyuyoung Kim.
3667
3668         tiledBackingStoreContentsRect() and tiledBackingStoreVisibleRect() are not
3669         necessary because CoordinatedGraphicsLayer can pass them directly if needed.
3670         This patch removes them in order to simplify code flow between TiledBackingStore
3671         and CoordinatedGraphicsLayer.
3672
3673         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3674         (WebCore::CoordinatedGraphicsLayer::imageBackingVisible):
3675         (WebCore::CoordinatedGraphicsLayer::adjustContentsScale):
3676         (WebCore::clampToContentsRectIfRectIsInfinite):
3677         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
3678         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
3679         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreContentsRect): Deleted.
3680         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreVisibleRect): Deleted.
3681         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3682         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
3683         (WebCore::TiledBackingStore::createTilesIfNeeded):
3684         (WebCore::TiledBackingStore::coverageRatio):
3685         (WebCore::TiledBackingStore::visibleAreaIsCovered):
3686         Used TiledBackingStore's m_visibleRect and m_rect, cached and scaled values for
3687         visibleRect, contentsRect.
3688         (WebCore::TiledBackingStore::createTiles):
3689         (WebCore::TiledBackingStore::removeAllNonVisibleTiles):
3690         (WebCore::TiledBackingStore::coverWithTilesIfNeeded): Renamed to createTilesIfNeeded.
3691         (WebCore::TiledBackingStore::visibleRect): Deleted. nobody used.
3692         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
3693         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
3694         (WebCore::TiledBackingStoreClient::tiledBackingStoreHasPendingTileCreation):
3695         Removed default implementation.
3696
3697 2015-08-29  Jessie Berlin  <berlin@apple.com>
3698
3699         El Capitan build fix.
3700
3701         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3702         (WebCore::FontCascade::drawGlyphs):
3703
3704 2015-08-29  Chris Fleizach  <cfleizach@apple.com>
3705
3706         AX: When navigating the elements of a scrollable element with VoiceOver, the scrollTop() position of the element does not permanently change
3707         https://bugs.webkit.org/show_bug.cgi?id=125720
3708
3709         Reviewed by Daniel Bates.
3710
3711         The scrollToVisible code did not account for scrollable elements that are larger than their viewports.
3712         First, we need to pass the sub-focus up the scroll chain (otherwise we'll scroll some parent to y=0).
3713         Second, we should try to center the focus within the viewport, rather than positioning at the bottom for a 
3714         better experience.
3715
3716         This change was adapted from Blink r183926:
3717         https://src.chromium.org/viewvc/blink?view=rev&revision=183926
3718
3719         Tests: accessibility/scroll-to-global-point-iframe-nested.html
3720                accessibility/scroll-to-global-point-iframe.html
3721                accessibility/scroll-to-global-point-main-window.html
3722                accessibility/scroll-to-global-point-nested.html
3723                accessibility/scroll-to-make-visible-div-overflow.html
3724                accessibility/scroll-to-make-visible-iframe.html
3725                accessibility/scroll-to-make-visible-nested-2.html
3726                accessibility/scroll-to-make-visible-nested.html
3727                accessibility/scroll-to-make-visible-with-subfocus.html
3728
3729         * accessibility/AccessibilityObject.cpp:
3730         (WebCore::computeBestScrollOffset):
3731         (WebCore::AccessibilityObject::isOnscreen):
3732         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
3733         (WebCore::AccessibilityObject::scrollToGlobalPoint):
3734         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3735         (-[WebAccessibilityObjectWrapper accessibilityScrollToVisible]):
3736         (-[WebAccessibilityObjectWrapper _accessibilityScrollToMakeVisibleWithSubFocus:]):
3737         (-[WebAccessibilityObjectWrapper _accessibilityScrollToGlobalPoint:]):
3738         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
3739
3740 2015-08-28  Myles C. Maxfield  <mmaxfield@apple.com>
3741
3742         Migrate GraphicsContexts from pointers to references
3743         https://bugs.webkit.org/show_bug.cgi?id=148561
3744
3745         Reviewed by Tim Horton.
3746
3747         We were using GraphicsContext*s throughout our rendering code. However,
3748         these contexts can't be nullptr. This patch migrates users to
3749         GraphicsContext&s.
3750
3751         This is a purely mechanical change.
3752
3753         No new tests because there is no behavior change.
3754
3755         * css/CSSFilterImageValue.cpp:
3756         (WebCore::CSSFilterImageValue::image):
3757         * editing/Editor.cpp:
3758         (WebCore::Editor::countMatchesForText):
3759         * editing/FrameSelection.cpp:
3760         (WebCore::FrameSelection::paintCaret):
3761         (WebCore::CaretBase::paintCaret):
3762         (WebCore::DragCaretController::paintDragCaret):
3763         * editing/FrameSelection.h:
3764         * html/HTMLCanvasElement.cpp:
3765         (WebCore::HTMLCanvasElement::paint):
3766         (WebCore::HTMLCanvasElement::createImageBuffer):
3767         (WebCore::HTMLCanvasElement::drawingContext):
3768         * html/HTMLCanvasElement.h:
3769         * html/HTMLVideoElement.cpp:
3770         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
3771         * html/HTMLVideoElement.h:
3772         * html/canvas/CanvasRenderingContext2D.cpp:
3773         (WebCore::CanvasRenderingContext2D::drawImage):
3774         (WebCore::drawImageToContext):
3775         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
3776         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3777         * html/canvas/WebGLRenderingContextBase.cpp:
3778         (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
3779         * inspector/InspectorOverlay.cpp:
3780         (WebCore::InspectorOverlay::paint):
3781         * page/FrameSnapshotting.cpp:
3782         (WebCore::snapshotFrameRect):
3783         * page/FrameView.cpp:
3784         (WebCore::FrameView::paintScrollCorner):
3785         (WebCore::FrameView::paintScrollbar):
3786         (WebCore::FrameView::paintControlTints):
3787         (WebCore::FrameView::willPaintContents):
3788         (WebCore::FrameView::didPaintContents):
3789         (WebCore::FrameView::paintContents):
3790         (WebCore::FrameView::paintContentsForSnapshot):
3791         (WebCore::FrameView::paintOverhangAreas):
3792         (WebCore::FrameView::adjustPageHeightDeprecated):
3793         * page/FrameView.h:
3794         * page/PrintContext.cpp:
3795         (WebCore::PrintContext::spoolPage):
3796         (WebCore::PrintContext::spoolRect):
3797         * page/win/FrameCGWin.cpp:
3798         (WebCore::drawRectIntoContext):
3799         (WebCore::imageFromRect):
3800         * platform/ScrollView.cpp:
3801         (WebCore::ScrollView::paintScrollCorner):
3802         (WebCore::ScrollView::paintScrollbar):
3803         (WebCore::ScrollView::paintScrollbars):
3804         (WebCore::ScrollView::paintPanScrollIcon):
3805         (WebCore::ScrollView::paint):
3806         (WebCore::ScrollView::paintOverhangAreas):
3807         (WebCore::ScrollView::calculateAndPaintOverhangAreas):
3808         * platform/ScrollView.h:
3809         * platform/Scrollbar.cpp:
3810         (WebCore::Scrollbar::paint):
3811         * platform/Scrollbar.h:
3812         * platform/ScrollbarTheme.h:
3813         (WebCore::ScrollbarTheme::paintScrollCorner):
3814         (WebCore::ScrollbarTheme::defaultPaintScrollCorner):
3815         (WebCore::ScrollbarTheme::paintOverhangAreas):
3816         * platform/ScrollbarThemeComposite.cpp:
3817         (WebCore::ScrollbarThemeComposite::paintScrollCorner):
3818         (WebCore::ScrollbarThemeComposite::paintOverhangAreas):
3819         * platform/ScrollbarThemeComposite.h:
3820         * platform/Theme.cpp:
3821         (WebCore::Theme::drawNamedImage):
3822         * platform/Theme.h:
3823         (WebCore::Theme::paint):
3824         * platform/Widget.h:
3825         * platform/cocoa/ThemeCocoa.cpp:
3826         (WebCore::fitContextToBox):
3827         (WebCore::ThemeCocoa::drawNamedImage):
3828         * platform/cocoa/ThemeCocoa.h:
3829         * platform/efl/WidgetEfl.cpp:
3830         (WebCore::Widget::paint):
3831         * platform/graphics/BitmapImage.cpp:
3832         (WebCore::BitmapImage::drawPattern):
3833         * platform/graphics/BitmapImage.h:
3834         * platform/graphics/CrossfadeGeneratedImage.cpp:
3835         (WebCore::drawCrossfadeSubimage):
3836         (WebCore::CrossfadeGeneratedImage::drawCrossfade):
3837         (WebCore::CrossfadeGeneratedImage::draw):
3838         (WebCore::CrossfadeGeneratedImage::drawPattern):
3839         * platform/graphics/CrossfadeGeneratedImage.h:
3840         * platform/graphics/FontCascade.cpp:
3841         (WebCore::FontCascade::drawText):
3842         (WebCore::FontCascade::drawEmphasisMarks):
3843         (WebCore::FontCascade::drawSimpleText):
3844         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
3845         (WebCore::FontCascade::drawGlyphBuffer):
3846         * platform/graphics/FontCascade.h:
3847         * platform/graphics/GeneratedImage.h:
3848         * platform/graphics/GradientImage.cpp:
3849         (WebCore::GradientImage::draw):
3850         (WebCore::GradientImage::drawPattern):
3851         * platform/graphics/GradientImage.h:
3852         * platform/graphics/GraphicsContext.cpp:
3853         (WebCore::GraphicsContext::drawText):
3854         (WebCore::GraphicsContext::drawGlyphs):
3855         (WebCore::GraphicsContext::drawEmphasisMarks):
3856         (WebCore::GraphicsContext::drawBidiText):
3857         (WebCore::GraphicsContext::drawImage):
3858         (WebCore::GraphicsContext::drawTiledImage):
3859         (WebCore::GraphicsContext::drawImageBuffer):
3860         (WebCore::GraphicsContext::clipToImageBuffer):
3861         (WebCore::GraphicsContext::createCompatibleBuffer):
3862         (WebCore::GraphicsContext::isCompatibleWithBuffer):
3863         * platform/graphics/GraphicsContext.h:
3864         * platform/graphics/GraphicsContext3D.h:
3865         * platform/graphics/Image.cpp:
3866         (WebCore::Image::fillWithSolidColor):
3867         (WebCore::Image::draw):
3868         (WebCore::Image::drawTiled):
3869         * platform/graphics/Image.h:
3870         (WebCore::Image::drawFrameMatchingSourceSize):
3871         * platform/graphics/ImageBuffer.cpp:
3872         (WebCore::ImageBuffer::createCompatibleBuffer):
3873         * platform/graphics/ImageBuffer.h:
3874         * platform/graphics/MediaPlayer.cpp:
3875         (WebCore::MediaPlayer::paint):
3876         (WebCore::MediaPlayer::paintCurrentFrameInContext):
3877         * platform/graphics/MediaPlayer.h:
3878         * platform/graphics/MediaPlayerPrivate.h:
3879         (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
3880         * platform/graphics/NamedImageGeneratedImage.cpp:
3881         (WebCore::NamedImageGeneratedImage::draw):
3882         (WebCore::NamedImageGeneratedImage::drawPattern):
3883         * platform/graphics/NamedImageGeneratedImage.h:
3884         * platform/graphics/ShadowBlur.cpp:
3885         (WebCore::ShadowBlur::adjustBlurRadius):
3886         (WebCore::ShadowBlur::calculateLayerBoundingRect):
3887         (WebCore::ShadowBlur::drawShadowBuffer):
3888         (WebCore::ShadowBlur::drawRectShadow):
3889         (WebCore::ShadowBlur::drawInsetShadow):
3890         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
3891         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
3892         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
3893         (WebCore::ShadowBlur::drawRectShadowWithTiling):
3894         (WebCore::ShadowBlur::drawLayerPieces):
3895         (WebCore::ShadowBlur::blurAndColorShadowBuffer):
3896         (WebCore::ShadowBlur::beginShadowLayer):
3897         (WebCore::ShadowBlur::endShadowLayer):
3898         * platform/graphics/ShadowBlur.h:
3899         * platform/graphics/TextRun.h:
3900         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3901         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3902         (WebCore::MediaPlayerPrivateAVFoundationCF::paintCurrentFrameInContext):
3903         (WebCore::MediaPlayerPrivateAVFoundationCF::paint):
3904         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
3905         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3906         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3907         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
3908         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
3909         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
3910         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
3911         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3912         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3913         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
3914         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
3915         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3916         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3917         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paint):
3918         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
3919         * platform/graphics/cairo/BitmapImageCairo.cpp:
3920         (WebCore::BitmapImage::draw):
3921         * platform/graphics/cairo/FontCairo.cpp:
3922         (WebCore::drawGlyphsToContext):
3923         (WebCore::drawGlyphsShadow):
3924         (WebCore::FontCascade::drawGlyphs):
3925         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3926         (WebCore::FontCascade::drawComplexText):
3927         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
3928         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3929         (WebCore::drawPathShadow):
3930         (WebCore::fillCurrentCairoPath):
3931         (WebCore::shadowAndFillCurrentCairoPath):
3932         (WebCore::shadowAndStrokeCurrentCairoPath):
3933         (WebCore::GraphicsContext::fillPath):
3934         (WebCore::GraphicsContext::strokePath):
3935         (WebCore::GraphicsContext::fillRect):
3936         (WebCore::GraphicsContext::strokeRect):
3937         (WebCore::GraphicsContext::platformFillRoundedRect):
3938         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3939         * platform/graphics/cairo/ImageBufferCairo.cpp:
3940         (WebCore::ImageBuffer::context):
3941         (WebCore::ImageBuffer::clip):
3942         (WebCore::ImageBuffer::draw):
3943         (WebCore::ImageBuffer::drawPattern):
3944         (WebCore::ImageBuffer::toDataURL):
3945         * platform/graphics/cairo/ImageCairo.cpp:
3946         (WebCore::Image::drawPattern):
3947         * platform/graphics/cairo/PlatformContextCairo.cpp:
3948         (WebCore::PlatformContextCairo::drawSurfaceToContext):
3949         * platform/graphics/cairo/PlatformContextCairo.h:
3950         * platform/graphics/cg/BitmapImageCG.cpp:
3951         (WebCore::BitmapImage::draw):
3952         * platform/graphics/cg/GraphicsContext3DCG.cpp:
3953         (WebCore::GraphicsContext3D::paintToCanvas):
3954         * platform/graphics/cg/GraphicsContextCG.cpp:
3955         (WebCore::GraphicsContext::fillRect):
3956         (WebCore::GraphicsContext::platformFillRoundedRect):
3957         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3958         * platform/graphics/cg/ImageBufferCG.cpp:
3959         (WebCore::ImageBuffer::ImageBuffer):
3960         (WebCore::ImageBuffer::context):
3961         (WebCore::ImageBuffer::flushContext):
3962         (WebCore::ImageBuffer::copyNativeImage):
3963         (WebCore::ImageBuffer::draw):
3964         (WebCore::ImageBuffer::drawPattern):
3965         (WebCore::ImageBuffer::clip):
3966         (WebCore::ImageBuffer::getUnmultipliedImageData):
3967         (WebCore::ImageBuffer::getPremultipliedImageData):
3968         (WebCore::ImageBuffer::putByteArray):
3969         (WebCore::ImageBuffer::toDataURL):
3970         * platform/graphics/cg/ImageCG.cpp:
3971         (WebCore::Image::drawPattern):
3972         * platform/graphics/cg/PDFDocumentImage.cpp:
3973         (WebCore::PDFDocumentImage::cacheParametersMatch):
3974         (WebCore::transformContextForPainting):
3975         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
3976         (WebCore::PDFDocumentImage::draw):
3977         (WebCore::applyRotationForPainting):
3978         (WebCore::PDFDocumentImage::drawPDFPage):
3979         * platform/graphics/cg/PDFDocumentImage.h:
3980         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3981         (WebCore::showLetterpressedGlyphsWithAdvances):
3982         (WebCore::showGlyphsWithAdvances):
3983         (WebCore::FontCascade::drawGlyphs):
3984         (WebCore::FontCascade::drawComplexText):
3985         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
3986         * platform/graphics/efl/ImageBufferEfl.cpp:
3987         (WebCore::ImageBuffer::toDataURL):
3988         * platform/graphics/filters/FEBlend.cpp:
3989         (WebCore::FEBlend::platformApplySoftware):
3990         * platform/graphics/filters/FEColorMatrix.cpp:
3991         (WebCore::FEColorMatrix::platformApplySoftware):
3992         * platform/graphics/filters/FEComposite.cpp:
3993         (WebCore::FEComposite::platformApplySoftware):
3994         * platform/graphics/filters/FEDropShadow.cpp:
3995         (WebCore::FEDropShadow::platformApplySoftware):
3996         * platform/graphics/filters/FEFlood.cpp:
3997         (WebCore::FEFlood::platformApplySoftware):
3998         * platform/graphics/filters/FEMerge.cpp:
3999         (WebCore::FEMerge::platformApplySoftware):
4000         * platform/graphics/filters/FEOffset.cpp:
4001         (WebCore::FEOffset::platformApplySoftware):
4002         * platform/graphics/filters/FETile.cpp:
4003         (WebCore::FETile::platformApplySoftware):
4004         * platform/graphics/filters/FilterEffect.cpp:
4005         (WebCore::FilterEffect::createImageBufferResult): Deleted.
4006