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