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