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