01385a7c4d28567932a5008cc4a20257b5f258c7
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-06-05  Eric Carlson  <eric.carlson@apple.com>
2
3         Layout tests fullscreen/video-controls-drag.html and media/video-fullscreeen-only-controls.html
4         fail on WK1 and WK2
5         https://bugs.webkit.org/show_bug.cgi?id=145675
6
7         Reviewed by Dean Jackson.
8
9         No new tests, changes covered by existing tests.
10
11         * Modules/mediacontrols/mediaControlsApple.js:
12         (Controller.prototype.updateControls): Use shouldHaveControls() to test if controls should
13           be visible.
14         (Controller.prototype.handleWrapperMouseMove): Don't return early when in fullscreen.
15         (Controller.prototype.updateFullscreenButtons): Drive-by fix: always show the (exit) fullscreen
16           button when in fullscreen.
17           
18
19 2015-06-04  David Hyatt  <hyatt@apple.com>
20
21         Underlines too close in vertical Chinese text.
22         https://bugs.webkit.org/show_bug.cgi?id=145651
23         <rdar://problem/11105920>
24
25         Reviewed by Simon Fraser.
26
27         Added fast/text/decorations-vertical-underline.html
28
29         * style/InlineTextBoxStyle.cpp:
30         (WebCore::computeUnderlineOffset):
31         Make sure the to map text-underline-position: auto to under when a line has an ideographic baseline.
32
33 2015-06-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
34
35         [GTK] [Wayland] The MiniBrowser crashes inside Weston.
36         https://bugs.webkit.org/show_bug.cgi?id=145645
37
38         Reviewed by Žan Doberšek.
39
40         No new tests, no behavior changes.
41
42         The issue was caused because we were not properly initializing the
43         Wayland display, and we were returning a nullptr in PlatformDisplayWayland::create(),
44         therefore a crash was happening on WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:1136
45         <http://trac.webkit.org/browser/trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp?rev=185245#L1136>
46
47         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
48         (WebCore::PlatformDisplayWayland::create): When connecting to the Wayland
49         server socket we should use the default value (NULL). This allows the value
50         to be overwritten at run-time by the environment variables WAYLAND_DISPLAY or
51         WAYLAND_SOCKET that the Wayland compositor should define. Also add a couple
52         of warnings to get information about what is going wrong when we fail to
53         initialize the display instead of just crashing without giving more information.
54         * platform/graphics/wayland/PlatformDisplayWayland.h:
55         (WebCore::PlatformDisplayWayland::isInitialized): Not longer check for m_webkitgtk
56         to signal that the display is ready because the UIProcess embedded Wayland
57         subcompositer is still not implemented. Added a FIXME note about it.
58
59 2015-06-05  Dean Jackson  <dino@apple.com>
60
61         [Mac] Popup focus is cut off
62         https://bugs.webkit.org/show_bug.cgi?id=145688
63         <rdar://problem/18313375>
64
65         Reviewed by Brent Fulgham.
66
67         Yosemite increased the width of focus rings, causing
68         some ugly clipping on Yosemite. The solution was to
69         not set a clip (which was code introduced for Leopard).
70
71         Test: fast/forms/select-element-focus-ring.html
72
73         * rendering/RenderThemeMac.mm:
74         (WebCore::RenderThemeMac::paintMenuList): Don't clip on Yosemite.
75
76 2015-06-05  Manuel Rego Casasnovas  <rego@igalia.com>
77
78         [CSS Grid Layout] Support dots sequences in grid-template-areas
79         https://bugs.webkit.org/show_bug.cgi?id=145693
80
81         Reviewed by Sergio Villar Senin.
82
83         The CSS WG agreed to consider a sequence of "." characters a single null
84         cell token for grid-template-areas. That way authors can match the
85         number of dots to the width of the column.
86
87         For more information see:
88         https://lists.w3.org/Archives/Public/www-style/2015May/0175.html
89
90         Added new test cases to check the new behavior.
91
92         * css/CSSParser.cpp:
93         (WebCore::containsOnlyDots): New helper function to check that the grid
94         area name is composed by only dots.
95         (WebCore::CSSParser::parseGridTemplateAreasRow): Use the new helper
96         function to look for unnamed areas.
97
98 2015-06-04  Joonghun Park  <jh718.park@samsung.com>
99
100         Purge PassRefPtr create() factory functions in WebCore/css
101         https://bugs.webkit.org/show_bug.cgi?id=144905
102
103         Reviewed by Darin Adler.
104
105         Return Ref instead of PassRefPtr in create() factory functions in css,
106         because the factory can't return null.
107
108         No new tests, no new behaviours.
109
110         * css/BasicShapeFunctions.cpp:
111         (WebCore::valueForCenterCoordinate):
112         (WebCore::basicShapeRadiusToCSSValue):
113         (WebCore::valueForBasicShape):
114         * css/BasicShapeFunctions.h:
115         * css/CSSBasicShapes.h:
116         * css/CSSCalculationValue.cpp:
117         (WebCore::createCSS):
118         (WebCore::CSSCalcValue::create):
119         * css/CSSCalculationValue.h:
120         * css/CSSCharsetRule.h:
121         * css/CSSComputedStyleDeclaration.cpp:
122         (WebCore::valueForNinePieceImageSlice):
123         (WebCore::valueForNinePieceImageQuad):
124         (WebCore::zoomAdjustedPixelValue):
125         (WebCore::zoomAdjustedNumberValue):
126         (WebCore::zoomAdjustedPixelValueForLength):
127         (WebCore::valueForReflection):
128         (WebCore::createPositionListForLayer):
129         (WebCore::positionOffsetValue):
130         (WebCore::percentageOrZoomAdjustedValue):
131         (WebCore::autoOrZoomAdjustedValue):
132         (WebCore::getBorderRadiusCornerValues):
133         (WebCore::getBorderRadiusCornerValue):
134         (WebCore::getBorderRadiusShorthandValue):
135         (WebCore::matrixTransformValue):
136         (WebCore::computedTransform):
137         (WebCore::adjustLengthForZoom):
138         (WebCore::ComputedStyleExtractor::valueForShadow):
139         (WebCore::ComputedStyleExtractor::valueForFilter):
140         (WebCore::specifiedValueForGridTrackBreadth):
141         (WebCore::specifiedValueForGridTrackSize):
142         (WebCore::valueForGridTrackList):
143         (WebCore::scrollSnapDestination):
144         (WebCore::scrollSnapPoints):
145         (WebCore::scrollSnapCoordinates):
146         (WebCore::createAnimationTriggerValue):
147         (WebCore::getAnimationTriggerValue):
148         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
149         (WebCore::fillSizeToCSSValue):
150         (WebCore::lineHeightFromStyle):
151         (WebCore::fontSizeFromStyle):
152         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
153         (WebCore::shapePropertyValue):
154         (WebCore::ComputedStyleExtractor::propertyValue):
155         * css/CSSComputedStyleDeclaration.h:
156         * css/CSSFontFace.h:
157         (WebCore::CSSFontFace::create):
158         * css/CSSFontFaceLoadEvent.h:
159         * css/CSSFontFaceRule.h:
160         * css/CSSGrammar.y.in:
161         * css/CSSGridLineNamesValue.cpp:
162         (WebCore::CSSGridLineNamesValue::cloneForCSSOM):
163         * css/CSSGridLineNamesValue.h:
164         (WebCore::CSSGridLineNamesValue::create):
165         * css/CSSImportRule.h:
166         * css/CSSKeyframeRule.h:
167         (WebCore::StyleKeyframe::create):
168         * css/CSSKeyframesRule.h:
169         * css/CSSMediaRule.h:
170         * css/CSSPageRule.h:
171         * css/CSSParser.cpp:
172         (WebCore::CSSParser::parseGridLineNames):
173         (WebCore::CSSParser::parseDashboardRegions):
174         (WebCore::CSSParser::parseClipShape):
175         (WebCore::CSSParser::parseBasicShape):
176         (WebCore::BorderImageSliceParseContext::commitBorderImageSlice):
177         (WebCore::BorderImageQuadParseContext::commitBorderImageQuad):
178         * css/CSSParser.h:
179         (WebCore::CSSParser::ValueWithCalculation::calculation):
180         * css/CSSPrimitiveValue.cpp:
181         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
182         (WebCore::CSSPrimitiveValue::init):
183         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
184         * css/CSSPrimitiveValue.h:
185         (WebCore::CSSPrimitiveValue::create):
186         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
187         * css/CSSPropertySourceData.h:
188         (WebCore::CSSStyleSourceData::create):
189         (WebCore::CSSRuleSourceData::create):
190         (WebCore::CSSRuleSourceData::createUnknown):
191         * css/CSSRuleList.h:
192         * css/CSSSegmentedFontFace.h:
193         (WebCore::CSSSegmentedFontFace::create):
194         * css/CSSSelector.cpp:
195         (WebCore::CSSSelector::createRareData):
196         * css/CSSSelector.h:
197         (WebCore::CSSSelector::RareData::create):
198         * css/CSSStyleRule.h:
199         * css/CSSSupportsRule.h:
200         * css/CSSValuePool.h:
201         (WebCore::CSSValuePool::createValue):
202         * css/FontLoader.cpp:
203         (WebCore::LoadFontCallback::create):
204         * css/LengthRepeat.h:
205         (WebCore::LengthRepeat::create):
206         (WebCore::LengthRepeat::cloneForCSSOM):
207         * css/MediaList.h:
208         (WebCore::MediaQuerySet::create):
209         (WebCore::MediaQuerySet::createAllowingDescriptionSyntax):
210         (WebCore::MediaList::create):
211         * css/MediaQueryList.cpp:
212         (WebCore::MediaQueryList::create):
213         * css/MediaQueryList.h:
214         * css/MediaQueryMatcher.h:
215         (WebCore::MediaQueryMatcher::create):
216         * css/Pair.h:
217         (WebCore::Pair::create):
218         * css/Rect.h:
219         (WebCore::Rect::create):
220         (WebCore::Rect::cloneForCSSOM):
221         (WebCore::Quad::create):
222         (WebCore::Quad::cloneForCSSOM):
223         * css/SVGCSSComputedStyleDeclaration.cpp:
224         (WebCore::paintOrder):
225         (WebCore::ComputedStyleExtractor::svgPropertyValue):
226         * css/StyleMedia.h:
227         (WebCore::StyleMedia::create):
228         * css/StyleResolver.cpp:
229         (WebCore::StyleResolver::keyframeStylesForAnimation):
230         * css/StyleSheetList.h:
231         (WebCore::StyleSheetList::create):
232         * css/ViewportStyleResolver.h:
233         (WebCore::ViewportStyleResolver::create):
234         * css/WebKitCSSMatrix.h:
235         * css/WebKitCSSRegionRule.h:
236         * css/WebKitCSSViewportRule.h:
237         * page/animation/CSSPropertyAnimation.cpp:
238         (WebCore::blendFilter):
239         * rendering/style/RenderStyle.h:
240         (WebCore::adjustFloatForAbsoluteZoom):
241         * rendering/style/StyleInheritedData.h:
242
243 2015-06-04  Benjamin Poulain  <bpoulain@apple.com>
244
245         The last 2 merged DFAs are not minimized by DFACombiner
246
247         * contentextensions/DFACombiner.cpp:
248         (WebCore::ContentExtensions::DFACombiner::combineDFAs):
249         I introduced a bug when I made minimization conditional: the last merge
250         does not minimize if we do not reach the minimum size.
251
252 2015-06-04  Brent Fulgham  <bfulgham@apple.com>
253
254         Latching algorithm in findEnclosingOverflowScroll is broken
255         https://bugs.webkit.org/show_bug.cgi?id=145642
256         <rdar://problem/21242308>
257
258         Reviewed by Simon Fraser.
259
260         Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
261
262         * page/mac/EventHandlerMac.mm:
263         (WebCore::scrollableAreaForBox): Added helper function.
264         (WebCore::findEnclosingScrollableContainer): Renamed from findEnclosingOverflowScroll.
265         Only identify something as our scroll element if it can be scrolled in either
266         axis of the gesture's motion.
267         (WebCore::scrollableAreaForContainerNode): Use new helper function.
268         (WebCore::EventHandler::platformPrepareForWheelEvents): Use new function
269         name, and pass horizontal and vertical deltas.
270         (WebCore::findEnclosingOverflowScroll): Deleted.
271
272 2015-06-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
273
274         REGRESSION(r185091): Crash happens on indexdb tests
275         https://bugs.webkit.org/show_bug.cgi?id=145549
276
277         Reviewed by Darin Adler.
278
279         * Modules/indexeddb/IDBDatabaseError.h:
280         (WebCore::IDBDatabaseError::create): Revert Ref usage of IDBDatabaseError::create().
281
282 2015-06-04  Simon Fraser  <simon.fraser@apple.com>
283
284         Crash in EventDispatcher::dispatchEvent entering a location on Google Maps
285         https://bugs.webkit.org/show_bug.cgi?id=145677
286         rdar://problem/20698280
287
288         Reviewed by Dean Jackson.
289
290         If a transition is running on a pseudo-element, and the host element is removed
291         from the DOM just as the transition ends, and there is a transition event listener,
292         then we'd crash with a null dereference in event dispatch code.
293         
294         AnimationController tries to clean up running animations when renderers are destroyed,
295         but omitted to remove the element from two vectors that store element references.
296         Elements are only added to these vectors briefly on animation end, before firing
297         events, but failure to remove the vector entries could result in attempting
298         to fire an event on a pseudo-element with no host element.
299         
300         Also convert EventDispatcher code to be more robust to potentially null event
301         targets, since it's not clear that eventTargetRespectingTargetRules() can always
302         manage to return a non-null node.
303         
304         Hard to make a test because this is timing sensitive.
305
306         * dom/EventDispatcher.cpp:
307         (WebCore::eventTargetRespectingTargetRules):
308         (WebCore::EventDispatcher::dispatchScopedEvent):
309         (WebCore::EventDispatcher::dispatchEvent):
310         (WebCore::EventPath::EventPath):
311         * page/animation/AnimationController.cpp:
312         (WebCore::AnimationControllerPrivate::clear):
313
314 2015-06-04  Hunseop Jeong  <hs85.jeong@samsung.com>
315
316         Replace 0 with nullptr in WebCore/Page.
317         https://bugs.webkit.org/show_bug.cgi?id=145631
318
319         Reviewed by Darin Adler.
320
321         No new tests, no behavior changes.
322
323         * page/AutoscrollController.cpp:
324         (WebCore::AutoscrollController::AutoscrollController):
325         (WebCore::AutoscrollController::stopAutoscrollTimer):
326         * page/ContentSecurityPolicy.cpp:
327         (WebCore::CSPSourceList::parseSource):
328         * page/ContentSecurityPolicy.h:
329         * page/ContextMenuController.cpp:
330         (WebCore::ContextMenuController::clearContextMenu):
331         * page/DOMSelection.cpp:
332         (WebCore::DOMSelection::clearTreeScope):
333         * page/DOMWindow.cpp:
334         (WebCore::DOMWindow::resetDOMWindowProperties):
335         (WebCore::DOMWindow::localStorage):
336         (WebCore::DOMWindow::focus):
337         * page/DOMWindow.h:
338         * page/DOMWindowExtension.cpp:
339         (WebCore::DOMWindowExtension::reconnectFrameFromPageCache):
340         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
341         * page/DOMWindowProperty.cpp:
342         (WebCore::DOMWindowProperty::DOMWindowProperty):
343         (WebCore::DOMWindowProperty::~DOMWindowProperty):
344         (WebCore::DOMWindowProperty::disconnectFrameForPageCache):
345         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
346         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
347         * page/DragController.cpp:
348         (WebCore::DragController::dragEnded):
349         (WebCore::DragController::performDragOperation):
350         (WebCore::DragController::tryDocumentDrag):
351         (WebCore::DragController::concludeEditDrag):
352         (WebCore::DragController::startDrag):
353         * page/EventHandler.cpp:
354         (WebCore::EventHandler::EventHandler):
355         (WebCore::EventHandler::resizeLayerDestroyed):
356         (WebCore::EventHandler::freeDataTransfer):
357         (WebCore::EventHandler::dragSourceEndedAt):
358         (WebCore::EventHandler::handleDrag):
359         * page/EventHandler.h:
360         * page/FocusController.cpp:
361         (WebCore::FocusController::advanceFocusInDocumentOrder):
362         * page/Frame.cpp:
363         (WebCore::Frame::~Frame):
364         (WebCore::Frame::searchForLabelsBeforeElement):
365         (WebCore::Frame::willDetachPage):
366         (WebCore::Frame::createView):
367         * page/Frame.h:
368         (WebCore::Frame::detachFromPage):
369         * page/FrameDestructionObserver.cpp:
370         (WebCore::FrameDestructionObserver::FrameDestructionObserver):
371         (WebCore::FrameDestructionObserver::~FrameDestructionObserver):
372         (WebCore::FrameDestructionObserver::frameDestroyed):
373         * page/FrameTree.cpp:
374         (WebCore::FrameTree::~FrameTree):
375         (WebCore::FrameTree::removeChild):
376         * page/FrameTree.h:
377         (WebCore::FrameTree::FrameTree):
378         (WebCore::FrameTree::detachFromParent):
379         * page/History.cpp:
380         (WebCore::History::History):
381         * page/Page.cpp:
382         (WebCore::Page::Page):
383         (WebCore::Page::~Page):
384         (WebCore::Page::findStringMatchingRanges):
385         * page/PageGroup.cpp:
386         * page/Performance.cpp:
387         (WebCore::Performance::Performance):
388         * page/PointerLockController.cpp:
389         (WebCore::PointerLockController::didLosePointerLock):
390         (WebCore::PointerLockController::clearElement):
391         * page/SecurityOrigin.h:
392         (WebCore::SecurityOrigin::canAccessDatabase):
393         * page/Settings.cpp:
394         (WebCore::Settings::Settings):
395         * page/SpatialNavigation.cpp:
396         (WebCore::FocusCandidate::FocusCandidate):
397         * page/SpatialNavigation.h:
398         (WebCore::FocusCandidate::FocusCandidate):
399         * page/scrolling/ScrollingTreeNode.cpp:
400         (WebCore::ScrollingTreeNode::ScrollingTreeNode):
401         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
402         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
403
404 2015-06-04  Benjamin Poulain  <bpoulain@apple.com>
405
406         Combine tiny DFAs into slightly larger ones
407         https://bugs.webkit.org/show_bug.cgi?id=145572
408
409         Reviewed by Alex Christensen.
410
411         This patch changes the ContentExtensions compiler to combine tiny DFA
412         until they reach a minimum size.
413
414         The main tool introduced here is DFAMerger. It combines 2 DFAs into
415         a single DFA that represent the union of the two machines.
416         That is done by a simple subset construction on the "name" of the nodes
417         in each DFAs.
418
419         Since we only merge 2 machines, and they are both deterministic, we know that
420         we can only be in one state of each machine, or a state in one machine without
421         equivalent in the other machine.
422         We exploit that to identify the mapping between nodes. To identify a node in
423         the new machine from nodes in the original machines, we just concatenate the node
424         IDs into a single 64 bits number. If there is no node in one of the machine, we
425         use a special tag.
426
427         The current algorithm does not have any subgraph pruning, machines grow very very
428         quickly. Because of that, we only merge very small DFAs at the moment.
429
430         Test: http/tests/contentextensions/filters-with-quantifiers-combined.html
431
432         * WebCore.xcodeproj/project.pbxproj:
433         * contentextensions/ContentExtensionCompiler.cpp:
434         (WebCore::ContentExtensions::compileRuleList):
435         * contentextensions/ContentExtensionsDebugging.h:
436         * contentextensions/DFA.cpp:
437         (WebCore::ContentExtensions::DFA::graphSize):
438         (WebCore::ContentExtensions::DFA::debugPrintDot):
439         * contentextensions/DFA.h:
440         * contentextensions/DFACombiner.cpp: Added.
441         (WebCore::ContentExtensions::DFAMerger::DFAMerger):
442         (WebCore::ContentExtensions::DFAMerger::merge):
443         (WebCore::ContentExtensions::DFAMerger::signatureForIndices):
444         (WebCore::ContentExtensions::DFAMerger::extractIndexA):
445         (WebCore::ContentExtensions::DFAMerger::extractIndexB):
446         (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode):
447         (WebCore::ContentExtensions::DFAMerger::setHalfSignature):
448         (WebCore::ContentExtensions::DFAMerger::populateTransitions):
449         (WebCore::ContentExtensions::DFAMerger::populateFromFallbackTransitions):
450         (WebCore::ContentExtensions::DFAMerger::createTransitions):
451         (WebCore::ContentExtensions::DFAMerger::createFallbackTransitionIfNeeded):
452         (WebCore::ContentExtensions::DFACombiner::combineDFAs):
453         * contentextensions/DFACombiner.h: Copied from Source/WebCore/contentextensions/DFA.h.
454         (WebCore::ContentExtensions::DFACombiner::addDFA):
455
456 2015-06-04  Matt Rajca  <mrajca@apple.com>
457
458         Rename MediaSessionManager to PlatformMediaSessionManager for consistency with PlatformMediaSession.
459         https://bugs.webkit.org/show_bug.cgi?id=145648
460
461         Reviewed by Eric Carlson.
462
463         * WebCore.vcxproj/WebCore.vcxproj:
464         * WebCore.vcxproj/WebCore.vcxproj.filters:
465         * WebCore.xcodeproj/project.pbxproj:
466         * html/HTMLMediaElement.cpp:
467         * html/MediaElementSession.cpp:
468         (WebCore::MediaElementSession::effectivePreloadForElement):
469         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
470         * platform/audio/PlatformMediaSession.cpp:
471         (WebCore::PlatformMediaSession::PlatformMediaSession):
472         (WebCore::PlatformMediaSession::~PlatformMediaSession):
473         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
474         (WebCore::PlatformMediaSession::clientWillPausePlayback):
475         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
476         (WebCore::PlatformMediaSession::updateClientDataBuffering):
477         * platform/audio/PlatformMediaSessionManager.cpp: Renamed from Source/WebCore/platform/audio/MediaSessionManager.cpp.
478         (WebCore::PlatformMediaSessionManager::sharedManager):
479         (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
480         (WebCore::PlatformMediaSessionManager::resetRestrictions):
481         (WebCore::PlatformMediaSessionManager::has):
482         (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
483         (WebCore::PlatformMediaSessionManager::count):
484         (WebCore::PlatformMediaSessionManager::beginInterruption):
485         (WebCore::PlatformMediaSessionManager::endInterruption):
486         (WebCore::PlatformMediaSessionManager::addSession):
487         (WebCore::PlatformMediaSessionManager::removeSession):
488         (WebCore::PlatformMediaSessionManager::addRestriction):
489         (WebCore::PlatformMediaSessionManager::removeRestriction):
490         (WebCore::PlatformMediaSessionManager::restrictions):
491         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
492         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
493         (WebCore::PlatformMediaSessionManager::setCurrentSession):
494         (WebCore::PlatformMediaSessionManager::currentSession):
495         (WebCore::PlatformMediaSessionManager::sessionRestrictsInlineVideoPlayback):
496         (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia):
497         (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
498         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
499         (WebCore::PlatformMediaSessionManager::updateSessionState):
500         (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand):
501         (WebCore::PlatformMediaSessionManager::systemWillSleep):
502         (WebCore::PlatformMediaSessionManager::systemDidWake):
503         (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged):
504         * platform/audio/PlatformMediaSessionManager.h: Renamed from Source/WebCore/platform/audio/MediaSessionManager.h.
505         (WebCore::PlatformMediaSessionManager::~PlatformMediaSessionManager):
506         (WebCore::PlatformMediaSessionManager::configureWireLessTargetMonitoring):
507         (WebCore::PlatformMediaSessionManager::hasWirelessTargetsAvailable):
508         (WebCore::PlatformMediaSessionManager::sessions):
509         * platform/audio/mac/AudioDestinationMac.cpp:
510         * platform/audio/mac/MediaSessionManagerMac.cpp:
511         (PlatformMediaSessionManager::updateSessionState):
512         (MediaSessionManager::updateSessionState): Deleted.
513         * testing/Internals.cpp:
514
515 2015-06-04  Eric Carlson  <eric.carlson@apple.com>
516
517         [Mac] Don't show default controls after playing to wireless target, again
518         https://bugs.webkit.org/show_bug.cgi?id=145620
519         <rdar://problem/21145806>
520
521         Reviewed by Dean Jackson.
522
523         Follow up to fix two tests broken by r185207.
524
525         * Modules/mediacontrols/mediaControlsApple.js:
526         (Controller.prototype.updateControls): Always show controls when the video element
527           is the fullscreen element because custom controls aren't possible.
528
529 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
530
531         [Cocoa] Add ASSERT to FontPlatformData::ctFont()
532         https://bugs.webkit.org/show_bug.cgi?id=145659
533
534         Reviewed by Dean Jackson.
535
536         The new ASSERT needs to be guarded with CORETEXT_WEB_FONTS, which is defined in FontCustomPlatformData.h,
537         and is not accessible to FontPlatformData. Therefore, I've moved the definition into TextFlags.h, which
538         both files include.
539
540         No new tests because there is no behavior change.
541
542         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
543         (WebCore::FontPlatformData::ctFont): Add the ASSERT.
544         * platform/graphics/mac/FontCustomPlatformData.h: Move the CORETEXT_WEB_FONTS preprocessor
545         macro from here ...
546         * platform/text/TextFlags.h: ... to here.
547
548 2015-06-04  Commit Queue  <commit-queue@webkit.org>
549
550         Unreviewed, rolling out r185208.
551         https://bugs.webkit.org/show_bug.cgi?id=145655
552
553         platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-
554         latched-select.html (Requested by shallawa on #webkit).
555
556         Reverted changeset:
557
558         "Latching algorithm in findEnclosingOverflowScroll is broken"
559         https://bugs.webkit.org/show_bug.cgi?id=145642
560         http://trac.webkit.org/changeset/185208
561
562 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
563
564         [Cocoa] Remove unnecessary code from FontPlatformData::ctFont()
565         https://bugs.webkit.org/show_bug.cgi?id=145652
566
567         Hoefler Text Italic no longer has initial and final swashes by default, so there
568         is no reason to explicitly disable them.
569
570         Reviewed by Andreas Kling.
571
572         No new tests because there is no behavior change.
573
574         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
575         (WebCore::FontPlatformData::ctFont):
576         (WebCore::createFeatureSettingDictionary): Deleted.
577         (WebCore::cascadeToLastResortAndDisableSwashesFontDescriptor): Deleted.
578
579 2015-06-04  Brent Fulgham  <bfulgham@apple.com>
580
581         Latching algorithm in findEnclosingOverflowScroll is broken
582         https://bugs.webkit.org/show_bug.cgi?id=145642
583         <rdar://problem/21242308>
584
585         Reviewed by Simon Fraser.
586
587         Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
588
589         * page/mac/EventHandlerMac.mm:
590         (WebCore::findEnclosingOverflowScrollForDominantDirection): Renamed from
591         'findEnclosingOverflowScroll'. Only identify element as our overflow
592         scroll element if it can be scrolled in either axis of the gesture's
593         motion.
594         (WebCore::scrolledToEdgeInDominantDirection): Renamed.
595         (WebCore::EventHandler::platformPrepareForWheelEvents): Use new function
596         name, and pass horizontal and vertical deltas.
597         (WebCore::findEnclosingOverflowScroll): Deleted.
598
599 2015-06-04  Eric Carlson  <eric.carlson@apple.com>
600
601         [Mac] Don't show default controls after playing to wireless target, again
602         https://bugs.webkit.org/show_bug.cgi?id=145620
603         <rdar://problem/21145806>
604
605         Reviewed by Dean Jackson.
606
607         * Modules/mediacontrols/mediaControlsApple.js:
608         (Controller.prototype.updateControls): Show or hide the panel as appropriate.
609         (Controller.prototype.handleWrapperMouseMove): Early return if !video.controls.
610         (Controller.prototype.addControls): Call updateControls instead of this.setNeedsTimelineMetricsUpdate
611           so all needed setup is done.
612         (Controller.prototype.resetHideControlsTimer): Only start the hide timer if playing.
613
614 2015-06-04  Chris Dumez  <cdumez@apple.com>
615
616         [WK2] Prune more resources from the MemoryCache before process suspension
617         https://bugs.webkit.org/show_bug.cgi?id=145633
618
619         Reviewed by Andreas Kling.
620
621         Prune more resources from the MemoryCache before process suspension or
622         on simulated memory warning by doing a synchronous JS garbage collection
623         and sweep *before* pruning dead resources from the memory cache.
624         Previously, we would do the garbage collection after pruning the
625         MemoryCache which meant that a lot of resources became dead after we
626         tried to prune them.
627
628         At the end a basic browsing on apple.com, we are able to remove ~17%
629         more resources from the MemoryCache on simulated memory warning with this
630         change.
631
632         Pruning as much as we can from the memory cache on critical memory
633         pressure or before process suspension is not only useful to free up
634         memory but also to make room in the vnode table as a lot of
635         CachedResources are mmmap'd from the network disk cache.
636
637         * platform/MemoryPressureHandler.cpp:
638         (WebCore::MemoryPressureHandler::MemoryPressureHandler):
639         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
640
641         - Pass 'synchronous' argument so that we know if we need to do a
642           synchronous JS garbage collection.
643         - Move here code from in the Cocoa handler that is doing a JS garbage
644           collection as well as a sweep, and make this code cross-platform.
645           This code used to be iOS specific but I see no reason we shouldn't
646           do this on Mac.
647
648         (WebCore::MemoryPressureHandler::releaseMemory):
649         * platform/MemoryPressureHandler.h:
650
651         Use enum class arguments for critical / synchronous. The 'synchronous'
652         argument is new so that the call site can let us know if memory needs
653         to be freed synchronously (e.g. in case of imminent process suspension).
654
655         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
656         (WebCore::MemoryPressureHandler::platformReleaseMemory):
657
658         Remove iOS-specific code that was doing a JS garbage collection and
659         sweep as this code is now in the generic memory pressure handler.
660
661         (WebCore::MemoryPressureHandler::install):
662
663         On simulated memory pressure, set 'synchronous' argument to Yes so that
664         a synchronous GC is done by the generic memory pressure handler. This
665         way, we no longer need to do a sync GC after calling the memory pressure
666         handler. This avoids code duplication and makes sure the GC is done
667         before pruning the memory cache.
668
669
670 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
671
672         [Cocoa] Clean up m_isEmoji in FontPlatformData
673         https://bugs.webkit.org/show_bug.cgi?id=145644
674
675         Reviewed by Andreas Kling.
676
677         m_isEmoji used to be a public member variable only defined on iOS. This
678         means that, whenever it was consulted, the sites were surrounded by
679         PLATFORM(IOS) guards. A cleaner design is to use a getter and setter,
680         which on non-iOS platforms, always return false / do nothing. Then, the
681         use sites can just use these functions without having ugly guards.
682
683         No new tests because there is no behavior change.
684
685         * platform/graphics/FontPlatformData.h:
686         (WebCore::FontPlatformData::hash): Simplify isEmoji use site.
687         (WebCore::FontPlatformData::isEmoji): Getter. Returns false on Mac.
688         (WebCore::FontPlatformData::setIsEmoji): Setter. Does nothing on Mac.
689         * platform/graphics/cocoa/FontCascadeCocoa.mm:
690         (WebCore::pointAdjustedForEmoji): Simplify isEmoji use site.
691         (WebCore::FontCascade::drawGlyphs): Ditto.
692         * platform/graphics/cocoa/FontCocoa.mm:
693         (WebCore::Font::platformInit): Ditto.
694         (WebCore::canUseFastGlyphAdvanceGetter): Ditto.
695         (WebCore::isEmoji): Deleted.
696         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
697         (WebCore::FontPlatformData::platformDataInit): Simplify isEmoji use
698         site.
699         (WebCore::FontPlatformData::platformDataAssign): Ditto.
700         (WebCore::FontPlatformData::platformIsEqual): Ditto.
701         (WebCore::FontPlatformData::ctFontSize): Ditto.
702         * platform/graphics/ios/FontCacheIOS.mm:
703         (WebCore::FontCache::getSystemFontFallbackForCharacters): Ditto.
704         (WebCore::FontCache::createFontPlatformData): Ditto.
705         * platform/graphics/mac/ComplexTextController.cpp:
706         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Ditto.
707
708 2015-06-03  Brent Fulgham  <bfulgham@apple.com>
709
710         REGRESSION (r181879): Scrolling order on pages with focused iframe is broken.
711         https://bugs.webkit.org/show_bug.cgi?id=145637
712         <rdar://problem/20635581>
713
714         Reviewed by Zalan Bujtas.
715
716         Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
717
718         This page revealed a bug in our RenderBox code caused by the mismatch between
719         our scrolling units, which are all integrally snapped, with our client height
720         and widths, which are not snapped at all. 
721         
722         In certain cases, the client height would have a small subpixel difference compared
723         to the scroll height, which would cause WebKit to believe it was scrollable. When
724         this happened, it would get stuck latched to this element and block scrolling events. 
725
726         * page/Frame.cpp:
727         (WebCore::Frame::scrollOverflowLayer): Use roundToInt for clientWidth and clientHeight,
728         rather than integer truncation.
729         * rendering/RenderBox.cpp:
730         (WebCore::RenderBox::canBeScrolledAndHasScrollableArea): Need to round clientWidth
731         and clientHeight to compare with scrollWidth/scrollHeight.
732         * rendering/RenderBox.h:
733         (WebCore::RenderBox::hasScrollableOverflowX): Ditto.
734         (WebCore::RenderBox::hasScrollableOverflowY): Ditto.
735         * rendering/RenderMarquee.cpp:
736         (WebCore::RenderMarquee::computePosition): Use roundToInt for clientWidth and
737         clientHeight, rather than integer truncation.
738
739 2015-06-04  Myles C. Maxfield  <mmaxfield@apple.com>
740
741         [Cocoa] Clean up m_font inside FontPlatformData
742         https://bugs.webkit.org/show_bug.cgi?id=145634
743
744         Reviewed by Andreas Kling.
745
746         FontPlatformDatas are used as keys in a HashMap. This means that they need
747         to be able to represent a "deleted" value. Previously, this "deleted" value
748         was represented as setting the pointer value of m_font to -1, and guarding
749         all uses of m_font to make sure it wasn't -1 before dereferencing it.
750
751         This patch simplifies FontPlatformData to represent a "deleted" value using
752         a separate boolean member variable. This class is already big enough that
753         the increased space is negligable (the class already contains two CoreText
754         fonts in addition to a CoreGraphics font). Because of this simplification,
755         m_font can now be a RetainPtr, instead of being manually retained and
756         released.
757
758         There is still a long way to go before FontPlatformData is acceptably
759         clean and understandable. This patch improves one aspect of it, and more
760         improvements will eventually follow.
761
762         No new tests because there is no behavior change.
763
764         * platform/graphics/FontCache.cpp: Remove unused variable.
765         * platform/graphics/FontPlatformData.cpp:
766         (WebCore::FontPlatformData::FontPlatformData): Clean up all the PLATFORM
767         macros in favor of a single bool. Also, update to include new state.
768         (WebCore::FontPlatformData::operator=): Update to include new state.
769         * platform/graphics/FontPlatformData.h:
770         (WebCore::FontPlatformData::font): Update to account for RetainPtr.
771         (WebCore::FontPlatformData::nsFont): Ditto.
772         (WebCore::FontPlatformData::setNSFont): Ditto.
773         (WebCore::FontPlatformData::hash): Update to include new state.
774         (WebCore::FontPlatformData::operator==): Ditto.
775         (WebCore::FontPlatformData::isHashTableDeletedValue): Use new state.
776         (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
777         (WebCore::FontPlatformData::isValidCTFontRef): Deleted.
778         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
779         (WebCore::FontPlatformData::platformDataInit): No need for manual retain
780         and release.
781         (WebCore::FontPlatformData::platformDataAssign): Ditto.
782         (WebCore::FontPlatformData::platformIsEqual): Update to account for
783         RetanPtr.
784         (WebCore::FontPlatformData::setFont): No need for manual retain and
785         release.
786         (WebCore::FontPlatformData::FontPlatformData): Deleted.
787         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
788         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
789         (WebCore::FontPlatformData::~FontPlatformData): m_scaledFont is always
790         valid.
791         (WebCore::FontPlatformData::platformDataAssign): Ditto.
792
793 2015-06-03  Carlos Alberto Lopez Perez  <clopez@igalia.com>
794
795         [GTK] [Wayland] Build is broken on trunk
796         https://bugs.webkit.org/show_bug.cgi?id=142879
797
798         Reviewed by Carlos Garcia Campos.
799
800         No new tests, no behavior changes.
801
802         Patch on GLContext.h picked from bug 136831 by
803         Iago Toral <itoral@igalia.com> and Zan Dobersek <zdobersek@igalia.com>
804
805         * platform/graphics/GLContext.h: Include wayland-egl.h before eglplatform.h
806         to use the Wayland platform when building for Wayland.
807         * platform/graphics/PlatformDisplay.cpp: Fix the include of GDK
808         headers for the different targets.
809         * platform/graphics/wayland/WaylandSurface.cpp: Fix build after r183731.
810         (WebCore::WaylandSurface::~WaylandSurface):
811
812 2015-06-04  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
813
814         [Streams API] Implement ReadableStreamController enqueue
815         https://bugs.webkit.org/show_bug.cgi?id=145210
816
817         Reviewed by Darin Adler.
818
819         Added possibility to enqueue any JSValue within ReadableJSStream.
820         They are stored in a Vector of strongified JSValue.
821
822         Added support for streams that contain data but are asked to close.
823         This is done through m_closeRequested boolean and splitting actual closing of the stream from changeStateToClosed().
824
825         Chunk size and backpressure mechanism is not yet implemented.
826         Neither is pulling once enqueued data is processed.
827
828         Covered by rebased tests.
829
830         * Modules/streams/ReadableStream.cpp:
831         (WebCore::ReadableStream::changeStateToClosed): Split method with newly added close().
832         (WebCore::ReadableStream::close): Does the actual closing of stream once stream has no more values.
833         (WebCore::ReadableStream::read): Close the stream when stream is emptied and close is requested.
834         (WebCore::ReadableStream::resolveReadCallback): Added to enable ReadableJSStream to resolve read callbacks immediatly at enqueue time.
835         * Modules/streams/ReadableStream.h:
836         (WebCore::ReadableStream::isErrored): Getter added for the custom binding code.
837         (WebCore::ReadableStream::isCloseRequested): Ditto.
838         * bindings/js/JSReadableStreamControllerCustom.cpp:
839         (WebCore::JSReadableStreamController::enqueue): binding code for enqueue, taking care of raising exception if readable stream cannot enqueue.
840         * bindings/js/ReadableJSStream.cpp:
841         (WebCore::ReadableJSStream::hasValue):
842         (WebCore::ReadableJSStream::read):
843         (WebCore::ReadableJSStream::enqueue):
844         * bindings/js/ReadableJSStream.h:
845
846 2015-06-04  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
847
848         [Streams API] ReadableJSStream does not need a ReadableStreamSource
849         https://bugs.webkit.org/show_bug.cgi?id=145601
850
851         Reviewed by Darin Adler.
852
853         Covered by existing tests.
854
855         * Modules/streams/ReadableStream.cpp:
856         (WebCore::ReadableStream::ReadableStream): Remoed m_source.
857         * Modules/streams/ReadableStream.h: Ditto
858         * Modules/streams/ReadableStreamSource.h: Deleted.
859         * WebCore.vcxproj/WebCore.vcxproj: Removing Modules/streams/ReadableStreamSource.h.
860         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
861         * WebCore.xcodeproj/project.pbxproj: Ditto.
862         * bindings/js/ReadableJSStream.cpp:
863         (WebCore::ReadableJSStream::globalObject):
864         (WebCore::ReadableJSStream::doStart): Equivalent of ReadableJSStream::Source::start().
865         (WebCore::ReadableJSStream::create): Updated according new constructor.
866         (WebCore::ReadableJSStream::ReadableJSStream):
867         (WebCore::startReadableStreamAsync): Deleted.
868         (WebCore::ReadableJSStream::jsController): Deleted.
869         (WebCore::ReadableJSStream::storeError): Deleted.
870         * bindings/js/ReadableJSStream.h: Added m_source member to store the JS source as a JS object.
871
872 2015-06-04  Zan Dobersek  <zdobersek@igalia.com>
873
874         Shrink the ArabicCharShapingMode enum in SVGGlyph.cpp
875         https://bugs.webkit.org/show_bug.cgi?id=145564
876
877         Reviewed by Darin Adler.
878
879         Shrink the ArabicCharShapingMode enum to just one byte.
880         This drops the size of the static s_arabicCharShapingMode
881         array of  ArabicCharShapingMode values from 888 bytes to 222.
882
883         * platform/graphics/SVGGlyph.cpp:
884         (WebCore::processArabicFormDetection):
885
886 2015-06-03  Zalan Bujtas  <zalan@apple.com>
887
888         Use borderBoxRect instead of contentBoxRect for backdrop filter.
889         https://bugs.webkit.org/show_bug.cgi?id=145606
890
891         Reviewed by Simon Fraser.
892
893         Backdrop filter should use border box rect. It also needs to take css clip into account.
894
895         Tests: css3/filters/backdrop/backdrop-filter-with-cliprect.html
896                css3/filters/backdrop/backdrop-filter-with-mask.html
897
898         * rendering/RenderLayerBacking.cpp:
899         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
900
901 2015-06-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
902
903         MediaDevices.getUserMedia should put promises in resolve/reject state synchronously
904         https://bugs.webkit.org/show_bug.cgi?id=145308
905
906         Reviewed by Darin Adler.
907
908         Removed the calls to callToMainThread in which were resolved and rejected promises.
909         Cleaned up the code to remove unneeded callback copies.
910
911         Covered by existing tests.
912
913         * Modules/mediastream/UserMediaRequest.cpp:
914         (WebCore::UserMediaRequest::create):
915         (WebCore::UserMediaRequest::UserMediaRequest):
916         (WebCore::UserMediaRequest::didCreateStream):
917         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError):
918         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError):
919         * Modules/mediastream/UserMediaRequest.h:
920
921 2015-06-03  Simon Fraser  <simon.fraser@apple.com>
922
923         REGRESSION (r184968): missing media player buttons (control bar exists, but no buttons)
924         https://bugs.webkit.org/show_bug.cgi?id=145630
925
926         Reviewed by Zalan Bujtas.
927
928         r184968 changed the initial value of m_intersectsCoverageRect to false. However,
929         this triggered a bug with mask layers, whose value of m_intersectsCoverageRect was never
930         updated.
931
932         Fix by copying the value of m_intersectsCoverageRect from the main layer to its
933         mask layer, just as we do for m_visibleRect and m_coverageRect.
934
935         Test: compositing/visible-rect/mask-layer-coverage.html
936
937         * platform/graphics/ca/GraphicsLayerCA.cpp:
938         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
939
940 2015-06-03  Simon Fraser  <simon.fraser@apple.com>
941
942         Layer tree dumps should include mask layers
943         https://bugs.webkit.org/show_bug.cgi?id=145629
944
945         Reviewed by Zalan Bujtas.
946
947         Dumping the layer tree omitted to dump the mask layer, so fix 
948         GraphicsLayer::dumpProperties() to dump this layer.
949
950         * platform/graphics/GraphicsLayer.cpp:
951         (WebCore::GraphicsLayer::dumpProperties):
952
953 2015-06-03  Greg Hughes  <ghughes@apple.com>
954
955         AX: Expose field sets to accessibility clients
956         https://bugs.webkit.org/show_bug.cgi?id=145585
957    
958         Expose fieldsets to the accessibility API via a subrole of AXFieldset.
959
960         Reviewed by Chris Fleizach.
961
962         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
963         (-[WebAccessibilityObjectWrapper subrole]):
964
965 2015-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
966
967         Remove dead code FontPlatformData::roundsGlyphAdvances()
968         https://bugs.webkit.org/show_bug.cgi?id=145628
969
970         Reviewed by Simon Fraser.
971
972         No new tests because there is no behavior change.
973
974         * WebCore.order:
975         * platform/graphics/FontPlatformData.h:
976         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
977         (WebCore::FontPlatformData::roundsGlyphAdvances): Deleted.
978
979 2015-06-03  Ryuan Choi  <ryuan.choi@navercorp.com>
980
981         [CoordinatedGraphics] Merge CoordinatedTile into Tile
982         https://bugs.webkit.org/show_bug.cgi?id=145602
983
984         Reviewed by Darin Adler.
985
986         CoordinatedTile only implements Tile since Qt and WebKit1/Efl were dropped.
987         So, there is no reason that CoordinatedTile inherits Tile interface.
988
989         No new tests, no behavior changes.
990
991         * PlatformEfl.cmake:
992         * PlatformGTK.cmake:
993         * WebCore.vcxproj/WebCore.vcxproj:
994         * WebCore.vcxproj/WebCore.vcxproj.filters:
995         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
996         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
997         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp: Renamed to Tile.cpp
998         * platform/graphics/texmap/coordinated/CoordinatedTile.h: Merged into Tile.h
999         (WebCore::CoordinatedTile::coordinate): Deleted.
1000         (WebCore::CoordinatedTile::rect): Deleted.
1001         * platform/graphics/texmap/coordinated/Tile.cpp: Renamed from CoordinatedTile.cpp.
1002         * platform/graphics/texmap/coordinated/Tile.h:
1003         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1004         (WebCore::TiledBackingStore::createTiles):
1005
1006 2015-06-03  Matt Rajca  <mrajca@apple.com>
1007
1008         Add basic Media Session support to HTMLMediaElement.
1009         https://bugs.webkit.org/show_bug.cgi?id=145581
1010
1011         Reviewed by Eric Carlson.
1012
1013         HTMLMediaElements now have:
1014
1015         - a 'kind' attribute representing the intrinsic media category
1016         - a 'session' attribute representing the current media session, if any
1017
1018         * CMakeLists.txt: Include the new HTMLMediaElementMediaSession sources.
1019         * DerivedSources.make: Include the new IDL file.
1020         * Modules/mediasession/HTMLMediaElementMediaSession.cpp: Added.
1021         (WebCore::HTMLMediaElementMediaSession::session):
1022         * Modules/mediasession/HTMLMediaElementMediaSession.h: Added basic translation of the IDL file.
1023         (WebCore::HTMLMediaElementMediaSession::kind):
1024         (WebCore::HTMLMediaElementMediaSession::setKind):
1025         (WebCore::HTMLMediaElementMediaSession::setSession):
1026         * Modules/mediasession/HTMLMediaElementMediaSession.idl: Added from the Media Session spec.
1027         * PlatformMac.cmake: Include DOMHTMLMediaElementMediaSession.cpp.
1028         * WebCore.xcodeproj/project.pbxproj: Include the new HTMLMediaElementMediaSession sources.
1029         * html/HTMLMediaElement.h: Added accessors for 'kind' and 'session'.
1030         (WebCore::HTMLMediaElement::kind):
1031         (WebCore::HTMLMediaElement::setKind):
1032         (WebCore::HTMLMediaElement::session):
1033         (WebCore::HTMLMediaElement::setSession):
1034
1035 2015-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
1036
1037         Cleanup after r185175.
1038         https://bugs.webkit.org/show_bug.cgi?id=145569
1039         <rdar://problem/20671711>
1040
1041         Unreviewed.
1042
1043         No new tests because there is no behavior change.
1044
1045         * platform/graphics/WidthIterator.h:
1046
1047 2015-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
1048
1049         SoftBank Emoji are not transformed by shaping when in a run of their own
1050         https://bugs.webkit.org/show_bug.cgi?id=145569
1051         <rdar://problem/20671711>
1052
1053         Reviewed by Dean Jackson.
1054
1055         Normally, we don't perform shaping on single glyphs. However, these particular codepoints
1056         need to have shaping run on them, even if they are alone.
1057
1058         Test: fast/text/softbank-emoji.html Note that this test may fail in different locales on
1059         different platforms. This patch disables the test on iOS.
1060
1061         * Source/WebCore/platform/graphics/WidthIterator.cpp:
1062         (WebCore::applyFontTransforms): Move the length-of-1 check into shouldApplyFontTransforms()
1063         (WebCore::shouldApplyFontTransforms): Return true if we have one of these emoji characters in
1064         a run of its own
1065         (WebCore::advanceInternal): Keep track of the previous character, and use it to call
1066         shouldApplyFontTransforms. 
1067         * Source/WebCore/platform/graphics/WidthIterator.h: shouldApplyFontTransforms() needs
1068         some more information to perform its duties.
1069
1070 2015-06-03  Daniel Bates  <dabates@apple.com>
1071
1072         Caps lock indicator should not be shown in read-only or disabled field
1073         https://bugs.webkit.org/show_bug.cgi?id=145612
1074         <rdar://problem/21227454>
1075
1076         Reviewed by Darin Adler.
1077
1078         * html/TextFieldInputType.cpp:
1079         (WebCore::TextFieldInputType::disabledAttributeChanged): Update caps lock indicator state.
1080         (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
1081         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator): Do not draw the caps lock indicator
1082         when the field is read-only or disabled.
1083
1084 2015-06-03  Dean Jackson  <dino@apple.com>
1085
1086         Crash in GraphicsContext3D::getInternalFramebufferSize
1087         https://bugs.webkit.org/show_bug.cgi?id=145479
1088         <rdar://problem/16461048>
1089
1090         Reviewed by Eric Carlson.
1091
1092         If we are in an unitialized or lost state, don't try to access the context.
1093
1094         In order to test this, I added an Internal setting that always
1095         forces WebGL into a pending state.
1096
1097         Test: fast/canvas/webgl/useWhilePending.html
1098
1099         * html/canvas/WebGLRenderingContextBase.cpp:
1100         (WebCore::WebGLRenderingContextBase::create): Check internal settings for
1101         a forced pending state.
1102         (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
1103         (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
1104         * page/Settings.cpp: New Internal setting for forcing a pending policy.
1105         (WebCore::Settings::Settings):
1106         (WebCore::Settings::setForcePendingWebGLPolicy):
1107         * page/Settings.h:
1108         (WebCore::Settings::isForcePendingWebGLPolicy):
1109         * testing/InternalSettings.cpp:
1110         (WebCore::InternalSettings::Backup::Backup):
1111         (WebCore::InternalSettings::Backup::restoreTo):
1112         (WebCore::InternalSettings::setForcePendingWebGLPolicy):
1113         * testing/InternalSettings.h:
1114         * testing/InternalSettings.idl:
1115
1116 2015-06-03  Hunseop Jeong  <hs85.jeong@samsung.com>
1117
1118         Use modern for-loops in WebCore/page.
1119         https://bugs.webkit.org/show_bug.cgi?id=145455
1120
1121         Reviewed by Darin Adler.
1122
1123         No new tests, no behavior changes.
1124
1125         * page/Chrome.cpp:
1126         (WebCore::Chrome::notifyPopupOpeningObservers):
1127         * page/ContentSecurityPolicy.cpp:
1128         (WebCore::CSPSourceList::matches):
1129         (WebCore::CSPDirectiveList::gatherReportURIs):
1130         (WebCore::ContentSecurityPolicy::copyStateFrom):
1131         (WebCore::isAllowedByAll):
1132         (WebCore::isAllowedByAllWithState):
1133         (WebCore::isAllowedByAllWithContext):
1134         (WebCore::isAllowedByAllWithURL):
1135         (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage):
1136         (WebCore::ContentSecurityPolicy::allowPluginType):
1137         (WebCore::ContentSecurityPolicy::reflectedXSSDisposition):
1138         (WebCore::ContentSecurityPolicy::gatherReportURIs):
1139         * page/ContextMenuController.cpp:
1140         (WebCore::ContextMenuController::populate):
1141         * page/DOMWindow.cpp:
1142         (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
1143         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
1144         (WebCore::DOMWindow::willDestroyCachedFrame):
1145         (WebCore::DOMWindow::willDestroyDocumentInFrame):
1146         (WebCore::DOMWindow::willDetachDocumentFromFrame):
1147         (WebCore::DOMWindow::disconnectDOMWindowProperties):
1148         (WebCore::DOMWindow::reconnectDOMWindowProperties):
1149         (WebCore::DOMWindow::getMatchedCSSRules):
1150         * page/DeviceController.cpp:
1151         (WebCore::DeviceController::dispatchDeviceEvent):
1152         (WebCore::DeviceController::fireDeviceEvent):
1153         * page/EventHandler.cpp:
1154         (WebCore::EventHandler::updateMouseEventTargetNode):
1155         (WebCore::EventHandler::handleTouchEvent):
1156         * page/FocusController.cpp:
1157         (WebCore::FocusController::setIsVisibleAndActiveInternal):
1158         * page/Frame.cpp:
1159         (WebCore::Frame::orientationChanged):
1160         (WebCore::Frame::injectUserScriptsForWorld):
1161         * page/FrameView.cpp:
1162         (WebCore::FrameView::scrollContentsFastPath):
1163         (WebCore::FrameView::serviceScriptedAnimations):
1164         (WebCore::FrameView::trackedRepaintRectsAsText):
1165         (WebCore::FrameView::updateWidgetPositions):
1166         (WebCore::FrameView::notifyWidgets):
1167         * page/Page.cpp:
1168         (WebCore::networkStateChanged):
1169         (WebCore::Page::stringToViewMode):
1170         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
1171         (WebCore::Page::refreshPlugins):
1172         (WebCore::Page::lockAllOverlayScrollbarsToHidden):
1173         (WebCore::Page::pluginViews):
1174         (WebCore::Page::storageBlockingStateChanged):
1175         (WebCore::Page::setIsVisibleInternal):
1176         * page/PageGroup.cpp:
1177         (WebCore::PageGroup::captionPreferencesChanged):
1178         * page/PageGroupLoadDeferrer.cpp:
1179         (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
1180         (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
1181         * page/PageSerializer.cpp:
1182         (WebCore::PageSerializer::serializeFrame):
1183         * page/Performance.cpp:
1184         (WebCore::Performance::webkitGetEntriesByType):
1185         (WebCore::Performance::webkitGetEntriesByName):
1186         * page/PerformanceResourceTiming.cpp:
1187         (WebCore::passesTimingAllowCheck):
1188         * page/PerformanceUserTiming.cpp:
1189         (WebCore::convertToEntrySequence):
1190         * page/SecurityPolicy.cpp:
1191         (WebCore::SecurityPolicy::isAccessWhiteListed):
1192         * page/UserContentURLPattern.cpp:
1193         (WebCore::UserContentURLPattern::matchesPatterns):
1194         * page/WindowFeatures.cpp:
1195         (WebCore::WindowFeatures::parseDialogFeatures):
1196         * page/animation/AnimationController.cpp:
1197         (WebCore::AnimationControllerPrivate::updateAnimations):
1198         (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
1199         (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
1200         (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
1201         (WebCore::AnimationControllerPrivate::numberOfActiveAnimations):
1202         * page/animation/CSSPropertyAnimation.cpp:
1203         (WebCore::ShorthandPropertyWrapper::equals):
1204         (WebCore::ShorthandPropertyWrapper::blend):
1205         * page/scrolling/AsyncScrollingCoordinator.cpp:
1206         (WebCore::setStateScrollingNodeSnapOffsetsAsFloat):
1207         * page/scrolling/ScrollingCoordinator.cpp:
1208         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
1209         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
1210
1211 2015-06-03  Daniel Bates  <dabates@apple.com>
1212
1213         AutoFill button should not be shown in read-only or disabled field
1214         https://bugs.webkit.org/show_bug.cgi?id=145579
1215         <rdar://problem/21212494>
1216
1217         Reviewed by Darin Adler.
1218
1219         Fixes an issue where the AutoFill button is shown in a read-only or disabled
1220         field. We should not show the AutoFill button in such cases.
1221
1222         Tests: fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled.html
1223                fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html
1224                fast/forms/auto-fill-button/input-auto-fill-button.html
1225                fast/forms/auto-fill-button/input-disabled-auto-fill-button.html
1226                fast/forms/auto-fill-button/input-readonly-auto-fill-button.html
1227                fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button.html
1228
1229         * html/TextFieldInputType.cpp:
1230         (WebCore::TextFieldInputType::disabledAttributeChanged): Update AutoFill button state.
1231         (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
1232         (WebCore::TextFieldInputType::shouldDrawAutoFillButton): Do not draw AutoFill button
1233         when the field is disabled or read-only.
1234
1235 2015-06-03  Brent Fulgham  <bfulgham@apple.com>
1236
1237         REGRESSION: (r181879): Scrolling in select/option region in iFrame scrolls both select and iframe
1238         https://bugs.webkit.org/show_bug.cgi?id=145574
1239         <rdar://problem/20966828>
1240
1241         Reviewed by Simon Fraser.
1242
1243         Tested by platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html
1244
1245         When the scroll gesture is started when the latched scrollable container is not at the limit of its
1246         scroll region, we are NOT supposed to propagate the scroll event to the enclosing region. However,
1247         we were doing two things wrong:
1248         (1) When we recognized we were latching, we were using the right wheel event target, but not using
1249             the latched scrollable container.
1250         (2) Likewise, we were not using latched ScrollableArea when handling wheel events.
1251
1252         Instead, we were using the current scrollable container and ScrollableArea under the mouse pointer,
1253         which could be different from the point we started latching as the content scrolled.
1254         
1255         The fix was to properly track the scrollable container and scrollable area during latching.
1256
1257         I attempted to store the latched ScrollableArea in the latchingState object, like we already do for the
1258         scrollable container, but found that this did not work properly. I think the life cycle of the
1259         ScrollableArea may not match the scrollable container, and since they are not reference counted I
1260         simply retrieve the ScrollableArea when needed.
1261
1262         * page/mac/EventHandlerMac.mm:
1263         (WebCore::scrollableAreaForContainerNode): Helper function to return the correct ScrollableArea
1264         for the two types of RenderBox elements.
1265         (WebCore::latchedToFrameOrBody): Helper predicate to identify Frame and Body elements.
1266         (WebCore::EventHandler::platformPrepareForWheelEvents): Use the correct ScrollableArea for the given
1267         ContainerNode. When latching, make sure to use the ScrollableArea that is related to the latched scrollable
1268         container, not the area currently underneath the mouse pointer.
1269
1270 2015-06-03  Brady Eidson  <beidson@apple.com>
1271
1272         REGRESSION (r183498): Certain types of frame loads in iframes with <base target="_blank"> can open urls in new window/tabs
1273         https://bugs.webkit.org/show_bug.cgi?id=145580
1274
1275         Reviewed by Mark Lam.
1276
1277         Tests: fast/loader/fragment-navigation-base-blank.html
1278                fast/loader/iframe-meta-refresh-base-blank.html
1279                fast/loader/iframe-set-location-base-blank.html
1280                fast/loader/refresh-iframe-base-blank.html
1281
1282         Before 183498, callers of FrameLoader::changeLocation() got automatically assigned a frame name of "_self".
1283         After 183498, many remained without a frame name.
1284         
1285         Later on, FrameLoader applies the <base> target as their frame name if they don't already have one. 
1286         
1287         When the <base> target is "_blank", that causes a new window/tab.
1288         
1289         Restoring "_self" to these call sites fixes this.
1290
1291         * inspector/InspectorFrontendClientLocal.cpp:
1292         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1293         
1294         * inspector/InspectorPageAgent.cpp:
1295         (WebCore::InspectorPageAgent::navigate):
1296         
1297         * loader/FrameLoadRequest.h:
1298         (WebCore::FrameLoadRequest::FrameLoadRequest):
1299         
1300         * loader/NavigationScheduler.cpp:
1301         (WebCore::NavigationScheduler::scheduleLocationChange):
1302         
1303         * page/DOMWindow.cpp:
1304         (WebCore::DOMWindow::createWindow):
1305
1306 2015-06-03  Alexey Proskuryakov  <ap@apple.com>
1307
1308         More iOS build fixing.
1309
1310         * platform/spi/mac/AVFoundationSPI.h:
1311
1312 2015-06-03  Zalan Bujtas  <zalan@apple.com>
1313
1314         Subpixel rendering: Composited layer with subpixel gap does not get painted properly when its position changes.
1315         https://bugs.webkit.org/show_bug.cgi?id=145587
1316
1317         Reviewed by Simon Fraser.
1318
1319         The composited layer always snaps to an enclosing device pixel (floors) while the renderer rounds.
1320         At certain positions (for example 0.5px on a 1x display), a gap is formed between the layer(0px) and its renderer(1px).
1321         In such cases, when the the renderer moves to a position (1.1px) where the gap is closed, we need to issue repaint on the layer
1322         in order to get the renderering right.
1323
1324         Test: compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves.html
1325
1326         * rendering/RenderLayerBacking.cpp:
1327         (WebCore::RenderLayerBacking::updateAfterLayout):
1328         (WebCore::devicePixelFractionGapFromRendererChanged):
1329         (WebCore::RenderLayerBacking::updateGeometry):
1330         * rendering/RenderLayerBacking.h:
1331
1332 2015-06-03  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1333
1334         [Streams API] ReadableStreamReader::closed() should be called once by binding code
1335         https://bugs.webkit.org/show_bug.cgi?id=145551
1336
1337         Reviewed by Darin Adler.
1338
1339         Covered by existing tests.
1340
1341         * bindings/js/JSReadableStreamReaderCustom.cpp:
1342         (WebCore::JSReadableStreamReader::closed): Calling ReadableStreamReader::closed only at creation of the promise.
1343
1344 2015-06-02  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1345
1346         [EFL][GTK] Fix build error since r185137
1347         https://bugs.webkit.org/show_bug.cgi?id=145596
1348
1349         Unreviewed, fix build break on EFL and GTK port.
1350
1351         * dom/Text.cpp:
1352         (WebCore::Text::formatForDebugger): Use strncpy() instead of strlcpy().
1353
1354 2015-06-02  Sergio Villar Senin  <svillar@igalia.com>
1355
1356         [CSS Grid Layout] Switch from parenthesis to brackets for grid line names
1357         https://bugs.webkit.org/show_bug.cgi?id=144996
1358
1359         Reviewed by Darin Adler.
1360
1361         Grid line names are now enclosed by brackets instead of parentheses
1362         as mentioned in the latest version of the spec. Appartently the CSS
1363         code is now more readable and avoids issues with tools like SASS.
1364
1365         * css/CSSGrammar.y.in:
1366         * css/CSSGridLineNamesValue.cpp:
1367         (WebCore::CSSGridLineNamesValue::customCSSText):
1368
1369 2015-06-02  Alexey Proskuryakov  <ap@apple.com>
1370
1371         iOS build fix
1372
1373         * platform/spi/mac/AVFoundationSPI.h:
1374
1375 2015-06-02  Commit Queue  <commit-queue@webkit.org>
1376
1377         Unreviewed, rolling out r185128 and r185132.
1378         https://bugs.webkit.org/show_bug.cgi?id=145597
1379
1380         The new test hits a bad assertion (Requested by ap on
1381         #webkit).
1382
1383         Reverted changesets:
1384
1385         "Crash in GraphicsContext3D::getInternalFramebufferSize"
1386         https://bugs.webkit.org/show_bug.cgi?id=145479
1387         http://trac.webkit.org/changeset/185128
1388
1389         "Skip webgl/useWhilePending.html on WebKit 1."
1390         http://trac.webkit.org/changeset/185132
1391
1392 2015-06-02  Ryuan Choi  <ryuan.choi@navercorp.com>
1393
1394         [CoordinatedGraphics] Refactor TiledBackingStoreClient
1395         https://bugs.webkit.org/show_bug.cgi?id=145577
1396
1397         Reviewed by Gyuyoung Kim.
1398
1399         This patch removes and simplifies unnecessary virtual methods of TiledBackingStoreClient.
1400
1401         No new tests, no behavior changes.
1402
1403         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1404         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers): Renamed from tiledBackingStorePaintEnd.
1405         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintBegin): Deleted.
1406         (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintEnd): Deleted.
1407         (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreBackgroundColor):
1408         Deleted because tiledBackingStoreBackgroundColor() is not used anywhere.
1409         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1410         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp:
1411         (WebCore::CoordinatedTile::updateBackBuffer):
1412         Simplified not to call unnecessary methods. In addition, used modern for loop.
1413         (WebCore::CoordinatedTile::swapBackBufferToFront): Deleted.
1414         * platform/graphics/texmap/coordinated/CoordinatedTile.h:
1415         * platform/graphics/texmap/coordinated/Tile.h:
1416         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1417         (WebCore::TiledBackingStore::updateTileBuffers):
1418         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
1419
1420 2015-06-02  Doug Russell  <d_russell@apple.com>
1421
1422         AX: debugging attributes for text markers
1423         https://bugs.webkit.org/show_bug.cgi?id=145283
1424
1425         Reviewed by Chris Fleizach.
1426
1427         AXTextMarkerDebugDescription: returns the result of
1428         VisiblePosition::formatForDebugger() for the visible position that a text marker
1429         represents.
1430         AXTextMarkerNodeDebugDescription: calls Node::showNode() and
1431         Node::showNodePathForThis() for the visible position that a text marker
1432         represents.
1433         AXTextMarkerNodeTreeDebugDescription: calls Node::showTreeForThis() for the
1434         visible position that a text marker represents.
1435         AXTextMarkerRangeDebugDescription: returns the result of
1436         formatForDebugger(VisiblePositionRange) for the visible position range that a text
1437         marker range represents.
1438
1439         This is debug only tooling. Tests would be flakey and not very helpful.
1440
1441         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1442         (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarker:]):
1443         (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarkerRange:]):
1444         (-[WebAccessibilityObjectWrapper showNodeForTextMarker:]):
1445         (-[WebAccessibilityObjectWrapper showNodeTreeForTextMarker:]):
1446         (formatForDebugger):
1447         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1448         * dom/Text.cpp:
1449         (WebCore::Text::formatForDebugger):
1450
1451 2015-06-02  Matt Rajca  <mrajca@apple.com>
1452
1453         MediaSessions should keep track of their current state.
1454         https://bugs.webkit.org/show_bug.cgi?id=145575
1455
1456         Reviewed by Alex Christensen.
1457
1458         * Modules/mediasession/MediaSession.h: Per the Media Session spec, the state can be 'Idle', 'Active', or
1459           'Interrupted'. Sessions are created in an 'Idle' state.
1460
1461 2015-06-02  Jon Lee  <jonlee@apple.com>
1462
1463         Build fix when building with internal SDKs
1464         https://bugs.webkit.org/show_bug.cgi?id=145576
1465         rdar://problem/21089476
1466
1467         Reviewed by Alexey Proskuryakov.
1468
1469         * platform/spi/mac/AVFoundationSPI.h: Include the right header.
1470
1471 2015-06-02  Dean Jackson  <dino@apple.com>
1472
1473         No need to guard the sizes attribute against PICTURE_SIZES in preload scanner.
1474         https://bugs.webkit.org/show_bug.cgi?id=145573
1475         <rdar://problem/21210038>
1476
1477         Reviewed by Myles Maxfield.
1478
1479         The PICTURE_SIZES feature flag doesn't need to be used to
1480         guard preloading of the sizes attribute.
1481
1482         * html/parser/HTMLPreloadScanner.cpp:
1483         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): Deleted.
1484         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Deleted.
1485
1486 2015-06-02  Anders Carlsson  <andersca@apple.com>
1487
1488         Use UUIDs for WebSQL database filenames instead of a sequential number
1489         https://bugs.webkit.org/show_bug.cgi?id=145571
1490
1491         Reviewed by Dan Bernstein.
1492
1493         This is a first step towards getting rid of the iOS specific code path where we truncate
1494         database files instead of deleting them (in order to avoid file corruption).
1495
1496         * Modules/webdatabase/DatabaseTracker.cpp:
1497         (WebCore::generateDatabaseFileName):
1498         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
1499         * platform/sql/SQLiteFileSystem.cpp:
1500         (WebCore::SQLiteFileSystem::getFileNameForNewDatabase): Deleted.
1501         * platform/sql/SQLiteFileSystem.h:
1502
1503 2015-06-02  Dean Jackson  <dino@apple.com>
1504
1505         Crash in GraphicsContext3D::getInternalFramebufferSize
1506         https://bugs.webkit.org/show_bug.cgi?id=145479
1507         <rdar://problem/16461048>
1508
1509         Reviewed by Eric Carlson.
1510
1511         If we are in an unitialized or lost state, don't try to access the context.
1512
1513         In order to test this, I added an Internal setting that always
1514         forces WebGL into a pending state.
1515
1516         Test: fast/canvas/webgl/useWhilePending.html
1517
1518         * html/canvas/WebGLRenderingContextBase.cpp:
1519         (WebCore::WebGLRenderingContextBase::create): Check internal settings for
1520         a forced pending state.
1521         (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
1522         (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
1523         * page/Settings.cpp: New Internal setting for forcing a pending policy.
1524         (WebCore::Settings::Settings):
1525         (WebCore::Settings::setForcePendingWebGLPolicy):
1526         * page/Settings.h:
1527         (WebCore::Settings::isForcePendingWebGLPolicy):
1528         * testing/InternalSettings.cpp:
1529         (WebCore::InternalSettings::Backup::Backup):
1530         (WebCore::InternalSettings::Backup::restoreTo):
1531         (WebCore::InternalSettings::setForcePendingWebGLPolicy):
1532         * testing/InternalSettings.h:
1533         * testing/InternalSettings.idl:
1534
1535 2015-06-02  Matt Rajca  <mrajca@apple.com>
1536
1537         Added a stub implementation of MediaSession, part of the Media Session spec.
1538         https://bugs.webkit.org/show_bug.cgi?id=145530
1539
1540         Reviewed by Eric Carlson.
1541
1542         * CMakeLists.txt: Added new MediaSession sources.
1543         * DerivedSources.make:
1544         * Modules/mediasession/MediaSession.cpp: Added stub implementation.
1545         (WebCore::MediaSession::MediaSession): Per the Media Session spec, a Media Remote Controls object should only be
1546           set for 'content' sessions; it is null otherwise.
1547         (WebCore::MediaSession::~MediaSession):
1548         (WebCore::MediaSession::controls):
1549         (WebCore::MediaSession::releaseSession):
1550         * Modules/mediasession/MediaSession.h: Added basic translation of IDL file.
1551         * Modules/mediasession/MediaSession.idl: Added from the Media Session spec.
1552         * WebCore.xcodeproj/project.pbxproj: Added new MediaSession sources.
1553
1554 2015-06-02  Zalan Bujtas  <zalan@apple.com>
1555
1556         Backdrop filter is pulling in content from behind the window.
1557         https://bugs.webkit.org/show_bug.cgi?id=145561
1558         rdar://problem/20909309
1559
1560         Reviewed by Simon Fraser.
1561
1562         This patch ensures that the backdrop filter layer is positioned and sized properly.
1563
1564         The backdrop filter layer should take its size and position from its renderer and not
1565         directly from the composited layer.
1566         In certain cases the composited layer's size is expanded to cover items like box shadow or an absolute positioned descendant.
1567         In such cases, we ended up applying the backdrop filter to those areas as well.
1568
1569         Tests: css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute.html
1570                css3/filters/backdrop/backdrop-filter-does-not-size-properly-border-and-padding.html
1571
1572         * platform/graphics/GraphicsLayer.h:
1573         (WebCore::GraphicsLayer::setBackdropFiltersRect):
1574         (WebCore::GraphicsLayer::backdropFiltersRect):
1575         * platform/graphics/ca/GraphicsLayerCA.cpp:
1576         (WebCore::GraphicsLayerCA::setBackdropFiltersRect):
1577         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1578         (WebCore::GraphicsLayerCA::updateBackdropFilters):
1579         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
1580         (WebCore::GraphicsLayerCA::updateContentsRects):
1581         (WebCore::GraphicsLayerCA::updateGeometry): Deleted.
1582         * platform/graphics/ca/GraphicsLayerCA.h:
1583         * rendering/RenderLayerBacking.cpp:
1584         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
1585         (WebCore::RenderLayerBacking::updateGeometry):
1586         * rendering/RenderLayerBacking.h:
1587
1588 2015-06-02  Eric Carlson  <eric.carlson@apple.com>
1589
1590         [Mac] occasional crash in Document::playbackTargetAvailabilityDidChange
1591         https://bugs.webkit.org/show_bug.cgi?id=145559
1592
1593         Reviewed by Darin Adler.
1594
1595         No new tests, covered by existing tests.
1596
1597         * html/HTMLMediaElement.cpp:
1598         (WebCore::HTMLMediaElement::registerWithDocument): Pass document to m_mediaSession->registerWithDocument.
1599         (WebCore::HTMLMediaElement::unregisterWithDocument): Pass document to m_mediaSession->unRegisterWithDocument.
1600         (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): Ditto.
1601         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
1602
1603         * html/MediaElementSession.cpp:
1604         (WebCore::MediaElementSession::registerWithDocument): Take a document.
1605         (WebCore::MediaElementSession::unregisterWithDocument): Ditto.
1606         * html/MediaElementSession.h:
1607
1608 2015-06-02  Chris Dumez  <cdumez@apple.com>
1609
1610         Calling FrameView::viewportContentsChanged() after style recalcs is too expensive
1611         https://bugs.webkit.org/show_bug.cgi?id=145554
1612         <rdar://problem/21189478>
1613
1614         Reviewed by Darin Adler and Simon Fraser.
1615
1616         Only call FrameView::viewportContentsChanged() after a style recalc if
1617         composited layers have been updated (and there is no pending layout).
1618
1619         We already viewportContentsChanged() after layout so we only need to
1620         call viewportContentsChanged() after a style recalc if it did not cause
1621         a layout but may have caused an element to become visible. In
1622         particular, this can happen in the case of composited animations (e.g.
1623         using -webkit-transform to move an element inside the viewport).
1624         Therefore, we now only call viewportContentsChanged() after a style
1625         recalc if it caused composited layers to be updated. This avoids a lot
1626         of unnecessary calls to viewportContentsChanged(), which is expensive.
1627
1628         No new tests, already covered by:
1629         fast/images/animated-gif-webkit-transform.html
1630
1631         * dom/Document.cpp:
1632         (WebCore::Document::recalcStyle):
1633         * page/FrameView.cpp:
1634         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
1635         * page/FrameView.h:
1636         * rendering/RenderLayerCompositor.cpp:
1637         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
1638         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1639         * rendering/RenderLayerCompositor.h:
1640
1641 2015-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
1642
1643         Remove use of CTFontSetRenderingParameters()
1644         https://bugs.webkit.org/show_bug.cgi?id=145560
1645
1646         Reviewed by Simon Fraser.
1647
1648         Instead, always use CTFontSetRenderingStyle().
1649
1650         No new tests because there is no behavior change.
1651
1652         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1653         (WebCore::RenderingStyleSaver::RenderingStyleSaver): Deleted.
1654         (WebCore::RenderingStyleSaver::~RenderingStyleSaver): Deleted.
1655
1656 2015-06-02  Anders Carlsson  <andersca@apple.com>
1657
1658         Move WKFontAntialiasingStateSaver to its own file
1659         https://bugs.webkit.org/show_bug.cgi?id=145557
1660         rdar://problem/21134776
1661
1662         Reviewed by Dan Bernstein.
1663
1664         Also rename it to FontAntialiasingStateSaver. Also, change it to use the CoreGraphicsSPI.h header for its
1665         CGFontAntialiasingStyle definition instead of using an explicit typedef.
1666
1667         * WebCore.xcodeproj/project.pbxproj:
1668         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1669         (PlatformCALayer::drawLayerContents):
1670         * platform/graphics/ios/FontAntialiasingStateSaver.h: Copied from Source/WebCore/platform/ios/wak/WKGraphics.h.
1671         (WebCore::FontAntialiasingStateSaver::FontAntialiasingStateSaver):
1672         (WebCore::FontAntialiasingStateSaver::setup):
1673         (WebCore::FontAntialiasingStateSaver::restore):
1674         * platform/ios/LegacyTileCache.mm:
1675         (WebCore::LegacyTileCache::drawWindowContent):
1676         * platform/ios/wak/WKGraphics.h:
1677         (WKFontAntialiasingStateSaver::WKFontAntialiasingStateSaver): Deleted.
1678         * platform/ios/wak/WKGraphics.mm:
1679         (WKFontAntialiasingStateSaver::setup): Deleted.
1680         (WKFontAntialiasingStateSaver::restore): Deleted.
1681
1682 2015-06-02  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1683
1684         [Streams API] Implement ReadableStreamReader read method in closed and errored state
1685         https://bugs.webkit.org/show_bug.cgi?id=144790
1686
1687         Reviewed by Darin Adler.
1688
1689         Reader delegates read() promise handling to its stream except if reader is no longer locking the stream and stream is readable.
1690         Storing of reader read() promise callbacks as a Vector in ReadableStream.
1691         Added resolution/rejection of read() promises in case of errored/closed streams.
1692
1693         Test: streams/readable-stream-reader-read.html
1694
1695         * ForwardingHeaders/runtime/IteratorOperations.h: Added.
1696         * Modules/streams/ReadableStream.cpp:
1697         (WebCore::ReadableStream::cleanCallbacks): Clean the read requests.
1698         (WebCore::ReadableStream::changeStateToClosed): Run success callbacks with undefined for read requests.
1699         (WebCore::ReadableStream::changeStateToErrored): Run failure callbacks with the errors for read requests.
1700         (WebCore::ReadableStream::closed): Parameter name changed.
1701         (WebCore::ReadableStream::read): Added. Succeeds with empty when closed, fails with error when errored, reads a
1702         value if there is one and pushes the callbacks to the queue otherwise.
1703         * Modules/streams/ReadableStream.h:
1704         (WebCore::ReadableStream::ReadCallbacks::ReadCallbacks): Struct containing success and failure callbacks.
1705         * Modules/streams/ReadableStreamReader.cpp:
1706         (WebCore::ReadableStreamReader::closed): Parameter name changed.
1707         (WebCore::ReadableStreamReader::read): Invoke success with empty if we streams if we don't have the right reader
1708         and call the stream otherwise to read.
1709         * Modules/streams/ReadableStreamReader.h:
1710         * bindings/js/JSReadableStreamReaderCustom.cpp:
1711         (WebCore::JSReadableStreamReader::read): Create the callback lambdas and invoke read. Failure rejects the
1712         promise and success creates the result from the read value.
1713         * bindings/js/ReadableJSStream.cpp:
1714         (WebCore::ReadableJSStream::hasValue):
1715         (WebCore::ReadableJSStream::read): Not implemented yet.
1716         * bindings/js/ReadableJSStream.h:
1717
1718 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
1719
1720         [Cocoa] FontPlatformData's equality check should always use reference URLs
1721         https://bugs.webkit.org/show_bug.cgi?id=144168
1722
1723         Reviewed by Tim Horton.
1724
1725         <rdar://problem/18985642> is not fixed, so we need to continue using the older
1726         objectForEqualityCheck().
1727
1728         No new tests because there is no behavior change.
1729
1730         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1731         (WebCore::FontPlatformData::objectForEqualityCheck):
1732
1733 2015-06-02  Andy Estes  <aestes@apple.com>
1734
1735         [Mac] REGRESSION (r175941): Max.app crashes when adding a sound file to a patch due to removing cursor resources from WebCore.framework
1736         https://bugs.webkit.org/show_bug.cgi?id=145555
1737
1738         Reviewed by Darin Adler.
1739
1740         Re-added the cursor resources used by Max.app and ran sort-Xcode-project-file.
1741
1742         * Resources/copyCursor.png: Added.
1743         * Resources/moveCursor.png: Added.
1744         * Resources/northEastSouthWestResizeCursor.png: Added.
1745         * Resources/northSouthResizeCursor.png: Added.
1746         * Resources/northWestSouthEastResizeCursor.png: Added.
1747         * WebCore.xcodeproj/project.pbxproj:
1748
1749 2015-06-02  Brady Eidson  <beidson@apple.com>
1750
1751         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
1752         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
1753
1754         Reviewed by Alex Christensen.
1755
1756         Tests: loader/navigation-policy/should-open-external-urls/main-frame-click.html
1757                loader/navigation-policy/should-open-external-urls/main-frame-navigated-programatically-by-subframe.html
1758                loader/navigation-policy/should-open-external-urls/main-frame-with-flag-progamatic.html
1759                loader/navigation-policy/should-open-external-urls/main-frame-without-flag-programatic.html
1760                loader/navigation-policy/should-open-external-urls/subframe-click-target-self.html
1761                loader/navigation-policy/should-open-external-urls/subframe-click-target-top.html
1762                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag-from-subframe.html
1763                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag.html
1764                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag-from-subframe.html
1765                loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag.html
1766                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag-from-subframe.html
1767                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag.html
1768                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag-from-subframe.html
1769                loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag.html
1770                loader/navigation-policy/should-open-external-urls/window-open-with-flag-from-subframe.html
1771                loader/navigation-policy/should-open-external-urls/window-open-with-flag.html
1772                loader/navigation-policy/should-open-external-urls/window-open-without-flag-from-subframe.html
1773                loader/navigation-policy/should-open-external-urls/window-open-without-flag.html
1774
1775         The "should open external URLs" flag is only for main frames.
1776         It doesn't enforce any sort of policy internal to WebKit, but rather is for notifications to the policy delegate.
1777         
1778         It is set from one of two places:
1779         1 - A main frame is navigated by any frame as the result of a user gesture.
1780         2 - WebKit2 API explicitly states the flag is true.
1781         
1782         The flag value propagates when:
1783         1 - When a main frame document is navigated to a new main frame document.
1784         2 - When a new window is opened from a page whose main frame had the flag set.
1785         3 - When a new window is opened as the result of a user gesture.
1786         
1787         The flag resets to false when:
1788         1 - A subframe navigates a main frame without a user gesture.
1789         
1790         This patch is large, but does little more than the following:
1791         1 - Adds a ShouldOpenExternalURLs flag to both FrameLoadRequest and NavigationAction.
1792         2 - Makes sure anybody who creates either of those objects sets a sensible for that flag.
1793         3 - When FrameLoader creates a new DocumentLoader, it sets its flag based on whether or not the load is in a main frame,
1794             whether or not the load is from a user gesture, and based on the initiator's value of the flag. 
1795             
1796         * dom/Document.cpp:
1797         (WebCore::Document::processHttpEquiv):
1798         (WebCore::Document::shouldOpenExternalURLsPolicyToPropagate):
1799         * dom/Document.h:
1800         
1801         * html/HTMLAnchorElement.cpp:
1802         (WebCore::HTMLAnchorElement::handleClick):
1803         
1804         * html/HTMLLinkElement.cpp:
1805         (WebCore::HTMLLinkElement::handleClick):
1806         
1807         * html/parser/XSSAuditorDelegate.cpp:
1808         (WebCore::XSSAuditorDelegate::didBlockScript):
1809         
1810         * inspector/InspectorFrontendClientLocal.cpp:
1811         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1812         
1813         * inspector/InspectorPageAgent.cpp:
1814         (WebCore::InspectorPageAgent::navigate):
1815         
1816         * loader/DocumentLoader.cpp:
1817         (WebCore::DocumentLoader::setTriggeringAction):
1818         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate):
1819         * loader/DocumentLoader.h:
1820         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy): Deleted.
1821         
1822         * loader/FrameLoadRequest.cpp:
1823         (WebCore::FrameLoadRequest::FrameLoadRequest):
1824         * loader/FrameLoadRequest.h:
1825         (WebCore::FrameLoadRequest::FrameLoadRequest):
1826         
1827         * loader/FrameLoader.cpp:
1828         (WebCore::FrameLoader::urlSelected):
1829         (WebCore::FrameLoader::receivedFirstData):
1830         (WebCore::FrameLoader::loadURLIntoChildFrame):
1831         (WebCore::FrameLoader::loadURL):
1832         (WebCore::FrameLoader::load):
1833         (WebCore::FrameLoader::loadWithNavigationAction):
1834         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1835         (WebCore::FrameLoader::reload):
1836         (WebCore::FrameLoader::loadPostRequest):
1837         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1838         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
1839         * loader/FrameLoader.h:
1840         
1841         * loader/NavigationAction.cpp:
1842         (WebCore::NavigationAction::NavigationAction):
1843         (WebCore::NavigationAction::copyWithShouldOpenExternalURLsPolicy):
1844         * loader/NavigationAction.h:
1845         (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy): Deleted.
1846         
1847         * loader/NavigationScheduler.cpp:
1848         (WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
1849         (WebCore::ScheduledRedirect::ScheduledRedirect):
1850         (WebCore::ScheduledLocationChange::ScheduledLocationChange):
1851         (WebCore::ScheduledRefresh::ScheduledRefresh):
1852         (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
1853         (WebCore::NavigationScheduler::scheduleRedirect):
1854         (WebCore::NavigationScheduler::scheduleLocationChange):
1855         (WebCore::NavigationScheduler::scheduleRefresh):
1856         * loader/NavigationScheduler.h:
1857         
1858         * loader/PolicyChecker.cpp:
1859         (WebCore::PolicyChecker::checkNavigationPolicy):
1860         
1861         * loader/SubframeLoader.cpp:
1862         (WebCore::SubframeLoader::loadOrRedirectSubframe):
1863         
1864         * loader/appcache/ApplicationCacheGroup.cpp:
1865         (WebCore::ApplicationCacheGroup::selectCache):
1866         
1867         * page/ContextMenuController.cpp:
1868         (WebCore::openNewWindow):
1869         (WebCore::ContextMenuController::contextMenuItemSelected):
1870         
1871         * page/DOMWindow.cpp:
1872         (WebCore::DOMWindow::setLocation):
1873         (WebCore::DOMWindow::createWindow):
1874         (WebCore::DOMWindow::open):
1875         
1876         * page/DragController.cpp:
1877         (WebCore::DragController::performDragOperation):
1878         
1879         * page/Location.cpp:
1880         (WebCore::Location::reload):
1881         
1882         * replay/ReplayInputDispatchMethods.cpp:
1883         (WebCore::InitialNavigation::dispatch):
1884         
1885         * svg/SVGAElement.cpp:
1886         (WebCore::SVGAElement::defaultEventHandler):
1887
1888 2015-06-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1889
1890         Heap-use-after-free read of size 4 in JavaScriptCore: WTF::StringImpl::isSymbol() (StringImpl.h:496)
1891         https://bugs.webkit.org/show_bug.cgi?id=145532
1892
1893         Reviewed by Geoffrey Garen.
1894
1895         Hold the ownership of AtomicStringImpl*.
1896
1897         * bindings/scripts/CodeGeneratorJS.pm:
1898         (GenerateParametersCheck):
1899         * dom/TreeScope.cpp:
1900         (WebCore::TreeScope::getElementById):
1901
1902 2015-06-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1903
1904         SharedBuffer::copy should return a Ref<SharedBuffer>
1905         https://bugs.webkit.org/show_bug.cgi?id=145499
1906
1907         Reviewed by Andreas Kling.
1908
1909         Changing SharedBuffer::copy to return a Ref<> and adapting some code accordingly.
1910
1911         Covered by existing tests.
1912
1913         * loader/SubresourceLoader.cpp:
1914         (WebCore::SubresourceLoader::didReceiveResponse):
1915         * loader/appcache/ApplicationCacheResource.cpp:
1916         (WebCore::ApplicationCacheResource::deliver):
1917         * platform/SharedBuffer.cpp:
1918         (WebCore::SharedBuffer::copy):
1919         * platform/SharedBuffer.h:
1920
1921 2015-06-01  Hunseop Jeong  <hs85.jeong@samsung.com>
1922
1923         Use modern for-loops in WebCore/Modules - 1
1924         https://bugs.webkit.org/show_bug.cgi?id=145507
1925
1926         Reviewed by Darin Adler.
1927
1928         No new tests, no behavior changes.
1929
1930         * Modules/battery/BatteryController.cpp:
1931         (WebCore::BatteryController::~BatteryController):
1932         (WebCore::BatteryController::updateBatteryStatus):
1933         (WebCore::BatteryController::didChangeBatteryStatus):
1934         * Modules/encryptedmedia/CDM.cpp:
1935         (WebCore::CDMFactoryForKeySystem):
1936         * Modules/encryptedmedia/MediaKeys.cpp:
1937         (WebCore::MediaKeys::~MediaKeys):
1938         * Modules/geolocation/Geolocation.cpp:
1939         (WebCore::Geolocation::resumeTimerFired):
1940         (WebCore::Geolocation::resetAllGeolocationPermission):
1941         (WebCore::Geolocation::makeCachedPositionCallbacks):
1942         (WebCore::Geolocation::sendError):
1943         (WebCore::Geolocation::sendPosition):
1944         (WebCore::Geolocation::stopTimer):
1945         (WebCore::Geolocation::cancelRequests):
1946         (WebCore::Geolocation::extractNotifiersWithCachedPosition):
1947         (WebCore::Geolocation::copyToSet):
1948         (WebCore::Geolocation::handlePendingPermissionNotifiers):
1949         * Modules/geolocation/GeolocationController.cpp:
1950         (WebCore::GeolocationController::positionChanged):
1951         (WebCore::GeolocationController::errorOccurred):
1952         * Modules/indexeddb/IDBDatabase.cpp:
1953         (WebCore::IDBDatabase::objectStoreNames):
1954         (WebCore::IDBDatabase::transaction):
1955         (WebCore::IDBDatabase::forceClose):
1956         (WebCore::IDBDatabase::closeConnection):
1957         (WebCore::IDBDatabase::findObjectStoreId):
1958         * Modules/indexeddb/IDBDatabaseBackend.cpp:
1959         (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
1960         (WebCore::IDBDatabaseBackend::deleteDatabase):
1961         (WebCore::IDBDatabaseBackend::close):
1962         * Modules/indexeddb/IDBDatabaseMetadata.cpp:
1963         (WebCore::IDBDatabaseMetadata::isolatedCopy):
1964         (WebCore::IDBObjectStoreMetadata::isolatedCopy):
1965         * Modules/indexeddb/IDBKey.cpp:
1966         (WebCore::IDBKey::isValid):
1967         * Modules/indexeddb/IDBKey.h:
1968         (WebCore::IDBKey::createMultiEntryArray):
1969         (WebCore::IDBKey::createArray):
1970         * Modules/indexeddb/IDBKeyPath.cpp:
1971         (WebCore::IDBKeyPath::IDBKeyPath):
1972         (WebCore::IDBKeyPath::isValid):
1973         (WebCore::IDBKeyPath::isolatedCopy):
1974         * Modules/indexeddb/IDBObjectStore.cpp:
1975         (WebCore::IDBObjectStore::indexNames):
1976         (WebCore::IDBObjectStore::put):
1977         Rename the two 'i's to 'keyData' and 'indexKeyData'.
1978         (WebCore::IDBObjectStore::index):
1979         (WebCore::IDBObjectStore::findIndexId):
1980         * Modules/indexeddb/IDBPendingTransactionMonitor.cpp:
1981         (WebCore::IDBPendingTransactionMonitor::deactivateNewTransactions):
1982         * Modules/indexeddb/IDBRequest.cpp:
1983         (WebCore::IDBRequest::abort):
1984         * Modules/indexeddb/IDBTransaction.cpp:
1985         (WebCore::IDBTransaction::closeOpenCursors):
1986         (WebCore::IDBTransaction::onAbort):
1987         (WebCore::IDBTransaction::dispatchEvent):
1988         * Modules/indexeddb/IDBTransactionBackend.cpp:
1989         (WebCore::IDBTransactionBackend::create):
1990         (WebCore::IDBTransactionBackend::closeOpenCursors):
1991         * Modules/mediasource/MediaSource.cpp:
1992         (WebCore::MediaSource::onReadyStateChange):
1993         * Modules/mediastream/MediaConstraintsImpl.cpp:
1994         (WebCore::MediaConstraintsImpl::initialize):
1995         (WebCore::MediaConstraintsImpl::getMandatoryConstraints):
1996         (WebCore::MediaConstraintsImpl::getOptionalConstraintValue):
1997         * Modules/mediastream/MediaStream.cpp:
1998         (WebCore::MediaStream::create):
1999         (WebCore::MediaStream::cloneMediaStreamTrackVector):
2000         (WebCore::MediaStream::addTrack):
2001         (WebCore::MediaStream::removeTrack):
2002         (WebCore::MediaStream::haveTrackWithSource):
2003         (WebCore::MediaStream::getTrackById):
2004         (WebCore::MediaStream::getTracks):
2005         (WebCore::MediaStream::trackDidEnd):
2006         (WebCore::MediaStream::scheduledEventTimerFired):
2007         * Modules/mediastream/MediaStreamCapabilities.cpp:
2008         (WebCore::MediaStreamCapabilities::sourceType):
2009         (WebCore::MediaStreamCapabilities::sourceId):
2010         (WebCore::MediaStreamCapabilities::facingMode):
2011         * Modules/mediastream/MediaStreamTrack.cpp:
2012         (WebCore::MediaStreamTrack::trackDidEnd):
2013         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
2014         (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
2015
2016 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
2017
2018         [SVG -> OTF Converter] Remove unnecessary hacks
2019         https://bugs.webkit.org/show_bug.cgi?id=145088
2020
2021         Reviewed by Simon Fraser.
2022
2023         Not needed anymore.
2024
2025         Test: svg/text/offset-square-svg-font.html
2026
2027         * svg/SVGToOTFFontConversion.cpp:
2028         (WebCore::SVGToOTFFontConverter::appendKERNTable):
2029         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2030
2031 2015-06-01  Andreas Kling  <akling@apple.com>
2032
2033         CSS animations in filling-forwards state shouldn't force compositing.
2034         <https://webkit.org/b/145389>
2035         <rdar://problem/17923642>
2036
2037         Reviewed by Simon Fraser.
2038
2039         Stop checking if a CSS animation is filling forwards when computing
2040         compositing requirements.
2041
2042         This prevents finished animations from pinning elements in composited
2043         state, and frees up a bunch of IOSurface memory on some content.
2044
2045         * page/animation/AnimationBase.h:
2046         (WebCore::AnimationBase::isAnimatingProperty): Deleted.
2047         * rendering/RenderLayerBacking.cpp:
2048         (WebCore::RenderLayerBacking::updateGeometry):
2049         * rendering/RenderLayerCompositor.cpp:
2050         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2051
2052 2015-06-01  Myles C. Maxfield  <mmaxfield@apple.com>
2053
2054         Out of bounds read in WebCore::ComplexTextController::adjustGlyphsAndAdvances
2055         https://bugs.webkit.org/show_bug.cgi?id=145537
2056         <rdar://problem/20959267>
2057
2058         Reviewed by Darin Adler.
2059
2060         U16_IS_SURROGATE_LEAD(ch) assumes U16_IS_SURROGATE(ch). In this case, that isn't true.
2061
2062         Test: fast/text/crash-complex-text-surrogate.html
2063
2064         * platform/graphics/mac/ComplexTextController.cpp:
2065         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2066
2067 2015-05-30  Zalan Bujtas  <zalan@apple.com>
2068
2069         REGRESSION (179771): zooming on facebook images covers image
2070         https://bugs.webkit.org/show_bug.cgi?id=145485
2071
2072         Reviewed by Simon Fraser.
2073
2074         Scaling an infinite rect should always produce an infinite rect.
2075         (Based on Simon Fraser's patch)
2076
2077         Test: compositing/layer-creation/zoomed-clip-intersection.html
2078
2079         * platform/graphics/LayoutRect.cpp:
2080         (WebCore::LayoutRect::scale):
2081
2082 2015-06-01  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2083
2084         Purge PassRefPtr in WebCore/Modules - 3
2085         https://bugs.webkit.org/show_bug.cgi?id=145508
2086
2087         Reviewed by Darin Adler.
2088
2089         As a step to purge PassRefPtr, this patch removes PassRefPtr, then use Ref or RefPtr.
2090
2091         * Modules/indexeddb/IDBCursor.cpp:
2092         (WebCore::IDBCursor::create):
2093         * Modules/indexeddb/IDBCursor.h:
2094         * Modules/indexeddb/IDBCursorBackend.h:
2095         (WebCore::IDBCursorBackend::create):
2096         * Modules/indexeddb/IDBCursorBackendOperations.h:
2097         (WebCore::CursorIterationOperation::create):
2098         (WebCore::CursorAdvanceOperation::create):
2099         * Modules/indexeddb/IDBDatabase.cpp:
2100         (WebCore::IDBDatabase::create):
2101         * Modules/indexeddb/IDBDatabase.h:
2102         * Modules/indexeddb/IDBDatabaseBackend.cpp:
2103         (WebCore::IDBDatabaseBackend::create):
2104         * Modules/indexeddb/IDBDatabaseBackend.h:
2105         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
2106         (WebCore::IDBDatabaseCallbacksImpl::create):
2107         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
2108         * Modules/indexeddb/IDBDatabaseError.h:
2109         (WebCore::IDBDatabaseError::create):
2110         * Modules/indexeddb/IDBIndex.h:
2111         (WebCore::IDBIndex::create):
2112         * Modules/indexeddb/IDBKey.h:
2113         (WebCore::IDBKey::createInvalid):
2114         (WebCore::IDBKey::createNumber):
2115         (WebCore::IDBKey::createString):
2116         (WebCore::IDBKey::createDate):
2117         (WebCore::IDBKey::createArray):
2118         * Modules/indexeddb/IDBKeyRange.cpp:
2119         (WebCore::IDBKeyRange::create):
2120         * Modules/indexeddb/IDBKeyRange.h:
2121         (WebCore::IDBKeyRange::create):
2122         * Modules/indexeddb/IDBObjectStore.cpp:
2123         * Modules/indexeddb/IDBObjectStore.h:
2124         (WebCore::IDBObjectStore::create):
2125         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2126         (WebCore::IDBOpenDBRequest::create):
2127         * Modules/indexeddb/IDBOpenDBRequest.h:
2128         * Modules/indexeddb/IDBRecordIdentifier.h:
2129         (WebCore::IDBRecordIdentifier::create):
2130         * Modules/indexeddb/IDBRequest.cpp:
2131         (WebCore::IDBRequest::create):
2132         (WebCore::IDBRequest::getResultCursor):
2133         * Modules/indexeddb/IDBRequest.h:
2134         * Modules/indexeddb/IDBTransaction.cpp:
2135         (WebCore::IDBTransaction::create):
2136         * Modules/indexeddb/IDBTransaction.h:
2137         * Modules/indexeddb/IDBTransactionBackend.cpp:
2138         (WebCore::IDBTransactionBackend::create):
2139         * Modules/indexeddb/IDBTransactionBackend.h:
2140         * Modules/indexeddb/IDBTransactionBackendOperations.h:
2141         (WebCore::CreateObjectStoreOperation::create):
2142         (WebCore::DeleteObjectStoreOperation::create):
2143         (WebCore::IDBDatabaseBackend::VersionChangeOperation::create):
2144         (WebCore::CreateObjectStoreAbortOperation::create):
2145         (WebCore::DeleteObjectStoreAbortOperation::create):
2146         (WebCore::IDBDatabaseBackend::VersionChangeAbortOperation::create):
2147         (WebCore::CreateIndexOperation::create):
2148         (WebCore::CreateIndexAbortOperation::create):
2149         (WebCore::DeleteIndexOperation::create):
2150         (WebCore::DeleteIndexAbortOperation::create):
2151         (WebCore::GetOperation::create):
2152         (WebCore::PutOperation::create):
2153         (WebCore::SetIndexesReadyOperation::create):
2154         (WebCore::OpenCursorOperation::create):
2155         (WebCore::CountOperation::create):
2156         (WebCore::DeleteRangeOperation::create):
2157         (WebCore::ClearObjectStoreOperation::create):
2158         * Modules/mediasource/VideoPlaybackQuality.cpp:
2159         (WebCore::VideoPlaybackQuality::create):
2160         * Modules/mediasource/VideoPlaybackQuality.h:
2161         * Modules/mediastream/MediaConstraintsImpl.cpp:
2162         (WebCore::MediaConstraintsImpl::create):
2163         * Modules/mediastream/MediaConstraintsImpl.h:
2164         * Modules/mediastream/MediaStream.cpp:
2165         (WebCore::MediaStream::create):
2166         * Modules/mediastream/MediaStream.h:
2167         * Modules/mediastream/RTCDTMFSender.cpp:
2168         (WebCore::RTCDTMFSender::create):
2169         * Modules/mediastream/RTCDTMFSender.h:
2170         * Modules/mediastream/RTCOfferAnswerOptions.cpp:
2171         (WebCore::RTCOfferAnswerOptions::create):
2172         (WebCore::RTCOfferOptions::create):
2173         * Modules/mediastream/RTCOfferAnswerOptions.h:
2174         * Modules/mediastream/RTCPeerConnection.cpp:
2175         (WebCore::RTCPeerConnection::parseConfiguration):
2176         (WebCore::RTCPeerConnection::create):
2177         * Modules/mediastream/RTCPeerConnection.h:
2178         * Modules/webaudio/AudioContext.cpp:
2179         (WebCore::AudioContext::create):
2180         * Modules/webdatabase/AbstractDatabaseServer.h:
2181         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2182         (WebCore::DOMWindowWebDatabase::openDatabase):
2183         * Modules/webdatabase/DOMWindowWebDatabase.h:
2184         * Modules/webdatabase/DatabaseManager.cpp:
2185         (WebCore::DatabaseManager::existingDatabaseContextFor):
2186         (WebCore::DatabaseManager::databaseContextFor):
2187         (WebCore::DatabaseManager::openDatabase):
2188         * Modules/webdatabase/DatabaseManager.h:
2189         * Modules/webdatabase/DatabaseServer.cpp:
2190         (WebCore::DatabaseServer::openDatabase):
2191         (WebCore::DatabaseServer::createDatabase):
2192         * Modules/webdatabase/DatabaseServer.h:
2193
2194 2015-06-01  Daniel Bates  <dabates@apple.com>
2195
2196         Notify client that we began editing when text field is focused
2197         https://bugs.webkit.org/show_bug.cgi?id=145439
2198         <rdar://problem/21142108>
2199
2200         Reviewed by Anders Carlsson.
2201
2202         Inform the editor client that we began editing when a text field is focused either
2203         by being explicitly focused (programmatically or by user interaction) or implicitly
2204         focused when the window became active.
2205
2206         Currently we only notify the editor client that we began editing a text field when
2207         when a person actually changes the value of the field. And we always notify the
2208         client that we ended editing when a text field is defocused regardless of whether
2209         we executed a began editing callback. Moreover we notify a client that we
2210         ended editing when the field is defocused (either explicitly or implicitly when the
2211         window becomes inactive). Instead we should always notify the client that we began
2212         editing when the field is focused so that this callback is symmetric with the end
2213         editing callback.
2214
2215         * html/SearchInputType.cpp:
2216         (WebCore::SearchInputType::didSetValueByUserEdit): Remove parameter for ValueChangeState,
2217         which was used to determine whether we should notify the client that we began editing, because
2218         we we will notify the client that editing began when the text field is focused as opposed to
2219         when the value of text field first changes.
2220         * html/SearchInputType.h: Ditto.
2221         * html/TextFieldInputType.cpp:
2222         (WebCore::TextFieldInputType::forwardEvent): Notify the client that we began editing when
2223         the text field is focused.
2224         (WebCore::TextFieldInputType::subtreeHasChanged): Update call site of didSetValueByUserEdit()
2225         following the removal of its parameter.
2226         (WebCore::TextFieldInputType::didSetValueByUserEdit): Ditto.
2227         * html/TextFieldInputType.h:
2228
2229 2015-06-01  Anders Carlsson  <andersca@apple.com>
2230
2231         WAKScrollView.h cannot be imported standalone
2232         https://bugs.webkit.org/show_bug.cgi?id=145529
2233
2234         Reviewed by Dan Bernstein.
2235
2236         * page/mac/WebCoreFrameView.h:
2237         Remove the __cplusplus #ifdefs since WebCoreFrameView.h is only used by Objective-C++ code.
2238         (The different non-C++ method declarations were wrong anyway!)
2239
2240         * platform/ScrollTypes.h:
2241         Remove the #ifdef __cplusplus surrounding the code, add header includes to make the file self-contained,
2242         and reformat the enum definitions.
2243
2244 2015-06-01  Alex Christensen  <achristensen@webkit.org>
2245
2246         [Content Extensions] resource-type and load-type should be independent.
2247         https://bugs.webkit.org/show_bug.cgi?id=145528
2248         rdar://problem/21190765
2249
2250         Reviewed by Benjamin Poulain.
2251
2252         Covered by existing tests and a new API test.
2253         
2254         Right now we use the same uint16_t to store all the load-type and resource-type flags,
2255         then we just do a bitwise and to check both at the same time. This results in a trigger
2256         with load-type and resource-type firing if either condition is met, not both conditions.
2257         A trigger with both resource-type and load-type conditions should only fire if both conditions are met.
2258
2259         * contentextensions/DFABytecodeInterpreter.cpp:
2260         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2261         Check and correctly handle rules with both resource-type and load-type flags.
2262         * loader/ResourceLoadInfo.h:
2263         Add masks to separate flags from resource-type and load-type.
2264
2265 2015-06-01  Alex Christensen  <achristensen@webkit.org>
2266
2267         [Content Extensions] Reduce DFA memory usage.
2268         https://bugs.webkit.org/show_bug.cgi?id=145526
2269
2270         Reviewed by Benjamin Poulain.
2271
2272         * contentextensions/DFA.cpp:
2273         (WebCore::ContentExtensions::DFA::memoryUsed):
2274         (WebCore::ContentExtensions::DFANode::transitions):
2275         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
2276         (WebCore::ContentExtensions::DFANode::changeFallbackTransition):
2277         (WebCore::ContentExtensions::DFANode::addFallbackTransition):
2278         (WebCore::ContentExtensions::DFANode::containsTransition):
2279         (WebCore::ContentExtensions::DFANode::kill):
2280         * contentextensions/DFA.h:
2281         * contentextensions/DFAMinimizer.cpp:
2282         (WebCore::ContentExtensions::DFAMinimizer::minimize):
2283         * contentextensions/NFAToDFA.cpp:
2284         (WebCore::ContentExtensions::NFAToDFA::convert):
2285         Use separate Vectors for the transition characters and destinations to avoid wasting memory to padding a std::pair.
2286
2287 2015-06-01  Matt Rajca  <mrajca@apple.com>
2288
2289         Implemented the `eventTargetInterface` and `scriptExecutionContext` methods required by EventTarget, as well as
2290         some required infrastructure.
2291         https://bugs.webkit.org/show_bug.cgi?id=145523
2292
2293         Reviewed by Eric Carlson.
2294
2295         * Modules/mediasession/MediaRemoteControls.cpp:
2296         (WebCore::MediaRemoteControls::MediaRemoteControls): Initialize all instance variables.
2297         * Modules/mediasession/MediaRemoteControls.h: MediaRemoteControl's constructor now takes a script execution
2298           context, which we provide to EventTarget. The required eventTargetInterface method has also been implemented.
2299         (WebCore::MediaRemoteControls::create):
2300         * Modules/mediasession/MediaRemoteControls.idl: Indicate MediaRemoteControls now takes a constructor that is
2301           passed in a script execution context. To prevent build errors, event handlers have been removed until they are
2302           implemented.
2303         * WebCore.xcodeproj/project.pbxproj: We should be building the derived JSMediaRemoteControls class with WebCore.
2304         * dom/EventTargetFactory.in: Ensure a MediaRemoteControlsEventTargetInterfaceType is generated.
2305
2306 2015-06-01  Benjamin Poulain  <bpoulain@apple.com>
2307
2308         [CSS JIT] Fail to compile when we are out of executable memory
2309         https://bugs.webkit.org/show_bug.cgi?id=145483
2310         rdar://problem/21166612
2311
2312         Reviewed by Andreas Kling.
2313
2314         We should use a soft failure when the Linker fails to allocate
2315         executable memory for the CSS JIT. We will just fallback to slow
2316         code when that happen, better slow CSS than crashing.
2317
2318         Credit to Chris for finding this problem.
2319
2320         * cssjit/SelectorCompiler.cpp:
2321         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2322
2323 2015-06-01  Chris Dumez  <cdumez@apple.com>
2324
2325         ASSERT(revalidatingResource.inCache()) in MemoryCache when reloading tumblr.com
2326         https://bugs.webkit.org/show_bug.cgi?id=145518
2327         <rdar://problem/21168573>
2328
2329         Reviewed by Darin Adler.
2330
2331         There was an assertion in MemoryCache::revalidationSucceeded() making
2332         sure that the resource that was revalidated is still in the memory
2333         cache. However, nothing prevents this resource from being pruned while
2334         it is being revalidated. We do make sure that the resource in question
2335         cannot be destroyed though (see CachedResource::canDelete()).
2336
2337         This patch gets rid of this assertion as it is incorrect. Also, the
2338         fact that the resource is no longer in the memory cache is not an
2339         issue. We are merely going to call MemoryCache::remove() to remove
2340         it from the memory cache before re-adding it and updating its
2341         HTTP response. The call to MemoryCache::remove() will simply be a
2342         no-op in this case and we will not have any problem adding the
2343         resource back to the memory cache because the resource is kept alive.
2344
2345         Test: http/tests/cache/memory-cache-pruning-during-revalidation.html
2346
2347         * loader/cache/MemoryCache.cpp:
2348         (WebCore::MemoryCache::revalidationSucceeded): Deleted.
2349
2350 2015-06-01  Matt Rajca  <mrajca@apple.com>
2351
2352         Add stub implementation of MediaRemoteControls, part of the Media Session spec.
2353         https://bugs.webkit.org/show_bug.cgi?id=145462
2354
2355         Reviewed by Eric Carlson.
2356
2357         * CMakeLists.txt: Added IDL file as well as the corresponding implementation file.
2358         * DerivedSources.make: Included the new IDL file.
2359         * Modules/mediasession/MediaRemoteControls.cpp: Added an empty implementation file.
2360         (MediaRemoteControls::~MediaRemoteControls):
2361         * Modules/mediasession/MediaRemoteControls.h: Added a stubbed header file with accessors for the four attributes declared in the IDL file.
2362         (WebCore::MediaRemoteControls::previousTrackEnabled):
2363         (WebCore::MediaRemoteControls::setPreviousTrackEnabled):
2364         (WebCore::MediaRemoteControls::nextTrackEnabled):
2365         (WebCore::MediaRemoteControls::setNextTrackEnabled):
2366         (WebCore::MediaRemoteControls::seekForwardEnabled):
2367         (WebCore::MediaRemoteControls::setSeekForwardEnabled):
2368         (WebCore::MediaRemoteControls::seekBackwardEnabled):
2369         (WebCore::MediaRemoteControls::setSeekBackwardEnabled):
2370         * Modules/mediasession/MediaRemoteControls.idl: Added from the Media Session spec.
2371         * WebCore.xcodeproj/project.pbxproj: Included the new IDL file and MediaRemoteControls.cpp/.h sources.
2372
2373 2015-06-01  Sergio Villar Senin  <svillar@igalia.com>
2374
2375         [CSS Grid Layout] Simplify the interface of GridResolvedPosition
2376         https://bugs.webkit.org/show_bug.cgi?id=139077
2377
2378         Reviewed by Darin Adler.
2379
2380         The interface of GridResolvedPosition is full of static methods
2381         that are used only internally, we should not expose them.
2382
2383         Apart from that resolveGridPositionsFromStyle() do always return
2384         a valid GridSpan from now on meaning that the caller has to ensure
2385         that the resolution does not require running the auto-placement
2386         algorithm. A new class called GridUnresolvedSpan was added for
2387         that purpose.
2388
2389         No new tests as this is a refactoring.
2390
2391         * rendering/RenderGrid.cpp:
2392         (WebCore::RenderGrid::placeItemsOnGrid):
2393         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2394         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2395         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2396         * rendering/style/GridPosition.h:
2397         * rendering/style/GridResolvedPosition.cpp:
2398         (WebCore::gridLinesForSide):
2399         (WebCore::implicitNamedGridLineForSide):
2400         (WebCore::isNonExistentNamedLineOrArea):
2401         (WebCore::GridUnresolvedSpan::requiresAutoPlacement):
2402         (WebCore::GridUnresolvedSpan::adjustGridPositionsFromStyle):
2403         (WebCore::adjustGridPositionForRowEndColumnEndSide):
2404         (WebCore::adjustGridPositionForSide):
2405         (WebCore::resolveNamedGridLinePositionFromStyle):
2406         (WebCore::firstNamedGridLineBeforePosition):
2407         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
2408         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
2409         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
2410         (WebCore::resolveGridPositionAgainstOppositePosition):
2411         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
2412         (WebCore::resolveGridPositionFromStyle):
2413         (WebCore::GridResolvedPosition::GridResolvedPosition):
2414         (WebCore::GridResolvedPosition::unresolvedSpanFromStyle):
2415         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
2416         (WebCore::GridResolvedPosition::adjustGridPositionsFromStyle): Deleted.
2417         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionFromStyle): Deleted.
2418         (WebCore::GridResolvedPosition::resolveGridPositionFromStyle): Deleted.
2419         (WebCore::GridResolvedPosition::resolveGridPositionAgainstOppositePosition): Deleted.
2420         (WebCore::GridResolvedPosition::resolveNamedGridLinePositionAgainstOppositePosition): Deleted.
2421         (WebCore::GridResolvedPosition::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition): Deleted.
2422         (WebCore::GridResolvedPosition::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition): Deleted.
2423         * rendering/style/GridResolvedPosition.h:
2424         (WebCore::GridUnresolvedSpan::GridUnresolvedSpan): New class.
2425         (WebCore::GridUnresolvedSpan::initialPosition):
2426         (WebCore::GridUnresolvedSpan::finalPosition):
2427         (WebCore::GridUnresolvedSpan::initialPositionSide):
2428         (WebCore::GridUnresolvedSpan::finalPositionSide):
2429         (WebCore::GridResolvedPosition::adjustGridPositionForRowEndColumnEndSide): Deleted.
2430         (WebCore::GridResolvedPosition::adjustGridPositionForSide): Deleted.
2431         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
2432
2433 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
2434
2435         Fix the !ENABLE(VIDEO_TRACK) build after r184799
2436         https://bugs.webkit.org/show_bug.cgi?id=145510
2437
2438         Reviewed by Eric Carlson.
2439
2440         * testing/Internals.cpp:
2441         (WebCore::Internals::userPreferredAudioCharacteristics):
2442         (WebCore::Internals::setUserPreferredAudioCharacteristic):
2443
2444 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
2445
2446         Fix logical-not-parentheses warning in CachedScript.cpp
2447         https://bugs.webkit.org/show_bug.cgi?id=145254
2448
2449         Reviewed by Sam Weinig.
2450
2451         * loader/cache/CachedScript.cpp:
2452         (WebCore::CachedScript::mimeTypeAllowedByNosniff): "!X==Y" should be "X!=Y" here.
2453
2454 2015-05-31  Dan Bernstein  <mitz@apple.com>
2455
2456         Remove Panther support
2457         https://bugs.webkit.org/show_bug.cgi?id=145506
2458
2459         Reviewed by Sam Weinig.
2460
2461         * platform/ios/wak/WAKAppKitStubs.h: Don't check for pre-Tiger SDKs.
2462
2463 2015-05-31  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2464
2465         Remove unused variable kZoomTicks.
2466         https://bugs.webkit.org/show_bug.cgi?id=145504
2467
2468         Reviewed by Sam Weinig.
2469
2470         No new tests, no behavior changes.
2471
2472         * platform/ScrollAnimatorNone.cpp:
2473
2474 2015-05-31  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2475
2476         Async XMLHttpRequest should get access to AppCache resources stored as flat files
2477         https://bugs.webkit.org/show_bug.cgi?id=138506
2478
2479         Reviewed by Darin Adler.
2480
2481         This patch reads flat file data when DocumentLoader substituteResource delivery timer is fired.
2482         Refactoring to remove ApplicationCacheHost/DocumentLoader friend link.
2483         Added ResourceLoader::deliverResponseAndData helper function, taking a SharedBuffer as input to remove an unneeded copy for flat files (no change for other files). 
2484
2485         Test: http/tests/appcache/simple-video-async.html
2486
2487         * loader/DocumentLoader.cpp:
2488         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
2489         (WebCore::DocumentLoader::scheduleArchiveLoad):
2490         (WebCore::DocumentLoader::scheduleSubstituteResourceLoad): Helper function to remove ApplicationCacheHost friend link.
2491         * loader/DocumentLoader.h:
2492         * loader/ResourceLoader.cpp:
2493         (WebCore::ResourceLoader::deliverResponseAndData): Helper function, code mostly moved from DocumentLoader::substituteResourceDeliveryTimerFired.
2494         * loader/ResourceLoader.h:
2495         * loader/SubstituteResource.h:
2496         (WebCore::SubstituteResource::deliver): Introduced to be overriden by ApplicationCacheResource to take care of flat file case.
2497         * loader/appcache/ApplicationCacheHost.cpp:
2498         (WebCore::ApplicationCacheHost::maybeLoadResource):
2499         (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
2500         * loader/appcache/ApplicationCacheResource.cpp:
2501         (WebCore::ApplicationCacheResource::deliver): Use SharedBuffer::createWithContentsOfFile to load data stored in flat file.
2502         * loader/appcache/ApplicationCacheResource.h:
2503
2504 2015-05-31  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2505
2506         [Streams API] Implement ReadableStreamController constructor
2507         https://bugs.webkit.org/show_bug.cgi?id=143752
2508
2509         Reviewed by Darin Adler.
2510
2511         Covered by rebased test and expectation.
2512
2513         * Modules/streams/ReadableStreamController.idl: Adding CustomConstructor.
2514         * bindings/js/JSReadableStreamControllerCustom.cpp:
2515         (WebCore::constructJSReadableStreamController): Throws an exception whenever called.
2516
2517 2015-05-30  Brady Eidson  <beidson@apple.com>
2518
2519         Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
2520         https://bugs.webkit.org/show_bug.cgi?id=145495
2521
2522         Reviewed by Alexey Proskuryakov.
2523
2524         No new tests (No change in behavior).
2525
2526         In most cases ownership of the Event is not actually being transferred, and these functions are all rarely called anyways.
2527         
2528         * html/HTMLLinkElement.cpp:
2529         (WebCore::HTMLLinkElement::handleClick):
2530         
2531         * loader/FrameLoader.cpp:
2532         (WebCore::FrameLoader::urlSelected):
2533         (WebCore::FrameLoader::loadFrameRequest):
2534         (WebCore::FrameLoader::loadURL):
2535         (WebCore::FrameLoader::loadPostRequest):
2536         * loader/FrameLoader.h:
2537
2538 2015-05-30  Andreas Kling  <akling@apple.com>
2539
2540         [iOS] Tiling coverage sometimes inflated by outdated scale factor.
2541         <https://webkit.org/b/145494>
2542         <rdar://problem/20989389>
2543
2544         Reviewed by Benjamin Poulain.
2545
2546         Have GraphicsLayerCA plumb the current contents scale through to TileController::adjustCoverageRect()
2547         instead of TileController getting it from TileGrid.
2548
2549         This avoids a situation where adjustCoverageRect() could cause temporarily oversized tiling coverage
2550         if called while TileGrid's content scale is outdated, and we're neither zooming or pinching, following
2551         a pinch zoom that increased the scale factor.
2552
2553         Specifically, if all the velocity data is zero, we pad the coverage rect by a horizontal and vertical
2554         margin computed like so:
2555
2556             margin = defaultTileSize / tileGrid.scale
2557
2558         If the actual scale is 5, but the TileGrid's outdated scale is e.g 0.8, you'll get a much larger
2559         margin than you really wanted. Then the whole thing gets scaled up by 5x later on, and we explode
2560         in a fiery feast of IOSurface allocations.
2561
2562         * platform/graphics/TiledBacking.h:
2563         * platform/graphics/ca/GraphicsLayerCA.cpp:
2564         (WebCore::GraphicsLayerCA::adjustCoverageRect):
2565         * platform/graphics/ca/TileController.cpp:
2566         (WebCore::TileController::computeTileCoverageRect):
2567         * platform/graphics/ca/TileController.h:
2568
2569 2015-05-30  Brady Eidson  <beidson@apple.com>
2570
2571         Fix Windows tests broken by r185007.
2572         https://bugs.webkit.org/show_bug.cgi?id=145472
2573
2574         Unreviewed. Discussed with Alexey Proskuryakov.
2575
2576         No new tests (Fixing the four broken ones should suffice).
2577
2578         The bug was that evaluating arguments in a method/constructor call has no guaranteed sequencing.
2579         
2580         Clang seems to always do LTR, allowing the PassRefPtr to be evaluated as a bool in the call to
2581         navigationType() before it is "consumed" by the PassRefPtr argument.
2582         
2583         In Visual Studio the PassRefPtr consumption happened before the bool evaluation, meaning `false`
2584         was always passed in to navigationType(), breaking the four tests.
2585         
2586         The fix? Using PassRefPtr here was silly in the first place.
2587         No ownership is being transferred.
2588         Raw pointers it is.
2589         
2590         * loader/FrameLoader.cpp:
2591         (WebCore::FrameLoader::loadURL):
2592         (WebCore::FrameLoader::loadPostRequest):
2593         * loader/NavigationAction.cpp:
2594
2595         (WebCore::NavigationAction::NavigationAction):
2596         * loader/NavigationAction.h: Nobody is actually transferring ownership of these Events.
2597           Raw pointers will work just fine, thanks.
2598
2599 2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
2600
2601         Unreviewed bindings test rebaseline after r185023.
2602
2603         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2604         (WebCore::isObservable): Deleted.
2605         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): Deleted.
2606
2607 2015-05-29  Andreas Kling  <akling@apple.com>
2608
2609         [iOS] Reduce tiling coverage when doing a pure pinch zoom with no panning.
2610         <https://webkit.org/b/145481>
2611         <rdar://problem/20989389>
2612
2613         Reviewed by Benjamin Poulain.
2614
2615         When we're zooming in with a pinch gesture but not panning the page
2616         at the same time, make the coverage rect be the visible rect.
2617
2618         This reduces memory pressure during zooming, especially on slower
2619         devices that struggle to keep up with the current viewport.
2620
2621         * platform/graphics/ca/TileController.cpp:
2622         (WebCore::TileController::computeTileCoverageRect):
2623
2624 2015-05-29  Keith Miller  <keith_miller@apple.com>
2625
2626         WeakMap reference w/ DOM element as key does not survive long enough.
2627         https://bugs.webkit.org/show_bug.cgi?id=137651
2628
2629         Reviewed by Geoffrey Garen.
2630
2631         Remove isObservable functions as an "unobservable wrappers"
2632         optimization is invalid with WeakMaps. Performance testing
2633         will be done after the code is commited. If major
2634         performance issues occur the patch will be rolled out.
2635
2636         Test: js/dom/weakmap-gc-unobservable-dom-nodes.html
2637
2638         * bindings/js/JSNodeCustom.cpp:
2639         (WebCore::isReachableFromDOM):
2640         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
2641         (WebCore::JSNode::insertBefore):
2642         (WebCore::isObservable): Deleted.
2643         * bindings/scripts/CodeGeneratorJS.pm:
2644         (GenerateImplementation):
2645
2646 2015-05-29  Anders Carlsson  <andersca@apple.com>
2647
2648         Get rid of WAKViewPrivate.h
2649         https://bugs.webkit.org/show_bug.cgi?id=145482
2650         rdar://problem/21162149
2651
2652         Reviewed by Dan Bernstein.
2653
2654         Merge WAKViewPrivate.h into WAKViewInternal.h and move the NSView sizing enum
2655         to WAKView.h since that was the only thing WebKit used (indirectly) from WAKViewPrivate.h.
2656
2657         * WebCore.xcodeproj/project.pbxproj:
2658         * platform/WAKViewInternal.h:
2659         (WAKViewForWKViewRef):
2660         * platform/ios/ScrollViewIOS.mm:
2661         * platform/ios/wak/WAKResponder.m:
2662         * platform/ios/wak/WAKView.h:
2663         * platform/ios/wak/WAKView.mm:
2664         * platform/ios/wak/WAKViewPrivate.h: Removed.
2665         (WAKViewForWKViewRef): Deleted.
2666         * platform/ios/wak/WAKWindow.mm:
2667         * platform/ios/wak/WKView.h:
2668         * platform/ios/wak/WKView.mm:
2669
2670 2015-05-29  Daniel Bates  <dabates@apple.com>
2671
2672         Clean up logic for updating caps lock indicator state
2673         https://bugs.webkit.org/show_bug.cgi?id=145329
2674
2675         Reviewed by Sam Weinig.
2676
2677         Remove logic to explicitly update the state of the caps lock indicator, which was used
2678         when the caps logic indicator was implemented as part of RenderTextControl. Currently,
2679         the caps logic indicator is implemented as part of a shadow DOM and we have existing
2680         logic to forward DOM focus and blur events to it so that it may update its state.
2681
2682         No change in behavior.
2683
2684         * editing/FrameSelection.cpp:
2685         (WebCore::FrameSelection::focusedOrActiveStateChanged): Deleted.
2686         * editing/FrameSelection.h:
2687         * page/EventHandler.cpp:
2688         (WebCore::EventHandler::keyEvent): Inline the code from EventHandler::capsLockStateMayHaveChanged()
2689         into this function because it is the only caller of EventHandler::capsLockStateMayHaveChanged() after
2690         we removed the call site in FrameSelection::focusedOrActiveStateChanged().
2691         (WebCore::EventHandler::capsLockStateMayHaveChanged): Deleted.
2692         * page/EventHandler.h:
2693
2694 2015-05-29  Zalan Bujtas  <zalan@apple.com>
2695
2696         Text disappears shortly after page load on Nexus 7 site.
2697         https://bugs.webkit.org/show_bug.cgi?id=145467
2698         rdar://problem/18327239
2699
2700         Reviewed by Simon Fraser.
2701
2702         This patch ensures that overlap testing for composited layers works properly when the sibling
2703         layer gets composited through its child.
2704
2705         When a layer gets composited through its child content, the recursive overlap testing should build up the
2706         overlapmap stack so that sibling content is intersected both against the child and its parent bounds.
2707
2708         Tests: compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html
2709                compositing/sibling-layer-does-not-get-composited-transform-case.html
2710
2711         * rendering/RenderLayerCompositor.cpp:
2712         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2713         (WebCore::RenderLayerCompositor::OverlapMap::contains): Deleted.
2714
2715 2015-05-29  Brady Eidson  <beidson@apple.com>
2716
2717         Review feedback followup for r185003.
2718         https://bugs.webkit.org/show_bug.cgi?id=145463
2719
2720         Reviewed by Darin Adler.
2721
2722         * platform/sql/SQLiteDatabase.cpp:
2723         (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): `static const` one thing, c++-style cast another.
2724
2725 2015-05-29  Chris Dumez  <cdumez@apple.com>
2726
2727         WebContent crash in WebCore::Page::sessionID() const + 0 (Page.cpp:1660)
2728         https://bugs.webkit.org/show_bug.cgi?id=145422
2729         <rdar://problem/20613631>
2730
2731         Reviewed by Brady Eidson.
2732
2733         We sometimes crash when destroying a PageCache CachedFrame because its
2734         DocumentLoader is still loading. This should never happen as we are not
2735         supposed to let pages are still have pending loads into the PageCache.
2736
2737         However, we were using DocumentLoader::isLoadingInAPISense() as check
2738         in PageCache::canCachePageContainingThisFrame() which is not exactly
2739         what we want. isLoadingInAPISense() no longer considers subresource
2740         loads once the frame as loaded. This means if the JS triggers a new
2741         load in a subframe after it has been loaded, then isLoadingInAPISense()
2742         will return false, despite the pending load.
2743
2744         This patch replaces the isLoadingInAPISense() check with isLoading()
2745         as this will consider all pending loads, even after the frame is
2746         loaded.
2747
2748         In most cases, using isLoadingInAPISense() was not an issue because
2749         we call DocumentLoader::stopLoading() in all subframes before starting
2750         a provisional load. However, nothing seems to prevent JS from
2751         triggering a new load after that and before the new load gets committed
2752         (which is when we save the page into PageCache).
2753
2754         No new test as we don't have a reliable reproduction case and the
2755         issue is timing related.
2756
2757         * history/PageCache.cpp:
2758         (WebCore::logCanCacheFrameDecision):
2759         (WebCore::PageCache::canCachePageContainingThisFrame):
2760         * page/DiagnosticLoggingKeys.cpp:
2761         (WebCore::DiagnosticLoggingKeys::isLoading):
2762         (WebCore::DiagnosticLoggingKeys::loadingAPISenseKey): Deleted.
2763         * page/DiagnosticLoggingKeys.h:
2764
2765 2015-05-29  Chris Dumez  <cdumez@apple.com>
2766
2767         Consider throttling DOM timers in iframes outside the viewport
2768         https://bugs.webkit.org/show_bug.cgi?id=145465
2769         <rdar://problem/20768957>
2770
2771         Reviewed by Darin Adler.
2772
2773         Throttle DOM timers in iframes that are outside the viewport to decrease
2774         CPU usage, improve performance and reduce power use.
2775
2776         The approach is similar to what we already did for requestAnimationFrame
2777         in r183998.
2778
2779         We already has support for throttling DOM timers at:
2780         - Page level: for backgound pages
2781         - DOM timer level: for timers changing the style of an element outside
2782           the viewport or drawing on a canvas outside the viewport.
2783
2784         This patch adds support for throttling DOM timers at Document level so
2785         we can throttle all timers inside a specific iframe / Document. It relies
2786         on the same timerAlignmentInterval that is used for throttling at Page
2787         level with tweaks so that different Documents inside the same Page can
2788         have a different timerAlignmentInterval.
2789
2790         Test: fast/dom/timer-throttling-subframe.html
2791
2792         * dom/Document.cpp:
2793         (WebCore::Document::setTimerThrottlingEnabled):
2794         (WebCore::Document::timerAlignmentInterval):
2795         * dom/Document.h:
2796         (WebCore::Document::isTimerThrottlingEnabled):
2797         * page/DOMTimer.cpp:
2798         (WebCore::DOMTimer::alignedFireTime):
2799         The previous code was not throttling the timer if its fireTime was in
2800         the past. This was causing some aggressive timers on mashable.com to
2801         not be throttled so I got rid of this behavior. I don't see any reason
2802         why we would not throttle a timer simply because it is supposed to have
2803         fired already.
2804
2805         * page/FrameView.cpp:
2806         (WebCore::FrameView::viewportContentsChanged):
2807         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
2808         * page/FrameView.h:
2809
2810         * testing/Internals.cpp:
2811         (WebCore::Internals::areTimersThrottled):
2812         * testing/Internals.h:
2813         * testing/Internals.idl:
2814         Add API to facilitate layout testing of this functionality.
2815
2816 2015-05-29  Brady Eidson  <beidson@apple.com>
2817
2818         NavigationAction constructor cleanup.
2819         https://bugs.webkit.org/show_bug.cgi?id=145472
2820
2821         Reviewed by Alex Christensen.
2822
2823         No new tests (Refactor, no change in behavior).
2824
2825         * loader/NavigationAction.cpp:
2826         (WebCore::NavigationAction::NavigationAction): Delegate many of the various constructors
2827           to a single full-featured constructor.
2828         * loader/NavigationAction.h:
2829
2830 2015-05-29  Matt Rajca  <mrajca@apple.com>
2831
2832         Rename MediaSession and MediaSessionClient to PlatformMediaSession and PlatformMediaSessionClient so we can use MediaSession for the formal implementation of the Media Session spec.
2833         https://bugs.webkit.org/show_bug.cgi?id=145447
2834
2835         Reviewed by Eric Carlson.
2836
2837         * Modules/webaudio/AudioContext.cpp:
2838         (WebCore::AudioContext::AudioContext):
2839         (WebCore::AudioContext::suspendPlayback):
2840         * Modules/webaudio/AudioContext.h:
2841         * WebCore.vcxproj/WebCore.vcxproj:
2842         * WebCore.vcxproj/WebCore.vcxproj.filters:
2843         * WebCore.xcodeproj/project.pbxproj:
2844         * html/HTMLAudioElement.h:
2845         * html/HTMLMediaElement.cpp:
2846         (WebCore::HTMLMediaElement::pausedForUserInteraction):
2847         (WebCore::HTMLMediaElement::mediaType):
2848         (WebCore::HTMLMediaElement::presentationType):
2849         (WebCore::HTMLMediaElement::displayType):
2850         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
2851         * html/HTMLMediaElement.h:
2852         * html/HTMLMediaSession.cpp:
2853         (WebCore::HTMLMediaSession::HTMLMediaSession):
2854         (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback):
2855         * html/HTMLMediaSession.h:
2856         * html/HTMLVideoElement.h:
2857         * platform/RemoteCommandListener.h:
2858         * platform/audio/MediaSessionManager.cpp:
2859         (WebCore::MediaSessionManager::resetRestrictions):
2860         (WebCore::MediaSessionManager::has):
2861         (WebCore::MediaSessionManager::activeAudioSessionRequired):
2862         (WebCore::MediaSessionManager::count):
2863         (WebCore::MediaSessionManager::beginInterruption):
2864         (WebCore::MediaSessionManager::endInterruption):
2865         (WebCore::MediaSessionManager::addSession):
2866         (WebCore::MediaSessionManager::removeSession):
2867         (WebCore::MediaSessionManager::addRestriction):
2868         (WebCore::MediaSessionManager::removeRestriction):
2869         (WebCore::MediaSessionManager::restrictions):
2870         (WebCore::MediaSessionManager::sessionWillBeginPlayback):
2871         (WebCore::MediaSessionManager::sessionWillEndPlayback):
2872         (WebCore::MediaSessionManager::setCurrentSession):
2873         (WebCore::MediaSessionManager::currentSession):
2874         (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
2875         (WebCore::MediaSessionManager::sessionCanLoadMedia):
2876         (WebCore::MediaSessionManager::applicationWillEnterBackground):
2877         (WebCore::MediaSessionManager::applicationWillEnterForeground):
2878         (WebCore::MediaSessionManager::didReceiveRemoteControlCommand):
2879         (WebCore::MediaSessionManager::systemWillSleep):
2880         (WebCore::MediaSessionManager::systemDidWake):
2881         * platform/audio/MediaSessionManager.h:
2882         (WebCore::MediaSessionManager::sessions):
2883         * platform/audio/PlatformMediaSession.cpp: Renamed from Source/WebCore/platform/audio/MediaSession.cpp.
2884         (WebCore::stateName):
2885         (WebCore::PlatformMediaSession::create):
2886         (WebCore::PlatformMediaSession::PlatformMediaSession):
2887         (WebCore::PlatformMediaSession::~PlatformMediaSession):
2888         (WebCore::PlatformMediaSession::setState):
2889         (WebCore::PlatformMediaSession::beginInterruption):
2890         (WebCore::PlatformMediaSession::endInterruption):
2891         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
2892         (WebCore::PlatformMediaSession::clientWillPausePlayback):
2893         (WebCore::PlatformMediaSession::pauseSession):
2894         (WebCore::PlatformMediaSession::mediaType):
2895         (WebCore::PlatformMediaSession::presentationType):
2896         (WebCore::PlatformMediaSession::title):
2897         (WebCore::PlatformMediaSession::duration):
2898         (WebCore::PlatformMediaSession::currentTime):
2899         (WebCore::PlatformMediaSession::canReceiveRemoteControlCommands):
2900         (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand):
2901         (WebCore::PlatformMediaSession::visibilityChanged):
2902         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
2903         (WebCore::PlatformMediaSession::updateClientDataBuffering):
2904         (WebCore::PlatformMediaSession::isHidden):
2905         (WebCore::PlatformMediaSession::displayType):
2906         (WebCore::PlatformMediaSessionClient::mediaSessionTitle):
2907         (WebCore::PlatformMediaSessionClient::mediaSessionDuration):
2908         (WebCore::PlatformMediaSessionClient::mediaSessionCurrentTime):
2909         * platform/audio/PlatformMediaSession.h: Renamed from Source/WebCore/platform/audio/MediaSession.h.
2910         (WebCore::PlatformMediaSession::state):
2911         (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget):
2912         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget):
2913         (WebCore::PlatformMediaSession::requiresPlaybackTargetRouteMonitoring):
2914         (WebCore::PlatformMediaSession::client):
2915         (WebCore::PlatformMediaSessionClient::PlatformMediaSessionClient):
2916         (WebCore::PlatformMediaSessionClient::displayType):
2917         (WebCore::PlatformMediaSessionClient::setShouldBufferData):
2918         (WebCore::PlatformMediaSessionClient::elementIsHidden):
2919         (WebCore::PlatformMediaSessionClient::wirelessRoutesAvailableDidChange):
2920         (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
2921         (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget):
2922         (WebCore::PlatformMediaSessionClient::isPlayingToWirelessPlaybackTarget):
2923         (WebCore::PlatformMediaSessionClient::setShouldPlayToPlaybackTarget):
2924         (WebCore::PlatformMediaSessionClient::~PlatformMediaSessionClient):
2925         * platform/audio/ios/MediaSessionManagerIOS.h:
2926         * platform/audio/ios/MediaSessionManagerIOS.mm:
2927         (WebCore::MediaSessionManageriOS::resetRestrictions):
2928         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
2929         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
2930         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
2931         (WebCore::MediaSessionManageriOS::sessionCanLoadMedia):
2932         (-[WebMediaSessionHelper interruption:]):
2933         * platform/audio/mac/MediaSessionManagerMac.cpp:
2934         (MediaSessionManager::updateSessionState):
2935         * platform/graphics/MediaPlayer.cpp:
2936         (WebCore::MediaPlayer::handlePlaybackCommand):
2937         * platform/graphics/MediaPlayer.h:
2938         (WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand):
2939         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2940         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
2941         * platform/ios/RemoteCommandListenerIOS.mm:
2942         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
2943         * testing/Internals.cpp:
2944         (WebCore::Internals::beginMediaSessionInterruption):
2945         (WebCore::Internals::endMediaSessionInterruption):
2946         (WebCore::Internals::setMediaSessionRestrictions):
2947         (WebCore::Internals::postRemoteControlCommand):
2948
2949 2015-05-29  Alex Christensen  <achristensen@webkit.org>
2950
2951         [Content Extensions] Decrease maxNFASize
2952         https://bugs.webkit.org/show_bug.cgi?id=145461
2953
2954         Reviewed by Gavin Barraclough.
2955
2956         * contentextensions/ContentExtensionCompiler.cpp:
2957         (WebCore::ContentExtensions::compileRuleList):
2958         Decrease maxNFASize based on analysis of memory usage and compiling and interpreting time.
2959
2960 2015-05-29  Brady Eidson  <beidson@apple.com>
2961
2962         WebSQL default functions can bypass authorizer.
2963         <rdar://problem/21048994> and https://bugs.webkit.org/show_bug.cgi?id=145463
2964
2965         Reviewed by Sam Weinig and Alexey Proskuryakov.
2966
2967         No new tests yet.
2968
2969         * platform/sql/SQLiteDatabase.cpp:
2970         (WebCore::unauthorizedSQLFunction): Function to install into SQLite to override some built-in functions.
2971         (WebCore::SQLiteDatabase::open):
2972         (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): Install function overrides for functions that
2973            take arbitrary input that are also meant to be disabled by virtue of them not being whitelisted.
2974         * platform/sql/SQLiteDatabase.h:
2975
2976 2015-05-29  Roger Fong  <roger_fong@apple.com>
2977
2978         Unreviewed. Shift fullscreen controls down 20px.
2979         <rdar://problem/21161523>
2980
2981         * Modules/mediacontrols/mediaControlsApple.css:
2982         (video:-webkit-full-screen::-webkit-media-controls-panel):
2983         Fullscreen control panel is too high and overlaps with caption menu.
2984         Shift it down 20px.
2985
2986 2015-05-28  Simon Fraser  <simon.fraser@apple.com>
2987
2988         Some assertion failures in compositing code after r183820
2989         https://bugs.webkit.org/show_bug.cgi?id=144630
2990
2991         Reviewed by Alexey Proskuryakov.
2992
2993         Reinstate the assertion commented out in r183843. Fixed by having blending no longer
2994         escape the media elements, which was fixed via bug 145420.
2995
2996         * rendering/RenderLayerCompositor.cpp:
2997         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2998
2999 2015-05-29  Hunseop Jeong  <hs85.jeong@samsung.com>
3000
3001         Use modern for-loops in WebCore/plugins, storage, style, testing and workers.
3002         https://bugs.webkit.org/show_bug.cgi?id=145425
3003
3004         Reviewed by Darin Adler.
3005
3006         No new tests, no behavior changes.
3007
3008         * plugins/DOMMimeTypeArray.cpp:
3009         (WebCore::DOMMimeTypeArray::canGetItemsForName):
3010         * plugins/DOMPlugin.cpp:
3011         (WebCore::DOMPlugin::canGetItemsForName):
3012         * plugins/DOMPluginArray.cpp:
3013         (WebCore::DOMPluginArray::canGetItemsForName):
3014         * plugins/PluginData.cpp:
3015         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
3016         * plugins/PluginMainThreadScheduler.cpp:
3017         (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin):
3018         (WebCore::PluginMainThreadScheduler::dispatchCalls):
3019         * storage/StorageEventDispatcher.cpp:
3020         (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
3021         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
3022         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
3023         * storage/StorageMap.cpp:
3024         (WebCore::StorageMap::importItems):
3025         * style/StyleResolveTree.cpp:
3026         (WebCore::Style::pseudoStyleCacheIsInvalid):
3027         * testing/Internals.cpp:
3028         (WebCore::Internals::nodesFromRect):
3029         * workers/Worker.cpp:
3030         (WebCore::networkStateChanged):
3031         * workers/WorkerGlobalScope.cpp:
3032         (WebCore::WorkerGlobalScope::importScripts):
3033
3034 2015-05-29  Alex Christensen  <achristensen@webkit.org>
3035
3036         Unreviewed build fix when using content extensions debugging.
3037
3038         * contentextensions/ContentExtensionCompiler.cpp:
3039         (WebCore::ContentExtensions::compileRuleList):
3040         Update variable name.
3041
3042 2015-05-29  Brady Eidson  <beidson@apple.com>
3043
3044         Typo followup to r184987
3045
3046         Unreviewed.
3047
3048         * loader/FrameLoader.cpp:
3049         (WebCore::FrameLoader::loadURLIntoChildFrame): Misplaced brace.
3050
3051 2015-05-29  Brady Eidson  <beidson@apple.com>
3052
3053         Small FrameLoader refactoring.
3054         https://bugs.webkit.org/show_bug.cgi?id=145459
3055
3056         Reviewed by Alex Christensen.
3057
3058         No new tests (No behavior change).
3059
3060         * loader/FrameLoader.cpp:
3061         (WebCore::FrameLoader::loadURLIntoChildFrame):
3062         (WebCore::FrameLoader::loadFrameRequest):
3063         (WebCore::FrameLoader::loadURL):
3064         (WebCore::FrameLoader::loadPostRequest):
3065         * loader/FrameLoader.h:
3066
3067 2015-05-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3068
3069         MediaDevices.getUserMedia should reject promise instead of throwing exceptions
3070         https://bugs.webkit.org/show_bug.cgi?id=145282
3071
3072         Reviewed by Darin Adler.
3073
3074         Ensuring at the custom binding level that all potential errors are used to reject promise.
3075         Cleaned up the wrappers by removing unneeded RefPtr.
3076
3077         Covered by modified test.
3078
3079         * Modules/mediastream/MediaDevices.cpp:
3080         (WebCore::MediaDevices::getUserMedia):
3081         * Modules/mediastream/MediaDevices.h:
3082         * Modules/mediastream/UserMediaRequest.cpp:
3083         (WebCore::UserMediaRequest::create):
3084         * bindings/js/JSMediaDevicesCustom.cpp:
3085         (WebCore::JSMediaDevices::getUserMedia):
3086
3087 2015-05-28  Hunseop Jeong  <hs85.jeong@samsung.com>
3088
3089         Replaced 0 with nullptr in WebCore/accessibility.
3090         https://bugs.webkit.org/show_bug.cgi?id=145309
3091
3092         Reviewed by Chris Fleizach.
3093
3094         No new tests, no behavior change.
3095
3096         * accessibility/AccessibilityRenderObject.cpp:
3097         (WebCore::AccessibilityRenderObject::mathPrescripts):
3098         (WebCore::AccessibilityRenderObject::mathPostscripts):
3099         * accessibility/AccessibilityScrollView.cpp:
3100         (WebCore::AccessibilityScrollView::scrollBar):
3101         * accessibility/atk/AXObjectCacheAtk.cpp:
3102         (WebCore::notifyChildrenSelectionChange):
3103         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
3104         (webkitAccessibleHyperlinkInit):
3105         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
3106         (webkitAccessibleDocumentGetAttributes):
3107         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3108         (getAttributeSetForAccessibilityObject):
3109         (attributeSetDifference):
3110         * accessibility/atk/WebKitAccessibleUtil.h:
3111         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3112         (webkitAccessibleRefChild):
3113         (webkitAccessibleGetAttributes):
3114         (webkitAccessibleGetObjectLocale):
3115         (getInterfaceMaskFromObject):
3116         (objectFocusedAndCaretOffsetUnignored):
3117         (cacheAndReturnAtkProperty):
3118
3119 2015-05-28  Zalan Bujtas  <zalan@apple.com>
3120
3121         Subpixel rendering: Pixel crack in text selection of simple text in <textarea>.
3122         https://bugs.webkit.org/show_bug.cgi?id=145393
3123         rdar://problem/19918941
3124
3125         Reviewed by Darin Adler.
3126
3127         Float to LayoutUnit conversion is lossy. To ensure that selection
3128         painting always lines up (snaps) properly, the calculated width needs to
3129         be adjusted by ceiling the float to the next LayoutUnit value.
3130
3131         Test: fast/text/hidpi-text-selection-gap-between-words.html
3132
3133         * platform/graphics/FontCascade.cpp:
3134         (WebCore::FontCascade::adjustSelectionRectForSimpleText):
3135         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3136         (WebCore::FontCascade::adjustSelectionRectForComplexText):
3137
3138 2015-05-28  Andreas Kling  <akling@apple.com>
3139
3140         GraphicsLayerCA should start out with m_intersectsCoverageRect=false
3141         <https://webkit.org/b/145443>
3142         <rdar://problem/19685798>
3143
3144         Reviewed by Simon Fraser.
3145
3146         Since the coverage rect of a newly-constructed GraphicsLayerCA is always empty,
3147         there's no way that the layer's own bounding box can intersect with it.
3148         Hence the m_intersectsCoverageRect flag should be false after construction.
3149
3150         This fixes an issue where compositing layers in subframes would be marked as
3151         non-volatile, despite being far outside the viewport and coverage rect.
3152
3153         Test: compositing/visible-rect/iframe-with-layers-outside-viewport.html
3154
3155         * platform/graphics/ca/GraphicsLayerCA.cpp:
3156         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
3157
3158 2015-05-28  Commit Queue  <commit-queue@webkit.org>
3159
3160         Unreviewed, rolling out r184796 and r184832.
3161         https://bugs.webkit.org/show_bug.cgi?id=145449
3162
3163         2% performance regression (Requested by litherum on #webkit).
3164
3165         Reverted changesets:
3166
3167         "[Cocoa] Use CTFontDrawGlyphs() instead of
3168         CGContextShowGlyphsWithAdvances()/CGContextShowGlyphsAtPositions()"
3169         https://bugs.webkit.org/show_bug.cgi?id=145234
3170         http://trac.webkit.org/changeset/184796
3171
3172         "Cleanup after r184796"
3173         https://bugs.webkit.org/show_bug.cgi?id=145333
3174         http://trac.webkit.org/changeset/184832
3175
3176 2015-05-28  Matt Rajca  <mrajca@apple.com>
3177
3178         Rename HTMLMediaSession to MediaElementSession to reserve "media session" for the Media Session API.
3179         https://bugs.webkit.org/show_bug.cgi?id=145440
3180
3181         Reviewed by Eric Carlson.
3182
3183         * CMakeLists.txt:
3184         * WebCore.vcxproj/WebCore.vcxproj:
3185         * WebCore.vcxproj/WebCore.vcxproj.filters:
3186         * WebCore.xcodeproj/project.pbxproj:
3187         * html/HTMLMediaElement.cpp:
3188         (WebCore::HTMLMediaElement::HTMLMediaElement):
3189         (WebCore::HTMLMediaElement::loadInternal):
3190         (WebCore::HTMLMediaElement::loadResource):
3191         (WebCore::HTMLMediaElement::suspend):
3192         (WebCore::HTMLMediaElement::resume):
3193         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
3194         (WebCore::HTMLMediaElement::mediaState):
3195         * html/HTMLMediaElement.h:
3196         (WebCore::HTMLMediaElement::mediaSession):
3197         * html/MediaElementSession.cpp: Renamed from Source/WebCore/html/HTMLMediaSession.cpp.
3198         (WebCore::restrictionName):
3199         (WebCore::MediaElementSession::MediaElementSession):
3200         (WebCore::MediaElementSession::registerWithDocument):
3201         (WebCore::MediaElementSession::unregisterWithDocument):
3202         (WebCore::MediaElementSession::addBehaviorRestriction):
3203         (WebCore::MediaElementSession::removeBehaviorRestriction):
3204         (WebCore::MediaElementSession::playbackPermitted):
3205         (WebCore::MediaElementSession::dataLoadingPermitted):
3206         (WebCore::MediaElementSession::fullscreenPermitted):
3207         (WebCore::MediaElementSession::pageAllowsDataLoading):
3208         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming):
3209         (WebCore::MediaElementSession::showPlaybackTargetPicker):
3210         (WebCore::MediaElementSession::hasWirelessPlaybackTargets):
3211         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
3212         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
3213         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
3214         (WebCore::MediaElementSession::setPlaybackTarget):
3215         (WebCore::MediaElementSession::targetAvailabilityChangedTimerFired):
3216         (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
3217         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget):
3218         (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget):
3219         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
3220         (WebCore::MediaElementSession::mediaStateDidChange):
3221         (WebCore::MediaElementSession::effectivePreloadForElement):
3222         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
3223         (WebCore::MediaElementSession::mediaEngineUpdated):
3224         (WebCore::MediaElementSession::allowsAlternateFullscreen):
3225         (WebCore::MediaElementSession::maximumMediaSourceBufferSize):
3226         * html/MediaElementSession.h: Renamed from Source/WebCore/html/HTMLMediaSession.h.
3227         * testing/Internals.cpp:
3228         (WebCore::Internals::setMediaElementRestrictions):
3229         (WebCore::Internals::setAudioContextRestrictions):
3230
3231 2015-05-28  Myles C. Maxfield  <mmaxfield@apple.com>
3232
3233         Crash under ICU with ASAN during editing/selection/move-by-word-visually-crash-test-5.html
3234         https://bugs.webkit.org/show_bug.cgi?id=145429
3235         <rdar://problem/20992218>
3236
3237         Reviewed by Alexey Proskuryakov.
3238
3239         WebKit uses some strings which contain the lower 8-bits of UTF-16 (thereby saving space). However,
3240         ICU doesn't understand this encoding. When we want to use ICU functions with strings in this encoding,
3241         we create a UTextProvider which converts our encoded strings to UTF-16 for ICU, one chunk at a time.
3242         This object contains a vtable which we populate to perform the conversion.
3243
3244         The WebKit function which actually returns the UTF-16 chunks has two relevant arguments: an index into
3245         the encoded string which ICU is requesting, and a direction from that index which ICU is interested
3246         in. This function populates a "chunk" which is characterized by a pointer to a buffer, the length of
3247         the populated data in the buffer, and an offset into the chunk which represents the index that the
3248         requested character was put into.
3249
3250         When ICU requests data going backward, we fill in the chunk accordingly, with the requested character
3251         all the way at the end. We then set the offset equal to the length of the buffer. However, this length
3252         value is stale from the previous time the function ran. Therefore, ICU was reading the wrong index in
3253         the chunk when expecting the requested character.
3254
3255         Covered by editing/selection/move-by-word-visually-crash-test-5.html.
3256
3257         * platform/text/icu/UTextProviderLatin1.cpp:
3258         (WebCore::uTextLatin1Access):
3259
3260 2015-05-28  Eric Carlson  <eric.carlson@apple.com>
3261
3262         [iOS] Fix controls bug caused by r184794
3263         https://bugs.webkit.org/show_bug.cgi?id=145445
3264
3265         Reviewed by Dean Jackson.
3266
3267         * Modules/mediacontrols/mediaControlsiOS.js:
3268         (ControllerIOS.prototype.showControls): Check video.controls instead of trying to call
3269         showInlinePlaybackPlaceholderOnly, which doesn't exist.
3270
3271 2015-05-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
3272
3273         Code clean up for extracting information from the mix of WritingMode and TextDirection
3274         https://bugs.webkit.org/show_bug.cgi?id=143399
3275
3276         Reviewed by Darin Adler.
3277         
3278         There should be eight TextFlows. A TextFlow consists of two directions.
3279         The first one controls the inline growing direction and the second one
3280         controls the block growing direction. We are going to use the cardinal
3281         directions to define these combinations.
3282
3283         We need to extract the following information easily from the TextFlow
3284
3285         -- isTextFlowReversed() // RTL
3286         -- isTextFlowFlipped()  // the opposite direction to normal
3287         -- isTextFlowVertical() // The line grows vertically
3288         
3289         Mixing WritingMode and TextDirection into TextFlow and choosing their values
3290         carefully to ease implementing the above functions can make things clearer.
3291
3292         * Modules/notifications/Notification.h:
3293         * platform/graphics/TextRun.h:
3294         * platform/ios/SelectionRect.h:
3295         * platform/text/BidiResolver.h:
3296         * platform/text/StringWithDirection.h:
3297         * platform/text/TextFlags.h:
3298         (WebCore::isLeftToRightDirection): Deleted.
3299         enum TextDirection is moved from TextFlags.h to WritingMode.h. So include
3300         WritingMode.h instead of including TextFlags.h.
3301         
3302         * css/CSSProperty.cpp:
3303         (WebCore::resolveToPhysicalProperty): Instead of handling the eight possible
3304         cases of the text flows one by one, we can map from a LogicalSide to a
3305         PhysicalSide using the TextFlow value.
3306         
3307         * platform/LengthBox.h:
3308         (WebCore::BoxExtent::before):
3309         (WebCore::BoxExtent::after):
3310         (WebCore::BoxExtent::start):
3311         (WebCore::BoxExtent::end):
3312         Use mapLogicalSideToPhysicalSide() to convert from a LogicalSide to a PhysicalSide.
3313         
3314         * platform/text/WritingMode.h:
3315         (WebCore::isLeftToRightDirection): Usually the default enum is defined
3316         first. And usually the default value is equal to zero. Since LTR is the
3317         default for the text direction, it should be defined before RTL.
3318         
3319         (WebCore::makeTextFlow): Returns a TextFlow given a WritingMode and a
3320         TextDirection.
3321         
3322         (WebCore::isReversedTextFlow): Returns true if the text direction is RTL.
3323         
3324         (WebCore::isFlippedTextFlow):
3325         (WebCore::isFlippedWritingMode): Returns true if the block growing direction
3326         is in the opposite direction of normal.
3327         
3328         (WebCore::isVerticalTextFlow):
3329         (WebCore::isVerticalWritingMode): Returns true if the line grows vertically.
3330                
3331         (WebCore::isHorizontalWritingMode):
3332         (WebCore::isFlippedLinesWritingMode): Use isVerticalWritingMode() and 
3333         isFlippedWritingMode() to answer these questions.
3334         
3335         (WebCore::isHorizontalPhysicalSide): 
3336         (WebCore::mirrorPhysicalSide): top <-> bottom and left <-> right conversion.
3337         (WebCore::rotatePhysicalSide): top <-> left and right <-> bottom conversion.
3338         
3339         (WebCore::mapLogicalSideToPhysicalSide): Maps a LogicalSide to a PhysicalSide
3340         using either the TextFlow or the WritingMode.
3341         
3342         (WebCore::isFlippedBlocksWritingMode): Deleted.
3343         * rendering/RenderMultiColumnSet.cpp:
3344         (WebCore::RenderMultiColumnSet::collectLayerFragments):
3345         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
3346         * rendering/shapes/Shape.cpp:
3347         (WebCore::physicalRectToLogical):
3348         (WebCore::physicalPointToLogical):
3349         * rendering/style/RenderStyle.h:
3350         Rename isFlippedBlocksWritingMode() to be isFlippedWritingMode() so we can
3351         be consistent with other WritingMode query functions.
3352
3353 2015-05-28  Matt Rajca  <mrajca@apple.com>
3354
3355         Add ENABLE_MEDIA_SESSION feature flag (which is off by default).
3356         https://bugs.webkit.org/show_bug.cgi?id=145415
3357
3358         Reviewed by Eric Carlson.
3359
3360         * Configurations/FeatureDefines.xcconfig:
3361
3362 2015-05-28  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3363
3364         [Streams API] ReadableStreamReader should not be exposed
3365         https://bugs.webkit.org/show_bug.cgi?id=143564
3366
3367         Reviewed by Darin Adler.
3368
3369         Covered by rebased tests.
3370
3371         * Modules/streams/ReadableStreamReader.idl: Adding NoInterfaceObject to ReadableStreamReader.idl.
3372
3373 2015-05-28  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3374
3375         [CMake] Improve detection and usage of GL/GLES/EGL libraries.
3376         https://bugs.webkit.org/show_bug.cgi?id=145408
3377
3378         Reviewed by Carlos Garcia Campos.
3379
3380         No new tests, no behavior changes.
3381
3382         * CMakeLists.txt: Ensure that we include the libraries and includes
3383         for the GL/GLESv2/EGL libraries before including the ANGLE directories.
3384         Define also any CFLAG that the system GL/GLESv2/EGL libraries may need.
3385         * PlatformEfl.cmake: Remove some includes that are now unneeded,
3386         because we are including now the EGL libraries on CMakeLists.txt
3387         * PlatformGTK.cmake: Remove unneeded include (We are including the EGL
3388         libraries now on CMakeLists.txt)
3389
3390 2015-05-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3391
3392         Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
3393         https://bugs.webkit.org/show_bug.cgi?id=145016
3394
3395         Reviewed by Darin Adler.
3396
3397         Updated code generator to generate the necessary declarations (constructor property in the prototype, the constructor class).
3398         In the case of CustomConstructor with NoInterfaceObject, the implementation of the constructor property related JS function is changed as follow:
3399         It creates a constructor object and shadows the constructor property JS function with this object.
3400         This ensures that only one constructor object is created per prototype.
3401         The constructor is not exposed as it is not added to the global object constructor map.
3402
3403         NoInterfaceObject is asking to not make the interface visible, which is contradictory with having a visible constructor of the interface.
3404         The case for having NoInterfaceObject and CustomConstructor is the following:
3405         We do not want to expose the interface but we still want to have a constructor property on the prototype of objects implementing the interface.
3406         One such case is https://streams.spec.whatwg.org/#globals
3407
3408         Added TestCustomConstructorWithNoInterfaceObject.idl to check that case.
3409
3410         * bindings/scripts/CodeGeneratorJS.pm:
3411         (GenerateHeader):
3412         (GenerateAttributesHashTable):
3413         (GenerateImplementation):
3414         (HasConstructorProperty):
3415         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp: Added.
3416         (WebKit::kit):
3417         (WebKit::core):
3418         (WebKit::wrapTestCustomConstructorWithNoInterfaceObject):
3419         (webkit_dom_test_custom_constructor_with_no_interface_object_finalize):
3420         (webkit_dom_test_custom_constructor_with_no_interface_object_constructor):
3421         (webkit_dom_test_custom_constructor_with_no_interface_object_class_init):
3422         (webkit_dom_test_custom_constructor_with_no_interface_object_init):
3423         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h: Added.
3424         * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h: Added.
3425         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Added.
3426         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::create):
3427         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::createStructure):
3428         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::JSTestCustomConstructorWithNoInterfaceObjectPrototype):
3429         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
3430         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure):
3431         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
3432         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
3433         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
3434         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
3435         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
3436         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype):
3437         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype):
3438         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy):
3439         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
3440         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
3441         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getConstructor):
3442         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
3443         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
3444         (WebCore::toJS):
3445         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
3446         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Added.
3447         (WebCore::wrapperOwner):
3448         (WebCore::toJS):
3449         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Added.
3450         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Added.
3451         (-[DOMTestCustomConstructorWithNoInterfaceObject dealloc]):
3452         (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]):
3453         (core):
3454         (kit):
3455         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Added.
3456         * bindings/scripts/test/TestCustomConstructor.idl: Added.
3457
3458 2015-05-19  Jon Honeycutt  <jhoneycutt@apple.com>
3459
3460         [iOS] When viewing an MJPEG stream as the main resource, only the first
3461         frame paints
3462
3463         <https://bugs.webkit.org/show_bug.cgi?id=145185>
3464         <rdar://problem/20124694>
3465
3466         This bug is caused by state not being restored between successive loads
3467         of multipart/x-mixed-replace content. Each part of the stream is not
3468         treated as a wholly new load, so if state is cleared as part of the
3469         previous page being destroyed, it may not be restored when loading
3470         the next stream part.
3471
3472         On WK1, tile cache updates are disabled in FrameView::clear(), which is
3473         called as the previous page is destroyed, but were not being
3474         reenabled when loading new replacement content from the stream.
3475
3476         On WK2, the exposed content rect was being reset to an empty rect as
3477         the previous page was destroyed, but it was not being reset by loading
3478         replacement content.
3479
3480         To fix these issues, I added two WebFrameLoaderClient callbacks;
3481         willReplaceMultipartContent() and didReplaceMultipartContent(). These
3482         are used to save and restore state between successive loads.
3483
3484         Reviewed by Darin Adler.
3485
3486         * loader/DocumentLoader.cpp:
3487         Call the new client callbacks.
3488         (WebCore::DocumentLoader::commitLoad):
3489         If replacing content in a multipart/x-mixed-replace stream, call the
3490         WebFrameLoaderClient's didReplaceMultipartContent().
3491
3492         (WebCore::DocumentLoader::setupForReplace):
3493         Call the WebFrameLoaderClient's willReplaceMultipartContent().
3494
3495         * loader/EmptyClients.h:
3496
3497         * loader/FrameLoaderClient.h:
3498
3499         * page/FrameView.cpp:
3500         (WebCore::FrameView::didReplaceMultipartContent):
3501         Re-enable tile cache updates that were disabled in FrameView::clear().
3502         This fixes the issue for WK1.
3503
3504         * page/FrameView.h:
3505         Declare an exported function, didReplaceMultipartContent(), that WebKit
3506         can call.
3507
3508 2015-05-27  Brady Eidson  <beidson@apple.com>
3509
3510         Remove unused ResourceRequest "user initiated" flag.
3511         https://bugs.webkit.org/show_bug.cgi?id=145428
3512
3513         Reviewed by Alexey Proskuryakov.
3514
3515         No new tests (No change in behavior).
3516
3517         * platform/ios/WebCoreSystemInterfaceIOS.mm:
3518         * platform/mac/WebCoreSystemInterface.mm:
3519
3520         * platform/network/ResourceRequestBase.h:
3521         (WebCore::ResourceRequestBase::initiatedByUserGesture): Deleted.
3522         (WebCore::ResourceRequestBase::setInitiatedByUserGesture): Deleted.
3523         (WebCore::ResourceRequestBase::encodeWithoutPlatformData): Deleted.
3524         (WebCore::ResourceRequestBase::decodeWithoutPlatformData): Deleted.
3525
3526         * platform/network/cf/ResourceRequestCFNet.cpp:
3527         (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted.
3528         (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted.
3529
3530         * platform/network/cocoa/ResourceRequestCocoa.mm:
3531         (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted.
3532         (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted.
3533
3534 2015-05-27  Brady Eidson  <beidson@apple.com>
3535
3536         Add a "should open urls externally" flag to DocumentLoader.
3537         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145417
3538
3539         Reviewed by Geoff Garen.
3540
3541         No new tests (No change in behavior, testable at API level with a followup patch)
3542
3543         * loader/DocumentLoader.cpp:
3544         (WebCore::DocumentLoader::setTriggeringAction): Apply the current flag value to the 
3545           new NavigationAction so it can be used later.
3546         * loader/DocumentLoader.h:
3547         (WebCore::DocumentLoader::setShouldOpenExternalURLsPolicy):
3548         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy):
3549         (WebCore::DocumentLoader::setTriggeringAction): Deleted.
3550
3551         FrameLoadRequest should hold the new flag to pass into FrameLoader machinery:
3552         * loader/FrameLoadRequest.h:
3553         (WebCore::FrameLoadRequest::setShouldOpenExternalURLsPolicy):
3554         (WebCore::FrameLoadRequest::shouldOpenExternalURLsPolicy):
3555
3556         * loader/FrameLoader.cpp:
3557         (WebCore::FrameLoader::load): Set the flag on the newly created DocumentLoader but
3558           only if it is for the main frame.
3559
3560         * loader/FrameLoaderTypes.h: Add a new enum for the flag.
3561
3562         Navigation action should hold the new flag to pass to the policy delegate:
3563         * loader/NavigationAction.cpp:
3564         (WebCore::NavigationAction::NavigationAction):
3565         * loader/NavigationAction.h:
3566         (WebCore::NavigationAction::shouldOpenExternalURLsPolicy):
3567         (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy):
3568
3569         * loader/PolicyChecker.cpp:
3570         (WebCore::PolicyChecker::checkNavigationPolicy): Include the flag from the DocumentLoader
3571           in the NavigationAction.
3572
3573 2015-05-27  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3574
3575         Purge PassRefPtr in WebCore/Modules - 2
3576         https://bugs.webkit.org/show_bug.cgi?id=145304
3577
3578         Reviewed by Darin Adler.
3579
3580         As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.
3581
3582         No new tests, no behavior changes
3583
3584         * Modules/mediasource/SourceBufferList.h:
3585         * Modules/mediastream/AllAudioCapabilities.h:
3586         (WebCore::AllAudioCapabilities::create):
3587         * Modules/mediastream/AllVideoCapabilities.h:
3588         (WebCore::AllVideoCapabilities::create):
3589         * Modules/mediastream/CapabilityRange.cpp:
3590         (WebCore::CapabilityRange::create):
3591         * Modules/mediastream/CapabilityRange.h:
3592         * Modules/mediastream/MediaSourceStates.cpp:
3593         (WebCore::MediaSourceStates::create):
3594         * Modules/mediastream/MediaStream.cpp:
3595         (WebCore::MediaStream::create):
3596         * Modules/mediastream/MediaStreamTrack.cpp:
3597         (WebCore::MediaStreamTrack::create):
3598         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
3599         (WebCore::MediaStreamTrackSourcesRequest::create):
3600         * Modules/mediastream/MediaTrackConstraint.cpp:
3601         (WebCore::MediaTrackConstraint::create):
3602         * Modules/mediastream/MediaTrackConstraint.h:
3603         * Modules/mediastream/RTCConfiguration.h:
3604         (WebCore::RTCConfiguration::create):
3605         * Modules/mediastream/RTCIceServer.h:
3606         (WebCore::RTCIceServer::create):
3607         * Modules/mediastream/RTCSessionDescription.cpp:
3608         (WebCore::RTCSessionDescription::create):
3609         * Modules/mediastream/RTCSessionDescription.h:
3610         * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:
3611         (WebCore::RTCSessionDescriptionRequestImpl::create):
3612         * Modules/mediastream/RTCStatsReport.cpp:
3613         (WebCore::RTCStatsReport::create):
3614         * Modules/mediastream/RTCStatsReport.h:
3615         * Modules/mediastream/RTCStatsRequestImpl.cpp:
3616         (WebCore::RTCStatsRequestImpl::create):
3617         * Modules/mediastream/RTCStatsRequestImpl.h:
3618         * Modules/mediastream/RTCStatsResponse.cpp:
3619         (WebCore::RTCStatsResponse::create):
3620         * Modules/mediastream/RTCStatsResponse.h:
3621         * Modules/mediastream/RTCVoidRequestImpl.cpp:
3622         (WebCore::RTCVoidRequestImpl::create):
3623         * Modules/mediastream/RTCVoidRequestImpl.h:
3624         * Modules/mediastream/SourceInfo.cpp:
3625         (WebCore::SourceInfo::create):
3626         * Modules/mediastream/SourceInfo.h:
3627         * Modules/mediastream/UserMediaRequest.cpp:
3628         (WebCore::UserMediaRequest::create):
3629         * Modules/mediastream/UserMediaRequest.h:
3630         * Modules/quota/StorageInfo.h:
3631         (WebCore::StorageInfo::create):
3632         * Modules/quota/StorageQuota.h:
3633         (WebCore::StorageQuota::create):
3634         * Modules/speech/SpeechSynthesis.cpp:
3635         (WebCore::SpeechSynthesis::create):
3636         * Modules/speech/SpeechSynthesis.h:
3637         * Modules/speech/SpeechSynthesisUtterance.cpp:
3638         (WebCore::SpeechSynthesisUtterance::create):
3639         * Modules/speech/SpeechSynthesisUtterance.h:
3640         * Modules/speech/SpeechSynthesisVoice.cpp:
3641         (WebCore::SpeechSynthesisVoice::create):
3642         * Modules/speech/SpeechSynthesisVoice.h:
3643         * Modules/webaudio/ChannelMergerNode.cpp:
3644         (WebCore::ChannelMergerNode::create):
3645         * Modules/webaudio/ChannelMergerNode.h:
3646         * Modules/webaudio/ChannelSplitterNode.cpp:
3647         (WebCore::ChannelSplitterNode::create):
3648         * Modules/webaudio/ChannelSplitterNode.h:
3649         * Modules/webaudio/DefaultAudioDestinationNode.h:
3650         (WebCore::DefaultAudioDestinationNode::create):
3651         * Modules/webaudio/GainNode.h:
3652         (WebCore::GainNode::create):
3653         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
3654         (WebCore::MediaElementAudioSourceNode::create):
3655         * Modules/webaudio/MediaElementAudioSourceNode.h:
3656         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
3657         (WebCore::MediaStreamAudioDestinationNode::create):
3658         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
3659         * Modules/webaudio/MediaStreamAudioSource.cpp:
3660         (WebCore::MediaStreamAudioSource::create):
3661         * Modules/webaudio/MediaStreamAudioSource.h:
3662         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
3663         (WebCore::MediaStreamAudioSourceNode::create):
3664         * Modules/webaudio/MediaStreamAudioSourceNode.h:
3665         * Modules/webaudio/OscillatorNode.cpp:
3666         (WebCore::OscillatorNode::setType):
3667         * Modules/webaudio/PannerNode.h:
3668         (WebCore::PannerNode::create):
3669         * Modules/webaudio/PeriodicWave.cpp:
3670         (WebCore::PeriodicWave::create):
3671         (WebCore::PeriodicWave::createSine):
3672         (WebCore::PeriodicWave::createSquare):
3673         (WebCore::PeriodicWave::createSawtooth):
3674         (WebCore::PeriodicWave::createTriangle):
3675         * Modules/webaudio/PeriodicWave.h:
3676         * Modules/webaudio/ScriptProcessorNode.cpp:
3677         (WebCore::ScriptProcessorNode::create):
3678         * Modules/webaudio/ScriptProcessorNode.h:
3679         * Modules/webaudio/WaveShaperNode.h:
3680         (WebCore::WaveShaperNode::create):
3681
3682 2015-05-27  Simon Fraser  <simon.fraser@apple.com>
3683
3684         REGRESSION (r183820): webkit.org/blog/ background painting issue on reload, when the page contains videos
3685         https://bugs.webkit.org/show_bug.cgi?id=145420
3686
3687         Reviewed by Dean Jackson.
3688
3689         After r183820, the media controls no longer had a wrapper that created CSS stacking context.
3690         The media controls on Mac use mix-blend-mode, which causes the compositing code to look for
3691         a stacking context ancestor and make it composited. After this change, it would walk up
3692         to a layer outside of the media element (e.g. the document element's layer), and make
3693         that composited. This triggered bugs with root background painting.
3694
3695         Prevent mix-blend-mode affecting content outside the media elements by having the media element's
3696         layer act as a stacking context.
3697
3698         Test: media/controls-layers.html
3699
3700         * rendering/RenderLayer.cpp:
3701         (WebCore::RenderLayer::RenderLayer):
3702         * rendering/RenderLayer.h:
3703
3704 2015-05-27  Andreas Kling  <akling@apple.com>
3705
3706         [WK2] Local storage areas should get torn down when they have no remaining references.
3707         <https://webkit.org/b/143339>
3708         <rdar://problem/20156436>
3709
3710         Reviewed by Darin Adler.
3711
3712         Add StorageArea::securityOrigin() implementations.
3713
3714         * loader/EmptyClients.cpp:
3715         * storage/StorageArea.h:
3716
3717 2015-05-27  Dean Jackson  <dino@apple.com>
3718
3719         img.currentSrc problem in strict mode with old picturefill
3720         https://bugs.webkit.org/show_bug.cgi?id=144095
3721         <rdar://problem/21087013>
3722
3723         Reviewed by Simon Fraser.
3724
3725         Add a PICTURE_SIZES flag. This allows us to easily remove the currentSrc
3726         attribute on HTMLImageElement, which is causing some issues with
3727         <picture> polyfills.
3728
3729         * Configurations/FeatureDefines.xcconfig:
3730         * html/HTMLImageElement.cpp:
3731         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate): Add guard around use of m_currentSrc.
3732         * html/HTMLImageElement.h:
3733         * html/HTMLImageElement.idl: Guard the currentSrc attribute.
3734         * html/parser/HTMLPreloadScanner.cpp:
3735         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3736         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
3737
3738 2015-05-27  Daniel Bates  <dabates@apple.com>
3739
3740         Attempt to fix internal build following <http://trac.webkit.org/changeset/184760>
3741         (https://bugs.webkit.org/show_bug.cgi?id=145289)
3742
3743         Reviewed by Jer Noble.
3744
3745         * platform/spi/mac/AVFoundationSPI.h:
3746
3747 2015-05-27  Jeremy Jones  <jeremyj@apple.com>
3748
3749         Refactor WebKit1 specific threading code out of WebVideoFullscreen code that is shared with WebKit2.
3750         https://bugs.webkit.org/show_bug.cgi?id=143954
3751
3752         Reviewed by Darin Adler.
3753
3754         WebVideoFullscreenInterfaceAVKit is used in both WebKit1 and WebKit2. In WebKit1, the model runs in the WebThread, while
3755         the interface is on the main thread. So there is code to dispatch between these two thread when communicating between the
3756         interface and the model. In WebKit2, this is handled automatically by the IPC mechanism. As a result, the threading code
3757         in WebVideoFullscreenbInterfaceAVKit and in WebVideoFullscreenModelVideoElement is redundant in WebKit2 and relies on
3758         WebThreadRun being a no-op in WebKit2.
3759
3760         This change clarifies this and simplifies the WebKit2 path by moving the WebKit1 specific threading code into
3761         WebVideoFullscreenControllerContext, which is the WebKit1 specific controller.
3762
3763         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3764         (WebVideoFullscreenControllerContext::WebVideoFullscreenControllerContext):
3765         (WebVideoFullscreenControllerContext::setController):
3766         (WebVideoFullscreenControllerContext::didSetupFullscreen):
3767         (WebVideoFullscreenControllerContext::didExitFullscreen):
3768         (WebVideoFullscreenControllerContext::didCleanupFullscreen):
3769         (WebVideoFullscreenControllerContext::fullscreenMayReturnToInline):
3770         (WebVideoFullscreenControllerContext::resetMediaState):
3771         (WebVideoFullscreenControllerContext::setDuration):
3772         (WebVideoFullscreenControllerContext::setCurrentTime):
3773         (WebVideoFullscreenControllerContext::setBufferedTime):
3774         (WebVideoFullscreenControllerContext::setRate):
3775         (WebVideoFullscreenControllerContext::setVideoDimensions):
3776         (WebVideoFullscreenControllerContext::setSeekableRanges):
3777         (WebVideoFullscreenControllerContext::setCanPlayFastReverse):
3778         (WebVideoFullscreenControllerContext::setAudioMediaSelectionOptions):
3779         (WebVideoFullscreenControllerContext::setLegibleMediaSelectionOptions):
3780         (WebVideoFullscreenControllerContext::setExternalPlayback):
3781         (WebVideoFullscreenControllerContext::play):
3782         (WebVideoFullscreenControllerContext::pause):
3783         (WebVideoFullscreenControllerContext::togglePlayState):
3784         (WebVideoFullscreenControllerContext::beginScrubbing):
3785         (WebVideoFullscreenControllerContext::endScrubbing):
3786         (WebVideoFullscreenControllerContext::seekToTime):
3787         (WebVideoFullscreenControllerContext::fastSeek):
3788         (WebVideoFullscreenControllerContext::beginScanningForward):
3789         (WebVideoFullscreenControllerContext::beginScanningBackward):
3790         (WebVideoFullscreenControllerContext::endScanning):
3791         (WebVideoFullscreenControllerContext::requestExitFullscreen):
3792         (WebVideoFullscreenControllerContext::setVideoLayerFrame):
3793         (WebVideoFullscreenControllerContext::setVideoLayerGravity):
3794         (WebVideoFullscreenControllerContext::selectAudioMediaOption):
3795         (WebVideoFullscreenControllerContext::selectLegibleMediaOption):
3796         (WebVideoFullscreenControllerContext::fullscreenModeChanged):
3797         (WebVideoFullscreenControllerContext::setupFullscreen):
3798         (WebVideoFullscreenControllerContext::exitFullscreen):
3799         (WebVideoFullscreenControllerContext::requestHideAndExitFullscreen):
3800         (-[WebVideoFullscreenController init]):
3801         (-[WebVideoFullscreenController dealloc]):
3802         (-[WebVideoFullscreenController enterFullscreen:mode:]):
3803         (-[WebVideoFullscreenController exitFullscreen]):
3804         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
3805         (-[WebVideoFullscreenController didFinishFullscreen:]):
3806         (WebVideoFullscreenControllerChangeObserver::setTarget): Deleted.
3807         (-[WebVideoFullscreenController didSetupFullscreen]): Deleted.
3808         (-[WebVideoFullscreenController didEnterFullscreen]): Deleted.
3809         (-[WebVideoFullscreenController didExitFullscreen]): Deleted.
3810         (-[WebVideoFullscreenController didCleanupFullscreen]): Deleted.
3811         (-[WebVideoFullscreenController fullscreenMayReturnToInline]): Deleted.
3812         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3813         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3814         (-[WebAVVideoLayer setBounds:]):
3815         (-[WebAVVideoLayer resolveBounds]):
3816         (WebVideoFullscreenInterfaceAVKit::resetMediaState):
3817         (WebVideoFullscreenInterfaceAVKit::setDuration):
3818         (WebVideoFullscreenInterfaceAVKit::setCurrentTime):
3819         (WebVideoFullscreenInterfaceAVKit::setBufferedTime):
3820         (WebVideoFullscreenInterfaceAVKit::setRate):
3821         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
3822         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges):
3823         (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse):
3824         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions):
3825         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions):
3826         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
3827         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
3828         (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
3829         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
3830         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
3831         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
3832         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
3833         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal):
3834         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
3835         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
3836         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
3837         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
3838         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
3839         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
3840         (WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen):
3841         (WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen):
3842         (WebVideoFullscreenInterfaceAVKit::setVideoLayerFrame):
3843         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Deleted.
3844         * platform/ios/WebVideoFullscreenModel.h:
3845         * platform/ios/WebVideoFullscreenModelVideoElement.h:
3846         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
3847         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
3848         (WebVideoFullscreenModelVideoElement::play):
3849         (WebVideoFullscreenModelVideoElement::pause):
3850         (WebVideoFullscreenModelVideoElement::togglePlayState):
3851         (WebVideoFullscreenModelVideoElement::beginScrubbing):
3852         (WebVideoFullscreenModelVideoElement::endScrubbing):
3853         (WebVideoFullscreenModelVideoElement::seekToTime):
3854         (WebVideoFullscreenModelVideoElement::fastSeek):
3855         (WebVideoFullscreenModelVideoElement::beginScanningForward):
3856         (WebVideoFullscreenModelVideoElement::beginScanningBackward):
3857         (WebVideoFullscreenModelVideoElement::endScanning):
3858         (WebVideoFullscreenModelVideoElement::requestExitFullscreen):
3859         (WebVideoFullscreenModelVideoElement::fullscreenModeChanged):
3860         (WebVideoFullscreenModelVideoElement::videoLayerFrame): Deleted.
3861         (WebVideoFullscreenModelVideoElement::videoLayerGravity): Deleted.
3862
3863 2015-05-27  Eric Carlson  <eric.carlson@apple.com>
3864
3865         [Mac] short-circuit MIME type lookup when possible
3866         https://bugs.webkit.org/show_bug.cgi?id=145362
3867
3868         Reviewed by Jer Noble.
3869
3870         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3871         (WebCore::isUnsupportedMIMEType): Renamed from unsupportedMIMEType. Convert type to lower case
3872         once instead of calling equalIgnoringCase many times.
3873         (WebCore::staticMIMETypeList): Renamed from staticMimeTypeCache. Initialize static set in a lambda,
3874         using an array of C strings in a loop.
3875         (WebCore::avfMIMETypes): Renamed from avfMimeTypeCache. Initialize static set in a lambda.
3876         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): avfMimeTypeCache -> avfMIMETypes.
3877         (WebCore::keySystemIsSupported): equalIgnoringCase -> equalIgnoringASCIICase.
3878         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Ditto.
3879         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): unsupportedMIMEType -> 
3880         isUnsupportedMIMEType, equalIgnoringCase -> equalIgnoringASCIICase, staticMimeTypeCache -> 
3881         staticMIMETypeList, avfMimeTypeCache -> avfMIMETypes.
3882         (WebCore::unsupportedMIMEType): Deleted.
3883         (WebCore::staticMimeTypeCache): Deleted.
3884         (WebCore::avfMimeTypeCache): Deleted.
3885
3886 2015-05-27  Eric Carlson  <eric.carlson@apple.com>
3887
3888         [Mac] short-circuit MIME type lookup when possible
3889         https://bugs.webkit.org/show_bug.cgi?id=145362
3890
3891         Reviewed by Dean Jackson.
3892
3893         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3894         (WebCore::unsupportedMIMEType): New, reject types known to not be supported.
3895         (WebCore::staticMimeTypeCache): Accept MIME types known to be supported.
3896         (WebCore::avfMimeTypeCache): Renamed from mimeTypeCache.
3897         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): mimeTypeCache -> staticMimeTypeCache.
3898         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Return immediately if
3899         unsupportedMIMEType returns true, don't call AVFoundation if staticMimeTypeCache returns true.
3900         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Ditto.
3901         (WebCore::mimeTypeCache): Deleted.
3902
3903 2015-05-27  Eric Carlson  <eric.carlson@apple.com>
3904
3905         [Mac] occasional crash in MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest
3906         https://bugs.webkit.org/show_bug.cgi?id=145409
3907
3908         Reviewed by Dean Jackson.
3909
3910         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3911         (WebCore::WebCoreAVFResourceLoader::stopLoading): NULL-check m_avRequest.
3912
3913 2015-05-26  Dean Jackson  <dino@apple.com>
3914
3915         Backdrop filters don't animate
3916         https://bugs.webkit.org/show_bug.cgi?id=145386
3917         <rdar://problem/21110037>
3918
3919         Reviewed by Simon Fraser.
3920
3921         Add support for animation of backdrop filters.
3922
3923         Note that, at the moment, we can only animate/transition
3924         backdrop-filter if it is already present on the element. See
3925         https://bugs.webkit.org/show_bug.cgi?id=145107
3926
3927         Test: css3/filters/backdrop/animation.html
3928
3929         * page/animation/AnimationBase.h: Add m_backdropFilterFunctionListsMatch and backdropFilterFunctionListsMatch.
3930         (WebCore::AnimationBase::backdropFilterFunctionListsMatch):
3931
3932         * page/animation/CSSPropertyAnimation.cpp:
3933         (WebCore::blendFunc): backdrop-filter is also supported.
3934         (WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Added. Works
3935         similarly to the PropertyWrapperAcceleratedFilter.
3936         (WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated):
3937         (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend):
3938         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Construct the
3939         PropertyWrapperAcceleratedBackdropFilter.
3940
3941         * page/animation/ImplicitAnimation.cpp:
3942         (WebCore::ImplicitAnimation::reset): Call checkForMatchingBackdropFilterFunctionLists.
3943         (WebCore::ImplicitAnimation::validateTransformFunctionList): Fix typo.
3944         (WebCore::ImplicitAnimation::checkForMatchingFilterFunctionLists): Remove whitespace.
3945         (WebCore::ImplicitAnimation::checkForMatchingBackdropFilterFunctionLists): New method that
3946         checks if the individual filters in a filter list match.
3947         * page/animation/ImplicitAnimation.h: Add checkForMatchingBackdropFilterFunctionLists.
3948
3949         * page/animation/KeyframeAnimation.cpp:
3950         (WebCore::KeyframeAnimation::KeyframeAnimation): Call checkForMatchingBackdropFilterFunctionLists.
3951         (WebCore::KeyframeAnimation::checkForMatchingBackdropFilterFunctionLists): Copied from
3952         checkForMatchingFilterFunctionLists, but calls backdropFilter() instead of filter().
3953         (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists): This was accidentally checking
3954         for backdrop filters as well, but it wouldn't have worked.
3955         * page/animation/KeyframeAnimation.h: Add checkForMatchingBackdropFilterFunctionLists.
3956
3957         * platform/graphics/GraphicsLayer.cpp:
3958         (WebCore::GraphicsLayer::validateFilterOperations): Modify the ASSERT to allow AnimatedPropertyWebkitBackdropFilter.
3959         * platform/graphics/GraphicsLayerClient.h: Add AnimatedPropertyWebkitBackdropFilter to the enum.
3960
3961         * platform/graphics/ca/GraphicsLayerCA.cpp:
3962         (WebCore::propertyIdToString): Support new enum.
3963         (WebCore::GraphicsLayerCA::addAnimation): Support AnimatedPropertyWebkitBackdropFilter.
3964         (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes): Ditto.
3965         (WebCore::GraphicsLayerCA::animatedLayer): Use a switch statement now that we have more than
3966         two options, and handle AnimatedPropertyWebkitBackdropFilter.
3967         (WebCore::GraphicsLayerCA::updateAnimations): Deleted a blank line.
3968
3969         * rendering/RenderLayerBacking.cpp:
3970         (WebCore::RenderLayerBacking::startAnimation): Support animation of backdrop-filter.
3971         (WebCore::RenderLayerBacking::startTransition): Ditto. Copied the code from the filter transition.
3972         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
3973         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
3974         * rendering/RenderLayerCompositor.cpp:
3975         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
3976
3977 2015-05-27  Jeremy Jones  <jeremyj@apple.com>
3978
3979         Handle case where -startOptimizedFullscreen fails.
3980         https://bugs.webkit.org/show_bug.cgi?id=145340
3981
3982         Reviewed by Eric Carlson.
3983
3984         Add new AVPlayerViewController delegate methods and remove old ones.
3985         -startOptimizedFullscreen can either fail silently because it is not allowed or it will call a delegate.
3986         We prevent silent failure by testing preconditions in enterFullscreenOptimized, and add the </