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