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