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