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