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