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