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