Slot elements should support fallback contents
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-10-01  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Slot elements should support fallback contents
4         https://bugs.webkit.org/show_bug.cgi?id=149701
5
6         Reviewed by Antti Koivisto.
7
8         Following discussions on Github discussions [1] [2], we're adding the default rule of `display: contents`
9         on slot elements and making slot elements render its children when there are no assigned nodes [3].
10
11         Make these changes by attaching renderers on direct-children of slot elements when there are no assigned
12         nodes during render tree construction. Note `display: contents` will be aded in webkit.org/b/149439.
13
14         [1] https://github.com/w3c/webcomponents/issues/317
15         [2] https://github.com/w3c/webcomponents/issues/308
16         [3] https://github.com/w3c/webcomponents/issues/308#issuecomment-143655347
17
18         Tests: fast/shadow-dom/css-scoping-shadow-slot-fallback.html
19                fast/shadow-dom/shadow-layout-after-slot-fallback-changes.html
20
21         * style/StyleResolveTree.cpp:
22         (WebCore::Style::attachSlotAssignees):
23         (WebCore::Style::detachSlotAssignees):
24         (WebCore::Style::resolveSlotAssignees):
25
26 2015-10-01  Brent Fulgham  <bfulgham@apple.com>
27
28         Latch does not clear when a scroll snap animation is triggered
29         https://bugs.webkit.org/show_bug.cgi?id=149681
30         <rdar://problem/22733922>
31
32         Reviewed by Simon Fraser.
33
34         Test: tiled-drawing/scrolling/latched-div-with-scroll-snap.html
35
36         The scroll snap animation logic bypasses some of the normal clean-up code used
37         for wheel event handling. When this happens, the scroll latching state is not
38         cleared. In some cases this "stale" latch state is used when starting a new
39         gesture in the same frame. This causes the wrong page element to receive the
40         mouse wheel events, and hilarity ensues.
41
42         * page/mac/EventHandlerMac.mm:
43         (WebCore::EventHandler::platformNotifyIfEndGesture): Clear latched state when
44         ending the gesture.
45
46 2015-10-01  Brent Fulgham  <bfulgham@apple.com>
47
48         [Win] Unreviewed CMake build fixes.
49
50         * CMakeLists.txt: Match original Windows build flags for WebCoreTest.
51         * PlatformAppleWin.cmake: Use the same build defines as the
52         original Windows build.
53
54 2015-09-30  João Oliveira  <hello@jxs.pt>
55
56         Web Inspector: Adjust font size of Developer Tools using Command,+ or Command,-
57         https://bugs.webkit.org/show_bug.cgi?id=149590
58
59         Reviewed by Joseph Pecoraro.
60
61         Patch by João Oliveira and Brian Burg.
62
63         Expose the frontend page's zoom factor so we can implement relative zoom.
64
65         * inspector/InspectorFrontendHost.cpp:
66         (WebCore::InspectorFrontendHost::zoomFactor): Added.
67         * inspector/InspectorFrontendHost.h:
68         * inspector/InspectorFrontendHost.idl:
69         * page/Frame.h:
70         (WebCore::Frame::pageZoomFactor):
71
72 2015-10-01  Carlos Garcia Campos  <cgarcia@igalia.com>
73
74         [GTK] Websites with invalid auth header keep loading forever
75         https://bugs.webkit.org/show_bug.cgi?id=149710
76
77         Reviewed by Martin Robinson.
78
79         We don't correctly handle a null realm from the server when
80         retrieving and storing credentials from libsecret. First
81         secret_attributes_build() fails because we pass a null domain, and
82         we pass null attributes to secret_service_search() that returns
83         early on a g_return macro and the callback is never called so the
84         load doesn't continue after the auth challenge.
85
86         * platform/network/gtk/CredentialBackingStore.cpp:
87         (WebCore::createAttributeHashTableFromChallenge):
88         (WebCore::CredentialBackingStore::credentialForChallenge):
89         (WebCore::CredentialBackingStore::storeCredentialsForChallenge):
90
91 2015-10-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
92
93         Refactor binding generator to factor JS DOM class m_impl handling
94         https://bugs.webkit.org/show_bug.cgi?id=149660
95
96         Reviewed by Darin Adler.
97
98         Added JSDOMWrapperWithImplementation template class to move m_impl out of the binding generator.
99         Updated custom bindings to use impl() instead of m_impl directly.
100         Updated binding generator accordingly.
101
102         Covered by existing tests and binding tests.
103
104         * bindings/js/JSDOMStringMapCustom.cpp:
105         (WebCore::JSDOMStringMap::getOwnPropertyNames):
106         (WebCore::JSDOMStringMap::deleteProperty):
107         * bindings/js/JSDOMWrapper.h:
108         (WebCore::JSDOMWrapperWithImplementation::impl):
109         (WebCore::JSDOMWrapperWithImplementation::~JSDOMWrapperWithImplementation):
110         (WebCore::JSDOMWrapperWithImplementation::JSDOMWrapperWithImplementation):
111         (WebCore::JSDOMWrapperWithImplementation::releaseImpl):
112         * bindings/js/JSGeolocationCustom.cpp:
113         (WebCore::JSGeolocation::getCurrentPosition):
114         (WebCore::JSGeolocation::watchPosition):
115         * bindings/js/JSSQLResultSetRowListCustom.cpp:
116         (WebCore::JSSQLResultSetRowList::item):
117         * bindings/js/JSSQLTransactionCustom.cpp:
118         (WebCore::JSSQLTransaction::executeSql):
119         * bindings/js/JSStorageCustom.cpp:
120         (WebCore::JSStorage::deleteProperty):
121         (WebCore::JSStorage::getOwnPropertyNames):
122         * bindings/js/JSSubtleCryptoCustom.cpp:
123         (WebCore::JSSubtleCrypto::encrypt):
124         (WebCore::JSSubtleCrypto::decrypt):
125         (WebCore::JSSubtleCrypto::sign):
126         (WebCore::JSSubtleCrypto::verify):
127         (WebCore::JSSubtleCrypto::wrapKey):
128         (WebCore::JSSubtleCrypto::unwrapKey):
129         * bindings/scripts/CodeGeneratorJS.pm:
130         (GetParentClassName):
131         (GetImplClassName):
132         (GenerateHeader):
133         (GenerateImplementation):
134         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
135         (WebCore::JSTestActiveDOMObject::JSTestActiveDOMObject):
136         (WebCore::JSTestActiveDOMObject::getOwnPropertySlot): Deleted.
137         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
138         (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
139         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
140         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
141         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor): Deleted.
142         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
143         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
144         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::finishCreation): Deleted.
145         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
146         (WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter):
147         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot): Deleted.
148         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
149         (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
150         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
151         (WebCore::JSTestEventConstructor::JSTestEventConstructor):
152         (WebCore::jsTestEventConstructorAttr1): Deleted.
153         * bindings/scripts/test/JS/JSTestEventConstructor.h:
154         (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
155         (WebCore::JSTestEventConstructor::finishCreation): Deleted.
156         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
157         (WebCore::JSTestEventTarget::JSTestEventTarget):
158         (WebCore::JSTestEventTarget::getOwnPropertySlot): Deleted.
159         * bindings/scripts/test/JS/JSTestEventTarget.h:
160         (WebCore::JSTestEventTarget::~JSTestEventTarget):
161         * bindings/scripts/test/JS/JSTestException.cpp:
162         (WebCore::JSTestException::JSTestException):
163         (WebCore::JSTestException::getOwnPropertySlot): Deleted.
164         * bindings/scripts/test/JS/JSTestException.h:
165         (WebCore::JSTestException::~JSTestException):
166         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
167         (WebCore::JSTestGenerateIsReachable::JSTestGenerateIsReachable):
168         (WebCore::jsTestGenerateIsReachableConstructor): Deleted.
169         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
170         (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
171         (WebCore::JSTestGenerateIsReachable::finishCreation): Deleted.
172         * bindings/scripts/test/JS/JSTestInterface.cpp:
173         (WebCore::JSTestInterface::JSTestInterface):
174         (WebCore::JSTestInterface::getOwnPropertySlot): Deleted.
175         * bindings/scripts/test/JS/JSTestInterface.h:
176         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
177         (WebCore::jsTestJSBuiltinConstructorConstructor): Deleted.
178         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
179         (WebCore::JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor):
180         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
181         (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
182         (WebCore::jsTestMediaQueryListListenerConstructor): Deleted.
183         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
184         (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
185         (WebCore::JSTestMediaQueryListListener::finishCreation): Deleted.
186         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
187         (WebCore::JSTestNamedConstructor::JSTestNamedConstructor):
188         (WebCore::jsTestNamedConstructorConstructor): Deleted.
189         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
190         (WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
191         (WebCore::JSTestNamedConstructor::finishCreation): Deleted.
192         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
193         (WebCore::JSTestNondeterministic::JSTestNondeterministic):
194         (WebCore::jsTestNondeterministicNondeterministicReadonlyAttr): Deleted.
195         * bindings/scripts/test/JS/JSTestNondeterministic.h:
196         (WebCore::JSTestNondeterministic::~JSTestNondeterministic):
197         (WebCore::JSTestNondeterministic::finishCreation): Deleted.
198         * bindings/scripts/test/JS/JSTestObj.cpp:
199         (WebCore::JSTestObj::JSTestObj):
200         (WebCore::JSTestObj::getOwnPropertySlot): Deleted.
201         * bindings/scripts/test/JS/JSTestObj.h:
202         (WebCore::JSTestObj::~JSTestObj):
203         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
204         (WebCore::JSTestOverloadedConstructors::JSTestOverloadedConstructors):
205         (WebCore::jsTestOverloadedConstructorsConstructor): Deleted.
206         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
207         (WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
208         (WebCore::JSTestOverloadedConstructors::finishCreation): Deleted.
209         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
210         (WebCore::JSTestOverrideBuiltins::JSTestOverrideBuiltins):
211         (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot): Deleted.
212         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
213         (WebCore::JSTestOverrideBuiltins::~JSTestOverrideBuiltins):
214         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
215         (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
216         (WebCore::jsTestSerializedScriptValueInterfaceValue): Deleted.
217         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
218         (WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
219         (WebCore::JSTestSerializedScriptValueInterface::finishCreation): Deleted.
220         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
221         (WebCore::JSTestTypedefs::JSTestTypedefs):
222         (WebCore::JSTestTypedefs::getOwnPropertySlot): Deleted.
223         * bindings/scripts/test/JS/JSTestTypedefs.h:
224         (WebCore::JSTestTypedefs::~JSTestTypedefs):
225         * bindings/scripts/test/JS/JSattribute.cpp:
226         (WebCore::JSattribute::JSattribute):
227         (WebCore::jsattributeReadonly): Deleted.
228         * bindings/scripts/test/JS/JSattribute.h:
229         (WebCore::JSattribute::~JSattribute):
230         (WebCore::JSattribute::finishCreation): Deleted.
231         * bindings/scripts/test/JS/JSreadonly.cpp:
232         (WebCore::JSreadonly::JSreadonly):
233         (WebCore::jsreadonlyConstructor): Deleted.
234         * bindings/scripts/test/JS/JSreadonly.h:
235         (WebCore::JSreadonly::~JSreadonly):
236         (WebCore::JSreadonly::finishCreation): Deleted.
237
238 2015-10-01  Csaba Osztrogonác  <ossy@webkit.org>
239
240         Fix the ARM build after r190192
241         https://bugs.webkit.org/show_bug.cgi?id=149620
242
243         Reviewed by Darin Adler.
244
245         * platform/graphics/FontFeatureSettings.h:
246         (WebCore::fontFeatureTag):
247
248 2015-10-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
249
250         [Streams API] Add support for private WebCore JS builtins functions
251         https://bugs.webkit.org/show_bug.cgi?id=149518
252
253         Reviewed by Darin Adler.
254
255         Using ReadableStream tee method as a testbed to add support for private WebCore JS builtins functions.
256         Private functions are hooked to JSDOMWindowBase, as it is the one connected to WebCoreClientData.
257         WebCoreClientData is responsible to export the private function symbols to the VM.
258
259         Updated generate-js-builtins script to generate a class that can create and own all JS functions.
260         This class is used by JSDOMWindowBase to create the JS builtin functions.
261         It is also used to manage the GC of these objects.
262
263         Covered by rebased tests.
264
265         * CMakeLists.txt: Adding ReadableStreamInternals builtin files.
266         * DerivedSources.cpp: Ditto.
267         * DerivedSources.make: Ditto.
268         * Modules/streams/ReadableStream.idl: Adding tee declaration as builtin
269         * Modules/streams/ReadableStream.js:
270         (tee): Calling @teeReadableStream
271         * Modules/streams/ReadableStreamInternals.js: Barebone @teeReadableStream implementation.
272         (teeReadableStream):
273         * WebCore.vcxproj/WebCore.vcxproj: Adding ReadableStreamInternals builtin files.
274         * WebCore.xcodeproj/project.pbxproj: Adding ReadableStreamInternals builtin files.
275         * bindings/js/JSDOMWindowBase.cpp:
276         (WebCore::JSDOMWindowBase::JSDOMWindowBase): Creating ReadableStreamInternalsBuiltinFunctions object.
277         (WebCore::JSDOMWindowBase::finishCreation): Creating builtin functions through ReadableStreamInternalsBuiltinFunctions and registering them to the JS engine.
278         (WebCore::JSDOMWindowBase::visitChildren): Ensuring GC does not collect private builtin functions through ReadableStreamInternalsBuiltinFunctions object
279         * bindings/js/JSDOMWindowBase.h:
280         * bindings/js/WebCoreJSClientData.h:
281         (WebCore::WebCoreJSClientData::WebCoreJSClientData): Exporting private names of ReadableStreamInternalsBuiltins
282         (WebCore::WebCoreJSClientData::readableStreamBuiltins):
283         (WebCore::WebCoreJSClientData::readableStreamInternalsBuiltins):
284         * generate-js-builtins: Adding support for ReadableStreamInternalsBuiltinFunctions and exportNames.
285
286 2015-10-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
287
288         Binding generator should make mutable CachedAttribute member fields
289         https://bugs.webkit.org/show_bug.cgi?id=148056
290
291         Reviewed by Chris Dumez.
292
293         Making mutable CachedAttribute member fields.
294         Removing const_cast from custom binding code.
295         Rebased bindings tests.
296
297         No change in behavior.
298
299         * bindings/js/JSHistoryCustom.cpp:
300         (WebCore::JSHistory::state):
301         * bindings/js/JSMessageEventCustom.cpp:
302         (WebCore::JSMessageEvent::data):
303         * bindings/js/JSPopStateEventCustom.cpp:
304         (WebCore::cacheState):
305         (WebCore::JSPopStateEvent::state):
306         * bindings/js/JSReadableStreamReaderEventCustom.cpp:
307         (WebCore::JSReadableStreamReader::closed):
308         * bindings/js/JSXMLHttpRequestCustom.cpp:
309         (WebCore::JSXMLHttpRequest::response):
310         * bindings/scripts/CodeGeneratorJS.pm:
311         (GenerateHeader):
312         * bindings/scripts/test/JS/JSTestObj.h:
313         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
314
315 2015-10-01  Xabier Rodriguez Calvar  <calvaris@igalia.com>
316
317         [Streams API] Create ByteLengthQueuingStrategy object as per spec
318         https://bugs.webkit.org/show_bug.cgi?id=147153
319
320         Reviewed by Darin Adler.
321
322         Added ByteLengthQueuingStream class as the spec defines at https://streams.spec.whatwg.org/#blqs-class.
323
324         Tests are covered by current set.
325
326         * CMakeLists.txt:
327         * DerivedSources.cpp:
328         * DerivedSources.make:
329         * WebCore.vcxproj/WebCore.vcxproj:
330         * WebCore.vcxproj/WebCore.vcxproj.filters:
331         * WebCore.xcodeproj/project.pbxproj:
332         * bindings/js/WebCoreJSBuiltins.cpp: Added build instructions.
333         * Modules/streams/ByteLengthQueuingStrategy.idl: Added.
334         * Modules/streams/ByteLengthQueuingStrategy.js: Copied from Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp.
335         (size): Return byteLength attribute of the chunk.
336         (initializeByteLengthQueuingStrategy): Initialize the highWaterMark property.
337         * bindings/js/WebCoreJSClientData.h:
338         (WebCore::WebCoreJSClientData::WebCoreJSClientData): Initialize the blqs builtins.
339         (WebCore::WebCoreJSClientData::byteLengthQueuingStrategyBuiltins): Return the attribute.
340
341 2015-10-01  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
342
343         Clean up all uses of PassRefPtr in Modules/geolocation
344         https://bugs.webkit.org/show_bug.cgi?id=149552
345
346         Reviewed by Darin Adler.
347
348         * Modules/geolocation/GeoNotifier.cpp:
349         (WebCore::GeoNotifier::GeoNotifier):
350         (WebCore::GeoNotifier::setFatalError):
351         * Modules/geolocation/GeoNotifier.h:
352         (WebCore::GeoNotifier::create):
353         * Modules/geolocation/Geolocation.cpp:
354         (WebCore::createGeoposition):
355         (WebCore::createPositionError):
356         (WebCore::Geolocation::Watchers::add):
357         (WebCore::Geolocation::getCurrentPosition):
358         (WebCore::Geolocation::watchPosition):
359         (WebCore::Geolocation::startRequest):
360         * Modules/geolocation/Geolocation.h:
361         * Modules/geolocation/GeolocationError.h:
362         * Modules/geolocation/GeolocationPosition.h:
363         * Modules/geolocation/Geoposition.h:
364         (WebCore::Geoposition::create):
365         (WebCore::Geoposition::isolatedCopy):
366         (WebCore::Geoposition::Geoposition):
367         * Modules/geolocation/PositionError.h:
368         * Modules/geolocation/PositionOptions.h:
369
370 2015-09-30  Hunseop Jeong  <hs85.jeong@samsung.com>
371
372         [EFL][Gtk] Try to fix the build after r190379.
373         https://bugs.webkit.org/show_bug.cgi?id=149693
374
375         Reviewed by Gyuyoung Kim.
376
377         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
378
379 2015-09-30  Katlyn Graff  <kgraff@apple.com>
380
381         Add support for the imageSmoothingQuality property for CanvasRenderingContext2D.
382         https://bugs.webkit.org/show_bug.cgi?id=149541
383
384         Reviewed by Ryosuke Niwa.
385
386         As documented here: https://html.spec.whatwg.org/multipage/scripting.html#image-smoothing
387         Exposes the smooothing quality of algorithms used for scaling images. Valid input
388         values are low, medium, and high: associated algorithms are expected to vary for
389         differing hardware. setImageSmoothingQuality provides a handle into CGInterpolationQuality.
390
391         Test: fast/canvas/canvas-imageSmoothingQuality.html
392
393         * html/canvas/CanvasRenderingContext2D.cpp:
394         (WebCore::CanvasRenderingContext2D::State::State):
395         (WebCore::CanvasRenderingContext2D::State::operator=):
396         (WebCore::smoothingToInterpolationQuality):
397         (WebCore::CanvasRenderingContext2D::imageSmoothingQuality):
398         (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality):
399         (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled):
400         * html/canvas/CanvasRenderingContext2D.h:
401         * html/canvas/CanvasRenderingContext2D.idl:
402
403 2015-09-30  Dean Jackson  <dino@apple.com>
404
405         GraphicsContext3D::mappedSymbolName should initialize count variable
406         https://bugs.webkit.org/show_bug.cgi?id=149692
407         <rdar://problem/22871304>
408
409         Reviewed by Simon Fraser.
410
411         While debugging another WebGL issue, I noticed that some
412         OpenGL renderers can get into a state where they
413         drop resources (e.g. a GPU reset). If we don't detect that
414         in time, we might try to ask for the currently attached
415         resources and our in-parameter will not be set. In this
416         case, initialize it to zero so that we don't do silly things.
417
418         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
419         (WebCore::GraphicsContext3D::mappedSymbolName): Initialize count to 0.
420
421 2015-09-30  Dean Jackson  <dino@apple.com>
422
423         Crash in gleLookupHashObject when context is lost
424         https://bugs.webkit.org/show_bug.cgi?id=149690
425         <rdar://problem/22751585>
426         <rdar://problem/22465495>
427
428         Reviewed by Simon Fraser.
429
430         When we received notification that the GPU has reset,
431         we were nulling out and deleting our OpenGL contexts
432         and then trying to do it all over again. The fix was
433         to flip the order of operations.
434
435         While there I added some logging, and changed the
436         way we check GPU status to make sure we do a check
437         after the first draw call.
438
439         Unfortunately we can't test automatically because it
440         involves resetting the GPU which can possibly cause
441         concurrent tests to fail.
442
443         * platform/graphics/mac/GraphicsContext3DMac.mm:
444         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Move forceContextLost()
445         to be the first thing we do after we've realised we need to
446         bail.
447
448 2015-09-30  Brady Eidson  <beidson@apple.com>
449
450         Add UniqueIDBDatabase object, IDBBackingStore objects, and a database operation thread.
451         https://bugs.webkit.org/show_bug.cgi?id=149678
452
453         Reviewed by Alex Christensen.
454
455         Test: storage/indexeddb/modern/opendatabase-request-event.html
456
457         - UniqueIDBDatabase represents a specific IDB database instance that can have multiple 
458           connections to it.
459         - IDBBackingStore is an abstract representation of a unique database's backing store, 
460           and has a concrete in-memory implementation for now.
461         - The database thread exists on IDBServer and is for offloading actual database I/O from 
462           the main thread.
463
464         * CMakeLists.txt:
465
466         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
467         (WebCore::IDBDatabaseIdentifier::isolatedCopy):
468         * Modules/indexeddb/IDBDatabaseIdentifier.h:
469
470         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
471         (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
472         (WebCore::IDBClient::IDBConnectionToServer::didOpenDatabase):
473         * Modules/indexeddb/client/IDBConnectionToServer.h:
474         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
475
476         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
477         (WebCore::IDBClient::IDBFactory::openInternal):
478
479         * Modules/indexeddb/server/IDBBackingStore.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h.
480         (WebCore::IDBServer::IDBBackingStore::~IDBBackingStore):
481
482         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
483         (WebCore::IDBServer::IDBConnectionToClient::didOpenDatabase):
484         * Modules/indexeddb/server/IDBConnectionToClient.h:
485         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
486
487         * Modules/indexeddb/server/IDBServer.cpp:
488         (WebCore::IDBServer::IDBServer::IDBServer):
489         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
490         (WebCore::IDBServer::IDBServer::createBackingStore):
491         (WebCore::IDBServer::IDBServer::openDatabase):
492         (WebCore::IDBServer::IDBServer::deleteDatabase):
493         (WebCore::IDBServer::IDBServer::postDatabaseTask):
494         (WebCore::IDBServer::IDBServer::postDatabaseTaskReply):
495         (WebCore::IDBServer::IDBServer::databaseThreadEntry):
496         (WebCore::IDBServer::IDBServer::databaseRunLoop):
497         (WebCore::IDBServer::IDBServer::handleTaskRepliesOnMainThread):
498         * Modules/indexeddb/server/IDBServer.h:
499
500         * Modules/indexeddb/server/IDBServerOperation.cpp: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h.
501         (WebCore::IDBServer::IDBServerOperation::create):
502         (WebCore::IDBServer::IDBServerOperation::IDBServerOperation):
503         * Modules/indexeddb/server/IDBServerOperation.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBServer.h.
504         (WebCore::IDBServer::IDBServerOperation::connection):
505         (WebCore::IDBServer::IDBServerOperation::requestData):
506
507         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp.
508         (WebCore::IDBServer::MemoryIDBBackingStore::create):
509         (WebCore::IDBServer::MemoryIDBBackingStore::MemoryIDBBackingStore):
510         (WebCore::IDBServer::MemoryIDBBackingStore::~MemoryIDBBackingStore):
511         (WebCore::IDBServer::MemoryIDBBackingStore::getOrEstablishDatabaseInfo):
512         * Modules/indexeddb/server/MemoryIDBBackingStore.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h.
513
514         * Modules/indexeddb/server/UniqueIDBDatabase.cpp: Added.
515         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
516         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
517         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
518         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
519         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
520         * Modules/indexeddb/server/UniqueIDBDatabase.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBServer.h.
521         (WebCore::IDBServer::UniqueIDBDatabase::create):
522
523         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h.
524         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
525         (WebCore::IDBDatabaseInfo::isolatedCopy):
526         * Modules/indexeddb/shared/IDBDatabaseInfo.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h.
527         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
528
529         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
530         (WebCore::InProcessIDBServer::didDeleteDatabase):
531         (WebCore::InProcessIDBServer::openDatabase):
532         (WebCore::InProcessIDBServer::didOpenDatabase):
533         * Modules/indexeddb/shared/InProcessIDBServer.h:
534
535         * WebCore.xcodeproj/project.pbxproj:
536
537         * platform/CrossThreadCopier.cpp:
538         (WebCore::IDBDatabaseInfo>::copy):
539         (WebCore::IDBDatabaseIdentifier>::copy):
540         * platform/CrossThreadCopier.h:
541
542 2015-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
543
544         Crash when using an SVG font with > 390 glyphs
545         https://bugs.webkit.org/show_bug.cgi?id=149677
546         <rdar://problem/21676402>
547
548         Reviewed by Simon Fraser.
549
550         The "Charset Index" in OTF are indices into a collection of strings. There are
551         390 predefined strings in this collection. We were currently assigning each
552         glyph to one of these strings. However, if there are more glyphs than strings,
553         we will be using invalid indices.
554
555         The values of the strings themselves are not necessary for SVG fonts. Therefore,
556         the solution is to create a single dummy string, and have all glyphs target it.
557
558         Tests: svg/custom/many-glyphs.svg
559
560         * css/CSSFontFaceSource.cpp:
561         (WebCore::CSSFontFaceSource::font):
562         * svg/SVGToOTFFontConversion.cpp:
563         (WebCore::SVGToOTFFontConverter::appendCFFTable):
564
565 2015-09-30  Chris Dumez  <cdumez@apple.com>
566
567         Unreviewed, roll out r188331: "NetworkProcess: DNS prefetch happens in the Web Process"
568         <rdar://problem/22560715>
569
570         Speculative roll out of r188331 as we had a ~2.5% PLT regression around
571         the time it landed and it seems the most likely culprit. I'll reland if
572         the perf bots do not recover after the roll out.
573
574         * html/HTMLAnchorElement.cpp:
575         (WebCore::HTMLAnchorElement::parseAttribute):
576         * loader/FrameLoaderClient.h:
577         * loader/LinkLoader.cpp:
578         (WebCore::LinkLoader::loadLink):
579         * page/Chrome.cpp:
580         (WebCore::Chrome::mouseDidMoveOverElement):
581
582 2015-09-30  Timothy Horton  <timothy_horton@apple.com>
583
584         Compute document marker rects at use time instead of paint time
585         https://bugs.webkit.org/show_bug.cgi?id=149643
586
587         Reviewed by Darin Adler.
588
589         * dom/DocumentMarkerController.cpp:
590         (WebCore::DocumentMarkerController::DocumentMarkerController):
591         (WebCore::DocumentMarkerController::detach):
592         Store and zero the Document backpointer.
593
594         (WebCore::DocumentMarkerController::addMarker):
595         (WebCore::DocumentMarkerController::addTextMatchMarker):
596         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker):
597         (WebCore::DocumentMarkerController::addDictationResultMarker):
598         (WebCore::DocumentMarkerController::copyMarkers):
599         Remove some useless comments.
600
601         (WebCore::updateRenderedRectsForMarker):
602         Use Range to compute the (unclipped, absolute) text rects, and store them
603         on the RenderedDocumentMarker.
604
605         (WebCore::DocumentMarkerController::invalidateRectsForAllMarkers):
606         (WebCore::DocumentMarkerController::invalidateRectsForMarkersInNode):
607         Mark the relevant markers' rects as invalid, and notify the ChromeClient.
608
609         (WebCore::DocumentMarkerController::updateRectsForInvalidatedMarkersOfType):
610         Run through all markers, computing rects for ones that don't have valid rects.
611         We will do layout (once) if necessary. However, this is most commonly
612         called from a place where layout should already be up to date, so this
613         should not happen often. updateRenderedRectsForMarker also asserts
614         that layout is up to date.
615
616         (WebCore::DocumentMarkerController::renderedRectsForMarkers):
617         Retrieve all markers of the given type, clip them by overflow clip and
618         frame clip, and return them to the caller.
619
620         (WebCore::DocumentMarkerController::addMarker):
621         (WebCore::DocumentMarkerController::markerContainingPoint):
622         (WebCore::DocumentMarkerController::markersFor):
623         (WebCore::DocumentMarkerController::repaintMarkers):
624         (WebCore::DocumentMarkerController::shiftMarkers):
625         (DocumentMarkerController::setMarkersActive):
626         (DocumentMarkerController::hasMarkers):
627         Modern iteration.
628         
629         (WebCore::DocumentMarkerController::invalidateRenderedRectsForMarkersInRect): Deleted.
630         * dom/DocumentMarkerController.h:
631
632         * dom/Document.cpp:
633         (WebCore::Document::Document):
634         Pass the Document to the DocumentMarkerController.
635
636         * dom/RenderedDocumentMarker.h:
637         (WebCore::RenderedDocumentMarker::contains):
638         (WebCore::RenderedDocumentMarker::setUnclippedAbsoluteRects):
639         (WebCore::RenderedDocumentMarker::unclippedAbsoluteRects):
640         (WebCore::RenderedDocumentMarker::invalidate):
641         (WebCore::RenderedDocumentMarker::isValid):
642         (WebCore::RenderedDocumentMarker::addRenderedRect): Deleted.
643         (WebCore::RenderedDocumentMarker::renderedRects): Deleted.
644         Instead of keeping "rendered" rects, keep unclipped rects in absolute
645         document coordinates. Invalidation will happen wholesale instead of
646         based on dirty rects, because computation no longer happens at paint
647         time, so it's safe to throw all of the rects away.
648         Keep track of whether we have valid rects or not.
649
650         * editing/Editor.cpp:
651         (WebCore::Editor::countMatchesForText):
652         We don't need to do a fake whole-document paint just to compute the
653         document marker rects. They are computed on demand, using layout information
654         instead of paint-time information.
655
656         * page/ChromeClient.h:
657         Remove an unnecessary semicolon.
658         Add didInvalidateDocumentMarkerRects, which DocumentMarkerController
659         will call whenever document marker rects are invalidated (and when e.g.
660         the find holes PageOverlay should repaint itself).
661
662         * page/FrameView.cpp:
663         (WebCore::FrameView::layout):
664         Invalidate document marker's layout-computed rects after layout is complete.
665         They'll be lazily recomputed when next requested.
666
667         (WebCore::FrameView::willPaintContents):
668         Remove the pre-painting invalidation of document marker rects.
669
670         * rendering/InlineTextBox.cpp:
671         (WebCore::InlineTextBox::paintTextMatchMarker):
672         (WebCore::InlineTextBox::paintDocumentMarker): Deleted.
673         (WebCore::InlineTextBox::computeRectForReplacementMarker): Deleted.
674         (WebCore::InlineTextBox::paintDocumentMarkers): Deleted.
675         Don't bother computing rendered rects for document markers at paint time.
676         Just do the actual painting work (which, for replacement markers, is
677         nothing at all).
678
679         * rendering/InlineTextBox.h:
680         * rendering/RenderLayer.cpp:
681         (WebCore::RenderLayer::updateLayerPositions):
682         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
683         When RenderLayers move, invalidate document marker rects.
684
685         * rendering/svg/SVGInlineFlowBox.cpp:
686         (WebCore::SVGInlineFlowBox::paint):
687         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer): Deleted.
688         * rendering/svg/SVGInlineFlowBox.h:
689         * rendering/svg/SVGRootInlineBox.cpp:
690         (WebCore::SVGRootInlineBox::paint):
691         Don't bother computing rendered rects for document markers at paint time.
692
693         * testing/Internals.cpp:
694         (WebCore::markerTypeFrom):
695         (WebCore::markerTypesFrom):
696         Add markerTypeFrom, which returns MarkerType enum values for the input string
697         instead of a MarkerTypes class.
698
699         (WebCore::Internals::dumpMarkerRects):
700         Dump all markers for the given type, and request them from DocumentMarkerController
701         instead of from the RenderedDocumentMarker, because we want fully clipped
702         rects, which can only be obtained from DocumentMarkerController.
703
704         * editing/FrameSelection.cpp:
705         (WebCore::FrameSelection::getTextRectangles):
706         Avoid enclosing unnecessarily, to avoid inflating zero-width text rects
707         to have a non-zero width. Callers appear to be OK with non-integral positions.
708
709         * testing/Internals.h:
710         * testing/Internals.idl:
711
712 2015-09-30  Eric Carlson  <eric.carlson@apple.com>
713
714         REGRESSION(r190262): User media unit test failures after r190262
715         https://bugs.webkit.org/show_bug.cgi?id=149580
716
717         Reviewed by Darin Adler.
718
719         * Modules/mediastream/RTCPeerConnection.cpp:
720         (WebCore::RTCPeerConnection::getStats): Drive-by fix to deal with optional param.
721
722         * Modules/mediastream/UserMediaRequest.cpp:
723         (WebCore::UserMediaRequest::constraintsValidated): Swap the track parameter order.
724         * Modules/mediastream/UserMediaRequest.h:
725
726         * platform/mediastream/MediaStreamCreationClient.h:
727         (WebCore::MediaStreamCreationClient::validateRequestConstraints): Swap the track parameter order.
728
729         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
730         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): If there is no 
731           constraint for a media type, don't return a device of that type.
732
733         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
734         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
735
736         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
737         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
738
739         * platform/mock/TimerEventBasedMock.h:
740         (WebCore::TimerEvent::~TimerEvent): Clear the m_mock pointer.
741
742         * platform/mock/UserMediaClientMock.h:
743         (WebCore::UserMediaClientMock::fire): Deal with empty device vectors.
744
745         * testing/Internals.cpp:
746         (WebCore::Internals::Internals): Don't register UserMediaController, it isn't needed for
747           WKTR.
748
749 2015-09-29  Antti Koivisto  <antti@apple.com>
750
751         Use separate style resolver for user agent shadow trees
752         https://bugs.webkit.org/show_bug.cgi?id=149626
753
754         Reviewed by Andreas Kling.
755
756         We now support separate style resolvers for shadow trees. Use this mechanism to have a separate
757         per-document style resolver for user agent shadow trees. This isolates user agent shadow trees
758         from author style better and simplifies the style resolver. It can also avoid some unnecessary style recalcs.
759
760         * css/DocumentRuleSets.cpp:
761         (WebCore::DocumentRuleSets::resetAuthorStyle):
762         (WebCore::DocumentRuleSets::appendAuthorStyleSheets):
763
764             Change interface so that only the new rules are provided.
765
766         * css/DocumentRuleSets.h:
767         * css/ElementRuleCollector.cpp:
768         (WebCore::ElementRuleCollector::addElementStyleProperties):
769         (WebCore::ElementRuleCollector::collectMatchingRules):
770
771             We can remove special bailout as shadow tree style resolver won't have other author style
772
773         (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
774
775             Remove the exception that disables property whitelists for UA stylesheets. We don't seem to use the feature.
776
777         (WebCore::ElementRuleCollector::matchUARules):
778         (WebCore::MatchingUARulesScope::MatchingUARulesScope): Deleted.
779         (WebCore::MatchingUARulesScope::~MatchingUARulesScope): Deleted.
780         (WebCore::MatchingUARulesScope::isMatchingUARules): Deleted.
781
782             Remove this unnecessary hack.
783
784         * css/ElementRuleCollector.h:
785         (WebCore::ElementRuleCollector::ElementRuleCollector):
786         * css/RuleSet.cpp:
787         (WebCore::RuleSet::addStyleRule):
788         (WebCore::RuleSet::copyShadowPseudoElementRulesFrom):
789
790             Also copy WebVTT rules. They are currently a sort of mixture of UA and author shadow tree.
791
792         (WebCore::shrinkMapVectorsToFit):
793         * css/RuleSet.h:
794         (WebCore::RuleData::containsUncommonAttributeSelector):
795         (WebCore::RuleData::linkMatchType):
796         (WebCore::RuleData::hasDocumentSecurityOrigin):
797         (WebCore::RuleData::propertyWhitelistType):
798         (WebCore::RuleData::descendantSelectorIdentifierHashes):
799         (WebCore::RuleSet::ruleCount):
800         (WebCore::RuleSet::hasShadowPseudoElementRules):
801         * css/StyleInvalidationAnalysis.cpp:
802         (WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis):
803         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
804
805             Don't invalidate the whole tree when author shadow pseudo element rules change. Just invalidate the shadow trees.
806
807         (WebCore::StyleInvalidationAnalysis::invalidateStyleForTree):
808         (WebCore::StyleInvalidationAnalysis::invalidateStyle):
809         (WebCore::invalidateIfNeeded): Deleted.
810         (WebCore::invalidateStyleForTree): Deleted.
811         * css/StyleInvalidationAnalysis.h:
812         (WebCore::StyleInvalidationAnalysis::dirtiesAllStyle):
813         (WebCore::StyleInvalidationAnalysis::hasShadowPseudoElementRulesInAuthorSheet):
814         * css/StyleResolver.cpp:
815         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
816         (WebCore::StyleResolver::StyleResolver):
817         (WebCore::StyleResolver::appendAuthorStyleSheets):
818
819             Simpler interface.
820
821         * css/StyleResolver.h:
822         (WebCore::StyleResolver::document):
823         (WebCore::StyleResolver::documentSettings):
824         (WebCore::StyleResolver::ruleSets):
825         * dom/AuthorStyleSheets.cpp:
826         (WebCore::AuthorStyleSheets::collectActiveStyleSheets):
827         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
828
829             Cleanups.
830
831         (WebCore::filterEnabledNonemptyCSSStyleSheets):
832         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
833         (WebCore::AuthorStyleSheets::updateStyleResolver):
834
835             Factor to a function.
836             Copy any author shadow pseudo elements to user agent shadow tree resolver.
837
838         (WebCore::AuthorStyleSheets::activeStyleSheetsForInspector):
839         * dom/AuthorStyleSheets.h:
840         * dom/Document.cpp:
841         (WebCore::Document::createStyleResolver):
842         (WebCore::Document::userAgentShadowTreeStyleResolver):
843
844             Use separate resolver.
845
846         (WebCore::Document::fontsNeedUpdate):
847         (WebCore::Document::clearStyleResolver):
848         * dom/Document.h:
849         (WebCore::Document::ensureStyleResolver):
850         * dom/ShadowRoot.cpp:
851         (WebCore::ShadowRoot::styleResolver):
852
853             Return document-global shadow tree resolver for ua trees.
854
855         * style/StyleResolveTree.cpp:
856         (WebCore::Style::resolveShadowTree):
857
858             Take styleChange of shadow root into account.
859
860 2015-09-30  Gwang Yoon Hwang  <yoon@igalia.com>
861
862         [GTK] Support HiDPI Properly in WebKitGtk+ with the TextureMapper
863         https://bugs.webkit.org/show_bug.cgi?id=141782
864
865         Reviewed by Carlos Garcia Campos.
866
867         This patch fixes HiDPI issue in the TextureMapper.
868         To support HiDPI in the TextureMapper, we need to draw scaled contents
869         in the TextureMapperTile, and apply the global scale in the root layer
870         to apply transforms correctly.
871
872         Supporting the device scale is handled at LayerTreeHostGtk and
873         TextureMapperBackingStore, and GraphicsLayerTextureMapper doesn't handle
874         the device scale directly.
875
876         From the TextureMapperLayer, deviceScale and pageScale do not have to be
877         handled differently. These are multiplied and provided to
878         TextureMapperBackingStore.
879
880         * platform/graphics/texmap/TextureMapperTile.cpp:
881         (WebCore::TextureMapperTile::updateContents):
882         * platform/graphics/texmap/TextureMapperTile.h:
883         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
884
885             Modified to increase the cover rect for tiles creation. For the image
886             contents, it just creates texture with a image size, regardless of the
887             contents scale.
888
889         * platform/graphics/texmap/BitmapTexture.cpp:
890         (WebCore::BitmapTexture::updateContents):
891
892             Apply the device scale to the graphics context before painting contents.
893
894         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
895         (WebCore::GraphicsLayerTextureMapper::setContentsToImage):
896         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
897
898             Apply the device scale and the page scale to the backing store
899
900 2015-09-29  Ryosuke Niwa  <rniwa@webkit.org>
901
902         ASSERTION FAILED: !isUnreachableNode(m_target.get()) when hovering over any input element
903         https://bugs.webkit.org/show_bug.cgi?id=149589
904
905         Reviewed by Darin Adler.
906
907         The bug was caused by target not being reset across shadow boundary when SHADOW_DOM was disabled.
908
909         No new tests since exiting tests cover this in debug builds. e.g. editing/deleting/5290534.html
910
911         * dom/EventDispatcher.cpp:
912         (WebCore::EventPath::EventPath):
913
914 2015-09-29  Jon Honeycutt  <jhoneycutt@apple.com>
915
916         Avoid reparsing an XSLT stylesheet after the first failure.
917         https://bugs.webkit.org/show_bug.cgi?id=149188
918         <rdar://problem/22709912>
919
920         Reviewed by Dave Hyatt.
921
922         Patch by Jiewen Tan, jiewen_tan@apple.com.
923
924         Test: svg/custom/invalid-xslt-crash.svg
925
926         * xml/XSLStyleSheet.h:
927         Add a new member variable m_compilationFailed that tracks whether
928         compilation has failed. Default value is false.
929
930         * xml/XSLStyleSheetLibxslt.cpp:
931         (WebCore::XSLStyleSheet::compileStyleSheet):
932         Return early if the compilation has failed before. After compiling the
933         style sheet, if we failed, set m_compilationFailed to true.
934
935 2015-09-29  Hunseop Jeong  <hs85.jeong@samsung.com>
936
937         Use modern for-loops in WebCore/loader.
938         https://bugs.webkit.org/show_bug.cgi?id=149397
939
940         Reviewed by Darin Adler.
941
942         No new tests because there is no behavior change.
943
944         * loader/CrossOriginAccessControl.cpp:
945         (WebCore::parseAccessControlExposeHeadersAllowList):
946         * loader/DocumentLoader.cpp:
947         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
948         * loader/FormSubmission.cpp:
949         (WebCore::FormSubmission::create):
950         * loader/FrameLoader.cpp:
951         (WebCore::FrameLoader::~FrameLoader):
952         (WebCore::FrameLoader::commitProvisionalLoad):
953         (WebCore::FrameLoader::detachChildren):
954         (WebCore::FrameLoader::shouldClose):
955         (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads):
956         * loader/HistoryController.cpp:
957         (WebCore::HistoryController::currentFramesMatchItem):
958         * loader/SubframeLoader.cpp:
959         (WebCore::findPluginMIMETypeFromURL):
960         (WebCore::SubframeLoader::createJavaAppletWidget):
961         * loader/appcache/ApplicationCache.cpp:
962         (WebCore::ApplicationCache::isURLInOnlineWhitelist):
963         (WebCore::ApplicationCache::urlMatchesFallbackNamespace):
964         * loader/appcache/ApplicationCacheGroup.cpp:
965         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
966         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
967         (WebCore::ApplicationCacheGroup::postListenerTask):
968         * loader/appcache/ApplicationCacheHost.cpp:
969         (WebCore::ApplicationCacheHost::stopDeferringEvents):
970         * loader/appcache/ApplicationCacheStorage.cpp:
971         (WebCore::StorageIDJournal::~StorageIDJournal):
972         (WebCore::ApplicationCacheStorage::store):
973         (WebCore::ApplicationCacheStorage::getOriginsWithCache):
974         * loader/archive/Archive.cpp:
975         (WebCore::Archive::clearAllSubframeArchivesImpl):
976         * loader/archive/ArchiveResourceCollection.cpp:
977         (WebCore::ArchiveResourceCollection::addAllResources):
978         * loader/archive/cf/LegacyWebArchive.cpp:
979         (WebCore::LegacyWebArchive::createPropertyListRepresentation):
980         (WebCore::LegacyWebArchive::create):
981         * loader/archive/mhtml/MHTMLArchive.cpp:
982         (WebCore::MHTMLArchive::generateMHTMLData):
983         * loader/cache/CachedImage.cpp:
984         (WebCore::CachedImage::switchClientsToRevalidatedResource):
985         (WebCore::CachedImage::createImage):
986         * loader/cache/CachedResource.cpp:
987         (WebCore::CachedResource::switchClientsToRevalidatedResource):
988         * loader/cache/CachedResourceLoader.cpp:
989         (WebCore::CachedResourceLoader::~CachedResourceLoader):
990         (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred):
991         (WebCore::CachedResourceLoader::garbageCollectDocumentResources):
992         (WebCore::CachedResourceLoader::isPreloaded):
993         (WebCore::CachedResourceLoader::printPreloadStats):
994         * loader/icon/IconDatabase.cpp:
995         (WebCore::IconDatabase::removeAllIcons):
996         (WebCore::IconDatabase::setIconDataForIconURL):
997         (WebCore::IconDatabase::iconRecordCountWithData):
998         (WebCore::IconDatabase::notifyPendingLoadDecisions):
999         (WebCore::IconDatabase::performURLImport):
1000         (WebCore::IconDatabase::performPendingRetainAndReleaseOperations):
1001         (WebCore::IconDatabase::readFromDatabase):
1002         (WebCore::IconDatabase::writeToDatabase):
1003
1004 2015-09-29  Chris Dumez  <cdumez@apple.com>
1005
1006         sectionRowIndex must return -1 when its parent is not a table, tbody, thead, or tfoot
1007         https://bugs.webkit.org/show_bug.cgi?id=148841
1008         <rdar://problem/22586870>
1009
1010         Reviewed by Ryosuke Niwa.
1011
1012         Update HTMLTableRowElement.sectionRowIndex to match the specification:
1013         https://html.spec.whatwg.org/multipage/tables.html#dom-tr-sectionrowindex
1014
1015         In particular, it now returns -1 if the parent is not a table, tbody,
1016         thead and tfoot.
1017
1018         No new tests, already covered by existing test.
1019
1020         * html/HTMLTableRowElement.cpp:
1021         (WebCore::HTMLTableRowElement::sectionRowIndex):
1022
1023 2015-09-29  Daniel Bates  <dabates@apple.com>
1024
1025         Make WebKit for iOS Simulator build with the public iOS 9 SDK
1026         https://bugs.webkit.org/show_bug.cgi?id=149652
1027
1028         Reviewed by Simon Fraser.
1029
1030         * WebCore.xcodeproj/project.pbxproj: Add private header pthreadSPI.h. Also move entry for IDBTransaction.h so that it is in sorted order.
1031         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Substitute AVPlayerViewControllerDelegate_WebKitOnly for AVPlayerViewControllerDelegate.
1032         * platform/spi/cocoa/AVKitSPI.h: As of iOS 9, AVPlayerViewControllerDelegate is a public protocol. Separate out WebKit-specific SPI into protocol
1033         AVPlayerViewControllerDelegate_WebKitOnly, which extends AVPlayerViewControllerDelegate. Also, the properties -[AVPlayerViewController allowsPictureInPicturePlayback] and -[AVPlayerViewController delegate] are public in iOS 9.
1034         * platform/spi/cocoa/pthreadSPI.h: Added.
1035         * platform/spi/ios/LaunchServicesSPI.h: Add more SPI.
1036         * platform/spi/ios/MediaPlayerSPI.h: Ignore deprecation warnings for UIPopoverController and UIActionSheet.
1037
1038 2015-09-29  Brady Eidson  <beidson@apple.com>
1039
1040         Followup to "Move WebKit2 AsyncTask to WebCore CrossThreadTask."
1041         https://bugs.webkit.org/show_bug.cgi?id=149651
1042
1043         Rubberstamped by Alex Christensen.
1044
1045         No new tests (No change in behavior).
1046
1047         * platform/CrossThreadTask.h: Now in WebCore, use the WebCore namespace.
1048
1049 2015-09-29  Brady Eidson  <beidson@apple.com>
1050
1051         Move WebKit2 AsyncTask to WebCore CrossThreadTask.
1052         https://bugs.webkit.org/show_bug.cgi?id=149651
1053
1054         Reviewed by Alex Christensen.
1055
1056         No new tests (No change in behavior).
1057         
1058         It will be needed in WebCore to support IndexedDB.
1059
1060         * WebCore.xcodeproj/project.pbxproj:
1061         * platform/CrossThreadTask.h: Renamed from Source/WebKit2/Shared/AsyncTask.h.
1062         (WebKit::CrossThreadTask::CrossThreadTask):
1063         (WebKit::CrossThreadTask::performTask):
1064         (WebKit::createCrossThreadTask):
1065
1066 2015-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1067
1068         Snap offsets should update when style is programmatically changed
1069         https://bugs.webkit.org/show_bug.cgi?id=135964
1070         <rdar://problem/18162411>
1071
1072         Reviewed by Darin Adler.
1073
1074         Tests:  css3/scroll-snap/scroll-snap-style-changed-coordinates.html
1075                 css3/scroll-snap/scroll-snap-style-changed-repeat.html
1076
1077         Updating scroll snap style properties now programmatically updates the scroll snap container. Does not yet
1078         handle the case of reparented elements with scroll snap coordinates. Adds some plumbing the FrameView and
1079         RenderLayerCompositor to immediately update the scrolling coordinator when updating the FrameView due to
1080         style changes.
1081
1082         * page/FrameView.cpp:
1083         (WebCore::FrameView::updateScrollingCoordinatorScrollSnapProperties): Calls on the compositor to reupdate scroll snap
1084             properties on the FrameView.
1085         * page/FrameView.h:
1086         * page/scrolling/AsyncScrollingCoordinator.cpp: Sets snap offsets to an empty vector when appropriate.
1087         (WebCore::setStateScrollingNodeSnapOffsetsAsFloat): Ditto.
1088         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Ditto.
1089         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Ditto.
1090         (WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView): Updates scroll snap properties
1091             from a given FrameView.
1092         * page/scrolling/AsyncScrollingCoordinator.h:
1093         * page/scrolling/ScrollingCoordinator.h:
1094         (WebCore::ScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
1095         * rendering/RenderLayerCompositor.cpp:
1096         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Updates the scrolling coordinator's
1097             scroll snap properties.
1098         * rendering/RenderLayerCompositor.h: Plumb scroll snap property updating to the FrameView.
1099         * rendering/RenderLayerModelObject.cpp: Checks for style changes and updates snap offsets when appropriate.
1100         (WebCore::scrollSnapContainerRequiresUpdateForStyleUpdate): Ditto.
1101         (WebCore::RenderLayerModelObject::styleDidChange): Ditto.
1102
1103 2015-09-29  Jer Noble  <jer.noble@apple.com>
1104
1105         REGRESSION: WebAudio user-gesture restriction is no longer lifted by touchstart event
1106         https://bugs.webkit.org/show_bug.cgi?id=149367
1107
1108         Reviewed by Eric Carlson.
1109
1110         Use processingUserGestureForMedia() rather than processingUserGesture(),
1111         as the former includes touchstart and the latter does not.
1112
1113         * Modules/webaudio/AudioContext.cpp:
1114         (WebCore::AudioContext::willBeginPlayback):
1115         (WebCore::AudioContext::willPausePlayback):
1116         * html/MediaElementSession.cpp:
1117         (WebCore::MediaElementSession::playbackPermitted):
1118         (WebCore::MediaElementSession::dataLoadingPermitted):
1119         (WebCore::MediaElementSession::fullscreenPermitted):
1120         (WebCore::MediaElementSession::showPlaybackTargetPicker):
1121
1122 2015-09-29  Ryosuke Niwa  <rniwa@webkit.org>
1123
1124         Update style/layout when a slot is added or removed
1125         https://bugs.webkit.org/show_bug.cgi?id=149593
1126
1127         Reviewed by Antti Koivisto.
1128
1129         Fixed the bug by forcing the render tree reconstruction on the shadow host when a slot is inserted or removed.
1130         We should optimize these reconstructions by only triggering them on the affected slot elements in the future.
1131
1132         Also fixed a bug that we were not invalidating the slot assignments when a default slot is introduced dynamically
1133         after the slot assignment algorithm had run.
1134
1135         Test (existing): fast/shadow-dom/shadow-layout-after-slot-changes.html
1136
1137         * dom/ShadowRoot.cpp:
1138         (WebCore::ShadowRoot::addSlotElementByName): Passes in ShadowRoot.
1139         (WebCore::ShadowRoot::removeSlotElementByName): Ditto.
1140         * dom/SlotAssignment.cpp:
1141         (WebCore::SlotAssignment::addSlotElementByName): Call setNeedsStyleRecalc.
1142         (WebCore::SlotAssignment::removeSlotElementByName): Call setNeedsStyleRecalc if the host is still alive since this
1143         function can be called while the host is being destructed in which case shadowRoot.host() would be nullptr.
1144         * dom/SlotAssignment.h:
1145
1146 2015-09-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1147
1148         Improve binding of JSBuiltinConstructor classes
1149         https://bugs.webkit.org/show_bug.cgi?id=149556
1150
1151         Reviewed by Darin Adler.
1152
1153         JSBuiltinConstructor classes no longer need definition of a DOM class.
1154         These classes no longer go through the JS wrapper cache.
1155         Removed code related to DOM class handling (m_impl, releaseImpl, WrapperOwner, toJS, ...)
1156         Updated creation code.
1157
1158         Refactoring of the binding generator code to simplify whether generating or not some methods.
1159
1160         Removed unneeded include of DOM class in JSXX.cpp (already done in JSXX.h)
1161
1162         Added new binding test to cover JSBuiltinConstructor keyword.
1163
1164         Covered by binding tests.
1165
1166         * bindings/js/JSDOMBinding.h:
1167         (WebCore::createJSBuiltin):
1168         (WebCore::DOMConstructorObject::createStructure):.
1169         * bindings/scripts/CodeGeneratorJS.pm:
1170         (NeedsImplementationClass):
1171         (ShouldGenerateToWrapped):
1172         (ShouldGenerateWrapperOwnerCode):
1173         (ShouldGenerateToJSDeclaration):
1174         (ShouldGenerateToJSImplementation):
1175         (GenerateHeader):
1176         (GenerateImplementation):
1177         (GenerateConstructorDefinition):
1178         (ComputeFunctionSpecial):.
1179         (UseJSBuiltins):.
1180         * bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructor.cpp: Added.
1181         (WebKit::kit):
1182         (WebKit::core):
1183         (WebKit::wrapTestJSBuiltinConstructor):
1184         (webkit_dom_test_js_builtin_constructor_finalize):
1185         (webkit_dom_test_js_builtin_constructor_constructor):
1186         (webkit_dom_test_js_builtin_constructor_class_init):
1187         (webkit_dom_test_js_builtin_constructor_init):
1188         * bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructor.h: Added.
1189         * bindings/scripts/test/GObject/WebKitDOMTestJSBuiltinConstructorPrivate.h: Added.
1190         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1191         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1192         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1193         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1194         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1195         * bindings/scripts/test/JS/JSTestException.cpp:
1196         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1197         * bindings/scripts/test/JS/JSTestInterface.cpp:
1198         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: Added.
1199         (WebCore::JSTestJSBuiltinConstructorPrototype::create):
1200         (WebCore::JSTestJSBuiltinConstructorPrototype::createStructure):
1201         (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
1202         (WebCore::JSTestJSBuiltinConstructorConstructor::create):
1203         (WebCore::JSTestJSBuiltinConstructorConstructor::createStructure):
1204         (WebCore::JSTestJSBuiltinConstructorConstructor::constructJSTestJSBuiltinConstructor):
1205         (WebCore::JSTestJSBuiltinConstructorConstructor::JSTestJSBuiltinConstructorConstructor):
1206         (WebCore::JSTestJSBuiltinConstructorConstructor::finishCreation):
1207         (WebCore::JSTestJSBuiltinConstructorConstructor::getConstructData):
1208         (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
1209         (WebCore::JSTestJSBuiltinConstructor::JSTestJSBuiltinConstructor):
1210         (WebCore::JSTestJSBuiltinConstructor::createPrototype):
1211         (WebCore::JSTestJSBuiltinConstructor::getPrototype):
1212         (WebCore::JSTestJSBuiltinConstructor::destroy):
1213         (WebCore::JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor):
1214         (WebCore::jsTestJSBuiltinConstructorConstructor):
1215         (WebCore::JSTestJSBuiltinConstructor::getConstructor):
1216         (WebCore::JSTestJSBuiltinConstructor::visitChildren):
1217         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h: Added.
1218         (WebCore::JSTestJSBuiltinConstructor::create):
1219         (WebCore::JSTestJSBuiltinConstructor::createStructure):
1220         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1221         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1222         * bindings/scripts/test/JS/JSTestNode.cpp:
1223         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1224         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1225         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1226         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1227         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1228         * bindings/scripts/test/JS/JSattribute.cpp:
1229         * bindings/scripts/test/JS/JSreadonly.cpp:
1230         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.h: Added.
1231         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.mm: Added.
1232         (-[DOMTestJSBuiltinConstructor dealloc]):
1233         (-[DOMTestJSBuiltinConstructor finalize]):
1234         (core):
1235         (kit):
1236         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructorInternal.h: Added.
1237         * bindings/scripts/test/TestJSBuiltinConstructor.idl: Added.
1238
1239 2015-09-29  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1240
1241         [Streams API] [Win] Remove reference to dead CountQueuingStrategy.h
1242         https://bugs.webkit.org/show_bug.cgi?id=149623
1243
1244         Reviewed by Darin Adler.
1245
1246         No new tests needed.
1247
1248         * WebCore.vcxproj/WebCore.vcxproj.filters:
1249
1250 2015-09-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1251
1252         Build WebCore JS Builtins according the ENABLE flags
1253         https://bugs.webkit.org/show_bug.cgi?id=149624
1254
1255         Reviewed by Csaba Osztrogonác.
1256
1257         Created WebCoreJSBuiltins.cpp to include all JSXXBuiltins.cpp files with the right #ifdef.
1258         Added WebCoreJSBuiltins.cpp to CMake, win and mac build systems.
1259
1260         No change in behavior.
1261
1262         * CMakeLists.txt:
1263         * DerivedSources.cpp:
1264         * WebCore.vcxproj/WebCore.vcxproj:
1265         * WebCore.xcodeproj/project.pbxproj:
1266         * bindings/js/WebCoreJSBuiltins.cpp: Added.
1267
1268 2015-09-29  Javier Fernandez  <jfernandez@igalia.com>
1269
1270         [CSS Grid Layout] Flex tracks sizing alg must handle 0fr values
1271         https://bugs.webkit.org/show_bug.cgi?id=148944
1272
1273         Reviewed by Darin Adler.
1274
1275         We don't allow 0 as flexible size value, which is not following current
1276         specs; it just states that it must be a positive value. This patch
1277         adds such change in the parser but some additional logic must be added
1278         as well to handle 0 values during the flex tracks sizing algorithm.
1279
1280         The old algorithm didn't take 0 values into account, so there is the risk
1281         of division by zero. Additionally, it was not handling fraction values
1282         in the best way. The last versions of the spec changed this algorithm in
1283         order to handle fraction values so that they don't cause exponential
1284         grow of tracks using values bigger than 1.
1285
1286         This patch implements also such new algorithm, so we can deal not only
1287         with 0 values, but managing fraction values properly.
1288
1289         No new tests, just some additional test cases and some of them rebaselined.
1290
1291         * rendering/RenderGrid.cpp:
1292         (WebCore::normalizedFlexFraction):
1293         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1294         (WebCore::RenderGrid::computeFlexFactorUnitSize): Added.
1295         (WebCore::RenderGrid::findFlexFactorUnitSize): Added.
1296         (WebCore::RenderGrid::GridTrackForNormalization): Deleted.
1297         (WebCore::RenderGrid::computeNormalizedFractionBreadth): Deleted.
1298         * rendering/RenderGrid.h:
1299
1300 2015-09-29  Csaba Osztrogonác  <ossy@webkit.org>
1301
1302         Fix the broken !ENABLE(STREAM_API) build
1303         https://bugs.webkit.org/show_bug.cgi?id=149525
1304
1305         Reviewed by Darin Adler.
1306
1307         * bindings/js/WebCoreJSClientData.h: Revert r190225.
1308
1309
1310 2015-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1311
1312         printing does not use minimum page zoom factor
1313         https://bugs.webkit.org/show_bug.cgi?id=108507
1314
1315         Reviewed by Darin Adler.
1316
1317         * page/PrintContext.cpp:
1318         (WebCore::PrintContext::beginAndComputePageRectsWithPageSize):
1319         Helper function to share common code from numberOfPages() and
1320         spoolAllPagesWithBoundaries().
1321         (WebCore::PrintContext::numberOfPages): Use beginAndComputePageRectsWithPageSize().
1322         (WebCore::PrintContext::spoolAllPagesWithBoundaries): Use
1323         beginAndComputePageRectsWithPageSize() and don't flip the Y axis
1324         for non Cocoa platforms.
1325         * page/PrintContext.h:
1326
1327 2015-09-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1328
1329         Add support for WebIDL JSBuiltin attributes
1330         https://bugs.webkit.org/show_bug.cgi?id=149554
1331
1332         Reviewed by Darin Adler.
1333
1334         Covered by bindings tests.
1335
1336         * bindings/scripts/CodeGeneratorGObject.pm:
1337         (SkipAttribute): Disabled GObject binding generation of JSBuiltin attribute.
1338         * bindings/scripts/CodeGeneratorJS.pm:
1339         (GetAttributeGetterName): Handling of Builtin function to retrieve BuiltinGenerator.
1340         (GetAttributeSetterName): Ditto.
1341         (GenerateAttributesHashTable): Set JSBuiltin attributes as "Accessor | Builtin".
1342         (GenerateImplementation): Skip implementation for JSBuiltin attributes
1343         * bindings/scripts/test/JS/JSTestObj.cpp: Adding binding test for JSBuiltin attributes.
1344         * bindings/scripts/test/ObjC/DOMTestObj.h:
1345         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1346         (-[DOMTestObj jsBuiltinAttribute]):
1347         (-[DOMTestObj setJsBuiltinAttribute:]):
1348         (-[DOMTestObj jsBuiltinReadOnlyAttribute]):
1349         * bindings/scripts/test/TestObj.idl: Ditto.
1350
1351 2015-09-28  Brent Fulgham  <bfulgham@apple.com>
1352
1353         [Win] Fix build after r190295.
1354
1355         * PlatformWin.cmake: Add missing Forwarding Header.
1356
1357 2015-09-28  Brady Eidson  <beidson@apple.com>
1358
1359         Add an IDB Server that can roundtrip a request back to the client.
1360         https://bugs.webkit.org/show_bug.cgi?id=149603
1361
1362         Reviewed by NOBODY (Build fix).
1363
1364         * Modules/indexeddb/IDBRequest.h: Remove unneeded #include, fixing the WK/WK2 builds.
1365
1366 2015-09-28  Brent Fulgham  <bfulgham@apple.com>
1367
1368         Expose 'geometryFlipped' state for debugging/logging purposes
1369         https://bugs.webkit.org/show_bug.cgi?id=149557
1370
1371         Reviewed by Simon Fraser.
1372
1373         No new tests: No new behavior.
1374
1375         * platform/graphics/ca/PlatformCALayer.h:
1376         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1377         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1378         (PlatformCALayerCocoa::geometryFlipped): Added.
1379         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1380         (PlatformCALayerWin::geometryFlipped): Added.
1381         (printLayer): Log flipped state of geometry.
1382         * platform/graphics/ca/win/PlatformCALayerWin.h:
1383
1384 2015-09-28  Brady Eidson  <beidson@apple.com>
1385
1386         Add an IDB Server that can roundtrip a request back to the client.
1387         https://bugs.webkit.org/show_bug.cgi?id=149603
1388
1389         Reviewed by Alex Christensen.
1390
1391         Test: storage/indexeddb/modern/deletedatabase-request-event.html
1392
1393         This is a critical piece of IDB infrastructure that:
1394         - Puts a database client/server divide in place.
1395         - Client synchronously sends requests to the server, and asynchronously receives a response back from it.
1396         - Introduces a class structure that makes it easy for WebKit2 to add a thin layer to replace the 
1397           in-process server with an out-of-process server.
1398
1399         To allow for the most basic of tests, the "delete database" request is hard coded as always failing 
1400         with an indeterminate error.
1401
1402         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1403         (WebCore::DOMWindowIndexedDatabase::indexedDB):
1404
1405         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1406         (WebCore::IDBDatabaseIdentifier::debugString):
1407         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1408
1409         * Modules/indexeddb/client/IDBConnectionToServer.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp.
1410         (WebCore::IDBClient::IDBConnectionToServer::create):
1411         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer):
1412         (WebCore::IDBClient::IDBConnectionToServer::identifier):
1413         (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
1414         (WebCore::IDBClient::IDBConnectionToServer::didDeleteDatabase):
1415
1416         * Modules/indexeddb/client/IDBConnectionToServer.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
1417         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
1418         (WebCore::IDBClient::IDBConnectionToServerDelegate::~IDBConnectionToServerDelegate):
1419
1420         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
1421         (WebCore::IDBClient::IDBFactory::create):
1422         (WebCore::IDBClient::IDBFactory::IDBFactory):
1423         (WebCore::IDBClient::IDBFactory::openInternal):
1424         (WebCore::IDBClient::IDBFactory::deleteDatabase):
1425         * Modules/indexeddb/client/IDBFactoryImpl.h:
1426
1427         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1428         (WebCore::IDBClient::IDBOpenDBRequest::createDeleteRequest):
1429         (WebCore::IDBClient::IDBOpenDBRequest::createOpenRequest):
1430         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
1431         (WebCore::IDBClient::IDBOpenDBRequest::~IDBOpenDBRequest):
1432         (WebCore::IDBClient::IDBOpenDBRequest::requestCompleted):
1433         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
1434         (WebCore::IDBClient::IDBOpenDBRequest::databaseIdentifier):
1435         (WebCore::IDBClient::IDBOpenDBRequest::version):
1436         (WebCore::IDBClient::IDBOpenDBRequest::create): Deleted.
1437
1438         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1439         (WebCore::IDBClient::IDBRequest::IDBRequest):
1440         (WebCore::IDBClient::IDBRequest::enqueueEvent):
1441         * Modules/indexeddb/client/IDBRequestImpl.h:
1442         (WebCore::IDBClient::IDBRequest::requestIdentifier):
1443
1444         * Modules/indexeddb/server/IDBConnectionToClient.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp.
1445         (WebCore::IDBServer::IDBConnectionToClient::create):
1446         (WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient):
1447         (WebCore::IDBServer::IDBConnectionToClient::identifier):
1448         (WebCore::IDBServer::IDBConnectionToClient::didDeleteDatabase):
1449         * Modules/indexeddb/server/IDBConnectionToClient.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
1450         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
1451         (WebCore::IDBServer::IDBConnectionToClientDelegate::~IDBConnectionToClientDelegate):
1452
1453         * Modules/indexeddb/server/IDBServer.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp.
1454         (WebCore::IDBServer::IDBServer::create):
1455         (WebCore::IDBServer::IDBServer::IDBServer):
1456         (WebCore::IDBServer::IDBServer::registerConnection):
1457         (WebCore::IDBServer::IDBServer::unregisterConnection):
1458         (WebCore::IDBServer::IDBServer::deleteDatabase):
1459         * Modules/indexeddb/server/IDBServer.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
1460
1461         * Modules/indexeddb/shared/IDBError.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.cpp.
1462         (WebCore::idbExceptionEntry):
1463         (WebCore::IDBError::IDBError):
1464         (WebCore::IDBError::operator=):
1465         (WebCore::IDBError::name):
1466         (WebCore::IDBError::message):
1467         * Modules/indexeddb/shared/IDBError.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.cpp.
1468         (WebCore::IDBError::IDBError):
1469         (WebCore::IDBError::isNull):
1470
1471         * Modules/indexeddb/shared/IDBRequestData.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp.
1472         (WebCore::IDBRequestData::IDBRequestData):
1473         * Modules/indexeddb/shared/IDBRequestData.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
1474         (WebCore::IDBRequestData::requestIdentifier):
1475         (WebCore::IDBRequestData::databaseIdentifier):
1476
1477         * Modules/indexeddb/shared/IDBRequestIdentifier.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp.
1478         (WebCore::nextRequestNumber):
1479         (WebCore::IDBRequestIdentifier::IDBRequestIdentifier):
1480         (WebCore::IDBRequestIdentifier::emptyValue):
1481         (WebCore::IDBRequestIdentifier::deletedValue):
1482         (WebCore::IDBRequestIdentifier::isHashTableDeletedValue):
1483         * Modules/indexeddb/shared/IDBRequestIdentifier.h: Added.
1484         (WebCore::IDBRequestIdentifier::isEmpty):
1485         (WebCore::IDBRequestIdentifier::hash):
1486         (WebCore::IDBRequestIdentifier::operator==):
1487         (WebCore::IDBRequestIdentifier::connectionIdentifier):
1488         (WebCore::IDBRequestIdentifierHash::hash):
1489         (WebCore::IDBRequestIdentifierHash::equal):
1490         (WebCore::IDBRequestIdentifierHashTraits::emptyValue):
1491         (WebCore::IDBRequestIdentifierHashTraits::isEmptyValue):
1492         (WebCore::IDBRequestIdentifierHashTraits::constructDeletedValue):
1493         (WebCore::IDBRequestIdentifierHashTraits::isDeletedValue):
1494
1495         * Modules/indexeddb/shared/IDBResultData.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
1496         (WebCore::IDBResultData::IDBResultData):
1497         * Modules/indexeddb/shared/IDBResultData.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h.
1498         (WebCore::IDBResultData::requestIdentifier):
1499         (WebCore::IDBResultData::error):
1500
1501         * Modules/indexeddb/shared/InProcessIDBServer.cpp: Added.
1502         (WebCore::InProcessIDBServer::create):
1503         (WebCore::InProcessIDBServer::InProcessIDBServer):
1504         (WebCore::InProcessIDBServer::identifier):
1505         (WebCore::InProcessIDBServer::connectionToServer):
1506         (WebCore::InProcessIDBServer::connectionToClient):
1507         (WebCore::InProcessIDBServer::deleteDatabase):
1508         (WebCore::InProcessIDBServer::didDeleteDatabase):
1509         * Modules/indexeddb/shared/InProcessIDBServer.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h.
1510
1511         * CMakeLists.txt:
1512         * WebCore.xcodeproj/project.pbxproj:
1513
1514         * loader/EmptyClients.cpp:
1515
1516         * page/DatabaseProvider.h:
1517
1518         * page/Page.cpp:
1519         (WebCore::Page::idbConnection):
1520         * page/Page.h:
1521
1522         * page/SecurityOriginData.cpp:
1523         (WebCore::SecurityOriginData::debugString):
1524         * page/SecurityOriginData.h:
1525
1526 2015-09-28  Ryosuke Niwa  <rniwa@webkit.org>
1527
1528         relatedNode should be retargeted respecting slots
1529         https://bugs.webkit.org/show_bug.cgi?id=149591
1530
1531         Reviewed by Antti Koivisto.
1532
1533         This patch retargets relatedNode with respect to shadow boundaries after r190214 as specified in
1534         https://w3c.github.io/webcomponents/spec/shadow/#retargeting-relatedtarget
1535
1536         Naively implementing the spec'ed behavior can result in O(n^2) behavior since we need to find the common tree scope
1537         ancestor for each target in the event path. This patch avoids this by implementing an O(1) incremental update step
1538         for when target's tree scope changes in the event path. See the description for moveToNewTreeScope below.
1539
1540         Test: fast/shadow-dom/event-with-related-target.html
1541
1542         * dom/EventContext.h: Replaced toMouseOrFocusEventContext by downcast<MouseOrFocusEventContext>.
1543         * dom/EventDispatcher.cpp:
1544         (WebCore::EventRelatedNodeResolver): Removed the code for relatedNode. This class is now only used for touch events.
1545         (WebCore::EventPath): Added m_event as a member variable.
1546
1547         (WebCore::RelatedNodeRetargeter): Added.
1548
1549         (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): Does the initial retargeting of relatedNode. When the
1550         tree scope of relatedNode and the target are the same, we immediately exit without collecting ancestor tree scopes
1551         of relatedNode as an optimization. We also special case when the relatedNode and the target are in two different
1552         documents (relatedNode should be nullptr) and when one is in document and the other one is not in the document
1553         (relatedNode should be the host of the outermost shadow root). Otherwise we have to do the real work by collecting
1554         all tree scope ancestors and walking downwards from the document tree scope (note target and relatedNode share the
1555         same document scope here since we would have exited early otherwise).
1556
1557         (WebCore::RelatedNodeRetargeter::currentNode): Returned relatedNode retargeted for the current tree scope.
1558
1559         (WebCore::RelatedNodeRetargeter::moveToNewTreeScope): Moves to a new tree scope. If the original target and
1560         relatedNode were in different trees, there is nothing to be done. Note that we can only move out of a shadow root
1561         to its host or move into a slot so newTreeScope (current target's tree scope) and previousTreeScope (previous
1562         target's tree scope) must have a child-parent relationship.
1563
1564         If previousTreeScope did not contain the retargeted relatedNode, then neither can its child shadow trees. Thus,
1565         there is nothing to be done when moving into a slot in this case. If we're moving out of previousTreeScope, then
1566         newTreeScope may contain the retargeted relatedNode but that still doesn't require any work. So we exit early in
1567         both cases.
1568
1569         Otherwise (previousTreeScope contained retargeted relatedNode), if we're moving out of a child shadow root
1570         (previousTreeScope) then relatedNode should also move to previousTreeScope's shadow host since previousTreeScope
1571         is a direct-child shadow tree of newTreeScope and previousTreeScope's shadow host resides in newTreeScope.
1572
1573         If we're moving into a child shadow root via a slot, then there are three possibilities: relatedNode is in
1574         previousTreeScope, newTreeScope and its child shadow trees, or newTreeScope's sibling tree scopes and its children.
1575         If it is in previousTreeScope (m_lowestCommonAncestorIndex is zero) or in newTreeScope's sibling, then
1576         previousTreeScope is the lowest common tree scope ancestor so there is nothing to be done. If relatedNode is in
1577         newTreeScope, then the retargeted relatedNode is either the shadow host of the shadow tree that contains
1578         relatedNode or relatedNode itself.
1579
1580         (WebCore::RelatedNodeRetargeter::checkConsistency): Finds the retargeted relatedNode in the simplest way to verify
1581         the correctness of the algorithm. We can disable this consistency check if it slows down debug builds too much.
1582         (WebCore::RelatedNodeRetargeter::nodeInLowestCommonAncestor): Finds the 
1583         (WebCore::RelatedNodeRetargeter::collectTreeScopes):
1584         (WebCore::EventPath::setRelatedTarget): Rewritten using RelatedNodeRetargeter.
1585
1586 2015-09-28  Alex Christensen  <achristensen@webkit.org>
1587
1588         Build WK1 with CMake on Mac
1589         https://bugs.webkit.org/show_bug.cgi?id=149604
1590
1591         Reviewed by Chris Dumez.
1592
1593         * CMakeLists.txt:
1594         * PlatformMac.cmake:
1595         Make a list of IDL files for the ObjC bindings.
1596
1597 2015-09-28  Chris Dumez  <cdumez@apple.com>
1598
1599         Drop support for legacy EventException
1600         https://bugs.webkit.org/show_bug.cgi?id=149597
1601         <rdar://problem/22879795>
1602
1603         Reviewed by Sam Weinig.
1604
1605         Drop support for legacy EventException. Both Firefox and Chrome do not
1606         support it, and our implementation no longer throws such exceptions.
1607
1608         No new tests, already covered by existing test.
1609
1610         * CMakeLists.txt:
1611         * DerivedSources.cpp:
1612         * DerivedSources.make:
1613         * Modules/indexeddb/legacy/LegacyRequest.cpp:
1614         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
1615         * Modules/websockets/WebSocket.cpp:
1616         * WebCore.vcxproj/WebCore.vcxproj:
1617         * WebCore.vcxproj/WebCore.vcxproj.filters:
1618         * WebCore.xcodeproj/project.pbxproj:
1619         * bindings/gobject/WebKitDOMPrivate.cpp:
1620         * bindings/js/JSExceptionBase.cpp:
1621         (WebCore::toExceptionBase): Deleted.
1622         * dom/DOMAllInOne.cpp:
1623         * dom/DOMExceptions.in:
1624         * dom/EventException.cpp: Removed.
1625         * dom/EventException.h:
1626         (WebCore::EventException::EventException): Deleted.
1627         * dom/EventException.idl:
1628         * dom/EventListenerMap.cpp:
1629         * dom/EventTarget.cpp:
1630         * dom/MessagePort.cpp:
1631         * dom/Node.cpp:
1632         * loader/appcache/DOMApplicationCache.cpp:
1633         * page/DOMWindow.cpp:
1634         * page/EventSource.cpp:
1635         * page/PerformanceUserTiming.h:
1636         * workers/AbstractWorker.cpp:
1637         * workers/Worker.cpp:
1638         * workers/WorkerGlobalScope.cpp:
1639         * xml/XMLHttpRequest.cpp:
1640         * xml/XMLHttpRequestUpload.cpp:
1641
1642 2015-09-28  Chris Dumez  <cdumez@apple.com>
1643
1644         Object.getOwnPropertyNames() does not return named properties
1645         https://bugs.webkit.org/show_bug.cgi?id=149562
1646         <rdar://problem/22879779>
1647
1648         Reviewed by Darin Adler.
1649
1650         Previously, Object.getOwnPropertyNames() did not return named properties
1651         for interfaces with named property getters. This patch adds support for
1652         this in the JS bindings generator and uses it for HTMLCollection only
1653         for now. Other interfaces will be taken care of independently.
1654
1655         Note that currently, even though the named properties are returned by
1656         Object.getOwnPropertyNames(), these properties are still not enumerated.
1657         This is because these are always unenumerable for existing DOM interfaces:
1658         - https://dom.spec.whatwg.org/#interface-htmlcollection
1659         - https://dom.spec.whatwg.org/#namednodemap
1660
1661         In the future, we may need to extend support if some interfaces require
1662         those to be enumerable.
1663
1664         Test: fast/dom/htmlcollection-getownpropertynames.html
1665
1666         * Modules/mediastream/RTCStatsResponse.cpp:
1667         (WebCore::WebCore::RTCStatsResponse::supportedPropertyNames):
1668         * Modules/mediastream/RTCStatsResponse.h:
1669         * bindings/scripts/CodeGeneratorJS.pm:
1670         (GenerateHeader):
1671         (GenerateImplementation):
1672         * css/StyleSheetList.cpp:
1673         (WebCore::StyleSheetList::supportedPropertyNames):
1674         * css/StyleSheetList.h:
1675         * dom/DOMNamedFlowCollection.cpp:
1676         (WebCore::DOMNamedFlowCollection::supportedPropertyNames):
1677         * dom/DOMNamedFlowCollection.h:
1678         * dom/NamedNodeMap.cpp:
1679         (WebCore::NamedNodeMap::supportedPropertyNames):
1680         * dom/NamedNodeMap.h:
1681         * html/HTMLCollection.cpp:
1682         (WebCore::HTMLCollection::supportedPropertyNames):
1683         * html/HTMLCollection.h:
1684         (WebCore::CollectionNamedElementCache::propertyNames):
1685         (WebCore::CollectionNamedElementCache::appendToIdCache):
1686         (WebCore::CollectionNamedElementCache::appendToNameCache):
1687         (WebCore::CollectionNamedElementCache::memoryCost):
1688         (WebCore::CollectionNamedElementCache::append):
1689         * plugins/DOMMimeTypeArray.cpp:
1690         (WebCore::DOMMimeTypeArray::supportedPropertyNames):
1691         * plugins/DOMMimeTypeArray.h:
1692         * plugins/DOMPlugin.cpp:
1693         (WebCore::DOMPlugin::supportedPropertyNames):
1694         * plugins/DOMPlugin.h:
1695         * plugins/DOMPluginArray.cpp:
1696         (WebCore::DOMPluginArray::supportedPropertyNames):
1697         * plugins/DOMPluginArray.h:
1698
1699 2015-09-28  Per Arne Vollan  <peavo@outlook.com>
1700
1701         [Curl] Deadlock when downloading.
1702         https://bugs.webkit.org/show_bug.cgi?id=149596
1703
1704         Reviewed by Alex Christensen.
1705
1706         Avoid grabbing the same lock twice.
1707
1708         * platform/network/curl/CurlDownload.cpp:
1709         (WebCore::CurlDownload::init):
1710         (WebCore::CurlDownload::addHeaders):
1711
1712 2015-09-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
1713
1714         An SVG inherits the container size of the previously drawn HTMLImageElement when drawing it on a canvas
1715         https://bugs.webkit.org/show_bug.cgi?id=148845
1716
1717         Reviewed by Darin Adler.
1718
1719         When drawing an SVG image on a canvas we need to make sure that the container
1720         size of the SVG is set to the image source size. If we do not do that, the
1721         previous container size will be used as the size of the image. When drawing
1722         it as HTMLImageElement, the renderer calls SVGImage::drawForContainer() which
1723         calls setContainerSize() and then calls draw(). This call ensures that the
1724         size is set correctly for cached images. But when drawing the SVGImage on
1725         CanvasRenderingContext2D, the SVGImage::draw() is called directly because
1726         it calls it through the base class method Image::draw().
1727         
1728         If the image.isSVGImage(), CanvasRenderingContext2D::drawImage() has to call
1729         SVGImage::setContainerSize() before calling Image::draw().
1730
1731         Test: svg/as-image/svg-cached-draw-canvas.html
1732
1733         * html/canvas/CanvasRenderingContext2D.cpp:
1734         (WebCore::CanvasRenderingContext2D::drawImage):
1735         Call SVGImage::setContainerSize() before calling Image::draw().
1736
1737 2015-09-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
1738
1739         Rename all the variables and parameters of type HTMLImageElement in CanvasRenderingContext2D.cpp from 'image' to 'imageElement'
1740
1741         Reviewed by Darin Adler.
1742
1743         This does not change functionality in this file. It is a preparation for
1744         the fix of the https://bugs.webkit.org/show_bug.cgi?id=148845.
1745
1746         * html/canvas/CanvasRenderingContext2D.cpp:
1747         (WebCore::size):
1748         (WebCore::normalizeRect):
1749         (WebCore::CanvasRenderingContext2D::drawImageFromRect):
1750         (WebCore::CanvasRenderingContext2D::setAlpha):
1751         (WebCore::CanvasRenderingContext2D::createRadialGradient):
1752         (WebCore::CanvasRenderingContext2D::createPattern):
1753         (WebCore::CanvasRenderingContext2D::drawImage):
1754
1755 2015-09-27  Yusuke Suzuki  <utatane.tea@gmail.com>
1756
1757         [ES6] Implement ES6 Module loader hook stubs in WebCore
1758         https://bugs.webkit.org/show_bug.cgi?id=149574
1759
1760         Reviewed by Ryosuke Niwa.
1761
1762         In this patch, we implement the loader hooks in the WebCore side.
1763         Since the fetcher and actual evaluation code are separated from
1764         this patch, they become empty.
1765
1766         Here, WebCore implements 3 loader hooks.
1767
1768         1. resolve hook
1769
1770             Takes the module name and resolve it to the unique module key.
1771             In WebCore, we use URL as a module key.
1772             And for the inlined module tag (e.g. <script type="module">import ...</script>),
1773             we use the ES6 symbol as a module key.
1774             In WebCore, we take the module name like "./hello.js" and resolve it by using
1775             the URL of the importer module.
1776             This functionality is implemented in this patch.
1777
1778         2. fetch hook
1779
1780             Fetches the resource specified by the module key. In WebCore, the module key is
1781             URL. We use CachedResource loading system to load the resource of the modules.
1782             The actual code of the fetch hook will be implemented in the subsequent patch.
1783
1784         3. evaluate hook
1785
1786             This is additional hook to instrument the module's execution for the inspector.
1787             The actual code of the evaluate hook will be implemented in the subsequent patch.
1788
1789         In addition to that, we added required JSC forward headers for the module loader
1790         implementation.
1791
1792         * CMakeLists.txt:
1793         * ForwardingHeaders/runtime/JSInternalPromise.h: Added.
1794         * ForwardingHeaders/runtime/JSInternalPromiseDeferred.h: Added.
1795         * ForwardingHeaders/runtime/JSModuleRecord.h: Added.
1796         * ForwardingHeaders/runtime/Symbol.h: Added.
1797         * WebCore.vcxproj/WebCore.vcxproj:
1798         * WebCore.vcxproj/WebCore.vcxproj.filters:
1799         * WebCore.xcodeproj/project.pbxproj:
1800         * bindings/js/JSBindingsAllInOne.cpp:
1801         * bindings/js/JSDOMWindowBase.cpp:
1802         (WebCore::JSDOMWindowBase::moduleLoaderResolve):
1803         (WebCore::JSDOMWindowBase::moduleLoaderFetch):
1804         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
1805         * bindings/js/JSDOMWindowBase.h:
1806         * bindings/js/JSModuleLoader.cpp: Added.
1807         (WebCore::JSModuleLoader::JSModuleLoader):
1808         (WebCore::JSModuleLoader::resolve):
1809         (WebCore::JSModuleLoader::fetch):
1810         (WebCore::JSModuleLoader::evaluate):
1811         * bindings/js/JSModuleLoader.h: Added.
1812         (WebCore::JSModuleLoader::document):
1813         * dom/Document.cpp:
1814         (WebCore::Document::Document):
1815         (WebCore::Document::~Document):
1816         * dom/Document.h:
1817         (WebCore::Document::moduleLoader):
1818
1819 2015-09-26  Hunseop Jeong  <hs85.jeong@samsung.com>
1820
1821         Use modern for-loops in WebCore/inspector.
1822         https://bugs.webkit.org/show_bug.cgi?id=149579
1823
1824         Reviewed by Darin Adler.
1825
1826         No new tests because there is no behavior change.
1827
1828         * inspector/DOMPatchSupport.cpp:
1829         (WebCore::DOMPatchSupport::diff):
1830         (WebCore::DOMPatchSupport::innerPatchChildren):
1831         (WebCore::DOMPatchSupport::removeChildAndMoveToNew):
1832         (WebCore::DOMPatchSupport::markNodeAsUsed):
1833         * inspector/InspectorCSSAgent.cpp:
1834         (WebCore::computePseudoClassMask):
1835         (WebCore::ChangeRegionOversetTask::timerFired):
1836         (WebCore::InspectorCSSAgent::getNamedFlowCollection):
1837         (WebCore::InspectorCSSAgent::resetPseudoStates):
1838         * inspector/InspectorDOMAgent.cpp:
1839         (WebCore::RevalidateStyleAttributeTask::timerFired):
1840         (WebCore::InspectorDOMAgent::releaseBackendNodeIds):
1841         (WebCore::InspectorDOMAgent::getEventListenersForNode):
1842         (WebCore::InspectorDOMAgent::getEventListeners):
1843         (WebCore::InspectorDOMAgent::performSearch):
1844         (WebCore::InspectorDOMAgent::styleAttributeInvalidated):
1845         * inspector/InspectorDOMDebuggerAgent.cpp:
1846         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
1847         * inspector/InspectorDatabaseAgent.cpp:
1848         (WebCore::InspectorDatabaseAgent::enable):
1849         (WebCore::InspectorDatabaseAgent::disable):
1850         (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
1851         (WebCore::InspectorDatabaseAgent::databaseId):
1852         (WebCore::InspectorDatabaseAgent::findByFileName):
1853         * inspector/InspectorFrontendClientLocal.cpp:
1854         (WebCore::InspectorFrontendClientLocal::frontendLoaded):
1855         * inspector/InspectorFrontendHost.cpp:
1856         * inspector/InspectorIndexedDBAgent.cpp:
1857         * inspector/InspectorOverlay.cpp:
1858         (WebCore::buildRendererHighlight):
1859         (WebCore::buildObjectForHighlight):
1860         * inspector/InspectorPageAgent.cpp:
1861         (WebCore::InspectorPageAgent::getCookies):
1862         * inspector/InspectorReplayAgent.cpp:
1863         (WebCore::buildInspectorObjectForSession):
1864         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
1865         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
1866         * inspector/InspectorResourceAgent.cpp:
1867         (WebCore::InspectorResourceAgent::willDestroyCachedResource):
1868         (WebCore::InspectorResourceAgent::willRecalculateStyle):
1869         * inspector/InspectorStyleSheet.cpp:
1870         (flattenSourceData):
1871         (WebCore::InspectorStyle::buildArrayForComputedStyle):
1872         (WebCore::InspectorStyle::populateAllProperties):
1873         (WebCore::selectorsFromSource):
1874         (WebCore::InspectorStyleSheet::ruleIndexByStyle):
1875         (WebCore::InspectorStyleSheet::buildArrayForRuleList):
1876         * inspector/InspectorWorkerAgent.cpp:
1877         (WebCore::InspectorWorkerAgent::createWorkerFrontendChannelsForExistingWorkers):
1878         (WebCore::InspectorWorkerAgent::destroyWorkerFrontendChannels):
1879         * inspector/NetworkResourcesData.cpp:
1880         (WebCore::NetworkResourcesData::removeCachedResource):
1881         (WebCore::NetworkResourcesData::clear):
1882         * inspector/PageRuntimeAgent.cpp:
1883         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
1884         * inspector/PageScriptDebugServer.cpp:
1885         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
1886         * inspector/WebConsoleAgent.cpp:
1887         (WebCore::WebConsoleAgent::frameWindowDiscarded):
1888         * inspector/WebInjectedScriptManager.cpp:
1889         (WebCore::WebInjectedScriptManager::discardInjectedScriptsFor):
1890
1891 2015-09-25  Eric Carlson  <eric.carlson@apple.com>
1892
1893         Clean up user media request internal API
1894         https://bugs.webkit.org/show_bug.cgi?id=149527
1895
1896         Reviewed by Tim Horton.
1897
1898         No new tests, no functional change.
1899
1900         * Modules/mediastream/UserMediaRequest.cpp:
1901         (WebCore::UserMediaRequest::constraintsValidated): Use track persistent ID to create vectors
1902           as that is what the platform code needs to map to a capture device.
1903         (WebCore::UserMediaRequest::userMediaAccessGranted): m_chosenXXDeviceUID -> m_XXDeviceUIDAllowed.
1904           Use the device IDs to create the MediaStream. Switch audio/video parameter order.
1905         (WebCore::UserMediaRequest::didCreateStream): Don't assume constraints are valid.
1906         * Modules/mediastream/UserMediaRequest.h:
1907         (WebCore::UserMediaRequest::videoDeviceUIDs):
1908         (WebCore::UserMediaRequest::audioDeviceUIDs):
1909         (WebCore::UserMediaRequest::allowedVideoDeviceUID):
1910         (WebCore::UserMediaRequest::allowedAudioDeviceUID):
1911         (WebCore::UserMediaRequest::requiresAudio): Deleted.
1912         (WebCore::UserMediaRequest::requiresVideo): Deleted.
1913         (WebCore::UserMediaRequest::firstVideoDeviceUID): Deleted.
1914         (WebCore::UserMediaRequest::firstAudioDeviceUID): Deleted.
1915
1916         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1917         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Call setPersistentId.
1918
1919 2015-09-25  Antti Koivisto  <antti@apple.com>
1920
1921         Implement scoped styling for shadow DOM
1922         https://bugs.webkit.org/show_bug.cgi?id=149230
1923
1924         Reviewed by Ryosuke Niwa.
1925
1926         Test: fast/shadow-dom/css-scoping-shadow-with-rules-no-style-leak.html
1927
1928         * css/ElementRuleCollector.cpp:
1929         (WebCore::ElementRuleCollector::collectMatchingRules):
1930
1931             Only use special path here for user agent shadow trees.
1932
1933         * dom/AuthorStyleSheets.cpp:
1934         (WebCore::AuthorStyleSheets::AuthorStyleSheets):
1935         (WebCore::AuthorStyleSheets::removePendingSheet):
1936         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
1937
1938             Basic support for ShadowRoot scoped stylesheets.
1939
1940         * dom/AuthorStyleSheets.h:
1941         (WebCore::AuthorStyleSheets::activeStyleSheets):
1942         * dom/InlineStyleSheetOwner.cpp:
1943         (WebCore::InlineStyleSheetOwner::~InlineStyleSheetOwner):
1944         (WebCore::authorStyleSheetsForElement):
1945         (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
1946         (WebCore::InlineStyleSheetOwner::removedFromDocument):
1947         (WebCore::InlineStyleSheetOwner::clearDocumentData):
1948         (WebCore::InlineStyleSheetOwner::childrenChanged):
1949         (WebCore::InlineStyleSheetOwner::createSheet):
1950         (WebCore::InlineStyleSheetOwner::isLoading):
1951         (WebCore::InlineStyleSheetOwner::sheetLoaded):
1952         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
1953
1954             Basic support for ShadowRoot scoped inline stylesheets.
1955
1956         * dom/InlineStyleSheetOwner.h:
1957         (WebCore::InlineStyleSheetOwner::sheet):
1958         * dom/ShadowRoot.cpp:
1959         (WebCore::ShadowRoot::styleResolver):
1960
1961             Create and initialize ShadowRoot scoped style resolver.
1962
1963         (WebCore::ShadowRoot::resetStyleResolver):
1964         (WebCore::ShadowRoot::authorStyleSheets):
1965
1966             Collection of author stylesheets in the shadow tree.
1967
1968         (WebCore::ShadowRoot::updateStyle):
1969
1970             Trigger style recalc when stylesheets change.
1971
1972         (WebCore::ShadowRoot::cloneNode):
1973         * dom/ShadowRoot.h:
1974         (WebCore::ShadowRoot::resetStyleInheritance):
1975         * html/HTMLStyleElement.h:
1976         * svg/SVGStyleElement.h:
1977
1978 2015-09-25  Alex Christensen  <achristensen@webkit.org>
1979
1980         Clean up CMake build on Mac
1981         https://bugs.webkit.org/show_bug.cgi?id=149573
1982
1983         Reviewed by Chris Dumez.
1984
1985         * CMakeLists.txt:
1986         * PlatformEfl.cmake:
1987         * PlatformGTK.cmake:
1988         * PlatformMac.cmake:
1989         * platform/graphics/DisplayRefreshMonitor.cpp:
1990
1991 2015-09-25  Tim Horton  <timothy_horton@apple.com>
1992
1993         Scrolling a overflow: scroll region makes find overlay holes stick to the edge of the region
1994         https://bugs.webkit.org/show_bug.cgi?id=149572
1995         <rdar://problem/13093602>
1996
1997         Reviewed by Simon Fraser.
1998
1999         Test: fast/text/mark-matches-overflow-clip.html
2000
2001         * rendering/InlineTextBox.cpp:
2002         (WebCore::InlineTextBox::paintTextMatchMarker):
2003         Clip the rendered marker rect to the overflow rect.
2004
2005         * testing/Internals.cpp:
2006         (WebCore::Internals::dumpMarkerRectsForNode):
2007         * testing/Internals.h:
2008         * testing/Internals.idl:
2009         Add a internals function to dump the rendered rects for a marker.
2010
2011 2015-09-25  Alex Christensen  <achristensen@webkit.org>
2012
2013         [Win] Switch to CMake
2014         https://bugs.webkit.org/show_bug.cgi?id=148111
2015
2016         Reviewed by Brent Fulgham.
2017
2018         * WebCore.vcxproj/WebCore.proj:
2019
2020 2015-09-25  Beth Dakin  <bdakin@apple.com>
2021
2022         Clicking on a data detected item inside a form control always pops up a map 
2023         on force touch trackpad
2024         https://bugs.webkit.org/show_bug.cgi?id=149559
2025         -and corresponding-
2026         rdar://problem/22826796
2027
2028         Reviewed by Tim Horton.
2029
2030         The real bug here appears to be a bug in Lookup, but we can work around it. 
2031         For normal text, we call directly into Data Detectors for map results, and 
2032         that works fine. For text within form controls, we did not properly extract 
2033         the text for DD, so we sent it to Lookup instead, and Lookup has this bug 
2034         where they will pop open the map right away. If we properly extract the text 
2035         for form controls, then we can work around this bug.
2036
2037         * editing/mac/DataDetection.mm:
2038         (WebCore::detectItemAtPositionWithRange):
2039         (WebCore::DataDetection::detectItemAroundHitTestResult):
2040
2041 2015-09-25  Brady Eidson  <beidson@apple.com>
2042
2043         PassRefPtr<> to RefPtr<> conversion in legacy IndexedDB code.
2044         https://bugs.webkit.org/show_bug.cgi?id=149558
2045
2046         Reviewed by Beth Dakin.
2047
2048         No new tests (No behavior change.)
2049         
2050         This patch does not attempt to completely remove all PassRefPtr usage inside legacy IDB.
2051
2052         It just switches over all PassRefPtr usage at the top level IDB interfaces that 
2053         modern IDB is implementing.
2054
2055         The rest of the usage inside the legacy implementation can be dealt with later via `git rm`.
2056
2057         * Modules/indexeddb/IDBAny.h:
2058         * Modules/indexeddb/IDBCursor.h:
2059         * Modules/indexeddb/IDBDatabase.h:
2060         * Modules/indexeddb/IDBDatabaseError.h:
2061         * Modules/indexeddb/IDBFactory.h:
2062         * Modules/indexeddb/IDBIndex.h:
2063         * Modules/indexeddb/IDBObjectStore.h:
2064         * Modules/indexeddb/IDBRequest.h:
2065         * Modules/indexeddb/IDBTransaction.h:
2066         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
2067         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
2068         (WebCore::IDBClient::IDBFactory::open):
2069         (WebCore::IDBClient::IDBFactory::deleteDatabase):
2070         * Modules/indexeddb/client/IDBFactoryImpl.h:
2071         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2072         (WebCore::IDBClient::IDBRequest::result):
2073         (WebCore::IDBClient::IDBRequest::error):
2074         (WebCore::IDBClient::IDBRequest::source):
2075         (WebCore::IDBClient::IDBRequest::transaction):
2076         * Modules/indexeddb/client/IDBRequestImpl.h:
2077         * Modules/indexeddb/legacy/LegacyAny.cpp:
2078         (WebCore::LegacyAny::createInvalid):
2079         (WebCore::LegacyAny::createNull):
2080         (WebCore::LegacyAny::createString):
2081         (WebCore::LegacyAny::domStringList):
2082         (WebCore::LegacyAny::idbCursor):
2083         (WebCore::LegacyAny::idbCursorWithValue):
2084         (WebCore::LegacyAny::idbDatabase):
2085         (WebCore::LegacyAny::idbFactory):
2086         (WebCore::LegacyAny::idbIndex):
2087         (WebCore::LegacyAny::idbObjectStore):
2088         (WebCore::LegacyAny::idbTransaction):
2089         (WebCore::LegacyAny::LegacyAny):
2090         * Modules/indexeddb/legacy/LegacyAny.h:
2091         (WebCore::LegacyAny::create):
2092         * Modules/indexeddb/legacy/LegacyCursor.cpp:
2093         (WebCore::LegacyCursor::update):
2094         (WebCore::LegacyCursor::deleteFunction):
2095         * Modules/indexeddb/legacy/LegacyCursor.h:
2096         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
2097         (WebCore::LegacyDatabase::objectStoreNames):
2098         (WebCore::LegacyDatabase::createObjectStore):
2099         (WebCore::LegacyDatabase::transaction):
2100         * Modules/indexeddb/legacy/LegacyDatabase.h:
2101         * Modules/indexeddb/legacy/LegacyFactory.cpp:
2102         (WebCore::LegacyFactory::getDatabaseNames):
2103         (WebCore::LegacyFactory::open):
2104         (WebCore::LegacyFactory::deleteDatabase):
2105         * Modules/indexeddb/legacy/LegacyFactory.h:
2106         * Modules/indexeddb/legacy/LegacyIndex.cpp:
2107         (WebCore::LegacyIndex::openCursor):
2108         (WebCore::LegacyIndex::count):
2109         (WebCore::LegacyIndex::openKeyCursor):
2110         (WebCore::LegacyIndex::get):
2111         (WebCore::LegacyIndex::getKey):
2112         * Modules/indexeddb/legacy/LegacyIndex.h:
2113         (WebCore::LegacyIndex::legacyObjectStore):
2114         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
2115         (WebCore::LegacyObjectStore::indexNames):
2116         (WebCore::LegacyObjectStore::get):
2117         (WebCore::LegacyObjectStore::add):
2118         (WebCore::LegacyObjectStore::put):
2119         (WebCore::LegacyObjectStore::deleteFunction):
2120         (WebCore::LegacyObjectStore::clear):
2121         (WebCore::LegacyObjectStore::createIndex):
2122         (WebCore::LegacyObjectStore::index):
2123         (WebCore::LegacyObjectStore::openCursor):
2124         (WebCore::LegacyObjectStore::count):
2125         * Modules/indexeddb/legacy/LegacyObjectStore.h:
2126         (WebCore::LegacyObjectStore::keyPathAny):
2127         (WebCore::LegacyObjectStore::transaction):
2128         (WebCore::LegacyObjectStore::createIndex):
2129         (WebCore::LegacyObjectStore::count):
2130         * Modules/indexeddb/legacy/LegacyRequest.cpp:
2131         (WebCore::LegacyRequest::result):
2132         (WebCore::LegacyRequest::error):
2133         (WebCore::LegacyRequest::source):
2134         (WebCore::LegacyRequest::transaction):
2135         (WebCore::LegacyRequest::onSuccess):
2136         * Modules/indexeddb/legacy/LegacyRequest.h:
2137         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
2138         (WebCore::LegacyTransaction::objectStore):
2139         * Modules/indexeddb/legacy/LegacyTransaction.h:
2140         * inspector/InspectorIndexedDBAgent.cpp:
2141
2142 2015-09-25  Per Arne Vollan  <peavo@outlook.com>
2143
2144         [WinCairo] Incorrect position for windowless plugins.
2145         https://bugs.webkit.org/show_bug.cgi?id=149524
2146
2147         Reviewed by Alex Christensen.
2148
2149         Added method to get graphics context HDC.
2150
2151         * platform/graphics/GraphicsContext.h:
2152         * platform/graphics/win/GraphicsContextWin.cpp:
2153         (WebCore::GraphicsContext::getWindowsContext):
2154         (WebCore::GraphicsContext::hdc):
2155         (WebCore::GraphicsContextPlatformPrivate::save):
2156
2157 2015-09-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2158
2159         Fix the broken !ENABLE(STREAM_API) build
2160         https://bugs.webkit.org/show_bug.cgi?id=149525
2161
2162         Reviewed by Darin Adler.
2163
2164         Removed some #ifdef ENABLE(STREAMS_API) to make build work when STREAMS_API is off.
2165         This is a temporary fix.
2166
2167         * bindings/js/WebCoreJSClientData.h:
2168         (WebCore::WebCoreJSClientData::WebCoreJSClientData):
2169         (WebCore::initNormalWorldClientData):
2170
2171 2015-09-25  Chris Dumez  <cdumez@apple.com>
2172
2173         Unreviewed, nit fix after r190229.
2174
2175         * dom/Range.cpp:
2176         (WebCore::Range::insertNode):
2177
2178 2015-09-25  Commit Queue  <commit-queue@webkit.org>
2179
2180         Unreviewed, rolling out r190232 and r190236.
2181         https://bugs.webkit.org/show_bug.cgi?id=149555
2182
2183         "It did not help" (Requested by cdumez on #webkit).
2184
2185         Reverted changesets:
2186
2187         "Unreviewed, roll out r187615 as it seems to have caused a ~1%
2188         PLT regression."
2189         http://trac.webkit.org/changeset/190232
2190
2191         "This started failing after this rollout:"
2192         http://trac.webkit.org/changeset/190236
2193
2194 2015-09-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2195
2196         Remove the need for DOMClass in case of JSBuiltinConstructor WebIDL
2197         https://bugs.webkit.org/show_bug.cgi?id=149522
2198
2199         Reviewed by Darin Adler.
2200
2201         Adding generation of the dummy DOM class for JSBuiltinConstructor interfaces.
2202         This is applied to CountQueuingStrategy.
2203
2204         Covered by existing tests of CountQueuingStrategy.
2205
2206         * Modules/streams/CountQueuingStrategy.h: Removed.
2207         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2208         * WebCore.xcodeproj/project.pbxproj: Ditto.
2209         * bindings/scripts/CodeGeneratorJS.pm:
2210         (GenerateHeader): Removal of DOM class header include and generation of dummy class.
2211         (GenerateImplementation): Removal of DOM class header include.
2212         (UseDummyDOMClass): Helper routine.
2213         (GenerateDummyDOMClassForJSBuiltin): Ditto.
2214
2215 2015-09-24  Brent Fulgham  <bfulgham@apple.com>
2216
2217         [Win] Support composited content in WebView render-to-context methods
2218         https://bugs.webkit.org/show_bug.cgi?id=149516
2219         <rdar://problem/22635080>
2220
2221         Reviewed by Simon Fraser.
2222
2223         Extend the CACFLayerTreeHost implementation to render into a passed
2224         device context when requested. When no context is provided (the default
2225         case) paint as normal.
2226
2227         Will be tested by existing compositing tests in a future bug. DumpRenderTree
2228         has to be extended to do this painting properly.
2229
2230         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2231         (WebCore::CACFLayerTreeHost::paint): Accept an optional HDC argument, and
2232         pass it to the render method.
2233         * platform/graphics/ca/win/CACFLayerTreeHost.h:
2234         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp: Add missing SOFT_LINK
2235         command for the WKCACFViewDrawIntoDC.
2236         (WebCore::WKCACFViewLayerTreeHost::paint): Accept optional HDC argument and
2237         pass it to the parent class.
2238         (WebCore::WKCACFViewLayerTreeHost::render): Accept new optional HDC argument.
2239         If provided, call WKCACFViewDrawIntoDC. Otherwise, call WKCACFVIewDraw.
2240         (WebCore::WKCACFViewLayerTreeHost::setShouldInvertColors):
2241         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
2242
2243 2015-09-24  Chris Dumez  <cdumez@apple.com>
2244
2245         Drop [NotDeletable] from QuickTimePluginReplacement.postEvent()
2246         https://bugs.webkit.org/show_bug.cgi?id=149547
2247
2248         Reviewed by Eric Carlson.
2249
2250         Drop [NotDeletable] from QuickTimePluginReplacement.postEvent(). It does
2251         not appear to be needed and this is the last user of this non-standard
2252         IDL attribute. This patch also drops support for this IDL attribute.
2253
2254         * Modules/plugins/QuickTimePluginReplacement.idl:
2255         * bindings/scripts/CodeGeneratorJS.pm:
2256         (ComputeFunctionSpecial):
2257         * bindings/scripts/IDLAttributes.txt:
2258
2259 2015-09-24  Chris Dumez  <cdumez@apple.com>
2260
2261         Node.replaceChild() does not behave according to the specification
2262         https://bugs.webkit.org/show_bug.cgi?id=149546
2263         <rdar://problem/22571887>
2264
2265         Reviewed by Ryosuke Niwa.
2266
2267         Node.replaceChild() does not behave according to the specification. In
2268         particular, when replacing |child| with |node| we are supposed to remove
2269         |node| from its parent *before* removing |child| from its parent:
2270         - https://dom.spec.whatwg.org/#concept-node-replace (Steps 10 & 11)
2271
2272         This patch reverses the order as per the specification. Our new behavior
2273         matches Firefox's behavior. Note that this patch also remove an
2274         optimization when replacing a child with its next sibling. This
2275         optimization was observable from JS. It seems likely this case is not
2276         common enough for it to be an issue. However, we can revisit if we see
2277         it regresses things.
2278
2279         This leads to incorrect Mutation Records being queued in some cases.
2280
2281         No new tests, already covered by existing test.
2282
2283         * dom/ContainerNode.cpp:
2284         (WebCore::ContainerNode::replaceChild):
2285
2286 2015-09-24  Chris Dumez  <cdumez@apple.com>
2287
2288         Unreviewed, roll out r187615 as it seems to have caused a ~1% PLT regression.
2289         <rdar://problem/22657123>
2290
2291         * platform/graphics/FontCache.h:
2292         (WebCore::FontDescriptionKey::makeFlagsKey):
2293         * platform/graphics/FontCascade.cpp:
2294         (WebCore::operator==):
2295         (WebCore::makeFontSelectorFlags):
2296         (WebCore::makeFontCascadeCacheKey):
2297         (WebCore::computeFontCascadeCacheHash):
2298
2299 2015-09-24  David Hyatt  <hyatt@apple.com>
2300
2301         Keep the already-parsed list of terms in custom property values so that we don't have to re-parse them
2302         later when doing variable resolution.
2303         https://bugs.webkit.org/show_bug.cgi?id=149544
2304
2305         Reviewed by Dean Jackson.
2306
2307         * css/CSSComputedStyleDeclaration.cpp:
2308         (WebCore::ComputedStyleExtractor::customPropertyValue):
2309         (WebCore::ComputedStyleExtractor::customPropertyText):
2310         Add a helper for getting the raw text. More closely parallels how non-custom properties work with the
2311         extractor.
2312
2313         (WebCore::ComputedStyleExtractor::propertyValue):
2314         Change propertyValue to use customPropertyText.
2315
2316         (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
2317         Don't copy CSS custom properties into the style declaration. This is just used for things like editing, so
2318         we didn't need to be putting the custom properties into this set.
2319
2320         (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
2321         Patched to go straight to the serialized string value.
2322
2323         (WebCore::ComputedStyleExtractor::customPropertyValue): Deleted.
2324         Replaced by customPropertyText.
2325
2326         * css/CSSComputedStyleDeclaration.h:
2327         Rename customPropertyValue to customPropertyText and make it just return a String.
2328
2329         * css/CSSCustomPropertyValue.h:
2330         (WebCore::CSSCustomPropertyValue::create):
2331         (WebCore::CSSCustomPropertyValue::customCSSText):
2332         (WebCore::CSSCustomPropertyValue::name):
2333         (WebCore::CSSCustomPropertyValue::equals):
2334         (WebCore::CSSCustomPropertyValue::CSSCustomPropertyValue):
2335         (WebCore::CSSCustomPropertyValue::value): Deleted.
2336         Changed to hold both a CSSParserValueList, which it adopts from the CSSParser, and a string value that
2337         is constructed lazily only if the value is serialized. Now the problematic serialization code will only
2338         run if someone uses the CSS OM to trigger a serialization (this should be a rare occurrence, so perf
2339         improves with this change).
2340
2341         * css/CSSGrammar.y.in:
2342         Change parsing of custom properties to be identical to regular properties. This refactoring allows
2343         us to simply invoke the parser from style declarations as well and makes everything behave more
2344         similarly to normal property parsing.
2345
2346         * css/CSSParser.cpp:
2347         (WebCore::CSSParser::parseValue):
2348         (WebCore::CSSParser::parseCustomPropertyValue):
2349         (WebCore::CSSParser::parseCustomPropertyDeclaration):
2350         (WebCore::CSSParser::addCustomPropertyDeclaration): Deleted.
2351         * css/CSSParser.h:
2352         (WebCore::CSSParser::setCustomPropertyName):
2353         We now have a method for parsing custom properties that can be invoked from style declarations. The
2354         parser list is now adopted by the CSSCustomPropertyValue.
2355
2356         * css/CSSParserValues.cpp:
2357         (WebCore::CSSParserValueList::toString):
2358         Build the string serialization code right into CSSParserValueList.
2359
2360         * css/CSSParserValues.h:
2361         Add a toString() method for serialization.
2362
2363         * css/StyleProperties.cpp:
2364         (WebCore::MutableStyleProperties::setProperty):
2365         (WebCore::MutableStyleProperties::setCustomProperty):
2366         Changed to use the new CSSParser functions. This makes the code behave almost identically to regular
2367         property parsing.
2368
2369         * css/StyleResolver.cpp:
2370         (WebCore::StyleResolver::applyProperty):
2371         * rendering/style/RenderStyle.h:
2372         * rendering/style/StyleCustomPropertyData.h:
2373         Change the mapping on RenderStyle to store the custom CSS values. This way we can get to the original
2374         parser lists for each variable when it comes time to do variable resolution.
2375
2376 2015-09-24  Chris Dumez  <cdumez@apple.com>
2377
2378         Rewrite Range::insertNode() as per the latest DOM specification
2379         https://bugs.webkit.org/show_bug.cgi?id=149528
2380
2381         Reviewed by Ryosuke Niwa.
2382
2383         Rewrite Range::insertNode() as per the latest DOM specification:
2384         - https://dom.spec.whatwg.org/#concept-range-insert
2385
2386         Our previous implementation seemed outdated as we were failing a lot of
2387         W3C tests that Firefox is passing.
2388
2389         No new tests, already covered by existing tests.
2390
2391         * dom/ContainerNode.cpp:
2392         (WebCore::ContainerNode::ensurePreInsertionValidity):
2393         (WebCore::checkPreReplacementValidity):
2394         (WebCore::ContainerNode::insertBefore):
2395         (WebCore::ContainerNode::replaceChild):
2396         (WebCore::ContainerNode::appendChild):
2397         * dom/ContainerNode.h:
2398         * dom/Range.cpp:
2399         (WebCore::Range::insertNode):
2400         (WebCore::Range::surroundContents):
2401         (WebCore::Range::toString): Deleted.
2402         (WebCore::Range::toHTML): Deleted.
2403         (WebCore::Range::text): Deleted.
2404         (WebCore::Range::createContextualFragment): Deleted.
2405         (WebCore::Range::detach): Deleted.
2406         (WebCore::Range::absoluteBoundingBox): Deleted.
2407         * dom/Range.h:
2408
2409 2015-09-24  Brent Fulgham  <bfulgham@apple.com>
2410
2411         [Win] Unreviewed build failure.
2412
2413         * bindings/js/WebCoreJSClientData.h: Make sure Streams API headers
2414         are only included if the feature is on.
2415
2416 2015-09-24  Ryosuke Niwa  <rniwa@webkit.org>
2417
2418         Make event dispatching respect slotting
2419         https://bugs.webkit.org/show_bug.cgi?id=149243
2420
2421         Reviewed by Antti Koivisto.
2422
2423         There are primarily two cases to consider: getting out of a shadow root to its host,
2424         and moving into a slot from an assigned node.
2425
2426         When getting out of a shadow root, either the event originated in its shadow tree
2427         including its nodes' shadow trees (1) or it moved into this shadow tree via a slot (2).
2428         In (1), event.target should be set to the shadow host. In (2), it should be set to the
2429         first node in the event path that belongs to the same tree as the shadow host. In order
2430         to find such a node in O(1), we use a stack of event targets in each (shadow) tree. We
2431         push event.target of the current tree whenever we move up to a slot from an assigned node
2432         and pop it out of the stack when we move out of the shadow tree.
2433
2434         A follow up patch is needed to update the code to resolve related targets.
2435
2436         Tests: fast/shadow-dom/event-inside-shadow-tree.html
2437                fast/shadow-dom/event-inside-slotted-node.html
2438
2439         * dom/EventDispatcher.cpp:
2440         (WebCore::EventPath::EventPath):
2441
2442 2015-09-24  Chris Dumez  <cdumez@apple.com>
2443
2444         Drop XPATH_NAMESPACE_NODE from Node::NodeType enum
2445         https://bugs.webkit.org/show_bug.cgi?id=149532
2446
2447         Reviewed by Ryosuke Niwa.
2448
2449         Drop XPATH_NAMESPACE_NODE from Node::NodeType enum as there is currently
2450         no way to construct such Node in WebKit. This avoid having to handle this
2451         Node type everywhere.
2452
2453         * bindings/gobject/WebKitDOMPrivate.cpp:
2454         (WebKit::wrap): Deleted.
2455         * bindings/objc/DOM.mm:
2456         (kitClass): Deleted.
2457         * dom/Document.cpp:
2458         (WebCore::Document::importNode):
2459         (WebCore::Document::adoptNode): Deleted.
2460         (WebCore::Document::childTypeAllowed): Deleted.
2461         (WebCore::Document::canAcceptChild): Deleted.
2462         * dom/Node.cpp:
2463         (WebCore::Node::dumpStatistics): Deleted.
2464         (WebCore::Node::textContent): Deleted.
2465         (WebCore::Node::ancestorElement): Deleted.
2466         * dom/Node.h:
2467         * dom/Range.cpp:
2468         (WebCore::Range::checkNodeWOffset):
2469         (WebCore::lengthOfContentsInNode): Deleted.
2470         (WebCore::Range::processContentsBetweenOffsets): Deleted.
2471         (WebCore::Range::surroundContents): Deleted.
2472         * editing/MarkupAccumulator.cpp:
2473         (WebCore::MarkupAccumulator::appendStartMarkup): Deleted.
2474         * xml/XPathFunctions.cpp:
2475         (WebCore::XPath::expandedNameLocalPart): Deleted.
2476         * xml/XPathStep.cpp:
2477         (WebCore::XPath::Step::nodesInAxis):
2478         (WebCore::XPath::primaryNodeType): Deleted.
2479         * xml/XPathUtil.cpp:
2480         (WebCore::XPath::stringValue): Deleted.
2481         (WebCore::XPath::isValidContextNode): Deleted.
2482
2483 2015-09-24  David Hyatt  <hyatt@apple.com>
2484
2485         Add support for CSS Custom Properties (in preparation for implementing CSS Variables).
2486         https://bugs.webkit.org/show_bug.cgi?id=130397
2487
2488         Reviewed by Antti Koivisto.
2489
2490         Added new tests in fast/css/custom-properties.
2491
2492         * WebCore.xcodeproj/project.pbxproj:
2493         Add new header files to the project (CSSCustomPropertyValue and StyleCustomPropertyData).
2494
2495         * css/CSSComputedStyleDeclaration.cpp:
2496         (WebCore::ComputedStyleExtractor::customPropertyValue):
2497         (WebCore::ComputedStyleExtractor::propertyValue):
2498         If a custom property value is queried (i.e., it starts with "--"), then we use our
2499         customPropertyValue lookup to go to the RenderStyle and fetch the appropriate custom property
2500         value from the StyleCustomPropertyData.
2501
2502         (WebCore::CSSComputedStyleDeclaration::length):
2503         (WebCore::CSSComputedStyleDeclaration::item):
2504         Patched to include custom properties in the returned array. They appear at the end of the array
2505         after the built-in properties.
2506
2507         (WebCore::ComputedStyleExtractor::propertyMatches):
2508         Patched to check custom properties.
2509
2510         (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
2511         Make sure the custom properties get copied into the StyleDeclaration.
2512
2513         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2514         (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
2515         Patched to call customPropertyValue for custom properties.
2516
2517         * css/CSSComputedStyleDeclaration.h:
2518         Add customPropertyValue() to ComputedStyleExtractor.
2519
2520         * css/CSSCustomPropertyValue.h: Added.
2521         (WebCore::CSSCustomPropertyValue::create):
2522         (WebCore::CSSCustomPropertyValue::equals):
2523         (WebCore::CSSCustomPropertyValue::customCSSText):
2524         (WebCore::CSSCustomPropertyValue::name):
2525         (WebCore::CSSCustomPropertyValue::value):
2526         (WebCore::CSSCustomPropertyValue::CSSCustomPropertyValue):
2527         Custom properties are parsed as a property with an ID of CSSPropertyCustom and a CSSCustomPropertyValue
2528         that holds both the name and the value of the property. Ultimately we might want to just ditch property IDs in
2529         favor of AtomicStrings for all properties, and then the need to special case custom properties would go
2530         away. For now, though, this is the way we work custom properties into the existing system.
2531
2532         * css/CSSGrammar.y.in:
2533         Add a production for recognizing custom properties and storing them using a property ID of CSSPropertyCustom
2534         and a CSSCustomPropertyValue that has the name/value pair.
2535
2536         * css/CSSParser.cpp:
2537         (WebCore::filterProperties):
2538         Patched to track seen custom properties and to handle them correctly.
2539
2540         (WebCore::CSSParser::createStyleProperties):
2541         Pass in a seenCustomProperties table to ensure we bail when encountering the same custom property twice.
2542
2543         (WebCore::CSSParser::addCustomPropertyDeclaration):
2544         Called from the grammar production to create the CSSCustomPropertyValue.
2545
2546         (WebCore::isCustomPropertyIdentifier):
2547         Recognize the -- custom property during lexing.
2548
2549         (WebCore::CSSParser::parseIdentifier):
2550         Patched to return a CUSTOM_PROPERTY token when a custom property is identified.
2551
2552          * css/CSSParser.h:
2553         (WebCore::isCustomPropertyName):
2554         Add a helper function for asking if a property name is custom.
2555
2556         * css/CSSValue.cpp:
2557         (WebCore::CSSValue::equals):
2558         (WebCore::CSSValue::cssText):
2559         (WebCore::CSSValue::destroy):
2560         * css/CSSValue.h:
2561         Patched to add support for CSSCustomPropertyValue.
2562
2563         * css/PropertySetCSSStyleDeclaration.cpp:
2564         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
2565         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
2566         (WebCore::PropertySetCSSStyleDeclaration::getPropertyPriority):
2567         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
2568         (WebCore::PropertySetCSSStyleDeclaration::removeProperty):
2569         Add code for handling custom properties in the CSS OM.
2570
2571         * css/StyleProperties.cpp:
2572         (WebCore::StyleProperties::getPropertyValue):
2573         (WebCore::StyleProperties::getCustomPropertyValue):
2574         (WebCore::StyleProperties::getPropertyCSSValue):
2575         (WebCore::StyleProperties::getCustomPropertyCSSValue):
2576         (WebCore::MutableStyleProperties::removeProperty):
2577         (WebCore::MutableStyleProperties::removeCustomProperty):
2578         (WebCore::StyleProperties::propertyIsImportant):
2579         (WebCore::StyleProperties::customPropertyIsImportant):
2580         (WebCore::MutableStyleProperties::setProperty):
2581         (WebCore::MutableStyleProperties::setCustomProperty):
2582         (WebCore::MutableStyleProperties::addParsedProperty):
2583         (WebCore::MutableStyleProperties::findPropertyIndex):
2584         (WebCore::ImmutableStyleProperties::findCustomPropertyIndex):
2585         (WebCore::MutableStyleProperties::findCustomPropertyIndex):
2586         (WebCore::MutableStyleProperties::findCSSPropertyWithID):
2587         (WebCore::MutableStyleProperties::findCustomCSSPropertyWithName):
2588         (WebCore::StyleProperties::propertyMatches):
2589         (WebCore::StyleProperties::PropertyReference::cssName):
2590         * css/StyleProperties.h:
2591         (WebCore::StyleProperties::findCustomPropertyIndex):
2592         Patched to support handling custom properties in the CSS OM. We have to create equivalent methods that operate
2593         on AtomicString propertyNames instead of on property IDs.
2594
2595         * css/StyleResolver.cpp:
2596         (WebCore::StyleResolver::CascadedProperties::customProperties):
2597         (WebCore::StyleResolver::styleForKeyframe):
2598         (WebCore::StyleResolver::styleForPage):
2599         (WebCore::StyleResolver::applyMatchedProperties):
2600         (WebCore::StyleResolver::applyProperty):
2601         (WebCore::StyleResolver::CascadedProperties::set):
2602         (WebCore::StyleResolver::applyCascadedProperties):
2603         The resolver has to hold a HashMap from AtomicStrings to Properties. It matches identically to how built-in
2604         properties work except that an extensible table (HashMap) is used to hold the property data.
2605
2606         * css/makeprop.pl:
2607         Patched to include the special CSSPropertyCustom value of 1 (just after the CSSPropertyInvalid id value but before the first
2608         built-in property value).
2609
2610         * inspector/InspectorStyleSheet.cpp:
2611         (WebCore::InspectorStyle::getText):
2612         (WebCore::lowercasePropertyName):
2613         (WebCore::InspectorStyle::populateAllProperties):
2614         Patch inspector to not lowercase CSS custom property names, since they are case-sensitive.
2615
2616         * rendering/style/RenderStyle.h:
2617         * rendering/style/StyleCustomPropertyData.h: Added.
2618         (WebCore::StyleCustomPropertyData::create):
2619         (WebCore::StyleCustomPropertyData::copy):
2620         (WebCore::StyleCustomPropertyData::operator==):
2621         (WebCore::StyleCustomPropertyData::operator!=):
2622         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
2623         (WebCore::StyleCustomPropertyData::getCustomPropertyValue):
2624         (WebCore::StyleCustomPropertyData::hasCustomProperty):
2625         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
2626         * rendering/style/StyleRareInheritedData.cpp:
2627         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2628         (WebCore::StyleRareInheritedData::operator==):
2629         * rendering/style/StyleRareInheritedData.h:
2630         The front end storage in the RenderStyle for custom properties. For now, custom properties are always inherited, so the
2631         data is in StyleRareInheritedData.
2632
2633 2015-09-24  Chris Dumez  <cdumez@apple.com>
2634
2635         Optimize Range's lengthOfContentsInNode() for DocumentType Nodes
2636         https://bugs.webkit.org/show_bug.cgi?id=149529
2637
2638         Reviewed by Darin Adler.
2639
2640         Optimize Range's lengthOfContentsInNode() for DocumentType Nodes:
2641         - https://dom.spec.whatwg.org/#concept-node-length
2642
2643         We currently call Node::countChildNodes() unnecessarily on DocumentType
2644         Nodes instead of simply returning 0.
2645
2646         * dom/Range.cpp:
2647         (WebCore::lengthOfContentsInNode):
2648         (WebCore::Range::processContents):
2649
2650 2015-09-24  ChangSeok Oh  <changseok.oh@collabora.com>
2651
2652         Unreviewed, fix typo errors in a comment ("passed" -> "Passed", "Overwise" -> "Otherwise")
2653
2654         * css/mediaControlsGtk.css:
2655
2656 2015-09-24  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2657
2658         Reduce almost uses of PassRefPtr in Webcore/testing
2659         https://bugs.webkit.org/show_bug.cgi?id=149449
2660
2661         Reviewed by Darin Adler.
2662
2663         This patch removes all uses of PassRefPtr except for Internals::serializeObject() and Internals::deserializeObject().
2664         It will be removed by upcoming patch.
2665
2666         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
2667         (WebCore::CDMSessionClearKey::generateKeyRequest):
2668         * Modules/encryptedmedia/CDMSessionClearKey.h:
2669         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2670         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
2671         * platform/graphics/CDMSession.h:
2672         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2673         (WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
2674         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
2675         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
2676         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2677         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
2678         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2679         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2680         (WebCore::CDMSessionMediaSourceAVFObjC::generateKeyRequest):
2681         * testing/InternalSettings.h:
2682         (WebCore::InternalSettings::create):
2683         * testing/Internals.cpp:
2684         (WebCore::Internals::create):
2685         (WebCore::Internals::computedStyleIncludingVisitedInfo):
2686         (WebCore::Internals::markerRangeForNode):
2687         (WebCore::Internals::rangeFromLocationAndLength):
2688         (WebCore::Internals::subrange):
2689         (WebCore::Internals::nodesFromRect):
2690         (WebCore::Internals::mallocStatistics):
2691         (WebCore::Internals::typeConversions):
2692         (WebCore::Internals::memoryInfo):
2693         (WebCore::Internals::serializeObject):
2694         (WebCore::Internals::deserializeBuffer):
2695         (WebCore::Internals::createTimeRanges):
2696         * testing/Internals.h:
2697         * testing/MallocStatistics.h:
2698         (WebCore::MallocStatistics::create):
2699         * testing/MemoryInfo.h:
2700         (WebCore::MemoryInfo::create):
2701         * testing/MockCDM.cpp:
2702         (WebCore::MockCDMSession::generateKeyRequest):
2703         * testing/TypeConversions.h:
2704         (WebCore::TypeConversions::create):
2705
2706 2015-09-24  Ryosuke Niwa  <rniwa@webkit.org>
2707
2708         Ran sort-Xcode-project-file.
2709
2710         * WebCore.xcodeproj/project.pbxproj:
2711
2712 2015-09-24  ChangSeok Oh  <changseok.oh@collabora.com>
2713
2714         [GTK] playbutton in media controls is not changed when it is clicked.
2715         https://bugs.webkit.org/show_bug.cgi?id=149113
2716
2717         Reviewed by Philippe Normand.
2718
2719         When the play button in media controls is clicked, a 'paused' class is added or removed
2720         for the element to update its appearance. Although Document::recalcStyle is triggered
2721         by that class attribute change, the play button is not changed since there is
2722         no difference in styles whether having the 'paused' class or not. Gtk port
2723         does not define the -webkit-media-controls-play-button.paused. To fix this,
2724         -webkit-media-controls-play-button.paused is newly defined with a dummy style,
2725         "position: relative;", which should not change the play button appearance,
2726         but be clearly different in style.
2727
2728         Test: media/media-controls-play-button-updates.html
2729
2730         * css/mediaControlsGtk.css:
2731         (video::-webkit-media-controls-play-button.paused):
2732
2733 2015-09-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2734
2735         Unreviewed. Fix GObject DOM API breaks after r190120.
2736
2737         EntityReference has been removed from the DOM spec. Generate an
2738         empy GObject implementation to keep API and ABI
2739         compatibility. also add a deprecated impementation for the methods
2740         using WebKitEntityReference.
2741
2742         * PlatformGTK.cmake: Do not generate bindings for EntityReference.idl.
2743         * bindings/gobject/WebKitDOMDeprecated.cpp:
2744         (webkit_dom_entity_reference_init):
2745         (webkit_dom_entity_reference_class_init):
2746         (webkit_dom_node_iterator_get_expand_entity_references):
2747         (webkit_dom_tree_walker_get_expand_entity_references):
2748         (webkit_dom_document_create_entity_reference):
2749         * bindings/gobject/WebKitDOMDeprecated.h:
2750         * bindings/gobject/WebKitDOMDeprecated.symbols:
2751         * bindings/scripts/CodeGeneratorGObject.pm:
2752         (SkipFunction): Remove FIXME.
2753         * dom/Document.idl: Do not generate createEntityReference for GObject.
2754         * dom/EntityReference.idl: Do not generate empty files for GObject.
2755
2756 2015-09-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2757
2758         [Streams API] Add support for JS builtins constructor
2759         https://bugs.webkit.org/show_bug.cgi?id=149497
2760
2761         Reviewed by Darin Adler.
2762
2763         Covered by existing tests.
2764
2765         Making CountQueuingStrategy fully JS built-in implemented.
2766         Adding support for calling a JS builtin initialization function just after creating the JSXX object.
2767         This JS function must be named initializeXX and be in XX.Js file.
2768         The JSBuiltinConstructor keyword is added to the binding generator.
2769
2770         * CMakeLists.txt: Adding CountQueuingStrategy.js, removing JSCountQueuingStrategyCustom.cpp.
2771         * DerivedSources.cpp: Ditto.
2772         * DerivedSources.make: Ditto.
2773         * Modules/streams/CountQueuingStrategy.h: Making CountQueuingStrategy a dummy class.
2774         (WebCore::CountQueuingStrategy::create):
2775         (WebCore::CountQueuingStrategy::~CountQueuingStrategy):
2776         (WebCore::CountQueuingStrategy::CountQueuingStrategy):
2777         * Modules/streams/CountQueuingStrategy.idl:
2778         * Modules/streams/CountQueuingStrategy.js: Added.
2779         (size):
2780         (initializeCountQueuingStrategy):
2781         * WebCore.vcxproj/WebCore.vcxproj: Removing JSCountQueuingStrategyCustom.cpp.
2782         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2783         * WebCore.xcodeproj/project.pbxproj: Ditto.
2784         * bindings/js/JSBindingsAllInOne.cpp: Ditto.
2785         * bindings/js/JSCountQueuingStrategyCustom.cpp: Removed.
2786         * bindings/js/JSDOMBinding.cpp: Adding support for DOMConstructorJSBuiltinObject.
2787         (WebCore::callInitializeFunction):
2788         (WebCore::DOMConstructorJSBuiltinObject::visitChildren):
2789         * bindings/js/JSDOMBinding.h: Diitto.
2790         (WebCore::createFromJSBuiltin):
2791         (WebCore::DOMConstructorJSBuiltinObject::DOMConstructorJSBuiltinObject):
2792         * bindings/js/WebCoreJSClientData.h: Adding support for CQS builtins functions.
2793         (WebCore::WebCoreJSClientData::WebCoreJSClientData):
2794         (WebCore::WebCoreJSClientData::countQueuingStrategyBuiltins):
2795         * bindings/scripts/CodeGeneratorJS.pm:
2796         (GetJSBuiltinFunctionName):
2797         (GetFunctionName):
2798         (InstanceNeedsVisitChildren): Generating visitChildren method in case of JSBuiltinConstructor.
2799         (GetParentConstructorClassName): Refactoring to make JSXXConstructor derive from DOMConstructorJSBuiltinObject in case of JSBuiltinConstructor.
2800         (GenerateConstructorDeclaration): Ditto.
2801         (GenerateConstructorDefinition): Generate specific constructor in case of JSBuiltinConstructor.
2802         (GenerateConstructorHelperMethods): Refactoring to use Base class.
2803         (IsConstructable): Ditto.
2804         (ConstructorHasProperties): Deleted.
2805         * bindings/scripts/IDLAttributes.txt: Adding JSBuiltinConstructor.
2806         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2807         (WebCore::JSTestActiveDOMObjectConstructor::JSTestActiveDOMObjectConstructor):
2808         * bindings/scripts/test/JS/JSTestCallback.cpp:
2809         (WebCore::JSTestCallbackConstructor::JSTestCallbackConstructor):
2810         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2811         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
2812         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2813         (WebCore::JSTestCustomNamedGetterConstructor::JSTestCustomNamedGetterConstructor):
2814         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2815         (WebCore::JSTestEventConstructorConstructor::JSTestEventConstructorConstructor):
2816         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2817         (WebCore::JSTestEventTargetConstructor::JSTestEventTargetConstructor):
2818         * bindings/scripts/test/JS/JSTestException.cpp:
2819         (WebCore::JSTestExceptionConstructor::JSTestExceptionConstructor):
2820         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2821         (WebCore::JSTestGenerateIsReachableConstructor::JSTestGenerateIsReachableConstructor):
2822         * bindings/scripts/test/JS/JSTestInterface.cpp:
2823         (WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor):
2824         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2825         (WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor):
2826         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2827         (WebCore::JSTestNamedConstructorConstructor::JSTestNamedConstructorConstructor):
2828         (WebCore::JSTestNamedConstructorNamedConstructor::JSTestNamedConstructorNamedConstructor):
2829         * bindings/scripts/test/JS/JSTestNode.cpp:
2830         (WebCore::JSTestNodeConstructor::JSTestNodeConstructor):
2831         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2832         (WebCore::JSTestNondeterministicConstructor::JSTestNondeterministicConstructor):
2833         * bindings/scripts/test/JS/JSTestObj.cpp:
2834         (WebCore::JSTestObjConstructor::JSTestObjConstructor):
2835         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2836         (WebCore::JSTestOverloadedConstructorsConstructor::JSTestOverloadedConstructorsConstructor):
2837         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2838         (WebCore::JSTestOverrideBuiltinsConstructor::JSTestOverrideBuiltinsConstructor):
2839         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2840         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor):
2841         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2842         (WebCore::JSTestTypedefsConstructor::JSTestTypedefsConstructor):
2843         * bindings/scripts/test/JS/JSattribute.cpp:
2844         (WebCore::JSattributeConstructor::JSattributeConstructor):
2845         * bindings/scripts/test/JS/JSreadonly.cpp:
2846         (WebCore::JSreadonlyConstructor::JSreadonlyConstructor):
2847
2848 2015-09-23  Chris Dumez  <cdumez@apple.com>
2849
2850         Simplify / Optimize Range::selectNode()
2851         https://bugs.webkit.org/show_bug.cgi?id=149515
2852
2853         Reviewed by Ryosuke Niwa.
2854
2855         Simplify / Optimize Range::selectNode():
2856         1. Do a null-check on refNode->parentNode() instead of checking the
2857            nodeType(), which is virtual. Attr, DocumentFragment and Document
2858            Nodes do not have a parent and thus are covered by this check.
2859            Also, setStartBefore() / setEndAfter() were already doing a null
2860            check on the parent.
2861         2. Call lower-level setStart() / setEnd() directly, instead of using
2862            setStartBefore() / setEndAfter() as intermediary. As a result:
2863            2.a. We avoid doing a redundant null checks on refNode and its parent
2864                 (inside those intermediate functions)
2865            2.b. We only call refNode->computeNodeIndex() once instead of twice
2866                 (in each of those intermediate functions). computeNodeIndex()
2867                 is not a trivial getter as its needs to traverse all the
2868                 previous siblings.
2869
2870         The implementation now matches exactly the text of the DOM specification
2871         as well:
2872         https://dom.spec.whatwg.org/#concept-range-select
2873
2874         No new layout tests, no web-exposed behavior intended.
2875
2876         * dom/Range.cpp:
2877         (WebCore::Range::selectNode):
2878
2879 2015-09-23  Myles C. Maxfield  <mmaxfield@apple.com>
2880
2881         [Cocoa] [Font Features] Implement font-variant-*
2882         https://bugs.webkit.org/show_bug.cgi?id=148413
2883
2884         Reviewed by Darin Adler.
2885
2886         This patch is the first pass of implementing of the font-variant-* properties. Specifically,
2887         these properties are:
2888         font-variant-ligatures
2889         font-variant-position
2890         font-variant-caps
2891         font-variant-numeric
2892         font-variant-alternates
2893         font-variant-east-asian
2894
2895         These new properties are held inside FontDescription as bit fields. At font creation time,
2896         we consult with the FontDescription to figure out which variants are specified. We then
2897         convert those variants to font features, and resolve these font features with the additional
2898         features specified by font-feature-settings (as the spec requires). This patch also makes
2899         our caches sensitive to these new properties of FontDescription so we don't look up cached,
2900         stale fonts.
2901
2902         The implementation has some caveats, however. They are listed here:
2903         1. These new properties need to interact correctly with @font-face declarations. In
2904         particular, only certain properties of the FontDescription should be considered when
2905         detecting if a @font-face declaration applies to a particular element. This discrimination
2906         does not happen correctly. In addition, any feature-specific CSS properties inside the
2907         @font-face declaration need to be consulted at a particular point during the feature
2908         resolve. This does not currently occur.
2909         2. One of the properties, font-variant-alternates, has a few values which require custom
2910         CSS functions, which makes modeling the properties as bit fields tricky. These extra values
2911         need to be implemented. This patch implements all the values which do not require extra CSS
2912         features.
2913         3. These new properties have a shorthand, font-variant, which is designed to be backward-
2914         compatible with CSS 2.1's concept of font-variant. In particular, CSS 2.1 allows you to use
2915         "normal" and "small-caps" with font-variant. Both of these values are values of the new
2916         property font-variant-caps. However, our existing implementation of small-caps does not
2917         use font features when they exist; instead, it simply draws text at a smaller font size and
2918         uses (effectively) text-transform to force capital letters. This implementation needs to be
2919         unified with the new font-variant-caps property so that we can expand font-variant to be
2920         a shorthand for the new properties.
2921         4. font-variant-position and font-variant-caps should provide appropriate synthesis if no
2922         matching font-feature exists.
2923         5. FontCascade::typesettingFeatures() is now no-longer accurate. Fixing this would be large
2924         enough to warrant its own patch.
2925         6. These properties are not tested with TrueType fonts.
2926
2927         Tests: css3/font-variant-all-webfont.html
2928                css3/font-variant-parsing.html
2929
2930         * css/CSSComputedStyleDeclaration.cpp: Reconstruct StyleProperties from a RenderStyle.
2931         (WebCore::appendLigaturesValue):
2932         (WebCore::fontVariantLigaturesPropertyValue):
2933         (WebCore::fontVariantPositionPropertyValue):
2934         (WebCore::fontVariantCapsPropertyValue):
2935         (WebCore::fontVariantNumericPropertyValue):
2936         (WebCore::fontVariantAlternatesPropertyValue):
2937         (WebCore::fontVariantEastAsianPropertyValue):
2938         (WebCore::ComputedStyleExtractor::propertyValue):
2939         * css/CSSFontFeatureValue.cpp: Update to FontFeatureTag instead of WTF::String.
2940         (WebCore::CSSFontFeatureValue::CSSFontFeatureValue):
2941         (WebCore::CSSFontFeatureValue::customCSSText):
2942         * css/CSSFontFeatureValue.h: Ditto.
2943         (WebCore::CSSFontFeatureValue::create):
2944         (WebCore::CSSFontFeatureValue::tag):
2945         * css/CSSParser.cpp: Parse the new properties according to the CSS3 fonts spec.
2946         (WebCore::isValidKeywordPropertyAndValue):
2947         (WebCore::isKeywordPropertyID):
2948         (WebCore::CSSParser::parseValue):
2949         (WebCore::CSSParser::parseFontFeatureTag):
2950         (WebCore::CSSParser::parseFontVariantLigatures):
2951         (WebCore::CSSParser::parseFontVariantNumeric):
2952         (WebCore::CSSParser::parseFontVariantEastAsian):
2953         * css/CSSParser.h:
2954         * css/CSSPrimitiveValueMappings.h: For the three properties which are simple keyword value
2955         properties, implement casting operators to automatically convert between RenderStyle
2956         objects and CSS property objects.
2957         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2958         (WebCore::CSSPrimitiveValue::operator FontVariantPosition):
2959         (WebCore::CSSPrimitiveValue::operator FontVariantCaps):
2960         (WebCore::CSSPrimitiveValue::operator FontVariantAlternates):
2961         * css/CSSPropertyNames.in: New properties.
2962         * css/CSSValueKeywords.in: New values.
2963         * css/StyleBuilderConverter.h:
2964         (WebCore::StyleBuilderConverter::convertFontFeatureSettings): Update to not use
2965         RefPtrs.
2966         * css/StyleBuilderCustom.h: Properties which are not simple keyword value properties are
2967         decomposed into multiple members of FontDescription. These properties exist to convert
2968         between these aggregate members and the CSS properties.
2969         (WebCore::StyleBuilderCustom::applyInheritFontVariantLigatures):
2970         (WebCore::StyleBuilderCustom::applyInitialFontVariantLigatures):
2971         (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
2972         (WebCore::StyleBuilderCustom::applyInheritFontVariantNumeric):
2973         (WebCore::StyleBuilderCustom::applyInitialFontVariantNumeric):
2974         (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
2975         (WebCore::StyleBuilderCustom::applyInheritFontVariantEastAsian):
2976         (WebCore::StyleBuilderCustom::applyInitialFontVariantEastAsian):
2977         (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
2978         (WebCore::StyleBuilderCustom::applyInitialWebkitFontVariantLigatures): Deleted.
2979         (WebCore::StyleBuilderCustom::applyInheritWebkitFontVariantLigatures): Deleted.
2980         (WebCore::StyleBuilderCustom::applyValueWebkitFontVariantLigatures): Deleted.
2981         * editing/cocoa/HTMLConverter.mm:
2982         (HTMLConverter::computedAttributesForElement): Unprefix font-variant-ligatures.
2983         * platform/graphics/FontCache.h: Update cache to be sensitive to new state in
2984         FontDescription.
2985         (WebCore::FontDescriptionKey::FontDescriptionKey):
2986         (WebCore::FontDescriptionKey::operator==):
2987         (WebCore::FontDescriptionKey::computeHash):
2988         (WebCore::FontDescriptionKey::makeFlagsKey):
2989         (WebCore::FontDescriptionKey::makeFlagKey): Deleted.
2990         * platform/graphics/FontCascade.cpp:
2991         (WebCore::FontCascade::codePath): These new variants should trigger the complex text
2992         codepath.
2993         * platform/graphics/FontCascade.h:
2994         (WebCore::FontCascade::computeTypesettingFeatures): Update to use new state enum.
2995         * platform/graphics/FontDescription.cpp: Add state to hold new property values.
2996         (WebCore::FontDescription::FontDescription):
2997         (WebCore::FontCascadeDescription::FontCascadeDescription): Deleted.
2998         * platform/graphics/FontDescription.h: Add state to hold new property values.
2999         (WebCore::FontDescription::featureSettings):
3000         (WebCore::FontDescription::variantCommonLigatures):
3001         (WebCore::FontDescription::variantDiscretionaryLigatures):
3002         (WebCore::FontDescription::variantHistoricalLigatures):
3003         (WebCore::FontDescription::variantContextualAlternates):
3004         (WebCore::FontDescription::variantPosition):
3005         (WebCore::FontDescription::variantCaps):
3006         (WebCore::FontDescription::variantNumericFigure):
3007         (WebCore::FontDescription::variantNumericSpacing):
3008         (WebCore::FontDescription::variantNumericFraction):
3009         (WebCore::FontDescription::variantNumericOrdinal):
3010         (WebCore::FontDescription::variantNumericSlashedZero):
3011         (WebCore::FontDescription::variantAlternates):
3012         (WebCore::FontDescription::variantEastAsianVariant):
3013         (WebCore::FontDescription::variantEastAsianWidth):
3014         (WebCore::FontDescription::variantEastAsianRuby):
3015         (WebCore::FontDescription::variantSettings):
3016         (WebCore::FontDescription::setFeatureSettings):
3017         (WebCore::FontDescription::setVariantCommonLigatures):
3018         (WebCore::FontDescription::setVariantDiscretionaryLigatures):
3019         (WebCore::FontDescription::setVariantHistoricalLigatures):
3020         (WebCore::FontDescription::setVariantContextualAlternates):
3021         (WebCore::FontDescription::setVariantPosition):
3022         (WebCore::FontDescription::setVariantCaps):
3023         (WebCore::FontDescription::setVariantNumericFigure):
3024         (WebCore::FontDescription::setVariantNumericSpacing):
3025         (WebCore::FontDescription::setVariantNumericFraction):
3026         (WebCore::FontDescription::setVariantNumericOrdinal):
3027         (WebCore::FontDescription::setVariantNumericSlashedZero):
3028         (WebCore::FontDescription::setVariantAlternates):
3029         (WebCore::FontDescription::setVariantEastAsianVariant):
3030         (WebCore::FontDescription::setVariantEastAsianWidth):
3031         (WebCore::FontDescription::setVariantEastAsianRuby):
3032         (WebCore::FontDescription::operator==):
3033         (WebCore::FontCascadeDescription::initialVariantPosition):
3034         (WebCore::FontCascadeDescription::initialVariantCaps):
3035         (WebCore::FontCascadeDescription::initialVariantAlternates):
3036         (WebCore::FontCascadeDescription::commonLigaturesState): Deleted.
3037         (WebCore::FontCascadeDescription::discretionaryLigaturesState): Deleted.
3038         (WebCore::FontCascadeDescription::historicalLigaturesState): Deleted.
3039         (WebCore::FontCascadeDescription::setCommonLigaturesState): Deleted.
3040         (WebCore::FontCascadeDescription::setDiscretionaryLigaturesState): Deleted.
3041         (WebCore::FontCascadeDescription::setHistoricalLigaturesState): Deleted.
3042         (WebCore::FontCascadeDescription::operator==): Deleted.
3043         * platform/graphics/FontFeatureSettings.cpp: Update to use FontFeatureTag instead of
3044         WTF::String.
3045         (WebCore::FontFeature::FontFeature):
3046         (WebCore::FontFeature::operator==):
3047         (WebCore::FontFeature::operator<):
3048         (WebCore::FontFeatureSettings::hash):
3049         (WebCore::FontFeatureSettings::create): Deleted.
3050         * platform/graphics/FontFeatureSettings.h: Update to use FontFeatureTag instead of
3051         WTF::String.
3052         (WebCore::fontFeatureTag):
3053         (WebCore::FontFeatureTagHash::hash):
3054         (WebCore::FontFeatureTagHash::equal):
3055         (WebCore::FontFeatureTagHashTraits::constructDeletedValue):
3056         (WebCore::FontFeatureTagHashTraits::isDeletedValue):
3057         (WebCore::FontFeature::tag):
3058         (WebCore::FontFeatureSettings::operator==):
3059         (WebCore::FontFeatureSettings::begin):
3060         (WebCore::FontFeatureSettings::end):
3061         (WebCore::FontFeatureSettings::FontFeatureSettings): Deleted.
3062         * platform/graphics/cocoa/FontCacheCoreText.cpp: Ditto. Also, when computing font
3063         features, consult with the state inside FontDescription.
3064         (WebCore::tagEquals):
3065         (WebCore::appendTrueTypeFeature):
3066         (WebCore::appendOpenTypeFeature):
3067         (WebCore::computeFeatureSettingsFromVariants):
3068         (WebCore::preparePlatformFont):
3069         (WebCore::platformFontLookupWithFamily):
3070         (WebCore::fontWithFamily):
3071         (WebCore::FontCache::createFontPlatformData):
3072         (WebCore::FontCache::systemFallbackForCharacters):
3073         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: Update to use references instead of
3074         pointers.
3075         (WebCore::HarfBuzzShaper::setFontFeatures):
3076         * platform/graphics/mac/FontCacheMac.mm:
3077         (WebCore::platformFontWithFamily): Ditto.
3078         * platform/graphics/mac/FontCustomPlatformData.cpp:
3079         (WebCore::FontCustomPlatformData::fontPlatformData): Be sensitive to new state inside FontDescription.
3080         * platform/text/TextFlags.h:
3081         (WebCore::FontVariantSettings::isAllNormal): New state enums.
3082         * rendering/RenderThemeIOS.mm:
3083         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription): Be sensitive to new state inside
3084         FontDescription.
3085         * rendering/line/BreakingContext.h:
3086
3087 2015-09-23  Chris Dumez  <cdumez@apple.com>
3088
3089         Unreviewed, roll out r190085 as it seems to cause crashes in JSC
3090         <rdar://problem/22825602>
3091
3092         * bindings/scripts/CodeGeneratorJS.pm:
3093         (GenerateAttributesHashTable):
3094         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3095         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3096         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3097         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3098         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3099         * bindings/scripts/test/JS/JSTestException.cpp:
3100         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3101         * bindings/scripts/test/JS/JSTestInterface.cpp:
3102         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3103         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3104         * bindings/scripts/test/JS/JSTestNode.cpp:
3105         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3106         * bindings/scripts/test/JS/JSTestObj.cpp:
3107         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3108         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3109         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3110         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3111         * bindings/scripts/test/JS/JSattribute.cpp:
3112         * bindings/scripts/test/JS/JSreadonly.cpp:
3113
3114 2015-09-23  Chris Dumez  <cdumez@apple.com>
3115
3116         HTMLOutputElement.htmlFor should be settable
3117         https://bugs.webkit.org/show_bug.cgi?id=149418
3118
3119         Reviewed by Ryosuke Niwa.
3120
3121         HTMLOutputElement.htmlFor should be settable as per the latest HTML
3122         specification:
3123         - https://html.spec.whatwg.org/multipage/forms.html#the-output-element
3124
3125         It is supposed to call DOMSettableTokenList.setValue() with the input
3126         String. This patch adds support for this by adding [PutForwards=value]
3127         IDL extended attribute.
3128
3129         This aligns our behavior with the specification, Firefox and Chrome.
3130
3131         No new tests, already covered by existing test.
3132
3133         * html/AttributeDOMTokenList.cpp:
3134         (WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
3135         (WebCore::AttributeDOMTokenList::attributeValueChanged):
3136         * html/AttributeDOMTokenList.h:
3137         - Have AttributeDOMTokenList subclass DOMSettableTokenList instead of
3138         DOMTokenList so that it can be used in places where the IDL expects
3139         us to return a DOMSettableTokenList (e.g. HTMLOutputElement.htmlFor).
3140         - Mark AttributeDOMTokenList as fast allocated.
3141
3142         * html/DOMSettableTokenList.cpp:
3143         (WebCore::DOMSettableTokenList::setValue):
3144         * html/DOMSettableTokenList.h:
3145         - Move setValue() from DOMTokenList to DOMSettableTokenList
3146           as it is only needed by DOMSettableTokenList.
3147         - Get rid of the factory function as all call sites are using
3148           AttributeDOMTokenList now.
3149         - Stop inheriting RefCounted as AttributeDOMTokenList handles its
3150           own refcounting.
3151
3152         * html/DOMTokenList.cpp:
3153         (WebCore::DOMTokenList::setValueInternal):
3154         * html/DOMTokenList.h:
3155         Rename setValue() to setValueInternal() as this version does not
3156         update the associated attribute value, only the tokens.
3157
3158         * html/HTMLLinkElement.cpp:
3159         * html/HTMLLinkElement.h:
3160         - Have HTMLLinkElement.sizes use an AttributeDOMTokenList instead of
3161           a DOMSettableTokenList as there is an associated attribute. The
3162           previous code had a bug has setting HTMLLinkElement.sizes would not
3163           update the associated 'sizes' attribute. Switching to using
3164           AttributeDOMTokenList fixes this and a new layout test has been added
3165           to cover this.
3166         - Create the AttributeDOMTokenList lazily to avoid updating it every
3167           time the sizes attribute changes until it is actually accessed.
3168
3169         * html/HTMLOutputElement.cpp:
3170         * html/HTMLOutputElement.h:
3171         - Have HTMLLinkElement.htmlFor use an AttributeDOMTokenList instead of
3172           a DOMSettableTokenList as there is an associated attribute.
3173         - Create the AttributeDOMTokenList lazily to avoid updating it every
3174           time the sizes attribute changes until it is actually accessed.
3175
3176         * html/HTMLOutputElement.idl:
3177         Add [PutForwards=value] on the htmlFor attribute, as per the
3178         HTML specification.
3179
3180 2015-09-23  Chris Dumez  <cdumez@apple.com>
3181
3182         TreeWalker.previousSibling()  / nextSibling() does not behave according to the specification
3183         https://bugs.webkit.org/show_bug.cgi?id=149493
3184
3185         Reviewed by Darin Adler.
3186
3187         TreeWalker.previousSibling()  / nextSibling() does not behave according
3188         to the specification:
3189         - https://dom.spec.whatwg.org/#dom-treewalker-nextsibling
3190         - https://dom.spec.whatwg.org/#dom-treewalker-previoussibling
3191         - https://dom.spec.whatwg.org/#concept-traverse-siblings
3192
3193         In particular, the previous code would fail to update 'node' variable
3194         in the case acceptNode() returned FILTER_REJECT. This patch fixes this
3195         and refactors the function to match more closely the text of the spec
3196         and avoid code duplication.
3197
3198         No new tests, already covered by existing test.
3199
3200         * dom/TreeWalker.cpp:
3201         (WebCore::TreeWalker::traverseSiblings):
3202         (WebCore::TreeWalker::previousSibling):
3203         (WebCore::TreeWalker::nextSibling):
3204         (WebCore::TreeWalker::previousNode): Deleted.
3205         * dom/TreeWalker.h:
3206
3207 2015-09-23  Alex Christensen  <achristensen@webkit.org>
3208
3209         Fix CMake build.
3210
3211         * CMakeLists.txt:
3212         Use {} instead of () for CMake variables.
3213
3214 2015-09-23  Tim Horton  <timothy_horton@apple.com>
3215
3216         Try to fix the CMake build.
3217
3218         * CMakeLists.txt:
3219
3220 2015-09-23  Tim Horton  <timothy_horton@apple.com>
3221
3222         Hopefully fix the production build.
3223
3224         * DerivedSources.make:
3225         * WebCore.vcxproj/build-generated-files.pl:
3226         * WebCore.xcodeproj/project.pbxproj:
3227         * generate-js-builtins:
3228         * make-generated-sources.sh:
3229
3230 2015-09-23  Ryosuke Niwa  <rniwa@webkit.org>
3231
3232         Mac production build fix attempt after r190155.
3233
3234         * WebCore.xcodeproj/project.pbxproj:
3235
3236 2015-09-23  Chris Dumez  <cdumez@apple.com>
3237
3238         Avoid unnecessary ancestor traversal in Range::selectNodeContents()
3239         https://bugs.webkit.org/show_bug.cgi?id=149491
3240
3241         Reviewed by Andreas Kling.
3242
3243         Avoid unnecessary ancestor traversal in Range::selectNodeContents().
3244         A DocumentType Node cannot have children, therefore, there is no need
3245         to check if ancestors are docTypes. We now simply check if the current
3246         node is a DocumentType Node, as per the specification:
3247         - https://dom.spec.whatwg.org/#dom-range-selectnodecontents (step 1)
3248
3249         * dom/Range.cpp:
3250         (WebCore::Range::selectNodeContents):
3251
3252 2015-09-23  Chris Dumez  <cdumez@apple.com>
3253
3254         Range's setStartBefore() / setStartAfter() / setEndBefore() / setEndAfter() do not match the specification
3255         https://bugs.webkit.org/show_bug.cgi?id=149490
3256
3257         Reviewed by Andreas Kling.
3258
3259         Range's setStartBefore() / setStartAfter() / setEndBefore() / setEndAfter()
3260         behavior do not match the DOM specification:
3261         - https://dom.spec.whatwg.org/#dom-range-setstartbefore
3262         - https://dom.spec.whatwg.org/#dom-range-setstartafter
3263         - https://dom.spec.whatwg.org/#dom-range-setendbefore
3264         - https://dom.spec.whatwg.org/#dom-range-setendafter
3265
3266         In particular, instead of step 2:
3267         "If parent is null, throw an InvalidNodeTypeError exception."
3268
3269         Our implementation was doing more checks and throwing exceptions in cases
3270         that the specification does not say we should. We were calling
3271         checkNodeBA() which had restrictions on both the node type and its
3272         root type. This is now replaced by a simple null check on the parent,
3273         as per the specification.
3274
3275         Firefox's behavior matches the specification.
3276
3277         No new tests, already covered by existing tests.
3278
3279         * dom/Range.cpp:
3280         (WebCore::Range::setStartAfter):
3281         (WebCore::Range::setEndBefore):
3282         (WebCore::Range::setEndAfter):
3283         (WebCore::Range::setStartBefore):
3284         (WebCore::Range::cloneRange): Deleted.
3285         (WebCore::Range::selectNode): Deleted.
3286         (WebCore::Range::selectNodeContents): Deleted.
3287         (WebCore::Range::absoluteTextRects): Deleted.
3288         * dom/Range.h:
3289
3290 2015-09-23  Commit Queue  <commit-queue@webkit.org>
3291
3292         Unreviewed, rolling out r190168.
3293         https://bugs.webkit.org/show_bug.cgi?id=149502
3294
3295         it broke debug builds. (Requested by zalan on #webkit).
3296
3297         Reverted changeset:
3298
3299         "HTMLOutputElement.htmlFor should be settable"
3300         https://bugs.webkit.org/show_bug.cgi?id=149418
3301         http://trac.webkit.org/changeset/190168
3302
3303 2015-09-23  Commit Queue  <commit-queue@webkit.org>
3304
3305         Unreviewed, rolling out r190160.
3306         https://bugs.webkit.org/show_bug.cgi?id=149501
3307
3308         media/media-controls-play-button-updates.html fails on
3309         Yosemite and EFL (Requested by zalan on #webkit).
3310
3311         Reverted changeset:
3312
3313         "[GTK] playbutton in media controls is not changed when it is
3314         clicked."
3315         https://bugs.webkit.org/show_bug.cgi?id=149113
3316         http://trac.webkit.org/changeset/190160
3317
3318 2015-09-23  Antti Koivisto  <antti@apple.com>
3319
3320         Try to fix build.
3321
3322         * css/DocumentRuleSets.h:
3323         * inspector/InspectorInstrumentation.h:
3324
3325 2015-09-23  Antti Koivisto  <antti@apple.com>
3326
3327         Fix sorting
3328
3329         * dom/DOMAllInOne.cpp:
3330
3331 2015-09-22  Antti Koivisto  <antti@apple.com>
3332
3333         Split author style code out from DocumentStyleSheetCollection
3334         https://bugs.webkit.org/show_bug.cgi?id=149446
3335
3336         Reviewed by Andreas Kling.
3337
3338         Shadow trees may have their own author style. Factor the related code out so we can use
3339         it outside the document context.
3340
3341         DocumentStyleSheetCollection is replaced by two classes:
3342
3343         AuthorStyleSheets - author stylesheets and mutation optimization code
3344         ExtensionStyleSheets - user stylesheets, injected author stylesheets, content extension stylesheets
3345
3346         * WebCore.xcodeproj/project.pbxproj:
3347         * contentextensions/ContentExtensionsBackend.cpp:
3348         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
3349         * css/CSSStyleSheet.cpp:
3350         (WebCore::CSSStyleSheet::didMutateRules):
3351         * css/DocumentRuleSets.cpp:
3352         (WebCore::DocumentRuleSets::~DocumentRuleSets):
3353         (WebCore::DocumentRuleSets::initUserStyle):
3354         * css/DocumentRuleSets.h:
3355         (WebCore::DocumentRuleSets::sibling):
3356         (WebCore::DocumentRuleSets::uncommonAttribute):
3357         * css/InspectorCSSOMWrappers.cpp:
3358         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheets):
3359         (WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
3360         (WebCore::InspectorCSSOMWrappers::collectFromDocumentStyleSheetCollection): Deleted.
3361         * css/InspectorCSSOMWrappers.h:
3362         * css/StyleResolver.cpp:
3363         (WebCore::StyleResolver::StyleResolver):
3364         (WebCore::StyleResolver::appendAuthorStyleSheets):
3365         * css/StyleSheetList.cpp:
3366         (WebCore::StyleSheetList::styleSheets):
3367         (WebCore::StyleSheetList::detachFromDocument):
3368         (WebCore::StyleSheetList::length):
3369         * dom/AuthorStyleSheets.cpp: Added.
3370         (WebCore::AuthorStyleSheets::AuthorStyleSheets):
3371         (WebCore::AuthorStyleSheets::combineCSSFeatureFlags):
3372         (WebCore::AuthorStyleSheets::resetCSSFeatureFlags):
3373         (WebCore::AuthorStyleSheets::addAuthorSheet):
3374         (WebCore::AuthorStyleSheets::removePendingSheet):
3375         (WebCore::AuthorStyleSheets::addStyleSheetCandidateNode):
3376         (WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode):
3377         (WebCore::AuthorStyleSheets::collectActiveStyleSheets):
3378         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
3379         (WebCore::filterEnabledNonemptyCSSStyleSheets):
3380         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
3381         (WebCore::AuthorStyleSheets::activeStyleSheetsForInspector):
3382         (WebCore::AuthorStyleSheets::activeStyleSheetsContains):
3383         (WebCore::AuthorStyleSheets::detachFromDocument):
3384         * dom/AuthorStyleSheets.h: Added.
3385         (WebCore::AuthorStyleSheets::activeStyleSheets):
3386         (WebCore::AuthorStyleSheets::styleSheets):
3387         (WebCore::AuthorStyleSheets::styleSheetsForStyleSheetList):
3388         (WebCore::AuthorStyleSheets::pendingUpdateType):
3389         (WebCore::AuthorStyleSheets::setPendingUpdateType):
3390         (WebCore::AuthorStyleSheets::flushPendingUpdates):
3391         (WebCore::AuthorStyleSheets::preferredStylesheetSetName):
3392         (WebCore::AuthorStyleSheets::selectedStylesheetSetName):
3393         (WebCore::AuthorStyleSheets::setPreferredStylesheetSetName):
3394         (WebCore::AuthorStyleSheets::setSelectedStylesheetSetName):
3395         (WebCore::AuthorStyleSheets::addPendingSheet):
3396         (WebCore::AuthorStyleSheets::hasPendingSheets):
3397         (WebCore::AuthorStyleSheets::usesFirstLineRules):
3398         (WebCore::AuthorStyleSheets::usesFirstLetterRules):
3399         (WebCore::AuthorStyleSheets::usesRemUnits):
3400         (WebCore::AuthorStyleSheets::setUsesRemUnit):
3401         (WebCore::AuthorStyleSheets::usesStyleBasedEditability):
3402         (WebCore::AuthorStyleSheets::setUsesStyleBasedEditability):
3403         * dom/Document.cpp:
3404         (WebCore::Document::Document):
3405         (WebCore::Document::~Document):
3406    &nb