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