Convert arguments to ScrollingCoordinator functions to references
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-29  Simon Fraser  <simon.fraser@apple.com>
2
3         Convert arguments to ScrollingCoordinator functions to references
4         https://bugs.webkit.org/show_bug.cgi?id=143198
5
6         Reviewed by Darin Adler.
7
8         Convert all the FrameView* and ScrollableArea* arguments to ScrollingCoordinator functions to
9         references, and use references in a few other places.
10
11         * dom/Document.cpp:
12         (WebCore::wheelEventHandlerCountChanged):
13         * loader/HistoryController.cpp:
14         (WebCore::HistoryController::restoreScrollPositionAndViewState):
15         * page/DebugPageOverlays.cpp:
16         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
17         * page/Frame.cpp:
18         (WebCore::Frame::willDetachPage):
19         * page/FrameView.cpp:
20         (WebCore::FrameView::prepareForDetach):
21         (WebCore::FrameView::addSlowRepaintObject):
22         (WebCore::FrameView::removeSlowRepaintObject):
23         (WebCore::FrameView::addViewportConstrainedObject):
24         (WebCore::FrameView::removeViewportConstrainedObject):
25         (WebCore::FrameView::requestScrollPositionUpdate):
26         (WebCore::FrameView::performPostLayoutTasks):
27         (WebCore::FrameView::scrollableAreaSetChanged):
28         (WebCore::FrameView::wheelEvent):
29         * page/Page.cpp:
30         (WebCore::Page::nonFastScrollableRects):
31         * page/Page.h:
32         * page/scrolling/AsyncScrollingCoordinator.cpp:
33         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
34         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
35         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
36         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
37         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
38         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
39         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
40         (WebCore::AsyncScrollingCoordinator::updateMainFrameScrollLayerPosition):
41         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
42         * page/scrolling/AsyncScrollingCoordinator.h:
43         * page/scrolling/ScrollingCoordinator.cpp:
44         (WebCore::ScrollingCoordinator::pageDestroyed):
45         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView):
46         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
47         (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged):
48         (WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
49         (WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
50         (WebCore::ScrollingCoordinator::scrollLayerForScrollableArea):
51         (WebCore::ScrollingCoordinator::scrollLayerForFrameView):
52         (WebCore::ScrollingCoordinator::headerLayerForFrameView):
53         (WebCore::ScrollingCoordinator::footerLayerForFrameView):
54         (WebCore::ScrollingCoordinator::counterScrollingLayerForFrameView):
55         (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
56         (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
57         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView):
58         (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
59         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
60         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
61         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
62         (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates):
63         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
64         (WebCore::ScrollingCoordinator::replaySessionStateDidChange):
65         (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
66         * page/scrolling/ScrollingCoordinator.h: Align the bitmask enums to make mistakes easier to spot.
67         (WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
68         (WebCore::ScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
69         (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
70         (WebCore::ScrollingCoordinator::handleWheelEvent):
71         (WebCore::ScrollingCoordinator::willDestroyScrollableArea):
72         (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange):
73         (WebCore::ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
74         (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
75         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
76         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
77         (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
78         (WebCore::ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate):
79         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
80         * page/scrolling/ios/ScrollingCoordinatorIOS.h:
81         * page/scrolling/mac/ScrollingCoordinatorMac.h:
82         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
83         (WebCore::ScrollingCoordinatorMac::handleWheelEvent):
84         * rendering/RenderLayer.cpp:
85         (WebCore::RenderLayer::~RenderLayer):
86         * rendering/RenderLayerBacking.cpp:
87         (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
88         * rendering/RenderLayerCompositor.cpp:
89         (WebCore::RenderLayerCompositor::updateBacking):
90         (WebCore::RenderLayerCompositor::hasCoordinatedScrolling):
91         (WebCore::RenderLayerCompositor::scrollingLayerDidChange):
92         (WebCore::RenderLayerCompositor::updateLayerForHeader):
93         (WebCore::RenderLayerCompositor::updateLayerForFooter):
94         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
95         (WebCore::RenderLayerCompositor::destroyRootLayer):
96         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
97         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
98         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
99         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
100         * testing/Internals.cpp:
101         (WebCore::Internals::nonFastScrollableRects):
102
103 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
104
105         Use :matches() instead of :-webkit-any() for the sections and headings default style
106         https://bugs.webkit.org/show_bug.cgi?id=143197
107
108         Reviewed by Darin Adler.
109
110         We no longer need to use the :-webkit-any() hack in the default stylesheet.
111
112         The pseudo class :matches() also support correct specificity. This is not observable
113         since those selector do not conflict with any other rule in the default stylesheet.
114
115         * css/CSSSelector.h:
116         * css/SelectorChecker.cpp:
117         (WebCore::SelectorChecker::determineLinkMatchType):
118         * css/html.css:
119         (:matches(article, aside, nav, section) h1):
120         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
121         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
122         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
123         (:matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) :matches(article, aside, nav, section) h1):
124         (:-webkit-any(article,aside,nav,section) h1): Deleted.
125         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
126         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
127         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
128         (:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1): Deleted.
129
130 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
131
132         `currentColor` computes to the same colour on all elements, even if 'color' is inherited differently
133         https://bugs.webkit.org/show_bug.cgi?id=133420
134
135         Reviewed by Darin Adler.
136
137         When resolving a style with the help of the property cache, we were
138         completely ignoring currentColor.
139
140         Since you can set currentColor on properties that are not inherited,
141         those properties would just be copied from the cached style, which
142         may have a completely different inherited color.
143
144         This pacth fixes the issue by preventing any MatchResult from hitting
145         the cache if it contains any non-inherited property that would require
146         resolution by the cache:
147         -Using the inherit value.
148         -Using the currentColor value.
149
150         Tests: fast/css/currentColor-on-before-after-pseudo-elements.html
151                fast/css/currentColor-style-update-reftest.html
152                fast/css/currentColor-value-style-update.html
153
154         * css/ElementRuleCollector.cpp:
155         (WebCore::ElementRuleCollector::addElementStyleProperties):
156         (WebCore::ElementRuleCollector::matchAuthorRules):
157         (WebCore::ElementRuleCollector::matchUserRules):
158         (WebCore::ElementRuleCollector::matchUARules):
159         * css/StyleResolver.cpp:
160         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
161         (WebCore::StyleResolver::styleForKeyframe):
162         (WebCore::StyleResolver::pseudoStyleForElement):
163         (WebCore::StyleResolver::styleForPage):
164         (WebCore::StyleResolver::findFromMatchedPropertiesCache):
165         (WebCore::StyleResolver::addToMatchedPropertiesCache):
166         (WebCore::extractDirectionAndWritingMode):
167         (WebCore::StyleResolver::applyMatchedProperties):
168         (WebCore::StyleResolver::CascadedProperties::addStyleProperties):
169         (WebCore::StyleResolver::CascadedProperties::addMatches):
170         * css/StyleResolver.h:
171         (WebCore::StyleResolver::MatchResult::matchedProperties):
172
173 2015-03-29  Benjamin Poulain  <benjamin@webkit.org>
174
175         Enable :any-link by default
176         https://bugs.webkit.org/show_bug.cgi?id=143201
177
178         Reviewed by Sam Weinig.
179
180         The pseudo class :any-link has been stable for a while. This patch enables
181         it by default and remove the -webkit- prefix on the default style.
182
183         * css/CSSDefaultStyleSheets.cpp:
184         * css/CSSSelector.cpp:
185         (WebCore::CSSSelector::selectorText):
186         * css/CSSSelector.h:
187         * css/RuleSet.cpp:
188         (WebCore::RuleSet::addRule):
189         * css/SelectorChecker.cpp:
190         (WebCore::SelectorChecker::checkOne):
191         * css/SelectorChecker.h:
192         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
193         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
194         * css/html.css:
195         (a:any-link):
196         (a:any-link:active):
197         (:any-link img):
198         (a:-webkit-any-link): Deleted.
199         (a:-webkit-any-link:active): Deleted.
200         (:-webkit-any-link img): Deleted.
201         * cssjit/SelectorCompiler.cpp:
202         (WebCore::SelectorCompiler::addPseudoClassType):
203         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
204
205 2015-03-29  Joonghun Park  <jh718.park@samsung.com>
206
207         nullptr cleanup in RenderFooBox classes
208         https://bugs.webkit.org/show_bug.cgi?id=143182
209
210         Reviewed by Ryosuke Niwa.
211
212         No new tests, no behavior changes
213
214         Replace 0 with nullptr in RenderFooBox classes.
215
216         * rendering/RenderBox.cpp:
217         (WebCore::RenderBox::RenderBox):
218         (WebCore::RenderBox::paintFillLayer):
219         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
220         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
221         (WebCore::RenderBox::renderBoxRegionInfo):
222         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
223         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
224         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
225         (WebCore::RenderBox::positionForPoint):
226         (WebCore::RenderBox::layoutOverflowRectForPropagation):
227         * rendering/RenderBox.h:
228         (WebCore::RenderBox::setMarginBefore):
229         (WebCore::RenderBox::setMarginAfter):
230         (WebCore::RenderBox::setMarginStart):
231         (WebCore::RenderBox::setMarginEnd):
232         (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs):
233         (WebCore::RenderBox::setInlineBoxWrapper):
234         * rendering/RenderBoxModelObject.cpp:
235         (WebCore::RenderBoxModelObject::willBeDestroyed):
236         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
237         (WebCore::RenderBoxModelObject::paintBorderSides):
238         (WebCore::RenderBoxModelObject::firstLetterRemainingText):
239         * rendering/RenderBoxModelObject.h:
240         (WebCore::RenderBoxModelObject::moveChildTo):
241         (WebCore::RenderBoxModelObject::moveAllChildrenTo):
242         (WebCore::RenderBoxModelObject::moveChildrenTo):
243         * rendering/RenderDeprecatedFlexibleBox.cpp:
244         (WebCore::FlexBoxIterator::reset):
245         (WebCore::FlexBoxIterator::next):
246         * rendering/RenderDeprecatedFlexibleBox.h:
247         * rendering/RenderFlexibleBox.cpp:
248         (WebCore::RenderFlexibleBox::firstLineBaseline):
249         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
250         * rendering/RenderLineBoxList.cpp:
251         (WebCore::RenderLineBoxList::deleteLineBoxTree):
252         (WebCore::RenderLineBoxList::extractLineBox):
253         (WebCore::RenderLineBoxList::deleteLineBoxes):
254         (WebCore::RenderLineBoxList::checkConsistency):
255         * rendering/RenderLineBoxList.h:
256         (WebCore::RenderLineBoxList::RenderLineBoxList):
257         * rendering/RenderListBox.cpp:
258         (WebCore::RenderListBox::enclosingScrollableArea):
259         (WebCore::RenderListBox::setHasVerticalScrollbar):
260         * rendering/RenderListBox.h:
261
262 2015-03-29  Darin Adler  <darin@apple.com>
263
264         HTMLCollection caches incorrect length if item(0) is called before length on an empty collection
265         https://bugs.webkit.org/show_bug.cgi?id=143203
266         rdar://problem/18460462
267
268         Reviewed by Antti Koivisto.
269
270         Test: fast/dom/htmlcollection-length-after-item-2.html
271
272         * dom/CollectionIndexCache.h:
273         (CollectionIndexCache::nodeAt): If we hit the end looking for index 0, cache a length
274         of 0, not a length of 1.
275
276 2015-03-29  Darin Adler  <darin@apple.com>
277
278         Remove unneeded SVG code, including most isSupportedAttribute functions
279         https://bugs.webkit.org/show_bug.cgi?id=143194
280
281         Reviewed by Antti Koivisto.
282
283         - Removed most implementations of isSupportedAttribute. Others can be removed in
284           future patches. The ones left behind are now all private static member functions.
285           It's dangerous for them to be public because they tend to indicate which attributes
286           are supported at a particular level in the class hierarchy and they are not virtual
287           functions; might want to rethink the function name if we keep any of these long term.
288
289         - Removed unneeded includes, especially of Attr.h and Attribute.h.
290
291         - Changed most parseAttribute and svgAttributeChanged functions so they no longer
292           rely on checking attribute names against a set. Also removed lots of unneeded calls
293           to SVGLangSpace::parseAttribute, which is called by SVGElement::parseAttribute and
294           need not be called by derived classes.
295
296         - Removed return values from parseAttribute functions. Skipping other parseAttribute
297           logic is not an important optimization and makes functions needlessly complex.
298
299         - Moved use of InstanceInvalidationGuard closer to where they are needed. Eventually
300           we may be able to remove many of these.
301
302         - Used auto in a few places where the same type is repeated twice on the same line of
303           code, and auto makes it a bit smaller.
304
305         - Got rid of protected sections in some final classes; doesn't make sense to combine
306           these two. Also moved a few functions from protected to private in other classes.
307
308         - Made a number of functions into static member functions in the base classes such
309           as SVGLangSpace; they were not making any use of the object, and so it was wasteful
310           to compile them as non-static member functions.
311
312         * rendering/svg/RenderSVGImage.cpp: Removed unneeded includes.
313         * svg/SVGAElement.cpp: Removed unneeded includes.
314         (WebCore::SVGAElement::isSupportedAttribute): Deleted.
315         (WebCore::SVGAElement::parseAttribute): Don't use isSupportedAttribute.
316         (WebCore::SVGAElement::svgAttributeChanged): Don't use isSupportedAttribute.
317         * svg/SVGAElement.h: Removed isSupportedAttribute.
318         * svg/SVGAnimateMotionElement.cpp: Removed unneeded includes.
319         (WebCore::SVGAnimateMotionElement::isSupportedAttribute): Deleted.
320         (WebCore::SVGAnimateMotionElement::parseAttribute): Don't use isSupportedAttribute.
321         * svg/SVGAnimateMotionElement.h: Removed isSupportedAttribute.
322         * svg/SVGAnimateTransformElement.cpp:
323         (WebCore::SVGAnimateTransformElement::isSupportedAttribute): Deleted.
324         (WebCore::SVGAnimateTransformElement::parseAttribute): Don't use isSupportedAttribute.
325         * svg/SVGAnimateTransformElement.h: Removed isSupportedAttribute.
326         * svg/SVGAnimationElement.cpp:
327         (WebCore::SVGAnimationElement::parseAttribute): Don't use isSupportedAttribute.
328         * svg/SVGCircleElement.cpp:
329         (WebCore::SVGCircleElement::isSupportedAttribute): Deleted.
330         (WebCore::SVGCircleElement::parseAttribute): Don't use isSupportedAttribute.
331         (WebCore::SVGCircleElement::svgAttributeChanged): Don't use isSupportedAttribute.
332         * svg/SVGCircleElement.h: Removed isSupportedAttribute.
333         * svg/SVGClipPathElement.cpp: Removed unneeded includes.
334         (WebCore::SVGClipPathElement::parseAttribute): Don't use isSupportedAttribute.
335         * svg/SVGComponentTransferFunctionElement.cpp:
336         (WebCore::SVGComponentTransferFunctionElement::parseAttribute): Don't use isSupportedAttribute.
337         * svg/SVGCursorElement.cpp: Removed unneeded includes.
338         (WebCore::SVGCursorElement::parseAttribute): Don't use isSupportedAttribute.
339         (WebCore::SVGCursorElement::svgAttributeChanged): Don't use isSupportedAttribute.
340         * svg/SVGElement.cpp: Removed unneeded includes.
341         * svg/SVGEllipseElement.cpp: Removed unneeded includes.
342         (WebCore::SVGEllipseElement::isSupportedAttribute): Deleted.
343         (WebCore::SVGEllipseElement::parseAttribute): Don't use isSupportedAttribute.
344         (WebCore::SVGEllipseElement::svgAttributeChanged): Don't use isSupportedAttribute.
345         * svg/SVGEllipseElement.h: Removed isSupportedAttribute.
346         * svg/SVGExternalResourcesRequired.cpp: Removed unneeded includes.
347         (WebCore::SVGExternalResourcesRequired::parseAttribute): Don't return a boolean.
348         * svg/SVGExternalResourcesRequired.h: Don't return a boolean.
349         * svg/SVGFEBlendElement.cpp: Removed unneeded includes.
350         (WebCore::SVGFEBlendElement::isSupportedAttribute): Deleted.
351         (WebCore::SVGFEBlendElement::parseAttribute): Don't use isSupportedAttribute.
352         (WebCore::SVGFEBlendElement::svgAttributeChanged): Don't use isSupportedAttribute.
353         * svg/SVGFEBlendElement.h: Removed isSupportedAttribute.
354         * svg/SVGFEColorMatrixElement.cpp: Removed unneeded includes.
355         (WebCore::SVGFEColorMatrixElement::isSupportedAttribute): Deleted.
356         (WebCore::SVGFEColorMatrixElement::parseAttribute): Don't use isSupportedAttribute.
357         (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): Don't use isSupportedAttribute.
358         * svg/SVGFEColorMatrixElement.h: Removed isSupportedAttribute.
359         * svg/SVGFEComponentTransferElement.cpp: Removed unneeded includes.
360         (WebCore::SVGFEComponentTransferElement::isSupportedAttribute): Deleted.
361         (WebCore::SVGFEComponentTransferElement::parseAttribute): Don't use isSupportedAttribute.
362         * svg/SVGFEComponentTransferElement.h: Removed unneeded includes.
363         * svg/SVGFECompositeElement.cpp: Removed unneeded includes.
364         (WebCore::SVGFECompositeElement::isSupportedAttribute): Deleted.
365         (WebCore::SVGFECompositeElement::parseAttribute): Don't use isSupportedAttribute.
366         (WebCore::SVGFECompositeElement::svgAttributeChanged): Don't use isSupportedAttribute.
367         * svg/SVGFECompositeElement.h:
368         * svg/SVGFEConvolveMatrixElement.cpp: Removed unneeded includes.
369         (WebCore::SVGFEConvolveMatrixElement::isSupportedAttribute): Deleted.
370         (WebCore::SVGFEConvolveMatrixElement::parseAttribute): Don't use isSupportedAttribute.
371         (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): Don't use isSupportedAttribute.
372         * svg/SVGFEConvolveMatrixElement.h:
373         * svg/SVGFEDiffuseLightingElement.cpp: Removed unneeded includes.
374         (WebCore::SVGFEDiffuseLightingElement::isSupportedAttribute): Deleted.
375         (WebCore::SVGFEDiffuseLightingElement::parseAttribute): Don't use isSupportedAttribute.
376         (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): Don't use isSupportedAttribute.
377         * svg/SVGFEDiffuseLightingElement.h:
378         * svg/SVGFEDisplacementMapElement.cpp: Removed unneeded includes.
379         (WebCore::SVGFEDisplacementMapElement::isSupportedAttribute): Deleted.
380         (WebCore::SVGFEDisplacementMapElement::parseAttribute): Don't use isSupportedAttribute.
381         (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Don't use isSupportedAttribute.
382         * svg/SVGFEDisplacementMapElement.h:
383         * svg/SVGFEDropShadowElement.cpp: Removed unneeded includes.
384         (WebCore::SVGFEDropShadowElement::isSupportedAttribute): Deleted.
385         (WebCore::SVGFEDropShadowElement::parseAttribute): Don't use isSupportedAttribute.
386         (WebCore::SVGFEDropShadowElement::svgAttributeChanged): Don't use isSupportedAttribute.
387         * svg/SVGFEDropShadowElement.h:
388         * svg/SVGFEFloodElement.cpp: Removed unneeded includes.
389         * svg/SVGFEGaussianBlurElement.cpp: Removed unneeded includes.
390         (WebCore::SVGFEGaussianBlurElement::isSupportedAttribute): Deleted.
391         (WebCore::SVGFEGaussianBlurElement::parseAttribute): Don't use isSupportedAttribute.
392         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): Don't use isSupportedAttribute.
393         * svg/SVGFEGaussianBlurElement.h:
394         * svg/SVGFEImageElement.cpp: Removed unneeded includes.
395         (WebCore::SVGFEImageElement::isSupportedAttribute): Deleted.
396         (WebCore::SVGFEImageElement::parseAttribute): Don't use isSupportedAttribute.
397         (WebCore::SVGFEImageElement::svgAttributeChanged): Don't use isSupportedAttribute.
398         * svg/SVGFEImageElement.h:
399         * svg/SVGFELightElement.cpp: Removed unneeded includes.
400         (WebCore::SVGFELightElement::isSupportedAttribute): Deleted.
401         (WebCore::SVGFELightElement::parseAttribute): Don't use isSupportedAttribute.
402         (WebCore::SVGFELightElement::svgAttributeChanged): Don't use isSupportedAttribute.
403         * svg/SVGFELightElement.h:
404         * svg/SVGFEMergeNodeElement.cpp: Removed unneeded includes.
405         (WebCore::SVGFEMergeNodeElement::isSupportedAttribute): Deleted.
406         (WebCore::SVGFEMergeNodeElement::parseAttribute): Don't use isSupportedAttribute.
407         (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Don't use isSupportedAttribute.
408         * svg/SVGFEMergeNodeElement.h:
409         * svg/SVGFEMorphologyElement.cpp: Removed unneeded includes.
410         (WebCore::SVGFEMorphologyElement::isSupportedAttribute): Deleted.
411         (WebCore::SVGFEMorphologyElement::parseAttribute): Don't use isSupportedAttribute.
412         (WebCore::SVGFEMorphologyElement::svgAttributeChanged): Don't use isSupportedAttribute.
413         * svg/SVGFEMorphologyElement.h:
414         * svg/SVGFEOffsetElement.cpp: Removed unneeded includes.
415         (WebCore::SVGFEOffsetElement::isSupportedAttribute): Deleted.
416         (WebCore::SVGFEOffsetElement::parseAttribute): Don't use isSupportedAttribute.
417         (WebCore::SVGFEOffsetElement::svgAttributeChanged): Don't use isSupportedAttribute.
418         * svg/SVGFEOffsetElement.h:
419         * svg/SVGFESpecularLightingElement.cpp: Removed unneeded includes.
420         (WebCore::SVGFESpecularLightingElement::isSupportedAttribute): Deleted.
421         (WebCore::SVGFESpecularLightingElement::parseAttribute): Don't use isSupportedAttribute.
422         (WebCore::SVGFESpecularLightingElement::svgAttributeChanged): Don't use isSupportedAttribute.
423         * svg/SVGFESpecularLightingElement.h:
424         * svg/SVGFETileElement.cpp: Removed unneeded includes.
425         (WebCore::SVGFETileElement::isSupportedAttribute): Deleted.
426         (WebCore::SVGFETileElement::parseAttribute): Don't use isSupportedAttribute.
427         (WebCore::SVGFETileElement::svgAttributeChanged): Don't use isSupportedAttribute.
428         * svg/SVGFETileElement.h:
429         * svg/SVGFETurbulenceElement.cpp: Removed unneeded includes.
430         (WebCore::SVGFETurbulenceElement::isSupportedAttribute): Deleted.
431         (WebCore::SVGFETurbulenceElement::parseAttribute): Don't use isSupportedAttribute.
432         (WebCore::SVGFETurbulenceElement::svgAttributeChanged): Don't use isSupportedAttribute.
433         * svg/SVGFETurbulenceElement.h:
434         * svg/SVGFilterElement.cpp: Removed unneeded includes.
435         (WebCore::SVGFilterElement::parseAttribute): Don't use isSupportedAttribute.
436         * svg/SVGFilterPrimitiveStandardAttributes.cpp: Removed unneeded includes.
437         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute): Don't use isSupportedAttribute.
438         * svg/SVGFilterPrimitiveStandardAttributes.h: Removed isSupportedAttribute and also moved a
439         couple functions out of the class definition.
440         * svg/SVGFitToViewBox.cpp: Removed unneeded includes.
441         * svg/SVGFontFaceElement.cpp: Removed unneeded includes.
442         * svg/SVGFontFaceUriElement.cpp: Removed unneeded includes.
443         * svg/SVGForeignObjectElement.cpp: Removed unneeded includes.
444         (WebCore::SVGForeignObjectElement::parseAttribute): Don't use isSupportedAttribute.
445         * svg/SVGGElement.cpp: Removed unneeded includes.
446         (WebCore::SVGGElement::parseAttribute): Don't use isSupportedAttribute.
447         * svg/SVGGlyphElement.cpp: Removed unneeded includes.
448         * svg/SVGGlyphRefElement.cpp: Removed unneeded includes.
449         (WebCore::SVGGlyphRefElement::hasValidGlyphElement): Rewrote to use is<> instead of hasTagName.
450         (WebCore::SVGGlyphRefElement::parseAttribute): Don't use return value from SVGURIReference::parseAttribute.
451         * svg/SVGGradientElement.cpp: Removed unneeded includes.
452         (WebCore::SVGGradientElement::parseAttribute): Don't use isSupportedAttribute.
453         * svg/SVGGraphicsElement.cpp: Removed unneeded includes.
454         (WebCore::SVGGraphicsElement::parseAttribute): Don't use isSupportedAttribute.
455         * svg/SVGImageElement.cpp: Removed unneeded includes.
456         (WebCore::SVGImageElement::parseAttribute): Don't use isSupportedAttribute.
457         * svg/SVGLangSpace.cpp: Removed unneeded includes.
458         (WebCore::SVGLangSpace::parseAttribute): Removed the return value.
459         * svg/SVGLangSpace.h: Converted functions to static member functions and removed the
460         return value from parseAttribute.
461         * svg/SVGLineElement.cpp: Removed unneeded includes.
462         (WebCore::SVGLineElement::parseAttribute): Don't use isSupportedAttribute.
463         * svg/SVGLinearGradientElement.cpp: Removed unneeded includes.
464         (WebCore::SVGLinearGradientElement::parseAttribute): Don't use isSupportedAttribute.
465         * svg/SVGMPathElement.cpp: Removed unneeded includes.
466         (WebCore::SVGMPathElement::isSupportedAttribute): Deleted.
467         (WebCore::SVGMPathElement::parseAttribute): Don't use isSupportedAttribute.
468         (WebCore::SVGMPathElement::svgAttributeChanged): Don't use isSupportedAttribute.
469         * svg/SVGMPathElement.h: Removed isSupportedAttribute and made didNotifySubtreeInsertions
470         private instead of protected.
471         * svg/SVGMarkerElement.cpp: Removed unneeded includes.
472         (WebCore::SVGMarkerElement::parseAttribute): Don't use isSupportedAttribute.
473         * svg/SVGMaskElement.cpp: Removed unneeded includes.
474         (WebCore::SVGMaskElement::parseAttribute): Don't use isSupportedAttribute.
475         * svg/SVGPathElement.cpp: Removed unneeded includes.
476         (WebCore::SVGPathElement::parseAttribute): Don't use isSupportedAttribute.
477         * svg/SVGPatternElement.cpp: Removed unneeded includes.
478         (WebCore::SVGPatternElement::parseAttribute): Don't use isSupportedAttribute.
479         * svg/SVGPolyElement.cpp: Removed unneeded includes.
480         (WebCore::SVGPolyElement::isSupportedAttribute): Deleted.
481         (WebCore::SVGPolyElement::parseAttribute): Don't use isSupportedAttribute.
482         (WebCore::SVGPolyElement::svgAttributeChanged): Don't use isSupportedAttribute.
483         * svg/SVGPolyElement.h:
484         * svg/SVGRadialGradientElement.cpp: Removed unneeded includes.
485         (WebCore::SVGRadialGradientElement::parseAttribute): Don't use isSupportedAttribute.
486         * svg/SVGRectElement.cpp: Removed unneeded includes.
487         (WebCore::SVGRectElement::isSupportedAttribute): Deleted.
488         (WebCore::SVGRectElement::parseAttribute): Don't use isSupportedAttribute.
489         (WebCore::SVGRectElement::svgAttributeChanged): Don't use isSupportedAttribute.
490         * svg/SVGRectElement.h:
491         * svg/SVGSVGElement.cpp: Removed unneeded includes.
492         (WebCore::SVGSVGElement::parseAttribute): Don't use isSupportedAttribute.
493         * svg/SVGScriptElement.cpp: Removed unneeded includes.
494         * svg/SVGStopElement.cpp: Removed unneeded includes.
495         (WebCore::SVGStopElement::isSupportedAttribute): Deleted.
496         (WebCore::SVGStopElement::parseAttribute): Don't use isSupportedAttribute.
497         (WebCore::SVGStopElement::svgAttributeChanged): Don't use isSupportedAttribute.
498         * svg/SVGStopElement.h: Removed isSupportedAttribute.
499         * svg/SVGStyleElement.cpp: Removed unneeded includes.
500         (WebCore::SVGStyleElement::isSupportedAttribute): Deleted.
501         (WebCore::SVGStyleElement::parseAttribute): Don't use isSupportedAttribute.
502         * svg/SVGStyleElement.h: Removed isSupportedAttribute.
503         * svg/SVGSymbolElement.cpp: Removed unneeded includes.
504         (WebCore::SVGSymbolElement::isSupportedAttribute): Deleted.
505         (WebCore::SVGSymbolElement::parseAttribute): Don't use isSupportedAttribute.
506         (WebCore::SVGSymbolElement::svgAttributeChanged): Don't use isSupportedAttribute.
507         * svg/SVGSymbolElement.h: Removed isSupportedAttribute.
508         * svg/SVGTRefElement.cpp: Removed unneeded includes.
509         (WebCore::SVGTRefElement::isSupportedAttribute): Deleted.
510         (WebCore::SVGTRefElement::parseAttribute): Don't use isSupportedAttribute.
511         (WebCore::SVGTRefElement::svgAttributeChanged): Don't use isSupportedAttribute.
512         * svg/SVGTRefElement.h: Removed isSupportedAttribute and made didNotifySubtreeInsertions
513         private instead of protected.
514         * svg/SVGTests.cpp: Removed unneeded includes.
515         (WebCore::SVGTests::parseAttribute): Removed return value.
516         * svg/SVGTests.h: Removed return value of parseAttribute.
517         * svg/SVGTextContentElement.cpp: Removed unneeded includes.
518         (WebCore::SVGTextContentElement::collectStyleForPresentationAttribute): Don't use
519         isSupportedAttribute. Also removed global to optimize comparing attribute value against
520         the string "preserve".
521         (WebCore::SVGTextContentElement::parseAttribute): Don't use isSupportedAttribute.
522         (WebCore::SVGTextContentElement::svgAttributeChanged): Don't use isSupportedAttribute.
523         * svg/SVGTextContentElement.h: Made isSupportedAttribute private instead of protected.
524         * svg/SVGTextElement.cpp: Removed unneeded includes.
525         * svg/SVGTextPathElement.cpp: Removed unneeded includes.
526         (WebCore::SVGTextPathElement::parseAttribute): Don't use isSupportedAttribute.
527         * svg/SVGTextPositioningElement.cpp: Removed unneeded includes.
528         (WebCore::SVGTextPositioningElement::isSupportedAttribute): Deleted.
529         (WebCore::SVGTextPositioningElement::parseAttribute): Don't use isSupportedAttribute.
530         (WebCore::SVGTextPositioningElement::svgAttributeChanged): Don't use isSupportedAttribute.
531         * svg/SVGTextPositioningElement.h: Removed isSupportedAttribute and made some functions
532         private insetad of protected.
533         * svg/SVGURIReference.cpp: Removed unneeded includes.
534         (WebCore::SVGURIReference::parseAttribute): Don't use isSupportedAttribute.
535         * svg/SVGURIReference.h:
536         (WebCore::SVGURIReference::isExternalURIReference):
537         * svg/SVGUseElement.cpp: Removed unneeded includes.
538         (WebCore::SVGUseElement::parseAttribute): Don't use isSupportedAttribute.
539         * svg/SVGViewElement.h: Removed isSupportedAttribute.
540         * svg/animation/SVGSMILElement.cpp: Removed unneeded includes.
541
542 2015-03-29  Darin Adler  <darin@apple.com>
543
544         Remove unneeded includes of "Attribute.h"
545         https://bugs.webkit.org/show_bug.cgi?id=143195
546
547         Reviewed by Antti Koivisto.
548
549         * css/StyleResolver.cpp:
550         * html/HTMLAnchorElement.cpp:
551         * html/HTMLAreaElement.cpp:
552         * html/HTMLBRElement.cpp:
553         * html/HTMLBaseElement.cpp:
554         * html/HTMLBodyElement.cpp:
555         * html/HTMLButtonElement.cpp:
556         * html/HTMLCanvasElement.cpp:
557         * html/HTMLDivElement.cpp:
558         * html/HTMLElement.cpp:
559         * html/HTMLEmbedElement.cpp:
560         * html/HTMLFontElement.cpp:
561         * html/HTMLFormControlElement.cpp:
562         * html/HTMLFormElement.cpp:
563         * html/HTMLFrameElement.cpp:
564         * html/HTMLFrameElementBase.cpp:
565         * html/HTMLFrameSetElement.cpp:
566         * html/HTMLHRElement.cpp:
567         * html/HTMLIFrameElement.cpp:
568         * html/HTMLImageElement.cpp:
569         * html/HTMLOListElement.cpp:
570         * html/HTMLOptionElement.cpp:
571         * html/HTMLParagraphElement.cpp:
572         * html/HTMLParamElement.cpp:
573         * html/HTMLPlugInElement.cpp:
574         * html/HTMLPreElement.cpp:
575         * html/HTMLProgressElement.cpp:
576         * html/HTMLScriptElement.cpp:
577         * html/HTMLSelectElement.cpp:
578         * html/HTMLStyleElement.cpp:
579         * html/HTMLTableCaptionElement.cpp:
580         * html/HTMLTableCellElement.cpp:
581         * html/HTMLTableColElement.cpp:
582         * html/HTMLTableElement.cpp:
583         * html/HTMLTablePartElement.cpp:
584         * html/HTMLTextAreaElement.cpp:
585         * html/HTMLTextFormControlElement.cpp:
586         * html/HTMLUListElement.cpp:
587         * html/HTMLVideoElement.cpp:
588         * html/parser/HTMLScriptRunner.cpp:
589         * inspector/InspectorNodeFinder.cpp:
590         Removed includes of "Attribute.h".
591
592 2015-03-28  Eric Carlson  <eric.carlson@apple.com>
593
594         [Mac] Update for output device API change
595         https://bugs.webkit.org/show_bug.cgi?id=143187
596
597         Reviewed by Zalan Bujtas.
598
599         The API used for output device is being deprecated, update to the replacement.
600
601         * WebCore.xcodeproj/project.pbxproj: Add SPI headers.
602
603         * platform/graphics/MediaPlaybackTarget.h:
604         (WebCore::MediaPlaybackTarget::MediaPlaybackTarget): Update for API change.
605         (WebCore::MediaPlaybackTarget::setDevicePickerContext):
606         (WebCore::MediaPlaybackTarget::devicePickerContext):
607
608         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
609         (WebCore::MediaPlaybackTarget::encode):
610         (WebCore::MediaPlaybackTarget::decode):
611
612         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
613         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
614         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):
615         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac):
616         (WebCore::MediaPlaybackTargetPickerMac::outputeDeviceAvailabilityChangedTimerFired):
617         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
618         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange):
619         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets):
620         (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
621         (-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted.
622
623         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
624         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
625         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
626         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
627         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
628         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
629
630         * platform/spi/cocoa/AVKitSPI.h: Copied from Source/WebCore/platform/spi/ios/AVKitSPI.h. Moved
631             from ios directory, added Mac includes and prototypes.
632         * platform/spi/ios/AVKitSPI.h: Removed.
633
634         * platform/spi/mac/AVFoundationSPI.h: Added.
635
636 2015-03-28  Simon Fraser  <simon.fraser@apple.com>
637
638         Optimize RenderLayer::intersectsDamageRect() slightly
639         https://bugs.webkit.org/show_bug.cgi?id=143186
640
641         Reviewed by Zalan Bujtas.
642
643         We can early return from RenderLayer::intersectsDamageRect() if the
644         damageRect is empty, since nothing will intersect with the empty rect.
645         
646         Slight performance gain when scrolling overflow-scroll with lots of nested,
647         clipping layers.
648
649         * rendering/RenderLayer.cpp:
650         (WebCore::RenderLayer::calculateClipRects):
651
652 2015-03-28  Anders Carlsson  <andersca@apple.com>
653
654         Remove an unused SPI method from WebKitLegacy
655         https://bugs.webkit.org/show_bug.cgi?id=143185
656
657         Reviewed by Sam Weinig.
658
659         * loader/appcache/ApplicationCacheStorage.cpp:
660         (WebCore::ApplicationCacheStorage::storeCopyOfCache): Deleted.
661         * loader/appcache/ApplicationCacheStorage.h:
662
663 2015-03-28  Joonghun Park  <jh718.park@samsung.com>
664
665         nullptr cleanup in InlineFooBox classes
666         https://bugs.webkit.org/show_bug.cgi?id=143178
667
668         Reviewed by Csaba Osztrogonác.
669
670         No new tests, no behavior changes
671
672         Replace 0 with nullptr in InlineFooBox classes.
673
674         * rendering/InlineBox.cpp:
675         (WebCore::InlineBox::prevLeafChildIgnoringLineBreak):
676         * rendering/InlineFlowBox.cpp:
677         (WebCore::InlineFlowBox::removeChild):
678         (WebCore::InlineFlowBox::deleteLine):
679         (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
680         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
681         * rendering/InlineFlowBox.h:
682         (WebCore::InlineFlowBox::InlineFlowBox):
683         * rendering/InlineTextBox.h:
684         (WebCore::InlineTextBox::InlineTextBox):
685         * rendering/RootInlineBox.cpp:
686         (WebCore::RootInlineBox::getLogicalStartBoxWithNode):
687         (WebCore::RootInlineBox::getLogicalEndBoxWithNode):
688         * rendering/RootInlineBox.h:
689         * rendering/svg/SVGInlineTextBox.cpp:
690         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
691         (WebCore::SVGInlineTextBox::releasePaintingResource):
692         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
693         * rendering/svg/SVGRootInlineBox.cpp:
694         (WebCore::SVGRootInlineBox::closestLeafChildForPosition):
695         (WebCore::findFirstAndLastAttributesInVector):
696         * rendering/svg/SVGRootInlineBox.h:
697
698 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
699
700         More modern loops in RenderLayer.cpp
701         https://bugs.webkit.org/show_bug.cgi?id=143175
702
703         Reviewed by Ryosuke Niwa.
704
705         Use modern loops in more places in RenderLayer.app.
706
707         * rendering/RenderLayer.cpp:
708         (WebCore::RenderLayer::update3DTransformedDescendantStatus):
709         (WebCore::RenderLayer::paint):
710         (WebCore::performOverlapTests):
711         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
712         (WebCore::RenderLayer::paintList):
713         (WebCore::RenderLayer::collectFragments):
714         (WebCore::RenderLayer::updatePaintingInfoForFragments):
715         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
716         (WebCore::RenderLayer::calculateClipRects):
717
718 2015-03-27  Simon Fraser  <simon.fraser@apple.com>
719
720         nullptr cleanup in RenderLayer
721         https://bugs.webkit.org/show_bug.cgi?id=143174
722
723         Reviewed by Ryosuke Niwa.
724
725         Replace 0 with nullptr in RenderLayer.cpp.
726
727         * rendering/RenderLayer.cpp:
728         (WebCore::RenderLayer::filterRenderer):
729         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
730         (WebCore::RenderLayer::updateLayerPositionsAfterOverflowScroll):
731         (WebCore::RenderLayer::positionNewlyCreatedOverflowControls):
732         (WebCore::RenderLayer::enclosingOverflowClipLayer):
733         (WebCore::RenderLayer::enclosingCompositingLayer):
734         (WebCore::RenderLayer::enclosingCompositingLayerForRepaint):
735         (WebCore::RenderLayer::enclosingFilterLayer):
736         (WebCore::RenderLayer::enclosingFilterRepaintLayer):
737         (WebCore::RenderLayer::clippingRootForPainting):
738         (WebCore::RenderLayer::transparentPaintingAncestor):
739         (WebCore::transparencyClipBox):
740         (WebCore::RenderLayer::removeChild):
741         (WebCore::RenderLayer::removeOnlyThisLayer):
742         (WebCore::RenderLayer::insertOnlyThisLayer):
743         (WebCore::accumulateOffsetTowardsAncestor):
744         (WebCore::RenderLayer::enclosingScrollableArea):
745         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree):
746         (WebCore::RenderLayer::enclosingElement):
747         (WebCore::RenderLayer::enclosingFlowThreadAncestor):
748         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
749         (WebCore::RenderLayer::hitTestLayer):
750         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
751         (WebCore::RenderLayer::hitTestLayerByApplyingTransform):
752         (WebCore::RenderLayer::hitTestList):
753         (WebCore::RenderLayer::updateClipRects):
754         (WebCore::RenderLayer::clipRects):
755         (WebCore::RenderLayer::calculateClipRects):
756
757 2015-03-27  Gwang Yoon Hwang  <yoon@igalia.com>
758
759         [TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
760         https://bugs.webkit.org/show_bug.cgi?id=142386
761
762         Reviewed by Žan Doberšek.
763
764         TextureMapper and TextureMapperGL are bloated and tightly coupled with
765         BitmapTexture. We should move these classes to seperated file of their own.
766         Also, this patch removes friend relationship from TextureMapperGL and  its
767         subsidiary classes.
768
769         The main purpose of this refactoring is to expose BitmapTexturePool to
770         renderers of platformlayers like Video and Canvas. By doing this, each
771         renderer can acquire textures from the global texture pool to paint
772         their contents directly.
773
774         No new tests needed.
775
776         * PlatformEfl.cmake:
777         * PlatformGTK.cmake:
778         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
779         Include BitmapTextureGL and BitmapTexturePool explicitly
780
781         * platform/graphics/texmap/BitmapTexture.cpp: Added.
782         * platform/graphics/texmap/BitmapTexture.h: Added.
783         (WebCore::BitmapTexture::updateContents):
784         Exclude BitmapTexture class from TextureMapper
785
786         * platform/graphics/texmap/BitmapTextureGL.cpp: Added.
787         * platform/graphics/texmap/BitmapTextureGL.h: Added.
788         Exclude BitmapTextureGL class from TextureMapperGL
789         (WebCore::BitmapTextureGL::clipStack): Added.
790         Add the getter for clipStack for TextureMapperGL
791         (WebCore::BitmapTextureGL::Bind): Deleted.
792         (WebCore::BitmapTextureGL::BindAsSurface): Added.
793         Bind used TextureMapperGL's internal data directly to compute projection matrix as a friend class,
794         However, TextureMapperGL can compute projection matrix itself after binding job, so this
795         friend ship is not needed. Also, this patch renames Bind to BindAsSurface to remove ambiguity.
796
797         * platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Added.
798         * platform/graphics/texmap/BitmapTextureImageBuffer.h: Added.
799         Exclude BitmapTextureImageBuffer class from TextureMapperImageBuffer
800
801         * platform/graphics/texmap/BitmapTexturePool.cpp: Added.
802         * platform/graphics/texmap/BitmapTexturePool.h: Added.
803         Exclude BitmapTexturePool class from TextureMapperGL
804         (WebCore::BitmapTexturePool::acquireTexture):
805         Modified to use passed GraphicsContext3D instead of TextureMapperGL to remove redundant coupling
806
807         * platform/graphics/texmap/TextureMapper.cpp:
808         * platform/graphics/texmap/TextureMapper.h:
809         Remove BitmapTexturePool and BitmapTexture from its implementation.
810
811         * platform/graphics/texmap/TextureMapperGL.cpp:
812         * platform/graphics/texmap/TextureMapperGL.h:
813         Remove BitmapTextureGL from its implementation.
814         (WebCore::TextureMapperGL::TextureMapperGL):
815         (WebCore::TextureMapperGL::clipStack):
816         (WebCore::TextureMapperGL::bindSurface):
817         (WebCore::TextureMapperGL::currentSurface):
818         Add a getter of the current surface for filtering operation in BitmapTextureGL.
819         It would be clear to move filtering operation from BitmapTextureGL to TextureMapperGL later.
820
821         (WebCore::TextureMapperGL::ClipStack):
822         Move inner class declaration to public.
823
824         * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
825         * platform/graphics/texmap/TextureMapperImageBuffer.h:
826         Remove BitmapTextureImageBuffer from its implementation.
827
828 2015-03-27  Tim Horton  <timothy_horton@apple.com>
829
830         WebProcess started by editable WKWebView spends 15% of its initialization time loading DataDetectors
831         https://bugs.webkit.org/show_bug.cgi?id=143142
832         <rdar://problem/20324495>
833
834         Reviewed by Anders Carlsson.
835
836         Calling DataDetectorsLibrary() is expensive; we should avoid doing it
837         until actually necessary. When loading a page that makes a caret selection,
838         ServicesOverlayController was calling DataDetectorsLibrary() (ignoring the fact
839         that a caret selection can't have any services associated with it) to avoid
840         crashing on systems where DataDetectors is not available. Instead, we should
841         first check if there's anything to do, and then check for the existence
842         of DataDetectors.
843
844         * page/mac/ServicesOverlayController.mm:
845         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
846         Build the list of phone number ranges, and bail (clearing the potential highlights)
847         if it is empty, before calling DataDetectorsLibrary().
848
849         (WebCore::ServicesOverlayController::buildSelectionHighlight):
850         Check the list of selection rects, and bail (clearing the potential highlights)
851         if it is empty, before calling DataDetectorsLibrary().
852
853 2015-03-27  Jer Noble  <jer.noble@apple.com>
854
855         [Mac] Safari fails to fire page "load" event with video[preload=none]
856         https://bugs.webkit.org/show_bug.cgi?id=143147
857
858         Reviewed by Simon Fraser.
859
860         Test: media/video-page-load-preload-none.html
861
862         When told to load() when preload == None, set the networkState to Idle.
863         This causes HTMLMediaElement to set the shouldDelayLoadEvent flag to
864         false, and allows the page's 'load' event to fire.
865
866         Drive-by fix: add setNetworkState() and setReadyState() methods to
867         MediaPlayerPrivateAVFoundation, reducing a bunch of code duplication.
868
869         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
870         (WebCore::MediaPlayerPrivateAVFoundation::load):
871         (WebCore::MediaPlayerPrivateAVFoundation::setNetworkState):
872         (WebCore::MediaPlayerPrivateAVFoundation::setReadyState):
873         (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
874         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
875
876 2015-03-27  Alexey Proskuryakov  <ap@apple.com>
877
878         Calling crypto.webkitSubtle.generateKey causes page memory to never be released
879         https://bugs.webkit.org/show_bug.cgi?id=143151
880         rdar://problem/18940687
881
882         Reviewed by Tim Horton.
883
884         * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::generatePair): Don't.
885
886 2015-03-27  Brent Fulgham  <bfulgham@apple.com>
887
888         Null dereference in InbandMetadataTextTrack handling
889         https://bugs.webkit.org/show_bug.cgi?id=143144
890         <rdar://problem/18983250>
891
892         Reviewed by Eric Carlson.
893
894         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
895         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Check for null return value from
896         'client()', just like we do in all other methods.
897
898 2015-03-27  Oliver Hunt  <oliver@apple.com>
899
900         Forward additional CFNetwork ATS information to child processes
901         https://bugs.webkit.org/show_bug.cgi?id=143136
902
903         Reviewed by Anders Carlsson.
904
905         Declare SPI.
906
907         * platform/spi/cf/CFNetworkSPI.h:
908
909 2015-03-27  Chris Dumez  <cdumez@apple.com>
910
911         [WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
912         https://bugs.webkit.org/show_bug.cgi?id=143125
913         <rdar://problem/20321172>
914
915         Reviewed by Antti Koivisto.
916
917         Export a couple of extra symbols.
918
919         * platform/network/ResourceResponseBase.h:
920
921 2015-03-27  Jer Noble  <jer.noble@apple.com>
922
923         HTMLMediaElement will fire 'seeked' before seek completes, leading to currentTime discontinuities.
924         https://bugs.webkit.org/show_bug.cgi?id=143132
925
926         Reviewed by Eric Carlson.
927
928         When seeking, if the ready state rises to >= HAVE_CURRENT_DATA, we will fire the 'seeked'
929         event and continue playback. However, if a media engine updates the ready state before its
930         seek operation actually completes, the currentTime it returns may still be the time before
931         the seek.
932
933         Wait until both the ready state rises to HAVE_CURRENT_DATA and m_player->seeking() returns
934         false before firing the 'seeked' event.
935
936         * html/HTMLMediaElement.cpp:
937         (WebCore::HTMLMediaElement::parseAttribute):
938
939 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
940
941         Make some more objects use FastMalloc
942         https://bugs.webkit.org/show_bug.cgi?id=143122
943
944         Reviewed by Csaba Osztrogonác.
945
946         * Modules/geolocation/GeolocationController.h:
947         * Modules/geolocation/NavigatorGeolocation.h:
948         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
949         * Modules/notifications/NotificationController.h:
950         * Modules/webdatabase/DatabaseServer.h:
951         * css/CSSFontFaceSource.h:
952         * html/HTMLMediaSession.h:
953         * inspector/InspectorIndexedDBAgent.h:
954         * inspector/InspectorReplayAgent.h:
955         * page/CaptionUserPreferencesMediaAF.h:
956         * page/PageConsoleClient.h:
957         * page/PageDebuggable.h:
958         * page/animation/CSSPropertyAnimation.cpp:
959         * page/mac/ServicesOverlayController.h:
960         * platform/RemoteCommandListener.h:
961         * platform/Timer.h:
962         * platform/audio/MediaSessionManager.h:
963         * platform/mac/SystemSleepListenerMac.h:
964         * platform/mac/ThemeMac.h:
965         * rendering/svg/RenderSVGResourceSolidColor.h:
966         * replay/ReplayController.h:
967
968 2015-03-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
969
970         FEMorphology::platformApplyGeneric() should bail out if the radius is less than or equal to zero.
971         https://bugs.webkit.org/show_bug.cgi?id=142885.
972
973         Reviewed by Dean Jackson.
974
975         FEMorphology class implementation code clean up.
976         
977         Tests: svg/filters/feMorphology-radius-cases.svg
978
979         * platform/graphics/filters/FEMorphology.cpp:
980         (WebCore::shouldSupersedeExtremum): Reuse code instead of repeating it and
981         use < and > instead of =< and >=.
982         
983         (WebCore::pixelArrayIndex): Returns the array index of a pixel in an image
984         buffer, given: position(x, y), image width and the color channel.
985         
986         (WebCore::columnExtremum): Returns the extremum of a column of pixels.
987         
988         (WebCore::kernelExtremum): Returns the extremum of a filter kernel.
989         
990         (WebCore::FEMorphology::platformApplyGeneric): Apply some code clean-up.
991         The kernel size should be equal to radius of the filter. The extra pixel
992         was causing the resulted image to be asymmetric in some cases.
993         
994         (WebCore::FEMorphology::platformApplyDegenerate):
995         (WebCore::FEMorphology::platformApplySoftware): After applying scaling, we
996         still need to check the resulted radius is negative (overflow case) or less
997         than one (zero radius case) and treat these cases differently.
998         
999         (WebCore::FEMorphology::morphologyOperator): Deleted.
1000         (WebCore::FEMorphology::radiusX): Deleted.
1001         (WebCore::FEMorphology::radiusY): Deleted.
1002         * platform/graphics/filters/FEMorphology.h:
1003         (WebCore::FEMorphology::morphologyOperator):
1004         (WebCore::FEMorphology::radiusX):
1005         (WebCore::FEMorphology::radiusY):
1006         Move a single line functions from the source file to the header file.
1007
1008 2015-03-27  Antti Koivisto  <antti@apple.com>
1009
1010         Move CacheValidation to platform
1011         https://bugs.webkit.org/show_bug.cgi?id=143133
1012
1013         Reviewed by Chris Dumez.
1014
1015         It deals with platform types only and is currently violating layering.
1016
1017         * WebCore.xcodeproj/project.pbxproj:
1018         * loader/cache/CacheValidation.cpp: Removed.
1019         * loader/cache/CacheValidation.h: Removed.
1020         * platform/network/CacheValidation.cpp: Copied from Source/WebCore/loader/cache/CacheValidation.cpp.
1021         * platform/network/CacheValidation.h: Copied from Source/WebCore/loader/cache/CacheValidation.h.
1022
1023 2015-03-27  Commit Queue  <commit-queue@webkit.org>
1024
1025         Unreviewed, rolling out r177896.
1026         https://bugs.webkit.org/show_bug.cgi?id=142978
1027
1028         Loading libgstclutter.so in-process hangs web process
1029         (Requested by mcatanzaro on #webkit).
1030
1031         Reverted changeset:
1032
1033         "[GStreamer] Disable gst-plugin-scanner if seccomp filters are
1034         enabled"
1035         https://bugs.webkit.org/show_bug.cgi?id=140069
1036         http://trac.webkit.org/changeset/177896
1037
1038 2015-03-26  Antti Koivisto  <antti@apple.com>
1039
1040         Respect cache-control directives in request
1041         https://bugs.webkit.org/show_bug.cgi?id=143121
1042         rdar://problem/19714040
1043
1044         Reviewed by Chris Dumez.
1045
1046         Test: http/tests/cache/disk-cache/disk-cache-request-headers.html
1047
1048         * loader/cache/CacheValidation.cpp:
1049         (WebCore::isCacheHeaderSeparator):
1050         (WebCore::isControlCharacter):
1051         (WebCore::trimToNextSeparator):
1052         (WebCore::parseCacheHeader):
1053         (WebCore::parseCacheControlDirectives):
1054
1055             Factor Cache-control parsing here so it can be used for both requests and responses.
1056
1057         * loader/cache/CacheValidation.h:
1058         * platform/network/ResourceRequestBase.h:
1059         * platform/network/ResourceResponseBase.cpp:
1060         (WebCore::ResourceResponseBase::ResourceResponseBase):
1061         (WebCore::ResourceResponseBase::parseCacheControlDirectives):
1062         (WebCore::ResourceResponseBase::cacheControlContainsNoCache):
1063         (WebCore::ResourceResponseBase::cacheControlContainsNoStore):
1064         (WebCore::ResourceResponseBase::cacheControlContainsMustRevalidate):
1065         (WebCore::ResourceResponseBase::cacheControlMaxAge):
1066         (WebCore::isCacheHeaderSeparator): Deleted.
1067         (WebCore::isControlCharacter): Deleted.
1068         (WebCore::trimToNextSeparator): Deleted.
1069         (WebCore::parseCacheHeader): Deleted.
1070         * platform/network/ResourceResponseBase.h:
1071
1072 2015-03-27  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1073
1074         [GStreamer] share GL context in pipeline, part 2
1075         https://bugs.webkit.org/show_bug.cgi?id=143049
1076
1077         Reviewed by Carlos Garcia Campos.
1078
1079         This patch, instead of cluttering the GstGL attributes creation in
1080         ::handleSyncMessage(), creates a new method ::ensureGstGLContext(),
1081         where those attributes are defined. This method is guarded by
1082         USE(GSTREAMER_GL)
1083
1084         ::handlSyncMessage() shall return nothing, according to GStreamer
1085         documentation, not a boolean.
1086
1087         The GstGL attributes are now GRefPtr<> to avoid memory leaks.
1088
1089         The GstGLAPI and GstGLPlatform are now set given by the pre-processor
1090         directives, and the code in ::ensureGstGLContext() is simpler.
1091
1092         No new tests because this is platform specific and it depends in the
1093         run-time availability and configurations of GstGL elements.
1094
1095         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1096         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1097         Don't initialise the GstGL attributes since are GRefPtr<>
1098         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Changed the
1099         signature to use void instead of gboolean.
1100         (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): New method.
1101         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1102
1103 2015-03-26  Jeremy Jones  <jeremyj@apple.com>
1104
1105         Optimized Fullscreen fails to cleanup because of no longer necessary release of m_playerController in exitFullscreen()
1106         https://bugs.webkit.org/show_bug.cgi?id=143120
1107
1108         Reviewed by Eric Carlson.
1109
1110         We used to release m_playerController in WebVideoFullscreenInterfaceAVKit::exitFullscreen() in order to make sure 
1111         media state was reset. This is no longer necessary as we now have a way the model can explicitly request resetting the
1112         media state via resetMediaState(). m_playerController is already released in 
1113         WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal(). Releasing it prematurely can actually prevent the exit
1114         fullscreen process from completing successfully.
1115
1116         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1117         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
1118
1119 2015-03-26  Zalan Bujtas  <zalan@apple.com>
1120
1121         Inline continuation code should not take anonymous containing wrapper granted.
1122         https://bugs.webkit.org/show_bug.cgi?id=133312
1123
1124         Reviewed by Dave Hyatt.
1125
1126         It's wrong to assume that when RenderInline is part of an inline continuation, its containing block
1127         is an anonymous wrapper and its sibling might be a block level renderer.
1128         When the inline continuation is no longer needed, for example when the block level renderer that initiated the continuation
1129         is detached from the render tree, the inline renderes still continue to form continuation.(however they no longer require
1130         anonymous wrappers)
1131
1132         Test: fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation.html
1133
1134         * rendering/RenderInline.cpp:
1135         (WebCore::updateStyleOfAnonymousBlockContinuations):
1136         (WebCore::RenderInline::styleDidChange):
1137
1138 2015-03-26  Tim Horton  <timothy_horton@apple.com>
1139
1140         REGRESSION (r181358 and r181507): Lots of sites think that we support touch events on OS X
1141         https://bugs.webkit.org/show_bug.cgi?id=142888
1142         <rdar://problem/20227304>
1143
1144         Reviewed by Beth Dakin.
1145
1146         * dom/Document.idl:
1147         * dom/Element.idl:
1148         * html/HTMLBodyElement.idl:
1149         * html/HTMLFrameSetElement.idl:
1150         * page/DOMWindow.idl:
1151         Re-conditionalize a lot of event listeners; sites test ("ontouchstart" in window), which
1152         is not covered by NotEnumerable, and so r181358 and r181507 broke a bunch of sites
1153         (apple.com, blaze.com, anything using nicescroll.js, etc.) by causing them to think
1154         that (Mac) Safari was touch-enabled.
1155
1156 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
1157
1158         "lineNo" does not match WebKit coding style guidelines
1159         https://bugs.webkit.org/show_bug.cgi?id=143119
1160
1161         Reviewed by Michael Saboff.
1162
1163         We can afford to use whole words.
1164
1165         * bindings/js/JSLazyEventListener.cpp:
1166         (WebCore::JSLazyEventListener::initializeJSFunction):
1167         * bindings/js/JSMainThreadExecStateInstrumentation.h:
1168         (WebCore::JSMainThreadExecState::instrumentFunctionCall):
1169         * inspector/InspectorDOMAgent.cpp:
1170         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1171         * testing/Internals.cpp:
1172         (WebCore::Internals::parserMetaData):
1173
1174 2015-03-26  Roger Fong  <roger_fong@apple.com>
1175
1176         Apply blur effect to media control background.
1177         https://bugs.webkit.org/show_bug.cgi?id=143116.
1178         <rdar://problem/20316964>.
1179
1180         Reviewed by Brent Fulgham.
1181
1182         There are still a few issues, like the borders of the controls being blurred with black,
1183         and the volume slider background not showing the blur effect. Will fix those separately.
1184
1185         Add CSS for new divs to create blur effect using back drop filters and blend modes.
1186         * Modules/mediacontrols/mediaControlsApple.css:
1187         (audio::-webkit-media-controls-panel):
1188         (audio::-webkit-media-controls-panel-tint):
1189         (audio::-webkit-media-controls-panel-background):
1190         (audio::-webkit-media-controls-panel .volume-box):
1191         (audio::-webkit-media-controls-volume-slider-container-background):
1192         (audio::-webkit-media-controls-volume-slider-container-tint):
1193         (audio::-webkit-media-controls-toggle-closed-captions-button): Adjust fill.
1194         (audio::-webkit-media-controls-fullscreen-button): Adjust fill.
1195         (audio::-webkit-media-controls-fullscreen-button.exit): Adjust fill.
1196         (video:-webkit-full-screen::-webkit-media-controls-panel):
1197         (audio:-webkit-full-screen::-webkit-media-controls-panel-tint):
1198         (audio:-webkit-full-screen::-webkit-media-controls-panel-background):
1199         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
1200         (video:-webkit-full-screen::-webkit-media-controls-play-button):
1201         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
1202         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
1203         (video:-webkit-full-screen::-webkit-media-controls-timeline-container):
1204         (video:-webkit-full-screen::-webkit-media-controls-status-display):
1205         (audio::-webkit-media-controls-panel .volume-box:active): Deleted.
1206         * Modules/mediacontrols/mediaControlsApple.js:
1207         (Controller.prototype.createControls):
1208         (Controller.prototype.configureInlineControls): Add new divs for blurred background effect.
1209         (Controller.prototype.configureFullScreenControls): Ditto.
1210         (Controller.prototype.handlePanelMouseDown): The tint div is now in front.
1211         (Controller.prototype.drawTimelineBackground): Adjust colors to make border look better with new background.
1212         (Controller.prototype.drawVolumeBackground): Ditto.
1213
1214 2015-03-26  Geoffrey Garen  <ggaren@apple.com>
1215
1216         Assertion firing in JavaScriptCore/parser/parser.h for statesman.com site
1217         https://bugs.webkit.org/show_bug.cgi?id=142974
1218
1219         Reviewed by Joseph Pecoraro.
1220
1221         * bindings/js/JSLazyEventListener.cpp:
1222         (WebCore::JSLazyEventListener::initializeJSFunction): Use the new override
1223         line number API to guarantee that errors will map to the .html file locations
1224         that we like.
1225
1226         * bindings/js/ScriptController.cpp:
1227         (WebCore::ScriptController::eventHandlerPosition): Added a FIXME to cover
1228         some cases where our line and column numbers are still nonsense.
1229
1230 2015-03-26  Beth Dakin  <bdakin@apple.com>
1231
1232         Relevant repainted objects callback is inaccurate and inconsistent for PDF 
1233         documents
1234         https://bugs.webkit.org/show_bug.cgi?id=143118
1235         -and corresponding-
1236         rdar://problem/13371582
1237
1238         Reviewed by Tim Horton.
1239
1240         Investigating this bug resulted in finding two things that should change for the 
1241         relevant repainted objects heuristic. First, we should not count any objects 
1242         painted while updating control tints. And secondly, we should not use it at all 
1243         for plugin documents. In other documents, we count the plugin area as “painted” 
1244         when we get to paint whether or not the plugin has actually loaded. This is 
1245         intentional because it allows us to account for chunks of the page that will be 
1246         filled in by possibly slow-loading ads. However, if the plugin is the whole 
1247         document, then the heuristic just doesn’t make any sense and it leads to 
1248         inconsistent behavior at different window sizes. So we’ll only count plugins when 
1249         the document is not a plugin document. 
1250
1251         Don’t count objects during this paint!
1252         * page/FrameView.cpp:
1253         (WebCore::FrameView::updateControlTints):
1254         * page/Page.h:
1255         (WebCore::Page::setIsCountingRelevantRepaintedObjects):
1256
1257         Make sure the document is not a plugin document.
1258         * rendering/RenderEmbeddedObject.cpp:
1259         (WebCore::RenderEmbeddedObject::paint):
1260
1261 2015-03-26  Alex Christensen  <achristensen@webkit.org>
1262
1263         Progress towards CMake on Mac.
1264         https://bugs.webkit.org/show_bug.cgi?id=143112
1265
1266         Reviewed by Chris Dumez.
1267
1268         * CMakeLists.txt:
1269         * PlatformEfl.cmake:
1270         * PlatformGTK.cmake:
1271         * PlatformMac.cmake:
1272         * platform/graphics/mac/IconMac.mm:
1273
1274 2015-03-26  Jer Noble  <jer.noble@apple.com>
1275
1276         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
1277         https://bugs.webkit.org/show_bug.cgi?id=142970
1278
1279         Reviewed by Eric Carlson.
1280
1281         isMainThread() will (ironically) return true if called from the web thread. Rather than dispatch
1282         synchronously to the main thread to allocate the _volumeView, dispatch asynchronously and handle
1283         the case where the MPVolumeView has not yet been created.
1284
1285         * platform/audio/ios/MediaSessionManagerIOS.mm:
1286         (-[WebMediaSessionHelper allocateVolumeView]): Dispatch to the main thread to allocate. Move notification
1287             registration to -setVolumeView:.
1288         (-[WebMediaSessionHelper setVolumeView:]): Added. Register/Unregister for route availablitiy notifications.
1289         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Handle the possibility of a nil _volumeView.
1290
1291 2015-03-26  Benjamin Poulain  <bpoulain@apple.com>
1292
1293         Fix state maching debugging after r181964
1294         https://bugs.webkit.org/show_bug.cgi?id=143082
1295
1296         Reviewed by Alex Christensen.
1297
1298         * contentextensions/ContentExtensionCompiler.cpp:
1299         (WebCore::ContentExtensions::compileRuleList):
1300
1301 2015-03-25  David Hyatt  <hyatt@apple.com>
1302
1303         Improve the offsetWidth/Height layout optimization
1304         https://bugs.webkit.org/show_bug.cgi?id=143008
1305
1306         Reviewed by Zalan Bujtas.
1307
1308         * dom/Document.cpp:
1309         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1310         * dom/Document.h:
1311         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
1312         the positioning restrictions on the optimization check.
1313
1314         * dom/Element.cpp:
1315         (WebCore::Element::offsetWidth):
1316         (WebCore::Element::offsetHeight):
1317         Change to use Element& instead of Element*.
1318
1319         (WebCore::Element::clientWidth):
1320         (WebCore::Element::clientHeight):
1321         (WebCore::Element::scrollWidth):
1322         (WebCore::Element::scrollHeight):
1323         Turn on the optimization for clientWidth/Height and scrollWidth/Height.
1324
1325 2015-03-26  Brady Eidson  <beidson@apple.com>
1326
1327         Apply ContentExtension actions after redirects.
1328         <rdar://problem/20062613> and https://bugs.webkit.org/show_bug.cgi?id=143055
1329
1330         Reviewed by Alex Christensen.
1331
1332         Tests: http/tests/contentextensions/loading/main-resource-redirect-blocked.php
1333                http/tests/contentextensions/subresource-redirect-blocked.html
1334
1335         This patch moves the "run a URL against the content extension" code from CachedResourceLoader to
1336         the ContentExtensionsBackend.
1337
1338         That allows it to be shared between the CachedResourceLoader where loads are initiated and 
1339         ResourceLoader where redirects are handled.
1340
1341         * contentextensions/ContentExtension.cpp:
1342         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1343
1344         * contentextensions/ContentExtensionsBackend.cpp:
1345         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1346         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
1347         * contentextensions/ContentExtensionsBackend.h:
1348
1349         * loader/NetscapePlugInStreamLoader.cpp:
1350         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
1351
1352         * loader/ResourceLoadInfo.h:
1353
1354         * loader/ResourceLoader.cpp:
1355         (WebCore::ResourceLoader::ResourceLoader):
1356         (WebCore::ResourceLoader::willSendRequest):
1357         * loader/ResourceLoader.h:
1358
1359         * loader/SubresourceLoader.cpp:
1360         (WebCore::SubresourceLoader::SubresourceLoader):
1361
1362         * loader/cache/CachedResourceLoader.cpp:
1363         (WebCore::CachedResourceLoader::requestResource):
1364
1365         * page/UserContentController.cpp:
1366         (WebCore::UserContentController::processContentExtensionRulesForLoad):
1367         (WebCore::UserContentController::actionsForResourceLoad): Deleted.
1368         (WebCore::UserContentController::globalDisplayNoneStyleSheet): Deleted.
1369         (WebCore::UserContentController::displayNoneCSSRule): Deleted.
1370         * page/UserContentController.h:
1371
1372 2015-03-26  Myles C. Maxfield  <mmaxfield@apple.com>
1373
1374         Crash when laying out (char)0
1375         https://bugs.webkit.org/show_bug.cgi?id=143103
1376
1377         Reviewed by Dean Jackson.
1378
1379         We currently cache a character -> Font mapping in a HashMap.
1380         However, keys in Hashmaps can't be 0. This patch simply skips
1381         the cache in this case.
1382
1383         No new tests, for now. I'm having trouble creating a test because
1384         the site that causes this bug generates their page using script,
1385         and the script is all minified, and difficult to understand. I
1386         will contact the owner of the site and ask for and unminified
1387         version of their sources. However, I don't want to that to block
1388         this tiny fix from going in.
1389
1390         * platform/graphics/Font.cpp:
1391         (WebCore::Font::systemFallbackFontForCharacter):
1392
1393 2015-03-26  Jer Noble  <jer.noble@apple.com>
1394
1395         [Mac][EME] Crash at com.apple.WebCore: WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys + 177
1396         https://bugs.webkit.org/show_bug.cgi?id=143080
1397
1398         Reviewed by Eric Carlson.
1399
1400         Null-check m_certificate before dereferencing.
1401
1402         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1403         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys):
1404
1405 2015-03-26  Chris Fleizach  <cfleizach@apple.com>
1406
1407         AX: [role="button"][aria-pressed] should be exposed as AXCheckbox:AXToggleButton, with role description of "toggle button"
1408         https://bugs.webkit.org/show_bug.cgi?id=115298
1409
1410         Reviewed by Mario Sanchez Prada.
1411
1412         A role=button + aria-pressed object should be exposed as AXCheckbox on Mac now. It should also convert the
1413         aria-pressed state into a 0, 1, 2 number value for the Mac.
1414
1415         Test: platform/mac/accessibility/aria-pressed-button-attributes.html
1416
1417         * accessibility/AccessibilityObject.cpp:
1418         (WebCore::AccessibilityObject::checkboxOrRadioValue):
1419         * accessibility/AccessibilityObject.h:
1420         (WebCore::AccessibilityObject::isToggleButton):
1421         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1422         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1423         (createAccessibilityRoleMap):
1424         (-[WebAccessibilityObjectWrapper subrole]):
1425         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1426
1427 2015-03-25  Dean Jackson  <dino@apple.com>
1428
1429         CSS blend modes do not parse when in the shadow tree
1430         https://bugs.webkit.org/show_bug.cgi?id=143067
1431         <rdar://problem/20302662>
1432
1433         Reviewed by Anders Carlson.
1434
1435         The media controls style sheets are injected as UA stylesheets
1436         when we come across a <video> or <audio> element. These stylesheets
1437         have a different parsing context than the document stylesheets -
1438         one that uses the default constructor, which initializes some
1439         features like cssCompositingEnabled to false without checking
1440         the runtime state.
1441
1442         The easy fix is to use the global state to initialize the context.
1443
1444         Unfortunately we can't test this since it only occurs in the shadow
1445         tree.
1446
1447         * css/CSSParser.cpp:
1448         (WebCore::CSSParserContext::CSSParserContext): Check the state
1449         of RuntimeEnabledFeatures to initialize CSS Regions and
1450         CSS Compositing (Blending).
1451
1452 2015-03-25  Chris Fleizach  <cfleizach@apple.com>
1453
1454         AX: table cells that use display:block render the table inaccessible to VoiceOver
1455         https://bugs.webkit.org/show_bug.cgi?id=143007
1456
1457         Reviewed by Mario Sanchez Prada.
1458
1459         When display:block is used on a table cell, it was being ignored because it was anonymous.
1460         This is still a valid scenario however if it's still inside of a valid table.
1461
1462         Test: accessibility/table-cell-display-block.html
1463
1464         * accessibility/AccessibilityTableCell.cpp:
1465         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored):
1466
1467 2015-03-25  Tim Horton  <timothy_horton@apple.com>
1468
1469         Add a preference to prevent "user-scalable=no" from having any effect
1470         https://bugs.webkit.org/show_bug.cgi?id=143032
1471
1472         Reviewed by Sam Weinig.
1473
1474         * page/ViewportConfiguration.cpp:
1475         (WebCore::ViewportConfiguration::ViewportConfiguration):
1476         (WebCore::ViewportConfiguration::allowsUserScaling):
1477         * page/ViewportConfiguration.h:
1478         (WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
1479         If forceAlwaysUserScalable is set to true, force "user-scalable=yes".
1480
1481 2015-03-25  Dan Bernstein  <mitz@apple.com>
1482
1483         Another attempt to get the iOS EWS building again.
1484
1485         * WebCore.xcodeproj/project.pbxproj:
1486
1487 2015-03-25  Alex Christensen  <achristensen@webkit.org>
1488
1489         Add case-insensitive checks to DFA bytecode.
1490         https://bugs.webkit.org/show_bug.cgi?id=142977
1491
1492         Reviewed by Benjamin Poulain.
1493
1494         * contentextensions/DFABytecode.h:
1495         (WebCore::ContentExtensions::instructionSizeWithArguments):
1496         * contentextensions/DFABytecodeCompiler.cpp:
1497         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
1498         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
1499         Add case-insensitive bytecode.
1500         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
1501         Check to see if case-insensitive bytecodes can be used.
1502         (WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
1503         * contentextensions/DFABytecodeCompiler.h:
1504         (WebCore::ContentExtensions::DFABytecodeCompiler::Range::Range):
1505         Added Range structure to be able to count the ranges in a future patch deciding if we want to use jump tables.
1506         * contentextensions/DFABytecodeInterpreter.cpp:
1507         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1508         Interpret case-insensitive bytecodes.
1509
1510 2015-03-25  Sam Weinig  <sam@webkit.org>
1511
1512         Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
1513
1514         * contentextensions/ContentExtensionCompiler.cpp:
1515         (WebCore::ContentExtensions::compileRuleList):
1516         * contentextensions/ContentExtensionCompiler.h:
1517         * contentextensions/ContentExtensionParser.cpp:
1518         (WebCore::ContentExtensions::getTypeFlags):
1519
1520 2015-03-25  Sam Weinig  <sam@webkit.org>
1521
1522         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
1523         https://bugs.webkit.org/show_bug.cgi?id=143059
1524
1525         Reviewed by Alex Christensen.
1526
1527         * WebCore.xcodeproj/project.pbxproj:
1528         Add ContentExtensionError.h/cpp.
1529
1530         * contentextensions/ContentExtensionError.cpp: Added.
1531         (WebCore::ContentExtensions::contentExtensionErrorCategory):
1532         * contentextensions/ContentExtensionError.h: Added.
1533         (WebCore::ContentExtensions::make_error_code):
1534         Add ContentExtensionError enum and std::error_code adaptor.
1535
1536         * contentextensions/ContentExtensionCompiler.h:
1537         Instead of returning CompiledContentExtensionData, use a client interface
1538         to pass data. Eventually, this should be turned into a direct streaming 
1539         interface so we can write directly to a file.
1540
1541         * contentextensions/ContentExtensionCompiler.cpp:
1542         (WebCore::ContentExtensions::compileRuleList):
1543         * contentextensions/ContentExtensionParser.cpp:
1544         (WebCore::ContentExtensions::getTypeFlags):
1545         (WebCore::ContentExtensions::loadTrigger):
1546         (WebCore::ContentExtensions::loadAction):
1547         (WebCore::ContentExtensions::loadRule):
1548         (WebCore::ContentExtensions::loadEncodedRules):
1549         (WebCore::ContentExtensions::parseRuleList):
1550         * contentextensions/ContentExtensionParser.h:
1551         Convert to return an error.
1552
1553 2015-03-25  Beth Dakin  <bdakin@apple.com>
1554
1555         REGRESSION (r181660): Safari navigates to link after a starting and canceling a 
1556         force preview
1557         https://bugs.webkit.org/show_bug.cgi?id=143057
1558         -and corresponding-
1559         rdar://problem/20251436
1560
1561         Reviewed by Tim Horton.
1562
1563         This patch adds a value for ActionUpdated to the ImmediateActionStage enum. Now if 
1564         m_immediateActionStage indicates that an immediate action has either begun or 
1565         completed then we can have the same behavior.
1566         * page/EventHandler.cpp:
1567         (WebCore::EventHandler::handleMouseReleaseEvent):
1568         * page/EventHandler.h:
1569
1570 2015-03-25  Dean Jackson  <dino@apple.com>
1571
1572         MediaControls: Use font with fixed number width
1573         https://bugs.webkit.org/show_bug.cgi?id=143018
1574         <rdar://problem/20245415>
1575
1576         Reviewed by Eric Carlson.
1577
1578         Add a new font-family, specific to Apple platforms,
1579         called -apple-system-font-monospaced-numbers. This is
1580         a special variant of the system font which uses monospaced
1581         forms for the number glyphs - allowing a time reading that
1582         doesn't bounce around as the time changes.
1583
1584         * Modules/mediacontrols/mediaControlsApple.css: Media controls should
1585         use the new font.
1586         (audio::-webkit-media-controls-time-remaining-display):
1587         * Modules/mediacontrols/mediaControlsiOS.css:
1588         (audio::-webkit-media-controls-time-remaining-display):
1589
1590         * platform/graphics/ios/FontCacheIOS.mm: Request a new CTFontRef with
1591         the appropriate attributes.
1592         (WebCore::createCTFontWithFamilyNameAndWeight):
1593         * platform/graphics/mac/FontCacheMac.mm: Ditto, but NSFont.
1594         (WebCore::fontWithFamily):
1595         * platform/spi/cocoa/CoreTextSPI.h: Expose the constants for
1596         the new form so that the public SDK can build.
1597
1598 2015-03-25  Alex Christensen  <achristensen@webkit.org>
1599
1600         [Content Extensions] Add multi-DFA compiling and interpreting.
1601         https://bugs.webkit.org/show_bug.cgi?id=143010
1602
1603         Reviewed by Benjamin Poulain.
1604
1605         * contentextensions/ContentExtensionCompiler.cpp:
1606         (WebCore::ContentExtensions::compileRuleList):
1607         Compile multiple NFAs to DFAs.
1608         * contentextensions/ContentExtensionsBackend.cpp:
1609         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1610         Fixed a bug when there are no non-universal actions.
1611         We still need to report that no ignore-previous-rules was hit to apply the
1612         universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
1613         and skipped in DFABytecodeInterpreter::interpret.
1614         * contentextensions/DFABytecodeCompiler.cpp:
1615         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1616         Add a header for each DFA.
1617         * contentextensions/DFABytecodeInterpreter.cpp:
1618         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1619         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1620         Interpret as many DFAs as there are in the bytecode.
1621
1622 2015-03-25  Per Arne Vollan  <peavo@outlook.com>
1623
1624         [Win] Illegal character in project file.
1625         https://bugs.webkit.org/show_bug.cgi?id=143051
1626
1627         Reviewed by Brent Fulgham.
1628
1629         There is an illegal character in the WebCore project filter.
1630         WebCore files are shown unfiltered.
1631
1632         * WebCore.vcxproj/WebCore.vcxproj.filters:
1633
1634 2015-03-25  David Hyatt  <hyatt@apple.com>
1635
1636         Add a pref to enable the new block-inside-inline model
1637         https://bugs.webkit.org/show_bug.cgi?id=143050
1638
1639         Reviewed by Sam Weinig.
1640
1641         * page/Settings.in:
1642
1643 2015-03-25  Dan Bernstein  <mitz@apple.com>
1644
1645         iOS Simulator build fix.
1646
1647         * platform/spi/cocoa/IOSurfaceSPI.h:
1648
1649 2015-03-25  Commit Queue  <commit-queue@webkit.org>
1650
1651         Unreviewed, rolling out r181932.
1652         https://bugs.webkit.org/show_bug.cgi?id=143041
1653
1654         The test fails most of the time on bots (Requested by ap on
1655         #webkit).
1656
1657         Reverted changeset:
1658
1659         "[Content Extensions] Add multi-DFA compiling and
1660         interpreting."
1661         https://bugs.webkit.org/show_bug.cgi?id=143010
1662         http://trac.webkit.org/changeset/181932
1663
1664 2015-03-24  Dean Jackson  <dino@apple.com>
1665
1666         Source/WebCore/rendering/RenderThemeMac.mm:2181:118: error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull]
1667         https://bugs.webkit.org/show_bug.cgi?id=143039
1668
1669         Unreviewed build fix for newer versions of OS X.
1670
1671         * rendering/RenderThemeMac.mm: Define a null language parameter. This
1672         seemed better than turning the clang warning off for just that
1673         function.
1674         (WebCore::AttachmentLayout::layOutTitle):
1675         (WebCore::AttachmentLayout::layOutSubtitle):
1676
1677 2015-03-24  Dan Bernstein  <mitz@apple.com>
1678
1679         Another attempt to fix the build.
1680
1681         * WebCore.xcodeproj/project.pbxproj:
1682         * platform/spi/cocoa/QuartzCoreSPI.h:
1683
1684 2015-03-24  Alex Christensen  <achristensen@webkit.org>
1685
1686         [Content Extensions] Add multi-DFA compiling and interpreting.
1687         https://bugs.webkit.org/show_bug.cgi?id=143010
1688
1689         Reviewed by Benjamin Poulain.
1690
1691         * contentextensions/ContentExtensionCompiler.cpp:
1692         (WebCore::ContentExtensions::compileRuleList):
1693         Compile multiple NFAs to DFAs.
1694         * contentextensions/ContentExtensionsBackend.cpp:
1695         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1696         Fixed a bug when there are no non-universal actions.
1697         We still need to report that no ignore-previous-rules was hit to apply the
1698         universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
1699         and skipped in DFABytecodeInterpreter::interpret.
1700         * contentextensions/DFABytecodeCompiler.cpp:
1701         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1702         Add a header for each DFA.
1703         * contentextensions/DFABytecodeInterpreter.cpp:
1704         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1705         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1706         Interpret as many DFAs as there are in the bytecode.
1707
1708 2015-03-24  Dan Bernstein  <mitz@apple.com>
1709
1710         Tried to fix the EWS build.
1711
1712         * platform/spi/cocoa/QuartzCoreSPI.h:
1713
1714 2015-03-24  Commit Queue  <commit-queue@webkit.org>
1715
1716         Unreviewed, rolling out r181898 and r181909.
1717         https://bugs.webkit.org/show_bug.cgi?id=143034
1718
1719         Broke fast/regions/auto-size/autoheight-two-pass-layout-
1720         complex-002.html (Requested by ap on #webkit).
1721
1722         Reverted changesets:
1723
1724         "Improve the offsetWidth/Height layout optimization"
1725         https://bugs.webkit.org/show_bug.cgi?id=143008
1726         http://trac.webkit.org/changeset/181898
1727
1728         "Disable layout dimensions optimization for RenderRegions"
1729         https://bugs.webkit.org/show_bug.cgi?id=143017
1730         http://trac.webkit.org/changeset/181909
1731
1732 2015-03-24  Zhuo Li  <zachli@apple.com>
1733
1734         Scripts running in isolated world should not subject to a page's CSP about 'eval'.
1735         https://bugs.webkit.org/show_bug.cgi?id=141316.
1736
1737         Reviewed by Geoffrey Garen.
1738
1739         * bindings/js/ScriptController.cpp:
1740         (WebCore::ScriptController::initScript):
1741         We should not impose the main world Content Security Policy onto the isolated world.
1742
1743 2015-03-24  Chris Dumez  <cdumez@apple.com>
1744
1745         [Mac] Use .cpp file extension instead of .mm for SharedTimerCF and PowerObserverMac
1746         https://bugs.webkit.org/show_bug.cgi?id=143026
1747
1748         Reviewed by Andy Estes.
1749
1750         Use .cpp file extension instead of .mm for SharedTimerCF and
1751         PowerObserverMac.
1752
1753         * WebCore.xcodeproj/project.pbxproj:
1754         * platform/cf/SharedTimerCF.cpp: Renamed from Source/WebCore/platform/cf/SharedTimerCF.mm.
1755         (WebCore::timerFired):
1756         Use WTF::AutodrainedPool instead of @autoreleasepool {}.
1757
1758         * platform/mac/PowerObserverMac.cpp: Renamed from Source/WebCore/platform/mac/PowerObserverMac.mm.
1759
1760 2015-03-24  Yusuke Suzuki  <utatane.tea@gmail.com>
1761
1762         REGRESSION (r181458): Heap use-after-free in JSSetIterator destructor
1763         https://bugs.webkit.org/show_bug.cgi?id=142696
1764
1765         Reviewed and tweaked by Geoffrey Garen.
1766
1767         Use JSSetIterator/JSMapIterator to iterate over JSSet and JSMap.
1768
1769         * ForwardingHeaders/runtime/JSMapIterator.h: Added.
1770         * ForwardingHeaders/runtime/JSSetIterator.h: Added.
1771         * bindings/js/SerializedScriptValue.cpp:
1772         (WebCore::CloneSerializer::serialize):
1773
1774 2015-03-24  Dan Bernstein  <mitz@apple.com>
1775
1776         Tried to fix the iOS Simulator build.
1777
1778         * platform/spi/cocoa/QuartzCoreSPI.h:
1779
1780 2015-03-24  Benjamin Poulain  <bpoulain@apple.com>
1781
1782         Make URL filter patterns matching consistent and add a simple canonicalization step
1783         https://bugs.webkit.org/show_bug.cgi?id=142998
1784
1785         Reviewed by Alex Christensen.
1786
1787         This patch makes two changes to the url filter input:
1788         -Make the matching "Search" by default, the pattern can now appear anywhere
1789          in the URL by default.
1790         -Make the input a little less fragile: do not explode on valid input
1791          that is not formatted in a certain way.
1792
1793         To implement the search behavior, I simply add an implict ".*" in front of the patterns
1794         when that make sense.
1795
1796         To make the input more solid, we do some little modification on the input:
1797         -Remove duplicated ".*".
1798         -Remove matching suffixes that do not bring new information.
1799         -Unify all the ".*" in the same format.
1800
1801         Why do that here? That should be done through a graph analysis on the machine.
1802
1803         The reason is this is incredibly cheap compared to the graph analysis. Any state
1804         removed upfront will save the handling of several hundred nodes in the deterministic
1805         graph.
1806
1807         * contentextensions/URLFilterParser.cpp:
1808         (WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
1809         (WebCore::ContentExtensions::Term::isUniversalTransition):
1810         (WebCore::ContentExtensions::GraphBuilder::finalize):
1811         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
1812         (WebCore::ContentExtensions::GraphBuilder::fail):
1813         (WebCore::ContentExtensions::GraphBuilder::simplifySunkTerms):
1814
1815 2015-03-24  Chris Dumez  <cdumez@apple.com>
1816
1817         Regression(r181671): Caused Timer-related crashes on iOS / WK1
1818         https://bugs.webkit.org/show_bug.cgi?id=143025
1819
1820         Reviewed by Andy Estes.
1821
1822         Call CFRunLoopAddTimer() on WebThreadRunLoop() instead of
1823         CFRunLoopGetCurrent() for iOS, as we did before r181671.
1824
1825         I inadvertently changed this in r181671 when merging the Mac
1826         and iOS implementations.
1827
1828         No new tests, already covered by existing tests.
1829
1830         * platform/cf/SharedTimerCF.mm:
1831         (WebCore::setSharedTimerFireInterval):
1832
1833 2015-03-24  Dan Bernstein  <mitz@apple.com>
1834
1835         WebCore part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
1836         https://bugs.webkit.org/show_bug.cgi?id=143023
1837
1838         Reviewed by Tim Horton.
1839
1840         * platform/spi/cocoa/QuartzCoreSPI.h: Added the declaration of
1841         CARenderServerRenderLayerWithTransform.
1842
1843 2015-03-24  David Hyatt  <hyatt@apple.com>
1844
1845         Disable layout dimensions optimization for RenderRegions
1846         https://bugs.webkit.org/show_bug.cgi?id=143017
1847
1848         Reviewed by Dean Jackson.
1849
1850         * dom/Document.cpp:
1851         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1852         Turn off the optimization for regions, since auto height regions can change size
1853         without needing a layout.
1854
1855 2015-03-24  Beth Dakin  <bdakin@apple.com>
1856
1857         Add events related to force click gesture
1858         https://bugs.webkit.org/show_bug.cgi?id=142836
1859         -and corresponding-
1860         rdar://problem/20210239
1861
1862         Reviewed by Dean Jackson.
1863
1864         This patch adds six new events for the force click gesture:
1865
1866         webkitmouseforcewillbegin -> Event is sent just before mousedown to indicate that 
1867         force can be perceived if the user presses any harder. The author should prevent 
1868         default on this event to both prevent the user agent’s default force click 
1869         features and to receive the other 5 events.
1870
1871         webkitmouseforcechanged -> This event fires whenever force changes between the 
1872         mousedown and mouseup. It is a new type of mouse event that includes a force 
1873         variable which is a normalized number between 0 (corresponds to click) and 1 
1874         (corresponds to force click). In this patch, I have only added code to send this 
1875         event between mousedown and mouseforcedown, but as a followup patch, we plan to 
1876         send it through mouseup.
1877
1878         webkitmouseforcecancelled -> If the user releases their finger from the trackpad 
1879         after pressing hard enough to send webkitmouseforcewillbegin events but not hard 
1880         enough to force click, this event will be sent to indicate that the user bailed 
1881         out on the gesture.
1882
1883         webkitmouseforcedown -> The down part of the force click.
1884
1885         webkitmouseforceup -> The up part of the force click. This event is added in this 
1886         patch, but does not yet fire. That is work for a follow-up patch.
1887
1888         webkitmouseforceclick -> The equivalent of the click event for the force click. 
1889         Should fire just after webkitmouseforceup. This event is added in this patch, but 
1890         does not yet fire. That is work for a follow-up patch.
1891
1892         Add new files for WebKitMouseForceEvent to build systems.
1893         * DerivedSources.cpp:
1894         * DerivedSources.make:
1895         * WebCore.vcxproj/WebCore.vcxproj:
1896         * WebCore.vcxproj/WebCore.vcxproj.filters:
1897         * WebCore.xcodeproj/project.pbxproj:
1898         * WebCore.xcodeproj/project.pbxproj:
1899
1900         Plumbing for new events.
1901         * dom/Document.idl:
1902
1903         Code to dispatch the new events. Currently the code that calls these functions is 
1904         in WebKit2.
1905         * dom/Element.cpp:
1906         (WebCore::Element::dispatchMouseForceWillBegin):
1907         (WebCore::Element::dispatchMouseForceChanged):
1908         (WebCore::Element::dispatchMouseForceDown):
1909         (WebCore::Element::dispatchMouseForceUp):
1910         (WebCore::Element::dispatchMouseForceClick):
1911         (WebCore::Element::dispatchMouseForceCancelled):
1912         * dom/Element.h:
1913
1914         More plumbing.
1915         * dom/Element.idl:
1916         * dom/EventNames.h:
1917         * dom/EventNames.in:
1918
1919         Our new type of mouse event that includes force.
1920         * dom/WebKitMouseForceEvent.cpp: Added.
1921         (WebCore::WebKitMouseForceEventInit::WebKitMouseForceEventInit):
1922         (WebCore::WebKitMouseForceEvent::WebKitMouseForceEvent):
1923         (WebCore::WebKitMouseForceEvent::~WebKitMouseForceEvent):
1924         (WebCore::WebKitMouseForceEvent::eventInterface):
1925         * dom/WebKitMouseForceEvent.h: Added.
1926         * dom/WebKitMouseForceEvent.idl: Added.
1927
1928         More plumbing.
1929         * html/HTMLAttributeNames.in:
1930         * html/HTMLBodyElement.cpp:
1931         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
1932         * html/HTMLBodyElement.idl:
1933         * html/HTMLElement.cpp:
1934         (WebCore::HTMLElement::createEventHandlerNameMap):
1935         * page/DOMWindow.idl:
1936         * page/EventHandler.h:
1937         (WebCore::EventHandler::lastMouseDownEvent):
1938
1939 2015-03-24  Anders Carlsson  <andersca@apple.com>
1940
1941         Fix designated initializer violations
1942         https://bugs.webkit.org/show_bug.cgi?id=143016
1943         rdar://problem/20268858
1944
1945         Reviewed by Dan Bernstein.
1946
1947         Mark -[DOMObject init] as unavailable.
1948
1949         * bindings/objc/DOMObject.h:
1950         * bindings/objc/DOMObject.mm:
1951         (-[DOMObject init]):
1952
1953 2015-03-24  Benjamin Poulain  <benjamin@webkit.org>
1954
1955         CSS Selectors Level 4: enable case-insensitive attribute matching by default
1956         https://bugs.webkit.org/show_bug.cgi?id=142960
1957
1958         Reviewed by Andreas Kling.
1959
1960         All open issues have been resolved, enable the feature by default.
1961
1962         Test: fast/css/attribute-selector-case-insensitive.html
1963
1964         * css/CSSGrammar.y.in:
1965
1966 2015-03-24  Dean Jackson  <dino@apple.com>
1967
1968         MediaControls: Scrubber and Time displays have the incorrect blending
1969         https://bugs.webkit.org/show_bug.cgi?id=143011
1970         <rdar://problem/20245251>
1971
1972         Reviewed by Eric Carlson.
1973
1974         The scrubber in media controls should use plus-darker blending. Then
1975         the scrubber itself should use a slightly transparent black (55% opacity)
1976         when drawing.
1977
1978         * Modules/mediacontrols/mediaControlsiOS.css:
1979         (audio::-webkit-media-controls-timeline): Add the blend mode.
1980         * Modules/mediacontrols/mediaControlsiOS.js:
1981         (ControllerIOS.prototype.drawTimelineBackground): Start drawing with
1982         transparency. I changed the order of rendering to make it
1983         more clear we draw the three parts in left to right order.
1984
1985 2015-03-24  David Hyatt  <hyatt@apple.com>
1986
1987         Improve the offsetWidth/Height layout optimization
1988         https://bugs.webkit.org/show_bug.cgi?id=143008
1989
1990         Reviewed by Dean Jackson.
1991
1992         * dom/Document.cpp:
1993         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1994         * dom/Document.h:
1995         Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
1996         the positioning restrictions on the optimization check.
1997
1998         * dom/Element.cpp:
1999         (WebCore::Element::offsetWidth):
2000         (WebCore::Element::offsetHeight):
2001         Change to use Element& instead of Element*.
2002
2003         (WebCore::Element::clientWidth):
2004         (WebCore::Element::clientHeight):
2005         (WebCore::Element::scrollWidth):
2006         (WebCore::Element::scrollHeight):
2007         Turn on the optimization for clientWidth/Height and scrollWidth/Height.
2008
2009 2015-03-24  Yoav Weiss  <yoav@yoav.ws>
2010
2011         Stop image from displaying when src attribute is removed or emptied
2012         https://bugs.webkit.org/show_bug.cgi?id=142677
2013
2014         Reviewed by Chris Dumez.
2015
2016         Previously, we ignored empty attribute as failed URL, and didn't update the
2017         renderer when an image was removed. This patch fixes that.
2018
2019         Tests: fast/dom/HTMLImageElement/image-empty-src.html
2020                fast/dom/HTMLImageElement/image-remove-src.html
2021
2022         * loader/ImageLoader.cpp:
2023         (WebCore::ImageLoader::updateFromElement):
2024
2025 2015-03-17  Philippe Normand  <pnormand@igalia.com>
2026
2027         [OpenWebRTC] RealtimeMediaSourceCenter implementation
2028         https://bugs.webkit.org/show_bug.cgi?id=142476
2029
2030         Reviewed by Eric Carlson.
2031
2032         The old GStreamer MediaStreamCenter is replaced by the OpenWebRTC
2033         RealtimeMediaSourceCenter. It is not yet able to correctly assess
2034         MediaConstraints so it selects the first audio/video sources
2035         available through OpenWebRTC.
2036
2037         * PlatformEfl.cmake: Add new files to the build.
2038         * PlatformGTK.cmake: Ditto.
2039         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp: Removed.
2040         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Added.
2041         (WebCore::initializeOpenWebRTC): Simple function to initialize the
2042         framework, it is going to be used by the PeerConnection backend as well.
2043         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Added.
2044         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Added.
2045         (WebCore::mediaSourcesAvailableCallback): Function invoked once
2046         the media sources discovery succeeded within OpenWebRTC.
2047         (WebCore::RealtimeMediaSourceCenter::platformCenter): Instantiate
2048         the OpenWebRTC RealtimeMediaSourceCenter.
2049         (WebCore::RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr):
2050         (WebCore::RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr):
2051         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
2052         Schedule a discovery process for the capture sources.
2053         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Pick
2054         the first audio/video sources and create a MediaStream accordingly.
2055         (WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources):
2056         Not yet implemented.
2057         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
2058         Method invoked once the capture sources process succeeded. Parse
2059         them and create an internal cache of RealtimeMediaSources accordingly.
2060         (WebCore::RealtimeMediaSourceCenterOwr::firstSource): Utility
2061         function to fetch the first source of the given type from the
2062         RealtimeMediaSources cache.
2063         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h.
2064         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Added.
2065
2066 2015-03-24  Csaba Osztrogonác  <ossy@webkit.org>
2067
2068         [EFL] Add OpenWebRTC in jhbuild
2069         https://bugs.webkit.org/show_bug.cgi?id=142778
2070
2071         Reviewed by Gyuyoung Kim.
2072
2073         Original patch by Philippe Normand <pnormand@igalia.com>
2074
2075         * PlatformEfl.cmake: Add OpenWebRTC CFLAGS and LDFLAGS.
2076
2077 2015-03-23 Yoav Weiss  <yoav@yoav.ws>
2078
2079         Update empty image canvas tests and fix a related bug
2080         https://bugs.webkit.org/show_bug.cgi?id=142694
2081
2082         Reviewed by Chris Dumez.
2083
2084         During the work on https://bugs.webkit.org/show_bug.cgi?id=142677
2085         we encountered an issue with canvas tests related to empty image handling
2086         when drawn or used as a pattern. After updating these tests, an issue with
2087         pattern handling was encountered.
2088
2089         The spec, as well as Chrome's implementation, say that when an empty image
2090         is used as a pattern, createPattern should return null. See
2091         https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:check-the-usability-of-the-image-argument
2092         Instead, createPattern returned an exception in this case.
2093         This patch fixes that and makes sure that it returns a null when image loading hasn't started.
2094
2095         Tests: canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html
2096                canvas/philip/tests/2d.drawImage.incomplete.nosrc.html
2097                canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html
2098                canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html
2099                canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html
2100
2101         * html/canvas/CanvasRenderingContext2D.cpp:
2102         (WebCore::CanvasRenderingContext2D::createPattern): Return "null" if image is not fully decodeable.
2103
2104 2015-03-23  Alex Christensen  <achristensen@webkit.org>
2105
2106         Fix api tests after r181876.
2107
2108         * contentextensions/ContentExtensionsBackend.cpp:
2109         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2110         Always append a CSSDisplayNoneStyleSheet action if no ignore-previous-rules is seen.
2111         * loader/cache/CachedResourceLoader.cpp:
2112         (WebCore::CachedResourceLoader::requestResource):
2113         Changed an assertion to a null check.
2114
2115 2015-03-23  Dean Jackson  <dino@apple.com>
2116
2117         Timelines are sharing the same canvas background
2118         https://bugs.webkit.org/show_bug.cgi?id=142994
2119         <rdar://problem/20209466>
2120
2121         Reviewed by Brent Fulgham.
2122
2123         Since each MediaControl lives in an isolated world, we
2124         can't rely on a global variable to provide a unique
2125         identifier for a named canvas. The fix is to expose
2126         WebCore's UUID generator, and have each canvas use
2127         that for a name.
2128
2129         * Modules/mediacontrols/MediaControlsHost.cpp:
2130         (WebCore::MediaControlsHost::generateUUID): New method on the
2131         MediaControlsHost that generates a UUID.
2132         * Modules/mediacontrols/MediaControlsHost.h:
2133         * Modules/mediacontrols/MediaControlsHost.idl:
2134
2135         * Modules/mediacontrols/mediaControlsApple.js: Remove the global
2136         variable unique ID that wasn't working, and instead get
2137         an ID from the MediaControlsHost.
2138         (Controller.prototype.createControls):
2139         * Modules/mediacontrols/mediaControlsiOS.js:
2140         (ControllerIOS):
2141
2142 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
2143
2144         Scroll latching logic can get stuck in 'scrollable="no"' iframes
2145         https://bugs.webkit.org/show_bug.cgi?id=142789
2146         <rdar://problem/20129494>
2147
2148         Reviewed by Dean Jackson.
2149
2150         Clean up the EventHandler and latching code as follows:
2151         (1) Do not handle iframe elements as part of the normal latching logic. Instead, iframes should
2152             be evaluated during the 'platformCompleteWheelEvent' phase of processing as top-level scrolling
2153             frames.
2154         (2) Get rid of the ill-conceived notation that we should process non-mainframe and main-frame frames
2155             different.
2156         (3) Modify code to reflect that the scroll latching code really deals with overflow scrolling. Consequently,
2157             the 'findEnclosingScrollableContainer' was renamed to 'findEnclosingOverflowScroll' and does not
2158             treat iframe as a suitable target.
2159         (4) Do not create a latching state object when the container being evaluated is already scrolled to the
2160             extreme position in the direction of the mouse gesture. In this case, we want the enclosing frame
2161             to be the latching target.
2162         (5) Do not treat the state where the mouse wheel gesture has ended manual scrolling, but has not ended
2163             momentum scrolling, as an appropriate time to select a latching target.
2164
2165         * page/EventHandler.cpp:
2166         (WebCore::EventHandler::platformCompleteWheelEvent): Modify signature to remove unneeded argument.
2167         (WebCore::EventHandler::handleWheelEvent): Modify call to 'platformCompleteWheelEvent' to remove unused argument.
2168         * page/EventHandler.h:
2169         * page/mac/EventHandlerMac.mm:
2170         (WebCore::findEnclosingOverflowScroll): Renamed from 'findEnclosingScrollableContainer' and revised per the
2171         notes above.
2172         (WebCore::EventHandler::platformPrepareForWheelEvents): Remove mainFrame vs. non-mainFrame code paths and
2173         consolidate logic.
2174         (WebCore::EventHandler::platformCompleteWheelEvent): Remove unused argument. The wheel event target is no
2175         longer needed here, now that iframes are not processed by this code.
2176         (WebCore::findEnclosingScrollableContainer): Deleted.
2177         * page/scrolling/ScrollLatchingState.cpp:
2178         (WebCore::ScrollLatchingState::setPreviousWheelScrolledElement:) Switch to move operator for passing
2179         a temporary RefPtr to the the function.
2180         * page/scrolling/ScrollLatchingState.h:
2181         * platform/PlatformWheelEvent.h:
2182         (WebCore::PlatformWheelEvent::useLatchedEventElement): Recognize 'phase=ended, momentum=none' as a state
2183         that should not cause latching state to be revised.
2184
2185 2015-03-23  Anders Carlsson  <andersca@apple.com>
2186
2187         Try to fix the iOS build.
2188
2189         * platform/network/mac/CookieJarMac.mm:
2190
2191 2015-03-23  Brady Eidson  <beidson@apple.com>
2192
2193         Content extensions should apply css selectors
2194         https://bugs.webkit.org/show_bug.cgi?id=142604
2195
2196         Reviewed by Alex Christensen.
2197
2198         Tests: http/tests/contentextensions/css-display-none.html
2199
2200         * WebCore.xcodeproj/project.pbxproj:
2201
2202         * contentextensions/ContentExtension.cpp:
2203         (WebCore::ContentExtensions::ContentExtension::create):
2204         (WebCore::ContentExtensions::ContentExtension::ContentExtension):
2205         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
2206         * contentextensions/ContentExtension.h:
2207         (WebCore::ContentExtensions::ContentExtension::identifier):
2208         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
2209
2210         * contentextensions/ContentExtensionsBackend.cpp:
2211         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
2212         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2213         (WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
2214         * contentextensions/ContentExtensionsBackend.h:
2215
2216         * contentextensions/DFABytecodeInterpreter.cpp:
2217         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2218
2219         * dom/DocumentStyleSheetCollection.cpp:
2220         (WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet):
2221         * dom/DocumentStyleSheetCollection.h:
2222
2223         * loader/DocumentLoader.cpp:
2224         (WebCore::DocumentLoader::commitData):
2225         (WebCore::DocumentLoader::startLoadingMainResource):
2226         (WebCore::DocumentLoader::addPendingContentExtensionSheet):
2227         * loader/DocumentLoader.h:
2228
2229         * loader/cache/CachedResourceLoader.cpp:
2230         (WebCore::CachedResourceLoader::requestResource):
2231
2232         * loader/cache/CachedResourceRequest.cpp:
2233         (WebCore::CachedResourceRequest::setInitiator):
2234         * loader/cache/CachedResourceRequest.h:
2235         (WebCore::CachedResourceRequest::initiatingDocumentLoader):
2236
2237         * page/UserContentController.cpp:
2238         (WebCore::UserContentController::globalDisplayNoneStyleSheet):
2239         (WebCore::UserContentController::displayNoneCSSRule):
2240         * page/UserContentController.h:
2241
2242 2015-03-23  Anders Carlsson  <andersca@apple.com>
2243
2244         -[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't remove cookies
2245         https://bugs.webkit.org/show_bug.cgi?id=142990
2246         rdar://problem/20241645
2247
2248         Reviewed by Andreas Kling.
2249
2250         Use the Mac version of deleteAllCookiesModifiedSince on iOS as well.
2251
2252         * platform/network/cf/CookieJarCFNet.cpp:
2253         * platform/network/mac/CookieJarMac.mm:
2254
2255 2015-03-23  Conrad Shultz  <conrad_shultz@apple.com>
2256
2257         Replace uses of kCTFontSystemFontType
2258         https://bugs.webkit.org/show_bug.cgi?id=142984
2259
2260         Reviewed by Tim Horton.
2261
2262         * rendering/RenderThemeMac.mm:
2263         (WebCore::AttachmentLayout::layOutTitle):
2264         (WebCore::AttachmentLayout::layOutSubtitle):
2265
2266 2015-03-23  Dean Jackson  <dino@apple.com>
2267
2268         kCTFontSystemFontType is deprecated in CoreText
2269         https://bugs.webkit.org/show_bug.cgi?id=142981
2270         <rdar://problem/20261171>
2271
2272         Reviewed by Beth Dakin.
2273
2274         Update to the non-deprecated version.
2275
2276         * rendering/RenderThemeIOS.mm: kCTFontSystemFontType -> kCTFontUIFontSystem
2277         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2278
2279 2015-03-23  Eric Carlson  <eric.carlson@apple.com>
2280
2281         [Mac] Enable fullscreen for MSE-based videos
2282         https://bugs.webkit.org/show_bug.cgi?id=142971
2283
2284         Reviewed by Jer Noble.
2285
2286         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2287         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsFullscreen): Return true;
2288
2289 2015-03-23  Alex Christensen  <achristensen@webkit.org>
2290
2291         [MediaFoundation] Implement seek.
2292         https://bugs.webkit.org/show_bug.cgi?id=142594
2293
2294         Reviewed by Darin Adler.
2295
2296         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2297         (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
2298         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
2299         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
2300         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2301
2302 2015-03-23  Dan Bernstein  <mitz@apple.com>
2303
2304         Fixed the build.
2305
2306         * platform/graphics/cocoa/FontCocoa.mm:
2307         (WebCore::Font::platformBoundsForGlyph): Switched to non-deprecated CTFontOrientation values.
2308         (WebCore::Font::platformWidthForGlyph): Ditto.
2309
2310 2015-03-23  Jer Noble  <jer.noble@apple.com>
2311
2312         [iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
2313         https://bugs.webkit.org/show_bug.cgi?id=142970
2314
2315         Reviewed by Eric Carlson.
2316
2317         Return early after synchronously calling to the main thread to allocate the volume
2318         view, to avoid re-allocating the volume view again on the web thread.
2319
2320         * platform/audio/ios/MediaSessionManagerIOS.mm:
2321         (-[WebMediaSessionHelper allocateVolumeView]):
2322
2323 2015-03-23  Tim Horton  <timothy_horton@apple.com>
2324
2325         Add a share item to the link action menu
2326         https://bugs.webkit.org/show_bug.cgi?id=142961
2327         <rdar://problem/19198374>
2328
2329         Reviewed by Beth Dakin.
2330
2331         * English.lproj/Localizable.strings:
2332         Remove some now-unused strings.
2333
2334         * platform/spi/mac/NSMenuSPI.h:
2335         Add some SPI.
2336
2337 2015-03-23  David Kilzer  <ddkilzer@apple.com>
2338
2339         [iOS] Build fix: CoreText deprecated kCTFontSystemFontType
2340
2341         Fix tracked by:  <rdar://problem/20261171>
2342
2343         * rendering/RenderThemeIOS.mm:
2344         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2345         Add clang pragmas.
2346
2347 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
2348
2349         Unreviewed test fix.
2350
2351         * css/CSSParser.cpp:
2352         (WebCore::CSSParser::parseScrollSnapDestination): Remove new assertion.
2353
2354 2015-03-23  Brent Fulgham  <bfulgham@apple.com>
2355
2356         scroll-snap-destination and scroll-snap-coordinate do not seem to work together properly
2357         https://bugs.webkit.org/show_bug.cgi?id=142552
2358         <rdar://problem/20114743>
2359
2360         Reviewed by Dean Jackson.
2361
2362         Revise the snap point logic as follows:
2363         (1) Put the snap point destination handling in a helper function to make the rest of the code
2364             easier to read.
2365         (2) Make sure we always have a left-hand snap point (i.e., position 0), but don't add multiple
2366             left-hand snap points.
2367         (3) Create a helper function to determine if we should be working with the scroll snap 'elements'
2368             behavior. We want to use this for scroll-snap-destination/scroll-snap-coordinate markup.
2369         (4) Create per-element snap point offsets when using scroll-snap-destination/scroll-snap-coordinate.
2370
2371         * css/CSSParser.cpp:
2372         (WebCore::CSSParser::parseScrollSnapDestination): Add assertion to try to catch bad parser state.
2373         * page/scrolling/AxisScrollSnapOffsets.cpp:
2374         (WebCore::destinationOffsetForViewSize): Added helper function to consolidate logic for handling
2375         destination coordinates.
2376         (WebCore::updateFromStyle): Make sure a left-hand snap point is always provided.
2377         (WebCore::styleUsesElements): Added helper function.
2378         (WebCore::updateSnapOffsetsForScrollableArea): Revise logic to generate 'per-element' snap point
2379         offsets.
2380
2381 2015-03-23  Yoav Weiss  <yoav@yoav.ws>
2382
2383         Refactor ImageLoader's setting of CachedImage
2384         https://bugs.webkit.org/show_bug.cgi?id=142825
2385
2386         Reviewed by Chris Dumez.
2387
2388         No new tests, since there's no functional change.
2389
2390         setImage and setImageWithoutConsideringPendingLoadEvent were not called with new
2391         CachedImages and were not used as originally intended. That resulted in some dead code,
2392         and confusion when going over the code.
2393         This patch renames these methods into equivalent clearImage* methods, and deletes resulting dead code.
2394
2395         * html/HTMLObjectElement.cpp:
2396         (WebCore::HTMLObjectElement::renderFallbackContent): Changed setImage call to clearImage.
2397         * loader/ImageLoader.cpp:
2398         (WebCore::ImageLoader::clearImage):
2399         (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
2400         (WebCore::ImageLoader::notifyFinished):
2401         (WebCore::ImageLoader::elementDidMoveToNewDocument):
2402         (WebCore::ImageLoader::setImage): Deleted.
2403         (WebCore::ImageLoader::setImageWithoutConsideringPendingLoadEvent): Deleted.
2404         * loader/ImageLoader.h:
2405
2406 2015-03-22  Benjamin Poulain  <benjamin@webkit.org>
2407
2408         CSS Selectors: fix attribute case-insensitive matching of Contain and List
2409         https://bugs.webkit.org/show_bug.cgi?id=142932
2410
2411         Reviewed by Darin Adler.
2412
2413         Fix the last two attribute selectors that were using full case-insensitive
2414         match:
2415             -Contain ([foo*=bar]).
2416             -List (foo~=bar]).
2417
2418         Tests: fast/selectors/attribute-contains-value-matching-is-ascii-case-insensitive.html
2419                fast/selectors/attribute-list-value-matching-is-ascii-case-insensitive.html
2420
2421         * css/SelectorChecker.cpp:
2422         (WebCore::attributeValueMatches):
2423         * cssjit/SelectorCompiler.cpp:
2424         (WebCore::SelectorCompiler::attributeValueContains):
2425         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
2426
2427 2015-03-22  Benjamin Poulain  <bpoulain@apple.com>
2428
2429         Detect when url filter pattern with groups match the empty string
2430         https://bugs.webkit.org/show_bug.cgi?id=142930
2431
2432         Reviewed by Sam Weinig.
2433
2434         The previous test was only accounting for simple atoms. This patch extends
2435         it to groups.
2436
2437         * contentextensions/URLFilterParser.cpp:
2438         (WebCore::ContentExtensions::Term::quantify):
2439         (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
2440         (WebCore::ContentExtensions::GraphBuilder::finalize):
2441         (WebCore::ContentExtensions::Term::quantifier): Deleted.
2442
2443 2015-03-22  Eric Carlson  <eric.carlson@apple.com>
2444
2445         [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
2446         https://bugs.webkit.org/show_bug.cgi?id=142940
2447
2448         Reviewed by Sam Weinig.
2449
2450         * dom/Document.cpp:
2451         (WebCore::Document::didChoosePlaybackTarget): const-ify the didChoosePlaybackTarget argument.
2452         * dom/Document.h:
2453
2454         * html/HTMLMediaSession.cpp:
2455         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Ditto.
2456         * html/HTMLMediaSession.h:
2457
2458         * page/Page.cpp:
2459         (WebCore::Page::didChoosePlaybackTarget):  Ditto.
2460         * page/Page.h:
2461
2462         * platform/audio/MediaSession.h:
2463         * platform/graphics/MediaPlaybackTargetPickerClient.h:
2464         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: 
2465         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):  Ditto.
2466
2467 2015-03-22  Anders Carlsson  <andersca@apple.com>
2468
2469         _WKWebsiteDataStore should clear WebSQL databases
2470         https://bugs.webkit.org/show_bug.cgi?id=142947
2471
2472         Reviewed by Sam Weinig.
2473
2474         * Modules/webdatabase/DatabaseTracker.cpp:
2475         (WebCore::DatabaseTracker::trackerWithDatabasePath):
2476         Add a hack so we can get at a tracker from the UI process.
2477
2478         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
2479         New function that deletes all databases modified after a given time.
2480
2481         * Modules/webdatabase/DatabaseTracker.h:
2482         Add new members and export the ones we want to call from WebKit2.
2483
2484         * Modules/webdatabase/OriginLock.h:
2485         Export the destructor.
2486
2487 2015-03-21  Dean Jackson  <dino@apple.com>
2488
2489         Remove the prefix for CSS Transforms
2490         https://bugs.webkit.org/show_bug.cgi?id=142927
2491         <rdar://problem/11568151>
2492
2493         Reviewed by Simon Fraser.
2494
2495         Support the bare form of:
2496         - transform
2497         - transform-style
2498         - transform-origin
2499         - perspective
2500         - perspective-origin
2501
2502         For transform-style, we also still differentiate the prefixed property
2503         because we may want to use that as an indicator of legacy content.
2504
2505         This is mostly a find and replace, but with some related naming
2506         changes. The DOM interface for WebKitCSSTransformValue remains
2507         unchanged.
2508
2509         Tests: transforms/2d/transform-2d-prefixed.html
2510                transforms/3d/general/prefixed-3dtransform-values.html
2511
2512         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2513         (WebCore::propertyChangeMayRepaintNonDescendants):
2514         * css/CSSComputedStyleDeclaration.cpp:
2515         (WebCore::isLayoutDependent):
2516         (WebCore::ComputedStyleExtractor::propertyValue):
2517         * css/CSSParser.cpp:
2518         (WebCore::isValidKeywordPropertyAndValue):
2519         (WebCore::isKeywordPropertyID):
2520         (WebCore::parseTranslateTransformValue):
2521         (WebCore::CSSParser::parseValue):
2522         (WebCore::CSSParser::parseTransformOrigin):
2523         (WebCore::CSSParser::parsePerspectiveOrigin):
2524         * css/CSSPropertyNames.in:
2525         * css/StyleProperties.cpp:
2526         (WebCore::StyleProperties::getPropertyValue):
2527         (WebCore::StyleProperties::asText):
2528         * css/WebKitCSSMatrix.cpp:
2529         (WebCore::WebKitCSSMatrix::setMatrixValue):
2530         * html/track/VTTCue.cpp:
2531         (WebCore::VTTCueBox::applyCSSProperties):
2532         * page/animation/AnimationController.cpp:
2533         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
2534         * page/animation/CSSPropertyAnimation.cpp:
2535         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
2536         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2537         * page/animation/CompositeAnimation.cpp:
2538         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
2539         * page/animation/ImplicitAnimation.cpp:
2540         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
2541         * page/animation/KeyframeAnimation.cpp:
2542         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
2543         (WebCore::KeyframeAnimation::validateTransformFunctionList):
2544         * platform/graphics/GraphicsLayer.cpp:
2545         (WebCore::GraphicsLayer::validateTransformOperations):
2546         * platform/graphics/GraphicsLayerClient.h:
2547         * platform/graphics/ca/GraphicsLayerCA.cpp:
2548         (WebCore::propertyIdToString):
2549         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
2550         (WebCore::GraphicsLayerCA::addAnimation):
2551         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
2552         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2553         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2554         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2555         (WebCore::GraphicsLayerTextureMapper::addAnimation):
2556         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2557         (WebCore::TextureMapperAnimation::applyInternal):
2558         * platform/graphics/texmap/TextureMapperLayer.cpp:
2559         (WebCore::TextureMapperLayer::syncAnimations):
2560         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2561         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
2562         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
2563         (WebCore::CoordinatedGraphicsLayer::addAnimation):
2564         * rendering/RenderLayerBacking.cpp:
2565         (WebCore::RenderLayerBacking::updateGeometry):
2566         (WebCore::RenderLayerBacking::startAnimation):
2567         (WebCore::RenderLayerBacking::startTransition):
2568         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
2569         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
2570         * rendering/RenderLayerCompositor.cpp:
2571         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2572         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
2573         * svg/SVGElement.cpp:
2574         (WebCore::populateAttributeNameToCSSPropertyIDMap):
2575
2576 2015-03-21  Commit Queue  <commit-queue@webkit.org>
2577
2578         Unreviewed, rolling out r181824.
2579         https://bugs.webkit.org/show_bug.cgi?id=142935
2580
2581         Broke Windows build (Requested by ap on #webkit).
2582
2583         Reverted changeset:
2584
2585         "Remove the prefix for CSS Transforms"
2586         https://bugs.webkit.org/show_bug.cgi?id=142927
2587         http://trac.webkit.org/changeset/181824
2588
2589 2015-03-20  Dean Jackson  <dino@apple.com>
2590
2591         Remove the prefix for CSS Transforms
2592         https://bugs.webkit.org/show_bug.cgi?id=142927
2593         <rdar://problem/11568151>
2594
2595         Reviewed by Simon Fraser.
2596
2597         Support the bare form of:
2598         - transform
2599         - transform-style
2600         - transform-origin
2601         - perspective
2602         - perspective-origin
2603
2604         For transform-style, we also still differentiate the prefixed property
2605         because we may want to use that as an indicator of legacy content.
2606
2607         This is mostly a find and replace, but with some related naming
2608         changes. The DOM interface for WebKitCSSTransformValue remains
2609         unchanged.
2610
2611         Tests: transforms/2d/transform-2d-prefixed.html
2612                transforms/3d/general/prefixed-3dtransform-values.html
2613
2614         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2615         (WebCore::propertyChangeMayRepaintNonDescendants):
2616         * css/CSSComputedStyleDeclaration.cpp:
2617         (WebCore::isLayoutDependent):
2618         (WebCore::ComputedStyleExtractor::propertyValue):
2619         * css/CSSParser.cpp:
2620         (WebCore::isValidKeywordPropertyAndValue):
2621         (WebCore::isKeywordPropertyID):
2622         (WebCore::parseTranslateTransformValue):
2623         (WebCore::CSSParser::parseValue):
2624         (WebCore::CSSParser::parseTransformOrigin):
2625         (WebCore::CSSParser::parsePerspectiveOrigin):
2626         * css/CSSPropertyNames.in:
2627         * css/StyleProperties.cpp:
2628         (WebCore::StyleProperties::getPropertyValue):
2629         (WebCore::StyleProperties::asText):
2630         * css/WebKitCSSMatrix.cpp:
2631         (WebCore::WebKitCSSMatrix::setMatrixValue):
2632         * html/track/VTTCue.cpp:
2633         (WebCore::VTTCueBox::applyCSSProperties):
2634         * page/animation/AnimationController.cpp:
2635         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
2636         * page/animation/CSSPropertyAnimation.cpp:
2637         (WebCore::PropertyWrapperAcceleratedTransform::PropertyWrapperAcceleratedTransform):
2638         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2639         * page/animation/CompositeAnimation.cpp:
2640         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
2641         * page/animation/ImplicitAnimation.cpp:
2642         (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
2643         * page/animation/KeyframeAnimation.cpp:
2644         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
2645         (WebCore::KeyframeAnimation::validateTransformFunctionList):
2646         * platform/graphics/GraphicsLayer.cpp:
2647         (WebCore::GraphicsLayer::validateTransformOperations):
2648         * platform/graphics/GraphicsLayerClient.h:
2649         * platform/graphics/ca/GraphicsLayerCA.cpp:
2650         (WebCore::propertyIdToString):
2651         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
2652         (WebCore::GraphicsLayerCA::addAnimation):
2653         (WebCore::GraphicsLayerCA::isRunningTransformAnimation):
2654         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2655         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2656         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2657         (WebCore::GraphicsLayerTextureMapper::addAnimation):
2658         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2659         (WebCore::TextureMapperAnimation::applyInternal):
2660         * platform/graphics/texmap/TextureMapperLayer.cpp:
2661         (WebCore::TextureMapperLayer::syncAnimations):
2662         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2663         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHasActiveTransformAnimation):
2664         (WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
2665         (WebCore::CoordinatedGraphicsLayer::addAnimation):
2666         * rendering/RenderLayerBacking.cpp:
2667         (WebCore::RenderLayerBacking::updateGeometry):
2668         (WebCore::RenderLayerBacking::startAnimation):
2669         (WebCore::RenderLayerBacking::startTransition):
2670         (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
2671         (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
2672         * rendering/RenderLayerCompositor.cpp:
2673         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
2674         (WebCore::RenderLayerCompositor::isRunningTransformAnimation):
2675         * svg/SVGElement.cpp:
2676         (WebCore::populateAttributeNameToCSSPropertyIDMap):
2677
2678 2015-03-20  Yusuke Suzuki  <utatane.tea@gmail.com>
2679
2680         REGRESSION (r179429): Potential Use after free in JavaScriptCore`WTF::StringImpl::ref + 83
2681         https://bugs.webkit.org/show_bug.cgi?id=142410
2682
2683         Reviewed by Geoffrey Garen.
2684
2685         The same issues are found in the existing code; PropertyName does not have ownership.
2686         This patch rewrite the point that should have ownership to Identifier.
2687
2688         * bindings/js/JSDOMWindowCustom.cpp:
2689         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2690         (WebCore::JSDOMWindow::putByIndex):
2691         * bindings/js/ReadableStreamJSSource.cpp:
2692         (WebCore::getInternalSlotFromObject):
2693         * bindings/scripts/CodeGeneratorJS.pm:
2694         (GenerateImplementation):
2695         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2696         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlotByIndex):
2697         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2698         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
2699         * bindings/scripts/test/JS/JSTestInterface.cpp:
2700         (WebCore::JSTestInterface::putByIndex):
2701
2702 2015-03-20  Simon Fraser  <simon.fraser@apple.com>
2703
2704         Log the slow-scrolling reasons (if any) on first commit of a ScrollingTreeFrameScrollingNodeMac
2705         https://bugs.webkit.org/show_bug.cgi?id=142917
2706
2707         Reviewed by Beth Dakin.
2708         
2709         The scrollperf test would fail to detect transitions between slow and fast scrolling
2710         for new pages, because there was no logging when slow-scrolling scrolling tree was
2711         torn down, and a new fast-scrolling tree constructed.
2712         
2713         Fix by always logging the slow-scrolling reasons in the first update of the
2714         ScrollingTreeFrameScrollingNodeMac, even when the slow-scrolling reasons haven't
2715         changed.
2716
2717         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2718         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2719         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
2720         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2721
2722 2015-03-19  Geoffrey Garen  <ggaren@apple.com>
2723
2724         Function.prototype.toString should not decompile the AST
2725         https://bugs.webkit.org/show_bug.cgi?id=142853
2726
2727         Reviewed by Sam Weinig.
2728
2729         * bindings/js/JSLazyEventListener.cpp:
2730         (WebCore::JSLazyEventListener::initializeJSFunction): Adjust the line
2731         number of attribute event listeners to account for the leading newline
2732         now added by JavaScriptCore.
2733
2734         This solution is not perfect, but there are a lot of pre-existing problems
2735         with line and column reporting for attribute event listeners, and this
2736         preserves existing behavior with reasonable reliability.
2737
2738 2015-03-20  Alex Christensen  <achristensen@webkit.org>
2739
2740         Progress towards CMake on Mac.
2741         https://bugs.webkit.org/show_bug.cgi?id=136003
2742
2743         Reviewed by Chris Dumez.
2744
2745         * PlatformMac.cmake:
2746         Added some directories to create forwarding headers from.
2747         Generate ObjC bindings.
2748
2749 2015-03-20  Per Arne Vollan  <peavo@outlook.com>
2750
2751         [WinCairo] Crash when leaving page while video is playing.
2752         https://bugs.webkit.org/show_bug.cgi?id=142578
2753
2754         Reviewed by Alex Christensen.
2755
2756         This can happen when there is an asynchronous event invoked from a video worker
2757         thread, accessing the media player object after it has been deleted.
2758         This is solved by resetting the media player pointer in the event object,
2759         when the media player is deleted.
2760
2761         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2762         (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation):
2763         (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
2764         (WebCore::MediaPlayerPrivateMediaFoundation::removeListener):
2765         (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted):
2766         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::AsyncCallback):
2767         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::~AsyncCallback):
2768         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke):
2769         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
2770         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2771         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::MediaPlayerListener):
2772         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::~MediaPlayerListener):
2773         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerListener::onMediaPlayerDeleted):
2774
2775 2015-03-20  Chris Dumez  <cdumez@apple.com>
2776
2777         Regression(r181782): Caused WebKit2.RestoreSessionStateContainingFormData API test to crash
2778         https://bugs.webkit.org/show_bug.cgi?id=142911
2779
2780         Reviewed by Antti Koivisto.
2781
2782         Drop the isBackForwardLoadType(m_loadType) assertion in
2783         FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad(). This assertion
2784         used to hold true when goToBackForwardItem() was only called with
2785         history navigation load types. However, after r181782, we use a Standard
2786         load in the cases where we do not wish to display stale content (e.g.
2787         restoring session state).
2788
2789         The assertion comment says "We only use cache-only loads to avoid
2790         resubmitting forms". However, we then call loadDifferentDocumentItem()
2791         which already takes care of using the ReturnCacheDataElseLoad cache
2792         policy as the HistoryItem has form data and we pass
2793         MayNotAttemptCacheOnlyLoadForFormSubmissionItem as parameter.
2794
2795         No new tests, covered by WebKit2.RestoreSessionStateContainingFormData
2796         API test.
2797
2798         * loader/FrameLoader.cpp:
2799         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
2800
2801 2015-03-20  Andy Estes  <aestes@apple.com>
2802
2803         [Content Filtering] Adopt NEFilterSource unblock handling
2804         https://bugs.webkit.org/show_bug.cgi?id=142904
2805
2806         Reviewed by Andreas Kling.
2807
2808         * platform/cocoa/NetworkExtensionContentFilter.mm:
2809         (WebCore::NetworkExtensionContentFilter::unblockHandler):
2810         Returned an unblock handler that calls -[NEFilterSource remediateWithDecisionHandler:].
2811         * platform/cocoa/ParentalControlsContentFilter.mm:
2812         (WebCore::ParentalControlsContentFilter::unblockHandler): Used ASCIILiteral.
2813
2814 2015-03-19  Andy Estes  <aestes@apple.com>
2815
2816         [Content Filtering] Add tests for unblock requests
2817         https://bugs.webkit.org/show_bug.cgi?id=142900
2818
2819         Reviewed by Andreas Kling.
2820
2821         Currently the iOS Parental Controls content filter has a mechanism for requesting that a page be unblocked.
2822         WebKit implements this by listening for navigations originating from the filter's error page to a special URL,
2823         and requesting the page be unblocked via platform API, which might cause UI to be displayed. If the unblock is
2824         successful then we schedule a reload of the frame in order to display the unblocked document.
2825
2826         NetworkExtension also supports unblock requests, so in preparation for adopting its API, this patch allows
2827         content filters to specify their own unblock request method, teaches MockContentFilter to provide such a method,
2828         and writes tests to cover both allowed and denied unblock requests.
2829
2830         The content filter that blocks a load creates a ContentFilterUnblockHandler, passing it a lambda that is executed
2831         when a navigation matches the filter's special unblock URL. Filters can also specify that a script be executed in
2832         the context of its error page if the unblock is denied.
2833
2834         All platform content filters can handle unblock requests like this with the exception of iOS Parental Controls in WebKit2.
2835         Since UI can be displayed by the system in this case, the request must be made from within the UI process. Therefore the
2836         existing method is retained of serializing a WebFilterEvaluator and intercepting navigation policy calls in the UI process.
2837
2838         Tests: contentfiltering/allow-after-unblock-request.html
2839                contentfiltering/block-after-unblock-request.html
2840
2841         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
2842         (WebCore::JSMockContentFilterSettings::decisionPoint): Added some using statements for clarity.
2843         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Ditto.
2844         (WebCore::toJSValue): Returns a JSValue from a Decision.
2845         (WebCore::toDecision): Returns a Decision from a JSValue.
2846         (WebCore::JSMockContentFilterSettings::decision): Used toJSValue.
2847         (WebCore::JSMockContentFilterSettings::setDecision): Used toDecision.
2848         (WebCore::JSMockContentFilterSettings::unblockRequestDecision): Used toJSValue.
2849         (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision): Used toDecision.
2850         * loader/ContentFilter.cpp:
2851         (WebCore::ContentFilter::createIfNeeded): Passed a reference to the owning DocumentLoader.
2852         (WebCore::ContentFilter::ContentFilter): Ditto.
2853         (WebCore::ContentFilter::unblockHandler): If the unblockHandler requests that a script be executed when an
2854         unblock request is denied, create a wrapper unblockHandler that executes that script in m_documentLoader's frame.
2855         * loader/ContentFilter.h:
2856         * loader/DocumentLoader.cpp:
2857         (WebCore::DocumentLoader::responseReceived): Passed this to ContentFilter::createIfNeeded.
2858         * loader/FrameLoader.cpp:
2859         (WebCore::FrameLoader::prepareForLoadStart): Called PolicyChecker::prepareForLoadStart.
2860         * loader/PolicyChecker.cpp:
2861         (WebCore::PolicyChecker::prepareForLoadStart): Reset m_contentFilterUnblockHandler.
2862         (WebCore::PolicyChecker::checkNavigationPolicy): Moved logic to here from WebKit1's WebFrameLoaderClient.
2863         Placing it here allows it to be shared between WebKit1 and WebKit2 (when the unblock handler does not need to
2864         be called in the UI process).
2865         * loader/PolicyChecker.h:
2866         (WebCore::PolicyChecker::setContentFilterUnblockHandler): Added.
2867         * page/Frame.h: Made Frame ThreadSafeRefCounted, since RefPtr<Frames> are captured in lambdas that can be
2868         copied by background threads managed by the underlying platform.
2869         * platform/ContentFilterUnblockHandler.h:
2870         (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Returned the Apple content filter scheme.
2871         (WebCore::ContentFilterUnblockHandler::unblockURLHost): Returned the unblock URL host.
2872         (WebCore::ContentFilterUnblockHandler::clear): Deleted.
2873         * platform/PlatformContentFilter.h:
2874         (WebCore::PlatformContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
2875         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2876         (WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler): Added a constructor that takes an
2877         unblockURLHost and a UnblockRequesterFunction. Added an alternate constructor for iOS Parental Controls on
2878         WebKit2 that takes an unblockURLHost and a WebFilterEvaluator.
2879         (WebCore::ContentFilterUnblockHandler::needsUIProcess): Returned true if m_webFilterEvaluator is non-null.
2880         (WebCore::ContentFilterUnblockHandler::encode): Encoded m_unblockURLHost in addition to m_webFilterEvaluator.
2881         (WebCore::ContentFilterUnblockHandler::decode): Decoded m_unblockURLHost in addition to m_webFilterEvaluator.
2882         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Returned true if there is a either a m_unblockRequester
2883         or a m_webFilterEvaluator and the request's host and scheme match those of the unblock request URL.
2884         (WebCore::dispatchToMainThread): Added a helper to dispatch a block to the main thread. Then if the web thread
2885         is enabled on iOS, dispatch it there.
2886         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync): Renamed from handleUnblockRequestAndDispatchIfSuccessful.
2887         Requested an unblock using either m_unblockRequester or m_webFilterEvaluator, then called decisionHandler with the response.
2888         (WebCore::scheme): Moved to ContentFilterUnblockHandler::unblockURLScheme.
2889         (WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful): Renamed to requestUnblockAsync.
2890         * platform/cocoa/ParentalControlsContentFilter.mm:
2891         (WebCore::ParentalControlsContentFilter::unblockHandler): Returned an unblock handler using the WebFilterEvaluator constructor.
2892         * testing/MockContentFilter.cpp: Added using statments for clarity.
2893         (WebCore::settings): Added a helper to get MockContentFilterSettings::singleton().
2894         (WebCore::MockContentFilter::canHandleResponse): Used the helper.
2895         (WebCore::MockContentFilter::MockContentFilter): Took advantage of the using statements.
2896         (WebCore::MockContentFilter::addData): Ditto.
2897         (WebCore::MockContentFilter::finishedAddingData): Ditto.
2898         (WebCore::MockContentFilter::unblockHandler): Returned a ContentFilterUnblockHandler that checks settings() for its decision.
2899         (WebCore::MockContentFilter::unblockRequestDeniedScript): Returned the script to execute in MockContentFilter's
2900         error page when an unblock request is denied.
2901         (WebCore::MockContentFilter::maybeDetermineStatus): Took advantage of settings() and using statements.
2902         * testing/MockContentFilterSettings.cpp:
2903         (WebCore::MockContentFilterSettings::unblockRequestURL): Constructed a static unblock URL and returned it.
2904         * testing/MockContentFilterSettings.h:
2905         (WebCore::MockContentFilterSettings::unblockURLHost): Returned the filter's unblock URL host.
2906         (WebCore::MockContentFilterSettings::unblockRequestDecision): Returns the decision to make for an unblock request.
2907         (WebCore::MockContentFilterSettings::setUnblockRequestDecision): Sets the decision to make for an unblock request.
2908         * testing/MockContentFilterSettings.idl: Added the unblockRequestDecision and unblockRequestURL attributes.
2909
2910 2015-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2911
2912         [GTK] Crash due to empty drag image during drag-and-drop
2913         https://bugs.webkit.org/show_bug.cgi?id=142671
2914
2915         Reviewed by Philippe Normand.
2916
2917         Return early from ImageBuffer constructor if an empty size is
2918         given. This is a speculative fix for a crash while starting a drag
2919         and drop operation, that I haven't been able to reproduce.
2920
2921         * platform/graphics/cairo/ImageBufferCairo.cpp:
2922         (WebCore::ImageBuffer::ImageBuffer):
2923
2924 2015-03-19  Chris Dumez  <cdumez@apple.com>
2925
2926         [WK2] We should allow stale content when restoring a killed / crashed WebProcess
2927         https://bugs.webkit.org/show_bug.cgi?id=142893
2928         <rdar://problem/19633737>
2929         <rdar://problem/19869257>
2930
2931         Reviewed by Antti Koivisto.
2932
2933         Always use ReturnCacheDataElseLoad cache policy for history navigations.
2934         Previously, we would use the default protocol cache policy for history
2935         navigations if m_stateMachine.committedFirstRealDocumentLoad() returned
2936         false so that we do not display stale content when restoring the session
2937         state of Safari statup (rdar://problem/8131355). This is now handled
2938         before reaching this method by no longer using "IndexedBackForward"
2939         FrameLoadType when restoring session tabs, and using "Standard" load
2940         type instead.
2941
2942         * loader/FrameLoader.cpp:
2943         (WebCore::FrameLoader::loadDifferentDocumentItem):
2944
2945 2015-03-19  Andy Estes  <aestes@apple.com>
2946
2947         [Content Filtering] Move ContentFilter to from platform/ to loader/
2948         https://bugs.webkit.org/show_bug.cgi?id=142897
2949
2950         Reviewed by Dan Bernstein.
2951
2952         ContentFilterCollection never contained any platform code, so it doesn't make sense for it to be in platform.
2953         Move it to loader/, since ContentFilters are owned by DocumentLoaders, and just call it ContentFilter. Extract
2954         the abstract part of ContentFilter into a new base class called PlatformContentFilter that each of the
2955         individual filters inherit from.
2956
2957         * WebCore.xcodeproj/project.pbxproj:
2958         * loader/ContentFilter.cpp: Renamed from Source/WebCore/platform/ContentFilter.cpp.
2959         (WebCore::ContentFilter::types): Moved from ContentFilterCollection.
2960         (WebCore::ContentFilter::createIfNeeded): Ditto.
2961         (WebCore::ContentFilter::ContentFilter): Ditto.
2962         (WebCore::ContentFilter::addData): Ditto.
2963         (WebCore::ContentFilter::finishedAddingData): Ditto.
2964         (WebCore::ContentFilter::needsMoreData): Ditto.
2965         (WebCore::ContentFilter::didBlockData): Ditto.
2966         (WebCore::ContentFilter::getReplacementData): Ditto.
2967         (WebCore::ContentFilter::unblockHandler): Ditto.
2968         * loader/ContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
2969         (WebCore::ContentFilter::type): Replaced a use of ContentFilterCollection.
2970         * platform/PlatformContentFilter.h: Renamed from Source/WebCore/platform/ContentFilter.h.
2971         * platform/cocoa/NetworkExtensionContentFilter.h: Inherited from PlatformContentFilter.
2972         * platform/cocoa/ParentalControlsContentFilter.h: Ditto.
2973         * testing/MockContentFilter.h: Ditto.
2974
2975 2015-03-19  Dean Jackson  <dino@apple.com>
2976
2977         CSS Animations with triggers should map scroll position to duration
2978         https://bugs.webkit.org/show_bug.cgi?id=142870
2979         <rdar://problem/20227244>
2980
2981         Reviewed by Simon Fraser.
2982
2983         Expose a prototype implementation of what will eventually be called
2984         animation-timebase, mapping the scroll location to the duration of an
2985         animation. This only applies if the animation has a start and end
2986         trigger.
2987
2988         Test: animations/trigger-container-scroll-boundaries.html
2989
2990         * css/CSSComputedStyleDeclaration.cpp:
2991         (WebCore::createAnimationTriggerValue): Change to downcast.
2992
2993         * css/CSSToStyleMap.cpp:
2994         (WebCore::CSSToStyleMap::mapAnimationTrigger): Fix a bug where I wasn't
2995         telling the ScrollAnimationTrigger object whether or not it had
2996         an end value. This wasn't visible before because we were not using
2997         the end value.
2998
2999         * page/animation/AnimationBase.cpp:
3000         (WebCore::AnimationBase::fireAnimationEventsIfNeeded): Add a comment and
3001         change to using a downcast.
3002         (WebCore::AnimationBase::timeToNextService): Change to downcast.
3003         (WebCore::AnimationBase::freezeAtTime): Whitespace cleanup.
3004         (WebCore::AnimationBase::getElapsedTime): Calculate the elapsedTime based
3005         on the scroll position relative to the start and end trigger spots.
3006
3007         * page/animation/AnimationController.cpp:
3008         (WebCore::AnimationControllerPrivate::updateAnimations): Since this
3009         can potentially call into beginAnimationUpdateTime, it should have
3010         an update blocker. This fixes the assert we were seeing in tests.
3011         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Keep track of the scroll
3012         position so we don't need to ask for it all the time.
3013         * page/animation/AnimationControllerPrivate.h:
3014         (WebCore::AnimationControllerPrivate::scrollPosition): New accessor.
3015
3016         * platform/animation/AnimationTrigger.h: Add downcast macros.
3017         (WebCore::ScrollAnimationTrigger::create): Calculate hasEndValue from the passed
3018         parameters rather than a separate value.
3019         (WebCore::ScrollAnimationTrigger::hasEndValue):
3020         (WebCore::ScrollAnimationTrigger::ScrollAnimationTrigger):
3021         (WebCore::ScrollAnimationTrigger::setHasEndValue): Deleted.
3022
3023         * platform/graphics/ca/GraphicsLayerCA.cpp:
3024         (WebCore::GraphicsLayerCA::animationCanBeAccelerated): If we have an
3025         animation of this sort, we can't use a CAAnimation.
3026
3027 2015-03-19  Eric Carlson  <eric.carlson@apple.com>
3028
3029         [Mac] Move MediaPlaybackTargetPicker
3030         https://bugs.webkit.org/show_bug.cgi?id=142889
3031
3032         Move WebMediaPlaybackTargetPickerProxy from WK2 and rename as MediaPlaybackTargetPicker so it
3033         can be used by both WK2 and WK1.
3034
3035         Reviewed by Tim Horton.
3036
3037         * WebCore.xcodeproj/project.pbxproj:
3038         * platform/graphics/MediaPlaybackTargetPicker.cpp: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp.
3039         * platform/graphics/MediaPlaybackTargetPicker.h: Copied from Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.h.
3040         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h.
3041         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Copied from Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm.
3042
3043 2015-03-19  Enrica Casucci  <enrica@apple.com>
3044
3045         REGRESSION (r109593): Clicking after last inline element could cause a crash.
3046         https://bugs.webkit.org/show_bug.cgi?id=142880
3047         rdar://problem/17222294
3048
3049         Reviewed by Ryosuke Niwa.
3050
3051         Test: editing/selection/click-after-last-inline-crash.html
3052
3053         * rendering/RootInlineBox.cpp:
3054         (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition):
3055
3056 2015-03-19  Enrica Casucci  <enrica@apple.com>
3057
3058         One more build fix after r181760.
3059
3060         * page/EventHandler.cpp:
3061         (WebCore::EventHandler::handleDrag):
3062
3063 2015-03-19  Jessie Berlin  <jberlin@webkit.org>
3064
3065         Build fix after r181760.
3066
3067         * rendering/RenderAttachment.h:
3068
3069 2015-03-19  Jer Noble  <jer.noble@apple.com>
3070
3071         [WK2][Mac] Fullscreen animations with mismatched aspect ratios are "squished".
3072         https://bugs.webkit.org/show_bug.cgi?id=142132
3073
3074         Reviewed by Tim Horton.
3075
3076         Add a new utility method to calculate a rect with a specific aspect ratio wrapping a smaller one.
3077
3078         * platform/graphics/GeometryUtilities.cpp:
3079         (WebCore::smallestRectWithAspectRatioAroundRect):
3080         * platform/graphics/GeometryUtilities.h:
3081
3082 2015-03-19  Chris Dumez  <cdumez@apple.com>
3083
3084         Get rid of "CachePolicyCache" cache policy
3085         https://bugs.webkit.org/show_bug.cgi?id=142881
3086
3087         Reviewed by Antti Koivisto.
3088
3089         Get rid of "CachePolicyCache" cache policy as it is unused.
3090
3091         * loader/cache/CachePolicy.h:
3092         * loader/cache/CachedResource.cpp:
3093         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders):
3094         * page/DiagnosticLoggingKeys.cpp:
3095         (WebCore::DiagnosticLoggingKeys::mustRevalidateIsExpiredKey): Deleted.
3096         * page/DiagnosticLoggingKeys.h:
3097
3098 2015-03-19  Alex Christensen  <achristensen@webkit.org>
3099
3100         [Content Extensions] Test regular expression parse failures.
3101         https://bugs.webkit.org/show_bug.cgi?id=142872
3102
3103         Reviewed by Benjamin Poulain.
3104
3105         * contentextensions/URLFilterParser.cpp:
3106         (WebCore::ContentExtensions::GraphBuilder::finalize):
3107         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
3108         (WebCore::ContentExtensions::URLFilterParser::addPattern):
3109         (WebCore::ContentExtensions::URLFilterParser::statusString):
3110         * contentextensions/URLFilterParser.h:
3111         Changed failures that can never happen to assertions.
3112
3113 2015-03-19  Enrica Casucci  <enrica@apple.com>
3114
3115         Release build fix after https://trac.webkit.org/r181760.
3116
3117         Unreviewed.
3118
3119         * page/EventHandler.cpp:
3120         (WebCore::EventHandler::handleDrag):
3121
3122 2015-03-19  Enrica Casucci  <enrica@apple.com>
3123
3124         <attachment> should put URLs on the pasteboard so that Finder can accept drops.
3125         https://bugs.webkit.org/show_bug.cgi?id=142801
3126         rdar://problem/19982527
3127
3128         Reviewed by Tim Horton.
3129
3130         Test: editing/pasteboard/drag-and-drop-attachment-contenteditable.html
3131
3132         This patch adds all the necessary support to write attachment elements into
3133         the pasteboard, including the promised type.
3134
3135         * WebCore.xcodeproj/project.pbxproj:
3136         * page/DragActions.h:
3137         * page/DragClient.h:
3138         (WebCore::DragClient::declareAndWriteAttachment):
3139         * page/DragController.cpp:
3140         (WebCore::DragController::draggableElement):
3141         (WebCore::DragController::startDrag):
3142         * page/DragController.h:
3143         (WebCore::DragController::draggingAttachmentURL):
3144         * page/EventHandler.cpp:
3145         (WebCore::EventHandler::dragHysteresisExceeded):
3146         (WebCore::EventHandler::handleDrag):
3147         * page/mac/DragControllerMac.mm:
3148         (WebCore::DragController::declareAndWriteAttachment):
3149         * page/win/DragControllerWin.cpp:
3150         (WebCore::DragController::declareAndWriteAttachment):
3151         * platform/URL.cpp:
3152         (WebCore::URL::fileURLWithFileSystemPath):
3153         * platform/URL.h:
3154         * rendering/HitTestResult.cpp:
3155         (WebCore::HitTestResult::absoluteAttachmentURL):
3156         * rendering/HitTestResult.h:
3157
3158 2015-03-19  Chris Dumez  <cdumez@apple.com>
3159
3160         Unreviewed, fix linking error after r181753.
3161
3162         Drop WEBCORE_EXPORT for Settings::minimumDOMTimerInterval() as it is
3163         now inlined.
3164
3165         * page/Settings.h:
3166         (WebCore::Settings::minimumDOMTimerInterval):
3167
3168 2015-03-19  Brady Eidson  <beidson@apple.com>
3169
3170         Part of content extensions should apply css selectors
3171         https://bugs.webkit.org/show_bug.cgi?id=142604
3172
3173         Reviewed by Alex Christensen.
3174
3175         Add a new action for applying the cached global stylesheet.
3176
3177         * contentextensions/CompiledContentExtension.cpp:
3178         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
3179
3180         * contentextensions/ContentExtensionActions.h:
3181
3182         * contentextensions/ContentExtensionCompiler.cpp:
3183         (WebCore::ContentExtensions::serializeActions):
3184
3185         * contentextensions/ContentExtensionParser.cpp:
3186         (WebCore::ContentExtensions::loadAction):
3187
3188         * contentextensions/ContentExtensionRule.cpp:
3189         (WebCore::ContentExtensions::Action::deserialize):
3190         * contentextensions/ContentExtensionRule.h:
3191         (WebCore::ContentExtensions::Action::Action):
3192         (WebCore::ContentExtensions::Action::operator==):
3193         (WebCore::ContentExtensions::Action::stringArgument):
3194         (WebCore::ContentExtensions::Action::cssSelector): Deleted.
3195
3196         * contentextensions/ContentExtensionsBackend.cpp:
3197         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3198
3199         * loader/cache/CachedResourceLoader.cpp:
3200         (WebCore::CachedResourceLoader::requestResource):
3201
3202 2015-03-19  Chris Dumez  <cdumez@apple.com>
3203
3204         Clean up DOMTimer related settings
3205         https://bugs.webkit.org/show_bug.cgi?id=142837
3206
3207         Reviewed by Darin Adler.
3208
3209         Clean up DOMTimer related settings:
3210         - Make default minimum timer interval 4ms instead of 10ms as all ports
3211           were setting it to 4ms and the specifications says 4ms.
3212         - Get rid of setters for default DOMTimer interval values as they are
3213           not set anymore.
3214         - Move default DOMTimer interval values from Settings to DOMTimer as
3215           those are global (not per-page) and not really settings.
3216         - Stop using abbreviations in the names (e.g. min -> minimum).
3217         - Move DOMTimer settings members from Page to Settings. There is no
3218           reason for those to be stored on the Page. The getters were private
3219           so call-sites had to go via Settings anyway. Also, call-sites already
3220           had to do a null check on the page to get the settings. It seems
3221           unfortunate for the settings to do another null-check on the page for
3222           retrieving the setting value from the page.
3223         - Inline the DOMTimer settings getters as these are trivial.
3224
3225         * dom/Document.cpp:
3226         (WebCore::Document::minimumTimerInterval):
3227         (WebCore::Document::timerAlignmentInterval):
3228         * dom/ScriptExecutionContext.cpp:
3229         (WebCore::ScriptExecutionContext::minimumTimerInterval):
3230         (WebCore::ScriptExecutionContext::timerAlignmentInterval):
3231         * page/DOMTimer.h:
3232         * page/Page.cpp:
3233         (WebCore::Page::Page):
3234         (WebCore::Page::setTimerThrottlingEnabled):
3235         (WebCore::Page::setMinimumTimerInterval): Deleted.
3236         (WebCore::Page::minimumTimerInterval): Deleted.
3237         * page/Page.h:
3238         (WebCore::Page::timerAlignmentInterval): Deleted.
3239         * page/Settings.cpp:
3240         (WebCore::Settings::Settings):
3241         (WebCore::Settings::setMinimumDOMTimerInterval):
3242         (WebCore::Settings::setDOMTimerAlignmentInterval):
3243         (WebCore::Settings::setHiddenPageDOMTimerAlignmentInterval): Deleted.
3244         (WebCore::Settings::hiddenPageDOMTimerAlignmentInterval): Deleted.
3245         (WebCore::Settings::setDefaultMinDOMTimerInterval): Deleted.
3246         (WebCore::Settings::defaultMinDOMTimerInterval): Deleted.
3247         (WebCore::Settings::setMinDOMTimerInterval): Deleted.
3248         (WebCore::Settings::minDOMTimerInterval): Deleted.
3249         (WebCore::Settings::setDefaultDOMTimerAlignmentInterval): Deleted.
3250         (WebCore::Settings::defaultDOMTimerAlignmentInterval): Deleted.
3251         (WebCore::Settings::domTimerAlignmentInterval): Deleted.
3252         * page/Settings.h:
3253         (WebCore::Settings::minimumDOMTimerInterval):
3254         (WebCore::Settings::domTimerAlignmentInterval):
3255         * testing/InternalSettings.cpp:
3256         (WebCore::InternalSettings::Backup::Backup):
3257         (WebCore::InternalSettings::Backup::restoreTo):
3258         (WebCore::InternalSettings::setMinimumTimerInterval):
3259
3260 2015-03-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3261
3262         [GTK] Scrollbars look bad with GTK+ 3.16
3263         https://bugs.webkit.org/show_bug.cgi?id=140800
3264
3265         Reviewed by Sergio Villar Senin.
3266
3267         Take margin into account when rendering scrollbars. This fixes the
3268         huge scrollbars rendered with GTK+ 3.16. We don't need to check
3269         the GTK+ version because in previous versions the marging were 0,
3270         so the same code just works.
3271
3272         * platform/gtk/ScrollbarThemeGtk.cpp:
3273         (WebCore::adjustRectAccordingToMargin):
3274         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
3275         (WebCore::ScrollbarThemeGtk::paintThumb):
3276
3277 2015-03-19  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3278
3279         [Streams API] Update ReadableStream API according new version of the specification
3280         https://bugs.webkit.org/show_bug.cgi?id=142822
3281
3282         Reviewed by Benjamin Poulain.
3283
3284         This patch updates the IDL of ReadableStream according the new version of the spec, which splits functionality between ReadableStream and ReadableStreamReader.
3285         In particular, this patch removes read(), ready, closed and state from ReadableStream and it adds the getReader method.
3286
3287         Covered by updated readablestream-constructor.html test.
3288
3289         * Modules/streams/ReadableStream.cpp:
3290         (WebCore::ReadableStream::ReadableStream):
3291         (WebCore::ReadableStream::state): Deleted.
3292         (WebCore::ReadableStream::closed): Deleted.
3293         (WebCore::ReadableStream::ready): Deleted.
3294         * Modules/streams/ReadableStream.h:
3295         (WebCore::ReadableStream::internalState): Added to make mac build system happy, to be used by ReadableStreamReader.
3296         * Modules/streams/ReadableStream.idl:
3297         * bindings/js/JSReadableStreamCustom.cpp:
3298         (WebCore::JSReadableStream::cancel):
3299         (WebCore::JSReadableStream::getReader):
3300         (WebCore::JSReadableStream::read): Deleted.
3301         (WebCore::getOrCreatePromiseDeferredFromObject): Deleted.
3302         (WebCore::readyPromiseSlotName): Deleted.
3303         (WebCore::JSReadableStream::ready): Deleted.
3304         (WebCore::closedPromiseSlotName): Deleted.
3305         (WebCore::JSReadableStream::closed): Deleted.
3306
3307 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
3308
3309         Unreviewed. GTK build fix after r181720.
3310
3311         * rendering/RenderImage.cpp:
3312         (WebCore::RenderImage::styleDidChange):
3313
3314 2015-03-18  Antti Koivisto  <antti@apple.com>
3315
3316         Test disk cache behavior when using back navigation cache policy
3317         https://bugs.webkit.org/show_bug.cgi?id=142848
3318
3319         Reviewed by Chris Dumez.
3320
3321         Add a way to override the normal cache policy so we can test reload behavior of cache without actually reloading.
3322
3323         Test: http/tests/cache/disk-cache-validation-back-navigation-policy.html
3324
3325         * loader/FrameLoader.cpp:
3326         (WebCore::FrameLoader::addExtraFieldsToRequest):
3327         * loader/FrameLoader.h:
3328         (WebCore::FrameLoader::setOverrideCachePolicyForTesting):
3329         * testing/Internals.cpp:
3330         (WebCore::Internals::setOverrideCachePolicy):
3331         * testing/Internals.h:
3332         * testing/Internals.idl:
3333
3334 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3335
3336         TextFragment#start() is always >= 0 since its type is unsigned
3337         https://bugs.webkit.org/show_bug.cgi?id=142860
3338
3339         Reviewed by Andreas Kling.
3340
3341         Since TextFragment::m_start is unsigned, the result of
3342         TextFragment::start() is always >= 0 and assertion is not effective.
3343         This patch removes this assertion to suppress warnings.
3344
3345         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3346         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3347
3348 2015-03-18  Alex Christensen  <achristensen@webkit.org>
3349
3350         [ContentExtensions] Prepare for compiling stylesheets of selectors to be used on every page.
3351         https://bugs.webkit.org/show_bug.cgi?id=142799
3352
3353         Reviewed by Brady Eidson.
3354
3355         * WebCore.xcodeproj/project.pbxproj:
3356         Make private headers to use with API tests.
3357         * contentextensions/CompiledContentExtension.cpp:
3358         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
3359         * contentextensions/CompiledContentExtension.h:
3360         Added method to get only the selectors from the root of the DFA, which apply to all URLs.
3361         * contentextensions/ContentExtensionCompiler.cpp:
3362         (WebCore::ContentExtensions::compileRuleList):
3363         Added checking if the trigger will match everything.
3364         These actions can be put directly on the root of the DFA without adding extra epsilon transitions to the NFA.
3365         * contentextensions/DFA.h:
3366         (WebCore::ContentExtensions::DFA::nodeAt):
3367         * contentextensions/DFABytecodeInterpreter.cpp:
3368         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
3369         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3370         * contentextensions/DFABytecodeInterpreter.h:
3371         * contentextensions/NFA.h:
3372         * contentextensions/URLFilterParser.cpp:
3373         (WebCore::ContentExtensions::Term::quantifier):
3374         Sink terms to a vector then add nodes to NFA when finalizing after checking for regexes that match everything.
3375         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
3376         (WebCore::ContentExtensions::GraphBuilder::finalize):
3377         (WebCore::ContentExtensions::GraphBuilder::parseStatus):
3378         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
3379         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
3380         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
3381         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
3382         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
3383         (WebCore::ContentExtensions::GraphBuilder::assertionWordBoundary):
3384         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
3385         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
3386         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
3387         (WebCore::ContentExtensions::GraphBuilder::atomParentheticalAssertionBegin):
3388         (WebCore::ContentExtensions::GraphBuilder::disjunction):
3389         (WebCore::ContentExtensions::GraphBuilder::hasError):
3390         (WebCore::ContentExtensions::GraphBuilder::fail):
3391         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
3392         (WebCore::ContentExtensions::URLFilterParser::addPattern):
3393         (WebCore::ContentExtensions::URLFilterParser::statusString):
3394         (WebCore::ContentExtensions::GraphBuilder::errorMessage): Deleted.
3395         * contentextensions/URLFilterParser.h:
3396         Use an enum instead of strings for the status to avoid checking strings when we have a regex that matches everything.
3397
3398 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3399
3400         Fix build failure due to FALLTHROUGH in unreachable code
3401         https://bugs.webkit.org/show_bug.cgi?id=142703
3402
3403         Reviewed by Benjamin Poulain.
3404
3405         FALLTHROUGH should not exist in unreachable code marked by
3406         ASSERT_NOT_REACHABLE.
3407
3408         When !ENABLE(CSS_SELECTOR_JIT) and Debug mode is enabled,
3409         both ASSERT_NOT_REACHED and FALLTHROUGH are instantiated
3410         and it cause build failure.
3411
3412         Here, since CompiledSingle/CompiledSingleWithRootFilter are
3413         not set when !ENABLE(CSS_SELECTOR_JIT). So dropping FALLTHROUGH
3414         and leave ASSERT_NOT_REACHED.
3415         And since ASSERT_NOT_ReACHED is stripped when Release build,
3416         I've inserted FALLTHROUGH() if ASSERT_DISABLED.
3417         This fix is the same to r162906.
3418
3419         * dom/SelectorQuery.cpp:
3420         (WebCore::SelectorDataList::execute):
3421
3422 2015-03-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
3423
3424         Switching between two SVG images with no intrinsic sizes causes them to get the default SVG size instead of the container size.
3425         https://bugs.webkit.org/show_bug.cgi?id=142805.
3426
3427         Reviewed by Darin Adler.
3428         
3429         The bug happens due to wrong logic in RenderImage::imageDimensionsChanged().
3430         This function decides to setNeedsLayout() if the intrinsic size of the image
3431         changes. If the size does not change, it only repaints the image rectangle.
3432         When switching the src of the an image between two SVG images and both of
3433         them have no intrinsic size, we do not updateInnerContentRect() and this
3434         means an SVGImageForContainer is not going to be created for this image.
3435         When the image is drawn, it is drawn directly from the SVGImage. And this
3436         means the drawing has to be scaled by container_size / SVG_default_intrinsic_size
3437         
3438         After figuring out that I need to updateInnerContentRect() to fix this bug,
3439         I found out Blink has already changed this code to do the same thing. But 
3440         they also did more clean-up in this function. Here is the link
3441         https://codereview.chromium.org/114323004. I think their change seems correct
3442         although they did not say what exactly they were trying to fix.
3443         
3444         The plan for repaintOrMarkForLayout(), which is the new name of this function,
3445         is the following:
3446             -- setNeedLayout() if the intrinsic size changes and it affects the size
3447                of the image.
3448             -- updateInnerContentRect() if the intrinsic size did not change but the
3449                image has exiting layout.
3450             -- repaint the image rectangle if layout is not needed.
3451             
3452         This change also removes the call to computeLogicalWidthInRegion(), which is
3453         almost running a layout for the image. This call figures out whether the image
3454         needs to setNeedsLayout(). This call is unnecessary; the image needs to run a
3455         layout if the intrinsic size has changed and it affects the size of the image.
3456                     
3457         Test: svg/as-image/svg-no-intrinsic-size-switching.html
3458
3459         * rendering/RenderImage.cpp:
3460         (WebCore::RenderImage::styleDidChange): Change the function call.
3461         (WebCore::RenderImage::imageChanged): Rename local variable and change the
3462         function call.
3463         
3464         (WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Simplify this function.
3465         Call setIntrinsicSize() with the new size unless the image is in error state.
3466         
3467         (WebCore::RenderImage::repaintOrMarkForLayout): This a better name for this
3468         function since it is called even if the intrinsic size was not changed.
3469         (WebCore::RenderImage::imageDimensionsChanged): Deleted.
3470         
3471         * rendering/RenderImage.h: Rename imageDimensionsChanged() and change the 
3472         updateIntrinsicSizeIfNeeded() to return void.
3473         
3474         * rendering/svg/RenderSVGForeignObject.cpp:
3475         (WebCore::RenderSVGForeignObject::paint): Code cleanup. This function can
3476         only handle the paint phases PaintPhaseForeground and PaintPhaseSelection.
3477         Use this information to simplify the logic and order of painting there.
3478
3479 2015-03-18  Jeremy Jones  <jeremyj@apple.com>
3480
3481         Fix typo in playerViewControllerWillCancelOptimizedFullscree.
3482         https://bugs.webkit.org/show_bug.cgi?id=142745
3483
3484         Reviewed by Darin Adler.
3485
3486         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3487         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]):
3488         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]): Deleted.
3489
3490 2015-03-18  Simon Fraser  <simon.fraser@apple.com>
3491
3492         Avoid repaints when changing transform on an element with multiple background images
3493         https://bugs.webkit.org/show_bug.cgi?id=142841
3494
3495         Reviewed by Zalan Bujtas.
3496         
3497         Replace the cheap test for changed images in RenderElement::updateFillImages()
3498         with an exhaustive test that walks the entire list of background images,
3499         since any ensuing repaint is way more expensive than a slightly more expensive check here.
3500         
3501         Test: fast/repaint/multiple-backgrounds-style-change.html
3502
3503         * rendering/RenderElement.cpp:
3504         (WebCore::RenderElement::updateFillImages):
3505         * rendering/style/FillLayer.cpp:
3506         (WebCore::layerImagesIdentical): See if both images are the same (either none
3507         or both mask images, and same image pointer).
3508         (WebCore::FillLayer::imagesIdentical): Walk the two FillLayer lists, checking the images
3509         on each one. Returns false if we reach the end of one list before the other, or the images
3510         are different.
3511         * rendering/style/FillLayer.h: New static function; static because
3512         it compares two FillLayer lists, and I think that makes more sense than
3513         a member function.
3514
3515 2015-03-18  Anders Carlsson  <andersca@apple.com>
3516
3517         Pass cookies by reference in CookieHash functions
3518         https://bugs.webkit.org/show_bug.cgi?id=142839
3519
3520         Reviewed by Sam Weinig.
3521
3522         * platform/Cookie.h:
3523         (WebCore::CookieHash::hash):
3524         (WebCore::CookieHash::equal):
3525
3526 2015-03-18  Tim Horton  <timothy_horton@apple.com>
3527
3528         Temporarily fix the !ENABLE(CSS_SELECTOR_JIT) and assertions-enabled build
3529
3530         * dom/SelectorQuery.cpp:
3531         (WebCore::SelectorDataList::execute):
3532
3533 2015-03-18  Myles C. Maxfield  <mmaxfield@apple.com>
3534
3535         Call CTFontSetRenderingParameters before rendering text
3536         https://bugs.webkit.org/show_bug.cgi?id=142816
3537
3538         Reviewed by Darin Adler.
3539
3540         No new tests.
3541
3542         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3543         (WebCore::showGlyphsWithAdvances):
3544         * platform/spi/cocoa/CoreTextSPI.h:
3545
3546 2015-03-18  Chris Dumez  <cdumez@apple.com>
3547
3548         [WK2] Log the number of network cache requests that we have never seen before
3549         https://bugs.webkit.org/show_bug.cgi?id=142828
3550         <rdar://problem/19632130>
3551
3552         Reviewed by Antti Koivisto.
3553
3554         Add diagnostic logging key for network cache efficacy logging.
3555
3556         * page/DiagnosticLoggingKeys.cpp:
3557         (WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey):
3558         (WebCore::DiagnosticLoggingKeys::requestKey):
3559         * page/DiagnosticLoggingKeys.h:
3560
3561 2015-03-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3562
3563         Use filterRootId in SelectorQuery even if CSS JIT is not enabled
3564         https://bugs.webkit.org/show_bug.cgi?id=142703
3565
3566         Reviewed by Benjamin Poulain.
3567
3568         filterRootId pruning path is not inherently related to CSS JIT.
3569         This patch enables filterRootId even in the environment
3570         where CSS JIT is not enabled.
3571
3572         * dom/SelectorQuery.cpp:
3573         (WebCore::filterRootById):
3574         (WebCore::SelectorDataList::executeSingleSelectorData):
3575         (WebCore::SelectorDataList::execute):
3576         * dom/SelectorQuery.h:
3577
3578 2015-03-18  Zalan Bujtas  <zalan@apple.com>
3579
3580         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
3581         https://bugs.webkit.org/show_bug.cgi?id=142809
3582
3583         Reviewed by Antti Koivisto.
3584
3585         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
3586
3587         No change in functionality.
3588
3589         * rendering/SimpleLineLayoutFlowContents.h:
3590         (WebCore::SimpleLineLayout::FlowContents::begin):
3591         (WebCore::SimpleLineLayout::FlowContents::end):
3592         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
3593         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
3594         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
3595         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
3596         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
3597         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
3598         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
3599         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3600         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3601
3602 2015-03-18  Zalan Bujtas  <zalan@apple.com>
3603
3604         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
3605         https://bugs.webkit.org/show_bug.cgi?id=142785
3606
3607         Reviewed by Antti Koivisto.
3608
3609         This is in transition to support <br>. A particular position could point to multiple
3610         segments when <br> is directly followed by text.
3611
3612         No change in functionality.
3613
3614         * rendering/SimpleLineLayoutFlowContents.cpp:
3615         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
3616         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
3617         * rendering/SimpleLineLayoutFlowContents.h:
3618         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
3619         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
3620         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
3621         * rendering/SimpleLineLayoutResolver.cpp:
3622         (WebCore::SimpleLineLayout::RunResolver::Run::text):
3623
3624 2015-03-17  Simon Fraser  <simon.fraser@apple.com>
3625
3626         Skip trying to paint overlay scrollbars when there are none or they are clipped out
3627         https://bugs.webkit.org/show_bug.cgi?id=142811
3628         rdar://problem/20200725
3629
3630         Reviewed by Darin Adler.
3631
3632         In some content with lots of layers and overflow:scroll, we could spend 20% of
3633         the time under paintOverflowControlsForFragments() setting up an (empty) clip,
3634         and then trying to draw scrollbars that we don't have.
3635         
3636         Avoid calling paintOverflowControlsForFragments() if there are no scrollbars,
3637         and don't both setting up an empty clip just to paint nothing.
3638
3639         * rendering/RenderLayer.cpp:
3640         (WebCore::RenderLayer::paintLayerContents):
3641         (WebCore::RenderLayer::paintOverflowControlsForFragments):
3642
3643 2015-03-18  Per Arne Vollan  <peavo@outlook.com>
3644
3645         [WinCairo] Unreviewed build fix after r181665.
3646
3647         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3648         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
3649
3650 2015-03-18  Joseph Pecoraro  <pecoraro@apple.com>
3651
3652         Remove unused "preprocessor" parameter to sub-CodeGenerators
3653         https://bugs.webkit.org/show_bug.cgi?id=142793
3654
3655         Reviewed by Darin Adler.
3656
3657         * bindings/scripts/CodeGenerator.pm:
3658         (ProcessDocument):
3659         (FileNamePrefix):
3660         * bindings/scripts/CodeGeneratorObjC.pm:
3661
3662 2015-03-18  Zalan Bujtas  <zalan@apple.com>
3663
3664         Simple line layout: Split fragments on renderer boundary on the fly.
3665         https://bugs.webkit.org/show_bug.cgi?id=142579
3666
3667         Reviewed by Antti Koivisto.
3668
3669         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
3670         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
3671         fragments across renderer boundary.
3672
3673         Test: fast/text/simple-line-with-multiple-renderers.html
3674
3675         * rendering/SimpleLineLayout.cpp:
3676         (WebCore::SimpleLineLayout::revertRuns):
3677         (WebCore::SimpleLineLayout::LineState::isEmpty):
3678         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Check if fragments need a new run and
3679         whether neighboring fragments need collapsing.
3680         (WebCore::SimpleLineLayout::LineState::revertUncommitted): Revert fragments over multiple renderers if they form
3681         a fragment continuation.
3682         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3683         (WebCore::SimpleLineLayout::forceFragmentToLine): Ensure that if a fragment has continuation across multiple renderers,
3684         they all get added to the current line.
3685         (WebCore::SimpleLineLayout::createLineRuns):
3686         (WebCore::SimpleLineLayout::LineState::appendFragment): Deleted.
3687         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
3688         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
3689         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
3690         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
3691         (WebCore::SimpleLineLayout::begin): Deleted.
3692         (WebCore::SimpleLineLayout::end): Deleted.
3693         (WebCore::SimpleLineLayout::preWrap): Deleted.
3694         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
3695         (WebCore::SimpleLineLayout::updateLineConstrains): Deleted.
3696         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Deleted.
3697         (WebCore::SimpleLineLayout::createTextRuns): Deleted.
3698         (WebCore::SimpleLineLayout::create): Deleted.
3699         (WebCore::SimpleLineLayout::Layout::create): Deleted.
3700         * rendering/SimpleLineLayoutFlowContents.h:
3701         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator+):
3702         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
3703         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->):
3704         * rendering/SimpleLineLayoutFunctions.cpp:
3705         (WebCore::SimpleLineLayout::paintFlow): Unrelated fix on non-collapsed tab position.
3706         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3707         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
3708         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
3709         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3710         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
3711         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3712         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3713         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
3714         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::overlapsToNextRenderer):
3715         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsible):
3716         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
3717         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
3718         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
3719
3720 2015-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
3721
3722         Flex and grid items should be painted as inline-blocks
3723         https://bugs.webkit.org/show_bug.cgi?id=142266
3724
3725         Reviewed by Darin Adler.
3726
3727         Based on Blink r157004 by <cbiesinger@chromium.org>.
3728         https://src.chromium.org/viewvc/blink?revision=157004&view=revision
3729
3730         Both flexbox and grid specs define that the painting order of flex/grid
3731         items is the same as inline blocks. See
3732         http://dev.w3.org/csswg/css-flexbox/#painting and
3733         http://dev.w3.org/csswg/css-grid/#z-order.
3734
3735         Extracted inline blocks painting code from InlineElementBox and moved to
3736         a helper method that will be reused for flexboxes and grids.
3737
3738         Tests: css3/flexbox/flex-item-text-background-not-interleaved.html
3739                fast/css-grid-layout/grid-item-text-background-not-interleaved.html
3740
3741         * rendering/InlineElementBox.cpp:
3742         (WebCore::InlineElementBox::paint): Move code to
3743         RenderElement::paintAsInlineBlock().
3744         * rendering/RenderBlock.cpp:
3745         (WebCore::RenderBlock::paintChild): Add new argument to paint children
3746         as inline blocks.
3747         * rendering/RenderBlock.h: Define PaintType enmu and modify paintChild()
3748         signature to add the new argument.
3749         * rendering/RenderElement.cpp:
3750         (WebCore::paintPhase): Paint element in a phase.
3751         (WebCore::RenderElement::paintAsInlineBlock): Code extracted from
3752         InlineElementBox::paint().
3753         * rendering/RenderElement.h: Add new method signature.
3754         * rendering/RenderFlexibleBox.cpp:
3755         (WebCore::RenderFlexibleBox::paintChildren): Call
3756         RenderBlock::paintChild() with the new argument.
3757         * rendering/RenderGrid.cpp:
3758         (WebCore::RenderGrid::paintChildren): Ditto.
3759
3760 2015-03-18  Chris Dumez  <cdumez@apple.com>
3761
3762         [WK2] Log total number of network cache queries using diagnostic logging
3763         https://bugs.webkit.org/show_bug.cgi?id=142803
3764         <rdar://problem/19632130>
3765
3766         Reviewed by Antti Koivisto.
3767
3768         Add diagnostic logging key needed for network efficacy logging.
3769
3770         * page/DiagnosticLoggingKeys.cpp:
3771         (WebCore::DiagnosticLoggingKeys::retrievalRequestKey):
3772         * page/DiagnosticLoggingKeys.h:
3773
3774 2015-03-18  Tim Horton  <timothy_horton@apple.com>
3775
3776         Fix the build after r181660
3777
3778         * page/EventHandler.cpp:
3779         (WebCore::EventHandler::setImmediateActionStage):
3780         * page/EventHandler.h:
3781         (WebCore::EventHandler::setImmediateActionStage):
3782         Un-inline setImmediateActionStage, because it is exported to WebCore, and
3783         exporting inline thing causes random weak symbol errors on some platforms.
3784
3785 2015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
3786
3787         Ignore some deprecation warnings
3788         https://bugs.webkit.org/show_bug.cgi?id=142813
3789
3790         Reviewed by Mark Rowe.
3791
3792         Fixing the deprecations is tracked by: <rdar://problem/20201450>
3793
3794         * editing/cocoa/HTMLConverter.mm:
3795         (HTMLConverter::_processElement):
3796
3797 2015-03-17  Commit Queue  <commit-queue@webkit.org>
3798
3799         Unreviewed, rolling out r181667, r181682, and r181683.
3800         https://bugs.webkit.org/show_bug.cgi?id=142812
3801
3802         Broke multiple tests with ASan, plus dependent commits
3803         (Requested by ap on #webkit).
3804
3805         Reverted changesets:
3806
3807         "Simple line layout: Split fragments on renderer boundary on
3808         the fly."
3809         https://bugs.webkit.org/show_bug.cgi?id=142579
3810         http://trac.webkit.org/changeset/181667
3811
3812         "Simple line layout: Change FlowContents::segmentForPosition()
3813         to segmentForRun()."
3814         https://bugs.webkit.org/show_bug.cgi?id=142785
3815         http://trac.webkit.org/changeset/181682
3816
3817         "Simple line layout: Use Vector<>::const_iterator instead of
3818         custom FlowContents::Iterator."
3819         https://bugs.webkit.org/show_bug.cgi?id=142809
3820         http://trac.webkit.org/changeset/181683
3821
3822 2015-03-17  Zalan Bujtas  <zalan@apple.com>
3823
3824         Simple line layout: Use Vector<>::const_iterator instead of custom FlowContents::Iterator.
3825         https://bugs.webkit.org/show_bug.cgi?id=142809
3826
3827         Reviewed by Antti Koivisto.
3828
3829         FlowContents::Iterator simply iterates on a vector<>. No need to custom implement it.
3830
3831         No change in functionality.
3832
3833         * rendering/SimpleLineLayoutFlowContents.h:
3834         (WebCore::SimpleLineLayout::FlowContents::begin):
3835         (WebCore::SimpleLineLayout::FlowContents::end):
3836         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator): Deleted.
3837         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++): Deleted.
3838         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator--): Deleted.
3839         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==): Deleted.
3840         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=): Deleted.
3841         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*): Deleted.
3842         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator->): Deleted.
3843         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3844         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3845
3846 2015-03-17  Zalan Bujtas  <zalan@apple.com>
3847
3848         Simple line layout: Change FlowContents::segmentForPosition() to segmentForRun().
3849         https://bugs.webkit.org/show_bug.cgi?id=142785
3850
3851         Reviewed by Antti Koivisto.
3852
3853         This is in transition to support <br>. A particular position could point to multiple
3854         segments when <br> is directly followed by text.
3855
3856         No change in functionality.
3857
3858         * rendering/SimpleLineLayoutFlowContents.cpp:
3859         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):
3860         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow): Deleted.
3861         * rendering/SimpleLineLayoutFlowContents.h:
3862         (WebCore::SimpleLineLayout::FlowContents::segmentForRun):
3863         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition): Deleted.
3864         (WebCore::SimpleLineLayout::FlowContents::segmentForPosition): Deleted.
3865         * rendering/SimpleLineLayoutResolver.cpp:
3866         (WebCore::SimpleLineLayout::RunResolver::Run::text):
3867
3868 2015-03-17  Chris Dumez  <cdumez@apple.com>
3869
3870         [Mac][iOS] setSharedTimerFireInterval() / stopSharedTimer() are expensive
3871         https://bugs.webkit.org/show_bug.cgi?id=142752
3872         <rdar://problem/20176731>
3873
3874         Reviewed by Antti Koivisto.
3875
3876         setSharedTimerFireInterval() / stopSharedTimer() are expensive on Mac
3877         and iOS on pages using a lot of timers.
3878
3879         For example, on bing.com / iOS, ~15.4% of the CPU time is spent in
3880         setSharedTimerFireInterval() and ~14.7% of the CPU time is spent in
3881         stopSharedTimer(). The expensive calls are CFRunLoopAddTimer (11.4%),
3882         CFRunLoopTimerInvalidate (14.1%), CFRunLoopTimerCreate (3.3%).
3883
3884         The issue is that we keep creating, adding to run loop modes, and then
3885         destroying the sharedTimer for each firing event. This is very
3886         expensive. In such case, the CFRunLoopTimerRef documentation advises to
3887         """
3888         ... create a repeating timer with an initial firing time in the distant
3889         future (or the initial firing time) and a very large repeat interval—on
3890         the order of decades or more—and add it to all the necessary run loop
3891         modes. Then, when you know when the timer should fire next, you reset
3892         the firing time with CFRunLoopTimerSetNextFireDate, perhaps from the
3893         timer’s own callback function. This technique effectively produces a
3894         reusable, asynchronous timer.
3895         """ [1].
3896
3897         Doing so greatly decreases CPU time spend in:
3898         - setSharedTimerFireInterval(): 15.4% -> 4.6%
3899         - stopSharedTimer(): 14.6% -> 8.6%
3900
3901         Overall CPU time spent on bing.com in timerFired() goes down from
3902         ~61.2% to ~49.5%.
3903
3904         This patch also refactors the SharedTimer code to share as much as
3905         possible between Mac and iOS.
3906
3907         This patch is based in part on the following patch:
3908         http://trac.webkit.org/changeset/143210
3909
3910         [1] https://developer.apple.com/library/prerelease/ios/documentation/CoreFoundation/Reference/CFRunLoopTimerRef/index.html#//apple_ref/c/func/CFRunLoopTimerSetNextFireDate
3911
3912         * WebCore.xcodeproj/project.pbxproj:
3913         * platform/SharedTimer.h:
3914         (WebCore::SharedTimer::invalidate):
3915         (WebCore::MainThreadSharedTimer::setFiredFunction): Deleted.
3916         (WebCore::MainThreadSharedTimer::setFireInterval): Deleted.
3917         (WebCore::MainThreadSharedTimer::stop): Deleted.
3918         * platform/ThreadTimers.cpp:
3919         (WebCore::ThreadTimers::fireTimersInNestedEventLoop):
3920         * platform/cf/SharedTimerCF.mm: Added.
3921         (WebCore::applicationDidBecomeActive):
3922         (WebCore::setupPowerObserver):
3923         (WebCore::setSharedTimerFiredFunction):
3924         (WebCore::timerFired):
3925         (WebCore::restartSharedTimer):
3926         (WebCore::invalidateSharedTimer):
3927         (WebCore::setSharedTimerFireInterval):
3928         (WebCore::stopSharedTimer):
3929         * platform/efl/SharedTimerEfl.cpp:
3930         (WebCore::invalidateSharedTimer):
3931         * platform/gtk/SharedTimerGtk.cpp:
3932         (WebCore::invalidateSharedTimer):
3933         * platform/ios/SharedTimerIOS.mm: Removed.
3934         * platform/mac/PowerObserverMac.h: Copied from Source/WebCore/platform/efl/SharedTimerEfl.cpp.
3935         * platform/mac/PowerObserverMac.mm: Renamed from Source/WebCore/platform/mac/SharedTimerMac.mm.
3936         (WebCore::PowerObserver::PowerObserver):
3937         (WebCore::PowerObserver::~PowerObserver):
3938         (WebCore::PowerObserver::didReceiveSystemPowerNotification):
3939         * platform/win/SharedTimerWin.cpp:
3940         (WebCore::removeSharedTimer):
3941
3942 2015-03-17  Tim Horton  <timothy_horton@apple.com>
3943
3944         Cannot invoke action menus anymore
3945         https://bugs.webkit.org/show_bug.cgi?id=142797
3946         <rdar://problem/20032670>
3947
3948         Reviewed by Beth Dakin.
3949
3950         * platform/spi/mac/NSMenuSPI.h:
3951         Add additional NSMenu SPI.
3952
3953 2015-03-17  Zalan Bujtas  <zalan@apple.com>
3954
3955         Simple line layout: Split fragments on renderer boundary on the fly.
3956         https://bugs.webkit.org/show_bug.cgi?id=142579
3957
3958         Reviewed by Antti Koivisto.
3959
3960         Fragment splitting at renderers' boundary at the end of the line is no longer needed.
3961         This patch ensures that TextFragmentIterator::nextTextFragment() does not concatenate
3962         fragments across renderer boundary.
3963
3964         Test: fast/text/simple-line-with-multiple-renderers.html