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