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