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