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