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