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