1b825c86cdc135d5e59c51db26ea5b30e023dabf
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-09-16  Antti Koivisto  <antti@apple.com>
2
3         Turn ChildNodeInsertion/RemovalNotifier classes into functions
4         https://bugs.webkit.org/show_bug.cgi?id=149236
5
6         Reviewed by Ryosuke Niwa.
7
8         Less architecture, more readability.
9
10         * dom/ContainerNode.cpp:
11         (WebCore::ContainerNode::notifyChildInserted):
12         (WebCore::ContainerNode::notifyChildRemoved):
13         (WebCore::ContainerNode::removeChildren):
14         * dom/ContainerNodeAlgorithms.cpp:
15         (WebCore::notifyDescendantInsertedIntoDocument):
16         (WebCore::notifyDescendantInsertedIntoTree):
17         (WebCore::notifyNodeInsertedIntoDocument):
18         (WebCore::notifyNodeInsertedIntoTree):
19         (WebCore::notifyChildNodeInserted):
20         (WebCore::notifyNodeRemovedFromDocument):
21         (WebCore::notifyNodeRemovedFromTree):
22         (WebCore::notifyChildNodeRemoved):
23         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument): Deleted.
24         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree): Deleted.
25         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument): Deleted.
26         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree): Deleted.
27         * dom/ContainerNodeAlgorithms.h:
28         (WebCore::ChildNodeInsertionNotifier::ChildNodeInsertionNotifier): Deleted.
29         (WebCore::ChildNodeRemovalNotifier::ChildNodeRemovalNotifier): Deleted.
30         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument): Deleted.
31         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree): Deleted.
32         (WebCore::ChildNodeInsertionNotifier::notify): Deleted.
33         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument): Deleted.
34         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromTree): Deleted.
35         (WebCore::ChildNodeRemovalNotifier::notify): Deleted.
36         * dom/Element.cpp:
37         (WebCore::Element::addShadowRoot):
38         (WebCore::Element::removeShadowRoot):
39         (WebCore::Element::createShadowRoot):
40
41 2015-09-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
42
43         Remove all uses of PassRefPtr in WebCore/bindings
44         https://bugs.webkit.org/show_bug.cgi?id=149207
45
46         Reviewed by Darin Adler.
47
48         If RefPtr<>&& argument is passed to new variable or other function, we use copyRef() or WTF::move().
49         copyRef() should be used when the argument continues to be used in following code. If it is final use
50         inside function, we have to use WTF::move().
51
52         * bridge/NP_jsobject.cpp:
53         * bridge/NP_jsobject.h:
54         * bridge/c/CRuntimeObject.cpp:
55         (JSC::Bindings::CRuntimeObject::CRuntimeObject):
56         * bridge/c/CRuntimeObject.h:
57         (JSC::Bindings::CRuntimeObject::create):
58         * bridge/c/c_instance.cpp:
59         (JSC::Bindings::CInstance::CInstance):
60         * bridge/c/c_instance.h:
61         (JSC::Bindings::CInstance::create):
62         * bridge/jsc/BridgeJSC.cpp:
63         (JSC::Bindings::Array::Array):
64         (JSC::Bindings::Instance::Instance):
65         * bridge/jsc/BridgeJSC.h:
66         * bridge/objc/ObjCRuntimeObject.h:
67         (JSC::Bindings::ObjCRuntimeObject::create):
68         * bridge/objc/ObjCRuntimeObject.mm:
69         (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
70         * bridge/objc/WebScriptObjectProtocol.h:
71         * bridge/objc/objc_instance.h:
72         * bridge/objc/objc_instance.mm:
73         (ObjcInstance::ObjcInstance):
74         (ObjcInstance::create):
75         * bridge/objc/objc_runtime.h:
76         * bridge/objc/objc_runtime.mm:
77         (JSC::Bindings::ObjcArray::ObjcArray):
78         * bridge/runtime_object.cpp:
79         (JSC::Bindings::RuntimeObject::RuntimeObject):
80         * bridge/runtime_object.h:
81         * bridge/runtime_root.cpp:
82         (JSC::Bindings::RootObject::create):
83         * bridge/runtime_root.h:
84
85 2015-09-16  Chris Dumez  <cdumez@apple.com>
86
87         Element's attribute NS API should defined treat undefined namespace as null
88         https://bugs.webkit.org/show_bug.cgi?id=149238
89         <rdar://problem/22562204>
90
91         Reviewed by Ryosuke Niwa.
92
93         Element's attribute NS API should treat defined undefined namespace as null
94         instead of converting it to the "undefined" String. This is because the
95         namespace parameter is a nullable String as per the DOM spec:
96         - https://dom.spec.whatwg.org/#element
97
98         The attribute is nullable and WebIDL says undefined should be converted
99         to null for nullable parameters:
100         - https://heycam.github.io/webidl/#es-nullable-type (step 3)
101
102         Firefox follows the specification.
103
104         No new tests, already covered by existing test.
105
106         * dom/Element.idl:
107
108 2015-09-16  Chris Dumez  <cdumez@apple.com>
109
110         Possible small iOS PLT regression from r189537
111         https://bugs.webkit.org/show_bug.cgi?id=149232
112
113         Reviewed by Ryosuke Niwa.
114
115         r189537 may have regressed PLT a bit on iOS. That change added a couple
116         of extra branches to throw exceptions. This patch marks those branches
117         as UNLIKELY() as we already do for other similar checks in the JS
118         bindings.
119
120         * bindings/scripts/CodeGeneratorJS.pm:
121         (GenerateImplementation):
122         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
123         (webkit_dom_test_obj_get_property):
124         (webkit_dom_test_obj_class_init):
125         (webkit_dom_test_obj_get_strict_type_checking_attribute):
126         (webkit_dom_test_obj_set_strict_type_checking_attribute):
127         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
128         * bindings/scripts/test/JS/JSTestObj.cpp:
129         (WebCore::jsTestObjStrictTypeCheckingAttribute):
130         (WebCore::setJSTestObjStrictTypeCheckingAttribute):
131         * bindings/scripts/test/ObjC/DOMTestObj.h:
132         * bindings/scripts/test/ObjC/DOMTestObj.mm:
133         (-[DOMTestObj strictTypeCheckingAttribute]):
134         (-[DOMTestObj setStrictTypeCheckingAttribute:]):
135         * bindings/scripts/test/TestObj.idl:
136         * html/HTMLTableElement.cpp:
137         (WebCore::HTMLTableElement::setTHead):
138         (WebCore::HTMLTableElement::setTFoot):
139
140 2015-09-16  Joseph Pecoraro  <pecoraro@apple.com>
141
142         Web Inspector: Fix common typo "supress" => "suppress"
143         https://bugs.webkit.org/show_bug.cgi?id=149199
144
145         Reviewed by Gyuyoung Kim.
146
147         * html/shadow/ContentDistributor.h:
148         (WebCore::ContentDistributor::needsDistribution):
149         * page/ContentSecurityPolicy.cpp:
150         (WebCore::ContentSecurityPolicy::reportViolation):
151         * platform/NotImplemented.h:
152         * platform/graphics/ca/win/LayerChangesFlusher.cpp:
153         (WebCore::LayerChangesFlusher::hookCallback):
154         * platform/mac/HIDGamepadProvider.cpp:
155         (WebCore::HIDGamepadProvider::deviceRemoved):
156         * platform/win/makesafeseh.asm:
157
158 2015-09-16  Chris Dumez  <cdumez@apple.com>
159
160         WebIDL: Rename [ReturnNewObject] to [NewObject] and use it more consistently in DOM
161         https://bugs.webkit.org/show_bug.cgi?id=149192
162
163         Reviewed by Darin Adler.
164
165         Rename [ReturnNewObject] to [NewObject] and use it more consistently in
166         DOM.
167
168         This aligns our IDL extended attribute naming with standard Web IDL:
169         https://heycam.github.io/webidl/#NewObject
170
171         We already have [ReturnNewObject] in most places that the DOM
172         specification uses [NewObject] but we are missing a few so I'll
173         fix this as well:
174         https://dom.spec.whatwg.org/#interface-document
175
176         Using [NewObject] lets the bindings generator know that the API in
177         question always returns new objects and that we can bypass the check
178         for existing wrappers and directly create a new wrapper for the
179         returned object.
180
181         This patch also adds support for generating the toJSNewlyCreated()
182         utility function for most types. Previously, to use [ReturnNewObject]
183         for a new type, you needed to add the type to a hard-coded list in
184         the bindings generator then provide your own implementation for
185         toJSNewlyCreated() as custom bindings.
186
187         No new-exposed behavior change.
188
189         * bindings/js/JSDocumentCustom.cpp:
190         * bindings/js/JSEventCustom.cpp:
191         * bindings/js/JSNodeListCustom.cpp:
192         Add toJSNewlyCreated() custom implementation for Node, Event and
193         Document, that shares code with the existing toJS() implementation for
194         those types.
195
196         * bindings/js/JSCDATASectionCustom.cpp: Removed.
197         * bindings/js/JSTextCustom.cpp: Removed.
198         * bindings/js/JSTouchCustom.cpp: Removed.
199         * bindings/js/JSTouchListCustom.cpp: Removed.
200         Drop several custom bindings files as the bindings generator is
201         now able to generate the toJSNewlyCreated() utility function for
202         most types.
203
204         * bindings/scripts/CodeGeneratorJS.pm:
205         - Rename [ReturnNewObject] to [NewObject].
206         - Generate a toJSNewlyCreated() whenever we generate a toJS() already.
207           Get rid of the hard-coded list of types that need a
208           toJSNewlyCreated().
209
210         * bindings/scripts/IDLAttributes.txt:
211         Rename [ReturnNewObject] to [NewObject].
212
213         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
214         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
215         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
216         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
217         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
218         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
219         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
220         * bindings/scripts/test/JS/JSTestEventConstructor.h:
221         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
222         * bindings/scripts/test/JS/JSTestEventTarget.h:
223         * bindings/scripts/test/JS/JSTestException.cpp:
224         * bindings/scripts/test/JS/JSTestException.h:
225         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
226         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
227         * bindings/scripts/test/JS/JSTestInterface.cpp:
228         * bindings/scripts/test/JS/JSTestInterface.h:
229         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
230         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
231         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
232         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
233         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
234         * bindings/scripts/test/JS/JSTestNondeterministic.h:
235         * bindings/scripts/test/JS/JSTestObj.cpp:
236         * bindings/scripts/test/JS/JSTestObj.h:
237         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
238         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
239         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
240         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
241         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
242         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
243         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
244         * bindings/scripts/test/JS/JSTestTypedefs.h:
245         * bindings/scripts/test/JS/JSattribute.cpp:
246         * bindings/scripts/test/JS/JSattribute.h:
247         * bindings/scripts/test/JS/JSreadonly.cpp:
248         * bindings/scripts/test/JS/JSreadonly.h:
249         Rebaseline bindings tests.
250
251         * dom/Attr.idl:
252         * dom/CDATASection.idl:
253         * dom/Comment.idl:
254         * dom/DocumentFragment.idl:
255         * dom/DocumentType.idl:
256         * dom/EntityReference.idl:
257         * dom/ProcessingInstruction.idl:
258         Add [JSGenerateToJSObject] so that the bindings generator generates
259         a toJS() / toJSNewlyCreated() for this type. While it is not strictly
260         needed, it avoids falling back to using the toJS() from Node which
261         calls the virtual nodeType() function to determine the node type.
262         This change was made for efficiency purposes.
263
264         * dom/DOMImplementation.idl:
265         Rename [ReturnNewObject] to [NewObject] and add it to createHTMLDocument()
266         as well, as per the specification:
267         https://dom.spec.whatwg.org/#interface-domimplementation
268
269         * dom/Document.idl:
270         Rename [ReturnNewObject] to [NewObject] and add it to more operations
271         as per he DOM specification:
272         https://dom.spec.whatwg.org/#document
273
274         * dom/Node.idl:
275         Add [NewObject] to cloneNode() as per the DOM specification:
276         https://dom.spec.whatwg.org/#node
277
278         * dom/ParentNode.idl:
279         Add [NewObject] to querySelectorAll() as per the DOM specification:
280         https://dom.spec.whatwg.org/#parentnode
281
282         * dom/Range.idl:
283         Add [NewObject] for several operations, as per the DOM specification:
284         https://dom.spec.whatwg.org/#interface-range
285
286 2015-09-16  Brady Eidson  <beidson@apple.com>
287
288         Have window.indexedDB.deleteDatabase return an IDBOpenDBRequest.
289         https://bugs.webkit.org/show_bug.cgi?id=149229
290
291         Reviewed by Alex Christensen.
292
293         Test: storage/indexeddb/modern/deletedatabase-request.html
294               storage/indexeddb/modern/deletedatabase-null-name-exception.html
295
296         * CMakeLists.txt:
297         * WebCore.xcodeproj/project.pbxproj:
298
299         * Modules/indexeddb/IDBDatabaseIdentifier.cpp: Added.
300         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
301         * Modules/indexeddb/IDBDatabaseIdentifier.h: Added.
302         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
303         (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
304         (WebCore::IDBDatabaseIdentifier::hash):
305         (WebCore::IDBDatabaseIdentifier::isValid):
306         (WebCore::IDBDatabaseIdentifier::operator==):
307         (WebCore::IDBDatabaseIdentifier::databaseName):
308         (WebCore::IDBDatabaseIdentifierHash::hash):
309         (WebCore::IDBDatabaseIdentifierHash::equal):
310         (WebCore::IDBDatabaseIdentifierHashTraits::isEmptyValue):
311
312         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
313         (WebCore::IDBClient::shouldThrowSecurityException):
314         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
315         (WebCore::IDBClient::IDBFactory::open):
316         (WebCore::IDBClient::IDBFactory::deleteDatabase):
317         * Modules/indexeddb/client/IDBFactoryImpl.h:
318
319         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
320         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
321         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
322         (WebCore::IDBClient::IDBOpenDBRequest::create):
323
324         * Modules/indexeddb/client/IDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
325         (WebCore::IDBClient::IDBRequest::IDBRequest):
326         (WebCore::IDBClient::IDBRequest::result):
327         (WebCore::IDBClient::IDBRequest::errorCode):
328         (WebCore::IDBClient::IDBRequest::error):
329         (WebCore::IDBClient::IDBRequest::source):
330         (WebCore::IDBClient::IDBRequest::transaction):
331         (WebCore::IDBClient::IDBRequest::readyState):
332         (WebCore::IDBClient::IDBRequest::eventTargetInterface):
333         (WebCore::IDBClient::IDBRequest::activeDOMObjectName):
334         (WebCore::IDBClient::IDBRequest::canSuspendForPageCache):
335         * Modules/indexeddb/client/IDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.h.
336
337         * platform/Logging.h:
338
339 2015-09-16  Chris Dumez  <cdumez@apple.com>
340
341         Add initial support for [Unforgeable] IDL extended attribute
342         https://bugs.webkit.org/show_bug.cgi?id=149147
343
344         Reviewed by Darin Adler.
345
346         Add initial support for [Unforgeable] IDL extended attribute:
347         https://heycam.github.io/webidl/#Unforgeable
348
349         In particular, attributes marked as unforgeable are now:
350         - on the instance rather than the prototype
351         - non-configurable. WebKit does not match the Web IDL specification
352           and most properties are currently non-configurable already. However,
353           I added an extra check for [Unforgeable] so that unforgeable
354           attributes stay unconfigurable if we later decide to match the spec
355           and mark properties as configurable.
356
357         Operation marked as unforgeable are now non-configurable. However, this
358         patch does not move them from the prototype to the instance yet. This
359         needs to be addressed in a follow-up patch as this is a larger change.
360
361         This patch also drops support for the undocumented
362         [OperationsNotDeletable] IDL extended attribute. It is no longer needed
363         now that we support [Unforgeable] and still support [NotDeletable] for
364         operations.
365
366         Test: fast/dom/unforgeable-attributes.html
367
368         * Modules/plugins/QuickTimePluginReplacement.idl:
369         Drop [OperationsNotDeletable] on the interface and mark the only
370         operation on this interface as [NotDeletable]. There is no behavior
371         change but this allows us to drop support for a non-standard and
372         undocumented IDL extended attribute.
373
374         * bindings/scripts/CodeGeneratorJS.pm:
375         (AttributeShouldBeOnInstance):
376         (GenerateAttributesHashTable):
377         (GenerateImplementation):
378         Add initial support for [Unforgeable] IDL extended attribute.
379
380         * bindings/scripts/IDLAttributes.txt:
381         Add [Unforgeable]. Drop [OperationsNotDeletable].
382
383         * crypto/CryptoKeyPair.idl:
384         Drop [OperationsNotDeletable] on the interface as this interface has
385         no operations.
386
387         * dom/Document.idl:
388         * page/DOMWindow.idl:
389         * page/Location.idl:
390         Mark attributes / interfaces as [Unforgeable] as per the latest HTML
391         specification:
392         https://html.spec.whatwg.org/multipage/dom.html#document
393         https://html.spec.whatwg.org/multipage/browsers.html#window
394         https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface
395
396 2015-09-16  Zalan Bujtas  <zalan@apple.com>
397
398         Simple line layout: Glitch selecting long text.
399         https://bugs.webkit.org/show_bug.cgi?id=149204
400         rdar://problem/22646472
401
402         Reviewed by Antti Koivisto.
403
404         When long text is split into multiple RenderText objects, we ignore renderer boundaries while
405         collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
406         This patch ensures that fragments with hypen character ignore renderer boundaries too.
407
408         Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
409
410         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
411         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
412
413 2015-09-16  Brady Eidson  <beidson@apple.com>
414
415         Remove stray logging string mistakenly left in r189746.
416
417         * Modules/indexeddb/legacy/LegacyFactory.cpp:
418         (WebCore::LegacyFactory::deleteDatabase):
419
420 2015-09-16  Chris Fleizach  <cfleizach@apple.com>
421
422         AX: No VoiceOver typing feedback in some search fields
423         https://bugs.webkit.org/show_bug.cgi?id=149177
424
425         Reviewed by Mario Sanchez Prada.
426
427         If SearchFieldRole is not marked as a TextControl, it does not end up returning the accessibilityValue,
428         which is needed to output the right text to VoiceOver.
429
430         Test: accessibility/ax-value-with-search.html
431
432         * accessibility/AccessibilityObject.cpp:
433         (WebCore::AccessibilityObject::isTextControl):
434
435 2015-09-16  Manuel Rego Casasnovas  <rego@igalia.com>
436
437         [css-grid] Grid container's height should include scrollbar
438         https://bugs.webkit.org/show_bug.cgi?id=149210
439
440         Reviewed by Sergio Villar Senin.
441
442         Add scrollbar's size in the grid container's height calculation at
443         RenderGrid::layoutGridItems().
444
445         Test: fast/css-grid-layout/grid-container-margin-border-padding-scrollbar.html
446
447         * rendering/RenderGrid.cpp:
448         (WebCore::RenderGrid::layoutGridItems): Include scrollbarLogicalHeight()
449         while computing the grid's logical height.
450
451 2015-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
452
453         Unreviewed. Fix GObject DOM bindings API break after r189676.
454
455         webkit_dom_character_data_append_data() used to raise exceptions.
456
457         * bindings/scripts/CodeGeneratorGObject.pm:
458         (FunctionUsedToRaiseException):
459
460 2015-09-15  Commit Queue  <commit-queue@webkit.org>
461
462         Unreviewed, rolling out r189847.
463         https://bugs.webkit.org/show_bug.cgi?id=149208
464
465         Asserts on all the tests (Requested by ap on #webkit).
466
467         Reverted changeset:
468
469         "Simple line layout: Glitch selecting long text."
470         https://bugs.webkit.org/show_bug.cgi?id=149204
471         http://trac.webkit.org/changeset/189847
472
473 2015-09-15  Zalan Bujtas  <zalan@apple.com>
474
475         Simple line layout: Glitch selecting long text.
476         https://bugs.webkit.org/show_bug.cgi?id=149204
477         rdar://problem/22646472
478
479         Reviewed by Antti Koivisto.
480
481         When long text is split into multiple RenderText objects, we ignore renderer boundaries while
482         collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
483         This patch ensures that fragments with hypen character ignore renderer boundaries too.
484
485         Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
486
487         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
488         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
489
490 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
491
492         GTK+ build fix attempt after r189841.
493
494         * PlatformGTK.cmake:
495
496 2015-09-15  Chris Dumez  <cdumez@apple.com>
497
498         Document.createElement(localName) does not handle correctly missing or null parameter
499         https://bugs.webkit.org/show_bug.cgi?id=149184
500         <rdar://problem/22565070>
501
502         Reviewed by Ryosuke Niwa.
503
504         Document.createElement(localName) does not handle correct missing or
505         null parameter:
506         - https://dom.spec.whatwg.org/#interface-document
507
508         As per the specification, the parameter is a non-nullable DOMString and
509         is mandatory. Therefore, as per Web IDL, we should have the following
510         behavior:
511         1. If the parameter is missing, we should throw an exception
512         2. If the parameter is null, we should convert it to the "null" string
513            and create a <null> element.
514
515         Chrome and Firefox behave according to the specification. However,
516         WebKit was doing:
517         1. Create a <undefined> element
518         2. Throw an InvalidCharacterError
519
520         This patch aligns WebKit's behavior with the specification and other
521         major browsers.
522
523         No new tests, already covered by existing tests.
524
525         * dom/Document.idl:
526
527 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
528
529         Add ShadowRoot interface and Element.prototype.attachShadow
530         https://bugs.webkit.org/show_bug.cgi?id=149187
531
532         Reviewed by Antti Koivisto.
533
534         Add back ShadowRoot IDL interface and Element.prototype.attachShadow in accordance with
535         http://w3c.github.io/webcomponents/spec/shadow/ at db27e6e36eab512d86edcdabb33ed27b5751acd7 excluding getSelection(),
536         elementFromPoint(), elementsFromPoint(), caretPositionFromPoint(), and styleSheets attribute on ShadowRoot interface.
537
538         The feature is enabled by default on Mac and iOS ports for testing and disabled by default elsewhere.
539
540         Also added HTMLElement::canHaveUserAgentShadowRoot which returns false by default and overridden elsewhere to return true
541         to distinguish elements for which attachShadow is supposed to throw NotSupported.
542         See https://w3c.github.io/webcomponents/spec/shadow/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict
543
544         Tests: fast/shadow-dom/Element-interface-attachShadow.html
545                fast/shadow-dom/Element-interface-shadowRoot-attribute.html
546                fast/shadow-dom/ShadowRoot-interface.html
547
548         * CMakeLists.txt:
549         * Configurations/FeatureDefines.xcconfig:
550         * DerivedSources.cpp:
551         * DerivedSources.make:
552         * PlatformGTK.cmake:
553         * WebCore.vcxproj/WebCore.vcxproj:
554         * WebCore.vcxproj/WebCore.vcxproj.filters:
555         * WebCore.xcodeproj/project.pbxproj:
556         * css/SelectorChecker.cpp:
557         (WebCore::SelectorChecker::matchRecursively):
558         * dom/Element.cpp:
559         (WebCore::Element::bindingsOffsetParent):
560         (WebCore::Element::offsetParent):
561         (WebCore::Element::addShadowRoot):
562         (WebCore::Element::createShadowRoot):
563         (WebCore::Element::attachShadow): Added.
564         (WebCore::Element::bindingShadowRoot): Added. Returns null unless the attached shadow root is in the "open" mode.
565         * dom/Element.h:
566         * dom/Element.idl: Added attachShadow and shadowRoot. We only expose these to JS for now since Dictionary argument isn't
567         supported by other binding code.
568         * dom/ShadowRoot.cpp: Removed an unused enum.
569         * dom/ShadowRoot.h:
570         (WebCore::ShadowRoot::Type): Replaced old-style enum "ShadowRootType" by an enum class named "Type". Also added two new
571         values Open and Closed for author shadow roots.
572         (WebCore::ShadowRoot::type):
573         * dom/ShadowRoot.idl: Added.
574         * html/HTMLButtonElement.h:
575         * html/HTMLDetailsElement.h:
576         (HTMLButtonElement::canHaveUserAgentShadowRoot): Ditto.
577         * html/HTMLElement.h:
578         (WebCore::HTMLElement::canHaveUserAgentShadowRoot): Added. Returns false by default.
579         * html/HTMLInputElement.h:
580         * html/HTMLKeygenElement.h:
581         * html/HTMLMarqueeElement.h:
582         * html/HTMLMediaElement.h:
583         * html/HTMLMeterElement.h:
584         * html/HTMLPlugInElement.h:
585         * html/HTMLProgressElement.h:
586         * html/HTMLSelectElement.h:
587         * html/HTMLSummaryElement.h:
588         * html/HTMLTextAreaElement.h:
589         * html/shadow/InsertionPoint.h:
590         (ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints):
591         * rendering/RenderElement.cpp:
592         (WebCore::RenderElement::selectionPseudoStyle):
593         * rendering/RenderLayer.cpp:
594         (WebCore::rendererForScrollbar):
595         * svg/SVGElement.cpp:
596         (WebCore::SVGElement::correspondingUseElement):
597         * testing/Internals.cpp:
598         (WebCore::Internals::shadowRootType):
599
600 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
601
602         [Win] Unreviewed release fix after r189832
603
604         * platform/graphics/ca/win/PlatformCALayerWin.h: The implementation
605         should exist in Release builds as well.
606
607 2015-09-15  Benjamin Poulain  <bpoulain@apple.com>
608
609         Style invalidation affecting siblings does not work with inline-style changes
610         https://bugs.webkit.org/show_bug.cgi?id=149189
611
612         Reviewed by Antti Koivisto.
613
614         Style::resolveTree() made the assumption that inline style changes only affect
615         descendants and should not participate in "StyleRecalcAffectsNextSiblingElementStyle".
616         That was wrong. If the inline style change through CSSOM, it can cause the creation
617         of a style attribute, which is observable through "StyleRecalcAffectsNextSiblingElementStyle".
618
619         This patch removes the incorrect assumption. Style invalidation is always propagated now.
620
621         Tests: fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html
622                fast/css/style-attribute-invalidation-propagates-to-direct-siblings.html
623                fast/css/style-attribute-invalidation-propagates-to-indirect-siblings.html
624
625         * css/PropertySetCSSStyleDeclaration.cpp:
626         (WebCore::InlineCSSStyleDeclaration::didMutate): Deleted.
627         * dom/StyledElement.cpp:
628         (WebCore::StyledElement::inlineStyleChanged):
629         * dom/StyledElement.h:
630         (WebCore::StyledElement::invalidateStyleAttribute):
631         Clean up inline-style invalidation a tiny bit.
632
633         * style/StyleResolveTree.cpp:
634         (WebCore::Style::resolveTree):
635         Fix the bug.
636
637 2015-09-15  Joseph Pecoraro  <pecoraro@apple.com>
638
639         Web Inspector: Paused Debugger prevents page reload
640         https://bugs.webkit.org/show_bug.cgi?id=148174
641
642         Reviewed by Brian Burg.
643
644         When navigating the page while paused, suppress any pausing until the page
645         has completed navigation. If not paused and navigating, you can still pause
646         in pagehide and unload handlers or other late page events.
647
648         Could not write a reliable test for this at the moment.
649         InspectorTest.reloadPage has multiple issues with the output,
650         so I'll investigate making reload tests more reliable later.
651
652         * inspector/InspectorController.h:
653         * inspector/InspectorController.cpp:
654         (WebCore::InspectorController::resume): Deleted.
655         * loader/FrameLoader.cpp:
656         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
657         We now use existing InspectorInstrumentation functions instead of a method
658         on InspectorController during load. In dropping the method InspectorController
659         can drop a member variable no longer used.
660
661         * inspector/InspectorInstrumentation.h:
662         (WebCore::InspectorInstrumentation::willStartProvisionalLoad):
663         Add a new instrumentation hook.
664
665         * inspector/InspectorInstrumentation.cpp:
666         (WebCore::InspectorInstrumentation::willStartProvisionalLoadImpl):
667         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
668         When starting or completing main frame navigations, let the PageDebuggerAgent do some work.
669
670         * inspector/PageDebuggerAgent.h:
671         * inspector/PageDebuggerAgent.cpp:
672         (WebCore::PageDebuggerAgent::mainFrameStartedLoading):
673         (WebCore::PageDebuggerAgent::mainFrameStoppedLoading):
674         (WebCore::PageDebuggerAgent::mainFrameNavigated):
675         Suppress pausing if navigating while paused. Otherwise behave as normal.
676
677 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
678
679         [Win] Provide a means for viewing the layer tree
680         https://bugs.webkit.org/show_bug.cgi?id=149165
681
682         Reviewed by Simon Fraser.
683
684         Revise the old fprintf logic to generate a string
685         containing the layer tree so that it can be output
686         to the debugger (or elsewhere).
687
688         * platform/graphics/ca/PlatformCALayer.h: Rename 'printTree'
689         to 'printLayerTree', and make it available in release builds.
690         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
691         (WebCore::CACFLayerTreeHost::printLayerTree): Added. Calls into
692         the PlatformCALayer implementation.
693         * platform/graphics/ca/win/CACFLayerTreeHost.h:
694         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
695         (printIndent): Revise to use two-space indent and use StringBuilder.
696         (printTransform): Ditto.
697         (printColor): Added helper function.
698         (printLayer): Revised to output information on the layer contents.
699         (PlatformCALayerWin::printLayerTree): Renamed from 'printTree'.
700         (PlatformCALayerWin::printTree): Deleted.
701         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
702         (PlatformCALayerWinInternal::drawRepaintCounters): Drive-by fix. Match the
703         cocoa repaint counter logic by not painting counters for the layers that
704         contain the tile grid.
705         * platform/graphics/ca/win/PlatformCALayerWin.h:
706         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
707         (PlatformCALayerWinInternal::drawRepaintCounters):
708
709 2015-09-15  Myles C. Maxfield  <mmaxfield@apple.com>
710
711         REGRESSION(r155554): Nested isolates can cause an infinite loop when laying out bidi runs
712         https://bugs.webkit.org/show_bug.cgi?id=149153
713
714         Reviewed by David Hyatt.
715
716         When traversing bidi runs, we might encounter a run which is supposed to be isolated. In this
717         situation, we will append a placeholder run in the run list, and remember a pointer to these
718         isolated runs inside BidiResolver. Then, once we're done traversing the bidi runs, we return
719         to the isolated runs and handle them separately (and replace the placeholder with the result).
720
721         However, due to the fact that our BidiRuns start at leaf nodes, we have to keep track of which
722         local root of the render tree we were inspecting (to ensure that we visit the same node
723         multiple times if there are nested isolate spans). We were not correctly keeping track of this
724         local root, which was leading us to consider the same root multiple times, thereby leading to
725         an infinite loop.
726
727         The solution is simply to keep root information alongside the isolated run information inside
728         BidiResolver. However, BidiResolver is inside platform/, which means that this new type should
729         be a template argument, just like how BidiRun itself is a template argument.
730
731         This new type, BidiIsolatedRun, holds all the information that our isolate-revisiting logic
732         needs inside constructBidiRunsForSegment(). It also holds a reference to the placeholder run
733         which we will replace.
734
735         Test: fast/text/international/unicode-bidi-isolate-nested-crash.html
736
737         * platform/graphics/GraphicsContext.cpp:
738         (WebCore::GraphicsContext::drawBidiText): BidiIsolatedRun template argument is unused, so pass
739         in Void.
740         * platform/text/BidiResolver.h: Add template argument.
741         (WebCore::BidiResolver::isolatedRuns):
742         (WebCore::IsolatedRun>::~BidiResolver):
743         (WebCore::IsolatedRun>::appendRun):
744         (WebCore::IsolatedRun>::embed):
745         (WebCore::IsolatedRun>::checkDirectionInLowerRaiseEmbeddingLevel):
746         (WebCore::IsolatedRun>::lowerExplicitEmbeddingLevel):
747         (WebCore::IsolatedRun>::raiseExplicitEmbeddingLevel):
748         (WebCore::IsolatedRun>::commitExplicitEmbedding):
749         (WebCore::IsolatedRun>::updateStatusLastFromCurrentDirection):
750         (WebCore::IsolatedRun>::reorderRunsFromLevels):
751         (WebCore::IsolatedRun>::createBidiRunsForLine):
752         (WebCore::IsolatedRun>::setMidpointForIsolatedRun): Use references instead of pointers.
753         (WebCore::IsolatedRun>::midpointForIsolatedRun): Ditto.
754         (WebCore::Run>::~BidiResolver): Deleted.
755         (WebCore::Run>::appendRun): Deleted.
756         (WebCore::Run>::embed): Deleted.
757         (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
758         (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
759         (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
760         (WebCore::Run>::commitExplicitEmbedding): Deleted.
761         (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
762         (WebCore::Run>::reorderRunsFromLevels): Deleted.
763         (WebCore::Run>::createBidiRunsForLine): Deleted.
764         (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
765         (WebCore::Run>::midpointForIsolatedRun): Deleted.
766         * rendering/InlineIterator.h:
767         (WebCore::BidiIsolatedRun::BidiIsolatedRun): New type.
768         (WebCore::addPlaceholderRunForIsolatedInline): Create new type, and include local root
769         information.
770         (WebCore::IsolateTracker::addFakeRunIfNecessary): Include local root information.
771         (WebCore::InlineBidiResolver::appendRun): Ditto.
772         * rendering/RenderBlockLineLayout.cpp: Update for new BidiIsolatedRun type.
773         (WebCore::setUpResolverToResumeInIsolate):
774         (WebCore::constructBidiRunsForSegment):
775         * rendering/line/TrailingObjects.h:
776
777 2015-09-15  Brady Eidson  <beidson@apple.com>
778
779         Add empty IDBFactory implementation for Modern IDB.
780         https://bugs.webkit.org/show_bug.cgi?id=149191
781
782         Reviewed by Jer Noble.
783
784         No new tests (No behavior change).
785
786         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
787         (WebCore::DOMWindowIndexedDatabase::indexedDB):
788         
789         * Modules/indexeddb/client/IDBFactoryImpl.cpp: 
790         (WebCore::IDBClient::IDBFactory::create):
791         (WebCore::IDBClient::IDBFactory::IDBFactory):
792         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
793         (WebCore::IDBClient::IDBFactory::open):
794         (WebCore::IDBClient::IDBFactory::deleteDatabase):
795         (WebCore::IDBClient::IDBFactory::cmp):
796         * Modules/indexeddb/client/IDBFactoryImpl.h: 
797         
798         * CMakeLists.txt:
799         * WebCore.xcodeproj/project.pbxproj:
800         
801         * loader/EmptyClients.cpp:
802         * page/DatabaseProvider.h:
803
804 2015-09-15  Antti Koivisto  <antti@apple.com>
805
806         Split FontDescription into lower and higher level types
807         https://bugs.webkit.org/show_bug.cgi?id=149036
808
809         Reviewed by Darin Adler.
810
811         Currently FontDescription is used through the text subsystem. However much of the data it
812         carries is only needed by FontCascade and text layout but not by the lower level Font/FontCache
813         layer. This makes code confusing. For example families specified in FontDescription are ignored
814         at lower levels.
815
816         Split it into a low level FontDescription and a high level FontCascadeDescription type:
817
818         FontDescription <-> Font
819         FontCascadeDescription <-> FontCascade
820
821         The former only carries information that is needed to instantiate a Font or fetch it from the FontCache.
822         The latter has additional data for CSS font cascade semantics and other higher level features.
823
824 2015-09-15  Myles C. Maxfield  <mmaxfield@apple.com>
825
826         GraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
827         https://bugs.webkit.org/show_bug.cgi?id=149193
828
829         Reviewed by Anders Carlsson.
830
831         There are two users of BidiResolver, one which needs isolated runs (in RenderBlockLineLayout) and
832         one which doesn't (in GraphicsContext::drawBidiText()). Because of [1], the isolated runs vector
833         is migrating to a new type outside of platform/. Therefore, only the first user of BidiResolver
834         should have this member variable.
835
836         This is achieved by creating two subclasses of BidiResolver, and using the Curiously Repeating
837         Template pattern to downcast into specializations.
838
839         [1] https://bugs.webkit.org/show_bug.cgi?id=149153
840
841         No new tests because there is no behavior change.
842
843         * platform/text/BidiResolver.h:
844         (WebCore::BidiResolverBase::BidiResolverBase):
845         (WebCore::BidiResolverBase::increment):
846         (WebCore::BidiResolverBase::appendRun):
847         (WebCore::BidiResolverBase::incrementInternal):
848         (WebCore::IsolateRun>::~BidiResolverWithIsolate):
849         (WebCore::Subclass>::appendRunInternal):
850         (WebCore::Subclass>::embed):
851         (WebCore::Subclass>::checkDirectionInLowerRaiseEmbeddingLevel):
852         (WebCore::Subclass>::lowerExplicitEmbeddingLevel):
853         (WebCore::Subclass>::raiseExplicitEmbeddingLevel):
854         (WebCore::Subclass>::commitExplicitEmbedding):
855         (WebCore::Subclass>::updateStatusLastFromCurrentDirection):
856         (WebCore::Subclass>::reorderRunsFromLevels):
857         (WebCore::Subclass>::createBidiRunsForLine):
858         (WebCore::Subclass>::setMidpointForIsolatedRun):
859         (WebCore::Subclass>::midpointForIsolatedRun):
860         (WebCore::BidiResolver::BidiResolver): Deleted.
861         (WebCore::BidiResolver::increment): Deleted.
862         (WebCore::BidiResolver::isolatedRuns): Deleted.
863         (WebCore::Run>::~BidiResolver): Deleted.
864         (WebCore::Run>::appendRun): Deleted.
865         (WebCore::Run>::embed): Deleted.
866         (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
867         (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
868         (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
869         (WebCore::Run>::commitExplicitEmbedding): Deleted.
870         (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
871         (WebCore::Run>::reorderRunsFromLevels): Deleted.
872         (WebCore::Run>::createBidiRunsForLine): Deleted.
873         (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
874         (WebCore::Run>::midpointForIsolatedRun): Deleted.
875         * rendering/InlineIterator.h:
876         (WebCore::InlineBidiResolver::incrementInternal):
877         (WebCore::InlineBidiResolver::appendRunInternal):
878         (WebCore::InlineBidiResolver::increment): Deleted.
879         (WebCore::InlineBidiResolver::appendRun): Deleted.
880         * rendering/line/TrailingObjects.h:
881
882 2015-09-15  Chris Dumez  <cdumez@apple.com>
883
884         new Event() without parameter should throw
885         https://bugs.webkit.org/show_bug.cgi?id=149146
886         <rdar://problem/22565070>
887
888         Reviewed by Ryosuke Niwa.
889
890         new Event() without parameter should throw because the type parameter
891         is mandatory as per the specification:
892         https://dom.spec.whatwg.org/#interface-event
893
894         Both Firefox and Chrome throw in this case. However, WebKit was
895         creating an event whose type is the string "undefined". This patch
896         aligns our behavior with the specification and other major browsers.
897
898         No new tests, already covered by existing test.
899
900         * bindings/scripts/CodeGeneratorJS.pm:
901         (GenerateConstructorDefinition):
902         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
903         (WebCore::JSTestEventConstructorConstructor::constructJSTestEventConstructor):
904
905 2015-09-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
906
907         [GTK] Build failure with ACCELERATED_2D_CANVAS when cairo-gl has built with OpenGLESv2 support only.
908         https://bugs.webkit.org/show_bug.cgi?id=149172
909
910         Reviewed by Martin Robinson.
911
912         No new tests, no behavior change.
913
914         * platform/graphics/glx/GLContextGLX.cpp:
915         (WebCore::GLContextGLX::cairoDevice):
916
917 2015-09-15  Chris Dumez  <cdumez@apple.com>
918
919         Element.getAttributeNS() should return null if the attribute does not exist
920         https://bugs.webkit.org/show_bug.cgi?id=149180
921         <rdar://problem/22561011>
922
923         Reviewed by Ryosuke Niwa.
924
925         Element.getAttributeNS() should return null if the attribute does not
926         exist, similarly to what Element.getAttribute() does:
927         - https://dom.spec.whatwg.org/#element (both return a nullable DOMString).
928         - https://dom.spec.whatwg.org/#dom-element-getattributens (step 2)
929
930         Firefox and Chrome match the specification. However, WebKit was returning
931         an empty string for getAttributeNS() and null for getAttribute(). This
932         patch aligns WebKit's behavior with the specification and other browsers.
933
934         No new tests, already covered by existing tests.
935
936         * dom/Element.idl:
937
938 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
939
940         ContentDistribution should be only used for details elements
941         https://bugs.webkit.org/show_bug.cgi?id=149148
942
943         Reviewed by Antti Koivisto.
944
945         Extracted ShadowRootWithInsertionPoints out of ShadowRoot for HTMLDetailsElement and HTMLSummaryElement.
946
947         We don't add a separate .h and .cpp files since this is a temporary measure until we replace it with
948         a slot-based shadow DOM implementation.
949
950         No new tests. There should be no observable behavioral change.
951
952         * dom/Element.cpp:
953         (WebCore::Element::addShadowRoot): Removed the call to didShadowBoundaryChange since this function is only
954         called in ensureUserAgentShadowRoot. Also moved the call to didAddUserAgentShadowRoot for
955         HTMLDetailsElement's shadow root which uses this function instead of ensureUserAgentShadowRoot.
956         (WebCore::Element::removeShadowRoot): Removed the call to invalidateDistribution since it's only called by
957         ~Element.
958         (WebCore::Element::createShadowRoot):
959         (WebCore::Element::ensureUserAgentShadowRoot): Moved the call didAddUserAgentShadowRoot into addShadowRoot
960         since HTMLDetailsElement uses a subclass of ShadowRoot.
961         (WebCore::Element::childrenChanged):
962         (WebCore::Element::removeAllEventListeners):
963
964         * dom/Element.h:
965         (Element::addShadowRoot): Made this function a protected member as it's now used by HTMLDetailsElement.
966
967         * dom/ShadowRoot.cpp:
968         (WebCore::ShadowRoot::childrenChanged): Deleted.
969
970         * dom/ShadowRoot.h:
971         (WebCore::ShadowRoot::distributor): Made this a virtual function and return nullptr by default.
972         (WebCore::ShadowRoot::isOrphan):
973
974         * html/HTMLDetailsElement.cpp:
975         (WebCore::HTMLDetailsElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
976
977         * html/HTMLInputElement.cpp:
978         (WebCore::HTMLInputElement::runPostTypeUpdateTasks): Removed the call to invalidateDistribution since it's
979         only relevant for HTMLDetailsElement's shadow DOM.
980
981         * html/HTMLSummaryElement.cpp:
982         (WebCore::HTMLSummaryElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
983
984         * html/shadow/ContentDistributor.cpp:
985         (WebCore::ContentDistributor::distribute):
986         (WebCore::ContentDistributor::ensureDistribution):
987         (WebCore::ContentDistributor::invalidateDistribution):
988
989         * html/shadow/InsertionPoint.cpp:
990         (WebCore::InsertionPoint::childrenChanged):
991         (WebCore::InsertionPoint::insertedInto):
992         (WebCore::InsertionPoint::removedFrom):
993         (WebCore::findInsertionPointOf):
994         (WebCore::ShadowRootWithInsertionPoints::childrenChanged): Moved from ShadowRoot.
995
996         * html/shadow/InsertionPoint.h:
997         (WebCore::ShadowRootWithInsertionPoints::create): Added.
998         (WebCore::ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints): Added.
999
1000 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
1001
1002         [Win] Tiled drawing is rendering more times than it should
1003         https://bugs.webkit.org/show_bug.cgi?id=149144
1004         <rdar://problem/22313905>
1005
1006         Reviewed by Simon Fraser.
1007
1008         Provide a more faithful implemenation of the Objective C tiled drawing logic.
1009         (1) Create a new WebTiledBackingLayerWin class that represents a the
1010             container of tiles. This matches the Objective C design.
1011         (2) Move implementation of several methods (e.g., isOpaque) to the internal
1012             class implementation so that the Tile Drawing logic can perform special
1013             handling in these cases.
1014         (3) Remove the duplicated Tiled Drawing logic from PlatformCALayerWinInternal,
1015             since it was just duplicating code in TileController and TileGrid.
1016         (4) Clean up the display callback code to avoid performing incorrect flipping
1017             of the coordinate system.
1018
1019         * PlatformAppleWin.cmake: Add new WebTiledBackingLayerWin file.            
1020         * WebCore.vcxproj/WebCore.vcxproj: Add the new WebTiledBackingLayerWin files.
1021         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1022         * platform/graphics/ca/PlatformCALayer.cpp:
1023         (PlatformCALayer::flipContext): Added convenience method.
1024         (PlatformCALayer::drawRepaintIndicator): Ditto.
1025         * platform/graphics/ca/TileGrid.cpp:
1026         (TileGrid::platformCALayerPaintContents): Flip the context before drawing the repaint
1027         indicator on Windows.
1028         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1029         (PlatformCALayerWin::PlatformCALayerWin): Create a WebTiledBackingLayerWin
1030         object if using tiled drawing.
1031         (PlatformCALayerWin::~PlatformCALayerWin):
1032         (PlatformCALayerWin::isOpaque): Move implementation to internal class.
1033         (PlatformCALayerWin::setOpaque): Ditto.
1034         (PlatformCALayerWin::setBorderWidth): Ditto.
1035         (PlatformCALayerWin::setBorderColor): Ditto.
1036         (PlatformCALayerWin::contentsScale): Ditto.
1037         (PlatformCALayerWin::setContentsScale): Ditto.
1038         (PlatformCALayerWin::cornerRadius): Ditto.
1039         (PlatformCALayerWin::tiledBacking): Ditto.
1040         (PlatformCALayerWin::drawTextAtPoint): New helper method to draw repaint counter
1041         text. Needed to work around bug in CG.
1042         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1043         (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Remove tiling-logic
1044         related member variables.
1045         (PlatformCALayerWinInternal::~PlatformCALayerWinInternal):
1046         (shouldInvertBeforeDrawingContent): Added convenience method.
1047         (shouldInvertBeforeDrawingRepaintCounters): Ditto.
1048         (PlatformCALayerWinInternal::displayCallback):
1049         (PlatformCALayerWinInternal::drawRepaintCounters): Helper method to
1050         share code between the two layer classes.
1051         (PlatformCALayerWinInternal::internalSetNeedsDisplay): use nullptr.
1052         (PlatformCALayerWinInternal::setNeedsDisplay): Ditto.
1053         (PlatformCALayerWinInternal::setNeedsDisplayInRect): Move tiled code
1054         to WebTiledBackingLayerWin and simplify the remaing code.
1055         (PlatformCALayerWinInternal::setSublayers): Remove tile code.
1056         (PlatformCALayerWinInternal::getSublayers): Ditto.
1057         (PlatformCALayerWinInternal::removeAllSublayers): Ditto.
1058         (PlatformCALayerWinInternal::insertSublayer): Ditto.
1059         (PlatformCALayerWinInternal::sublayerCount): Ditto.
1060         (PlatformCALayerWinInternal::indexOfSublayer): Ditto.
1061         (PlatformCALayerWinInternal::sublayerAtIndex): Ditto.
1062         (PlatformCALayerWinInternal::setBounds): Ditto.
1063         (PlatformCALayerWinInternal::setFrame): Ditto.
1064         (PlatformCALayerWinInternal::isOpaque): Ditto.
1065         (PlatformCALayerWinInternal::setOpaque): Ditto.
1066         (PlatformCALayerWinInternal::contentsScale): Ditto.
1067         (PlatformCALayerWinInternal::setContentsScale): Ditto.
1068         (PlatformCALayerWinInternal::setBorderWidth): Ditto.
1069         (PlatformCALayerWinInternal::setBorderColor): Ditto.
1070         (layerTypeIsTiled): Deleted.
1071         (PlatformCALayerWinInternal::constrainedSize): Deleted.
1072         (PlatformCALayerWinInternal::tileDisplayCallback): Deleted.
1073         (PlatformCALayerWinInternal::addTile): Deleted.
1074         (PlatformCALayerWinInternal::removeTile): Deleted.
1075         (PlatformCALayerWinInternal::tileAtIndex): Deleted.
1076         (PlatformCALayerWinInternal::tileCount): Deleted.
1077         (PlatformCALayerWinInternal::updateTiles): Deleted.
1078         (PlatformCALayerWinInternal::drawTile): Deleted.
1079         (PlatformCALayerWinInternal::createTileController): Deleted.
1080         (PlatformCALayerWinInternal::tiledBacking): Deleted.
1081         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
1082         (WebCore::PlatformCALayerWinInternal::owner):
1083         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: Added.
1084         (WebTiledBackingLayerWin::WebTiledBackingLayerWin):
1085         (WebTiledBackingLayerWin::~WebTiledBackingLayerWin):
1086         (DisplayOnMainThreadContext::DisplayOnMainThreadContext):
1087         (redispatchOnMainQueue):
1088         (WebTiledBackingLayerWin::displayCallback):
1089         (WebTiledBackingLayerWin::setNeedsDisplay):
1090         (WebTiledBackingLayerWin::setNeedsDisplayInRect):
1091         (WebTiledBackingLayerWin::setBounds):
1092         (WebTiledBackingLayerWin::isOpaque):
1093         (WebTiledBackingLayerWin::setOpaque):
1094         (WebTiledBackingLayerWin::contentsScale):
1095         (WebTiledBackingLayerWin::setContentsScale):
1096         (WebTiledBackingLayerWin::setBorderWidth):
1097         (WebTiledBackingLayerWin::setBorderColor):
1098         (WebTiledBackingLayerWin::createTileController):
1099         (WebTiledBackingLayerWin::tiledBacking):
1100         (WebTiledBackingLayerWin::invalidate):
1101         * platform/graphics/ca/win/WebTiledBackingLayerWin.h: Added.
1102
1103 2015-09-14  David Hyatt  <hyatt@apple.com>
1104
1105         [New Block-Inside-Inline Model] Implement margin collapsing across contiguous anonymous inline blocks.
1106         https://bugs.webkit.org/show_bug.cgi?id=149132
1107
1108         Reviewed by Zalan Bujtas.
1109
1110         Added new tests inside fast/block/inside-inlines/
1111
1112         * rendering/InlineFlowBox.cpp:
1113         (WebCore::InlineFlowBox::anonymousInlineBlock):
1114         Change this accessor to be more robust and be willing to both recur (in case we ever do decide intermediate line boxes should exist)
1115         and to type check. This is not currently needed, but I'm just being paranoid and future proof.
1116
1117         (WebCore::InlineFlowBox::addToLine):
1118         Again, for thoroughness, I am making sure to propagate the hasAnonymousInlineBlock() bit through to parents. This is only needed
1119         if we build intermediate line boxes for lines with anonymous inline blocks.
1120
1121         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
1122         Anonymous inline blocks receive a layout via layoutBlockChild, in order to make sure that margin collapsing runs. This means
1123         that unlike other line objects, the position of the child has been determined already. Therefore we simply set the position
1124         of the line box that wraps the anonymous inline block to the already-computed position for that block.
1125
1126         Also patch the code that sets lineTop and lineBottom using the root box's dimensions. We don't really care about the root line
1127         box on anonymous inline block lines and just want to set lineTop and lineBottom to fit the anonymous inline block.
1128
1129         * rendering/RenderBlockFlow.cpp:
1130         (WebCore::RenderBlockFlow::collapseMargins):
1131         (WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
1132         Refactor collapseMargins to call a helper function that can pass in a previous "sibling", and that can handle the child
1133         being null. We do this to perform a margin collapse when anonymous inline blocks run up against regular lines (which is like
1134         collapsing with a sibling block "child").
1135
1136         * rendering/RenderBlockFlow.h:
1137         Tweak the MarginInfo constructor to take a const RenderBlockFlow. Tweak some line layout methods to pass in the LineLayoutState
1138         so that MarginInfo is available during line layout.
1139
1140         * rendering/RenderBlockLineLayout.cpp:
1141         (WebCore::RenderBlockFlow::createLineBoxes):
1142         When we create a new line box, if it is not an anonymous inline block line and our previous line was, simulate a margin
1143         collapse in order to possibly push the line box down or up. Re-use the pagination adjustment code to rewind line layout
1144         and perform it again if pushed below a float.
1145
1146         (WebCore::constructBidiRunsForSegment):
1147         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
1148         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1149         (WebCore::RenderBlockFlow::layoutLineBoxes):
1150         (WebCore::RenderBlockFlow::determineStartPosition):
1151         (WebCore::RenderBlockFlow::matchedEndLine):
1152         (WebCore::RenderBlockFlow::updateRegionForLine):
1153         (WebCore::RenderBlockFlow::marginCollapseLinesFromStart):
1154         Patch line layout to run margin collapsing when anonymous inline blocks are encountered. This involves making sure
1155         margin info and float bottom positions are passed through so that layoutBlockChild can be properly called on
1156         anonymous inline blocks that we encounter.
1157
1158         In addition line layout when it syncs dirty lines has to run margin collapsing on earlier lines in order to make
1159         sure margin info is properly set up at the first dirty line position.
1160
1161         Note that there will be more improvements/changes in this area (dirty line syncing), as the current model is inefficient
1162         when many anonymous inline blocks are scattered throughout a large-scale line box tree.
1163
1164         * rendering/RootInlineBox.cpp:
1165         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
1166         (WebCore::RootInlineBox::ascentAndDescentForBox):
1167         Make sure to rely on the block layout code for the placement of the boxes themselves. Set up the line box code to not have
1168         an effect on ascent/descent.
1169
1170         * rendering/line/BreakingContext.h:
1171         (WebCore::BreakingContext::BreakingContext):
1172         (WebCore::BreakingContext::handleReplaced):
1173         When we encounter an anonymous inline block, lay it out when it is seen. We have to delay the layout, since we have
1174         to be able to perform it mid-line-layout when the containing block's logical height is at the correct value and all previous
1175         lines are placed. Margin info also has to be current.
1176
1177         * rendering/line/LineBreaker.cpp:
1178         * rendering/line/LineBreaker.h:
1179         Patched to pass LineLayoutState through so that the stuff we need to perform block layout is available (margin info and float vars).
1180
1181         * rendering/line/LineLayoutState.h:
1182         Add the block layout margin and float bottom information to the line layout state so that we have it available when performing
1183         layouts and margin collapses on anonymous inline block children.
1184
1185 2015-09-15  Brady Eidson  <beidson@apple.com>
1186
1187         Make the IDBAny::Type enum into an enum class.
1188         https://bugs.webkit.org/show_bug.cgi?id=149169.
1189
1190         Reviewed by Oliver Hunt.
1191
1192         No new tests (Cleanup, no behavior change).
1193
1194         * Modules/indexeddb/IDBAny.h:
1195         * Modules/indexeddb/legacy/LegacyAny.cpp:
1196         (WebCore::LegacyAny::createInvalid):
1197         (WebCore::LegacyAny::createNull):
1198         (WebCore::LegacyAny::LegacyAny):
1199         (WebCore::LegacyAny::domStringList):
1200         (WebCore::LegacyAny::idbCursor):
1201         (WebCore::LegacyAny::idbCursorWithValue):
1202         (WebCore::LegacyAny::idbDatabase):
1203         (WebCore::LegacyAny::idbFactory):
1204         (WebCore::LegacyAny::idbIndex):
1205         (WebCore::LegacyAny::idbObjectStore):
1206         (WebCore::LegacyAny::idbTransaction):
1207         (WebCore::LegacyAny::scriptValue):
1208         (WebCore::LegacyAny::string):
1209         (WebCore::LegacyAny::integer):
1210         (WebCore::LegacyAny::legacyCursor):
1211         (WebCore::LegacyAny::legacyCursorWithValue):
1212         (WebCore::LegacyAny::legacyDatabase):
1213         (WebCore::LegacyAny::legacyFactory):
1214         (WebCore::LegacyAny::legacyIndex):
1215         (WebCore::LegacyAny::legacyObjectStore):
1216         (WebCore::LegacyAny::legacyTransaction):
1217         * Modules/indexeddb/legacy/LegacyCursor.cpp:
1218         (WebCore::LegacyCursor::LegacyCursor):
1219         (WebCore::LegacyCursor::effectiveObjectStore):
1220         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
1221         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
1222         (WebCore::LegacyOpenDBRequest::dispatchEvent):
1223         * Modules/indexeddb/legacy/LegacyRequest.cpp:
1224         (WebCore::LegacyRequest::getResultCursor):
1225         (WebCore::effectiveObjectStore):
1226         * bindings/js/JSIDBAnyCustom.cpp:
1227         (WebCore::toJS):
1228         * inspector/InspectorIndexedDBAgent.cpp:
1229         * page/DatabaseProvider.h:
1230
1231 2015-09-15  Brady Eidson  <beidson@apple.com>
1232
1233         Move most IDB object encoding/decoding from WebKit2 to WebCore.
1234         https://bugs.webkit.org/show_bug.cgi?id=149152
1235
1236         Reviewed by Alex Christensen.
1237
1238         No new tests (Cleanup, no behavior change).
1239
1240         * Modules/indexeddb/IDBDatabaseMetadata.h:
1241         (WebCore::IDBDatabaseMetadata::encode):
1242         (WebCore::IDBDatabaseMetadata::decode):
1243         * Modules/indexeddb/IDBIndexMetadata.h:
1244         (WebCore::IDBIndexMetadata::encode):
1245         (WebCore::IDBIndexMetadata::decode):
1246         * Modules/indexeddb/IDBKeyData.h:
1247         (WebCore::IDBKeyData::encode):
1248         (WebCore::IDBKeyData::decode):
1249         * Modules/indexeddb/IDBKeyPath.h:
1250         (WebCore::IDBKeyPath::encode):
1251         (WebCore::IDBKeyPath::decode):
1252         * Modules/indexeddb/IDBKeyRangeData.h:
1253         (WebCore::IDBKeyRangeData::encode):
1254         (WebCore::IDBKeyRangeData::decode):
1255         * Modules/indexeddb/IDBObjectStoreMetadata.h:
1256         (WebCore::IDBObjectStoreMetadata::encode):
1257         (WebCore::IDBObjectStoreMetadata::decode):
1258
1259 2015-09-14  Brady Eidson  <beidson@apple.com>
1260
1261         Make the enum IDBKey::Type into a utility enum class.
1262         https://bugs.webkit.org/show_bug.cgi?id=149149
1263
1264         Reviewed by Alex Christensen.
1265
1266         No new tests (Cleanup, no behavior change).
1267
1268         * Modules/indexeddb/IDBKey.cpp:
1269         (WebCore::IDBKey::isValid):
1270         (WebCore::IDBKey::compare):
1271         * Modules/indexeddb/IDBKey.h:
1272         (WebCore::IDBKey::createNumber):
1273         (WebCore::IDBKey::createDate):
1274         (WebCore::IDBKey::createMultiEntryArray):
1275         (WebCore::IDBKey::createArray):
1276         (WebCore::IDBKey::type):
1277         (WebCore::IDBKey::array):
1278         (WebCore::IDBKey::string):
1279         (WebCore::IDBKey::date):
1280         (WebCore::IDBKey::number):
1281         (WebCore::IDBKey::compareTypes):
1282         (WebCore::IDBKey::IDBKey):
1283         * Modules/indexeddb/IDBKeyData.cpp:
1284         (WebCore::IDBKeyData::IDBKeyData):
1285         (WebCore::IDBKeyData::maybeCreateIDBKey):
1286         (WebCore::IDBKeyData::isolatedCopy):
1287         (WebCore::IDBKeyData::encode):
1288         (WebCore::IDBKeyData::decode):
1289         (WebCore::IDBKeyData::compare):
1290         (WebCore::IDBKeyData::loggingString):
1291         (WebCore::IDBKeyData::setArrayValue):
1292         (WebCore::IDBKeyData::setStringValue):
1293         (WebCore::IDBKeyData::setDateValue):
1294         (WebCore::IDBKeyData::setNumberValue):
1295         * Modules/indexeddb/IDBKeyData.h:
1296         (WebCore::IDBKeyData::IDBKeyData):
1297         (WebCore::IDBKeyData::minimum):
1298         (WebCore::IDBKeyData::maximum):
1299         * Modules/indexeddb/IndexedDB.h:
1300         * bindings/js/IDBBindingUtilities.cpp:
1301         (WebCore::idbKeyToJSValue):
1302         (WebCore::createIDBKeyFromValue):
1303         (WebCore::createIDBKeyFromScriptValueAndKeyPath):
1304         (WebCore::generateIndexKeysForValue):
1305         * inspector/InspectorIndexedDBAgent.cpp:
1306
1307 2015-09-15  Javier Fernandez  <jfernandez@igalia.com>
1308
1309         [CSS Grid Layout] Using {row, column}-axis terms in alignment related logic
1310         https://bugs.webkit.org/show_bug.cgi?id=148942
1311
1312         Reviewed by Sergio Villar Senin.
1313
1314         This patch changes the names of several functions and variables
1315         defined to implement the alignment logic. We want to use from now
1316         on the terms row-axis and column-axis when referring to the
1317         alignment direction the logic is applied to.
1318
1319         No new tests, no new functionality.
1320
1321         * rendering/RenderGrid.cpp:
1322         (WebCore::RenderGrid::columnAxisOffsetForChild):
1323         (WebCore::RenderGrid::rowAxisOffsetForChild):
1324         (WebCore::RenderGrid::findChildLogicalPosition):
1325         * rendering/RenderGrid.h:
1326
1327 2015-09-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1328
1329         Remove all uses of PassRefPtr in WebCore/xml
1330         https://bugs.webkit.org/show_bug.cgi?id=149114
1331
1332         Reviewed by Darin Adler.
1333
1334         * dom/DecodedDataDocumentParser.h:
1335         * dom/DocumentParser.h:
1336         * dom/RawDataDocumentParser.h:
1337         * html/FTPDirectoryDocument.cpp:
1338         (WebCore::FTPDirectoryDocumentParser::append):
1339         * html/parser/HTMLDocumentParser.cpp:
1340         (WebCore::HTMLDocumentParser::append):
1341         * html/parser/HTMLDocumentParser.h:
1342         * html/parser/TextDocumentParser.cpp:
1343         (WebCore::TextDocumentParser::append):
1344         * html/parser/TextDocumentParser.h:
1345         * xml/NativeXPathNSResolver.cpp:
1346         (WebCore::NativeXPathNSResolver::NativeXPathNSResolver):
1347         * xml/NativeXPathNSResolver.h:
1348         (WebCore::NativeXPathNSResolver::create):
1349         * xml/XMLErrors.cpp:
1350         (WebCore::createXHTMLParserErrorHeader):
1351         * xml/XMLHttpRequestProgressEventThrottle.cpp:
1352         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
1353         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent):
1354         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
1355         * xml/XMLHttpRequestProgressEventThrottle.h:
1356         * xml/XMLSerializer.h:
1357         * xml/XPathEvaluator.cpp:
1358         (WebCore::XPathEvaluator::createExpression):
1359         (WebCore::XPathEvaluator::createNSResolver):
1360         (WebCore::XPathEvaluator::evaluate):
1361         * xml/XPathEvaluator.h:
1362         * xml/XPathNodeSet.h: Fix style errors.
1363         (WebCore::XPath::NodeSet::NodeSet):
1364         (WebCore::XPath::NodeSet::append):
1365         * xml/XPathPath.cpp:
1366         (WebCore::XPath::Filter::evaluate):
1367         (WebCore::XPath::LocationPath::evaluate):
1368         * xml/XPathValue.h: ditto.
1369         (WebCore::XPath::Value::Value):
1370         (WebCore::XPath::Value::Data::create):
1371         (WebCore::XPath::Value::Data::Data):
1372         * xml/XSLTProcessor.cpp:
1373         (WebCore::XSLTProcessor::transformToDocument):
1374         (WebCore::XSLTProcessor::transformToFragment):
1375         * xml/XSLTProcessor.h:
1376         (WebCore::XSLTProcessor::setXSLStyleSheet):
1377         (WebCore::XSLTProcessor::importStylesheet):
1378         * xml/parser/XMLDocumentParser.cpp:
1379         (WebCore::XMLDocumentParser::append):
1380         * xml/parser/XMLDocumentParser.h:
1381
1382 2015-09-14  Dewei Zhu  <dewei_zhu@apple.com>
1383
1384         Polish code for r189579.
1385         https://bugs.webkit.org/show_bug.cgi?id=149131
1386
1387         Reviewed by Chris Dumez.
1388
1389         Use more self-explaining function name "characterSetWithUTF8Fallback" instead of
1390         "characterSetForBindings". Optimize the way to get text encoding.
1391
1392         * dom/Document.cpp:
1393         (WebCore::Document::characterSetWithUTF8Fallback):
1394         (WebCore::Document::encoding): Deleted.
1395         (WebCore::Document::characterSetForBindings): Deleted.
1396         * dom/Document.h:
1397         (WebCore::Document::encoding):
1398         (WebCore::Document::textEncoding):
1399         * dom/Document.idl:
1400         * loader/DocumentWriter.cpp:
1401         (WebCore::DocumentWriter::createDecoderIfNeeded):
1402         * loader/FormSubmission.cpp:
1403         (WebCore::encodingFromAcceptCharset):
1404
1405 2015-09-14  Chris Dumez  <cdumez@apple.com>
1406
1407         Drop non-standard [IsIndex] WebKit IDL extended attribute
1408         https://bugs.webkit.org/show_bug.cgi?id=149122
1409         <rdar://problem/22547139>
1410
1411         Reviewed by Darin Adler.
1412
1413         Drop non-standard [IsIndex] WebKit IDL extended attribute. This attribute
1414         causes us to throw an IndexSizeError if the input value is negative. Web
1415         IDL supports no such thing. Instead Web IDL supports:
1416         1. Default behavior: the input value wraps around if it does not fit.
1417         2. [EnforceRange]: A TypeError is thrown if the input value does not fit [1].
1418         3. [Clamp]: The input value will be clamped if it does not fit [2].
1419
1420         Our bindings generator supports all three. We don't need the non-standard
1421         [IsIndex].
1422
1423         We previously used [IsIndex] in places where we're supposed to wrap around
1424         as per Web IDL. Therefore, we threw for negative values but other browsers
1425         don't. For e.g., CharacterData.substringData(offset, -1) is supposed to
1426         return the substring from offset to the end of the string. It does so in
1427         Firefox and Chrome. However, WebKit was throwing an Exception.
1428
1429         This change impacts the CharacterData and the SVGTextContentElement
1430         API. The compatibility risk is low because we were throwing an exception
1431         for negative values and we now wrap the value around instead, as other
1432         browsers do.
1433
1434         No new tests, already covered by existing tests.
1435
1436         [1] https://heycam.github.io/webidl/#EnforceRange
1437         [2] https://heycam.github.io/webidl/#Clamp
1438
1439         * bindings/scripts/CodeGeneratorJS.pm:
1440         (GenerateParametersCheck): Deleted.
1441         * bindings/scripts/IDLAttributes.txt:
1442         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1443         (WebCore::jsTestEventTargetPrototypeFunctionItem):
1444         * bindings/scripts/test/TestEventTarget.idl:
1445         * dom/CharacterData.cpp:
1446         (WebCore::CharacterData::deleteData):
1447         (WebCore::CharacterData::replaceData):
1448         * dom/CharacterData.idl:
1449         * dom/ClientRectList.idl:
1450         * svg/SVGTextContentElement.cpp:
1451         (WebCore::SVGTextContentElement::getSubStringLength):
1452         (WebCore::SVGTextContentElement::selectSubString):
1453         * svg/SVGTextContentElement.idl:
1454
1455 2015-09-14  Chris Dumez  <cdumez@apple.com>
1456
1457         Document.createNodeIterator(null) / Document.createTreeWalker(null) should throw a TypeError
1458         https://bugs.webkit.org/show_bug.cgi?id=149126
1459         <rdar://problem/22564891>
1460
1461         Reviewed by Ryosuke Niwa.
1462
1463         Document.createNodeIterator(null) / Document.createTreeWalker(null)
1464         should throw a TypeError:
1465         https://dom.spec.whatwg.org/#interface-document
1466
1467         This is because the parameter is not nullable and Web IDL says we
1468         should throw a TypeError in this case.
1469
1470         Firefox and Chrome throw an exception in this case. This patch
1471         aligns our behavior with the specification and other major browsers.
1472
1473         No new tests, already covered by existing W3C test.
1474
1475         * dom/Document.cpp:
1476         (WebCore::Document::createNodeIterator):
1477         (WebCore::Document::createTreeWalker):
1478         * dom/Document.h:
1479         * dom/Document.idl:
1480         * dom/NodeIterator.cpp:
1481         (WebCore::NodeIterator::NodeIterator):
1482         * dom/NodeIterator.h:
1483         (WebCore::NodeIterator::create):
1484         * dom/Traversal.cpp:
1485         (WebCore::NodeIteratorBase::NodeIteratorBase):
1486         * dom/Traversal.h:
1487         * dom/TreeWalker.cpp:
1488         (WebCore::TreeWalker::TreeWalker):
1489         * dom/TreeWalker.h:
1490         (WebCore::TreeWalker::create):
1491
1492 2015-09-14  Alex Christensen  <achristensen@webkit.org>
1493
1494         Fix Windows clean build after r189746
1495
1496         * WebCore.vcxproj/copyForwardingHeaders.cmd:
1497         Copy headers from new legacy directory.
1498
1499 2015-09-14  Chris Dumez  <cdumez@apple.com>
1500
1501         window.HTMLDetailsElement should exist
1502         https://bugs.webkit.org/show_bug.cgi?id=149139
1503
1504         Reviewed by Ryosuke Niwa.
1505
1506         window.HTMLDetailsElement should exist:
1507         https://html.spec.whatwg.org/multipage/forms.html#the-details-element
1508
1509         Drop the [NoInterfaceObject] IDL extended attribute in WebKit to
1510         address the problem.
1511
1512         No new tests, already covered by existing tests.
1513
1514         * html/HTMLDetailsElement.idl:
1515
1516 2015-09-14  Alex Christensen  <achristensen@webkit.org>
1517
1518         Fix AppleWin CMake build
1519         https://bugs.webkit.org/show_bug.cgi?id=149137
1520
1521         Reviewed by Brent Fulgham.
1522
1523         * PlatformAppleWin.cmake:
1524         Spell Inband correctly.
1525         * css/makegrammar.pl:
1526         Add quotes so bison can be in a directory with spaces in it.        
1527
1528 2015-09-14  Alex Christensen  <achristensen@webkit.org>
1529
1530         [Win] Unreviewed build fix after r189746
1531
1532         * WebCore.vcxproj/WebCoreIncludeCommon.props:
1533         Include new legacy directory.
1534
1535 2015-09-14  Alex Christensen  <achristensen@webkit.org>
1536
1537         Progress towards CMake on Mac.
1538         https://bugs.webkit.org/show_bug.cgi?id=149123
1539
1540         Reviewed by Chris Dumez.
1541
1542         * CMakeLists.txt:
1543         Added some more files.
1544         * PlatformMac.cmake:
1545         Added more files and listed the strange ObjC bindings.
1546         * contentextensions/DFACombiner.cpp:
1547         * contentextensions/DFACombiner.h:
1548         Added preprocessor protection.
1549         * platform/FileSystem.h:
1550         Include utility.  It's needed to compile the different configurations.
1551         * platform/ScrollAnimator.cpp:
1552         ScrollAnimator is an abstract class on Mac.  Don't compile it.
1553         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1554         FontAntialiasingStateSaver.h is only used on iOS.
1555         * rendering/RenderThemeMac.mm:
1556         config.h needs to be outside the #if !PLATFORM(IOS) to compile correctly without precompiled headers.
1557
1558 2015-09-14  Brady Eidson  <beidson@apple.com>
1559
1560         Rename current concrete IDB implementation to "Legacy".
1561         https://bugs.webkit.org/show_bug.cgi?id=149118
1562
1563         Reviewed by Alex Christensen.
1564
1565         No new tests (No change in behavior).
1566
1567         This patch makes IDL bindings abstract.
1568         It then renames the current concrete implementations of the bindings from "IDB" to "Legacy".
1569         Finally it moves those files and their support classes to a "legacy" subfolder.
1570
1571         * CMakeLists.txt:
1572         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1573         * Modules/indexeddb/IDBAny.cpp:
1574         * Modules/indexeddb/IDBAny.h:
1575         * Modules/indexeddb/IDBCursor.cpp:
1576         * Modules/indexeddb/IDBCursor.h:
1577         * Modules/indexeddb/IDBCursor.idl:
1578         * Modules/indexeddb/IDBCursorWithValue.cpp:
1579         * Modules/indexeddb/IDBCursorWithValue.h:
1580         * Modules/indexeddb/IDBCursorWithValue.idl:
1581         * Modules/indexeddb/IDBDatabase.cpp:
1582         * Modules/indexeddb/IDBDatabase.h:
1583         * Modules/indexeddb/IDBDatabase.idl:
1584         * Modules/indexeddb/IDBFactory.cpp:
1585         * Modules/indexeddb/IDBFactory.h:
1586         * Modules/indexeddb/IDBFactory.idl:
1587         * Modules/indexeddb/IDBIndex.cpp:
1588         * Modules/indexeddb/IDBIndex.h:
1589         * Modules/indexeddb/IDBIndex.idl:
1590         * Modules/indexeddb/IDBObjectStore.cpp:
1591         * Modules/indexeddb/IDBObjectStore.h:
1592         * Modules/indexeddb/IDBObjectStore.idl:
1593         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1594         * Modules/indexeddb/IDBOpenDBRequest.h:
1595         * Modules/indexeddb/IDBOpenDBRequest.idl:
1596         * Modules/indexeddb/IDBRequest.cpp:
1597         * Modules/indexeddb/IDBRequest.h:
1598         * Modules/indexeddb/IDBRequest.idl:
1599         * Modules/indexeddb/IDBTransaction.cpp:
1600         * Modules/indexeddb/IDBTransaction.h:
1601         * Modules/indexeddb/IDBTransaction.idl:
1602         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
1603         * Modules/indexeddb/IDBVersionChangeEvent.h:
1604         * Modules/indexeddb/legacy/IDBCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCallbacks.h.
1605         * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp.
1606         * Modules/indexeddb/legacy/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h.
1607         * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp.
1608         * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h.
1609         * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp.
1610         * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h.
1611         * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
1612         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
1613         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
1614         * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Renamed from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h.
1615         * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h.
1616         * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h.
1617         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp.
1618         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h.
1619         * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp.
1620         * Modules/indexeddb/legacy/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h.
1621         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp.
1622         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h.
1623         * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp.
1624         * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h.
1625         * Modules/indexeddb/legacy/LegacyAny.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBAny.cpp.
1626         * Modules/indexeddb/legacy/LegacyAny.h: Added.
1627         * Modules/indexeddb/legacy/LegacyCursor.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.cpp.
1628         * Modules/indexeddb/legacy/LegacyCursor.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.h.
1629         * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp.
1630         * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h.
1631         * Modules/indexeddb/legacy/LegacyDatabase.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.cpp.
1632         * Modules/indexeddb/legacy/LegacyDatabase.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.h.
1633         * Modules/indexeddb/legacy/LegacyFactory.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.cpp.
1634         * Modules/indexeddb/legacy/LegacyFactory.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.h.
1635         * Modules/indexeddb/legacy/LegacyIndex.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.cpp.
1636         * Modules/indexeddb/legacy/LegacyIndex.h: Added.
1637         * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp.
1638         * Modules/indexeddb/legacy/LegacyObjectStore.h: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.h.
1639         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
1640         * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h.
1641         * Modules/indexeddb/legacy/LegacyRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.cpp.
1642         * Modules/indexeddb/legacy/LegacyRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.h.
1643         * Modules/indexeddb/legacy/LegacyTransaction.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.cpp.
1644         * Modules/indexeddb/legacy/LegacyTransaction.h: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.h.
1645         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
1646         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
1647         * WebCore.xcodeproj/project.pbxproj:
1648         * WebCore.vcxproj/WebCore.vcxproj:
1649
1650 2015-09-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1651
1652         [EFL] Remove create() factory function in EvasGLContext and EvasGLSurface
1653         https://bugs.webkit.org/show_bug.cgi?id=149110
1654
1655         Reviewed by Csaba Osztrogon√°c.
1656
1657         It is not good implementation we support both create() factory function and public constructor.
1658         In EvasGLContext and EvasGLSurface cases, those have supported both. However create() factory is only
1659         used by EwkView. Thus let's remove the create() function, then EwkView creates EvasGLContext using
1660         std::make_unique<> directly.
1661
1662         * platform/graphics/efl/EvasGLContext.h:
1663         (WebCore::EvasGLContext::create): Deleted.
1664         * platform/graphics/efl/EvasGLSurface.h:
1665         (WebCore::EvasGLSurface::create): Deleted.
1666
1667 2015-09-09  Sergio Villar Senin  <svillar@igalia.com>
1668
1669         min-width/height should default to auto for grid items
1670         https://bugs.webkit.org/show_bug.cgi?id=146021
1671
1672         Reviewed by Darin Adler.
1673
1674         Based on Blink's r194408, r194863 and r194887 by <rego@igalia.com>.
1675
1676         From the spec (http://dev.w3.org/csswg/css-grid/#grid-items):
1677         "The auto value of min-width and min-height behaves on grid
1678         items in the relevant axis analogously to its behavior on flex
1679         items in the main axis."
1680
1681         From now on the default value for min-width and min-height for
1682         grid items is auto, meaning that in general, grid items won't
1683         shrink bellow their content.
1684
1685         The change is not exactly the same as the one in Blink because
1686         this one takes into account vertical writting modes, something
1687         that was not well handled in the original one.
1688
1689         Tests: fast/css-grid-layout/min-width-height-auto-overflow.html
1690                fast/css-grid-layout/min-width-height-auto.html
1691
1692         * rendering/RenderBox.cpp:
1693         (WebCore::RenderBox::computeLogicalWidthInRegion):
1694         (WebCore::RenderBox::computeLogicalHeight):
1695
1696 2015-09-14  Manuel Rego Casasnovas  <rego@igalia.com>
1697
1698         [css-grid] Percentage columns should remove scrollbar's width
1699         https://bugs.webkit.org/show_bug.cgi?id=149116
1700
1701         Reviewed by Sergio Villar Senin.
1702
1703         Currently the calculation of percentage columns was not subtracting the
1704         scrollbar's size.
1705         Fixed RenderGrid::computeUsedBreadthOfSpecifiedLength()
1706         to avoid this problem.
1707
1708         Test: fast/css-grid-layout/grid-percent-track-scrollbar.html
1709
1710         * rendering/RenderGrid.cpp:
1711         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
1712
1713 2015-09-13  Chris Dumez  <cdumez@apple.com>
1714
1715         Improve Node pre-insertion validation when the parent is a Document
1716         https://bugs.webkit.org/show_bug.cgi?id=149109
1717         <rdar://problem/22560436>
1718
1719         Reviewed by Ryosuke Niwa.
1720
1721         Improve Node pre-insertion validation when the parent is a Document to
1722         match the specification:
1723         https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
1724         https://dom.spec.whatwg.org/#concept-node-replace
1725
1726         This affects the following API: Node.insertBefore(), Node.appendChild(),
1727         Node.replaceChild().
1728
1729         WebKit current fails to do the following checks whenever the parent is a
1730         Document from pre-insertion validation:
1731         1. If the inserted Node is a DocumentFragment, we should make sure it
1732           contains only one Element.
1733         -> This is because a Document can have only one child that is an
1734            Element [1].
1735         2.a. If an Element is inserted, we should make sure it is not inserted
1736              before a DocumentType.
1737         2.b. If a DocumentType is inserted, we should make sure it is not
1738              inserted after an Element.
1739         -> This is because the DocType must come before the optional Element
1740            child [1].
1741
1742         Firefox and Chrome already match the specification here. This patch
1743         aligns WebKit's behavior with those browsers and the specification.
1744
1745         [1] https://dom.spec.whatwg.org/#node-trees
1746
1747         No new tests, already covered by existing W3C tests.
1748
1749         * dom/ContainerNode.cpp:
1750         (WebCore::checkAcceptChild):
1751         (WebCore::checkAddChild):
1752         (WebCore::checkReplaceChild):
1753         (WebCore::ContainerNode::insertBefore):
1754         (WebCore::ContainerNode::appendChild):
1755         (WebCore::containsConsideringHostElements): Deleted.
1756         (WebCore::checkAcceptChildGuaranteedNodeTypes): Deleted.
1757         * dom/Document.cpp:
1758         (WebCore::Document::canAcceptChild):
1759         (WebCore::Document::cloneNodeInternal): Deleted.
1760         * dom/Document.h:
1761
1762 2015-09-13  Chris Dumez  <cdumez@apple.com>
1763
1764         Document.adoptNode() should be able to explicitly adopt a DocumentType node
1765         https://bugs.webkit.org/show_bug.cgi?id=149097
1766         <rdar://problem/22549345>
1767
1768         Reviewed by Ryosuke Niwa.
1769
1770         Document.adoptNode() should be able to explicitly adopt a DocumentType
1771         node as per the latest DOM specification:
1772         https://dom.spec.whatwg.org/#dom-document-adoptnode
1773
1774         Chrome and Firefox match the specidicaiton but WebKit was throwing a
1775         NotSupportedError.
1776
1777         No new tests, already covered by existing test.
1778
1779         * dom/Document.cpp:
1780         (WebCore::Document::adoptNode): Deleted.
1781
1782 2015-09-13  Chris Dumez  <cdumez@apple.com>
1783
1784         Document.title does not behave according to specification
1785         https://bugs.webkit.org/show_bug.cgi?id=149098
1786
1787         Reviewed by Ryosuke Niwa.
1788
1789         Update Document.title to behave according to the latest DOM specification:
1790         https://html.spec.whatwg.org/multipage/dom.html#document.title
1791
1792         In particular, the following Web-Exposed changes were made:
1793         1. The title Element should be the first title element in the document
1794            (in tree order) [1]. Previously, WebKit would use the first title
1795            Element *added* to the Document. Document.title returns the text
1796            content of the title Element so this change is web-exposed.
1797         2. If the title Element is replaced after the title has been set by the
1798            JS (via the document.title setter), we should update the value
1799            returned by the document.title getter. Previously, WebKit would set
1800            a flag if the title was explicitly set by JS via document.title
1801            setter and later title element changes would not override the title
1802            set by the JS. This behavior isn't specified and does not match the
1803            behavior of other browsers.
1804
1805         The new behavior is also consistent with the behavior of Firefox and
1806         Chrome.
1807
1808         Some refactoring was made for the sake of clarity now that our
1809         implementation has changed. See details below.
1810
1811         [1] https://html.spec.whatwg.org/multipage/dom.html#the-title-element-2
1812
1813         No new tests, already covered by existing tests.
1814
1815         * dom/Document.cpp:
1816         (WebCore::Document::updateTitleFromTitleElement):
1817         New convenience method that calls updateTitle() with the text of the
1818         document's current title Element. If there is no title Element, it
1819         clears the title.
1820
1821         (WebCore::Document::updateTitleElement):
1822         Method which updates the Document's title Element whenever a title
1823         Element is added or removed from the Document. Once the title Element
1824         is updated, it takes care of calling updateTitleFromTitleElement() to
1825         update the Document's title.
1826
1827         (WebCore::Document::titleElementAdded):
1828         (WebCore::Document::titleElementRemoved):
1829         (WebCore::Document::titleElementTextChanged):
1830         New Document public API called by HTMLTitleElement / SVGTitleElement
1831         whenever a title Element is added / removed from the Document or
1832         whenever the title element's text has changed. These methods will
1833         take care of calling updateTitleElement() / updateTitleFromTitleElement()
1834         as necessary.
1835         Previously, we would only have 2 methods:
1836         - setTitleElement() which would be called whenever a title Element was
1837           added to the document or when its text had changed. The name was
1838           confusing because it would not necessarily set the document's title
1839           Element and it would be used both for title element update and a
1840           simple title update. This method has been split into 2:
1841           titleElementAdded() and titleElementTextChanged().
1842         - removeTitle() which would be called whenever a title Element was
1843           removed. The naming was confusing because it would not necessarily
1844           remove the Document's title Element. This is now called
1845           titleElementRemoved().
1846
1847         * html/HTMLTitleElement.cpp:
1848         (WebCore::HTMLTitleElement::insertedInto):
1849         Call the new titleElementAdded() instead of setTitleElement().
1850
1851         (WebCore::HTMLTitleElement::removedFrom):
1852         Call the new titleElementRemoved() instead of removeTitle().
1853
1854         (WebCore::HTMLTitleElement::childrenChanged):
1855         Call the new titleElementTextChanged() instead of
1856         setTitleElement() / removeTitle() as we don't really want
1857         to remove or add a title Element. We merely want to notify
1858         the document that the title element text has changed in
1859         case it is the current title Element of the Document.
1860
1861         (WebCore::HTMLTitleElement::computedTextWithDirection):
1862         Rename textWithDirection() to computedTextWithDirection() to
1863         make it clear it is not a simple getter and make it private
1864         as it is only used to set the m_title member which caches the
1865         computed text.
1866
1867         * html/HTMLTitleElement.h:
1868         Add new textWithDirection() getter which returns m_title. This
1869         is needed so that Document can query the title of the Element.
1870         Previously, HTMLTitleElement would pass directly m_title to
1871         the Document when calling Document::setTitleElement().
1872
1873         * svg/SVGTitleElement.cpp:
1874         (WebCore::SVGTitleElement::insertedInto):
1875         Call the new titleElementAdded() instead of setTitleElement().
1876
1877         (WebCore::SVGTitleElement::removedFrom):
1878         Call the new titleElementRemoved() instead of removeTitle().
1879
1880         (WebCore::SVGTitleElement::childrenChanged):
1881         Call the new titleElementTextChanged() instead of
1882         setTitleElement().
1883
1884 2015-09-13  Chris Dumez  <cdumez@apple.com>
1885
1886         document.lastModified should use the user's local time zone
1887         https://bugs.webkit.org/show_bug.cgi?id=149092
1888         <rdar://problem/22567705>
1889
1890         Reviewed by Ryosuke Niwa.
1891
1892         document.lastModified should use the user's local time zone:
1893         https://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified
1894
1895         Chrome and Firefox comply with the specification but WebKit was using
1896         UTC. This patch aligns WebKit's behavior with the specification and
1897         other browsers.
1898
1899         No new tests, already covered by existing tests.
1900
1901         * dom/Document.cpp:
1902         (WebCore::Document::lastModified):
1903         (WebCore::Document::setCookieURL): Deleted.
1904
1905 2015-09-13  Chris Dumez  <cdumez@apple.com>
1906
1907         Node.baseURI should not return null for detached nodes
1908         https://bugs.webkit.org/show_bug.cgi?id=149104
1909         <rdar://problem/22559535>
1910
1911         Reviewed by Sam Weinig.
1912
1913         Node.baseURI should not return null for detached nodes. It should return
1914         the node document's base URL. The node document is set when the node is
1915         created so it is valid even if the node is detached [1]:
1916         https://dom.spec.whatwg.org/#dom-node-baseuri
1917
1918         WebKit was traversing the ancestors to find the base URL, which only
1919         works if the node is attached. Also, WebKit was taking into account
1920         the xml:base attribute when computing the baseURI.
1921
1922         Both Chrome and Firefox already dropped support for xml:base:
1923         https://code.google.com/p/chromium/issues/detail?id=341854
1924         https://bugzilla.mozilla.org/show_bug.cgi?id=903372
1925
1926         Firefox complies with the specification. Chrome's baseURI still only
1927         works for attached Nodes as their implementation still traverses the
1928         DOM tree, despite dropping support for xml:base.
1929
1930         This patch drops support xml:base when computing Node.baseURI, as
1931         Firefox, Chrome and the latest DOM specification do. It also makes
1932         Node.baseURI work for detached Nodes by returning the base URL of the
1933         node Document. This means we no longer have to traverse the Node's
1934         ancestors in the DOM tree. This is consistent with the behavior of
1935         Firefox and the latest DOM specification.
1936
1937         This patch does not drop the SVGElement.xmlbase attribute yet. However,
1938         we should probably consider making this change as well given that:
1939         - The SVG2 specification dropped it
1940         - Chrome dropped it.
1941         - It no longers impacts Node.baseURI
1942
1943         [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976
1944
1945         No new tests, already covered by existing test.
1946
1947         * dom/Document.cpp:
1948         (WebCore::Document::setContent): Deleted.
1949         * dom/Document.h:
1950         (WebCore::Document::inputCursor): Deleted.
1951         * dom/DocumentType.cpp:
1952         (WebCore::DocumentType::nodeName): Deleted.
1953         * dom/DocumentType.h:
1954         * dom/Element.cpp:
1955         (WebCore::Element::imageSourceURL): Deleted.
1956         (WebCore::Element::rendererIsNeeded): Deleted.
1957         (WebCore::Element::createElementRenderer): Deleted.
1958         (WebCore::Element::insertedInto): Deleted.
1959         * dom/Element.h:
1960         * dom/Node.cpp:
1961         (WebCore::Node::baseURI):
1962         * dom/Node.h:
1963         * svg/SVGElement.idl:
1964
1965 2015-09-13  Chris Dumez  <cdumez@apple.com>
1966
1967         CharacterData API parameters should not be optional
1968         https://bugs.webkit.org/show_bug.cgi?id=149101
1969         <rdar://problem/22546954>
1970
1971         Reviewed by Sam Weinig.
1972
1973         CharacterData API parameters should not be optional as per the DOM
1974         specification:
1975         https://dom.spec.whatwg.org/#characterdata
1976
1977         The parameters are also mandatory in Firefox and Chrome. However,
1978         those parameters are optional in WebKit. When DOMString parameters
1979         were omitted, we would use the "undefined" string instead. When
1980         unsigned long parameters were omitted, we would use 0 instead.
1981         This patch aligns our behavior with the specification and other
1982         major browsers.
1983
1984         No new tests, already covered by existing tests.
1985
1986         * dom/CharacterData.cpp:
1987         (WebCore::CharacterData::appendData):
1988         * dom/CharacterData.h:
1989         * dom/CharacterData.idl:
1990         * dom/Element.cpp:
1991         (WebCore::Element::mergeWithNextTextNode):
1992         * dom/Node.cpp:
1993         (WebCore::Node::normalize):
1994         * xml/parser/XMLDocumentParser.cpp:
1995         (WebCore::XMLDocumentParser::exitText):
1996
1997 2015-09-13  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1998
1999         Remove all uses of PassRefPtr in crypto, storage, and history
2000         https://bugs.webkit.org/show_bug.cgi?id=149091
2001
2002         Reviewed by Andreas Kling.
2003
2004         * crypto/CryptoKeyPair.cpp:
2005         (WebCore::CryptoKeyPair::CryptoKeyPair):
2006         * crypto/CryptoKeyPair.h:
2007         (WebCore::CryptoKeyPair::create):
2008         * crypto/SubtleCrypto.h:
2009         (WebCore::SubtleCrypto::create):
2010         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
2011         (WebCore::CryptoKeyRSA::create):
2012         * crypto/keys/CryptoKeyAES.cpp:
2013         (WebCore::CryptoKeyAES::generate):
2014         * crypto/keys/CryptoKeyAES.h:
2015         * crypto/keys/CryptoKeyHMAC.cpp:
2016         (WebCore::CryptoKeyHMAC::generate):
2017         * crypto/keys/CryptoKeyHMAC.h:
2018         * crypto/keys/CryptoKeyRSA.h:
2019         * crypto/mac/CryptoKeyRSAMac.cpp:
2020         (WebCore::CryptoKeyRSA::create):
2021         * history/BackForwardController.cpp:
2022         (WebCore::BackForwardController::BackForwardController):
2023         * history/BackForwardController.h:
2024         * history/HistoryItem.cpp:
2025         (WebCore::HistoryItem::setStateObject):
2026         (WebCore::HistoryItem::setFormData):
2027         * history/HistoryItem.h:
2028         (WebCore::HistoryItem::stateObject):
2029         * loader/EmptyClients.cpp:
2030         * page/Page.cpp:
2031         (WebCore::Page::Page):
2032         * storage/Storage.cpp:
2033         (WebCore::Storage::create):
2034         (WebCore::Storage::Storage):
2035         * storage/Storage.h:
2036         * storage/StorageArea.h:
2037         * storage/StorageMap.cpp:
2038         (WebCore::StorageMap::copy):
2039         (WebCore::StorageMap::setItem):
2040         (WebCore::StorageMap::setItemIgnoringQuota):
2041         (WebCore::StorageMap::removeItem):
2042         * storage/StorageMap.h:
2043         * storage/StorageNamespace.h:
2044
2045 2015-09-12  Chris Dumez  <cdumez@apple.com>
2046
2047         window.EventTarget should exist
2048         https://bugs.webkit.org/show_bug.cgi?id=149085
2049         <rdar://problem/22546774>
2050
2051         Reviewed by Sam Weinig.
2052
2053         Drop [NoInterfaceObject] for the EventTarget interface to match Chrome,
2054         Firefox and the specification:
2055         https://dom.spec.whatwg.org/#interface-eventtarget
2056
2057         No new tests, already covered by existing tests.
2058
2059         * dom/EventTarget.idl:
2060
2061 2015-09-12  Brian Burg  <bburg@apple.com>
2062
2063         Web Inspector: disambiguate inspected/frontend controllers and pages in backend code
2064         https://bugs.webkit.org/show_bug.cgi?id=149071
2065
2066         Reviewed by Joseph Pecoraro.
2067
2068         Be consistent about prefixing pages, inspector controllers, and window controllers
2069         with either "frontend" or "inspected", as appropriate. This change makes obvious some bugs
2070         in the frontend connection code, which are tracked by https://webkit.org/b/149006.
2071
2072         No new tests, no behavior change.
2073
2074         * WebCore.order:
2075         * inspector/InspectorClient.h:
2076         * inspector/InspectorController.cpp:
2077         (WebCore::InspectorController::inspectedPageDestroyed):
2078         (WebCore::InspectorController::show):
2079         (WebCore::InspectorController::close):
2080         * inspector/InspectorFrontendClientLocal.cpp:
2081         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
2082         (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
2083         (WebCore::InspectorFrontendClientLocal::canAttachWindow):
2084         (WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
2085         (WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
2086         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2087         (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
2088         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
2089         (WebCore::InspectorFrontendClientLocal::isUnderTest):
2090         * inspector/InspectorFrontendClientLocal.h:
2091         * inspector/InspectorOverlay.cpp:
2092         (WebCore::InspectorOverlay::freePage):
2093         * loader/EmptyClients.h:
2094
2095 2015-09-12  Chris Dumez  <cdumez@apple.com>
2096
2097         ChildNode.replaceWith() without argument should replace the node with an empty DocumentFragment
2098         https://bugs.webkit.org/show_bug.cgi?id=149073
2099         <rdar://problem/22547801>
2100
2101         Reviewed by Ryosuke Niwa.
2102
2103         ChildNode.replaceWith() without argument should replace the node with 
2104         an empty DocumentFragment, as per the specification:
2105         https://dom.spec.whatwg.org/#dom-childnode-replacewith
2106         https://dom.spec.whatwg.org/#converting-nodes-into-a-node
2107
2108         Previously, WebKit did not do anything in this case. This patch fixes
2109         it.
2110
2111         No new tests, already covered by existing test.
2112
2113         * dom/Node.cpp:
2114         (WebCore::Node::replaceWith):
2115
2116 2015-09-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2117
2118         Remove all uses of PassRefPtr in WebCore/plugins
2119         https://bugs.webkit.org/show_bug.cgi?id=149055
2120
2121         Reviewed by Darin Adler.
2122
2123         * plugins/DOMMimeType.cpp:
2124         (WebCore::DOMMimeType::DOMMimeType):
2125         (WebCore::DOMMimeType::enabledPlugin):
2126         * plugins/DOMMimeType.h:
2127         (WebCore::DOMMimeType::create):
2128         * plugins/DOMMimeTypeArray.cpp:
2129         (WebCore::DOMMimeTypeArray::item):
2130         * plugins/DOMMimeTypeArray.h:
2131         * plugins/DOMPlugin.cpp:
2132         (WebCore::DOMPlugin::item):
2133         * plugins/DOMPlugin.h:
2134         * plugins/DOMPluginArray.cpp:
2135         (WebCore::DOMPluginArray::item):
2136         * plugins/DOMPluginArray.h:
2137         * plugins/PluginViewBase.h:
2138         (WebCore::PluginViewBase::bindingInstance):
2139
2140 2015-09-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2141
2142         Remove all uses of PassRefPtr in WebCore/accessibility and WebCore/fileapi
2143         https://bugs.webkit.org/show_bug.cgi?id=149059
2144
2145         Reviewed by Darin Adler.
2146
2147         * accessibility/AXObjectCache.cpp:
2148         * accessibility/AccessibilityObject.cpp:
2149         (WebCore::rangeClosestToRange):
2150         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
2151         (WebCore::AccessibilityObject::selectionRange):
2152         (WebCore::AccessibilityObject::selectText):
2153         * accessibility/AccessibilityObject.h:
2154         * accessibility/ios/AXObjectCacheIOS.mm:
2155         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2156         (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
2157         (-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
2158         * accessibility/mac/AXObjectCacheMac.mm:
2159         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2160         (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
2161         * fileapi/FileList.h:
2162         (WebCore::FileList::append):
2163         * fileapi/WebKitBlobBuilder.cpp:
2164         (WebCore::BlobBuilder::append):
2165         * fileapi/WebKitBlobBuilder.h:
2166
2167 2015-09-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
2168
2169         SVGColor custom text format is different from the CSS color custom text format
2170         https://bugs.webkit.org/show_bug.cgi?id=148879
2171
2172         Reviewed by Daniel Bates.
2173
2174         Implement the serialization of a CSS color value as it is described in
2175         <https://drafts.csswg.org/cssom/#serializing-css-values>. Add the new
2176         function Color::cssText() which is refactored from the existing function
2177         Color::serialized(). Use the new function for serializing the SVGColor
2178         always and also for Color but only when the alpha component is not 1.
2179
2180         Test: svg/css/computed-style-rgb-color.html
2181
2182         * css/CSSPrimitiveValue.cpp:
2183         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Move the code
2184         for serializing the color from this function to Color::cssText().
2185         
2186         * platform/graphics/Color.cpp:
2187         (WebCore::Color::serialized): Call Color::cssText() if the alpha component
2188         is not 1 and delete the repeated code. 
2189         
2190         (WebCore::Color::cssText):
2191         * platform/graphics/Color.h: Add the new function to the header file.
2192         
2193         * svg/SVGColor.cpp:
2194         (WebCore::SVGColor::customCSSText): Call Color::cssText() always instead
2195         of calling Color::serialized() for serializing the SVGColor.
2196
2197 2015-09-11  Nan Wang  <n_wang@apple.com>
2198
2199         AX: ARIA 1.1 @aria-current
2200         https://bugs.webkit.org/show_bug.cgi?id=146012
2201
2202         Reviewed by Chris Fleizach.
2203
2204         Tests: accessibility/aria-current.html
2205                inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent.html
2206
2207         Added support for ARIA 1.1 aria-current.
2208
2209         * accessibility/AccessibilityObject.cpp:
2210         (WebCore::AccessibilityObject::invalidStatus):
2211         (WebCore::AccessibilityObject::ariaCurrentState):
2212         (WebCore::AccessibilityObject::hasTagName):
2213         * accessibility/AccessibilityObject.h:
2214         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2215         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
2216         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2217         * html/HTMLAttributeNames.in:
2218         * inspector/InspectorDOMAgent.cpp:
2219         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2220
2221 2015-09-11  Chris Dumez  <cdumez@apple.com>
2222
2223         DOMTokenList update steps for classList don't follow the spec
2224         https://bugs.webkit.org/show_bug.cgi?id=148589
2225         <rdar://problem/22547443>
2226
2227         Reviewed by Ryosuke Niwa and Darin Adler.
2228
2229         Update our DOMTokenList implementation to behave according to
2230         the latest DOM specification:
2231         https://dom.spec.whatwg.org/#interface-domtokenlist
2232
2233         In particular, the following changes were made:
2234         - The stringifier now returns the result of the ordered set serializer
2235           for tokens. This means that we drop duplicate spaces and extra spaces
2236           [1][2][3].
2237         - DOMSettableTokenList.value now returns the result of the ordered set
2238           serializer for tokens [4] as well.
2239         - When the DOMTokenList's tokens are updated and there is an associated
2240           Element attribute, we set the attribute value to be the the ordered
2241           set serializer for tokens. This is according to the DOMTokenList
2242           update steps in the specification [6]. Chrome does not match the
2243           specification either.
2244
2245         Edge browser behaves according to the specification already. Firefox was
2246         implementing this via [7] but no recent progress. This makes the JS API
2247         nicer to use and interest was shown by jQuery Team.
2248
2249         The following refactoring was done:
2250         - Merge ClassList / RelList into a single AttributeDOMTokenList class
2251           as their code is mostly duplicated and the only thing that changes
2252           is which attribute is associated (class vs rel). AttributeDOMTokenList
2253           now keeps the attribute name as a member so it could be used for any
2254           attribute. AttributeDOMTokenList overrides DOMTokenList's
2255           updateAfterTokenChange() to do update the attribute's value as per
2256           [6].
2257         - We no longer use a SpaceSplitString for the internal representation
2258           as we need to sanitize the tokens (drop duplicates and extra spaces).
2259           DOMTokenList now has an internal Vector<AtomicString> containing the
2260           tokens that is constructed from the algorithm in [2]. As a result,
2261           most of the logic is now in DOMTokenList instead of its subclasses
2262           which means that most methods are no longer virtual. We only have
2263           one virtual function named updateAfterTokenChange() to do the update
2264           steps as AttributeDOMTokenList needs to update the associated
2265           attribute.
2266
2267         This change does not seem to impact Dromaeo.
2268
2269         [1] https://dom.spec.whatwg.org/#concept-ordered-set-serializer
2270         [2] https://dom.spec.whatwg.org/#ordered%20sets
2271         [3] https://dom.spec.whatwg.org/#stringification-behavior
2272         [4] https://dom.spec.whatwg.org/#dom-domsettabletokenlist-value
2273         [5] https://dom.spec.whatwg.org/#dom-domtokenlist-contains (step 2)
2274         [6] https://dom.spec.whatwg.org/#concept-DTL-update
2275         [7] https://bugzilla.mozilla.org/show_bug.cgi?id=869788
2276
2277         No new tests, already covered by existing tests.
2278
2279         * dom/Element.cpp:
2280         (WebCore::Element::classAttributeChanged):
2281         When the class attribute changes, make sure to update the associated
2282         classList if there is one. We could do this lazily if it turns out
2283         to be a performance problem. However, chances are this is not as
2284         classList is rarely used and we only need to update the classList if
2285         it was ever accessed by JS for this Element.
2286
2287         (WebCore::Element::insertedInto):
2288         Drop call to clearClassListValueForQuirksMode() as we no longer need
2289         to maintain a separate SpaceSplitString for classes when in quirks
2290         mode. This is because AttributeDOMTokenList now has its own Vector
2291         of classes in their original cases. It therefore no longer relies on
2292         Element::classNames() which has its case folded when in quirks mode.
2293
2294         (WebCore::Element::classList):
2295         Return a AttributeDOMTokenList instead of a ClassList.
2296
2297         * html/AttributeDOMTokenList.h: Added.
2298         * html/AttributeDOMTokenList.cpp: Added.
2299         (WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
2300         Call DOMTokenList::setValue() using the attribute's value so that
2301         DOMTokenList can initialize its token Vector.
2302
2303         (WebCore::AttributeDOMTokenList::attributeValueChanged):
2304         If the attribute value was changed by somebody else that the
2305         AttributeDOMTokenList, call DOMTokenList::setValue() so that it
2306         can update its token Vector.
2307
2308         (WebCore::AttributeDOMTokenList::updateAfterTokenChange):
2309         This is called whenever the token Vector is changed via JS. In
2310         this case, we update the associated attribute's value.
2311
2312         * html/ClassList.cpp: Removed.
2313         * html/ClassList.h: Removed.
2314         Now merged into AttributeDOMTokenList.
2315
2316         * html/DOMSettableTokenList.cpp:
2317         * html/DOMSettableTokenList.h:
2318         Get rid of most of the code as most of the logic is now in
2319         DOMTokenList parent class.
2320
2321         * html/DOMTokenList.cpp:
2322         (WebCore::DOMTokenList::validateToken):
2323         Use a String parameter instead of an AtomicString as this method does
2324         not need the input the be an AtomicString. This avoid atomizing
2325         String unnecessarily.
2326
2327         (WebCore::DOMTokenList::validateTokens):
2328         Use a modern loop.
2329
2330         (WebCore::DOMTokenList::contains):
2331         No longer use containsInternal() virtual function. We can now check
2332         the internal token Vector.
2333
2334         (WebCore::DOMTokenList::add):
2335         Now update the internal Vector. Use a modern loop and try to minimize
2336         Vector capacity reallocation.
2337
2338         (WebCore::DOMTokenList::remove):
2339         Now update the internal Vector.
2340
2341         (WebCore::DOMTokenList::toggle):
2342         Now update the internal Vector and refactor the code so that it is
2343         structured exactly as the algorithm in the specification for
2344         clarity.
2345
2346         (WebCore::DOMTokenList::value):
2347         Now return the result of the ordered set serializer for tokens. This
2348         method is used for:
2349         - The DOMSettableTokenList.value() getter
2350         - The DOMTokenList stringifier
2351         - As attribute value when updating the associated attribute in
2352           AttributeDOMTokenList.
2353
2354         (WebCore::DOMTokenList::setValue):
2355         Update the internal Vector using the algorithm in [2].
2356
2357         * html/DOMTokenList.h:
2358         (WebCore::DOMTokenList::length):
2359         No longer virtual, now returns the size of the internal token Vector.
2360
2361         (WebCore::DOMTokenList::item):
2362         No longer virtual, now returns the token at the given index in the
2363         internal Vector.
2364
2365         * html/HTMLAnchorElement.cpp:
2366         (WebCore::HTMLAnchorElement::relList):
2367         Now return a AttributeDOMTokenList.
2368
2369         * html/HTMLLinkElement.cpp:
2370         (WebCore::HTMLLinkElement::relList):
2371         Now return a AttributeDOMTokenList.
2372
2373         * html/RelList.cpp: Removed.
2374         * html/RelList.h: Removed.
2375         Now merged into AttributeDOMTokenList.
2376
2377 2015-09-11  Chris Dumez  <cdumez@apple.com>
2378
2379         Element.tagName should be upper-case for HTML elements in HTML documents
2380         https://bugs.webkit.org/show_bug.cgi?id=148843
2381         <rdar://problem/22559081>
2382
2383         Reviewed by Ryosuke Niwa.
2384
2385         Element.tagName should be upper-case for HTML elements in HTML documents,
2386         as per the DOM specification:
2387         https://dom.spec.whatwg.org/#dom-element-tagname
2388
2389         Previously, WebKit would fail to upper-case the tagname if the element's
2390         tag had a prefix. This patch corrects this. This aligns our behavior with
2391         Firefox, Chrome and IE.
2392
2393         No new tests, already covered by existing tests.
2394
2395         * html/HTMLElement.cpp:
2396         (WebCore::HTMLElement::nodeName):
2397
2398 2015-09-11  Chris Dumez  <cdumez@apple.com>
2399
2400         document.body = "text" should throw a TypeError, not a HierarchyRequestError
2401         https://bugs.webkit.org/show_bug.cgi?id=149057
2402         <rdar://problem/22567157>
2403
2404         Reviewed by Ryosuke Niwa.
2405
2406         document.body = "text" should throw a TypeError, not a
2407         HierarchyRequestError:
2408         https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
2409
2410         This is because "text" is a DOMString and it cannot be converted into an
2411         HTMLElement?. Therefore, the WebIDL specification says we should throw a
2412         TypeError in this case.
2413
2414         Chrome and Firefox throw the right exception.
2415
2416         No new tests, already covered by existing test.
2417
2418         * dom/Document.idl:
2419
2420 2015-09-11  Andreas Kling  <akling@apple.com>
2421
2422         [JSC] Weak should only accept cell pointees.
2423         <https://webkit.org/b/148955>
2424
2425         Reviewed by Geoffrey Garen.
2426
2427         Update WebCore bindings for the new Weak and Weak-related signatures.
2428
2429         * bindings/js/JSCSSRuleListCustom.cpp:
2430         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
2431         * bindings/js/JSCSSValueCustom.cpp:
2432         (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots):
2433         (WebCore::JSCSSValueOwner::finalize):
2434         * bindings/js/JSCallbackData.cpp:
2435         (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots):
2436         * bindings/js/JSCallbackData.h:
2437         * bindings/js/JSMutationObserverCustom.cpp:
2438         (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots):
2439         * bindings/js/JSNodeCustom.cpp:
2440         (WebCore::isReachableFromDOM):
2441         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
2442         * bindings/js/JSNodeListCustom.cpp:
2443         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
2444         * bindings/js/JSTextTrackCueCustom.cpp:
2445         (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
2446         * bindings/js/WebCoreTypedArrayController.cpp:
2447         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots):
2448         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
2449         * bindings/js/WebCoreTypedArrayController.h:
2450         * bindings/scripts/CodeGeneratorJS.pm:
2451         (GenerateHeader):
2452         (GenerateImplementation):
2453         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2454         (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots):
2455         (WebCore::JSTestActiveDOMObjectOwner::finalize):
2456         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2457         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2458         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
2459         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
2460         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2461         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2462         (WebCore::JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots):
2463         (WebCore::JSTestCustomNamedGetterOwner::finalize):
2464         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2465         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2466         (WebCore::JSTestEventConstructorOwner::isReachableFromOpaqueRoots):
2467         (WebCore::JSTestEventConstructorOwner::finalize):
2468         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2469         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2470         (WebCore::JSTestEventTargetOwner::isReachableFromOpaqueRoots):
2471         (WebCore::JSTestEventTargetOwner::finalize):
2472         * bindings/scripts/test/JS/JSTestEventTarget.h:
2473         * bindings/scripts/test/JS/JSTestException.cpp:
2474         (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
2475         (WebCore::JSTestExceptionOwner::finalize):
2476         * bindings/scripts/test/JS/JSTestException.h:
2477         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2478         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
2479         (WebCore::JSTestGenerateIsReachableOwner::finalize):
2480         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2481         * bindings/scripts/test/JS/JSTestInterface.cpp:
2482         (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
2483         (WebCore::JSTestInterfaceOwner::finalize):
2484         * bindings/scripts/test/JS/JSTestInterface.h:
2485         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2486         (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots):
2487         (WebCore::JSTestMediaQueryListListenerOwner::finalize):
2488         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2489         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2490         (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots):
2491         (WebCore::JSTestNamedConstructorOwner::finalize):
2492         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2493         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2494         (WebCore::JSTestNondeterministicOwner::isReachableFromOpaqueRoots):
2495         (WebCore::JSTestNondeterministicOwner::finalize):
2496         * bindings/scripts/test/JS/JSTestNondeterministic.h:
2497         * bindings/scripts/test/JS/JSTestObj.cpp:
2498         (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots):
2499         (WebCore::JSTestObjOwner::finalize):
2500         * bindings/scripts/test/JS/JSTestObj.h:
2501         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2502         (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots):
2503         (WebCore::JSTestOverloadedConstructorsOwner::finalize):
2504         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2505         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2506         (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
2507         (WebCore::JSTestOverrideBuiltinsOwner::finalize):
2508         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2509         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2510         (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots):
2511         (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
2512         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2513         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2514         (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
2515         (WebCore::JSTestTypedefsOwner::finalize):
2516         * bindings/scripts/test/JS/JSTestTypedefs.h:
2517         * bindings/scripts/test/JS/JSattribute.cpp:
2518         (WebCore::JSattributeOwner::isReachableFromOpaqueRoots):
2519         (WebCore::JSattributeOwner::finalize):
2520         * bindings/scripts/test/JS/JSattribute.h:
2521         * bindings/scripts/test/JS/JSreadonly.cpp:
2522         (WebCore::JSreadonlyOwner::isReachableFromOpaqueRoots):
2523         (WebCore::JSreadonlyOwner::finalize):
2524         * bindings/scripts/test/JS/JSreadonly.h:
2525         * bridge/runtime_root.cpp:
2526         (JSC::Bindings::RootObject::finalize):
2527         * bridge/runtime_root.h:
2528
2529 2015-09-10  Chris Fleizach  <cfleizach@apple.com>
2530
2531         AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
2532         https://bugs.webkit.org/show_bug.cgi?id=148891
2533
2534         Reviewed by Alexey Proskuryakov.
2535
2536         Asychronous focus setting DOES work on Yosemite, just not Mavericks.
2537
2538         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2539         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
2540         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2541
2542 2015-09-10  David Hyatt  <hyatt@apple.com>
2543
2544         [New Block-Inside-Inline Model] Self-collapsing block check needs to account for anonymous inline blocks
2545         https://bugs.webkit.org/show_bug.cgi?id=149042
2546
2547         Reviewed by Dean Jackson.
2548
2549         Added new tests in fast/block/inside-inlines/
2550
2551         * rendering/InlineFlowBox.cpp:
2552         * rendering/InlineFlowBox.h:
2553         (WebCore::InlineFlowBox::anonymousInlineBlock):
2554         Add a new accessor to get the anonymousInlineBlock() for lines that wrap them.
2555
2556         * rendering/RenderBlock.cpp:
2557         (WebCore::RenderBlock::childrenPreventSelfCollapsing):
2558         (WebCore::RenderBlock::isSelfCollapsingBlock):
2559         isSelfCollapsingBlock() now calls a virtual method that checks lines/children called childrenPreventSelfCollapsing.
2560         This lets us farm out the lines check to the derived RenderBlockFlow class.
2561
2562         * rendering/RenderBlock.h:
2563         (WebCore::RenderBlock::childrenPreventSelfCollapsing):
2564         Added new virtual method for checking children.
2565
2566         * rendering/RenderBlockFlow.cpp:
2567         * rendering/RenderBlockFlow.h:
2568         (WebCore::RenderBlockFlow::childrenPreventSelfCollapsing):
2569         Overridden to ensure that blocks can still be self-collapsing if they only contain anonymous inline-block lines that
2570         are also self-collapsing.
2571
2572 2015-09-10  Jinyoung Hur  <hur.ims@navercorp.com>
2573
2574         [WebGL][GLES] bad shaders should not be linked not only for GL but also for GL ES
2575         https://bugs.webkit.org/show_bug.cgi?id=148794
2576
2577         Reviewed by Dean Jackson.
2578
2579         Checking bad shaders, precision matching and varyings packing are all valid for GL ES too.
2580
2581         Test: webgl/1.0.2/conformance/programs/program-test.html
2582
2583         * html/canvas/WebGLRenderingContextBase.cpp:
2584         (WebCore::WebGLRenderingContextBase::linkProgram):
2585
2586 2015-09-10  Jinyoung Hur  <hur.ims@navercorp.com>
2587
2588         Static variables in GraphicsContext3DOpenGLCommon should be avoided because of the race condition
2589         https://bugs.webkit.org/show_bug.cgi?id=148957
2590
2591         Reviewed by Dean Jackson.
2592
2593         There is no guarantee that only one thread calls GraphicsContext3D::compileShader() at a time so it would be 
2594         better to use a thread local storage variable rather than use a static variable.
2595
2596         No new tests. No behavioural changes.
2597
2598         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2599         (WebCore::getCurrentNameHashMapForShader):
2600         (WebCore::setCurrentNameHashMapForShader):
2601         (WebCore::nameHashForShader):
2602         (WebCore::GraphicsContext3D::compileShader):
2603         (WebCore::GraphicsContext3D::mappedSymbolName):
2604
2605 2015-09-10  Chris Dumez  <cdumez@apple.com>
2606
2607         Node.appendChild(null) / replaceChild(null, null) / removeChild(null) / insertBefore(null, ref) should throw a TypeError
2608         https://bugs.webkit.org/show_bug.cgi?id=148971
2609         <rdar://problem/22560883>
2610         <rdar://problem/22559225>
2611
2612         Reviewed by Ryosuke Niwa.
2613
2614         Node.appendChild(null) / replaceChild(null, null) / removeChild(null)
2615         and insertBefore(null, ref) should throw a TypeError instead of a
2616         NotFoundError, as per the specification:
2617         https://dom.spec.whatwg.org/#node
2618
2619         The parameters are not nullable so the Web IDL specification says
2620         we should throw a TypeError in this case.
2621
2622         This patch moves the null-checking from ContainerNode to the methods
2623         on Node. The null-checking is supposed to be done by the bindings code
2624         but our generator currently does not support this so we do the null
2625         checking as close to the bindings as possible. The bindings code is
2626         calling the methods on Node. This also makes sure we throw a TypeError
2627         for null-argument when the Node is not a ContainerNode. For e.g.
2628         Text.appendChild(null) should throw a TypeError too.
2629
2630         The methods on ContainerNode now take references insteaad of pointer
2631         parameters now that the null-checking is done at the call site in
2632         Node. This lead to a lot of code update as those methods are used
2633         a lot throughout the code base.
2634
2635         No new tests, already covered by pre-existing layout tests.
2636
2637 2015-09-10  Daniel Bates  <dabates@apple.com>
2638
2639         Write a test to ensure we don't regress processing of tasks when page defers loading
2640         https://bugs.webkit.org/show_bug.cgi?id=135882
2641         <rdar://problem/22550497>
2642
2643         Reviewed by Darin Adler.
2644
2645         Towards adding a test for <https://bugs.webkit.org/show_bug.cgi?id=135688>, add a window.internals
2646         function, setPageDefersLoading, to enable and disable whether the page defers loading.
2647
2648         Test: storage/websql/success-callback-when-page-defers-loading.html
2649
2650         * testing/Internals.cpp:
2651         (WebCore::Internals::resetToConsistentState): Reset defers loading for the page to false.
2652         (WebCore::Internals::setPageDefersLoading): Added.
2653         * testing/Internals.h:
2654         * testing/Internals.idl: Added IDL declaration setPageDefersLoading.
2655
2656 2015-09-10  Sergio Villar Senin  <svillar@igalia.com>
2657
2658         min-width/height should default to auto for flexbox items
2659         https://bugs.webkit.org/show_bug.cgi?id=146020
2660
2661         Reviewed by David Hyatt.
2662
2663         Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
2664
2665         As specified here
2666         http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
2667         value of min-{width|height} is auto for flex items.
2668
2669         In case this patch breaks any website (as it's changing the
2670         default value of those properties) the fix is likely to add:
2671
2672         min-width: 0;
2673         min-height: 0;
2674
2675         to any relevant flexitems.
2676
2677         Test: css3/flexbox/min-size-auto.html
2678
2679         * css/CSSComputedStyleDeclaration.cpp:
2680         (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
2681         (WebCore::ComputedStyleExtractor::propertyValue): Return auto
2682         for flex items if min-width/height is auto.
2683         * css/CSSParser.cpp:
2684         (WebCore::CSSParser::parseValue):
2685         * html/shadow/SliderThumbElement.cpp:
2686         * rendering/RenderBox.cpp:
2687         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
2688         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
2689         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
2690         (WebCore::RenderBox::computeLogicalHeight):
2691         (WebCore::RenderBox::computeLogicalHeightUsing):
2692         (WebCore::RenderBox::computeContentLogicalHeight):
2693         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
2694         (WebCore::RenderBox::computeReplacedLogicalWidth):
2695         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
2696         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
2697         (WebCore::RenderBox::computeReplacedLogicalHeight):
2698         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
2699         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2700         (WebCore::RenderBox::availableLogicalHeightUsing):
2701         (WebCore::RenderBox::computePositionedLogicalWidth):
2702         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
2703         (WebCore::RenderBox::computePositionedLogicalHeight):
2704         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
2705         * rendering/RenderBox.h:
2706         * rendering/RenderButton.h:
2707         * rendering/RenderFlexibleBox.cpp:
2708         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2709         (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
2710         (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
2711         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2712         (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
2713         * rendering/RenderFlexibleBox.h:
2714         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
2715         * rendering/RenderFullScreen.h:
2716         * rendering/RenderGrid.cpp:
2717         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2718         * rendering/RenderMediaControlElements.h:
2719         * rendering/RenderMenuList.cpp:
2720         (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
2721         the min-width explicitly.
2722         * rendering/RenderMenuList.h:
2723         * rendering/RenderMultiColumnSet.cpp:
2724         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
2725         * rendering/RenderNamedFlowFragment.cpp:
2726         (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
2727         * rendering/RenderReplaced.cpp:
2728         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
2729         (WebCore::RenderReplaced::computeReplacedLogicalHeight):
2730         * rendering/RenderSlider.h:
2731         * rendering/RenderTextControl.h:
2732         * rendering/RenderTextControlSingleLine.cpp:
2733         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
2734         the min-width explicitly.
2735         * rendering/mathml/RenderMathMLBlock.h:
2736         * rendering/style/RenderStyle.h:
2737
2738 2015-09-10  ChangSeok Oh  <changseok.oh@collabora.com>
2739
2740         [GTK] Volume bar is broken
2741         https://bugs.webkit.org/show_bug.cgi?id=145639
2742
2743         Reviewed by Philippe Normand.
2744
2745         The ControlPart enum values' order has mismatched the one of values in CSSValueKeywords.in
2746         after r180965. The MediaVolumeSliderPart should be prior to the MediaVolumeSliderContainerpart.
2747
2748         Tests: media/click-volume-bar-not-pausing.html
2749                media/volume-bar-empty-when-muted.html
2750
2751         * platform/ThemeTypes.h:
2752
2753 2015-09-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2754
2755         Remove all uses of PassRefPtr in WebCore/svg
2756         https://bugs.webkit.org/show_bug.cgi?id=148472
2757
2758         Reviewed by Darin Adler.
2759
2760         Clean up all uses of PassRefPtr in WebCore/svg.
2761
2762         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2763         (WebCore::AudioScheduledSourceNode::addEventListener):
2764         * Modules/webaudio/AudioScheduledSourceNode.h:
2765         * Modules/webaudio/ScriptProcessorNode.cpp:
2766         (WebCore::ScriptProcessorNode::addEventListener):
2767         * Modules/webaudio/ScriptProcessorNode.h:
2768         * dom/EventListenerMap.cpp:
2769         (WebCore::copyListenersNotCreatedFromMarkupToTarget):
2770         * dom/EventTarget.cpp:
2771         (WebCore::EventTarget::addEventListener):
2772         * dom/EventTarget.h:
2773         * dom/MessagePort.cpp:
2774         (WebCore::MessagePort::addEventListener):
2775         * dom/MessagePort.h:
2776         * dom/Node.cpp:
2777         (WebCore::tryAddEventListener):
2778         (WebCore::Node::addEventListener):
2779         * dom/Node.h:
2780         * html/HTMLMediaElement.cpp:
2781         (WebCore::HTMLMediaElement::addEventListener):
2782         * html/HTMLMediaElement.h:
2783         * html/ImageDocument.cpp:
2784         (WebCore::ImageDocument::createDocumentStructure):
2785         * html/shadow/MediaControlsApple.cpp:
2786         (WebCore::MediaControlsApple::showClosedCaptionTrackList):
2787         * page/DOMWindow.cpp:
2788         (WebCore::DOMWindow::addEventListener):
2789         * page/DOMWindow.h:
2790         * rendering/svg/RenderSVGResourceFilter.cpp:
2791         (WebCore::RenderSVGResourceFilter::buildPrimitives):
2792         * svg/SVGElement.cpp:
2793         (WebCore::SVGElement::addEventListener):
2794         * svg/SVGElement.h:
2795         * svg/SVGPathElement.cpp:
2796         (WebCore::SVGPathElement::pathSegListChanged):
2797         * svg/SVGPathUtilities.cpp:
2798         (WebCore::appendSVGPathByteStreamFromSVGPathSeg):
2799         * svg/SVGPathUtilities.h:
2800         * svg/SVGTRefElement.cpp:
2801         (WebCore::SVGTRefTargetEventListener::attach):
2802         (WebCore::SVGTRefElement::buildPendingResource):
2803         * svg/graphics/filters/SVGFilterBuilder.cpp:
2804         (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
2805         * svg/graphics/filters/SVGFilterBuilder.h:
2806
2807 2015-09-09  Dewei Zhu  <dewei_zhu@apple.com>
2808
2809         Document.characterSet should return "UTF-8" instead of null by default.
2810         https://bugs.webkit.org/show_bug.cgi?id=148810
2811         <rdar://problem/22548727>
2812
2813         Reviewed by Ryosuke Niwa.
2814
2815         Document encoding should default to "UTF-8" as is specified in
2816         https://dom.spec.whatwg.org/#concept-document-encoding. This behavior
2817         is consistent with Firefox and Chrome.
2818
2819         * dom/Document.cpp:
2820         (WebCore::Document::encoding): Returns nullAtom according to declearation.
2821         (WebCore::Document::characterSetForBindings): Returns "UTF-8" by default instead of null String.
2822         * dom/Document.h:
2823         (WebCore::Document::charset):
2824         (WebCore::Document::inputEncoding): Deleted.
2825         (WebCore::Document::characterSet): Deleted.
2826         * dom/Document.idl:
2827         * dom/InlineStyleSheetOwner.cpp:
2828         (WebCore::InlineStyleSheetOwner::createSheet):
2829         * inspector/InspectorPageAgent.cpp:
2830         (WebCore::InspectorPageAgent::mainResourceContent):
2831         * inspector/InspectorResourceAgent.cpp:
2832         (WebCore::InspectorResourceAgent::didFinishLoading):
2833         (WebCore::InspectorResourceAgent::didFailLoading):
2834         * loader/DocumentWriter.cpp:
2835         (WebCore::DocumentWriter::createDecoderIfNeeded):
2836         * loader/FormSubmission.cpp:
2837         (WebCore::encodingFromAcceptCharset):
2838
2839 2015-09-09  Benjamin Poulain  <bpoulain@apple.com>
2840
2841         CSS general sibling selectors does not work without CSS JIT
2842         https://bugs.webkit.org/show_bug.cgi?id=148987
2843         rdar://problem/22559860
2844
2845         Reviewed by Andreas Kling.
2846
2847         When traversing with the indirect adjacent combinator, SelectorChecker
2848         was not setting the style invalidation flag on the right element.
2849
2850         Tests: fast/css/indirect-adjacent-style-invalidation-1.html
2851                fast/css/indirect-adjacent-style-invalidation-2.html
2852                fast/css/indirect-adjacent-style-invalidation-3.html
2853
2854         * css/SelectorChecker.cpp:
2855         (WebCore::SelectorChecker::matchRecursively):
2856
2857 2015-09-09  Joseph Pecoraro  <pecoraro@apple.com>
2858
2859         Web Inspector: Remove unused InspectorFrontendHost methods
2860         https://bugs.webkit.org/show_bug.cgi?id=149013
2861
2862         Reviewed by Brian Burg.
2863
2864         * inspector/InspectorFrontendHost.cpp:
2865         (WebCore::InspectorFrontendHost::canSaveAs): Deleted.
2866         (WebCore::InspectorFrontendHost::canInspectWorkers): Deleted.
2867         * inspector/InspectorFrontendHost.h:
2868         * inspector/InspectorFrontendHost.idl:
2869
2870 2015-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
2871
2872         ASSERTION FAILED: typesettingFeatures & (Kerning | Ligatures) in WebCore::applyFontTransforms
2873         https://bugs.webkit.org/show_bug.cgi?id=146194
2874
2875         Reviewed by Dean Jackson.
2876
2877         We might trigger shaping even if the author hasn't specified kerning or ligatures.
2878
2879         Test: fast/text/softbank-emoji-no-ligatures-nor-kerning.html
2880
2881         * platform/graphics/WidthIterator.cpp:
2882         (WebCore::isSoftBankEmoji):
2883         (WebCore::WidthIterator::applyFontTransforms):
2884         (WebCore::WidthIterator::advanceInternal):
2885         (WebCore::applyFontTransforms): Deleted.
2886         * platform/graphics/WidthIterator.h:
2887
2888 2015-09-09  Chris Dumez  <cdumez@apple.com>
2889
2890         Setting document.title when there is no title and no head element should no nothing
2891         https://bugs.webkit.org/show_bug.cgi?id=149005
2892         <rdar://problem/22567524>
2893
2894         Reviewed by Ryosuke Niwa.
2895
2896         Setting document.title when there is no title element and no head
2897         element should no nothing:
2898         - https://html.spec.whatwg.org/multipage/dom.html#document.title
2899
2900         Firefox and Chrome comply with the specification. However, WebKit
2901         was returning the updated title when querying document.title after
2902         setting it.
2903
2904         No new tests, covered by existing tests.
2905
2906         * dom/Document.cpp:
2907         (WebCore::Document::setTitle):
2908
2909 2015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
2910
2911         [css-grid] Percentage columns shouldn't include border and padding
2912         https://bugs.webkit.org/show_bug.cgi?id=148978
2913
2914         Reviewed by Sergio Villar Senin.
2915
2916         Subtract border and padding when we're calculating the breadth of the
2917         columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
2918
2919         Added test to check the behavior for both columns and rows.
2920
2921         Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
2922
2923         * rendering/RenderGrid.cpp:
2924         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2925
2926 2015-09-09  Commit Queue  <commit-queue@webkit.org>
2927
2928         Unreviewed, rolling out r189536 and r189538.
2929         https://bugs.webkit.org/show_bug.cgi?id=149002
2930
2931         broke tests on mac (Requested by alexchristensen on #webkit).
2932
2933         Reverted changesets:
2934
2935         "min-width/height should default to auto for flexbox items"
2936         https://bugs.webkit.org/show_bug.cgi?id=146020
2937         http://trac.webkit.org/changeset/189536
2938
2939         "[css-grid] Percentage columns shouldn't include border and
2940         padding"
2941         https://bugs.webkit.org/show_bug.cgi?id=148978
2942         http://trac.webkit.org/changeset/189538
2943
2944 2015-09-08  David Hyatt  <hyatt@apple.com>
2945
2946         REGRESSION: Inline-block baseline is wrong when zero-width replaced child is present
2947         https://bugs.webkit.org/show_bug.cgi?id=147452
2948         rdar://problem/21943074
2949
2950         Reviewed by Myles Maxfield.
2951
2952         Added new test in fast/inline-block
2953
2954         Treat zero width replaced elements the same as replaced elements with width. Instead of
2955         clearing floats based off having no committed width, we instead track both committed
2956         width and committed replaced objects. We do this with two new booleans in LineWidth
2957         so that we know when we have uncomitted and committed replaced objects.
2958
2959         * rendering/line/BreakingContext.h:
2960         (WebCore::BreakingContext::handleReplaced):
2961         (WebCore::BreakingContext::handleText):
2962         (WebCore::BreakingContext::canBreakAtThisPosition):
2963         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
2964         * rendering/line/LineWidth.cpp:
2965         (WebCore::LineWidth::LineWidth):
2966         (WebCore::LineWidth::commit):
2967         (WebCore::LineWidth::applyOverhang):
2968         * rendering/line/LineWidth.h:
2969         (WebCore::LineWidth::committedWidth):
2970         (WebCore::LineWidth::availableWidth):
2971         (WebCore::LineWidth::logicalLeftOffset):
2972         (WebCore::LineWidth::hasCommitted):
2973         (WebCore::LineWidth::addUncommittedWidth):
2974         (WebCore::LineWidth::addUncommittedReplacedWidth):
2975
2976 2015-09-09  Antti Koivisto  <antti@apple.com>
2977
2978         Split mixed font GlyphPage functionality to separate class
2979         https://bugs.webkit.org/show_bug.cgi?id=148965
2980
2981         Reviewed by Myles Maxfield.
2982
2983         Currently GlyphPage class is used for both immutable single font case (in Font) and
2984         for caching mixed font mappings (in FontCascadeFonts). It is cleaner to use separate
2985         classed for these cases. This will also make future improvements easier.
2986
2987         * platform/graphics/Font.cpp:
2988         (WebCore::Font::~Font):
2989         (WebCore::fillGlyphPage):
2990         (WebCore::createAndFillGlyphPage):
2991         (WebCore::Font::glyphPage):
2992         (WebCore::Font::glyphForCharacter):
2993         (WebCore::Font::glyphDataForCharacter):
2994         * platform/graphics/Font.h:
2995         * platform/graphics/FontCascadeFonts.cpp:
2996         (WebCore::MixedFontGlyphPage::MixedFontGlyphPage):
2997         (WebCore::MixedFontGlyphPage::glyphDataForCharacter):
2998         (WebCore::MixedFontGlyphPage::setGlyphDataForCharacter):
2999         (WebCore::MixedFontGlyphPage::setGlyphDataForIndex):
3000
3001             Mixed font pages are now an implementation detail of FontCascadeFonts.
3002
3003         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::glyphDataForCharacter):
3004         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setGlyphDataForCharacter):
3005         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setSingleFontPage):
3006
3007             Cache entry is either shared single font GlyphPage or mutable MixedFontGlyphPage.
3008
3009         (WebCore::FontCascadeFonts::FontCascadeFonts):
3010         (WebCore::FontCascadeFonts::glyphDataForCharacter):
3011         (WebCore::FontCascadeFonts::pruneSystemFallbacks):
3012         * platform/graphics/FontCascadeFonts.h:
3013         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isNull):
3014         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isMixedFont):
3015         * platform/graphics/GlyphPage.h:
3016
3017             GlyphPage is now for single font mappings only.
3018             Use regular allocation instead of variable size tricks.
3019             It is always immutable after initialization (though currently a setter is still needed).
3020
3021         (WebCore::GlyphPage::create):
3022         (WebCore::GlyphPage::~GlyphPage):
3023         (WebCore::GlyphPage::count):
3024         (WebCore::GlyphPage::indexForCharacter):
3025         (WebCore::GlyphPage::glyphDataForCharacter):
3026         (WebCore::GlyphPage::glyphForCharacter):
3027         (WebCore::GlyphPage::glyphDataForIndex):
3028         (WebCore::GlyphPage::glyphForIndex):
3029         (WebCore::GlyphPage::setGlyphForIndex):
3030         (WebCore::GlyphPage::font):
3031         (WebCore::GlyphPage::GlyphPage):
3032         (WebCore::GlyphPage::createForMixedFonts): Deleted.
3033         (WebCore::GlyphPage::createCopyForMixedFonts): Deleted.
3034         (WebCore::GlyphPage::createForSingleFont): Deleted.
3035         (WebCore::GlyphPage::isImmutable): Deleted.
3036         (WebCore::GlyphPage::setImmutable): Deleted.
3037         (WebCore::GlyphPage::glyphAt): Deleted.
3038         (WebCore::GlyphPage::fontForCharacter): Deleted.
3039         (WebCore::GlyphPage::setGlyphDataForCharacter): Deleted.
3040         (WebCore::GlyphPage::setGlyphDataForIndex): Deleted.
3041         (WebCore::GlyphPage::hasPerGlyphFontData): Deleted.
3042         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
3043         (WebCore::GlyphPage::fill):
3044         * platform/graphics/mac/GlyphPageMac.cpp:
3045         (WebCore::GlyphPage::fill):
3046         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
3047         (WebCore::OpenTypeVerticalData::substituteWithVerticalGlyphs):
3048         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
3049         (WebCore::GlyphPage::fill):
3050         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
3051         (WebCore::GlyphPage::fill):
3052         * svg/SVGFontData.cpp:
3053         (WebCore::SVGFontData::applySVGGlyphSelection):
3054         (WebCore::SVGFontData::fillSVGGlyphPage):
3055         (WebCore::SVGFontData::fillBMPGlyphs):
3056         (WebCore::SVGFontData::fillNonBMPGlyphs):
3057         * svg/SVGFontData.h:
3058         (WebCore::SVGFontData::verticalAdvanceY):
3059
3060 2015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
3061
3062         [css-grid] Percentage columns shouldn't include border and padding
3063         https://bugs.webkit.org/show_bug.cgi?id=148978
3064
3065         Reviewed by Sergio Villar Senin.
3066
3067         Subtract border and padding when we're calculating the breadth of the
3068         columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
3069
3070         Added test to check the behavior for both columns and rows.
3071
3072         Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
3073
3074         * rendering/RenderGrid.cpp:
3075         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
3076
3077 2015-09-09  Chris Dumez  <cdumez@apple.com>
3078
3079         HTMLTableElement.tHead / tFoot / caption should be nullable
3080         https://bugs.webkit.org/show_bug.cgi?id=148991
3081
3082         Reviewed by Ryosuke Niwa.
3083
3084         According to the specification, HTMLTableElement.tHead / tFoot / caption
3085         should be nullable:
3086         https://html.spec.whatwg.org/multipage/tables.html#htmltableelement
3087
3088         Upon assigning null, we are supposed to remove the existing tHead / tFoot
3089         / caption element. However, we had a bug causing us to throw an exception
3090         after removing the element. This is because we would try to insert a null
3091         element and ContainerNode::insertBefore() throws when doing so.
3092
3093         Also, as per the specification, setting tHead / tFoot to something else
3094         than a thead / tfoot element should throw a HierarchyRequestError:
3095         https://html.spec.whatwg.org/multipage/tables.html#dom-table-thead
3096         https://html.spec.whatwg.org/multipage/tables.html#dom-table-tfoot
3097
3098         Previously, WebKit did not check the tag and was happy inserting the
3099         element as long as it was an HTMLTableSectionElement. This means that
3100         you could set a tfoot by assigning table.tHead.
3101
3102         This patch corrects both bugs and adds test coverage for it.
3103
3104         Test: fast/dom/HTMLTableElement/nullable-attributes.html
3105
3106         * html/HTMLTableElement.cpp:
3107         (WebCore::HTMLTableElement::setCaption):
3108         Only call insertBefore() if newCaption is not null as insertBefore()
3109         will throw an exception otherwise.
3110
3111         (WebCore::HTMLTableElement::setTHead):
3112         - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
3113           null or a <thead> element, as per the specification.
3114         - Only call insertBefore() if newHead is not null as insertBefore()
3115           will throw an exception otherwise.
3116
3117         (WebCore::HTMLTableElement::setTFoot):
3118         - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
3119           null or a <tfoot> element, as per the specification.
3120         - Only call insertBefore() if newFoot is not null as insertBefore()
3121           will throw an exception otherwise.
3122
3123         * html/HTMLTableElement.idl:
3124         Use [StrictTypeChecking] for these 3 attributes so that the bindings
3125         will throw a TypeError if the JS tries to assign a value with the
3126         wrong type. When the implementation is called with null, we now know
3127         this is because the JS assigned null (and not an invalid value).
3128         This is important as assigning null is valid since those attributes
3129         are nullable.
3130
3131 2015-06-26  Sergio Villar Senin  <svillar@igalia.com>
3132
3133         min-width/height should default to auto for flexbox items
3134         https://bugs.webkit.org/show_bug.cgi?id=146020
3135
3136         Reviewed by David Hyatt.
3137
3138         Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
3139
3140         As specified here
3141         http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
3142         value of min-{width|height} is auto for flex items.
3143
3144         In case this patch breaks any website (as it's changing the
3145         default value of those properties) the fix is likely to add:
3146
3147         min-width: 0;
3148         min-height: 0;
3149
3150         to any relevant flexitems.
3151
3152         Test: css3/flexbox/min-size-auto.html
3153
3154         * css/CSSComputedStyleDeclaration.cpp:
3155         (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
3156         (WebCore::ComputedStyleExtractor::propertyValue): Return auto
3157         for flex items if min-width/height is auto.
3158         * css/CSSParser.cpp:
3159         (WebCore::CSSParser::parseValue):
3160         * html/shadow/SliderThumbElement.cpp:
3161         * rendering/RenderBox.cpp:
3162         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
3163         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
3164         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
3165         (WebCore::RenderBox::computeLogicalHeight):
3166         (WebCore::RenderBox::computeLogicalHeightUsing):
3167         (WebCore::RenderBox::computeContentLogicalHeight):
3168         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
3169         (WebCore::RenderBox::computeReplacedLogicalWidth):
3170         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
3171         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
3172         (WebCore::RenderBox::computeReplacedLogicalHeight):
3173         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
3174         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
3175         (WebCore::RenderBox::availableLogicalHeightUsing):
3176         (WebCore::RenderBox::computePositionedLogicalWidth):
3177         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
3178         (WebCore::RenderBox::computePositionedLogicalHeight):
3179         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
3180         * rendering/RenderBox.h:
3181         * rendering/RenderButton.h:
3182         * rendering/RenderFlexibleBox.cpp:
3183         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
3184         (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
3185         (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
3186         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
3187         (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
3188         * rendering/RenderFlexibleBox.h:
3189         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
3190         * rendering/RenderFullScreen.h:
3191         * rendering/RenderGrid.cpp:
3192         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
3193         * rendering/RenderMediaControlElements.h:
3194         * rendering/RenderMenuList.cpp:
3195         (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
3196         the min-width explicitly.
3197         * rendering/RenderMenuList.h:
3198         * rendering/RenderMultiColumnSet.cpp:
3199         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
3200         * rendering/RenderNamedFlowFragment.cpp:
3201         (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
3202         * rendering/RenderReplaced.cpp:
3203         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
3204         (WebCore::RenderReplaced::computeReplacedLogicalHeight):
3205         * rendering/RenderSlider.h:
3206         * rendering/RenderTextControl.h:
3207         * rendering/RenderTextControlSingleLine.cpp:
3208         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
3209         the min-width explicitly.
3210         * rendering/mathml/RenderMathMLBlock.h:
3211         * rendering/style/RenderStyle.h:
3212
3213 2015-09-08  Joseph Pecoraro  <pecoraro@apple.com>
3214
3215         Web Inspector: No need for [Custom] Implementation of some InspectorFrontendHost methods
3216         https://bugs.webkit.org/show_bug.cgi?id=148990
3217
3218         Reviewed by Timothy Hatcher.
3219
3220         * bindings/js/JSInspectorFrontendHostCustom.cpp:
3221         (WebCore::JSInspectorFrontendHost::platform): Deleted.
3222         (WebCore::JSInspectorFrontendHost::port): Deleted.
3223         * inspector/InspectorFrontendHost.cpp:
3224         (WebCore::InspectorFrontendHost::platform):
3225         (WebCore::InspectorFrontendHost::port):
3226         * inspector/InspectorFrontendHost.h:
3227         * inspector/InspectorFrontendHost.idl:
3228         Uncustomize a few basic functions.
3229
3230 2015-09-08  Michael Catanzaro  <mcatanzaro@igalia.com>
3231
3232         Crash when WebCore::SQLiteFileSystem::openDatabase is called from multiple threads
3233         https://bugs.webkit.org/show_bug.cgi?id=143245
3234
3235         Reviewed by Darin Adler.
3236
3237         sqlite3_initialize is documented to be thread-safe, and to be called automatically by the
3238         library when needed, so applications should never need to call it directly. The problem is,
3239         it's not thread-safe: we have documented instances of GNOME Builder, Devhelp, Epiphany, and
3240         cinnamon-screensaver crashing when sqlite3_initialize is called simultaneously in separate
3241         threads (usually inside sqlite3_open). So call it manually, guarded using std::call_once, to
3242         make sure that the library is fully initialized before the first call to sqlite3_open. It's
3243         a good idea to do this regardless, because the documentation says it could be required in
3244         a future release of SQLite. (Though the use of std::call_once should not be needed, and is
3245         only used to attempt to work around the crashes.)
3246
3247         This is a workaround for an SQLite bug that might have been fixed upstream, but the SQLite
3248         developers are not really confident in the thread-safety of this function, and have advised
3249         that we carry the workaround. Seems like a good idea.
3250
3251         * platform/sql/SQLiteDatabase.cpp:
3252         (WebCore::SQLiteDatabase::SQLiteDatabase):
3253
3254 2015-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
3255
3256         Unify symbolTablePut in JSLexicalEnvironment and JSSymbolTableObject
3257         https://bugs.webkit.org/show_bug.cgi?id=148783
3258
3259         Reviewed by Geoffrey Garen.
3260
3261         No behavior change.
3262
3263         * bindings/js/JSDOMWindowBase.cpp:
3264         (WebCore::JSDOMWindowBase::updateDocument):
3265
3266 2015-09-08  Brian Burg  <bburg@apple.com>
3267
3268         Several inspector-protocol tests are flaky with GuardMalloc
3269         https://bugs.webkit.org/show_bug.cgi?id=136715
3270
3271         Reviewed by Joseph Pecoraro.
3272
3273         Sometimes, the async dispatch task can outlive its owning frontend client.
3274         To avoid problems, make it refcounted instead and add a protector reference.
3275
3276         No new tests, covered by existing tests.
3277
3278         * inspector/InspectorFrontendClientLocal.cpp:
3279         (WebCore::InspectorBackendDispatchTask::create):
3280         (WebCore::InspectorBackendDispatchTask::dispatch):
3281         (WebCore::InspectorBackendDispatchTask::reset):
3282         (WebCore::InspectorBackendDispatchTask::timerFired):
3283         (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
3284         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
3285         (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
3286         * inspector/InspectorFrontendClientLocal.h:
3287
3288 2015-09-08  Chris Dumez  <cdumez@apple.com>
3289
3290         new Comment(undefined) / new Text(undefined) should use default's empty string
3291         https://bugs.webkit.org/show_bug.cgi?id=148973
3292         <rdar://problem/22548042>
3293
3294         Reviewed by Ryosuke Niwa.
3295
3296         new Comment(undefined) / new Text(undefined) should use default's empty string instead of converting
3297         undefined to the "undefined" string:
3298         - https://dom.spec.whatwg.org/#interface-comment (parameter is optional, default value is empty String)
3299         - https://dom.spec.whatwg.org/#text (ditto)
3300
3301         undefined should be treated as if the parameter is missing, in the case the parameter is optional, as
3302         per the Web IDL specification. This patch aligns WebKit's behavior with the specification and the
3303         behavior of Firefox and Chrome.
3304
3305         No new tests, already covered by existing tests.
3306
3307         * bindings/scripts/CodeGeneratorJS.pm:
3308         (GenerateParametersCheck):
3309         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3310         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
3311         * bindings/scripts/test/JS/JSTestObj.cpp:
3312         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
3313
3314 2015-09-08  Chris Dumez  <cdumez@apple.com>
3315
3316         document.importNode(node, deep): deep's default value should be false
3317         https://bugs.webkit.org/show_bug.cgi?id=148959
3318         <rdar://problem/22558915>
3319
3320         Reviewed by Alexey Proskuryakov.
3321
3322         Switch deep parameter's default value for document.importNode() to
3323         false, as per the latest DOM specification:
3324         - https://dom.spec.whatwg.org/#interface-document
3325         - https://dom.spec.whatwg.org/#dom-document-importnode
3326
3327         Firefox and Chrome follow the specification. However, WebKit was using
3328         "true" for deep's default value.
3329
3330         No new tests, already covered by:
3331         imported/w3c/web-platform-tests/dom/nodes/Document-importNode.html
3332
3333         * dom/Document.h:
3334         (WebCore::Document::importNode):
3335
3336 2015-09-08  Per Arne Vollan  <peavo@outlook.com>
3337
3338         [Win][HighDPI] Video window placement is incorrect.
3339         https://bugs.webkit.org/show_bug.cgi?id=148954
3340
3341         Reviewed by Alex Christensen.
3342
3343         We need to scale window dimensions with device scale factor.
3344
3345         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3346         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
3347
3348 2015-09-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3349
3350         Reduce uses of PassRefPtr in fileapi
3351         https://bugs.webkit.org/show_bug.cgi?id=148952
3352
3353         Reviewed by Andreas Kling.
3354
3355         Remove all uses of PassRefPtr in return type. Argument uses of PassRefPtr will be
3356         removed in near future.
3357
3358         * fileapi/FileError.h:
3359         (WebCore::FileError::create):
3360         * fileapi/FileReader.cpp:
3361         (WebCore::FileReader::arrayBufferResult):
3362         * fileapi/FileReader.h:
3363         * fileapi/FileReaderLoader.cpp:
3364         (WebCore::FileReaderLoader::arrayBufferResult):
3365         * fileapi/FileReaderLoader.h:
3366         * fileapi/FileReaderSync.cpp:
3367         (WebCore::FileReaderSync::readAsArrayBuffer):
3368         * fileapi/FileReaderSync.h:
3369         * fileapi/ThreadableBlobRegistry.cpp:
3370         (WebCore::ThreadableBlobRegistry::getCachedOrigin):
3371         * fileapi/ThreadableBlobRegistry.h:
3372
3373 2015-09-07  Chris Fleizach  <cfleizach@apple.com>
3374
3375         AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
3376         https://bugs.webkit.org/show_bug.cgi?id=148891
3377
3378         Reviewed by Mario Sanchez Prada.
3379
3380         Undo the asynchronous dispatch of accessibility setting values on pre El Capitan machines
3381         because it causes focus to not sync correctly.
3382
3383         Test: accessibility/mac/focus-moves-cursor.html
3384
3385         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3386         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
3387         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3388
3389 2015-09-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3390
3391         [CoordinatedGraphics] Remove ScrollingStateScrollingNodeCoordinatedGraphics.cpp
3392         https://bugs.webkit.org/show_bug.cgi?id=148931
3393
3394         Reviewed by Csaba Osztrogon√°c.
3395
3396         ScrollingStateScrollingNodeCoordinatedGraphics.cpp implements nothing. Removed it.
3397
3398         * PlatformEfl.cmake:
3399         * PlatformGTK.cmake:
3400         * WebCore.vcxproj/WebCore.vcxproj:
3401         * WebCore.vcxproj/WebCore.vcxproj.filters:
3402         * page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp: Removed.
3403
3404 2015-09-07  Daniel Bates  <dabates@apple.com>
3405
3406         ASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::get(); update form
3407         association after subtree insertion
3408         https://bugs.webkit.org/show_bug.cgi?id=148919
3409         <rdar://problem/21868036>
3410
3411         Reviewed by Andy Estes.
3412
3413         Currently we update the form association of a form control upon insertion into
3414         the document. Instead we should update the form association of a form control
3415         after its containing subtree is inserted into the document to avoid an assertion
3416         failure when the containing subtree has an element whose id is identical to both
3417         the id of some other element in the document and the name of the form referenced
3418         by the inserted form control.
3419
3420         Tests: fast/forms/update-form-owner-in-moved-subtree-assertion-failure-2.html
3421                fast/forms/update-form-owner-in-moved-subtree-assertion-failure-3.html
3422                fast/forms/update-form-owner-in-moved-subtree-assertion-failure-4.html
3423                fast/forms/update-form-owner-in-moved-subtree-assertion-failure.html
3424
3425         * html/FormAssociatedElement.cpp:
3426         (WebCore::FormAssociatedElement::insertedInto): Moved resetFormOwner() from here
3427         to {HTMLFormControlElement, HTMLObjectElement}::finishedInsertingSubtree().
3428         * html/HTMLFormControlElement.cpp:
3429         (WebCore::HTMLFormControlElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree
3430         so that HTMLFormControlElement::finishedInsertingSubtree() is called.
3431         (WebCore::HTMLFormControlElement::finishedInsertingSubtree): Added; turn around and
3432         call FormAssociatedElement::resetFormOwner().
3433         * html/HTMLFormControlElement.h:
3434         * html/HTMLInputElement.cpp:
3435         (WebCore::HTMLInputElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
3436         that HTMLInputElement::finishedInsertingSubtree() is called and move logic to update radio button
3437         group from here...
3438         (WebCore::HTMLInputElement::finishedInsertingSubtree): to here.
3439         * html/HTMLInputElement.h:
3440         * html/HTMLObjectElement.cpp:
3441         (WebCore::HTMLObjectElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
3442         that HTMLObjectElement::finishedInsertingSubtree() is called.
3443         (WebCore::HTMLObjectElement::finishedInsertingSubtree): Added; turn around and
3444         call FormAssociatedElement::resetFormOwner().
3445         * html/HTMLObjectElement.h:
3446         * html/HTMLSelectElement.cpp:
3447         (WebCore::HTMLSelectElement::insertedInto): Modified to return the result of
3448         HTMLFormControlElementWithState::insertedInto(), which may schedule a callback after subtree
3449         insertion.
3450         * html/HTMLTextFormControlElement.cpp:
3451         (WebCore::HTMLTextFormControlElement::insertedInto): Ditto.
3452
3453 2015-09-07  Antti Koivisto  <antti@apple.com>
3454
3455         Remove GlyphPage::mayUseMixedFontsWhenFilling
3456         https://bugs.webkit.org/show_bug.cgi?id=148928
3457
3458         Reviewed by Dan Bernstein.
3459
3460         http://trac.webkit.org/188566 removed support for composite fonts. We never need to use mixed
3461         glyph pages for fonts anymore.
3462
3463         * platform/graphics/Font.cpp:
3464         (WebCore::createAndFillGlyphPage):
3465         * platform/graphics/GlyphPage.h:
3466         (WebCore::GlyphPage::GlyphPage):
3467         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
3468         * platform/graphics/mac/GlyphPageMac.cpp:
3469         (WebCore::shouldUseCoreText):
3470         (WebCore::GlyphPage::fill):
3471         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
3472
3473 2015-09-07  Antti Koivisto  <antti@apple.com>
3474
3475         Remove unneeded offset and length arguments from glyph page filling functions
3476         https://bugs.webkit.org/show_bug.cgi?id=148929
3477
3478         Reviewed by Andreas Kling.
3479
3480         They are always passed 0/GlyphPage::size.
3481
3482         * platform/graphics/Font.cpp:
3483         (WebCore::Font::~Font):
3484         (WebCore::fillGlyphPage):
3485         (WebCore::createAndFillGlyphPage):
3486         * platform/graphics/Font.h:
3487         * platform/graphics/GlyphPage.h:
3488         (WebCore::GlyphPage::setGlyphDataForIndex):
3489         * platform/graphics/mac/GlyphPageMac.cpp:
3490         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling):
3491         (WebCore::GlyphPage::fill):
3492         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
3493         (WebCore::GlyphPage::fill):
3494         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
3495         (WebCore::GlyphPage::fill):
3496         * svg/SVGFontData.cpp:
3497         (WebCore::SVGFontData::applySVGGlyphSelection):
3498         (WebCore::SVGFontData::fillSVGGlyphPage):
3499         (WebCore::SVGFontData::fillBMPGlyphs):
3500         (WebCore::SVGFontData::fillNonBMPGlyphs):
3501         * svg/SVGFontData.h:
3502         (WebCore::SVGFontData::verticalAdvanceY):
3503
3504 2015-09-06  Chris Dumez  <cdumez@apple.com>
3505
3506         dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
3507         https://bugs.webkit.org/show_bug.cgi?id=148800
3508         <rdar://problem/22565782>
3509         <rdar://problem/22565485>
3510
3511         Reviewed by Geoffrey Garen.
3512
3513         dispatchEvent() should throw an InvalidStateError if the event's
3514         initialized flag is not set or its dispatch flag is set, and should
3515         allow dispatching events with an empty type as long as it is
3516         initialized:
3517         https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
3518
3519         Previously, WebKit relied on the event type being empty to throw a
3520         UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
3521         exception type is outdated and initializing Event.type to an empty
3522         string is legal.
3523
3524         No new tests, already covered by existing tests that were rebaselined.
3525
3526         * dom/Event.cpp:
3527         (WebCore::Event::Event):
3528         (WebCore::Event::initEvent):
3529         * dom/Event.h:
3530         (WebCore::Event::isInitialized):
3531         * dom/EventTarget.cpp:
3532         (WebCore::EventTarget::dispatchEvent):
3533
3534 2015-09-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3535
3536         XHR2 timeout property should allow late updates
3537         https://bugs.webkit.org/show_bug.cgi?id=98156
3538
3539         Reviewed by Darin Adler.
3540
3541         Adding a timer within XMLHttpRequest to handle timeouts for asynchronous requests.
3542         This allows easy update of the timeout even after request is sent.
3543         Timeout is still handled by the network backend for synchronous requests (Web worker context).
3544
3545         Covered by updated tests.
3546
3547         * xml/XMLHttpRequest.cpp:
3548         (WebCore::XMLHttpRequest::XMLHttpRequest): Adding timeout timer initialization.
3549         (WebCore::XMLHttpRequest::setTimeout): Updating timeout timer state if request is sent.
3550         (WebCore::XMLHttpRequest::createRequest): Starting timeout timer if needed.
3551         (WebCore::XMLHttpRequest::internalAbort): Stopping timeout timer if needed.
3552         (WebCore::XMLHttpRequest::didFail): Adding comment.
3553         (WebCore::XMLHttpRequest::didFinishLoading): Stopping timeout timer if needed.
3554         * xml/XMLHttpRequest.h:
3555
3556 2015-09-05  Jaehun Lim  <ljaehun.lim@samsung.com>
3557
3558         Remove unused macros from StyleResolver.cpp
3559         https://bugs.webkit.org/show_bug.cgi?id=148163
3560
3561         Reviewed by Andreas Kling.
3562
3563         HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL are not used after
3564         StyleBuilder refactoring.
3565
3566         No new tests because there is no behavior change.
3567
3568         * css/StyleResolver.cpp:
3569         Remove HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL.
3570
3571 2015-09-05  Brian Burg  <bburg@apple.com>
3572
3573         Web Inspector: tighten up lifetimes for Agent-owned objects, and initialize agents using contexts
3574         https://bugs.webkit.org/show_bug.cgi?id=148625
3575
3576         Reviewed by Joseph Pecoraro.
3577
3578         All agents own their domain-specific frontend and backend dispatchers. Change so that
3579         they are initialized in constructors rather than when a frontend connects or disconnects.
3580         This may cause additional memory use, but this can be counteracted by lazily creating
3581         some agents that are not required for other agents to function (i.e., runtime and page agents).
3582
3583         To avoid adding frontend/backend dispatcher arguments to every single agent constructor,
3584         change agent construction to take a AgentContext or a subclass of it. This provides agents with
3585         references to objects in the owning InspectorEnvironment subclass that are guaranteed to
3586         outlive all agents. AgentContext and its subclasses follow the existing Agent class hierarchy.
3587
3588         No new tests, no behavior changed.
3589
3590         * bindings/js/WorkerScriptDebugServer.cpp:
3591         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
3592         (WebCore::WorkerScriptDebugServer::addListener):
3593         (WebCore::WorkerScriptDebugServer::removeListener):
3594         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
3595         * bindings/js/WorkerScriptDebugServer.h:
3596         * inspector/InspectorApplicationCacheAgent.cpp:
3597         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
3598         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
3599         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
3600         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
3601         * inspector/InspectorApplicationCacheAgent.h:
3602         * inspector/InspectorCSSAgent.cpp:
3603         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
3604         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
3605         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
3606         * inspector/InspectorCSSAgent.h:
3607         * inspector/InspectorController.cpp:
3608         (WebCore::InspectorController::InspectorController):
3609         * inspector/InspectorDOMAgent.cpp:
3610         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
3611         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
3612         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
3613         * inspector/InspectorDOMAgent.h:
3614         * inspector/InspectorDOMDebuggerAgent.cpp:
3615         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
3616         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
3617         (WebCore::InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend):
3618         * inspector/InspectorDOMDebuggerAgent.h:
3619         * inspector/InspectorDOMStorageAgent.cpp:
3620         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
3621         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
3622         (WebCore::InspectorDOMStorageAgent::findStorageArea):
3623         (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend):
3624         * inspector/InspectorDOMStorageAgent.h:
3625         * inspector/InspectorDatabaseAgent.cpp:
3626         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
3627         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
3628         (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend):
3629         * inspector/InspectorDatabaseAgent.h:
3630         * inspector/InspectorIndexedDBAgent.cpp:
3631         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
3632         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
3633         (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend):
3634         * inspector/InspectorIndexedDBAgent.h:
3635         * inspector/InspectorInstrumentation.cpp:
3636         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
3637         * inspector/InspectorLayerTreeAgent.cpp:
3638         (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
3639         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
3640         (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend):
3641         * inspector/InspectorLayerTreeAgent.h:
3642         * inspector/InspectorPageAgent.cpp:
3643         (WebCore::InspectorPageAgent::InspectorPageAgent):
3644         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
3645         (WebCore::InspectorPageAgent::enable):
3646         (WebCore::InspectorPageAgent::reload):
3647         (WebCore::InspectorPageAgent::navigate):
3648         (WebCore::InspectorPageAgent::getCookies):
3649         (WebCore::InspectorPageAgent::deleteCookie):
3650         (WebCore::InspectorPageAgent::getResourceTree):
3651         (WebCore::InspectorPageAgent::searchInResources):
3652         (WebCore::InspectorPageAgent::getScriptExecutionStatus):
3653         (WebCore::InspectorPageAgent::setScriptExecutionDisabled):
3654         (WebCore::InspectorPageAgent::mainFrame):
3655         (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
3656         (WebCore::InspectorPageAgent::buildObjectForFrame):
3657         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
3658         (WebCore::InspectorPageAgent::setEmulatedMedia):
3659         (WebCore::InspectorPageAgent::getCompositingBordersVisible):
3660         (WebCore::InspectorPageAgent::setCompositingBordersVisible):
3661         (WebCore::InspectorPageAgent::snapshotNode):
3662         (WebCore::InspectorPageAgent::snapshotRect):
3663         (WebCore::InspectorPageAgent::archive):
3664         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
3665         * inspector/InspectorPageAgent.h:
3666         * inspector/InspectorReplayAgent.cpp:
3667         (WebCore::InspectorReplayAgent::InspectorReplayAgent):
3668         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
3669         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
3670         * inspector/InspectorReplayAgent.h:
3671         * inspector/InspectorResourceAgent.cpp:
3672         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
3673         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
3674         (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend):
3675         * inspector/InspectorResourceAgent.h:
3676         * inspector/InspectorTimelineAgent.cpp:
3677         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
3678         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
3679         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
3680         (WebCore::InspectorTimelineAgent::page):
3681         * inspector/InspectorTimelineAgent.h:
3682         * inspector/InspectorWebAgentBase.h:
3683         (WebCore::WebAgentContext::WebAgentContext):
3684         (WebCore::PageAgentContext::PageAgentContext):
3685         (WebCore::WorkerAgentContext::WorkerAgentContext):
3686         (WebCore::InspectorAgentBase::InspectorAgentBase):
3687         * inspector/InspectorWorkerAgent.cpp:
3688         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
3689         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
3690         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
3691         * inspector/InspectorWorkerAgent.h:
3692         * inspector/PageConsoleAgent.cpp:
3693         (WebCore::PageConsoleAgent::PageConsoleAgent):
3694         * inspector/PageConsoleAgent.h:
3695         * inspector/PageDebuggerAgent.cpp:
3696         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
3697         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
3698         (WebCore::PageDebuggerAgent::breakpointActionLog):
3699         (WebCore::PageDebuggerAgent::injectedScriptForEval):
3700         * inspector/PageDebuggerAgent.h:
3701         * inspector/PageRuntimeAgent.cpp:
3702         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
3703         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
3704         (WebCore::PageRuntimeAgent::injectedScriptForEval):
3705         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
3706         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend):
3707         * inspector/PageRuntimeAgent.h:
3708         * inspector/WebConsoleAgent.cpp:
3709         (WebCore::WebConsoleAgent::WebConsoleAgent):
3710         * inspector/WebConsoleAgent.h:
3711         * inspector/WebDebuggerAgent.cpp:
3712         (WebCore::WebDebuggerAgent::WebDebuggerAgent):
3713         * inspector/WebDebuggerAgent.h:
3714         * inspector/WorkerConsoleAgent.cpp:
3715         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
3716         * inspector/WorkerConsoleAgent.h:
3717         * inspector/WorkerDebuggerAgent.cpp:
3718         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
3719         (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
3720         (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
3721         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
3722         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
3723         * inspector/WorkerDebuggerAgent.h:
3724         * inspector/WorkerInspectorController.cpp:
3725         (WebCore::WorkerInspectorController::WorkerInspectorController):
3726         * inspector/WorkerRuntimeAgent.cpp:
3727         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
3728         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
3729         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
3730         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
3731         * inspector/WorkerRuntimeAgent.h:
3732
3733 2015-09-04  Brian Burg  <bburg@apple.com>
3734
3735         Web Inspector: agents should send messages through FrontendRouter instead of FrontendChannel
3736         https://bugs.webkit.org/show_bug.cgi?id=148492
3737
3738         Reviewed by Joseph Pecoraro.
3739
3740         Replace uses of FrontendChannel with FrontendRouter. Minor code cleanup along the way.
3741
3742         No new tests, no behavior changed.
3743
3744         * WebCore.vcxproj/WebCore.vcxproj:
3745         * WebCore.vcxproj/WebCore.vcxproj.filters:
3746         * WebCore.xcodeproj/project.pbxproj:
3747         * inspector/InspectorApplicationCacheAgent.cpp:
3748         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
3749         * inspector/InspectorApplicationCacheAgent.h:
3750         * inspector/InspectorCSSAgent.cpp:
3751         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
3752         * inspector/InspectorCSSAgent.h:
3753         * inspector/InspectorController.cpp:
3754         (WebCore::InspectorController::connectFrontend):
3755         (WebCore::InspectorController::~InspectorController): No need to call discardAgents().
3756         * inspector/InspectorDOMAgent.cpp:
3757         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
3758         * inspector/InspectorDOMAgent.h:
3759         * inspector/InspectorDOMDebuggerAgent.cpp:
3760         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
3761         * inspector/InspectorDOMDebuggerAgent.h:
3762         * inspector/InspectorDOMStorageAgent.cpp:
3763         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
3764         * inspector/InspectorDOMStorageAgent.h:
3765         * inspector/InspectorDatabaseAgent.cpp:
3766         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
3767         * inspector/InspectorDatabaseAgent.h:
3768         * inspector/InspectorForwarding.h: Removed.
3769         * inspector/InspectorIndexedDBAgent.cpp:
3770         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
3771         * inspector/InspectorIndexedDBAgent.h:
3772         * inspector/InspectorLayerTreeAgent.cpp:
3773         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
3774         * inspector/InspectorLayerTreeAgent.h:
3775         * inspector/InspectorPageAgent.cpp:
3776         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
3777         * inspector/InspectorPageAgent.h:
3778         * inspector/InspectorReplayAgent.cpp:
3779         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
3780         * inspector/InspectorReplayAgent.h:
3781         * inspector/InspectorResourceAgent.cpp:
3782         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
3783         * inspector/InspectorResourceAgent.h:
3784         * inspector/InspectorTimelineAgent.cpp:
3785         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
3786         * inspector/InspectorTimelineAgent.h:
3787         * inspector/InspectorWebAgentBase.h:
3788         * inspector/InspectorWorkerAgent.cpp:
3789         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
3790         * inspector/InspectorWorkerAgent.h:
3791         * inspector/PageRuntimeAgent.cpp:
3792         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
3793         * inspector/PageRuntimeAgent.h:
3794         * inspector/WorkerInspectorController.cpp:
3795         (WebCore::WorkerInspectorController::connectFrontend):
3796         * inspector/WorkerInspectorController.h:
3797         * inspector/WorkerRuntimeAgent.cpp:
3798         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
3799         * inspector/WorkerRuntimeAgent.h:
3800         * page/PageDebuggable.cpp:
3801         * testing/Internals.cpp:
3802
3803 2015-09-05  Joseph Pecoraro  <pecoraro@apple.com>
3804
3805         Add a new ResourceLoaderOption to avoid page defers loading mechanisms for inspector
3806         https://bugs.webkit.org/show_bug.cgi?id=148727
3807
3808         Reviewed by Antti Koivisto.
3809
3810         This will be tested shortly by inspector tests.
3811
3812         * loader/ResourceLoaderOptions.h:
3813         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
3814         (WebCore::ResourceLoaderOptions::defersLoadingPolicy):
3815         (WebCore::ResourceLoaderOptions::setDefersLoadingPolicy):
3816         Add a new policy for defers loading. The default is to allow defers loading.
3817
3818         * loader/ResourceLoader.cpp:
3819         (WebCore::ResourceLoader::ResourceLoader):
3820         (WebCore::ResourceLoader::init):
3821         (WebCore::ResourceLoader::setDefersLoading):
3822         Respect the defers loading policy whenever we would set defers loading status.
3823
3824         * inspector/InspectorResourceAgent.cpp:
3825         (WebCore::InspectorResourceAgent::loadResource):
3826         Switch from incorrectly changing the defersLoading state of the loader
3827         to setting an option to disallow defers loading entirely for the loader.
3828
3829         * loader/DocumentLoader.cpp:
3830         (WebCore::DocumentLoader::startLoadingMainResource):
3831         * loader/MediaResourceLoader.cpp:
3832         (WebCore::MediaResourceLoader::start):
3833         * loader/NetscapePlugInStreamLoader.cpp:
3834         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
3835         * loader/cache/CachedResourceLoader.cpp:
3836         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3837         (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
3838         * loader/icon/IconLoader.cpp:
3839         (WebCore::IconLoader::startLoading):
3840         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3841         (WebCore::WebCoreAVCFResourceLoader::startLoading):
3842         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3843         (WebCore::WebCoreAVFResourceLoader::startLoading):
3844         Add the new value to instance of the longhand ResourceLoaderOptions constructor.
3845
3846 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
3847
3848         Rename members of CanvasRenderingContext2D::State
3849         https://bugs.webkit.org/show_bug.cgi?id=148889
3850
3851         Reviewed by Tim Horton.
3852
3853         CanvasRenderingContext2D::State is a struct, so its members should not start with m_.
3854
3855         No new tests because there is no behavior change.
3856
3857         * html/canvas/CanvasRenderingContext2D.cpp:
3858         (WebCore::CanvasRenderingContext2D::State::State):
3859         (WebCore::CanvasRenderingContext2D::State::operator=):
3860         (WebCore::CanvasRenderingContext2D::restore):
3861         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
3862         (WebCore::CanvasRenderingContext2D::setFillStyle):
3863         (WebCore::CanvasRenderingContext2D::lineWidth):
3864         (WebCore::CanvasRenderingContext2D::setLineWidth):
3865         (WebCore::CanvasRenderingContext2D::lineCap):
3866         (WebCore::CanvasRenderingContext2D::setLineCap):
3867         (WebCore::CanvasRenderingContext2D::lineJoin):
3868         (WebCore::CanvasRenderingContext2D::setLineJoin):
3869         (WebCore::CanvasRenderingContext2D::miterLimit):
3870         (WebCore::CanvasRenderingContext2D::setMiterLimit):
3871         (WebCore::CanvasRenderingContext2D::shadowOffsetX):
3872         (WebCore::CanvasRenderingContext2D::setShadowOffsetX):
3873         (WebCore::CanvasRenderingContext2D::shadowOffsetY):
3874         (WebCore::CanvasRenderingContext2D::setShadowOffsetY):
3875         (WebCore::CanvasRenderingContext2D::shadowBlur):
3876         (WebCore::CanvasRenderingContext2D::setShadowBlur):
3877         (WebCore::CanvasRenderingContext2D::shadowColor):
3878         (WebCore::CanvasRenderingContext2D::setShadowColor):
3879         (WebCore::CanvasRenderingContext2D::getLineDash):
3880         (WebCore::CanvasRenderingContext2D::setLineDash):
3881         (WebCore::CanvasRenderingContext2D::setWebkitLineDash):
3882         (WebCore::CanvasRenderingContext2D::lineDashOffset):
3883         (WebCore::CanvasRenderingContext2D::setLineDashOffset):
3884         (WebCore::CanvasRenderingContext2D::applyLineDash):
3885         (WebCore::CanvasRenderingContext2D::globalAlpha):
3886         (WebCore::CanvasRenderingContext2D::setGlobalAlpha):
3887         (WebCore::CanvasRenderingContext2D::globalCompositeOperation):
3888         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation):
3889         (WebCore::CanvasRenderingContext2D::scale):
3890         (WebCore::CanvasRenderingContext2D::rotate):
3891         (WebCore::CanvasRenderingContext2D::translate):
3892         (WebCore::CanvasRenderingContext2D::transform):
3893         (WebCore::CanvasRenderingContext2D::setTransform):
3894         (WebCore::CanvasRenderingContext2D::setStrokeColor):
3895         (WebCore::CanvasRenderingContext2D::setFillColor):
3896         (WebCore::CanvasRenderingContext2D::fillInternal):
3897         (WebCore::CanvasRenderingContext2D::strokeInternal):
3898         (WebCore::CanvasRenderingContext2D::clipInternal):
3899         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
3900         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
3901         (WebCore::CanvasRenderingContext2D::clearRect):
3902         (WebCore::CanvasRenderingContext2D::fillRect):
3903         (WebCore::CanvasRenderingContext2D::strokeRect):
3904         (WebCore::CanvasRenderingContext2D::setShadow):
3905         (WebCore::CanvasRenderingContext2D::applyShadow):
3906         (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
3907         (WebCore::CanvasRenderingContext2D::drawImage):
3908         (WebCore::CanvasRenderingContext2D::transformAreaToDevice):
3909         (WebCore::CanvasRenderingContext2D::rectContainsCanvas):
3910         (WebCore::CanvasRenderingContext2D::compositeBuffer):
3911         (WebCore::CanvasRenderingContext2D::didDraw):
3912         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
3913         (WebCore::CanvasRenderingContext2D::font):
3914         (WebCore::CanvasRenderingContext2D::setFont):
3915         (WebCore::CanvasRenderingContext2D::textAlign):
3916         (WebCore::CanvasRenderingContext2D::setTextAlign):
3917         (WebCore::CanvasRenderingContext2D::textBaseline):
3918         (WebCore::CanvasRenderingContext2D::setTextBaseline):
3919         (WebCore::CanvasRenderingContext2D::direction):
3920         (WebCore::CanvasRenderingContext2D::setDirection):
3921         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3922         (WebCore::CanvasRenderingContext2D::inflateStrokeRect):
3923         (WebCore::CanvasRenderingContext2D::imageSmoothingEnabled):
3924         (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled):
3925         * html/canvas/CanvasRenderingContext2D.h:
3926
3927 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
3928
3929         Crash when font completes downloading after calling 2D canvas setText() multiple times
3930         https://bugs.webkit.org/show_bug.cgi?id=148789
3931
3932         Reviewed by Darin Adler.
3933
3934         The CSSFontSelector has a list of clients, and when fonts complete downloading, these
3935         clients get a call back. CanvasRenderingContext2D::State is one such of these clients. However,
3936         the CSSFontSelector may be destroyed and recreated at any time. We were getting into a case
3937         where multiple CSSFontSelectors were thinking that the same CanvasRenderingContext2D::State were
3938         their client. When the CanvasRenderingContext2D::State was destroyed, it only unregistered
3939         itself from one of the CSSFontSelectors, which means the CSSFontSelector left over has a dangling
3940         pointer to it.
3941
3942         The solution is to implement a new helper class, FontProxy, to hold the
3943         CanvasRenderingContext2D::State's font, and maintain the invariant that this object is always
3944         registered to exactly one CSSFontSelector, and this CSSFontSelector is the one which is associated
3945         with the FontProxy's FontCascade object. This patch maintains this invariant, as well as protecting
3946         all access to the State's FontCascade object so no one can reach in and change it without going
3947         through functions which maintain the invariant.
3948
3949         Test: fast/canvas/font-selector-crash.html
3950
3951         * css/CSSFontSelector.cpp:
3952         (WebCore::CSSFontSelector::registerForInvalidationCallbacks):
3953         (WebCore::CSSFontSelector::unregisterForInvalidationCallbacks):
3954         (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
3955         * css/CSSFontSelector.h:
3956         * dom/Document.cpp:
3957         (WebCore::Document::fontsNeedUpdate):
3958         (WebCore::Document::fontSelector):
3959         (WebCore::Document::clearStyleResolver):
3960         * dom/Document.h:
3961         * html/canvas/CanvasRenderingContext2D.cpp:
3962         (WebCore::CanvasRenderingContext2D::State::State):
3963         (WebCore::CanvasRenderingContext2D::State::operator=):
3964         (WebCore::CanvasRenderingContext2D::FontProxy::~FontProxy):
3965         (WebCore::CanvasRenderingContext2D::FontProxy::FontProxy):
3966         (WebCore::CanvasRenderingContext2D::FontProxy::update):
3967         (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate):
3968         (WebCore::CanvasRenderingContext2D::FontProxy::initialize):
3969         (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
3970         (WebCore::CanvasRenderingContext2D::FontProxy::fontDescription):
3971         (WebCore::CanvasRenderingContext2D::FontProxy::width):
3972         (WebCore::CanvasRenderingContext2D::FontProxy::drawBidiText):
3973         (WebCore::CanvasRenderingContext2D::font):
3974         (WebCore::CanvasRenderingContext2D::setFont):
3975         (WebCore::CanvasRenderingContext2D::measureText):
3976         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3977         (WebCore::CanvasRenderingContext2D::State::~State): Deleted.
3978         (WebCore::CanvasRenderingContext2D::State::fontsNeedUpdate): Deleted.
3979         (WebCore::CanvasRenderingContext2D::accessFont): Deleted.
3980         * html/canvas/CanvasRenderingContext2D.h:
3981         * platform/graphics/FontSelector.h:
3982
3983 2015-09-04  Commit Queue  <commit-queue@webkit.org>
3984
3985   &nbs