Notify the UI delegate when a MediaDocument's natural size changes
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-07-21  Jer Noble  <jer.noble@apple.com>
2
3         Notify the UI delegate when a MediaDocument's natural size changes
4         https://bugs.webkit.org/show_bug.cgi?id=147182
5
6         Reviewed by Simon Fraser.
7
8         Notify the MediaDocument that it's underlying media element has changed its natural size, either when
9         the media engine notifies us that the size changed, or when the ready state progresses to HAVE_METADATA.
10
11         * html/HTMLMediaElement.cpp:
12         (WebCore::HTMLMediaElement::setReadyState): Notify the media document.
13         (WebCore::HTMLMediaElement::mediaPlayerSizeChanged): Ditto.
14         * html/MediaDocument.cpp:
15         (WebCore::MediaDocument::mediaElementNaturalSizeChanged): Pass to the chrome client.
16         * html/MediaDocument.h:
17         * page/ChromeClient.h:
18
19 2015-07-22  Simon Fraser  <simon.fraser@apple.com>
20
21         Layer z-ordering is incorrect when scrolling on page witih position:fixed
22         https://bugs.webkit.org/show_bug.cgi?id=147220
23         rdar://problem/15849697&21929247
24
25         Reviewed by Dean Jackson.
26
27         Overlap testing for compositing uses the currently laid out position of fixed
28         elements, without taking into account the fact that async scrolling can move
29         them around, and possibly under other non-composited elements. This manifested
30         as position:fixed elements moving over other elements on some pages when
31         scrolling, when they should have moved behind.
32         
33         Fix by expanding the overlap map entry for position:fixed elements to create
34         an rect for the area they cover at all scroll locations, taking min and max
35         scroll offsets into account.
36         
37         Also add a couple more LOG(Compositing) statements.
38
39         Tests: compositing/layer-creation/fixed-overlap-extent-rtl.html
40                compositing/layer-creation/fixed-overlap-extent.html
41
42         * rendering/RenderLayerCompositor.cpp:
43         (WebCore::fixedPositionOffset):
44         (WebCore::RenderLayerCompositor::computeExtent):
45         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer):
46         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged):
47
48 2015-07-23  Jer Noble  <jer.noble@apple.com>
49
50         Relax media playback restrictions if the allowsMediaDocumentInlinePlayback property is set.
51         https://bugs.webkit.org/show_bug.cgi?id=147234
52
53         Reviewed by Darin Adler.
54
55         * html/HTMLMediaElement.cpp:
56         (WebCore::HTMLMediaElement::prepareForLoad): Moved restriction check into MediaElementSession.
57         * html/MediaElementSession.cpp:
58         (WebCore::MediaElementSession::playbackPermitted): Check if is a top-level media document and if
59             allowsMediaDocumentInilnePlayback is set, and return early.
60         (WebCore::MediaElementSession::effectivePreloadForElement): Ditto.
61         (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading): Ditto.
62         * html/MediaElementSession.h:
63
64 2015-07-23  Matthew Daiter  <mdaiter@apple.com>
65
66         Bridged passing lists of devices between the UIProcess and the WebProcess
67         https://bugs.webkit.org/show_bug.cgi?id=147056
68         <rdar://problem/21883094>
69
70         Reviewed by Brent Fulgham.
71
72         * Modules/mediastream/UserMediaRequest.h: Added fields to store and
73         retrieve lists of devices
74         (WebCore::UserMediaRequest::deviceUIDsVideo):
75         (WebCore::UserMediaRequest::deviceUIDsAudio):
76
77 2015-07-19  Matt Rajca  <mrajca@apple.com>
78
79         Media Session: add support for ducking media elements
80         https://bugs.webkit.org/show_bug.cgi?id=147089
81
82         Reviewed by Eric Carlson.
83
84         Test: media/session/transient-interruptions.html
85
86         * Modules/mediasession/MediaSession.cpp:
87         (WebCore::MediaSession::handleDuckInterruption): Duck the active media elements.
88         (WebCore::MediaSession::handleUnduckInterruption): Unduck the active media elements.
89         * html/HTMLMediaElement.cpp:
90         (WebCore::HTMLMediaElement::updateVolume): Lower the volume of media elements to 25% when ducked (constant determined empirically).
91         (WebCore::HTMLMediaElement::setShouldDuck): Call updateVolume to change the volume of the underlying media player.
92         * html/HTMLMediaElement.h:
93
94 2015-07-23  Matt Rajca  <mrajca@apple.com>
95
96         Media Session: add infrastructure for testing ducking https://bugs.webkit.org/show_bug.cgi?id=147080
97
98         Reviewed by Jer Noble.
99
100         We need to expose a media element's underlying media player's volume to tests so we can test ducking.
101
102         * html/HTMLMediaElement.cpp:
103         (WebCore::HTMLMediaElement::playerVolume):
104         * html/HTMLMediaElement.h:
105         * testing/Internals.cpp:
106         (WebCore::Internals::mediaElementPlayerVolume):
107         * testing/Internals.h:
108         * testing/Internals.idl:
109
110 2015-07-21  Jer Noble  <jer.noble@apple.com>
111
112         [iOS] Add an explicit API to allow media documents to (temporarily) play inline
113         https://bugs.webkit.org/show_bug.cgi?id=147181
114
115         Reviewed by Beth Dakin.
116
117         Add listeners for the new allowsMediaDocumentInlinePlayback API. When this value becomes
118         NO, force any playing MediaDocuments to enter fullscreen mode.
119
120         * dom/Document.cpp:
121         (WebCore::Document::registerForAllowsMediaDocumentInlinePlaybackChangedCallbacks): Added registration method.
122         (WebCore::Document::unregisterForAllowsMediaDocumentInlinePlaybackChangedCallbacks): Added deregistration method.
123         (WebCore::Document::allowsMediaDocumentInlinePlaybackChanged): Notify all listeners.
124         * dom/Document.h:
125         * html/HTMLMediaElement.cpp:
126         (WebCore::HTMLMediaElement::registerWithDocument): Listen for allowsMediaDocumentInlinePlayback changes.
127         (WebCore::HTMLMediaElement::unregisterWithDocument): Stop listening to same.
128         (WebCore::HTMLMediaElement::allowsMediaDocumentInlinePlaybackChanged): Enter fullscreen mode if the value
129             changes to false during playback.
130         * html/HTMLMediaElement.h:
131         * html/MediaElementSession.cpp:
132         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback): Early true if the override value is set.
133         * page/Page.cpp:
134         (WebCore::Page::setAllowsMediaDocumentInlinePlayback): Notify all documents of the changed value.
135         * page/Page.h:
136         (WebCore::Page::allowsMediaDocumentInlinePlayback): Simple getter.
137
138 2015-07-23  Devin Rousso  <drousso@apple.com>
139
140         Web Inspector: Add a function to CSSCompletions to get a list of supported system fonts
141         https://bugs.webkit.org/show_bug.cgi?id=147009
142
143         Reviewed by Joseph Pecoraro.
144
145         Test: inspector/css/get-system-fonts.html
146
147         * inspector/InspectorCSSAgent.cpp:
148         (WebCore::InspectorCSSAgent::getSupportedSystemFontFamilyNames):
149         Gets the list of system fonts (implemented in each platform) and returns that list.
150         * inspector/InspectorCSSAgent.h:
151         * platform/graphics/FontCache.h:
152         * platform/graphics/freetype/FontCacheFreeType.cpp:
153         (WebCore::FontCache::systemFontFamilies):
154         * platform/graphics/ios/FontCacheIOS.mm:
155         (WebCore::FontCache::systemFontFamilies):
156         * platform/graphics/mac/FontCacheMac.mm:
157         (WebCore::FontCache::systemFontFamilies):
158         * platform/graphics/win/FontCacheWin.cpp:
159         (WebCore::FontCache::systemFontFamilies):
160
161 2015-07-23  Brent Fulgham  <bfulgham@apple.com>
162
163         [Win] Implement High DPI support features
164         https://bugs.webkit.org/show_bug.cgi?id=146335
165         <rdar://problem/21558269>
166
167         Reviewed by Alex Christensen.
168
169         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
170         (WebCore::PlatformCALayerWinInternal::drawTile): Don't translate the CGContext to the position
171         of the CACFLayerRef; the underlying context is already in the right position.
172         * platform/win/PlatformMouseEventWin.cpp: Update class to adjust mouse
173         event coordinates based on scaling factor.
174         (WebCore::deviceScaleFactor):
175         (WebCore::positionForEvent):
176         * platform/win/ScrollbarThemeWin.cpp:
177         (WebCore::scrollbarThicknessInPixels):
178         (WebCore::ScrollbarThemeWin::scrollbarThickness):
179         (WebCore::ScrollbarThemeWin::themeChanged):
180         * platform/win/WheelEventWin.cpp: Update class to adjust wheel event
181         coordinates based on scaling factor.
182         (WebCore::deviceScaleFactor):
183         (WebCore::positionForEvent):
184         (WebCore::globalPositionForEvent):
185         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
186
187 2015-07-23  Myles C. Maxfield  <mmaxfield@apple.com>
188
189         REGRESSION(r182236): Justified Arabic text does not expand
190         https://bugs.webkit.org/show_bug.cgi?id=147217
191
192         Reviewed by Simon Fraser.
193
194         When I was writing r182236, I got confused between the levels of the string hierarchy in ComplexTextController.
195         I've added a comment in the header which should make it easier to get it right.
196
197         Test: fast/text/international/arabic-justify.html
198
199         * platform/graphics/mac/ComplexTextController.cpp:
200         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
201         * platform/graphics/mac/ComplexTextController.h:
202
203 2015-07-23  Tim Horton  <timothy_horton@apple.com>
204
205         Fix the build for __IPHONE_OS_VERSION_MIN_REQUIRED <= 80200 || !HAVE(AVKIT)
206
207         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
208         (elementRectInWindow):
209         This helper is only used in the #else block, so move it there.
210
211 2015-07-23  Timothy Horton  <timothy_horton@apple.com>
212
213         Try to fix the build
214
215         * platform/spi/cocoa/QuartzCoreSPI.h:
216
217 2015-07-22  Sukolsak Sakshuwong  <sukolsak@gmail.com>
218
219         Add ENABLE_WEBASSEMBLY feature flag for WebAssembly
220         https://bugs.webkit.org/show_bug.cgi?id=147212
221
222         Reviewed by Filip Pizlo.
223
224         No new tests.
225
226         * Configurations/FeatureDefines.xcconfig:
227
228 2015-07-22  Tim Horton  <timothy_horton@apple.com>
229
230         Try to fix the build
231
232         * platform/spi/cocoa/QuartzCoreSPI.h:
233
234 2015-07-22  James Savage  <james.savage@apple.com>
235
236         Use updated CoreAnimation snapshot SPI.
237         https://bugs.webkit.org/show_bug.cgi?id=147197
238         <rdar://problem/21032083>
239
240         Reviewed by Tim Horton.
241         Patch by James Savage.
242
243         * platform/spi/cocoa/QuartzCoreSPI.h:
244
245 2015-07-22  Joseph Pecoraro  <pecoraro@apple.com>
246
247         Web Inspector: Timeline should immediately start moving play head when starting a new recording
248         https://bugs.webkit.org/show_bug.cgi?id=147210
249
250         Reviewed by Timothy Hatcher.
251
252         Test: inspector/timeline/recording-start-stop-timestamps.html
253
254         * inspector/InspectorTimelineAgent.cpp:
255         (WebCore::InspectorTimelineAgent::internalStart):
256         (WebCore::InspectorTimelineAgent::internalStop):
257         Include the current timestamp when starting / stopping a recording.
258
259 2015-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
260
261         Coordinates-based snap offsets don't update correctly when container is scrolled
262         https://bugs.webkit.org/show_bug.cgi?id=147215
263
264         Reviewed by Brent Fulgham.
265
266         Fixes the way we append the snap offsets of child elements with coordinates. We
267         now consider the scroll offset of the parent scroll snapping container, so snap
268         offset recomputations don't fail on scroll snapping containers.
269
270         Test: css3/scroll-snap/scroll-snap-coordinate-overflow-resize.html
271
272         * page/scrolling/AxisScrollSnapOffsets.cpp:
273         (WebCore::appendChildSnapOffsets): Fixed to consider the scroll offset of the
274             parent container.
275
276 2015-07-22  Matthew Daiter  <mdaiter@apple.com>
277
278         Needed to add methods to get PreviewCaptureLayers from Video
279         https://bugs.webkit.org/show_bug.cgi?id=147011
280         <rdar://problem/21861999>
281
282         Reviewed by Jer Noble.
283
284         * platform/mediastream/mac/AVVideoCaptureSource.h: Added in preview
285         layer to class
286         (WebCore::AVVideoCaptureSource::previewLayer):
287         * platform/mediastream/mac/AVVideoCaptureSource.mm: Instantiate
288         previewLayer on load
289         (WebCore::AVVideoCaptureSource::setupCaptureSession):
290
291 2015-07-22  Sungmann Cho  <sungmann.cho@navercorp.com>
292
293         [EFL] The "Missing Plug-in" buttons are not showing up on some flash contents
294         https://bugs.webkit.org/show_bug.cgi?id=147191
295
296         Reviewed by Gyuyoung Kim.
297
298         Currently, WebKitEFL doesn't show the "Missing Plug-in" buttons if the plugin-related tags
299         don't have a "type" attribute. In such a case, WebCore tries to guess the MIME type from
300         the extensions by using MIMETypeRegistry::getMIMETypeForExtension(). For WebKitEFL,
301         MIMETypeRegistry::getMIMETypeForExtension() goes through |extensionMap|, which is a simple
302         array of <extension, mime type>, looking for the mime type for the given extension.
303         But |extensionMap| in MIMETypeRegistryEfl.cpp doesn't have the information for ".swf",
304         so WebCore fails to guess the MIME type and regard the content type as ObjectContentFrame,
305         not ObjectContentNetscapePlugin.
306
307         * platform/efl/MIMETypeRegistryEfl.cpp:
308
309 2015-07-22  Matthew Daiter  <mdaiter@apple.com>
310
311         Rank sources for fitness for UIDs in bestSourcesForTypeAndConstraints
312         https://bugs.webkit.org/show_bug.cgi?id=147206
313         <rdar://problem/21950653>
314
315         Reviewed by Jer Noble.
316
317         * platform/mediastream/RealtimeMediaSource.cpp:
318         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
319         * platform/mediastream/RealtimeMediaSource.h:
320         (WebCore::RealtimeMediaSource::fitnessScore):
321         (WebCore::RealtimeMediaSource::setFitnessScore):
322         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
323         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
324
325 2015-07-22  Dean Jackson  <dino@apple.com>
326
327         Video controls, though hidden, are still interactive when in PiP
328         https://bugs.webkit.org/show_bug.cgi?id=147216
329         <rdar://problem/21012688>
330
331         Reviewed by Simon Fraser.
332
333         Explicitly add the PiP class to the controls container so that
334         we can hang a pointer-events: none off it.
335
336         * Modules/mediacontrols/mediaControlsiOS.css:
337         (video::-webkit-media-controls-panel.picture-in-picture): Add a pointer-events: none.
338         * Modules/mediacontrols/mediaControlsiOS.js:
339         (ControllerIOS.prototype.handlePresentationModeChange): Add/remove a PiP class
340         to the controls panel when necessary.
341
342 2015-07-22  Commit Queue  <commit-queue@webkit.org>
343
344         Unreviewed, rolling out r187196.
345         https://bugs.webkit.org/show_bug.cgi?id=147213
346
347         broke all the iOS builds (Requested by thorton on #webkit).
348
349         Reverted changeset:
350
351         "Use updated CoreAnimation snapshot SPI."
352         https://bugs.webkit.org/show_bug.cgi?id=147197
353         http://trac.webkit.org/changeset/187196
354
355 2015-07-22  James Savage  <james.savage@apple.com>
356
357         Use updated CoreAnimation snapshot SPI.
358         https://bugs.webkit.org/show_bug.cgi?id=147197
359
360         Reviewed by Tim Horton.
361
362         * platform/spi/cocoa/QuartzCoreSPI.h:
363
364 2015-07-22  Dean Jackson  <dino@apple.com>
365
366         Out of bounds in WebGLRenderingContext::simulateVertexAttrib0
367         https://bugs.webkit.org/show_bug.cgi?id=147176
368         <rdar://problem/21567767>
369
370         Reviewed by Oliver Hunt.
371
372         Test: fast/canvas/webgl/out-of-bounds-simulated-vertexAttrib0-drawArrays.html
373
374         Add overflow checking for the drawing calls, specifically the way
375         they may simulate vertexAttrib0.
376
377         * html/canvas/WebGLRenderingContextBase.cpp:
378         (WebCore::WebGLRenderingContextBase::validateDrawArrays): Call new validation method.
379         (WebCore::WebGLRenderingContextBase::validateDrawElements): Ditto.
380         (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): New method that
381         validates the parameters used to create the simulated attribute.
382         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): No need to do overflow
383         checking here now that the validation method does it for us.
384         (WebCore::WebGLRenderingContextBase::validateVertexAttributes): Deleted.
385         * html/canvas/WebGLRenderingContextBase.h: Add new validation method.
386
387 2015-07-22  Joseph Pecoraro  <pecoraro@apple.com>
388
389         Web Inspector: AppCache manifest 404 doesn't produce errors in console, manifest resource request always loading indicator
390         https://bugs.webkit.org/show_bug.cgi?id=147135
391
392         Reviewed by Alexey Proskuryakov.
393
394         * loader/appcache/ApplicationCacheGroup.cpp:
395         (WebCore::ApplicationCacheGroup::didReceiveResponse):
396         Always pass a document loader instead of passing null for the manifest request.
397
398         (WebCore::ApplicationCacheGroup::didReceiveManifestResponse):
399         Since we will be cancelling the resource handle ourselves in didReceiveResponse
400         before receiving the didFail resource handle delegates, we should update the
401         inspector about this resource load failing due to a cancel.
402
403         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
404         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
405         Update the MessageSource from "Other" to "AppCache".
406
407 2015-07-22  Jeremy Jones  <jeremyj@apple.com>
408
409         Fix fullscreen and PiP video animation and sizing regressions.
410         https://bugs.webkit.org/show_bug.cgi?id=147189
411         <rdar://problem/21930899>
412
413         Reviewed by Jer Noble.
414
415         Fixes WK1 specific regressions introduced by r187044. Flicker when entering fullscreen,
416         wrong animation and missing initial animation rects.
417
418         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
419         (elementRectInWindow): Added.
420         (WebVideoFullscreenControllerContext::didSetupFullscreen): Clear background decreases flash.
421         (WebVideoFullscreenControllerContext::fullscreenMayReturnToInline): Use consistent inline rect.
422         (WebVideoFullscreenControllerContext::setVideoLayerFrame): 
423         Clear the transform on the web thread instead of on the UI thread.
424         (WebVideoFullscreenControllerContext::setUpFullscreen): Use consistent inline rect.
425         (WebVideoFullscreenControllerContext::exitFullscreen): Use consistent inline rect.
426         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: 
427         (-[WebAVPlayerLayer resolveBounds]): Clear transform after setting frame.
428
429 2015-07-22  Jeremy Jones  <jeremyj@apple.com>
430
431         Adopt AVKit's AVSimplePlayerLayerView change for PiP.
432         https://bugs.webkit.org/show_bug.cgi?id=147186
433         <rdar://problem/21928170>
434
435         Reviewed by Jer Noble.
436
437         Adopt AVKit changes by inheriting from UIView instead of from AVPictureInPicturePlayerLayerView.
438
439         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
440         (WebAVPlayerLayerView_layerClass): Style.
441         (WebAVPlayerLayerView_playerController): Style.
442         (WebAVPlayerLayerView_videoView): Style.
443         (getWebAVPictureInPicturePlayerLayerViewClass): Inherit from UIView.
444
445 2015-07-22  Beth Dakin  <bdakin@apple.com>
446
447         Animated images should animate in previews
448         https://bugs.webkit.org/show_bug.cgi?id=147173
449         -and corresponding-
450         rdar://problem/21637698
451
452         Reviewed by Dan Bernstein.
453
454         New virtual function to indicate whether or not the image is animated.
455         * platform/graphics/BitmapImage.h:
456         * platform/graphics/Image.h:
457         (WebCore::Image::isAnimated):
458
459 2015-07-22  Jinyoung Hur  <hur.ims@navercorp.com>
460
461         [WinCairo] SVG path not rendered with all-zero dasharray
462         https://bugs.webkit.org/show_bug.cgi?id=146997
463
464         Reviewed by Martin Robinson.
465
466         All-zero dash array should not be passed to cairo_set_dash() as an argument, because it will cause an internal Cairo error.
467         Rather call cairo_set_dash() with num_dashes=0 to disable dash line.
468
469         Tests: fast/canvas/canvas-lineDash.html
470                svg/custom/zero-dasharray.html
471
472         * platform/graphics/cairo/GraphicsContextCairo.cpp:
473         (WebCore::GraphicsContext::setLineDash):
474
475 2015-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
476
477         Search fields render placeholder text improperly.
478         https://bugs.webkit.org/show_bug.cgi?id=147192
479         <rdar://problem/21901076>
480
481         Reviewed by Alexey Proskuryakov.
482
483         Due to changes in the way AppKit renders search inputs, we must now explicitly
484         set the placeholder text of a search input rendered using the Mac theme to be
485         an empty string when rendering the search input box (not including the actual
486         placeholder text).
487
488         * rendering/RenderThemeMac.mm:
489         (WebCore::RenderThemeMac::setSearchCellState): Force the placeholder text of
490             the NSSearchFieldCell for the Mac theme to be an empty string.
491
492 2015-07-22  Matthew Daiter  <mdaiter@apple.com>
493
494         Need the ability to give only best source UIDs to UserMedia request
495         https://bugs.webkit.org/show_bug.cgi?id=147171
496         <rdar://problem/21931121>
497
498         Reviewed by Eric Carlson.
499
500         * Modules/mediastream/UserMediaRequest.cpp:
501         (WebCore::UserMediaRequest::constraintsValidated):
502         * Modules/mediastream/UserMediaRequest.h:
503         (WebCore::UserMediaRequest::videoDeviceUIDs):
504         (WebCore::UserMediaRequest::audioDeviceUIDs):
505         * platform/mediastream/MediaStreamCreationClient.h:
506         * platform/mediastream/mac/AVCaptureDeviceManager.h:
507         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
508         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
509         (WebCore::AVCaptureDeviceManager::bestSourceForTypeAndConstraints): Deleted.
510         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
511         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
512         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
513         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
514         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
515
516 2015-07-22  Mark Dittmer  <mark.s.dittmer@gmail.com>
517
518         Fix toJSDOMWindow() in the case of an object that has the actual JS DOM window in its prototype chain.
519         https://bugs.webkit.org/show_bug.cgi?id=146785
520
521         Reviewed by Mark Lam.
522
523         * bindings/js/JSDOMWindowBase.cpp: toJSDOMWindow(): Walk the prototype chain of the given JSValue until a JSDOMWindow or JSDOMWindowShell is found.
524
525 2015-07-22  Matthew Daiter  <mdaiter@apple.com>
526
527         Remove revealing getVideoTracks() and getAudioTracks()
528         https://bugs.webkit.org/show_bug.cgi?id=147126
529         <rdar://problem/21908723>
530
531         Reviewed by Eric Carlson.
532
533         * Modules/mediastream/MediaStream.h:
534         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
535         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
536         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
537         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Modded to use
538         tracks() instead of getVideo/AudioTracks()
539         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto
540         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::playInternal): Ditto
541         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pauseInternal): Ditto
542         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Ditto
543         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::naturalSize): Ditto
544         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo): Ditto
545         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio): Ditto
546         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentMediaTime):
547         Changed to a FIXME
548         * platform/mediastream/MediaStreamPrivate.h:
549
550 2015-07-22  Matthew Daiter  <mdaiter@apple.com>
551
552         Ensure MediaPlayerPrivateAVFoundation doesn't load MediaStreams
553         https://bugs.webkit.org/show_bug.cgi?id=147119
554         <rdar://problem/21904955>
555
556         Reviewed by Eric Carlson.
557
558         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: Set
559         networkstate to error when loading MediaStreams
560
561 2015-07-22  Alex Christensen  <achristensen@webkit.org>
562
563         Fix quirks in CMake build on Mac and Windows
564         https://bugs.webkit.org/show_bug.cgi?id=147174
565
566         Reviewed by Gyuyoung Kim.
567
568         * PlatformMac.cmake:
569         Removed files that don't exist any more.
570         * platform/win/WindowsTouch.h:
571         Only use definitions of touch structures when compiling with VS2012.
572
573 2015-07-22  Csaba Osztrogonác  <ossy@webkit.org>
574
575         Fix cast-align warning in NetworkStateNotifierEfl.cpp
576         https://bugs.webkit.org/show_bug.cgi?id=145915
577
578         Reviewed by Gyuyoung Kim.
579
580         * platform/network/efl/NetworkStateNotifierEfl.cpp:
581         (WebCore::NetworkStateNotifier::readSocketCallback):
582
583 2015-07-22  Ryuan Choi  <ryuan.choi@navercorp.com>
584
585         [GTK][EFL] Remove dead functions in LocalizedStrings
586         https://bugs.webkit.org/show_bug.cgi?id=147188
587
588         Reviewed by Csaba Osztrogonác.
589
590         * platform/efl/LocalizedStringsEfl.cpp:
591         (WebCore::contextMenuItemTagHideMediaControls):
592         (WebCore::contextMenuitemTagHideMediaControls): Fixed typo since r152117.
593         (WebCore::inactivePluginText): Deleted since r151530.
594         (WebCore::textTrackClosedCaptionsText): Deleted since r141864.
595         * platform/gtk/LocalizedStringsGtk.cpp:
596         (WebCore::inactivePluginText): Deleted since r151530.
597         (WebCore::textTrackClosedCaptionsText): Deleted since r141864.
598
599 2015-07-21  Benjamin Poulain  <bpoulain@apple.com>
600
601         [CSS Selectors Level 4] Add #ifdefs to the new '>>' descendant combinator
602         https://bugs.webkit.org/show_bug.cgi?id=147184
603
604         Reviewed by Anders Carlsson.
605
606         Now that '>>>' is dead, the combinator '>>' is at risk.
607
608         This patch #ifdef all that code with the other experimental
609         features from Level 4.
610
611         * css/CSSGrammar.y.in:
612         * css/CSSParserValues.cpp:
613         (WebCore::CSSParserSelector::appendTagHistory):
614         * css/CSSParserValues.h:
615         * css/CSSSelector.cpp:
616         (WebCore::CSSSelector::CSSSelector):
617         (WebCore::CSSSelector::selectorText):
618         * css/CSSSelector.h:
619         (WebCore::CSSSelector::CSSSelector):
620
621 2015-07-21  Joseph Pecoraro  <pecoraro@apple.com>
622
623         Web Inspector: Node highlights are wrong when the page is zoomed
624         https://bugs.webkit.org/show_bug.cgi?id=147177
625
626         Reviewed by Simon Fraser.
627
628         * inspector/InspectorOverlay.cpp:
629         (WebCore::InspectorOverlay::update):
630         Remove scaling that appears to no longer be needed, it was double
631         scaling the overlay content and misplacing it in the process.
632
633 2015-07-21  Dean Jackson  <dino@apple.com>
634
635         Default media controls use a serif font, which seems wrong
636         https://bugs.webkit.org/show_bug.cgi?id=147179
637         <rdar://problem/21931728>
638
639         Reviewed by Simon Fraser.
640
641         The captions menu (and other text) should use a system style,
642         -webkit-small-control.
643
644         * Modules/mediacontrols/mediaControlsApple.css:
645         (::-webkit-media-controls):
646
647 2015-07-21  Matthew Daiter  <mdaiter@apple.com>
648
649         Exposed method to query device by UID
650         https://bugs.webkit.org/show_bug.cgi?id=147117
651         <rdar://problem/21904678>
652
653         Reviewed by Eric Carlson.
654
655         * platform/mediastream/mac/AVCaptureDeviceManager.h: Added method to
656         query device by UID
657         * platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto
658         (WebCore::AVCaptureDeviceManager::sourceWithUID): Ditto
659
660 2015-07-21  Benjamin Poulain  <benjamin@webkit.org>
661
662         [Content Extensions] Use a jump table when consecutive transitions have different targets
663         https://bugs.webkit.org/show_bug.cgi?id=147099
664
665         Reviewed by Alex Christensen.
666
667         When handling consecutive single transitions, merge them into
668         a jump table instead of creating many individual CheckValue.
669
670         From local testing on x86_64, it reduces the bytecode size by about 5%
671         and improve the runtime by about 10%.
672
673         * contentextensions/DFABytecode.h:
674         (WebCore::ContentExtensions::instructionSizeWithArguments):
675         * contentextensions/DFABytecodeCompiler.cpp:
676         (WebCore::ContentExtensions::DFABytecodeCompiler::extractJumpTable):
677         (WebCore::ContentExtensions::DFABytecodeCompiler::transitions):
678         (WebCore::ContentExtensions::DFABytecodeCompiler::checkForJumpTableMaxBytecodeSize):
679         (WebCore::ContentExtensions::DFABytecodeCompiler::compileJumpTable):
680         (WebCore::ContentExtensions::DFABytecodeCompiler::nodeTransitionsMaxBytecodeSize):
681         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
682         (WebCore::ContentExtensions::DFABytecodeCompiler::ranges): Deleted.
683         * contentextensions/DFABytecodeCompiler.h:
684         * contentextensions/DFABytecodeInterpreter.cpp:
685         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpetJumpTable):
686         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
687         * contentextensions/DFABytecodeInterpreter.h:
688
689 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
690
691         Add a logging channel for Layout, remove the LiveConnect channel
692         https://bugs.webkit.org/show_bug.cgi?id=147170
693
694         Reviewed by Zalan Bujtas.
695
696         Add a layout logging channel to WebCore, and remove the LiveConnect channel.
697
698         * page/FrameView.cpp:
699         (WebCore::FrameView::adjustViewSize):
700         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
701         (WebCore::FrameView::layout):
702         (WebCore::FrameView::performPostLayoutTasks):
703         (WebCore::FrameView::autoSizeIfEnabled):
704         * platform/Logging.h:
705
706 2015-07-21  Benjamin Poulain  <bpoulain@apple.com>
707
708         StyleSheetContents::wrapperInsertRule() can create rules that overflow RuleData's selector index
709         https://bugs.webkit.org/show_bug.cgi?id=147144
710
711         Reviewed by Alex Christensen.
712
713         RuleData identifies selectors by the index in a large array. The index only has 13 bits
714         so rules with more than 8192 selectors should be split.
715
716         One of the paths was not splitting the rule: StyleSheetContents::wrapperInsertRule().
717         When rules with too many selectors were added, the index would overflow and
718         some RuleData would point to selectors in the middle of selector chains. The resulting
719         behavior is random based on the selectors and the DOM.
720
721         We cannot easily fix that because the CSS OM API do not expect to create
722         several rules in response to calls to the API.
723         In this patch, I don't do anything fancy and just let the calls fail
724         if we cannot use the rules safely.
725
726
727         Content Extensions were also running into this problem. Large Selector lists are
728         pretty common, and ContentExtensionStyleSheet::addDisplayNoneSelector() was
729         overflowing the RuleData, creating broken page.
730
731         Unlike CSSOM, there is no problem with splitting rules coming from Content Extensions.
732         Instead of creating new APIs for that case, I rely on the parser to extend the StyleSheetContents.
733         That code already knows how to break rules correctly.
734
735         Tests: fast/css/insert-rule-overflow-rule-data.html
736                http/tests/contentextensions/css-display-none-overflows-rule-data-1.html
737                http/tests/contentextensions/css-display-none-overflows-rule-data-2.html
738
739         * contentextensions/ContentExtensionStyleSheet.cpp:
740         (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
741         * css/StyleSheetContents.cpp:
742         (WebCore::StyleSheetContents::wrapperInsertRule):
743
744 2015-07-21  Jon Honeycutt  <jhoneycutt@apple.com>
745
746         [iOS] Keyboard bold/italic/underline keys don't highlight after being
747         tapped to style a selection
748         https://bugs.webkit.org/show_bug.cgi?id=147164
749         <rdar://problem/21630806>
750
751         Reviewed by Ryosuke Niwa.
752
753         * editing/cocoa/EditorCocoa.mm:
754         (WebCore::Editor::styleForSelectionStart):
755         Use adjustedSelectionStartForStyleComputation(), which will ensure that
756         we're at the start of the selected node, not at the end of the node
757         before the selection.
758
759 2015-07-21  Tim Horton  <timothy_horton@apple.com>
760
761         Placing video in fullscreen caused WebKit crash at WebCore::Range::textQuads
762         https://bugs.webkit.org/show_bug.cgi?id=147166
763         <rdar://problem/21928558>
764
765         Reviewed by Simon Fraser.
766
767         * editing/FrameSelection.cpp:
768         (WebCore::FrameSelection::getClippedVisibleTextRectangles):
769         Check the Range, as always.
770
771 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
772
773         Safari mis-applies "animation-fill-mode: forwards" when using fractional iteration count
774         https://bugs.webkit.org/show_bug.cgi?id=146996
775
776         Reviewed by Dean Jackson.
777
778         animation-fill-mode: forwards with fractional iteration counts always snapped to
779         1 or 0, depending on direction. Fix to compute the fill-forward state from the
780         correct keyframes.
781         
782         If filling forwards, AnimationBase::progress() sets the elapsed time to the duration,
783         then uses fractionalTime() to handle animation direction mapping. If the fractionalTime
784         is integral, we can return early, avoiding the cost of mapping through timing functions.
785
786         Tested by existing tests.
787
788         * page/animation/AnimationBase.cpp:
789         (WebCore::AnimationBase::progress):
790         (WebCore::AnimationBase::getElapsedTime):
791         * page/animation/KeyframeAnimation.cpp:
792         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): It was possible
793         to end up with prevIndex == nextIndex with reverse animations, which resulted
794         in divide-by-zero when computing scale. Fix by picking a nextIndex that is different
795         from prevIndex.
796
797 2015-07-21  David Hyatt  <hyatt@apple.com>
798
799         Fix failing WK1 layout tests. Make sure to reset the text zoom scale
800         in Internals::resetToConsistentState.
801
802         Reviewed by Anders Carlsson
803
804         * testing/Internals.cpp:
805         (WebCore::Internals::resetToConsistentState):
806
807 2015-07-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
808
809         REGRESSION (r172417, r184065): Multiple rendering issues with fixed attached background-image
810         https://bugs.webkit.org/show_bug.cgi?id=147049
811         <rdar://problem/21110936>
812
813         Reviewed by Simon Fraser.
814
815         The fixed-attached background-image rendering is special. In general, to
816         display it, the destinationSize should be set to visibleContentSize. The
817         destinationLocation should be set such that the background-image does
818         not move with scrolling. The topContentInset should be subtracted from
819         the destinationLocation such that background-image can be rendered blurred
820         in the topContentArea. However there are cases in which these rules have to
821         be changed.
822         
823         -- destinationSize: In the case of fixed layout size, the fixedLayoutSize
824         is bigger than the visibleContentSize. In this case, if the background-image
825         belongs to the root element, the destinationSize has to be set to fixedLayoutSize.
826         Otherwise it has to be set to the borderBoxSize unless the overflow is
827         hidden.
828         
829         -- destinationLocation: If the background-image belongs to the root element, no
830         scroll offset to added to destinationLocation. For non-root element case,
831         FrameView::documentScrollOffsetRelativeToViewOrigin() should be used if no page
832         scaling is applied. Otherwise FrameView::scrollOffsetForFixedPosition() should be
833         used instead.
834         
835         Tests: platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover.html
836                platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local.html
837
838         * rendering/RenderBoxModelObject.cpp:
839         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Ensure
840         the geometry for the fixed-attached background-image is calculated correctly.
841         
842         * rendering/RenderLayerBacking.cpp:
843         (WebCore::RenderLayerBacking::updateGeometry): Ensure the background layer
844         gets the correct size for the fixedLayoutSize mode.
845
846 2015-07-21  Csaba Osztrogonác  <ossy@webkit.org>
847
848         Fix the !ENABLE(DETAILS_ELEMENT) build after r186598
849         https://bugs.webkit.org/show_bug.cgi?id=147115
850
851         Reviewed by Chris Fleizach.
852
853         * accessibility/AccessibilityNodeObject.cpp:
854         (WebCore::AccessibilityNodeObject::setIsExpanded):
855
856 2015-07-21  David Hyatt  <hyatt@apple.com>
857
858         Need a way to ignore text-zoom in a Web page.
859         https://bugs.webkit.org/show_bug.cgi?id=27092
860         rdar://problem/7037987
861
862         Reviewed by Simon Fraser.
863
864         This patch adds a new property, -webkit-text-zoom, with values of normal and reset. The reset
865         keyword, just as with the zoom property, can be used to ignore any inherited zoom from the
866         document.
867
868         Added new test in fast/text.
869
870         * Modules/mediacontrols/mediaControlsApple.css:
871         (audio::-webkit-media-controls-panel):
872         (video::-webkit-media-controls-panel):
873         * css/CSSComputedStyleDeclaration.cpp:
874         (WebCore::ComputedStyleExtractor::propertyValue):
875         * css/CSSParser.cpp:
876         (WebCore::CSSParser::parseValue):
877         * css/CSSPrimitiveValueMappings.h:
878         (WebCore::CSSPrimitiveValue::operator ContentDistributionType):
879         (WebCore::CSSPrimitiveValue::operator TextZoom):
880         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
881         * css/CSSPropertyNames.in:
882         * css/StyleBuilderConverter.h:
883         (WebCore::StyleBuilderConverter::csstoLengthConversionDataWithTextZoomFactor):
884         * css/StyleBuilderCustom.h:
885         (WebCore::StyleBuilderCustom::applyValueWebkitTextSizeAdjust):
886         (WebCore::StyleBuilderCustom::applyValueWebkitTextZoom):
887         (WebCore::StyleBuilderCustom::applyTextOrBoxShadowValue):
888         * css/StyleResolver.cpp:
889         (WebCore::StyleResolver::checkForZoomChange):
890         * rendering/style/RenderStyle.cpp:
891         (WebCore::RenderStyle::changeRequiresLayout):
892         * rendering/style/RenderStyle.h:
893         * rendering/style/RenderStyleConstants.h:
894         * rendering/style/StyleRareInheritedData.cpp:
895         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
896         (WebCore::StyleRareInheritedData::operator==):
897         * rendering/style/StyleRareInheritedData.h:
898         * style/StyleFontSizeFunctions.cpp:
899         (WebCore::Style::computedFontSizeFromSpecifiedSize):
900         * testing/Internals.cpp:
901         (WebCore::Internals::setPageZoomFactor):
902         (WebCore::Internals::setTextZoomFactor):
903         (WebCore::Internals::setUseFixedLayout):
904         * testing/Internals.h:
905         * testing/Internals.idl:
906
907 2015-07-21  Per Arne Vollan  <peavo@outlook.com>
908
909         WinLauncher does not start on WinXP.
910         https://bugs.webkit.org/show_bug.cgi?id=147147
911
912         Reviewed by Alex Christensen.
913
914         Calling GetProcessMemoryInfo() on WinXP requires that PSAPI_VERSION is set to 1,
915         see https://msdn.microsoft.com/en-us/library/windows/desktop/ms683219(v=vs.85).aspx.
916
917         * WebCore.vcxproj/WebCoreCommon.props:
918
919 2015-07-20  Michael Catanzaro  <mcatanzaro@igalia.com>
920
921         REGRESSION(r184376): [SOUP] Multiple assertions when downloading files
922         https://bugs.webkit.org/show_bug.cgi?id=147039
923
924         Reviewed by Darin Adler.
925
926         No new tests; this will be covered once we enable the network process for API tests.
927
928         * platform/network/soup/ResourceHandleSoup.cpp:
929         (WebCore::ResourceHandle::releaseForDownload): Call RefPtrBase::relaxAdoptionRequirement so
930         that we don't assert when storing the non-adopted ResourceHandle in a RefPtr. The ref will
931         be dropped in ResourceHandle::cleanupSoupOperation, which as the comment says should always
932         run. HOPEFULLY.
933         (WebCore::ResourceHandle::continueWillSendRequest): Don't assert that client() is nonnull,
934         because the code clearly expects and handles the case where it is null.
935         (WebCore::ResourceHandle::continueDidReceiveResponse): Ditto; note that here client() will
936         always be null for a download.
937
938 2015-07-20  Ada Chan  <adachan@apple.com>
939
940         Follow-up to my earlier fix for r147085
941         https://bugs.webkit.org/show_bug.cgi?id=147085
942
943         Reviewed by Eric Carlson.
944
945         * Modules/webaudio/AudioContext.cpp:
946         (WebCore::AudioContext::isPlayingAudioDidChange):
947         Null-check document() before dereferencing it in case the audio context's document is destroyed
948         by the time the code block is called on the main thread.
949
950 2015-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
951
952         Remove RenderTheme::shouldShowPlaceholderWhenFocused()
953         https://bugs.webkit.org/show_bug.cgi?id=147104
954
955         Reviewed by Martin Robinson.
956
957         GTK+ is the only port that returns false in
958         shouldShowPlaceholderWhenFocused(). That's inconsistent with all
959         other browsers that show the placeholder text even for focused
960         entries in all platforms. We should change the GTK+ port
961         behaviour, but that would leave all implementations of
962         shouldShowPlaceholderWhenFocused returning true, so let's just
963         remove it.
964
965         * html/HTMLTextFormControlElement.cpp:
966         (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
967         Do not consider whether the entry is focused or not.
968         * platform/efl/RenderThemeEfl.h:
969         * rendering/RenderTheme.h:
970         (WebCore::RenderTheme::shouldShowPlaceholderWhenFocused): Deleted.
971         * rendering/RenderThemeIOS.h:
972         * rendering/RenderThemeIOS.mm:
973         (WebCore::RenderThemeIOS::shouldShowPlaceholderWhenFocused): Deleted.
974         * rendering/RenderThemeMac.h:
975         * rendering/RenderThemeMac.mm:
976         (WebCore::RenderThemeMac::shouldShowPlaceholderWhenFocused): Deleted.
977         * rendering/RenderThemeSafari.h:
978         (WebCore::RenderThemeSafari::shouldShowPlaceholderWhenFocused): Deleted.
979         * rendering/RenderThemeWin.h:
980
981 2015-07-20  Zan Dobersek  <zdobersek@igalia.com>
982
983         [CoordinatedGraphics] CoordinatedGraphicsLayer::setContentsToImage() should avoid scheduling unnecessary flushes
984         https://bugs.webkit.org/show_bug.cgi?id=147118
985
986         Reviewed by Martin Robinson.
987
988         Have CoordinatedGraphicsLayer::setContentsToImage() return early if the new
989         passed-in Image and the corresponding native image pointer are equal to the
990         currently set values.
991
992         This specifically avoids scheduling unnecessary flushes when setContentsToImage()
993         is repeatedly called with a null Image pointer, which in previous code would
994         unconditionally result in a scheduled flush even if there was no Image assigned
995         as the content of this layer before. Until now the layer flush scheduling was only
996         avoided if the two non-null native image pointers were equal.
997
998         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
999         (WebCore::CoordinatedGraphicsLayer::setContentsToImage):
1000
1001 2015-07-20  Nan Wang  <n_wang@apple.com>
1002
1003         AX: Selection change as a result of focusing an element may cause Safari to crash
1004         https://bugs.webkit.org/show_bug.cgi?id=147052
1005         <rdar://problem/21778212>
1006
1007         Reviewed by Chris Fleizach.
1008
1009         When focusing an element, it may trigger a deferred layout that invalidates the render 
1010         element, which will cause axObjectCache() to be a nullptr, and lead to a crash. Fix that
1011         by using a RefPtr to hold the object and also caching the axObjectCache().
1012
1013         Test: platform/mac/accessibility/focus-crash.html
1014
1015         * accessibility/AccessibilityRenderObject.cpp:
1016         (WebCore::AccessibilityRenderObject::setFocused):
1017         (WebCore::AccessibilityRenderObject::setSelectedRows):
1018
1019 2015-07-20  Alex Christensen  <achristensen@webkit.org>
1020
1021         Unreviewed build fix after r187049.
1022
1023         * contentextensions/ContentExtension.cpp:
1024         (WebCore::ContentExtensions::ContentExtension::populateDomainCacheIfNeeded):
1025         Can't shrinkToFit HashSets.
1026
1027 2015-07-20  Alex Christensen  <achristensen@webkit.org>
1028
1029         [Content Extensions] Cache actions with domains that match everything
1030         https://bugs.webkit.org/show_bug.cgi?id=147050
1031
1032         Reviewed by Benjamin Poulain.
1033
1034         If you have lots of rules with triggers like {"url-filter":".*","if-domain":["*webkit.org"]}
1035         we will spend a lot of time adding unnecessary actions to HashSets when you are not on webkit.org.
1036         Caching all the rules and only adding them to a collection once when the domain changes saves a lot of URL interpreting time.
1037
1038         We already had an optimization for the css-display-none actions with triggers that matched everything using a special bytecode operation.
1039         This removes the need for a special bytecode operation by caching the triggers that match everything with and without domains,
1040         then from those cached actions we compile a stylesheet, and create cached actions for every new domain we visit.
1041
1042         All functionality is covered by existing API tests.
1043
1044         * contentextensions/CompiledContentExtension.cpp:
1045         (WebCore::ContentExtensions::CompiledContentExtension::~CompiledContentExtension):
1046         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors): Deleted.
1047         * contentextensions/CompiledContentExtension.h:
1048         * contentextensions/ContentExtension.cpp:
1049         (WebCore::ContentExtensions::ContentExtension::ContentExtension):
1050         (WebCore::ContentExtensions::ContentExtension::findFirstIgnorePreviousRules):
1051         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1052         (WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
1053         (WebCore::ContentExtensions::ContentExtension::populateDomainCacheIfNeeded):
1054         (WebCore::ContentExtensions::ContentExtension::cachedDomainActions):
1055         (WebCore::ContentExtensions::ContentExtension::universalActionsWithDomains):
1056         * contentextensions/ContentExtension.h:
1057         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
1058         (WebCore::ContentExtensions::ContentExtension::universalActionsWithoutDomains):
1059         * contentextensions/ContentExtensionCompiler.cpp:
1060         (WebCore::ContentExtensions::compileRuleList):
1061         * contentextensions/ContentExtensionRule.cpp:
1062         (WebCore::ContentExtensions::ContentExtensionRule::ContentExtensionRule):
1063         (WebCore::ContentExtensions::Action::deserialize):
1064         (WebCore::ContentExtensions::Action::deserializeType):
1065         (WebCore::ContentExtensions::Action::serializedLength):
1066         * contentextensions/ContentExtensionRule.h:
1067         (WebCore::ContentExtensions::Action::operator==):
1068         (WebCore::ContentExtensions::Action::setExtensionIdentifier):
1069         (WebCore::ContentExtensions::Action::extensionIdentifier):
1070         * contentextensions/ContentExtensionsBackend.cpp:
1071         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1072         * contentextensions/DFABytecode.h:
1073         (WebCore::ContentExtensions::instructionSizeWithArguments):
1074         * contentextensions/DFABytecodeCompiler.cpp:
1075         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
1076         * contentextensions/DFABytecodeInterpreter.cpp:
1077         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
1078         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
1079         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsMatchingEverything):
1080         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1081         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot): Deleted.
1082         * contentextensions/DFABytecodeInterpreter.h:
1083         * loader/ResourceLoadInfo.h:
1084
1085 2015-07-20  Jeremy Jones  <jeremyj@apple.com>
1086
1087         Adopt AVPlayerLayerView
1088         https://bugs.webkit.org/show_bug.cgi?id=146862
1089
1090         Reviewed by Jer Noble.
1091
1092         The CALayerHost is replaced with WebLayerHostView to be compatible with UIView animations.
1093         Some animation is improved in the conversion.
1094
1095         WebAVPlayerLayerView and WebAVPictureInPicturePlayerLayerView derive from AVKit and UIKit respectively.
1096         Because these frameworks are loaded at runtime, these classes must be generate using objc/runtime.h to
1097         register them from c functions at runtime. The most important part of these UIViews is that their
1098         backing layer is a WebAVPlayerLayer.
1099
1100         WebCALayerHostWrapper and WebAVVideoLayer are combined into WebAVPlayerLayer to simplify the hierarchy.
1101         WebAVPlayerLayer is a stand-in for an AVPlayerLayer.
1102
1103         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1104         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): -removeFromSuperlayer is redundant.
1105         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity): syncTextTrackBounds on change.
1106         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
1107         We never want animation here, since all animation will happen in UIViews. 
1108         This is just for going into the final size after a transform based animation.
1109
1110         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1111         (WebVideoFullscreenControllerContext::didSetupFullscreen): layer -> view
1112         (WebVideoFullscreenControllerContext::didCleanupFullscreen): layer -> view
1113         (WebVideoFullscreenControllerContext::setUpFullscreen): layer -> view
1114
1115         (WebVideoFullscreenControllerContext::setVideoLayerFrame): layer -> view
1116         Use fence port to synchronize between the UIThread and the WebThread,
1117         the same way WebKit2 uses a fence port to synchronize between processes.
1118
1119         (WebVideoFullscreenControllerContext::setVideoLayerGravity):
1120         No longer necessary to cache videoGravity at this level.
1121
1122         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1123         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1124
1125         (-[WebAVPlayerLayer init]):
1126         (-[WebAVPlayerLayer dealloc]):
1127         (-[WebAVPlayerLayer playerController]):
1128         (-[WebAVPlayerLayer setBounds:]):
1129         (-[WebAVPlayerLayer resolveBounds]):
1130         (-[WebAVPlayerLayer setVideoGravity:]):
1131         (-[WebAVPlayerLayer videoGravity]):
1132         (-[WebAVPlayerLayer videoRect]):
1133         (+[WebAVPlayerLayer keyPathsForValuesAffectingVideoRect]):
1134         Added class WebAVPlayerLayer, replacing WebAVVideoLayer and WebCALayerHostWrapper.
1135
1136         (WebAVPictureInPicturePlayerLayerView_layerClass):
1137         (getWebAVPictureInPicturePlayerLayerViewClass):
1138         Added runtime class WebAVPictureInPicturePlayerLayerView
1139
1140         (WebAVPlayerLayerView_layerClass):
1141         (WebAVPlayerLayerView_playerController):
1142         (WebAVPlayerLayerView_setPlayerController):
1143         (WebAVPlayerLayerView_videoView):
1144         (WebAVPlayerLayerView_setVideoView):
1145         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
1146         (WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView):
1147         (WebAVPlayerLayerView_pictureInPicturePlayerLayerView):
1148         (getWebAVPlayerLayerViewClass):
1149         Added runtime class WebAVPlayerLayerView
1150
1151         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
1152         Dimensions are also stored in WebAVPlayerLayer so it can make decisions about
1153         animating the video layer.
1154
1155         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
1156         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): 
1157         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
1158         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
1159         Straightforward layer to view conversion.
1160
1161         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
1162         Set view frame using the view hierarchy instead of assuming it is directly in a window.
1163
1164         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
1165         Set view frame using the view hierarchy instead of assuming it is directly in a window.
1166         dispatch_async before calling didExitFullscreen() to allows CATransactions to complete.
1167
1168         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
1169         Set view frame using the view hierarchy instead of assuming it is directly in a window.
1170         dispatch_async before calling didSetupFullscreen() to allows CATransactions to complete.
1171
1172         (-[WebCALayerHostWrapper dealloc]): Deleted.
1173         (-[WebCALayerHostWrapper setVideoSublayer:]): Deleted.
1174         (-[WebCALayerHostWrapper videoSublayer]): Deleted.
1175         (-[WebCALayerHostWrapper setBounds:]): Deleted.
1176         (-[WebCALayerHostWrapper resolveBounds]): Deleted.
1177         Class WebCALayerHostWrapper deleted. Functionality rolled into WebAVPlayerLayer.
1178
1179         (+[WebAVVideoLayer videoLayer]): Deleted.
1180         (-[WebAVVideoLayer init]): Deleted.
1181         (-[WebAVVideoLayer setPlayerViewController:]): Deleted.
1182         (-[WebAVVideoLayer setVideoSublayer:]): Deleted.
1183         (-[WebAVVideoLayer setBounds:]): Deleted.
1184         (-[WebAVVideoLayer setVideoLayerGravity:]): Deleted.
1185         (-[WebAVVideoLayer videoLayerGravity]): Deleted.
1186         (-[WebAVVideoLayer enterPIPModeRedirectingVideoToLayer:]): Deleted.
1187         (-[WebAVVideoLayer leavePIPMode]): Deleted.
1188         Class WebAVVideoLayer deleted. Functionality rolled into WebAVPlayerLayer.
1189
1190         * platform/ios/WebVideoFullscreenModel.h:
1191         * platform/ios/WebVideoFullscreenModelVideoElement.h:
1192         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
1193         No need to store frame and gravity in the model. It is stored in the UI where it is used.
1194
1195         (WebVideoFullscreenModelVideoElement::videoLayerFrame): Deleted.
1196         (WebVideoFullscreenModelVideoElement::videoLayerGravity): Deleted.
1197         * platform/spi/cocoa/AVKitSPI.h: Add AVPlayerLayerView.
1198
1199 2015-07-20  Anders Carlsson  <andersca@apple.com>
1200
1201         Add PLATFORM #ifdefs for Mac SPI headers
1202         https://bugs.webkit.org/show_bug.cgi?id=147129
1203
1204         Reviewed by Tim Horton.
1205
1206         * Configurations/WebCore.xcconfig:
1207         Skip NPAPI headers on iOS.
1208
1209         * platform/mac/WebVideoFullscreenController.h:
1210         * platform/spi/mac/DataDetectorsSPI.h:
1211         * platform/spi/mac/NSEventSPI.h:
1212         * platform/spi/mac/NSFontSPI.h:
1213         * platform/spi/mac/NSMenuSPI.h:
1214
1215 2015-07-20  Tim Horton  <timothy_horton@apple.com>
1216
1217         REGRESSION (r174287): Flash of black when opening a new web view or navigating to a new page
1218         https://bugs.webkit.org/show_bug.cgi?id=147127
1219         <rdar://problem/21474317>
1220
1221         Reviewed by Simon Fraser.
1222
1223         * rendering/RenderView.cpp:
1224         (WebCore::RenderView::paintBoxDecorations):
1225         Avoid using an invalid documentBackgroundColor, fall back to baseBackgroundColor
1226         like we did before r174287.
1227
1228 2015-07-20  Alex Christensen  <achristensen@webkit.org>
1229
1230         [Win] Unreviewed build fix after r187022.
1231
1232         * platform/win/WindowsTouch.h:
1233         Undid changes from r187022
1234
1235 2015-07-20  Jeremy Jones  <jeremyj@apple.com>
1236
1237         Allow video to rotate when app doesnt allow rotation.
1238         https://bugs.webkit.org/show_bug.cgi?id=147121
1239
1240         Reviewed by Jer Noble.
1241
1242         Set an SPI bool on the fullscreen video root view controller to allow it to override app rotation restrictions. 
1243         This allows video to be played in landscape in portrait only apps.
1244
1245         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1246         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
1247
1248 2015-07-20  Andreas Kling  <akling@apple.com>
1249
1250         Unreviewed assertion fix following r187031.
1251
1252         Just have GenericEventQueue::resume() return early if the queue isn't suspended.
1253         Suspend/Resume calls are not always symmetrical in HTMLMediaElement.
1254
1255         * dom/GenericEventQueue.cpp:
1256         (WebCore::GenericEventQueue::resume):
1257
1258 2015-07-20  David Kilzer  <ddkilzer@apple.com>
1259
1260         Unexpected ABI diffference between armv7 and armv7s in WebCore::GraphicsLayerCA::~GraphicsLayerCA()
1261         <http://webkit.org/b/147101>
1262
1263         Reviewed by Michael Saboff.
1264
1265         * platform/graphics/transforms/TransformationMatrix.h: Align
1266         Matrix4 on both armv7 and armv7s.
1267
1268 2015-07-20  Anders Carlsson  <andersca@apple.com>
1269
1270         Add the necessary platform checks to iOS SPI headers
1271         https://bugs.webkit.org/show_bug.cgi?id=147120
1272
1273         Reviewed by Tim Horton.
1274
1275         * platform/spi/ios/GraphicsServicesSPI.h:
1276         * platform/spi/ios/MediaPlayerSPI.h:
1277         * platform/spi/ios/MobileGestaltSPI.h:
1278
1279 2015-07-20  Andreas Kling  <akling@apple.com>
1280
1281         Improve behavior of media elements in page cache.
1282         <https://webkit.org/b/147020>
1283         <rdar://problem/21712311>
1284
1285         Reviewed by Chris Dumez.
1286
1287         Make improvements for media elements when transitioning in/out of page cache:
1288
1289         - Events that were scheduled when going into cache will now be delivered
1290           when the page is restored from cache.
1291
1292         - Data buffering is turned off while in the cache. This reduces the memory
1293           cost of cached pages with media elements on iOS (where mediaserverd would
1294           keep upcoming video frames in memory for cached pages.)
1295
1296         Test: media/restore-from-page-cache.html (amended)
1297
1298         * dom/GenericEventQueue.h:
1299         * dom/GenericEventQueue.cpp:
1300         (WebCore::GenericEventQueue::enqueueEvent):
1301         (WebCore::GenericEventQueue::suspend):
1302         (WebCore::GenericEventQueue::resume):
1303
1304             Add a simple suspend/resume mechanism to GenericEventQueue that can
1305             be used to support page caching.
1306
1307         * html/HTMLMediaElement.cpp:
1308         (WebCore::HTMLMediaElement::stop):
1309         (WebCore::HTMLMediaElement::suspend):
1310         (WebCore::HTMLMediaElement::resume):
1311         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
1312
1313             Adapt to event queueing changes and add calls to setShouldBufferData().
1314
1315         * html/HTMLSourceElement.h:
1316         * html/HTMLSourceElement.cpp:
1317         (WebCore::HTMLSourceElement::HTMLSourceElement):
1318         (WebCore::HTMLSourceElement::create):
1319         (WebCore::HTMLSourceElement::activeDOMObjectName):
1320         (WebCore::HTMLSourceElement::canSuspendForPageCache):
1321         (WebCore::HTMLSourceElement::suspend):
1322         (WebCore::HTMLSourceElement::resume):
1323         (WebCore::HTMLSourceElement::stop):
1324
1325             Turn HTMLSourceElement into an ActiveDOMObject so it gets all the
1326             appropriate page cache notifications directly. Suspend the delayed
1327             error event delivery timer when cached.
1328
1329 2015-07-20  Mark Lam  <mark.lam@apple.com>
1330
1331         Rollout r187020 and r187021: breaks JSC API tests on debug builds.
1332         https://bugs.webkit.org/show_bug.cgi?id=147110
1333
1334         * bindings/js/JSDOMWindowBase.cpp:
1335         (WebCore::JSDOMWindowBase::commonVM):
1336
1337 2015-07-18  Ada Chan  <adachan@apple.com>
1338
1339         Fix deadlock between -[AVPlayerItem currentTime] and -[AVPlayer isExternalPlaybackActive]
1340         https://bugs.webkit.org/show_bug.cgi?id=147085
1341         <rdar://problem/21878275>
1342
1343         Reviewed by Jer Noble.
1344
1345         * Modules/webaudio/AudioContext.cpp:
1346         (WebCore::AudioContext::isPlayingAudioDidChange):
1347         Call Document::updateIsPlayingMedia() on the main thread, since we could be on the audio I/O
1348         thread here and the Document::updateIsPlayingMedia() call could block, causing a deadlock.
1349
1350 2015-07-20  Alex Christensen  <achristensen@webkit.org>
1351
1352         Resurrect CMake build on Windows.
1353         https://bugs.webkit.org/show_bug.cgi?id=147083
1354
1355         Reviewed by Gyuyoung Kim.
1356
1357         * CMakeLists.txt:
1358         * PlatformWin.cmake:
1359         * dom/Document.cpp:
1360         (WebCore::Document::~Document):
1361         * dom/Range.cpp:
1362         * dom/Text.cpp:
1363         * editing/CompositeEditCommand.cpp:
1364         * platform/graphics/texmap/BitmapTexturePool.cpp:
1365         (WebCore::BitmapTexturePool::createTexture):
1366         * platform/win/WindowsTouch.h:
1367         * rendering/RenderThemeWin.h:
1368         Fixed some including and compiling quirks needed for different configurations.
1369
1370 2015-07-20  Per Arne Vollan  <peavo@outlook.com>
1371
1372         JavaScriptCore performance is very bad on Windows
1373         https://bugs.webkit.org/show_bug.cgi?id=146448
1374
1375         Reviewed by Mark Lam.
1376
1377         * bindings/js/JSDOMWindowBase.cpp:
1378         (WebCore::JSDOMWindowBase::commonVM): Compile fix.
1379
1380 2015-07-19  Tim Horton  <timothy_horton@apple.com>
1381
1382         Make shrink-wrapping test a ref-test instead of pixel-test
1383         https://bugs.webkit.org/show_bug.cgi?id=147081
1384
1385         Reviewed by Sam Weinig.
1386
1387         Nobody runs pixel tests.
1388
1389         * svg/SVGPathUtilities.cpp:
1390         (WebCore::pathIteratorForBuildingString):
1391         (WebCore::buildStringFromPath):
1392         * svg/SVGPathUtilities.h:
1393         Add a helper that turns a Path into a SVG path string.
1394
1395         * testing/Internals.cpp:
1396         (WebCore::Internals::pathStringWithShrinkWrappedRects):
1397         * testing/Internals.h:
1398         * testing/Internals.idl:
1399         Have the internals shrink-wrap method return an SVG path instead of a DOMPath.
1400
1401 2015-07-19  David Kilzer  <ddkilzer@apple.com>
1402
1403         REGRESSION (r187008): CGPathCreateMutableCopyByTransformingPath() is not available on Windows
1404         <https://bugs.webkit.org/show_bug.cgi?id=147077>
1405
1406         * platform/graphics/cg/PathCG.cpp:
1407         (WebCore::Path::transform): Restore less efficient code path
1408         for Windows.
1409
1410 2015-07-18  Tim Horton  <timothy_horton@apple.com>
1411
1412         Simplify Path(CG)::transform/translate
1413         https://bugs.webkit.org/show_bug.cgi?id=147077
1414
1415         Reviewed by Simon Fraser.
1416
1417         No new tests; no behavior change.
1418
1419         * platform/graphics/cg/PathCG.cpp:
1420         (WebCore::Path::translate):
1421         (WebCore::Path::transform):
1422         Use CGPathCreateMutableCopyByTransformingPath to do the copy and transform
1423         in a single call instead of two.
1424
1425         Make use of transform() to implement translate() instead of duplicating the code.
1426         Move the two functions near each other.
1427
1428         (WebCore::Path::boundingRect):
1429         Remove irrelevant reference to Snow Leopard.
1430
1431 2015-07-17  Matt Rajca  <mrajca@apple.com>
1432
1433         Media Session: Add support for 'Content' interruption types
1434         https://bugs.webkit.org/show_bug.cgi?id=147042
1435
1436         Reviewed by Eric Carlson.
1437
1438         Tests: Added media/session/content-interruptions
1439
1440         * Modules/mediasession/MediaSession.cpp:
1441         (WebCore::MediaSession::handleIndefinitePauseInterruption): Indefinitely pause the session by pausing media
1442          elements and removing them from the set of active participating elements.
1443         * Modules/mediasession/MediaSession.h:
1444         * Modules/mediasession/MediaSessionManager.cpp:
1445         (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification): Implemented support for 'Content'
1446          interruption types as described in 4.5.2.
1447
1448 2015-07-16  Matt Rajca  <mrajca@apple.com>
1449
1450         Media Session: add support for telephony interruptions
1451         https://bugs.webkit.org/show_bug.cgi?id=147016
1452
1453         Reviewed by Eric Carlson.
1454
1455         * platform/audio/mac/MediaSessionInterruptionProviderMac.mm:
1456         (WebCore::callDidBeginRinging): Forward this event to media sessions as a 'Transient' interruption.
1457         (WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
1458         (WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):
1459
1460 2015-07-17  Matt Rajca  <mrajca@apple.com>
1461
1462         Media Session: add infrastructure for testing interruptions
1463         https://bugs.webkit.org/show_bug.cgi?id=147060
1464
1465         Reviewed by Eric Carlson.
1466
1467         * Modules/mediasession/MediaSession.h: Export methods to be used with tests.
1468         * Modules/mediasession/MediaSessionManager.h: Ditto.
1469         * bindings/scripts/CodeGeneratorJS.pm: JSMediaSession needs to be marked with WEBCORE_EXPORT so it works with JSInternals.
1470         * testing/Internals.cpp:
1471         (WebCore::Internals::sendMediaSessionStartOfInterruptionNotification): Let tests send interruptions to MediaSessionManager.
1472         (WebCore::Internals::sendMediaSessionEndOfInterruptionNotification): Ditto.
1473         (WebCore::Internals::mediaSessionCurrentState): Expose the current state of media sessions to tests.
1474         * testing/Internals.h:
1475         * testing/Internals.idl: Add interfaces for sending interruptions from JS tests.
1476
1477 2015-07-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1478
1479         Reduce PassRefPtr in WebKit2 - 3
1480         https://bugs.webkit.org/show_bug.cgi?id=146995
1481
1482         Reviewed by Daniel Bates.
1483
1484         To remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
1485         Because some uses depend on WebCore, WebCore, WK1 ports are modified as well.
1486
1487         * loader/EmptyClients.cpp:
1488         (WebCore::EmptyChromeClient::createPopupMenu):
1489         (WebCore::EmptyChromeClient::createSearchPopupMenu):
1490         (WebCore::EmptyFrameLoaderClient::createDocumentLoader):
1491         (WebCore::EmptyFrameLoaderClient::createFrame):
1492         (WebCore::EmptyFrameLoaderClient::createPlugin):
1493         * loader/EmptyClients.h:
1494         * loader/FrameLoader.cpp:
1495         (WebCore::FrameLoader::init):
1496         (WebCore::FrameLoader::load):
1497         (WebCore::FrameLoader::loadWithNavigationAction):
1498         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1499         (WebCore::FrameLoader::reload):
1500         * loader/FrameLoaderClient.h:
1501         * loader/ResourceLoadScheduler.cpp:
1502         (WebCore::ResourceLoadScheduler::scheduleSubresourceLoad):
1503         (WebCore::ResourceLoadScheduler::schedulePluginStreamLoad):
1504         * loader/ResourceLoadScheduler.h:
1505         * loader/SubresourceLoader.cpp:
1506         (WebCore::SubresourceLoader::create):
1507         * loader/SubresourceLoader.h:
1508         * page/ChromeClient.h:
1509         * platform/graphics/texmap/TextureMapperBackingStore.h:
1510         * platform/graphics/texmap/TextureMapperLayer.h:
1511         (WebCore::TextureMapperLayer::texture):
1512         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp:
1513         (WebCore::TextureMapperSurfaceBackingStore::texture):
1514         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.h:
1515         * platform/graphics/texmap/TextureMapperTile.h:
1516         (WebCore::TextureMapperTile::texture):
1517         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
1518         (WebCore::TextureMapperTiledBackingStore::texture):
1519         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
1520         * storage/StorageNamespace.h:
1521
1522 2015-07-18  David Kilzer  <ddkilzer@apple.com>
1523
1524         REGRESSION (r186976): Use piFloat instead of M_PI
1525
1526         Attempt to fix the following build failure:
1527
1528             PathUtilities.cpp(183): error C2065: 'M_PI' : undeclared identifier [...\Source\WebCore\WebCore.vcxproj\WebCore.vcxproj]
1529
1530         * platform/graphics/PathUtilities.cpp:
1531         (WebCore::walkGraphAndExtractPolygon): Use piFloat since M_PI is
1532         not defined on Windows.
1533
1534 2015-07-18  David Kilzer  <ddkilzer@apple.com>
1535
1536         REGRESSION (r186976): Windows build broke due to missing definition of M_PI
1537
1538         Attempt to fix the following build failure:
1539
1540             PathUtilities.cpp(182): error C2065: 'M_PI' : undeclared identifier [...\Source\WebCore\WebCore.vcxproj\WebCore.vcxproj]
1541
1542         * platform/graphics/PathUtilities.cpp: Include <wtf/MathExtras.h>.
1543
1544 2015-07-17  Zalan Bujtas  <zalan@apple.com>
1545
1546         REGRESSION (r169105): Do not assign a renderer to multiple selection subtrees.
1547         https://bugs.webkit.org/show_bug.cgi?id=147038
1548         rdar://problem/21819351
1549
1550         Reviewed by David Kilzer.
1551
1552         A renderer should never be assigned to multiple selection subtrees. (Currently RenderObject maintains the last selection state.)
1553         RenderView::applySubtreeSelection() loops from the start to the end of the selection to find renderers that are inside the selection.
1554         However, in case of regions (when multiple selection roots are present) traversing the renderer tree by calling RenderObject::nextInPreOrder() could
1555         end up going across selection roots.
1556         This patch ensures that we assign renderers to a specific selection only when the current selection root and the renderer's selection root match.
1557
1558         Test: fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees2.html
1559
1560         * rendering/RenderView.cpp:
1561         (WebCore::SelectionIterator::SelectionIterator):
1562         (WebCore::SelectionIterator::current):
1563         (WebCore::SelectionIterator::checkForSpanner):
1564         (WebCore::RenderView::applySubtreeSelection):
1565
1566 2015-07-17  Andy Estes  <aestes@apple.com>
1567
1568         [iOS] Further tighten the sandbox around pages fetched with Content-Disposition: attachment
1569         https://bugs.webkit.org/show_bug.cgi?id=147044
1570         rdar://problem/21567820
1571
1572         Reviewed by Brady Eidson.
1573
1574         In addition to placing resources fetched with 'Content-Disposition: attachment' in a unique origin,
1575         this change does the following:
1576
1577         - Switches the sandbox type from SandboxOrigin to SandboxAll, which enforces the same restrictions as <iframe sandbox>.
1578         - Disables processing of <meta http-equiv> elements.
1579         - Disables loading of cross-origin subframes.
1580
1581         Tests: http/tests/contentdispositionattachmentsandbox/cross-origin-frames-disabled.html
1582                http/tests/contentdispositionattachmentsandbox/form-submission-disabled.html
1583                http/tests/contentdispositionattachmentsandbox/http-equiv-disabled.html
1584                http/tests/contentdispositionattachmentsandbox/plugins-disabled.html
1585                http/tests/contentdispositionattachmentsandbox/scripts-disabled.html
1586
1587         * dom/Document.cpp:
1588         (WebCore::Document::processHttpEquiv): Switched to calling Document::httpEquivPolicy(). Logged an error to the console for policies other than Enabled.
1589         (WebCore::Document::initSecurityContext): Switched sandbox enforcement from SandboxOrigin to SandboxAll.
1590         (WebCore::Document::httpEquivPolicy): Returned a HttpEquivPolicy based on shouldEnforceContentDispositionAttachmentSandbox() and Settings::httpEquivEnabled().
1591         (WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox): Returned true if Settings::contentDispositionAttachmentSandboxEnabled()
1592         and the document was fetched as an attachment.
1593         * dom/Document.h:
1594         * loader/cache/CachedResourceLoader.cpp: 
1595         (WebCore::CachedResourceLoader::canRequest): When requesting a subframe main resource when the parent frame enforces an attachment sandbox,
1596         only continue if the parent frame's SecurityOrigin allows the request.
1597         * page/Settings.in: Added contentDispositionAttachmentSandboxEnabled with an initial value of false.
1598
1599 2015-07-17  Zalan Bujtas  <zalan@apple.com>
1600
1601         (display: block)input range's thumb disappears when moved.
1602         https://bugs.webkit.org/show_bug.cgi?id=146896
1603         <rdar://problem/21787807>
1604
1605         Reviewed by Simon Fraser.
1606
1607         Since the thumb is positioned after the layout for the input (shadow) subtree is finished, the repaint rects
1608         issued during the layout will not cover the re-positioned thumb.
1609         We need to issue a repaint soon after the thumb is re-positioned.
1610
1611         Test: fast/repaint/block-inputrange-repaint.html
1612
1613         * html/shadow/SliderThumbElement.cpp:
1614         (WebCore::RenderSliderContainer::layout):
1615
1616 2015-07-17  Simon Fraser  <simon.fraser@apple.com>
1617
1618         Attempt to fix the build.
1619
1620         * html/HTMLMediaElement.cpp:
1621         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless):
1622         * html/HTMLMediaElement.h:
1623
1624 2015-07-17  Dean Jackson  <dino@apple.com>
1625
1626         Picture in Picture interacts poorly with AirPlay/HDMI
1627         https://bugs.webkit.org/show_bug.cgi?id=147061
1628         <rdar://problem/19192076>
1629
1630         Reviewed by Tim Horton.
1631
1632         When we are actively playing to an external target, the
1633         picture in picture button should be hidden.
1634
1635         Also, the availability of picture in picture is also
1636         dependent on AirPlay, so that we don't auto-pip when
1637         we're displaying on a TV.
1638
1639         * Modules/mediacontrols/mediaControlsiOS.js:
1640         (ControllerIOS.prototype.configureInlineControls): Call the update function.
1641         (ControllerIOS.prototype.updatePictureInPictureButton): Add or remove a hidden class.
1642         * html/MediaElementSession.cpp:
1643         (WebCore::MediaElementSession::allowsPictureInPicture): Check Airplay status.
1644
1645 2015-07-17  Tim Horton  <timothy_horton@apple.com>
1646
1647         [iOS] TextIndicator has a large forehead when line-height > 1
1648         https://bugs.webkit.org/show_bug.cgi?id=147058
1649         <rdar://problem/21643094>
1650
1651         Reviewed by Dean Jackson.
1652
1653         * editing/FrameSelection.cpp:
1654         (WebCore::FrameSelection::getClippedVisibleTextRectangles):
1655         * editing/FrameSelection.h:
1656         Add a parameter controlling whether getClippedVisibleTextRectangles
1657         returns selection-height rects (including extra line-height) or text-height
1658         rects (including only the text height). Plumb it down.
1659
1660         * page/TextIndicator.cpp:
1661         (WebCore::TextIndicator::createWithRange):
1662         (WebCore::TextIndicator::createWithSelectionInFrame):
1663         Use the tighter text-height rects on iOS, where there's no selection highlight to cover up.
1664         Remove an assertion that is no longer always true, and which is mostly obsoleted by the
1665         fact that we don't let FrameSnapshotting code arbitrarily decide the rect to snapshot anymore.
1666
1667 2015-07-17  Tim Horton  <timothy_horton@apple.com>
1668
1669         Improve rect shrink-wrapping algorithm
1670         https://bugs.webkit.org/show_bug.cgi?id=147037
1671         <rdar://problem/21643094>
1672
1673         Reviewed by Simon Fraser.
1674
1675         * platform/graphics/FloatPoint.h:
1676         (WebCore::areEssentiallyEqual):
1677         Added; implementation is the same as FloatSize's.
1678
1679         * platform/graphics/PathUtilities.cpp:
1680         (WebCore::FloatPointGraph::FloatPointGraph):
1681         (WebCore::FloatPointGraph::~FloatPointGraph):
1682         (WebCore::FloatPointGraph::Node::Node):
1683         (WebCore::FloatPointGraph::Node::nextPoints):
1684         (WebCore::FloatPointGraph::Node::addNextPoint):
1685         (WebCore::FloatPointGraph::Node::isVisited):
1686         (WebCore::FloatPointGraph::Node::visit):
1687         (WebCore::FloatPointGraph::Node::reset):
1688         (WebCore::FloatPointGraph::reset):
1689         (WebCore::FloatPointGraph::findOrCreateNode):
1690         (WebCore::findLineSegmentIntersection):
1691         (WebCore::addIntersectionPoints):
1692         (WebCore::walkGraphAndExtractPolygon):
1693         (WebCore::findUnvisitedPolygonStartPoint):
1694         (WebCore::unitePolygons):
1695         (WebCore::edgesForRect):
1696         (WebCore::PathUtilities::pathWithShrinkWrappedRects):
1697         (WebCore::addShrinkWrapRightCorner): Deleted.
1698         (WebCore::addShrinkWrapLeftCorner): Deleted.
1699         (WebCore::addShrinkWrappedPathForRects): Deleted.
1700         (WebCore::rectsIntersectOrTouch): Deleted.
1701         (WebCore::findSetContainingRect): Deleted.
1702         Add a new implementation of shrink-wrap, which is significantly more
1703         generic than the old one, which assumed a top-down progression of rects.
1704
1705         This version uses polygon intersection to find the path around the
1706         set of rects, and then follows said path and adds appropriately-sized
1707         arcs for the corners.
1708
1709         The polygon intersection algorithm first finds all the intersection points
1710         between all of the rects, then builds a graph of edges outward from one point.
1711         It then traverses the graph, choosing at each point the next edge which
1712         has not been visited and has the greatest interior angle, recording the polygon as it goes.
1713
1714         If at the end of the traversal we have not returned to the initial node,
1715         we give up on shrink-wrapping and just use a bounding box around the rects.
1716
1717         If any of the original rects have not been visited at all, we repeat the traversal
1718         starting with that rect, making an additional polygon (since we removed completely contained
1719         rects before we started, having not visited the rect at all means that it's not connected
1720         to the others).
1721
1722         Once we have a set of united polygons, we follow each one, determining the ideal (always
1723         equal in width and height, never more than half the length of either edge, so that we always
1724         have a smooth curve) arc radius and projecting it onto the edge, and then
1725         adding an arc between the end of the previous path and beginning of the next.
1726
1727         Because the shrink-wrap algorithm is fairly expensive, if there are more than 20 rects,
1728         we fall back to a bounding box. Given the current use cases, this is more than enough
1729         rects, but can certainly be adjusted in the future if needed.
1730
1731         * testing/Internals.cpp:
1732         (WebCore::Internals::pathWithShrinkWrappedRects):
1733         * testing/Internals.h:
1734         * testing/Internals.idl:
1735         Add a radius parameter.
1736
1737 2015-07-17  Nan Wang  <n_wang@apple.com>
1738
1739         AX: iframe within table cell is inaccessible to VoiceOver
1740         https://bugs.webkit.org/show_bug.cgi?id=147001
1741         <rdar://problem/21106945>
1742
1743         Reviewed by Chris Fleizach.
1744
1745         When a table cell is created before its parent table determines if it should be ignored or not,
1746         the table cell may cache the wrong role. Fix that by allowing each table cell to update its role
1747         after the table makes this determination.
1748
1749         Test: accessibility/iframe-within-cell.html
1750
1751         * accessibility/AccessibilityTable.cpp:
1752         (WebCore::AccessibilityTable::addChildren):
1753         (WebCore::AccessibilityTable::addChildrenFromSection):
1754
1755 2015-07-17  Myles C. Maxfield  <mmaxfield@apple.com>
1756
1757         style.fontFamily accessor crashes on unstyled node created from DOMParser().parseFromString()
1758         https://bugs.webkit.org/show_bug.cgi?id=147026
1759         <rdar://problem/21864487>
1760
1761         Reviewed by Andreas Kling.
1762
1763         Font CSS properties are a little special because they are used as indices into caches.
1764         Normally, StyleResolver gives all nodes a default font family, so our cache works correctly.
1765         However, if the document doesn't have a Settings object, StyleResolver wasn't doing this.
1766         Documents created from DOMParser().parseFromString() don't have a Settings object.
1767
1768         Test: fast/text/crash-font-family-parsed.html
1769
1770         * css/StyleResolver.cpp:
1771         (WebCore::StyleResolver::defaultStyleForElement):
1772         (WebCore::StyleResolver::initializeFontStyle): Set a font family even if we don't have a
1773         Settings object.
1774
1775 2015-07-17  Myles C. Maxfield  <mmaxfield@apple.com>
1776
1777         Video posters disappear once media has loaded
1778         https://bugs.webkit.org/show_bug.cgi?id=147045
1779
1780         Reviewed by Simon Fraser.
1781
1782         After r184932, all video elements are composited. However, there is logic in
1783         RenderLayerBacking::updateConfiguration() which adds the video layer to the page
1784         if the video is composited, without checking first to see if it should actually
1785         do so.
1786
1787         Test: compositing/video/poster.html
1788
1789         * rendering/RenderLayerBacking.cpp:
1790         (WebCore::RenderLayerBacking::updateConfiguration):
1791
1792 2015-07-17  Benjamin Poulain  <bpoulain@apple.com>
1793
1794         [Content Extensions] Term::isUniversalTransition() incorrectly expects the end-of-line assertion in character sets
1795         https://bugs.webkit.org/show_bug.cgi?id=147032
1796
1797         Reviewed by Alex Christensen.
1798
1799         * contentextensions/Term.h:
1800         (WebCore::ContentExtensions::Term::isUniversalTransition):
1801         The universal transition is not supposed to account for the end-of-line assertion,
1802         it should be a transition matching any character.
1803
1804         Here, we were counting 128 transitions, the 127 characters plus the
1805         transition on zero we are using for EOL.
1806
1807         The end result is Term::isUniversalTransition() was completely useless.
1808         The only code using it is the pattern simplificaton phase. That part
1809         was not working correclty and was allowing useless ".*" in the patterns.
1810
1811 2015-07-17  Dan Bernstein  <mitz@apple.com>
1812
1813         WebCore part of <rdar://problem/21803781> The external URL policy is not reported correctly in navigation actions that create new windows
1814         https://bugs.webkit.org/show_bug.cgi?id=147040
1815
1816         Reviewed by Dean Jackson.
1817
1818         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm
1819
1820         * loader/FrameLoader.cpp:
1821         (WebCore::shouldOpenExternalURLsPolicyToApply): Pulled the logic out of
1822         applyShouldOpenExternalURLsPolicyToNewDocumentLoader into this new helper.
1823         (WebCore::FrameLoader::loadURL): When targeting a new frame, apply the external URLs policy
1824         to the action passed to checkNewWindowPolicy.
1825         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader): Call the new
1826         helper function.
1827         (WebCore::createWindow): Include the external URL policy in the action passed to
1828         createWindow.
1829
1830 2015-07-17  Anders Carlsson  <andersca@apple.com>
1831
1832         ScrollView.h should be self-contained
1833         https://bugs.webkit.org/show_bug.cgi?id=147004
1834
1835         Reviewed by Sam Weinig.
1836
1837         * platform/ScrollView.h:
1838
1839 2015-07-17  Brady Eidson  <beidson@apple.com>
1840
1841         Rolling r186895 back in, in its entirety.
1842         https://bugs.webkit.org/show_bug.cgi?id=146976
1843
1844         Rubberstamped by Tim Horton.
1845
1846         * platform/network/cf/CookieJarCFNet.cpp:
1847         (WebCore::createCookies): Use new CFNetwork SPI.
1848
1849 2015-07-17  Benjamin Poulain  <bpoulain@apple.com>
1850
1851         [Content Extensions] CSS-display-none rules are not working properly
1852         https://bugs.webkit.org/show_bug.cgi?id=147024
1853
1854         Reviewed by Sam Weinig.
1855
1856         There were 2 bugs prevening rules with css-display-none and a url-filter from working
1857         correctly.
1858
1859         First, ContentExtensions::serializeActions() was merging selectors regardless of their
1860         trigger. All the CSS Selectors would be grouped together and applied regardless of which
1861         rule apply.
1862
1863         That problem was fixed by grouping CSS rules by trigger. We want all the undistinguishable
1864         CSS rules to be merged. The trigger makes 2 rules dinstinguishable as one rule can apply
1865         on a page while the next rule does not. The simplest approach is to group by trigger.
1866
1867         The second problem had to do with rules added before the document is created.
1868         When accumulating those rules, we were only keeping the last one. The reason was that
1869         DocumentLoader::addPendingContentExtensionDisplayNoneSelector() would only keep a single
1870         selector list by extension.
1871
1872         This is fixed by keeping a vector of all the rules that apply.
1873
1874         Tests: http/tests/contentextensions/css-display-none-with-different-case-sensitivity-are-not-merged.html
1875                http/tests/contentextensions/css-display-none-with-different-triggers-are-not-merged.html
1876                http/tests/contentextensions/two-distinguishable-css-display-none-rules-on-main-resource.html
1877
1878         * contentextensions/ContentExtensionCompiler.cpp:
1879         (WebCore::ContentExtensions::serializeActions):
1880         * contentextensions/ContentExtensionRule.h:
1881         (WebCore::ContentExtensions::Trigger::isEmpty):
1882         (WebCore::ContentExtensions::TriggerHash::hash):
1883         (WebCore::ContentExtensions::TriggerHash::equal):
1884         (WebCore::ContentExtensions::TriggerHashTraits::constructDeletedValue):
1885         (WebCore::ContentExtensions::TriggerHashTraits::isDeletedValue):
1886         (WebCore::ContentExtensions::TriggerHashTraits::emptyValue):
1887         (WebCore::ContentExtensions::TriggerHashTraits::isEmptyValue):
1888         * contentextensions/ContentExtensionsBackend.cpp:
1889         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): Deleted.
1890         * loader/DocumentLoader.cpp:
1891         (WebCore::DocumentLoader::commitData):
1892         (WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
1893         * loader/DocumentLoader.h:
1894
1895 2015-07-17  Tim Horton  <timothy_horton@apple.com>
1896
1897         iOS TextIndicators include text that is not supposed to be indicated
1898         https://bugs.webkit.org/show_bug.cgi?id=147028
1899         <rdar://problem/21643094>
1900
1901         Reviewed by Sam Weinig.
1902
1903         Paint the selection and background, but not other foregrounds, for iOS TextIndicators.
1904
1905         * page/FrameSnapshotting.cpp:
1906         (WebCore::snapshotFrameRect):
1907         * page/FrameSnapshotting.h:
1908         Add a new snapshot option where we'll paint backgrounds and the selected
1909         foreground and nothing else.
1910         Pass the new snapshot option through as a paint behavior.
1911
1912         * page/TextIndicator.cpp:
1913         (WebCore::TextIndicator::createWithRange):
1914         Implement the incantations necessary to make a temporary selection
1915         change not get sent to the UI process and actually have WebCore know about it
1916         and accurately respond to questions about it.
1917
1918         (WebCore::TextIndicator::createWithSelectionInFrame):
1919         Paint selection and backgrounds on iOS.
1920
1921         * rendering/PaintPhase.h:
1922         * rendering/RenderLayer.cpp:
1923         (WebCore::RenderLayer::paintLayerContents):
1924         * rendering/RenderElement.cpp:
1925         (WebCore::RenderElement::selectionColor):
1926         Add a new paint behavior, SelectionAndBackgroundsOnly, which behaves
1927         the same as selection only except it allows backgrounds to paint.
1928
1929 2015-07-17  Mark Lam  <mark.lam@apple.com>
1930
1931         Remove leak of objects between isolated worlds on custom events, message events, and pop state events.
1932         https://bugs.webkit.org/show_bug.cgi?id=118884
1933
1934         Reviewed by Filip Pizlo and Mark Lam.
1935         Patch by Keith Miller  <keith_miller@apple.com>.
1936
1937         Tests: fast/events/event-leak-objects.html
1938                fast/events/event-properties-gc.html
1939
1940         Fixes an issue where objects passed as certain properties of events could cross isolated worlds. This
1941         was fixed by checking that any object passed by an event must be serializable or originate from the same
1942         isolated world as the one it is currently being accessed in. In the case of MessageEvents and PopStateEvents we
1943         cache the values of the data and state properties, respectively, as they may be a deserialized object. In case
1944         an object was deserialized in a world with elevated privileges we also check the cached value is from the same
1945         world, if it is from a different world we recompute it. For testing purposes, I added a new function to Internals
1946         that determines whether a JSObject originated in the current world.
1947
1948         * CMakeLists.txt:
1949         * WebCore.xcodeproj/project.pbxproj:
1950         * bindings/js/DOMWrapperWorld.h:
1951         (WebCore::worldForDOMObject):
1952         * bindings/js/JSBindingsAllInOne.cpp:
1953         * bindings/js/JSCustomEventCustom.cpp: Copied from Source/WebCore/dom/CustomEvent.cpp.
1954         (WebCore::JSCustomEvent::detail):
1955         * bindings/js/JSMessageEventCustom.cpp:
1956         (WebCore::JSMessageEvent::data):
1957         * bindings/js/JSPopStateEventCustom.cpp:
1958         (WebCore::JSPopStateEvent::state):
1959         * dom/CustomEvent.cpp:
1960         (WebCore::CustomEvent::initCustomEvent):
1961         (WebCore::CustomEvent::trySerializeDetail):
1962         * dom/CustomEvent.h:
1963         * dom/CustomEvent.idl:
1964         * dom/MessageEvent.cpp:
1965         (WebCore::MessageEvent::initMessageEvent):
1966         (WebCore::MessageEvent::trySerializeData):
1967         * dom/MessageEvent.h:
1968         * dom/PopStateEvent.cpp:
1969         (WebCore::PopStateEvent::trySerializeState):
1970         * dom/PopStateEvent.h:
1971         * testing/Internals.cpp:
1972         (WebCore::Internals::isFromCurrentWorld):
1973         * testing/Internals.h:
1974         * testing/Internals.idl:
1975
1976 2015-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1977
1978         [GTK] Cleanup PasteboardHelper
1979         https://bugs.webkit.org/show_bug.cgi?id=147035
1980
1981         Reviewed by Žan Doberšek.
1982
1983         It's actually a singleton, but the API suggests you can create
1984         your own or use the default one, but the default one should be the
1985         only one. Rename PasteboardHelper::defaultPasteboardHelper() as
1986         PasteboardHelper::singleton() and make it non-copyable and never
1987         destroyed.
1988
1989         * platform/gtk/PasteboardGtk.cpp:
1990         (WebCore::Pasteboard::writePlainText): Use PasteboardHelper::singleton().
1991         (WebCore::Pasteboard::write): Ditto.
1992         (WebCore::Pasteboard::writePasteboard): Ditto.
1993         (WebCore::Pasteboard::clear): Ditto.
1994         (WebCore::Pasteboard::canSmartReplace): Ditto.
1995         (WebCore::Pasteboard::read): Ditto.
1996         (WebCore::Pasteboard::hasData): Ditto.
1997         (WebCore::Pasteboard::types): Ditto.
1998         (WebCore::Pasteboard::readString): Ditto.
1999         (WebCore::Pasteboard::readFilenames): Ditto.
2000         * platform/gtk/PasteboardHelper.cpp:
2001         (WebCore::PasteboardHelper::singleton): Renamed as singleton, also
2002         use NeverDestroyed and return a reference instead of a pointer.
2003         (WebCore::PasteboardHelper::PasteboardHelper): Do all
2004         initializations here and remove the initialization static flag,
2005         since this is a real singleton now. Also use
2006         gdk_atom_intern_static_string() to initialize the atoms instead of
2007         gdk_atom_intern().
2008         (WebCore::PasteboardHelper::targetList):
2009         (WebCore::PasteboardHelper::targetListForDataObject):
2010         (WebCore::getClipboardContentsCallback):
2011         * platform/gtk/PasteboardHelper.h:
2012
2013 2015-07-16  Matt Rajca  <mrajca@apple.com>
2014
2015         Media Session: handle 'Transient' and 'Transient Solo' interruption events
2016         https://bugs.webkit.org/show_bug.cgi?id=146840
2017
2018         Reviewed by Eric Carlson.
2019
2020         * Modules/mediasession/MediaSession.cpp:
2021         (WebCore::MediaSession::handleDuckInterruption): Added stub.
2022         (WebCore::MediaSession::handleUnduckInterruption): Added stub.
2023         (WebCore::MediaSession::handlePauseInterruption): Pause active media elements. We use our helper method to do this
2024           "safely" since pausing a media element can change the collection we're iterating.
2025         (WebCore::MediaSession::handleUnpauseInterruption): Unpause active media elements. We use our helper method to do this
2026           "safely" since unpausing a media element can change the collection we're iterating.
2027         (WebCore::MediaSession::togglePlayback): Factored out "safe" iteration into a helper method elsewhere.
2028         (WebCore::MediaSession::safelyIterateActiveMediaElements): Safely iterate through the collection of active media
2029           elements.
2030         * Modules/mediasession/MediaSession.h:
2031         * Modules/mediasession/MediaSessionManager.cpp:
2032         (WebCore::MediaSessionManager::MediaSessionManager): On Mac, register for platform-specific interruptions.
2033         (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification): Implemented section 4.5.2 of Media Session spec.
2034         (WebCore::MediaSessionManager::didReceiveEndOfInterruptionNotification): Ditto.
2035         * Modules/mediasession/MediaSessionManager.h:
2036
2037 2015-07-16  Matt Rajca  <mrajca@apple.com>
2038
2039         Media Session: add support for platform-specific interruption providers
2040         https://bugs.webkit.org/show_bug.cgi?id=147008
2041
2042         Reviewed by Eric Carlson.
2043
2044         * WebCore.xcodeproj/project.pbxproj: Include new source files.
2045         * platform/mediasession/MediaSessionInterruptionProvider.cpp: Added base class to be used by MediaSessionManager
2046           to listen for interruption notifications.
2047         (WebCore::MediaSessionInterruptionProvider::MediaSessionInterruptionProvider): Begin listening for interruptions
2048           upon construction.
2049         (WebCore::MediaSessionInterruptionProvider::~MediaSessionInterruptionProvider): Stop listening for interruptions
2050           before destruction.
2051         (WebCore::MediaSessionInterruptionProvider::beginListeningForInterruptions): To be overridden by subclasses.
2052         (WebCore::MediaSessionInterruptionProvider::stopListeningForInterruptions): To be overridden by subclasses.
2053         * platform/mediasession/MediaSessionInterruptionProvider.h: Added.
2054         (WebCore::MediaSessionInterruptionProviderClient::~MediaSessionInterruptionProviderClient):
2055         (WebCore::MediaSessionInterruptionProvider::client):
2056         * platform/mediasession/mac/MediaSessionInterruptionProviderMac.h: Added for providing Mac-specific interruptions.
2057         (WebCore::MediaSessionInterruptionProviderMac::~MediaSessionInterruptionProviderMac):
2058         * platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm: Added stubs.
2059         (WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
2060         (WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):
2061
2062 2015-07-16  Tim Horton  <timothy_horton@apple.com>
2063
2064         Add shrink-wrapped link highlights
2065         https://bugs.webkit.org/show_bug.cgi?id=147021
2066         <rdar://problem/21643094>
2067
2068         Reviewed by Enrica Casucci.
2069
2070         * WebCore.xcodeproj/project.pbxproj:
2071         * page/TextIndicator.cpp:
2072         (WebCore::TextIndicator::createWithRange):
2073         (WebCore::TextIndicator::createWithSelectionInFrame):
2074         * page/TextIndicator.h:
2075         Add a margin parameter to TextIndicator; this inflates each text rect
2076         by the given amount.
2077
2078         Use snapshotFrameRect instead of snapshotSelection because we really
2079         want an image that exactly fits textBoundingRectInDocumentCoordinates,
2080         and snapshotSelection comes up with selection rects in different ways,
2081         especially on iOS (where it comes up with nothing!).
2082
2083         For now, avoid forcing black text or painting only the selection on iOS.
2084         Eventually, we should have TextIndicator options for these things that
2085         are then respected at the presentation layer.
2086
2087 2015-07-16  Matt Rajca  <mrajca@apple.com>
2088
2089         Media Session: remove plumbing for delivering start/end-of-interruption events
2090         https://bugs.webkit.org/show_bug.cgi?id=147005
2091
2092         Reviewed by Eric Carlson.
2093
2094         Instead of receiving interruptions through WebKit, we will provide platform-specific implementations in WebCore
2095         so the same behavior is available to all clients.
2096
2097         * Modules/mediasession/MediaSessionEvents.h:
2098         * page/Page.cpp:
2099         * page/Page.h:
2100
2101 2015-07-16  Alex Christensen  <achristensen@webkit.org>
2102
2103         [Content Extensions] Cache domain actions
2104         https://bugs.webkit.org/show_bug.cgi?id=146817
2105
2106         Reviewed by Benjamin Poulain.
2107
2108         Right now we run regular expressions on the domain every time we have any rules that match with if-domain or unless-domain.  
2109         This caches the results of running regular expressions on the domain of the main document's url so we only need to 
2110         run those regular expressions when the main document changes domain.  We also spend less time adding unused actions into HashSets.
2111
2112         All behavior is covered by existing api tests, but I added some to explicitly test if-domain and unless-domain with multiple load types.
2113
2114         * contentextensions/ContentExtension.cpp:
2115         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
2116         (WebCore::ContentExtensions::ContentExtension::cachedDomainActions):
2117         * contentextensions/ContentExtension.h:
2118         (WebCore::ContentExtensions::ContentExtension::identifier):
2119         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
2120         * contentextensions/ContentExtensionsBackend.cpp:
2121         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2122         * contentextensions/DFABytecodeInterpreter.cpp:
2123         (WebCore::ContentExtensions::getJumpDistance):
2124         (WebCore::ContentExtensions::matchesDomain):
2125         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
2126         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2127         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
2128         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithDomains):
2129         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2130         * contentextensions/DFABytecodeInterpreter.h:
2131
2132 2015-07-16  Simon Fraser  <simon.fraser@apple.com>
2133
2134         Fix disappearing position:fixed elements in fixed layout mode
2135         https://bugs.webkit.org/show_bug.cgi?id=147019
2136
2137         Reviewed by Tim Horton.
2138
2139         Test: compositing/fixed-with-fixed-layout.html
2140         
2141         When in fixed layout mode, and being scaled down, viewportConstrainedVisibleContentRect() is
2142         the wrong thing to use to determine if position:fixed elements are clipped out. In this case,
2143         use the simpler document bounds (before scaling).
2144         
2145         In the long term,  there needs to be an equivalent of viewportConstrainedVisibleContentRect()
2146         that gives an appropriate rect that can be used here.
2147
2148         * rendering/RenderLayerCompositor.cpp:
2149         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
2150
2151 2015-07-16  Benjamin Poulain  <bpoulain@apple.com>
2152
2153         [Content extensions] Combine suffixes when generating NFAs
2154         https://bugs.webkit.org/show_bug.cgi?id=146961
2155
2156         Reviewed by Alex Christensen.
2157
2158         In this patch, I add a mechanism very similar to the prefix tree
2159         but for the suffix (called a reverse suffix tree here).
2160
2161         The idea is here is to reuse the existing NFA nodes when generating
2162         a chain of suffix Term that were already generated previously.
2163         When generating a disjunction ending with the same suffix, we now
2164         have the same trailing NFA nodes for both sides of the disjunction.
2165
2166         Mixing the prefix and suffix generation can be tricky, we do not want
2167         transitions from a pattern to creep into the suffix of an other.
2168
2169         To avoid any conflict, the rules here are very simple:
2170         -Only use the reverse suffix tree for terms without actions
2171          up to a leaf term with actions.
2172
2173          This rule ensure that no action will accidentally make its way
2174          to an other rule by resuing a vertex of the reverse suffix tree.
2175
2176         -Only use the reverse suffix tree for chains of terms in which
2177          each term only has zero or one following term.
2178
2179          With this condition, when taking any vertex of the reverse suffix
2180          tree, there is only one edge that move out of that vertex when reading
2181          from left to right.
2182          For any vertex, there is only one possible string generated
2183          left-to-right, a single suffix.
2184
2185         This is overly restrictive but it is fast, easier to verify, and it works
2186         well in practice.
2187         For all the more complicated cases, we can count on the Minimizer to
2188         find a better solution.
2189
2190
2191         With all the simple suffixes merged, our NFAs are smaller, which
2192         let us combine more patterns.
2193         The DFAs are also smaller and faster to produce since their size
2194         is relative to the NFA sizes.
2195
2196         Overall, I get the following gains:
2197         -Chris's test case:
2198             compile time -40%.
2199             bytecode size -14%.
2200         -Armand's test case:
2201             compile time -53%.
2202             bytecode size -13%.
2203
2204         * WebCore.xcodeproj/project.pbxproj:
2205         * contentextensions/CombinedURLFilters.cpp:
2206         (WebCore::ContentExtensions::ActiveSubtree::ActiveSubtree):
2207         (WebCore::ContentExtensions::generateInfixUnsuitableForReverseSuffixTree):
2208         (WebCore::ContentExtensions::generateSuffixWithReverseSuffixTree):
2209         (WebCore::ContentExtensions::clearReverseSuffixTree):
2210         (WebCore::ContentExtensions::generateNFAForSubtree):
2211         * contentextensions/DFA.cpp:
2212         (WebCore::ContentExtensions::DFA::debugPrintDot):
2213         Forgot to close a tag, dot was not happy.
2214
2215         * contentextensions/HashableActionList.h: Added.
2216         (WebCore::ContentExtensions::HashableActionList::HashableActionList):
2217         (WebCore::ContentExtensions::HashableActionList::isEmptyValue):
2218         (WebCore::ContentExtensions::HashableActionList::isDeletedValue):
2219         (WebCore::ContentExtensions::HashableActionList::operator==):
2220         (WebCore::ContentExtensions::HashableActionList::operator!=):
2221         (WebCore::ContentExtensions::HashableActionListHash::hash):
2222         (WebCore::ContentExtensions::HashableActionListHash::equal):
2223         We need a way to group reverse suffix tree by their terminal actions.
2224         This new hash structure lets us find unique vertex for a list of actions
2225         in any order.
2226
2227         * contentextensions/ImmutableNFANodeBuilder.h:
2228         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::isValid):
2229         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::nodeId):
2230         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addTransition):
2231         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addEpsilonTransition):
2232         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::ImmutableNFANodeBuilder): Deleted.
2233         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::~ImmutableNFANodeBuilder): Deleted.
2234         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::operator=): Deleted.
2235         * contentextensions/Term.h:
2236         (WebCore::ContentExtensions::Term::generateGraph):
2237         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2238         Node building changes a bit.
2239
2240         Previously, it was assumed nodes are always built from left to right.
2241         Getting the node on the right was done by providing the left node and the term
2242         doing the transition.
2243
2244         Now we have both left to right and right to left generation.
2245
2246         The right-to-left has a specific property: no edge can be added after
2247         it's initial term (rule 2 of our reverse suffix tree). This simplifies
2248         things a bit since we can finalize all the nodes in the suffix tree.
2249         All we need is to keep their ID to be able to link new nodes
2250         to the reverse suffix tree.
2251
2252 2015-07-16  Brady Eidson  <beidson@apple.com>
2253
2254         Rolling out part of r186895 until rdar://problem/21861167 is resolved.
2255         https://bugs.webkit.org/show_bug.cgi?id=146976
2256
2257         * platform/network/cf/CookieJarCFNet.cpp:
2258         (WebCore::createCookies): Don’t use this new SPI quite yet.
2259
2260 2015-07-16  Filip Pizlo  <fpizlo@apple.com>
2261
2262         Unreviewed, roll out http://trac.webkit.org/changeset/186903. It broke the build.
2263
2264         * CMakeLists.txt:
2265         * WebCore.xcodeproj/project.pbxproj:
2266         * bindings/js/DOMWrapperWorld.h:
2267         (WebCore::currentWorld):
2268         (WebCore::worldForDOMObject): Deleted.
2269         * bindings/js/JSBindingsAllInOne.cpp:
2270         * bindings/js/JSCustomEventCustom.cpp:
2271         (WebCore::JSCustomEvent::detail): Deleted.
2272         * bindings/js/JSMessageEventCustom.cpp:
2273         (WebCore::JSMessageEvent::data):
2274         * bindings/js/JSPopStateEventCustom.cpp:
2275         (WebCore::JSPopStateEvent::state):
2276         * dom/CustomEvent.cpp:
2277         (WebCore::CustomEvent::initCustomEvent):
2278         (WebCore::CustomEvent::eventInterface):
2279         (WebCore::CustomEvent::trySerializeDetail): Deleted.
2280         * dom/CustomEvent.h:
2281         * dom/CustomEvent.idl:
2282         * dom/MessageEvent.cpp:
2283         (WebCore::MessageEvent::initMessageEvent):
2284         (WebCore::MessageEvent::data):
2285         (WebCore::MessageEvent::trySerializeData): Deleted.
2286         * dom/MessageEvent.h:
2287         * dom/PopStateEvent.cpp:
2288         (WebCore::PopStateEvent::create):
2289         (WebCore::PopStateEvent::eventInterface):
2290         (WebCore::PopStateEvent::trySerializeState): Deleted.
2291         * dom/PopStateEvent.h:
2292         * testing/Internals.cpp:
2293         (WebCore::Internals::deserializeBuffer):
2294         (WebCore::Internals::setUsesOverlayScrollbars):
2295         (WebCore::Internals::isFromCurrentWorld): Deleted.
2296         * testing/Internals.h:
2297         * testing/Internals.idl:
2298
2299 2015-07-16  Keith Miller  <keith_miller@apple.com>
2300
2301         Remove leak of objects between isolated worlds on custom events, message events, and pop state events.
2302         https://bugs.webkit.org/show_bug.cgi?id=118884
2303
2304         Reviewed by Filip Pizlo.
2305
2306         Tests: fast/events/event-leak-objects.html
2307                fast/events/event-properties-gc.html
2308
2309         Fixes an issue where objects passed as certain properties of events could cross isolated worlds. This
2310         was fixed by checking that any object passed by an event must be serializable or originate from the same
2311         isolated world as the one it is currently being accessed in. In the case of MessageEvents and PopStateEvents we
2312         cache the values of the data and state properties, respectively, as they may be a deserialized object. In case
2313         an object was deserialized in a world with elevated privileges we also check the cached value is from the same
2314         world, if it is from a different world we recompute it. For testing purposes, I added a new function to Internals
2315         that determines whether a JSObject originated in the current world.
2316
2317         * CMakeLists.txt:
2318         * WebCore.xcodeproj/project.pbxproj:
2319         * bindings/js/DOMWrapperWorld.h:
2320         (WebCore::worldForDOMObject):
2321         * bindings/js/JSBindingsAllInOne.cpp:
2322         * bindings/js/JSCustomEventCustom.cpp: Copied from Source/WebCore/dom/CustomEvent.cpp.
2323         (WebCore::JSCustomEvent::detail):
2324         * bindings/js/JSMessageEventCustom.cpp:
2325         (WebCore::JSMessageEvent::data):
2326         * bindings/js/JSPopStateEventCustom.cpp:
2327         (WebCore::JSPopStateEvent::state):
2328         * dom/CustomEvent.cpp:
2329         (WebCore::CustomEvent::initCustomEvent):
2330         (WebCore::CustomEvent::trySerializeDetail):
2331         * dom/CustomEvent.h:
2332         * dom/CustomEvent.idl:
2333         * dom/MessageEvent.cpp:
2334         (WebCore::MessageEvent::initMessageEvent):
2335         (WebCore::MessageEvent::trySerializeData):
2336         * dom/MessageEvent.h:
2337         * dom/PopStateEvent.cpp:
2338         (WebCore::PopStateEvent::trySerializeState):
2339         * dom/PopStateEvent.h:
2340         * testing/Internals.cpp:
2341         (WebCore::Internals::isFromCurrentWorld):
2342         * testing/Internals.h:
2343         * testing/Internals.idl:
2344
2345 2015-07-16  Brady Eidson  <beidson@apple.com>
2346
2347         WebKit document.cookie mis-parsing.
2348         rdar://problem/21715050 and https://bugs.webkit.org/show_bug.cgi?id=146976
2349
2350         Reviewed by Sam Weinig.
2351
2352         * platform/network/cf/CookieJarCFNet.cpp:
2353         (WebCore::createCookies): Use new SPI if available.
2354         (WebCore::setCookiesFromDOM):
2355         * platform/spi/cf/CFNetworkSPI.h:
2356
2357 2015-07-15  Anders Carlsson  <andersca@apple.com>
2358
2359         Headers that use WEBCORE_EXPORT should include PlatformExportMacros.h
2360         https://bugs.webkit.org/show_bug.cgi?id=146984
2361
2362         Reviewed by Daniel Bates.
2363
2364         * contentextensions/DFA.h:
2365         * dom/ContextDestructionObserver.h:
2366         * dom/DeviceOrientationData.h:
2367         * dom/ExceptionCodePlaceholder.h:
2368         * editing/cocoa/HTMLConverter.h:
2369         * html/track/AudioTrack.h:
2370         * loader/FrameLoaderStateMachine.h:
2371         * loader/appcache/ApplicationCacheHost.h:
2372         * loader/cache/CachedResourceHandle.h:
2373         * platform/URL.h:
2374         * platform/animation/Animation.h:
2375         * platform/audio/AudioHardwareListener.h:
2376         * platform/audio/AudioSession.h:
2377         * platform/graphics/transforms/AffineTransform.h:
2378         * platform/network/Credential.h:
2379         * platform/network/CredentialBase.h:
2380         * platform/network/ResourceHandleClient.h:
2381         * platform/network/mac/AuthenticationMac.h:
2382
2383 2015-07-16  Joseph Pecoraro  <pecoraro@apple.com>
2384
2385         Web Inspector: update $$() to return an Array
2386         https://bugs.webkit.org/show_bug.cgi?id=146964
2387
2388         Reviewed by Brian Burg.
2389
2390         Test: inspector/console/command-line-api.html
2391
2392         * inspector/CommandLineAPIModuleSource.js:
2393         Update $$(...) to return an array.
2394         Also InjectedScriptHost.type was renamed to subtype
2395         a while ago.
2396
2397 2015-07-15  Tim Horton  <timothy_horton@apple.com>
2398
2399         Move indicator rect uniting code to TextIndicatorWindow instead of TextIndicator
2400         https://bugs.webkit.org/show_bug.cgi?id=146992
2401         <rdar://problem/21643094>
2402
2403         Reviewed by Daniel Bates.
2404
2405         Having to unite all the rects if any overlap is an implementation
2406         detail of the Mac TextIndicatorWindow presentation, not a fundamental
2407         property of TextIndicator.
2408
2409         Other TextIndicator presentations might be able to handle overlapping
2410         rects more effectively, so we shouldn't lose information unless we need to.
2411
2412         This also avoids having a second copy of some constants!
2413
2414         * page/TextIndicator.cpp:
2415         (WebCore::outsetIndicatorRectIncludingShadow): Deleted.
2416         (WebCore::textIndicatorsForTextRectsOverlap): Deleted.
2417         (WebCore::TextIndicator::TextIndicator): Deleted.
2418         * page/mac/TextIndicatorWindow.mm:
2419         (outsetIndicatorRectIncludingShadow):
2420         (textIndicatorsForTextRectsOverlap):
2421         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
2422
2423 2015-07-15  Ryuan Choi  <ryuan.choi@navercorp.com>
2424
2425         [CoordinatedGraphics] Remove setContentsScale from TiledBackingStore
2426         https://bugs.webkit.org/show_bug.cgi?id=146921
2427
2428         Reviewed by Gyuyoung Kim.
2429
2430         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2431         (WebCore::CoordinatedGraphicsLayer::createBackingStore):
2432         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2433         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
2434         (WebCore::TiledBackingStore::TiledBackingStore):
2435         (WebCore::TiledBackingStore::setContentsScale): Deleted.
2436         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
2437
2438 2015-07-15  Sam Weinig  <sam@webkit.org>
2439
2440         Color match plug-ins
2441         <rdar://problem/21758722>
2442         https://bugs.webkit.org/show_bug.cgi?id=146987
2443
2444         Reviewed by Dean Jackson.
2445
2446         * platform/spi/cocoa/QuartzCoreSPI.h:
2447         Add colorMatchUntaggedContent property.
2448
2449 2015-07-15  Brent Fulgham  <bfulgham@apple.com>
2450
2451         [Win] Another build fix after r186858.
2452
2453         * html/canvas/DOMPath.h: Don't use WEBCORE_EXPORT on the
2454         overall class and the destructor declaration.
2455
2456 2015-07-15  Dean Jackson  <dino@apple.com>
2457
2458         Tag WebGL layers with sRGB colorspace
2459         https://bugs.webkit.org/show_bug.cgi?id=146986
2460         <rdar://problem/21758704>
2461
2462         Fix the build on older El Capitan releases.
2463
2464         * platform/graphics/mac/WebGLLayer.mm:
2465         (-[WebGLLayer initWithGraphicsContext3D:]):
2466         * platform/spi/cocoa/QuartzCoreSPI.h:
2467
2468 2015-07-15  Dean Jackson  <dino@apple.com>
2469
2470         Tag WebGL layers with sRGB colorspace
2471         https://bugs.webkit.org/show_bug.cgi?id=146986
2472         <rdar://problem/21758704>
2473
2474         Reviewed by Simon Fraser.
2475
2476         Label a CAOpenGLLayer as using the sRGB colorspace,
2477         like the rest of our page content.
2478
2479         Test: fast/canvas/webgl/match-page-color-space.html
2480
2481         * platform/graphics/mac/WebGLLayer.mm:
2482         (-[WebGLLayer initWithGraphicsContext3D:]): Set the colorspace property on the layer.
2483         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]):
2484         (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]):
2485         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
2486
2487 2015-07-15  Brent Fulgham  <bfulgham@apple.com>
2488
2489         [Win] Unreviewed build fix after r186858.
2490
2491         Add missing DOMPath and PathUtilities files to project.
2492
2493         * WebCore.vcxproj/WebCore.vcxproj:
2494         * WebCore.vcxproj/WebCore.vcxproj.filters:
2495
2496 2015-07-15  Anders Carlsson  <andersca@apple.com>
2497
2498         Headers that look for NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES should import NSGeometry.h
2499         https://bugs.webkit.org/show_bug.cgi?id=146982
2500
2501         Reviewed by Tim Horton.
2502
2503         * platform/graphics/FloatPoint.h:
2504         * platform/graphics/IntPoint.h:
2505         * platform/graphics/IntSize.h:
2506
2507 2015-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2508
2509         Scroll snapping to elements is broken for main frame scrolling
2510         https://bugs.webkit.org/show_bug.cgi?id=146957
2511
2512         Reviewed by Brent Fulgham.
2513
2514         Fixes the case of elements with scroll snap coordinates in a scroll snapping mainframe by changing
2515         RenderBox::findEnclosingScrollableContainer to return the body's RenderBox when all enclosing elements
2516         are not overflow scrollable but the mainframe can scroll.
2517
2518         Test: css3/scroll-snap/scroll-snap-coordinate-mainframe.html
2519
2520         * page/FrameView.h: Export isScrollable so that the Internals API can use it.
2521         * rendering/RenderBox.cpp: Include MainFrame.h.
2522         (WebCore::RenderBox::findEnclosingScrollableContainer): Changed to return the body's RenderBox if
2523             none of its parent elements are overflow scrolling.
2524         * testing/Internals.cpp:
2525         (WebCore::Internals::scrollSnapOffsets): Updated to return snap offsets for the body element,
2526             allowing us to call window.internals.scrollSnapOffsets(document.body).
2527
2528 2015-07-15  Brady Eidson  <beidson@apple.com>
2529
2530         WebKit document.cookie mis-parsing.
2531         rdar://problem/21715050 and https://bugs.webkit.org/show_bug.cgi?id=146976
2532
2533         Reviewed by Sam Weinig.
2534
2535         * platform/network/mac/CookieJarMac.mm:
2536         (WebCore::setCookiesFromDOM): Use new CFNetwork SPI when available.
2537
2538 2015-07-15  Jinyoung Hur  <hur.ims@navercorp.com>
2539
2540         [WinCairo] font fallback not working
2541         https://bugs.webkit.org/show_bug.cgi?id=146595
2542
2543         Reviewed by Myles C. Maxfield.
2544
2545         A Win32 API, GetGlyphIndices(), is not used properly, so any glyphs are considered existing in a font and it prevents the font fall back mechanism from working.
2546
2547         I think a specific font should be newly installed on the test machine to test this case but I have no idea how can it be done.
2548
2549         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
2550         (WebCore::GlyphPage::fill):
2551
2552 2015-07-15  Tim Horton  <timothy_horton@apple.com>
2553
2554         Factor rect shrink-wrapping code out of RenderThemeMac for future reuse
2555         https://bugs.webkit.org/show_bug.cgi?id=146973
2556         <rdar://problem/21643094>
2557
2558         Reviewed by Anders Carlsson.
2559
2560         Test: fast/shrink-wrap/rect-shrink-wrap.html
2561
2562         * WebCore.xcodeproj/project.pbxproj:
2563         Add DOMPath.cpp and PathUtilities.{h, cpp}.
2564
2565         * bindings/js/JSDOMBinding.h:
2566         (WebCore::NativeValueTraits<double>::nativeValue):
2567         Make it possible to use sequence<double> in IDL files.
2568
2569         * bindings/scripts/CodeGeneratorJS.pm:
2570         Export JSDOMPath for use in Internals.
2571
2572         * html/canvas/DOMPath.cpp: Added.
2573         (WebCore::DOMPath::~DOMPath):
2574         * html/canvas/DOMPath.h:
2575         Out-of-line the DOMPath destructor so as not to anger the bindings
2576         integrity checker (otherwise, the address of the DOMPath destructor
2577         is different in WebCoreTestSupport and WebCore, causing us to fail
2578         the vtable equality test).
2579
2580         * platform/graphics/Path.h:
2581         Forward declare FloatRect instead of including it unnecessarily.
2582         Export ensurePlatformPath().
2583
2584         * platform/graphics/PathUtilities.cpp: Added.
2585         (WebCore::addShrinkWrapRightCorner):
2586         (WebCore::addShrinkWrapLeftCorner):
2587         (WebCore::addShrinkWrappedPathForRects):
2588         These parts are extracted from RenderThemeMac, with two changes:
2589             + support for arbitrarily-aligned rects
2590               (the other version assumed they were horizontally center-aligned)
2591             + support for overlapping rects
2592               (the other version assumed they touched but did not overlap)
2593
2594         There are still things missing:
2595             + support for a fallback when the shape is too hard to shrink-wrap
2596
2597         And things broken:
2598             + if the distance between two edges is smaller than the corner radius,
2599               we'll end up with a sharp edge in the path
2600
2601         Both of these cases are covered in the layout test and can be improved.
2602
2603         (WebCore::rectsIntersectOrTouch):
2604         Rect intersection with <= instead of <.
2605
2606         (WebCore::contiguousRectGroupsFromRects):
2607         Given a set of rects, find all of the contiguous regions. We'll
2608         shrink-wrap each region independently.
2609
2610         (WebCore::PathUtilities::pathWithShrinkWrappedRects):
2611         * platform/graphics/PathUtilities.h: Added.
2612         Add PathUtilities, where the shrink-wrapping code lives.
2613
2614         * rendering/RenderThemeMac.mm:
2615         (WebCore::paintAttachmentTitleBackground):
2616         (WebCore::addAttachmentTitleBackgroundRightCorner): Deleted.
2617         (WebCore::addAttachmentTitleBackgroundLeftCorner): Deleted.
2618         Remove shrink-wrapping implementation and make use of the one in PathUtilities.
2619
2620         * testing/Internals.cpp:
2621         (WebCore::Internals::pathWithShrinkWrappedRects):
2622         * testing/Internals.h:
2623         * testing/Internals.idl:
2624         Expose pathWithShrinkWrappedRects to tests via Internals.
2625         It takes a sequence<double> where every four values are the x, y, w, h
2626         of a rect, and returns a DOMPath which can be used with Canvas.
2627
2628 2015-07-15  Enrica Casucci  <enrica@apple.com>
2629
2630         [iOS] Should look for RTF and RTFD pasteboard types before plain text.
2631         https://bugs.webkit.org/show_bug.cgi?id=146971
2632         rdar://problem/21840845
2633
2634         Reviewed by Sam Weinig.
2635
2636         The list of pasteboard types returned by supportedPasteboardTypes
2637         determines the order in which WebKit looks for data in the pasteboard
2638         to create a fragment. The incorrect order could make plain text to
2639         be preferred over rich format.
2640
2641         * platform/ios/PasteboardIOS.mm:
2642         (WebCore::Pasteboard::supportedPasteboardTypes):
2643
2644 2015-07-15  Anders Carlsson  <andersca@apple.com>
2645
2646         Private headers that include project headers should also be project headers
2647         https://bugs.webkit.org/show_bug.cgi?id=146974
2648
2649         Reviewed by Dan Bernstein.
2650
2651         Since these headers can't be included by WebKit anyway they shouldn't be installed.
2652
2653         * WebCore.xcodeproj/project.pbxproj:
2654
2655 2015-07-15  Eric Carlson  <eric.carlson@apple.com>
2656
2657         [Mac] AirPlay route is not always set automatically
2658         https://bugs.webkit.org/show_bug.cgi?id=146969
2659
2660         Reviewed by Jer Noble.
2661
2662         * Modules/mediasession/WebMediaSessionManager.cpp:
2663         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Return early if there are
2664           no clients. Make the first client in the vector automatically play to the target if there
2665           is no other match and there is an active route.
2666         (WebCore::WebMediaSessionManager::watchdogTimerFired): Call picker.invalidatePlaybackTargets,
2667           not stopMonitoringPlaybackTargets.
2668
2669         * platform/graphics/MediaPlaybackTargetPicker.cpp:
2670         (WebCore::MediaPlaybackTargetPicker::invalidatePlaybackTargets): New.
2671         * platform/graphics/MediaPlaybackTargetPicker.h:
2672
2673         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2674         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2675         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): Do nothing, AirPlay
2676           automatically stops monitoring when appropriate and release the picker also releases
2677           the output context, which drops the route.
2678         (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): New.
2679
2680 2015-07-15  Anders Carlsson  <andersca@apple.com>
2681
2682         Remove forwarding headers that no longer point to valid headers
2683         https://bugs.webkit.org/show_bug.cgi?id=146972
2684
2685         Reviewed by Tim Horton.
2686
2687         * ForwardingHeaders/heap/AllocationSpace.h: Removed.
2688         * ForwardingHeaders/runtime/IntegralTypedArrayBase.h: Removed.
2689         * ForwardingHeaders/runtime/PrototypeFunction.h: Removed.
2690         * ForwardingHeaders/runtime/StorageBarrier.h: Removed.
2691         * ForwardingHeaders/runtime/TypedArrayBase.h: Removed.
2692
2693 2015-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2694
2695         Negative scroll snap repeat values cause web process to hang indefinitely
2696         https://bugs.webkit.org/show_bug.cgi?id=146953
2697         <rdar://problem/21823681>
2698
2699         Reviewed by Simon Fraser.
2700
2701         Fixed dangerous behavior caused by setting -scroll-snap-points-x or -y to negative or very small
2702         positive values. In the case of negative or 0 repeats, the web process would hang indefinitely. In
2703         the case of very small positive values, a massive amount of memory could potentially be allocated
2704         just to store snap offsets.
2705
2706         Tests: css3/scroll-snap/scroll-snap-negative-repeat.html
2707                css3/scroll-snap/scroll-snap-subpixel-repeat.html
2708
2709         * css/CSSParser.cpp:
2710         (WebCore::CSSParser::parseNonElementSnapPoints): Changed to consider negative snap repeat values as invalid CSS.
2711         * page/scrolling/AxisScrollSnapOffsets.cpp:
2712         (WebCore::updateFromStyle): Changed to threshold non-negative snap repeat values to 1px.
2713
2714 2015-07-14  Dean Jackson  <dino@apple.com>
2715
2716         Placeholder colors should be system grays
2717         https://bugs.webkit.org/show_bug.cgi?id=146955
2718         <rdar://problem/21774358>
2719
2720         Reviewed by Sam Weinig.
2721
2722         Update the PiP and Airplay placards to use the correct shades
2723         of gray.
2724
2725         * Modules/mediacontrols/mediaControlsApple.css: No need to specify the
2726         font here, nor have rules for Picture in Picture, which isn't available
2727         on OS X.
2728         (audio::-webkit-media-controls-time-remaining-display): We should specify
2729         font style here.
2730         (video:-webkit-full-screen::-webkit-media-controls-panel): Drive-by cleanup.
2731         (audio::-webkit-media-controls-wireless-playback-status): Use a gray background
2732         and system gray for text and artwork.
2733         (audio::-webkit-media-controls-wireless-playback-status.small): Ditto.
2734         (audio::-webkit-media-controls-picture-in-picture-button): Deleted (not on OS X).
2735         (audio::-webkit-media-controls-wireless-playback-text-top): Deleted use of background color.
2736         (audio::-webkit-media-controls-wireless-playback-text-bottom): Ditto..
2737
2738         * Modules/mediacontrols/mediaControlsiOS.css: Use a gray background
2739         and system gray for text and artwork.
2740         (audio::-webkit-media-controls-wireless-playback-status):
2741         (audio::-webkit-media-controls-wireless-playback-text-top):
2742         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
2743
2744 2015-07-14  Hunseop Jeong  <hs85.jeong@samsung.com>
2745
2746         [EFL] Scrollbar is not drawn on MiniBrowser.
2747         https://bugs.webkit.org/show_bug.cgi?id=143566
2748
2749         Reviewed by Gyuyoung Kim.
2750
2751         Implement the ScrollbarThemeEfl to draw the scrollbar on EFL port.
2752
2753         * PlatformEfl.cmake: Removed the ScrollbarEfl.cpp.
2754
2755         * platform/Scrollbar.cpp: Removed the !PLATFORM(EFL) guard to use the createNativeScrollbar().
2756
2757         * platform/efl/DefaultTheme/CMakeLists.txt: Replaced the image files with new ones.
2758
2759         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc:
2760         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Added.
2761         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Added.
2762         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png: Removed.
2763         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png: Removed.
2764         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png: Removed.
2765         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Added.
2766         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Added.
2767         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png: Removed.
2768         * platform/efl/RenderThemeEfl.cpp:
2769         (WebCore::toEdjeGroup):
2770         (WebCore::RenderThemeEfl::paintThemePart): Added the new function to draw the scrollbar
2771           using the RenderThemeEfl.
2772
2773         * platform/efl/RenderThemeEfl.h:
2774         * platform/efl/ScrollbarEfl.cpp: Removed.
2775         * platform/efl/ScrollbarEfl.h: Removed.
2776         * platform/efl/ScrollbarThemeEfl.cpp: Implemented the default functions to draw the
2777           scrollbar.
2778         (WebCore::scrollbarMap):
2779         (WebCore::ScrollbarThemeEfl::~ScrollbarThemeEfl):
2780         (WebCore::ScrollbarThemeEfl::scrollbarThickness):
2781         (WebCore::ScrollbarThemeEfl::hasThumb):
2782         (WebCore::ScrollbarThemeEfl::backButtonRect):
2783         (WebCore::ScrollbarThemeEfl::forwardButtonRect):
2784         (WebCore::ScrollbarThemeEfl::trackRect):
2785         (WebCore::ScrollbarThemeEfl::minimumThumbLength):
2786         (WebCore::ScrollbarThemeEfl::paintTrackBackground):
2787         (WebCore::ScrollbarThemeEfl::paintThumb):
2788         (WebCore::ScrollbarThemeEfl::registerScrollbar):
2789         (WebCore::ScrollbarThemeEfl::unregisterScrollbar):
2790         (WebCore::ScrollbarThemeEfl::loadThemeIfNeeded):
2791         * platform/efl/ScrollbarThemeEfl.h:
2792         (WebCore::ScrollbarThemeEfl::usesOverlayScrollbars):
2793
2794 2015-07-14  Andreas Kling  <akling@apple.com>
2795
2796         Don't persist history item tree for subframes across reloads.
2797         <https://webkit.org/b/146937>
2798         <rdar://problem/19925709>
2799
2800         Reviewed by Brady Eidson.
2801
2802         Throw away the subframe history items when reloading a page. This ensures that we
2803         don't accumulate outdated frame metadata when subframes change name across page loads.
2804         Since the history item tree is encoded in the UA session state and gets serialized to
2805         disk, it's important that we don't let it grow unbounded.
2806
2807         * loader/HistoryController.cpp:
2808         (WebCore::HistoryController::updateForReload):
2809
2810 2015-07-14  Antti Koivisto  <antti@apple.com>
2811
2812         REGRESSION (r177876): store.apple.com profile and cart icons are missing
2813         https://bugs.webkit.org/show_bug.cgi?id=146894
2814
2815         Reviewed by Myles C. Maxfield.
2816
2817         If we had several @font-face rules for the same face covering overlapping ranges we
2818         would only try to get glyphs from the first one. If it didn't have the glyph we wouldn't
2819         try the other ones.
2820
2821         Test: fast/css/font-face-multiple-missing-glyphs.html
2822
2823         * platform/graphics/FontCascadeFonts.cpp:
2824         (WebCore::FontCascadeFonts::glyphDataForVariant):
2825         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
2826
2827             Get GlyphData with one call.
2828
2829         * platform/graphics/FontRanges.cpp:
2830         (WebCore::FontRanges::~FontRanges):
2831         (WebCore::FontRanges::glyphDataForCharacter):
2832
2833             Check that we actually have a glyph in the font for the character before returning it.
2834
2835         (WebCore::FontRanges::fontForCharacter):
2836         (WebCore::FontRanges::fontForFirstRange):
2837         * platform/graphics/FontRanges.h:
2838         (WebCore::FontRanges::size):
2839         (WebCore::FontRanges::rangeAt):
2840
2841 2015-07-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2842
2843         Fix the 32 bit build after r186817
2844         https://bugs.webkit.org/show_bug.cgi?id=146947
2845
2846         Changed CGRect to NSRect.
2847
2848         Reviewed by Simon Fraser.
2849
2850         * platform/mac/ThemeMac.mm:
2851         (WebCore::paintButton):
2852
2853 2015-07-14  Anders Carlsson  <andersca@apple.com>
2854
2855         Remove wkPopupMenu from WebCoreSystemInterface; it's not called from WebCore
2856         https://bugs.webkit.org/show_bug.cgi?id=146945
2857
2858         Reviewed by Tim Horton.
2859
2860         * platform/mac/WebCoreSystemInterface.h:
2861
2862 2015-07-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2863
2864         Input buttons rendered at the wrong size when pinching-to-zoom
2865         https://bugs.webkit.org/show_bug.cgi?id=146916
2866
2867         Reviewed by Dean Jackson.
2868
2869         Scales buttons and their focus rects up when pinching to zoom by painting to an offscreen ImageBuffer which is
2870         then scaled and painted onto the display.
2871
2872         * platform/Theme.h: Modified signature of Theme::paint.
2873         (WebCore::Theme::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
2874         * platform/mac/ThemeMac.h: Modified signature of paintButton.
2875         * platform/mac/ThemeMac.mm: Added ImageBuffer.h header.
2876         (WebCore::buttonFocusRectOutlineWidth): Represents the width of the focus rect of a button. Used by paintButton
2877             to determine the size of the ImageBuffer required to draw a focus rect.
2878         (WebCore::paintButton): Changed to paint button cells and the focus rect, if applicable, to a temporary ImageBuffer
2879             before painting the ImageBuffer onto the view. Refactored to receive a deviceScaleFactor and page scale factor,
2880             used when painting to the ImageBuffer.
2881         (WebCore::ThemeMac::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
2882         * rendering/RenderTheme.cpp: Modified signature of RenderTheme::paint.
2883         (WebCore::RenderTheme::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
2884
2885 2015-07-14  Commit Queue  <commit-queue@webkit.org>
2886
2887         Unreviewed, rolling out r186809.
2888         https://bugs.webkit.org/show_bug.cgi?id=146943
2889
2890         Caused about 190 layout test failures. (Requested by mlam_ on
2891         #webkit).
2892
2893         Reverted changeset:
2894
2895         "REGRESSION (r177876): store.apple.com profile and cart icons
2896         are missing"
2897         https://bugs.webkit.org/show_bug.cgi?id=146894
2898         http://trac.webkit.org/changeset/186809
2899
2900 2015-07-14  Antti Koivisto  <antti@apple.com>
2901
2902         REGRESSION (r177876): store.apple.com profile and cart icons are missing
2903         https://bugs.webkit.org/show_bug.cgi?id=146894
2904
2905         Reviewed by Myles C. Maxfield.
2906
2907         If we had several @font-face rules for the same face covering overlapping ranges we
2908         would only try to get glyphs from the first one. If it didn't have the glyph we wouldn't
2909         try the other ones.
2910
2911         Test: fast/css/font-face-multiple-missing-glyphs.html
2912
2913         * platform/graphics/FontCascadeFonts.cpp:
2914         (WebCore::FontCascadeFonts::glyphDataForVariant):
2915         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
2916
2917             Get GlyphData with one call.
2918
2919         * platform/graphics/FontRanges.cpp:
2920         (WebCore::FontRanges::~FontRanges):
2921         (WebCore::FontRanges::glyphDataForCharacter):
2922
2923             Check that we actually have a glyph in the font for the character before returning it.
2924
2925         (WebCore::FontRanges::fontForCharacter):
2926         (WebCore::FontRanges::fontForFirstRange):
2927         * platform/graphics/FontRanges.h:
2928         (WebCore::FontRanges::size):
2929         (WebCore::FontRanges::rangeAt):
2930
2931 2015-07-14  Alex Christensen  <achristensen@webkit.org>
2932
2933         [Content Extensions] Fix if-domain and unless-domain when loading main documents.
2934         https://bugs.webkit.org/show_bug.cgi?id=146868
2935
2936         Reviewed by Benjamin Poulain.
2937
2938         Tests: http/tests/contentextensions/block-everything-if-domain.html
2939                http/tests/contentextensions/block-everything-unless-domain-iframe.html
2940                http/tests/contentextensions/block-everything-unless-domain-redirect.php
2941                http/tests/contentextensions/block-everything-unless-domain.html
2942
2943         * contentextensions/ContentExtensionsBackend.cpp:
2944         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
2945         If we are loading a new main document, use that main document url as the main document url for domain comparison.
2946
2947 2015-07-05  Sam Weinig  <sam@webkit.org>
2948
2949         DOM4: prepend, append, before, after & replace
2950         https://bugs.webkit.org/show_bug.cgi?id=74648
2951
2952         Reviewed by Darin Adler.
2953
2954         - Adds support for ChildNode.before/after/replaceWith and ParentNode.prepend/append
2955           which are new functions in https://dom.spec.whatwg.org
2956         - Uses custom bindings rather than implementing support for union types in the code
2957           generator as their uses seems isolated to just this spec at the moment. If more
2958           uses come along, we should implement proper support for them in the generator and
2959           remove the custom bindings added here.
2960
2961         Tests: fast/dom/ChildNode-after.html
2962                fast/dom/ChildNode-before.html
2963                fast/dom/ChildNode-replaceWith.html
2964                fast/dom/ParentNode-append.html
2965                fast/dom/ParentNode-prepend.html
2966
2967         * CMakeLists.txt:
2968         * WebCore.vcxproj/WebCore.vcxproj:
2969         * WebCore.xcodeproj/project.pbxproj:
2970         * bindings/js/JSBindingsAllInOne.cpp:
2971         Add new files.
2972
2973         * bindings/js/JSCharacterDataCustom.cpp: Added.
2974         (WebCore::JSCharacterData::before):
2975         (WebCore::JSCharacterData::after):
2976         (WebCore::JSCharacterData::replaceWith):
2977         * bindings/js/JSDocumentCustom.cpp:
2978         (WebCore::JSDocument::prepend):
2979         (WebCore::JSDocument::append):
2980         (WebCore::JSDocument::createTouchList):
2981         * bindings/js/JSDocumentFragmentCustom.cpp: Added.
2982         (WebCore::JSDocumentFragment::prepend):
2983         (WebCore::JSDocumentFragment::append):
2984         * bindings/js/JSDocumentTypeCustom.cpp: Added.
2985         (WebCore::JSDocumentType::before):
2986         (WebCore::JSDocumentType::after):
2987         (WebCore::JSDocumentType::replaceWith):
2988         * bindings/js/JSElementCustom.cpp:
2989         (WebCore::toJSNewlyCreated):
2990         (WebCore::JSElement::before):
2991         (WebCore::JSElement::after):
2992         (WebCore::JSElement::replaceWith):
2993         (WebCore::JSElement::prepend):
2994         (WebCore::JSElement::append):
2995         Add custom bindings to implement the use of variadic union types.
2996
2997         * bindings/js/JSNodeOrString.cpp: Added.
2998         (WebCore::toNodeOrStringVector):
2999         * bindings/js/JSNodeOrString.h: Added.
3000         Adds a help function for converting an JS argument list into a Vector
3001         of NodeOrString objects.
3002
3003         * dom/ChildNode.idl:
3004         Expose before/after/replaceWith to JavaScript.
3005
3006         * dom/ContainerNode.cpp:
3007         (WebCore::ContainerNode::append):
3008         (WebCore::ContainerNode::prepend):
3009         * dom/ContainerNode.h:
3010         Add implementations of append and prepend.
3011
3012         * dom/Node.h:
3013         * dom/Node.cpp:
3014         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
3015         (WebCore::firstPrecedingSiblingNotInNodeSet):
3016         (WebCore::firstFollowingSiblingNotInNodeSet):
3017         Helper functions for before, after and removeWith.
3018
3019         (WebCore::Node::before):
3020         (WebCore::Node::after):
3021         (WebCore::Node::replaceWith):
3022         Add implementations of before, after and removeWith.
3023
3024         * dom/NodeOrString.cpp: Added.
3025         (WebCore::convertNodesOrStringsIntoNode):
3026         * dom/NodeOrString.h: Added.
3027         (WebCore::NodeOrString::NodeOrString):
3028         (WebCore::NodeOrString::~NodeOrString):
3029         (WebCore::NodeOrString::type):
3030         (WebCore::NodeOrString::node):
3031         (WebCore::NodeOrString::string):
3032         Custom union type representing the (Node or DOMString) IDL type.
3033
3034         * dom/ParentNode.idl:
3035         Expose append/prepend to JavaScript.
3036
3037 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
3038
3039         [Win] Unreviewed build fix.
3040
3041         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
3042         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): Don't try to build
3043         the new Legible Output API features if they aren't available in the build
3044         environment.
3045
3046 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
3047
3048         [Win] Update Media Player logic for new Legible Output API
3049         https://bugs.webkit.org/show_bug.cgi?id=146922
3050         <rdar://problem/20542574>
3051
3052         Reviewed by Eric Carlson.
3053
3054         * AVFoundationSupport.py: Check for updated AVFCF feature.
3055         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3056         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Update to call the
3057         new 'readNativeSampleBuffer' method.
3058         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): Added. This is a no-op
3059         on Windows if it has the new AVCF API. Otherwise, it contains the same implementation
3060         that has always been used in 'processNativeSamples'.
3061         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
3062         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
3063         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): Added. Use the new
3064         Legible Output API instead of the old CoreMedia solution if it is available.
3065         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h:
3066         (WebCore::InbandTextTrackPrivateAVCF::mediaSelectionOption):
3067         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
3068         (WebCore::InbandTextTrackPrivateLegacyAVCF::readNativeSampleBuffer): Add a stub implementation.
3069         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h:
3070         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3071         (WebCore::AVFWrapper::createPlayerItem): Use the new Legible Output API if it is available.
3072
3073 2015-07-13  Matt Rajca  <mrajca@apple.com>
3074
3075         Media Session: add plumbing for delivering start/end-of-interruption events
3076         https://bugs.webkit.org/show_bug.cgi?id=146837
3077
3078         Reviewed by Tim Horton.
3079
3080         * Modules/mediasession/MediaSessionEvents.h: Renamed from MediaEventTypes.h and added new constants for
3081           interruption events.
3082         * WebCore.xcodeproj/project.pbxproj: Renamed MediaEventTypes.h.
3083         * page/Page.h: Added stub.
3084         * page/Page.cpp: Added stub.
3085
3086 2015-07-13  Simon Fraser  <simon.fraser@apple.com>
3087
3088         [iOS WK2] When choosing an initial viewport scale, take overflow on the <body> into account
3089         https://bugs.webkit.org/show_bug.cgi?id=146918
3090         rdar://problem/9222837
3091
3092         Reviewed by Tim Horton.
3093
3094         Use as input to the viewport scaling algorithm a contents size from the FrameView
3095         that takes overflow on the viewport renderer into account. This prevents unexpected
3096         viewports scaling on pages that have content that overflows their expressed contents size,
3097         but apply overflow to the <body>.
3098
3099         * page/FrameView.cpp:
3100         (WebCore::FrameView::contentsSizeRespectingOverflow): Look for overflow:hidden on each axis of
3101         the m_viewportRenderer, which is computed post-layout by calculateScrollbarModesForLayout()
3102         and is used for scrollbar logic on OS X. Clip unscaledDocumentRect on each axis, and then
3103         apply page scale.
3104         * page/FrameView.h:
3105
3106 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
3107
3108         Update WebCore Features.json
3109         https://bugs.webkit.org/show_bug.cgi?id=146914
3110
3111         Reviewed by Benjamin Poulain.
3112
3113         * features.json: Update with notes for CSS Scroll Snap Points, Filter Effects,
3114         backdrop-filters, and initial-letter.
3115
3116 2015-07-13  Matthew Daiter  <mdaiter@apple.com>
3117
3118         Change MediaPlayer Media Stream method signatures to use references
3119         https://bugs.webkit.org/show_bug.cgi?id=146839
3120         <rdar://problem/21769035>
3121
3122         Reviewed by Darin Adler.
3123
3124         * platform/graphics/MediaPlayer.cpp:
3125         (WebCore::MediaPlayer::loadWithNextMediaEngine):
3126         * platform/graphics/MediaPlayerPrivate.h: Changed to references
3127         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3128         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3129         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3130         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Ditto
3131         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3132         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto
3133         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3134         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3135         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
3136
3137 2015-07-13  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3138
3139         GTK] Build race with -DENABLE_WAYLAND_TARGET=ON
3140         https://bugs.webkit.org/show_bug.cgi?id=146740
3141
3142         Reviewed by Martin Robinson.
3143
3144         No new tests, no behavior changes.
3145
3146         * PlatformGTK.cmake: platform/graphics/wayland sources should be
3147         included into WebCore source list instead of WebCorePlatformGTK.
3148         Also move the add_custom_command() block into if(ENABLE_WAYLAND_TARGET),
3149         this is not strictly needed to fix this bug, but it seems cleaner.
3150
3151 2015-07-13  Matthew Daiter  <mdaiter@apple.com>
3152
3153         Adding MediaStream Engine building blocks to the code repo
3154         https://bugs.webkit.org/show_bug.cgi?id=146789
3155         <rdar://problem/21747025>
3156
3157         Reviewed by Brent Fulgham.
3158
3159         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Added.
3160         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setLoadingProgresssed):
3161         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setHasAvailableVideoFrame):
3162         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createWeakPtr):
3163         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Added.
3164         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
3165         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
3166         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::registerMediaEngine):
3167         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
3168         (WebCore::mimeTypeCache):
3169         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes):
3170         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType):
3171         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load):
3172         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad):
3173         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay):
3174         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformMedia):
3175         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer):
3176         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
3177         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::playInternal):
3178         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause):
3179         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pauseInternal):
3180         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paused):
3181         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
3182         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsScanning):
3183         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):
3184         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::naturalSize):
3185         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo):
3186         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio):
3187         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVisible):
3188         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::durationMediaTime):
3189         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::seeking):
3190         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setRateDouble):
3191         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setPreservesPitch):
3192         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::networkState):
3193         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::readyState):
3194         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::seekable):
3195         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::maxMediaTimeSeekable):
3196         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::minMediaTimeSeekable):
3197         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::buffered):
3198         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didLoadingProgress):
3199         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setSize):
3200         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAvailableVideoFrame):
3201         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsAcceleratedRendering):
3202         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::movieLoadType):
3203         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareForRendering):
3204         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::engineDescription):
3205         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::languageOfPrimaryAudioTrack):
3206         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldBePlaying):
3207         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::addDisplayLayer):
3208         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::removeDisplayLayer):
3209         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.h: Added.
3210         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.mm: Added.
3211         (WebCore::MediaStreamPrivateAVFObjC::create):
3212         (WebCore::MediaStreamPrivateAVFObjC::MediaStreamPrivateAVFObjC):
3213         (WebCore::MediaStreamPrivateAVFObjC::~MediaStreamPrivateAVFObjC):
3214         (WebCore::MediaStreamPrivateAVFObjC::duration):
3215         (WebCore::MediaStreamPrivateAVFObjC::buffered):
3216         (WebCore::MediaStreamPrivateAVFObjC::readyState):
3217         (WebCore::MediaStreamPrivateAVFObjC::hasAudio):
3218         (WebCore::MediaStreamPrivateAVFObjC::hasVideo):
3219         (WebCore::MediaStreamPrivateAVFObjC::naturalSize):
3220         * platform/mediastream/MediaStreamPrivate.h: 
3221         (WebCore::MediaStreamPrivate::MediaStreamPrivate): Added constructor.
3222
3223 2015-07-13  Eric Carlson  <eric.carlson@apple.com>
3224
3225         [iOS] Cancel AirPlay explicitly when exiting from full screen
3226         https://bugs.webkit.org/show_bug.cgi?id=146902
3227         <rdar://problem/20923632>
3228
3229         Reviewed by Brent Fulgham.
3230
3231         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3232         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3233         (WebVideoFullscreenInterfaceAVKit::~WebVideoFullscreenInterfaceAVKit): Call setExternalPlayback(false)
3234           if playing to an external screen.
3235
3236 2015-07-12  Chris Fleizach  <cfleizach@apple.com>
3237
3238         AX: WEB: VoiceOver for iOS does not read <iframe> elements during linear (swipe) navigation.
3239         https://bugs.webkit.org/show_bug.cgi?id=146861
3240
3241         Reviewed by Darin Adler.
3242
3243         AttachmentViews exist only on WK1 so we need account for both platforms.
3244
3245         Test: platform/ios-simulator/accessibility/iframe-access.html
3246
3247         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3248         (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
3249
3250 2015-07-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3251
3252         [Streams API] Templating ReadableJSStream
3253         https://bugs.webkit.org/show_bug.cgi?id=146802
3254
3255         Reviewed by Darin Adler.
3256
3257         Introducing ReadableStream::clearValues to clear queued values when cancelling and going into error state.
3258
3259         Introducing ReadableEnqueuingStream to handle the stream queue, as a class template.
3260         Specialized ReadableEnqueuingStream for the purpose of ReadableJSStream (storage of JSValue with variable size).
3261
3262         Updated some static functions to accept a ReadableStream in lieu of the more specialized ReadableJSStream.
3263
3264         Covered by existing tests.
3265
3266         * Modules/streams/ReadableStream.cpp:
3267         (WebCore::ReadableStream::changeStateToErrored):
3268         (WebCore::ReadableStream::cancelNoCheck):
3269         * Modules/streams/ReadableStream.h:
3270         (WebCore::ReadableEnqueuingStream::ReadableEnqueuingStream):
3271         (WebCore::ReadableEnqueuingStream::enqueueChunk):
3272         (WebCore::ReadableEnqueuingStream<ChunkType>::read):
3273         * bindings/js/ReadableJSStream.cpp:
3274         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::read):
3275         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::enqueueChunk):
3276         (WebCore::createPullResultFulfilledFunction):
3277         (WebCore::createCancelResultFulfilledFunction):
3278         (WebCore::ReadableJSStream::ReadableJSStream):
3279         (WebCore::ReadableJSStream::enqueue):
3280         * bindings/js/ReadableJSStream.h:
3281         (WebCore::ReadableJSStreamValue::create):
3282         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::desiredSize):
3283         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::ReadableEnqueuingStream):
3284
3285 2015-07-11  Babak Shafiei  <bshafiei@apple.com>
3286
3287         Unreviewed build fix.
3288
3289         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3290         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
3291         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cancelLoad):
3292
3293 2015-07-11  Nikita Vasilyev  <nvasilyev@apple.com>
3294
3295         Web Inspector: Inspector should be able to be docked to the bottom of a narrow window
3296         https://bugs.webkit.org/show_bug.cgi?id=146871
3297
3298         Reviewed by Timothy Hatcher.
3299
3300         * inspector/InspectorFrontendClientLocal.cpp:
3301
3302 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
3303
3304         Update default link action sheets for app links
3305         https://bugs.webkit.org/show_bug.cgi?id=146658
3306         <rdar://problem/21221902>
3307
3308         Reviewed by Dan Bernstein.
3309
3310         * English.lproj/Localizable.strings:
3311         * platform/spi/ios/LaunchServicesSPI.h:
3312
3313 2015-07-11  Benjamin Poulain  <benjamin@webkit.org>
3314
3315         Fix CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
3316         https://bugs.webkit.org/show_bug.cgi?id=146879
3317
3318         Reviewed by Andreas Kling.
3319
3320         Some of my recent changes broke CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING :(
3321
3322         * contentextensions/CombinedURLFilters.cpp:
3323         (WebCore::ContentExtensions::prefixTreeVertexToString):
3324         (WebCore::ContentExtensions::recursivePrint):
3325         (WebCore::ContentExtensions::CombinedURLFilters::print):
3326         * contentextensions/ContentExtensionsDebugging.h:
3327         * contentextensions/DFA.cpp:
3328         (WebCore::ContentExtensions::DFA::debugPrintDot):
3329
3330 2015-07-10  Simon Fraser  <simon.fraser@apple.com>
3331
3332         [iOS WK2] Scrolling issues on horizontally scrollable RTL pages
3333         https://bugs.webkit.org/show_bug.cgi?id=146872
3334         rdar://problem/7569416
3335
3336         Reviewed by Sam Weinig.
3337
3338         Horizontally scrollable RTL pages in WebKit2 had a variety of issues: they had
3339         a gap down the right edge, and unreachable content on the left side, focussing
3340         form fields scrolled to the wrong location, and programmatic scrolls scrolled
3341         to the wrong place.
3342         
3343         Fix by plumbing the WebCore notion of scrollOrigin through to the UI process,
3344         and using it in various places. There are three main aspects to the patch:
3345         
3346         1. scroll origin is included in RemoteLayerTreeTransaction, and plumbed through
3347            to -[WKWebView _scrollToContentOffset:] for correct programmatic scrolling,
3348            including zooming to focussed form elements.
3349         2. WebPageProxy::computeCustomFixedPositionRect() uses the actual documentRect()
3350            rather than just conjuring up a rect with a zero origin, which makes position:fixed
3351            work correctly.
3352         3. _interactionViewsContainerView (which hosts tap highlights) is positioned to 
3353            coincide with the origin of the documentRect (i.e. at the scroll origin, which
3354            may not be top-left). This allows tap highlights to show in the correct location.
3355         4. ScrollView::unobscuredContentRect() is fixed to take scroll origin into account;
3356            if the returned rect is wrong, RenderLayer::hitTest() incorrectly clips the hit
3357            testing area.
3358
3359         * platform/ios/ScrollViewIOS.mm:
3360         (WebCore::ScrollView::unobscuredContentRect):
3361
3362 2015-07-10  Chris Dumez  <cdumez@apple.com>
3363
3364         [WK2] Diagnostic logging messages are causing too much IPC
3365         https://bugs.webkit.org/show_bug.cgi?id=146873
3366         <rdar://problem/21779205>
3367
3368         Reviewed by Ryosuke Niwa.
3369
3370         Move shouldLogAfterSampling() utility function to DiagnosticLoggingClient
3371         so it can be easily reused.
3372
3373         * page/DiagnosticLoggingClient.h:
3374         (WebCore::DiagnosticLoggingClient::shouldLogAfterSampling):
3375
3376 2015-07-10  Daniel Bates  <dabates@apple.com>
3377
3378         Cleanup: Remove default constructor for WebCore::Pair()
3379         https://bugs.webkit.org/show_bug.cgi?id=146856
3380         <rdar://problem/21773212>
3381
3382         Reviewed by Darin Adler.
3383
3384         Remove default constructor for WebCore::Pair() and the setters Pair::set{First, Second}()
3385         since they are not used and it seems weird to keep the latter after the removal of the former.
3386         Should it turn out that we find a use for having a default constructor and/or setters then
3387         we can revert this change.
3388
3389         * css/Pair.h:
3390         (WebCore::Pair::create): Deleted.
3391         (WebCore::Pair::setFirst): Deleted.
3392         (WebCore::Pair::setSecond): Deleted.
3393         (WebCore::Pair::Pair): Deleted.
3394
3395 2015-07-10  Ryuan Choi  <ryuan.choi@navercorp.com>
3396
3397         [CoordinatedGraphics] Override primaryLayerID in CoordinatedGraphicsLayer
3398         https://bugs.webkit.org/show_bug.cgi?id=146826
3399
3400         Reviewed by Gyuyoung Kim.
3401
3402         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3403         (WebCore::CoordinatedGraphicsLayer::id): Moved id as inline function.
3404         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3405         (WebCore::CoordinatedGraphicsLayer::id):
3406
3407 2015-07-10  Matthew Daiter  <mdaiter@apple.com>
3408
3409         Exposing webkitMediaStream as MediaStream
3410         https://bugs.webkit.org/show_bug.cgi?id=146813
3411         <rdar://problem/21754383>
3412
3413         Reviewed by Eric Carlson.
3414
3415         * Modules/mediastream/MediaStream.idl: Changed interface
3416         name from webkitMediaStream to MediaStream
3417
3418 2015-07-10  Nan Wang  <n_wang@apple.com>
3419
3420         Added ARIA 1.1 "cell" and "table" roles.
3421         https://bugs.webkit.org/show_bug.cgi?id=146011
3422         <rdar://problem/21398946>
3423
3424         Reviewed by Chris Fleizach.
3425
3426         Created a new role called GridCellRole to match the gridcell role, 
3427         so the previous CellRole and TableRole will match to cell and table role.
3428         Made the changes to make sure that both GridRole and TableRole have same
3429         behavior, as well as the circumstance for GridCellRole and CellRole.
3430
3431         Test: accessibility/roles-table-and-cell.html
3432
3433         * accessibility/AXObjectCache.cpp:
3434         (WebCore::createFromRenderer):
3435         * accessibility/AccessibilityNodeObject.cpp:
3436         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute):
3437         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute):
3438         * accessibility/AccessibilityObject.cpp:
3439         (WebCore::initializeRoleMap):
3440         * accessibility/AccessibilityObject.h: