[Mac] Use Fast enumeration consistently in WebFontCache.mm
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-10-18  Chris Dumez  <cdumez@apple.com>
2
3         [Mac] Use Fast enumeration consistently in WebFontCache.mm
4         https://bugs.webkit.org/show_bug.cgi?id=137791
5
6         Reviewed by Darin Adler.
7
8         Use fast enumeration consistently in WebFontCache.mm as this results in
9         more efficient, concise and safer code.
10
11         No new tests, no behavior change.
12
13         * platform/mac/WebFontCache.mm:
14         (+[WebFontCache getTraits:inFamily:]):
15         Reserve Vector capacity before the loop as we know how many traits we
16         are going to append. Also use uncheckedAppend() for performance.
17
18         (+[WebFontCache internalFontWithFamily:traits:weight:size:]):
19
20 2014-10-18  Chris Fleizach  <cfleizach@apple.com>
21
22         AX: Tables with <colgroups> are not reporting table column headers
23         https://bugs.webkit.org/show_bug.cgi?id=137846
24
25         Reviewed by Mario Sanchez Prada.
26
27         The code to search for header objects was getting stuck on anonymous RenderTableSections.
28         We also need to check more rows for headers, in case the first row or more is not visible or is empty.
29
30         Test: accessibility/table-column-headers-with-captions.html
31
32         * accessibility/AccessibilityTableColumn.cpp:
33         (WebCore::AccessibilityTableColumn::headerObject):
34         (WebCore::AccessibilityTableColumn::headerObjectForSection):
35
36 2014-10-18  KwangHyuk Kim  <hyuki.kim@samsung.com>
37
38         [EFL] build break occurs on webkit efl build.
39         https://bugs.webkit.org/show_bug.cgi?id=137844
40
41         Reviewed by Gyuyoung Kim.
42
43         As local variable elementAddressRegisterIndex is assigned but not used, there is build break for the webkit efl.
44
45         No new tests because it's just to fix build break.
46
47         * cssjit/SelectorCompiler.cpp:
48         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
49
50 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
51
52         Apply std::unique_ptr to FooFont classes
53         https://bugs.webkit.org/show_bug.cgi?id=137769
54
55         Reviewed by Andreas Kling.
56
57         As a step to use std::unique_ptr, this patch applies std::unique_ptr to Font classes.
58
59         No new tests, no behavior changes.
60
61         * platform/graphics/Font.cpp:
62         (WebCore::retrieveOrAddCachedFontGlyphs):
63         (WebCore::Font::createLayout):
64         * platform/graphics/SimpleFontData.cpp:
65         (WebCore::SimpleFontData::DerivedFontData::create):
66         * platform/graphics/SimpleFontData.h:
67         Remove create() factory function because public ctor and std::make_unique<> can replace it.
68         * platform/graphics/mac/ComplexTextController.cpp:
69         (WebCore::Font::createLayout):
70
71 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
72
73         Use std::unique_ptr in WebCore/bindings
74         https://bugs.webkit.org/show_bug.cgi?id=137808
75
76         Reviewed by Andreas Kling.
77
78         Clean up PassOwnPtr|OwnPtr in WebCore/bindings by using std::unique_ptr, std::make_unique
79         and WTF::move.
80
81         No new tests, no behavior changes.
82
83         * bindings/generic/ActiveDOMCallback.h:
84         * bindings/js/JSMessageEventCustom.cpp:
85         (WebCore::handleInitMessageEvent):
86         * bindings/js/SerializedScriptValue.cpp:
87         (WebCore::SerializedScriptValue::SerializedScriptValue):
88         (WebCore::SerializedScriptValue::transferArrayBuffers):
89         (WebCore::SerializedScriptValue::create):
90         * bindings/js/SerializedScriptValue.h:
91         * bindings/js/WorkerScriptDebugServer.cpp:
92         (WebCore::WorkerScriptDebugServer::interruptAndRunTask):
93         * bindings/js/WorkerScriptDebugServer.h:
94         * inspector/WorkerDebuggerAgent.cpp:
95         (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
96
97 2014-10-16  Roger Fong  <roger_fong@apple.com>
98
99         Calling glReadPixels with BGRA format on an NVIDIA machine with an opaque context returns the wrong alpha values.
100         https://bugs.webkit.org/show_bug.cgi?id=137793.
101         <rdar://problem/15408133>
102
103         Reviewed by Dean Jackson.
104
105         This fixes conformance test context/context-attribute-preserve-drawing-buffer.html.
106
107         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
108         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
109         On an NVIDIA machine, when the context has alpha turned off, call glReadPixels with RGBA format and then convert to RGBA.
110
111 2014-10-17  Chris Dumez  <cdumez@apple.com>
112
113         Use is<>() / downcast<>() for all SVG RenderObjects
114         https://bugs.webkit.org/show_bug.cgi?id=137840
115
116         Reviewed by Benjamin Poulain.
117
118         Use is<>() / downcast<>() for all SVG RenderObjects and clean up the
119         surrounding code.
120
121         No new tests, no behaviro change.
122
123         * accessibility/AccessibilityRenderObject.cpp:
124         (WebCore::AccessibilityRenderObject::supportsPath):
125         (WebCore::AccessibilityRenderObject::elementPath):
126         * page/FrameView.cpp:
127         (WebCore::FrameView::applyOverflowToViewport):
128         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
129         * rendering/RenderLayerFilterInfo.cpp:
130         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
131         * rendering/svg/RenderSVGGradientStop.cpp:
132         (WebCore::RenderSVGGradientStop::styleDidChange):
133         * rendering/svg/RenderSVGImage.h:
134         * rendering/svg/RenderSVGInlineText.h:
135         * rendering/svg/RenderSVGResourceContainer.cpp:
136         (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):
137         * rendering/svg/RenderSVGResourceContainer.h:
138         * rendering/svg/RenderSVGRoot.cpp:
139         (WebCore::RenderSVGRoot::addResourceForClientInvalidation):
140         * rendering/svg/RenderSVGRoot.h:
141         * rendering/svg/RenderSVGShape.h:
142         * rendering/svg/RenderSVGText.cpp:
143         (WebCore::collectLayoutAttributes):
144         (WebCore::RenderSVGText::subtreeChildWillBeRemoved):
145         (WebCore::RenderSVGText::subtreeTextDidChange):
146         (WebCore::updateFontInAllDescendants):
147         * rendering/svg/RenderSVGText.h:
148         * rendering/svg/SVGInlineTextBox.h:
149         * rendering/svg/SVGRenderSupport.cpp:
150         (WebCore::SVGRenderSupport::mapLocalToContainer):
151         (WebCore::SVGRenderSupport::pushMappingToContainer):
152         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
153         * rendering/svg/SVGRenderTreeAsText.cpp:
154         (WebCore::writeStyle):
155         * rendering/svg/SVGRenderingContext.cpp:
156         (WebCore::SVGRenderingContext::bufferForeground):
157         * rendering/svg/SVGResourcesCycleSolver.cpp:
158         (WebCore::SVGResourcesCycleSolver::resolveCycles):
159         * rendering/svg/SVGRootInlineBox.cpp:
160         (WebCore::SVGRootInlineBox::renderSVGText):
161         (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation):
162         * svg/SVGCircleElement.cpp:
163         (WebCore::SVGCircleElement::svgAttributeChanged):
164         * svg/SVGElement.cpp:
165         (WebCore::SVGElement::svgAttributeChanged):
166         * svg/SVGEllipseElement.cpp:
167         (WebCore::SVGEllipseElement::svgAttributeChanged):
168         * svg/SVGImageElement.cpp:
169         (WebCore::SVGImageElement::svgAttributeChanged):
170         (WebCore::SVGImageElement::didAttachRenderers):
171         * svg/SVGLineElement.cpp:
172         (WebCore::SVGLineElement::svgAttributeChanged):
173         * svg/SVGPolyElement.cpp:
174         (WebCore::SVGPolyElement::svgAttributeChanged):
175         * svg/SVGRectElement.cpp:
176         (WebCore::SVGRectElement::svgAttributeChanged):
177         * svg/SVGSVGElement.cpp:
178         (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
179         (WebCore::SVGSVGElement::currentViewBoxRect):
180         * svg/graphics/SVGImage.cpp:
181         (WebCore::SVGImage::setContainerSize):
182         (WebCore::SVGImage::containerSize):
183
184 2014-10-17  Chris Dumez  <cdumez@apple.com>
185
186         Avoid unnecessary isSVGFont() check in SimpleFontData::applyTransforms()
187         https://bugs.webkit.org/show_bug.cgi?id=137836
188
189         Reviewed by Andreas Kling.
190
191         Avoid unnecessary isSVGFont() check in SimpleFontData::applyTransforms().
192         This function is only called from WidthIterator::applyFontTransforms(),
193         which already makes sure to call applyTransforms() if isSVGFont()
194         returns false. This patch replaces the check with a simple assertion.
195
196         No new tests, no behavior change.
197
198         * platform/graphics/SimpleFontData.h:
199         * svg/SVGFontData.h:
200
201 2014-10-17  Michael Saboff  <msaboff@apple.com>
202
203         Don't create cached functions that access lexicalGlobalObject()
204         https://bugs.webkit.org/show_bug.cgi?id=137839
205
206         Reviewed by Geoffrey Garen.
207
208         Made it so that all the JSDOMWindow special functions blur(), close(), focus() and postMessage()
209         are always created as needed for every prototype.  Made it so that JSHTMLDocument does
210         the same for open().  Updated test to account for these methods not being cached
211
212         Updated tests accordingly.
213
214         * bindings/js/JSDOMWindowCustom.cpp: 
215         (WebCore::JSDOMWindow::getOwnPropertySlot): Updated to always create cached versions of the
216         special functions.
217         * bindings/js/JSHTMLDocumentCustom.cpp:
218         (WebCore::JSHTMLDocument::getOwnPropertySlot): Added to create an uncached open() method when
219         it is first accessed.
220         * html/HTMLDocument.idl: Added CustomGetOwnPropertySlot and implemented it in JSHTMLDocumentCustom.cpp.
221
222 2014-10-17  Simon Fraser  <simon.fraser@apple.com>
223
224         [iOS] Speculative fix for a crash under RenderLayerCompositor::updateScrollCoordinatedLayer()
225         https://bugs.webkit.org/show_bug.cgi?id=137837
226         rdar://problem/18545452
227
228         Reviewed by Tim Horton.
229
230         Crash logs suggest that an iframe's RenderView's RenderLayer's backing can be null
231         in a call to updateScrollCoordinatedLayer(), so add an assertion (to help find a reproducible case)
232         and a null check.
233
234         * rendering/RenderLayerCompositor.cpp:
235         (WebCore::RenderLayerCompositor::attachScrollingNode):
236
237 2014-10-17  Andreas Kling  <akling@apple.com>
238
239         Re-arrange parentheses for compilation purposes.
240
241         * cssjit/SelectorCompiler.cpp:
242         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
243
244 2014-10-17  Andreas Kling  <akling@apple.com>
245
246         Unreviewed build fix after r174838.
247
248         Use StackAllocator::addressOf() instead of the old way of grabbing at a stack reference.
249
250         * cssjit/SelectorCompiler.cpp:
251         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
252
253 2014-10-17  Chris Dumez  <cdumez@apple.com>
254
255         Use is<>() / downcast<>() for RenderBox
256         https://bugs.webkit.org/show_bug.cgi?id=137804
257
258         Reviewed by Andreas Kling.
259
260         Use is<>() / downcast<>() for RenderBox and clean up the surrounding
261         code.
262
263         No new tests, no behavior change.
264
265         * accessibility/AccessibilityRenderObject.cpp:
266         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
267         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
268         (WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable):
269         (WebCore::AccessibilityRenderObject::scrollTo):
270         * bindings/objc/DOMHTML.mm:
271         (-[DOMHTMLElement scrollYOffset]):
272         (-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):
273         * bindings/objc/DOMUIKitExtensions.mm:
274         (-[DOMNode borderRadii]):
275         * css/CSSComputedStyleDeclaration.cpp:
276         (WebCore::sizingBox):
277         (WebCore::computedTransform):
278         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
279         (WebCore::ComputedStyleExtractor::propertyValue):
280         * dom/ContainerNode.cpp:
281         (WebCore::ContainerNode::getLowerRightCorner):
282         * dom/Document.cpp:
283         (WebCore::Document::webkitWillEnterFullScreenForElement):
284         * dom/Element.cpp:
285         (WebCore::Element::scrollByUnits):
286         * dom/Node.cpp:
287         (WebCore::Node::defaultEventHandler):
288         * dom/Position.cpp:
289         (WebCore::endsOfNodeAreVisuallyDistinctPositions):
290         * editing/DeleteButtonController.cpp:
291         (WebCore::isDeletableElement):
292         * editing/EditorCommand.cpp:
293         (WebCore::verticalScrollDistance):
294         * editing/FrameSelection.cpp:
295         (WebCore::CaretBase::paintCaret):
296         * editing/TextIterator.cpp:
297         (WebCore::fullyClipsContents):
298         (WebCore::shouldEmitExtraNewlineForNode):
299         * editing/htmlediting.cpp:
300         (WebCore::absoluteBoundsForLocalCaretRect):
301         * html/HTMLFormControlElement.cpp:
302         (WebCore::HTMLFormControlElement::isFocusable):
303         * html/HTMLPlugInImageElement.cpp:
304         (WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting):
305         * html/HTMLSelectElement.cpp:
306         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
307         * html/shadow/SliderThumbElement.cpp:
308         (WebCore::SliderThumbElement::setPositionFromPoint):
309         * inspector/InspectorOverlay.cpp:
310         (WebCore::buildObjectForElementInfo):
311         * page/AutoscrollController.cpp:
312         (WebCore::AutoscrollController::updateAutoscrollRenderer):
313         * page/EventHandler.cpp:
314         (WebCore::EventHandler::startPanScrolling):
315         * page/FrameView.cpp:
316         (WebCore::FrameView::embeddedContentBox):
317         * page/GestureTapHighlighter.cpp:
318         * page/SpatialNavigation.cpp:
319         (WebCore::isScrollableNode):
320         * page/animation/CSSPropertyAnimation.cpp:
321         (WebCore::blendFunc):
322         * platform/efl/RenderThemeEfl.cpp:
323         (WebCore::RenderThemeEfl::baselinePosition):
324         * plugins/PluginView.cpp:
325         (WebCore::PluginView::invalidateWindowlessPluginRect):
326         * rendering/InlineBox.cpp:
327         (WebCore::InlineBox::logicalHeight):
328         (WebCore::InlineBox::adjustPosition):
329         * rendering/InlineElementBox.cpp:
330         (WebCore::InlineElementBox::deleteLine):
331         (WebCore::InlineElementBox::extractLine):
332         (WebCore::InlineElementBox::attachLine):
333         (WebCore::InlineElementBox::paint):
334         (WebCore::InlineElementBox::nodeAtPoint):
335         * rendering/InlineFlowBox.cpp:
336         (WebCore::InlineFlowBox::addToLine):
337         (WebCore::InlineFlowBox::addReplacedChildOverflow):
338         * rendering/LayoutState.cpp:
339         (WebCore::LayoutState::LayoutState):
340         * rendering/RenderBlock.cpp:
341         (WebCore::RenderBlock::simplifiedNormalFlowLayout):
342         (WebCore::RenderBlock::markFixedPositionObjectForLayoutIfNeeded):
343         (WebCore::RenderBlock::clearPercentHeightDescendantsFrom):
344         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
345         (WebCore::RenderBlock::addFocusRingRects):
346         * rendering/RenderBlockFlow.cpp:
347         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
348         (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
349         * rendering/RenderBlockLineLayout.cpp:
350         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
351         (WebCore::RenderBlockFlow::layoutLineBoxes):
352         * rendering/RenderBox.cpp:
353         (WebCore::RenderBox::findAutoscrollable):
354         (WebCore::computeBlockStaticDistance):
355         (WebCore::RenderBox::positionForPoint):
356         (WebCore::RenderBox::layoutOverflowRectForPropagation):
357         * rendering/RenderBox.h:
358         (WebCore::RenderBox::previousSiblingBox):
359         (WebCore::RenderBox::nextSiblingBox):
360         (WebCore::RenderBox::parentBox):
361         (WebCore::RenderBox::firstChildBox):
362         (WebCore::RenderBox::lastChildBox):
363         * rendering/RenderBoxModelObject.cpp:
364         (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
365         (WebCore::RenderBoxModelObject::computeStickyPositionConstraints):
366         (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
367         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
368         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
369         * rendering/RenderElement.cpp:
370         (WebCore::RenderElement::removeChildInternal):
371         (WebCore::RenderElement::styleWillChange):
372         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
373         * rendering/RenderEmbeddedObject.cpp:
374         (WebCore::RenderEmbeddedObject::layout):
375         * rendering/RenderFieldset.cpp:
376         (WebCore::RenderFieldset::findLegend):
377         * rendering/RenderFlowThread.cpp:
378         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
379         (WebCore::RenderFlowThread::currentActiveRenderBox):
380         * rendering/RenderFlowThread.h:
381         * rendering/RenderFullScreen.cpp:
382         (WebCore::RenderFullScreen::unwrapRenderer):
383         * rendering/RenderImage.cpp:
384         (WebCore::RenderImage::layoutShadowControls):
385         (WebCore::RenderImage::computeIntrinsicRatioInformation):
386         * rendering/RenderInline.cpp:
387         (WebCore::RenderInline::absoluteRects):
388         (WebCore::RenderInline::addFocusRingRects):
389         * rendering/RenderLayer.cpp:
390         (WebCore::RenderLayer::updateLayerPosition):
391         (WebCore::RenderLayer::perspectiveTransform):
392         (WebCore::RenderLayer::perspectiveOrigin):
393         (WebCore::parentLayerCrossFrame):
394         (WebCore::RenderLayer::enclosingScrollableLayer):
395         (WebCore::RenderLayer::resize):
396         (WebCore::RenderLayer::scrollsOverflow):
397         (WebCore::computeReferenceBox):
398         (WebCore::RenderLayer::calculateClipRects):
399         * rendering/RenderLayer.h:
400         * rendering/RenderLayerBacking.cpp:
401         (WebCore::RenderLayerBacking::updateTransform):
402         (WebCore::RenderLayerBacking::updateGeometry):
403         (WebCore::RenderLayerBacking::resetContentsRect):
404         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
405         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
406         (WebCore::RenderLayerBacking::contentsBox):
407         (WebCore::RenderLayerBacking::backgroundBoxForPainting):
408         (WebCore::RenderLayerBacking::startAnimation):
409         (WebCore::RenderLayerBacking::startTransition):
410         * rendering/RenderLineBoxList.cpp:
411         (WebCore::RenderLineBoxList::rangeIntersectsRect):
412         * rendering/RenderMediaControlElements.cpp:
413         (WebCore::RenderMediaVolumeSliderContainer::layout):
414         * rendering/RenderMultiColumnFlowThread.cpp:
415         (WebCore::RenderMultiColumnFlowThread::firstColumnSetOrSpanner):
416         (WebCore::RenderMultiColumnFlowThread::nextColumnSetOrSpannerSiblingOf):
417         (WebCore::RenderMultiColumnFlowThread::previousColumnSetOrSpannerSiblingOf):
418         (WebCore::RenderMultiColumnFlowThread::resolveMovedChild):
419         (WebCore::isValidColumnSpanner):
420         (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
421         * rendering/RenderNamedFlowThread.cpp:
422         (WebCore::RenderNamedFlowThread::getRanges):
423         * rendering/RenderObject.cpp:
424         (WebCore::RenderObject::computeRectForRepaint):
425         (WebCore::RenderObject::showRegionsInformation):
426         (WebCore::RenderObject::showRenderObject):
427         (WebCore::RenderObject::mapLocalToContainer):
428         (WebCore::RenderObject::pushMappingToContainer):
429         (WebCore::RenderObject::mapAbsoluteToLocalPoint):
430         (WebCore::RenderObject::addAnnotatedRegions):
431         * rendering/RenderTable.cpp:
432         (WebCore::RenderTable::nodeAtPoint):
433         * rendering/RenderTextControlMultiLine.cpp:
434         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
435         * rendering/RenderTheme.cpp:
436         (WebCore::RenderTheme::baselinePosition):
437         * rendering/RenderThemeGtk.cpp:
438         (WebCore::RenderThemeGtk::baselinePosition):
439         (WebCore::centerRectVerticallyInParentInputElement):
440         * rendering/RenderThemeIOS.mm:
441         (WebCore::RenderThemeIOS::baselinePosition):
442         * rendering/RenderThemeSafari.cpp:
443         (WebCore::RenderThemeSafari::baselinePosition):
444         * rendering/RenderThemeWin.cpp:
445         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
446         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
447         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
448         * rendering/RenderTreeAsText.cpp:
449         (WebCore::RenderTreeAsText::writeRenderObject):
450         (WebCore::externalRepresentation):
451         * rendering/RenderView.cpp:
452         (WebCore::RenderView::paintBoxDecorations):
453         * rendering/RootInlineBox.cpp:
454         (WebCore::RootInlineBox::setLineBreakInfo):
455         * rendering/line/BreakingContextInlineHeaders.h:
456         (WebCore::BreakingContext::handleOutOfFlowPositioned):
457         (WebCore::BreakingContext::handleFloat):
458         (WebCore::BreakingContext::handleReplaced):
459         * rendering/line/LineBreaker.cpp:
460         (WebCore::LineBreaker::skipTrailingWhitespace):
461         (WebCore::LineBreaker::skipLeadingWhitespace):
462         * rendering/mathml/RenderMathMLUnderOver.cpp:
463         (WebCore::RenderMathMLUnderOver::layout):
464         * svg/graphics/SVGImage.cpp:
465         (WebCore::SVGImage::embeddedContentBox):
466
467 2014-10-17  Andreas Kling  <akling@apple.com>
468
469         Get rid of wrapperContext() in DOM bindings.
470         <https://webkit.org/b/137834>
471
472         Reviewed by Chris Dumez.
473
474         The "wrapper context" is always the DOMWrapperWorld, and since we're passing that around
475         already, we don't need a separate mechanism to get at the context.
476
477         The context is extra data stored in the DOM object's JSC::Weak (the wrapper GC object.)
478
479         * bindings/js/JSDOMBinding.h:
480         (WebCore::setInlineCachedWrapper):
481         (WebCore::cacheWrapper):
482         (WebCore::wrapperContext): Deleted.
483         * bindings/scripts/CodeGeneratorJS.pm:
484         (GenerateHeader):
485
486 2014-10-17  Benjamin Poulain  <benjamin@webkit.org>
487
488         Make a better use of the available registers when compiling nested selector lists
489         https://bugs.webkit.org/show_bug.cgi?id=137802
490
491         Reviewed by Andreas Kling.
492
493         Previously, when compiling a nested selector list, the compiler would start by pushing all
494         the allocated registers to the stack to free them for the compiled selector list.
495         While neat to ensure register allocation is correct, this is very inefficient.
496
497         This patch brings the first step for reducing the overhead. Instead of pushing everything
498         to the stack, we just push as many registers as we need for compiling the selector list.
499
500         In most cases, we have so many registers that we don't even need to push anything to the stack.
501
502         Test: fast/selectors/nth-child-of-register-requirement.html
503
504         * cssjit/SelectorCompiler.cpp:
505         Add an explicit type for SelectorList to keep information aggregated from all
506         SelectorFragmentList inside it.
507
508         SelectorFragmentList is also extended to include its register and stack requirements.
509         This information is then used to create a SelectorList and to compile the SelectorFragmentList.
510
511         (WebCore::SelectorCompiler::hasAnyCombinators):
512         We only change the elementAddressRegister when moving over combinators. This is used to detect
513         if a selector list clobber the elementAddressRegister or leave it untouched.
514
515         (WebCore::SelectorCompiler::computeBacktrackingMemoryRequirements):
516         (WebCore::SelectorCompiler::computeBacktrackingInformation):
517         Instead of returning a BacktrackingMemoryRequirements, update the SelectorFragmentList and SelectorList directly.
518
519         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
520         This is where the fun happen.
521         First step is keep the input untouched. For now it is simply pushed on the stack. This can be improved later.
522
523         Then we find how many allocated registers we need to save to compile the input selector list. We push those registers
524         to the stack and give them back to the register allocator.
525
526         With enough registers we can now compile the nested selector list. The code has changed a bit for efficiency. Instead
527         of creating a shortcut for success case, the code now exit on error and proceed on success. This is the general pattern
528         of SelectorCompiler and it is quite a bit more efficient in the common cases.
529
530         Finally, we reallocate the registers and get their values back from the stack. The "tail" is duplicated but that's fine
531         because in the vast majority of cases it is 1 or 2 pop.
532
533         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
534         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
535         * cssjit/StackAllocator.h:
536         (WebCore::StackAllocator::push):
537
538 2014-10-17  Chris Dumez  <cdumez@apple.com>
539
540         Use is<>() / downcast<>() for StyleImage
541         https://bugs.webkit.org/show_bug.cgi?id=137824
542
543         Reviewed by Andreas Kling.
544
545         Use is<>() / downcast<>() for StyleImage and clean up the surrouding
546         code.
547
548         No new tests, no behavior change.
549
550         * css/CSSCursorImageValue.cpp:
551         (WebCore::CSSCursorImageValue::detachPendingImage):
552         (WebCore::CSSCursorImageValue::cachedImage):
553         (WebCore::CSSCursorImageValue::cachedImageURL):
554         * css/CSSImageSetValue.cpp:
555         (WebCore::CSSImageSetValue::detachPendingImage):
556         (WebCore::CSSImageSetValue::~CSSImageSetValue):
557         (WebCore::CSSImageSetValue::cachedImageSet):
558         (WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources):
559         * css/CSSImageValue.cpp:
560         (WebCore::CSSImageValue::detachPendingImage):
561         (WebCore::CSSImageValue::cachedImage):
562         (WebCore::CSSImageValue::hasFailedOrCanceledSubresources):
563         * css/StyleResolver.cpp:
564         (WebCore::StyleResolver::loadPendingShapeImage):
565         (WebCore::StyleResolver::loadPendingImages):
566         * page/PageSerializer.cpp:
567         (WebCore::PageSerializer::retrieveResourcesForProperties):
568         * page/animation/CSSPropertyAnimation.cpp:
569         (WebCore::blendFunc):
570         * rendering/style/StyleCachedImage.h:
571         * rendering/style/StyleCachedImageSet.h:
572         * rendering/style/StyleGeneratedImage.h:
573         * rendering/style/StyleImage.h:
574         * rendering/style/StylePendingImage.h:
575
576 2014-10-17  Dean Jackson  <dino@apple.com>
577
578         [Media] Always update controls for <audio> since they are always visible
579         https://bugs.webkit.org/show_bug.cgi?id=137829
580         <rdar://problem/18693987>
581
582         Reviewed by Brent Fulgham.
583
584         Revision 174756 made a change to only update the display of the controls
585         while they are visible. However, <audio> elements didn't detect visibility
586         the same way, since their controls do not auto-hide.
587
588         Change controlsAreHidden to check if we're an audio element.
589
590         * Modules/mediacontrols/mediaControlsApple.js:
591         (Controller.prototype.controlsAreHidden): Audio elements do not auto-hide their controls.
592
593 2014-10-17  peavo@outlook.com  <peavo@outlook.com>
594
595         [WinCairo] Accelerated compositing is not implemented.
596         https://bugs.webkit.org/show_bug.cgi?id=137345
597
598         Reviewed by Brent Fulgham.
599
600         This patch is based on GTK, and the texture mapper graphics layer type.
601
602         * WebCore.vcxproj/copyForwardingHeaders.cmd: Copy texmap headers.
603         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: Added method and flag indicating whether animation has started.
604         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
605         (WebCore::GraphicsLayerTextureMapper::addAnimation):
606         * platform/graphics/texmap/GraphicsLayerTextureMapper.h: Ditto.
607         (WebCore::GraphicsLayerTextureMapper::startedAnimation):
608         * platform/graphics/texmap/TextureMapperShaderProgram.cpp: Use same precision for uniform in vertex shader as in fragment shader.
609         Otherwise glLinkProgram() will fail, and nothing will be rendered.
610
611 2014-10-17  Alexey Proskuryakov  <ap@apple.com>
612
613         [iOS] Crash when load is canceled while waiting for the user to type HTTP authentication credentials
614         https://bugs.webkit.org/show_bug.cgi?id=137826
615         rdar://problem/17329599
616
617         Reviewed by Brady Eidson.
618
619         No new tests, as we don't have a way to simulate details of user interaction with
620         an auth dialog.
621
622         * platform/network/cf/ResourceHandleCFNet.cpp:
623         (WebCore::ResourceHandle::receivedCredential):
624         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
625         (WebCore::ResourceHandle::receivedRequestToPerformDefaultHandling):
626         (WebCore::ResourceHandle::receivedChallengeRejection):
627         Added null checks before passing m_connection for CFNetwork functions, making this
628         match what Mac code does when sending a message to a nil receiver.
629
630 2014-10-17  Simon Fraser  <simon.fraser@apple.com>
631
632         Fix the iOS build.
633
634         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
635         (WebCore::AVTrackPrivateAVFObjCImpl::languageForAVMediaSelectionOption):
636
637 2014-10-16  Jer Noble  <jer.noble@apple.com>
638
639         [Mac] Represent AVMediaSelectionOptions as AudioTracks
640         https://bugs.webkit.org/show_bug.cgi?id=137474
641
642         Reviewed by Brent Fulgham.
643
644         Test: http/tests/media/hls/hls-audio-tracks.html
645
646         Support selecting audio "tracks" in HLS streams by exposing AVMediaSelectionOptions
647         as entries in the video's AudioTrackList.
648
649         AVMediaSessionGroups and AVPlayerItems don't have KVO or notifications to track when options
650         are selected and deselected, so wrap AVMediaSessionGroup and AVMediaSessionOption in C++
651         wrappers. Each AVMediaSelectionGroup can have only one AVMediaSelectionOption selected at a
652         time, so the wrapper will take care of answering which AVMediaSelectionOption is currently
653         selected, as without KVO notifications, asking the AVMediaSelectionGroup directly is
654         inconsistent. Because setting the selected option multiple times in the same run-loop can
655         cause flakiness, coalesce calls to setSelectedOption() by setting a one-shot timer to do
656         the actual selection in the next run-loop.
657
658         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: Added.
659         (WebCore::MediaSelectionOptionAVFObjC::avMediaSelectionOption):
660         (WebCore::MediaSelectionOptionAVFObjC::clearGroup): Clear backpointer to group from option.
661         (WebCore::MediaSelectionGroupAVFObjC::selectedOption): Simple accessor.
662         (WebCore::MediaSelectionGroupAVFObjC::options):  Simple accessor.
663         (WebCore::MediaSelectionGroupAVFObjC::avMediaSelectionGroup): Simple accessor.
664         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: Added.
665         (WebCore::MediaSelectionOptionAVFObjC::create): Simple factory method.
666         (WebCore::MediaSelectionOptionAVFObjC::MediaSelectionOptionAVFObjC): Simple constructor.
667         (WebCore::MediaSelectionOptionAVFObjC::setSelected): Pass through to MediaSelectionGroupAVFObjC.
668         (WebCore::MediaSelectionOptionAVFObjC::selected): Ditto.
669         (WebCore::MediaSelectionOptionAVFObjC::index): Return index of this object in the group's object.
670         (WebCore::MediaSelectionGroupAVFObjC::create):
671         (WebCore::MediaSelectionGroupAVFObjC::MediaSelectionGroupAVFObjC):
672         (WebCore::MediaSelectionGroupAVFObjC::~MediaSelectionGroupAVFObjC):
673         (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Discover added or removed options.
674         (WebCore::MediaSelectionGroupAVFObjC::setSelectedOption): Set a one shot timer to coalesce multiple calls.
675         (WebCore::MediaSelectionGroupAVFObjC::selectionTimerFired): Set the selected AVSelectionOption.
676
677         Modify AVTrackPrivateAVFObjCImpl to support both AVPlayerItemTracks and these new
678         MediaSelectionOptionAVFObjC objects.
679
680         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h:
681         (WebCore::AVTrackPrivateAVFObjCImpl::mediaSelectionOption): Simple accessor.
682         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
683         (WebCore::AVTrackPrivateAVFObjCImpl::AVTrackPrivateAVFObjCImpl):  Simple constructor.
684         (WebCore::AVTrackPrivateAVFObjCImpl::~AVTrackPrivateAVFObjCImpl): Simple destructor.
685         (WebCore::AVTrackPrivateAVFObjCImpl::enabled): Use MediaSelectionOptionAVFObjC, if present.
686         (WebCore::AVTrackPrivateAVFObjCImpl::setEnabled): Ditto.
687         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind): Ditto.
688         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind): Ditto.
689         (WebCore::AVTrackPrivateAVFObjCImpl::index): Ditto.
690         (WebCore::AVTrackPrivateAVFObjCImpl::id): Ditto.
691         (WebCore::AVTrackPrivateAVFObjCImpl::label): Ditto.
692         (WebCore::AVTrackPrivateAVFObjCImpl::language): Ditto.
693         (WebCore::AVTrackPrivateAVFObjCImpl::languageForAVMediaSelectionOption): Ditto.
694         (WebCore::AVTrackPrivateAVFObjCImpl::trackID): Ditto.
695
696         Allow AudioTrackPrivateAVFObjC and VideoTrackPrivateAVFObjC to be created with
697         a MediaSelectionOptionAVFObjC.
698
699         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h:
700         (WebCore::AudioTrackPrivateAVFObjC::create): Takes a MediaSelectionOptionAVFObjC.
701         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
702         (WebCore::AudioTrackPrivateAVFObjC::AudioTrackPrivateAVFObjC): Simple constructor.
703         (WebCore::AudioTrackPrivateAVFObjC::setMediaSelectionOption): Create a new AVTrackPrivateAVFObjCImpl.
704         (WebCore::AudioTrackPrivateAVFObjC::mediaSelectionOption): Simple accessor.
705         * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp:
706         (WebCore::VideoTrackPrivateAVFObjC::VideoTrackPrivateAVFObjC): Simple constructor.
707         (WebCore::VideoTrackPrivateAVFObjC::setMediaSelectonOption): Create a new AVTrackPrivateAVFObjCImpl.
708         (WebCore::VideoTrackPrivateAVFObjC::mediaSelectionOption): Simple accessor.
709         * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.h:
710
711         Because IDs are not necessarily unique across AVPlayerItemTracks and AVMediaSelectionOptions,
712         use the index of the track or option instead of it's self-declared ID for ordering for the
713         trackIndex.
714
715         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
716         (WebCore::AudioTrackPrivateAVFObjC::resetPropertiesFromTrack):
717         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
718         (WebCore::VideoTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack):
719
720         Rather than making allowing the AVPlayerItem to automatically select the "best"
721         AVMediaSelectionOption, select the automatic options when creating the AVPlayerItem
722         and thereafter allow the users manual selections "stick".
723
724         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
725         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
726         (WebCore::MediaPlayerPrivateAVFoundationObjC::ensureAVPlayer):
727         (WebCore::MediaPlayerPrivateAVFoundationObjC::ensureAVPlayerItem):
728
729         Determine whether any MediaSelectionOptionsAVFObjC have been added or removed and send trackChange events accordingly.
730
731         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
732         (WebCore::determineChangedTracksFromNewTracksAndOldItems): Added.
733         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks): Search for updated selection options.
734         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks): Ditto.
735         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia): Return selection group, if available.
736         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia): Ditto.
737         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): Filter out AVPlayerItemTracks without
738             AVAssetTracks, as these will be represented by MediaSelectionGroupObjCs instead.
739         
740         Add new files to project.
741         * WebCore.xcodeproj/project.pbxproj:
742
743 2014-10-17  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
744
745         [EFL] window.screen.width returns wrong value if more displays are available
746         https://bugs.webkit.org/show_bug.cgi?id=137778
747
748         Reviewed by Gyuyoung Kim.
749
750         ecore_x_screen_size_get() retrieves the size of Ecore_X_Screen, for example,
751         having two displays of 1680x1050, it will return 3360x1050.
752
753         Unlike EFL's MiniBrowser, Firefox and Chrome return screen of the current display.
754
755         No new tests. Hardware specific bug including multiple displays.
756
757         * platform/efl/PlatformScreenEfl.cpp:
758         (WebCore::screenRect):
759         Use ecore's xrandr to determine the screen on which browser window is displayed.
760
761 2014-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
762
763         [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds
764         https://bugs.webkit.org/show_bug.cgi?id=137782
765
766         Reviewed by Sergio Villar Senin.
767
768         * platform/gtk/SharedTimerGtk.cpp:
769         (WebCore::setSharedTimerFireInterval): Use microseconds instead of
770         milliseconds.
771
772 2014-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
773
774         [GTK] Move touch events handling from Platform to WebKit2
775         https://bugs.webkit.org/show_bug.cgi?id=137735
776
777         Reviewed by Sergio Villar Senin.
778
779         Remove GtkTouchContextHelper.
780
781         * PlatformGTK.cmake:
782         * platform/gtk/GtkTouchContextHelper.cpp: Removed.
783         * platform/gtk/GtkTouchContextHelper.h: Removed.
784
785 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
786
787         Remove unused function in WorkerThreadableLoader.h 
788         https://bugs.webkit.org/show_bug.cgi?id=137811
789
790         Reviewed by Csaba Osztrogon√°c.
791
792         mainThreadCreateLoader() isn't used anywhere. Even there is no implementation.
793
794         * loader/WorkerThreadableLoader.h:
795
796 2014-10-15  Yusuke Suzuki  <utatane.tea@gmail.com>
797
798         CSS Selectors Level 4: Implement :matches in SelectorChecker
799         https://bugs.webkit.org/show_bug.cgi?id=137393
800
801         Reviewed by Benjamin Poulain.
802
803         In this patch, we introduce initial :matches implementation.
804         In this current implementation, we don't consider pseudo elements.
805
806         Test: fast/selectors/querySelector-matches.html
807
808         * css/SelectorChecker.cpp:
809         (WebCore::SelectorChecker::checkOne):
810
811 2014-10-16  Yusuke Suzuki  <utatane.tea@gmail.com>
812
813         CSS JIT: Introduce StackAllocator::addressOf
814         https://bugs.webkit.org/show_bug.cgi?id=137771
815
816         Reviewed by Benjamin Poulain.
817
818         Introduce StackAllocator::addressOf and drop offsetToStackReference, it's too primitive.
819
820         * cssjit/SelectorCompiler.cpp:
821         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
822         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateParentElementTreeWalker):
823         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDirectAdjacentTreeWalker):
824         (WebCore::SelectorCompiler::SelectorCodeGenerator::loadCheckingContext):
825         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAdjacentBacktrackingTail):
826         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDescendantBacktrackingTail):
827         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstLink):
828         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateStoreLastVisitedElement):
829         * cssjit/StackAllocator.h:
830         (WebCore::StackAllocator::addressOf):
831         (WebCore::StackAllocator::offsetToStackReference):
832
833 2014-10-16  Alexey Proskuryakov  <ap@apple.com>
834
835         REGRESSION (r169024): Undetermined text is not displayed in the search field of Adobe Help Website
836         https://bugs.webkit.org/show_bug.cgi?id=137679
837         rdar://problem/18450335
838
839         Reviewed by Enrica Casucci.
840
841         Test: platform/mac/editing/input/selected-composed-text-painting.html
842
843         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): We do not paint
844         selection beckground for unconfirmed text with underlines, so we should use a regular
845         style for text painting, as well.
846
847 2014-10-16  Chris Dumez  <cdumez@apple.com>
848
849         Use is<>() / downcast<>() for BasicShape subclasses
850         https://bugs.webkit.org/show_bug.cgi?id=137766
851
852         Reviewed by Andreas Kling.
853
854         Use is<>() / downcast<>() for BasicShape subclasses and clean up the
855         surrounding code.
856
857         No new tests, no behavior change.
858
859         * css/BasicShapeFunctions.cpp:
860         (WebCore::valueForBasicShape):
861         (WebCore::basicShapeForValue):
862         * css/BasicShapeFunctions.h:
863         * css/CSSComputedStyleDeclaration.cpp:
864         (WebCore::shapePropertyValue):
865         * page/animation/CSSPropertyAnimation.cpp:
866         (WebCore::blendFunc):
867         * rendering/ClipPathOperation.h:
868         (WebCore::ShapeClipPathOperation::create):
869         Take a PassRef<BasicShape> in argument to make it obvious it is never
870         null.
871
872         (WebCore::ShapeClipPathOperation::basicShape):
873         Return a reference instead of a pointer as it can never return null.
874
875         (WebCore::ShapeClipPathOperation::windRule):
876         (WebCore::ShapeClipPathOperation::pathForReferenceRect):
877         Make it non-const due to the const-correctness of Ref::get().
878
879         (WebCore::ShapeClipPathOperation::ShapeClipPathOperation):
880         * rendering/RenderBlock.cpp:
881         (WebCore::RenderBlock::nodeAtPoint):
882         * rendering/RenderLayer.cpp:
883         (WebCore::RenderLayer::setupClipPath):
884         * rendering/shapes/Shape.cpp:
885         (WebCore::Shape::createShape):
886         * rendering/shapes/Shape.h:
887         * rendering/shapes/ShapeOutsideInfo.cpp:
888         (WebCore::ShapeOutsideInfo::computedShape):
889         * rendering/style/BasicShapes.cpp:
890         (WebCore::BasicShape::canBlend):
891         (WebCore::BasicShapeCircle::blend):
892         (WebCore::BasicShapeEllipse::blend):
893         (WebCore::BasicShapePolygon::blend):
894         (WebCore::BasicShapeInset::blend):
895         * rendering/style/BasicShapes.h:
896         * rendering/svg/SVGRenderingContext.cpp:
897         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
898
899 2014-10-16  Chris Dumez  <cdumez@apple.com>
900
901         Leverage the new RenderElement::m_isCSSAnimating flag in more places
902         https://bugs.webkit.org/show_bug.cgi?id=137786
903
904         Reviewed by Simon Fraser.
905
906         Leverage the new RenderElement::m_isCSSAnimating flag that was introduced
907         in r174703 in more places, for performance. This avoids doing extra work
908         for renderers on which we are not running animations on. This patch also
909         updates the API a bit to use more references instead of pointers, making
910         it clear the RenderElement cannot be null and thus avoiding unnecessary
911         null checks.
912
913         No new tests, no behavior change.
914
915         * css/CSSComputedStyleDeclaration.cpp:
916         (WebCore::computeRenderStyleForProperty):
917         * page/animation/AnimationController.cpp:
918         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
919         (WebCore::AnimationControllerPrivate::clear):
920         (WebCore::AnimationControllerPrivate::updateAnimationTimerForRenderer):
921         (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer):
922         (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
923         (WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
924         (WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
925         (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
926         (WebCore::AnimationController::cancelAnimations):
927         (WebCore::AnimationController::updateAnimations):
928         (WebCore::AnimationController::getAnimatedStyleForRenderer):
929         (WebCore::AnimationController::notifyAnimationStarted):
930         (WebCore::AnimationController::isRunningAnimationOnRenderer):
931         (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer):
932         * page/animation/AnimationController.h:
933         * page/animation/AnimationControllerPrivate.h:
934         * rendering/RenderElement.cpp:
935         (WebCore::RenderElement::willBeDestroyed):
936         * rendering/RenderLayer.cpp:
937         (WebCore::RenderLayer::currentTransform):
938         * rendering/RenderLayerBacking.cpp:
939         (WebCore::RenderLayerBacking::updateGeometry):
940         (WebCore::RenderLayerBacking::notifyAnimationStarted):
941         * rendering/RenderLayerCompositor.cpp:
942         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
943         (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation):
944
945 2014-10-16  Adrien Destugues  <pulkomandy@gmail.com>
946
947         Missing RefPtr.release() calls in TextureMapper
948         https://bugs.webkit.org/show_bug.cgi?id=137777
949
950         Reviewed by Chris Dumez.
951
952         No new tests: no functional change, cleanup/optimization.
953
954         Avoids useless ref/deref cycle when returning from functions.
955
956         * platform/graphics/texmap/TextureMapper.cpp:
957         (WebCore::TextureMapper::acquireTextureFromPool):
958         * platform/graphics/texmap/TextureMapperLayer.cpp:
959         (WebCore::TextureMapperLayer::paintIntoSurface):
960
961 2014-10-16  Chris Dumez  <cdumez@apple.com>
962
963         Use is<>() / downcast<>() for ContentData subclasses
964         https://bugs.webkit.org/show_bug.cgi?id=137768
965
966         Reviewed by Andreas Kling.
967
968         Use is<>() / downcast<>() for ContentData subclasses.
969
970         No new tests, no behavior change.
971
972         * css/CSSComputedStyleDeclaration.cpp:
973         (WebCore::contentToCSSValue):
974         * css/StyleResolver.cpp:
975         (WebCore::StyleResolver::loadPendingImages):
976         * rendering/RenderElement.cpp:
977         (WebCore::RenderElement::createFor):
978         * rendering/style/ContentData.h:
979         (WebCore::operator==):
980         * rendering/style/RenderStyle.cpp:
981         (WebCore::RenderStyle::setContent):
982
983 2014-10-16  Commit Queue  <commit-queue@webkit.org>
984
985         Unreviewed, rolling out r174744.
986         https://bugs.webkit.org/show_bug.cgi?id=137790
987
988         Caused another WebGL conformance test to fail (Requested by
989         rfong on #webkit).
990
991         Reverted changeset:
992
993         "glReadPixels on NVIDIA cards returns the wrong values for the
994         alpha channel when alpha is off."
995         https://bugs.webkit.org/show_bug.cgi?id=137752
996         http://trac.webkit.org/changeset/174744
997
998 2014-10-16  Tim Horton  <timothy_horton@apple.com>
999
1000         Implement selection services menu for Legacy WebKit
1001         https://bugs.webkit.org/show_bug.cgi?id=137582
1002         <rdar://problem/18604241>
1003
1004         Reviewed by Brady Eidson.
1005
1006         * WebCore.exp.in:
1007         * editing/Editor.h:
1008         * editing/ios/EditorIOS.mm:
1009         (WebCore::Editor::replaceSelectionWithAttributedString):
1010         * editing/mac/EditorMac.mm:
1011         (WebCore::Editor::replaceSelectionWithAttributedString):
1012         Add replaceSelectionWithAttributedString, which replaces the selection
1013         with the given attributed string (converting to plain text if the destination
1014         is not richly editable).
1015
1016 2014-10-16  Alexey Proskuryakov  <ap@apple.com>
1017
1018         Crashes in ResourceHandleCFURLConnectionDelegateWithOperationQueue due to unimplemented retain/release
1019         https://bugs.webkit.org/show_bug.cgi?id=137779
1020         rdar://problem/18679320
1021
1022         Reviewed by Brady Eidson.
1023
1024         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1025         (WebCore::ResourceHandleCFURLConnectionDelegate::retain):
1026         (WebCore::ResourceHandleCFURLConnectionDelegate::release):
1027         (WebCore::ResourceHandleCFURLConnectionDelegate::makeConnectionClient):
1028         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1029         Implemented retain/release. They are necessary, as ResourceHandle goes away when
1030         it's canceled, and there is noone else to keep the client object alive but
1031         CFURLConnection itself.
1032
1033         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1034         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1035         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1036         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1037         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1038         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
1039         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1040         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
1041         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
1042         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1043         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
1044         Added a FIXME about potential improvements that I spotted while invsestigating this.
1045
1046 2014-10-15  Andrei Bucur  <abucur@adobe.com>
1047
1048         ASSERTION  FAILED in WebCore::RenderFlowThread::getRegionRangeForBox
1049         https://bugs.webkit.org/show_bug.cgi?id=135563
1050
1051         Reviewed by David Hyatt.
1052
1053         The new multi-column code doesn't work correctly when the document contains nested fragmentation
1054         contexts. The problem is the current flow thread concept that can store only one RenderFlowThread
1055         at a time and use it during layout.
1056
1057         The stored flow thread is always correct for regions because named flow threads are absolutley positioned
1058         so every child renderer is contained inside them (with the expcetion of fixed positioned elements which are
1059         treated separately).
1060
1061         For multi-column elements this is no longer the case. An absolutely positioned element inside a static
1062         multi-column element will be contained by a block outside the fragmentation context. It can even be
1063         contained by a different multi-column element in the case of nested flow threads.
1064
1065         The patch below explores a solution that's not based on a current flow thread stored globally. The proposed
1066         patch makes every block to store a pointer to its fragmentation context and a flag that states if this pointer
1067         needs to be updated or not. If the renderer is not a block it will get its flow thread from the containing
1068         block. Once the containing flow thread is requested for the block, the pointer is computed and cached until
1069         invalidated:
1070         - when a subtree is removed from a flow thread
1071         - when the position property of an element inside a flow thread changes
1072
1073         The process is recursive and it doesn't affect elements that are not nested inside a flow thread. If a block
1074         changes position from relative to static, any element that was contained by it can only be contained by an
1075         ancestor of the block. This ancestor will still be outside of any flow thread. This ensures that non-fragmentation
1076         code is not affected from a performance perspective.
1077
1078         The patch affects the results of the performance tests:
1079         - the regions layout tests have a decreased performance raging from 2% to 5-6%
1080         - the regions selection tests have an increased performance raging from 1-2% to 10%
1081         - the multicolumn layout tests (now pending review in b137687) have an increased performance
1082         raging from 1.8% to 5%
1083
1084         Tests: fast/multicol/multicol-all-positioned-crash.html
1085                fast/multicol/multicol-transform-containing-block.html
1086
1087         * rendering/FlowThreadController.cpp:
1088         (WebCore::FlowThreadController::FlowThreadController):
1089         * rendering/FlowThreadController.h:
1090         (WebCore::FlowThreadController::currentRenderFlowThread): Deleted.
1091         (WebCore::FlowThreadController::setCurrentRenderFlowThread): Deleted.
1092         * rendering/LayoutState.h:
1093         (WebCore::LayoutState::currentRenderFlowThread):
1094         (WebCore::LayoutState::setCurrentRenderFlowThread):
1095         * rendering/RenderBlock.cpp:
1096         (WebCore::RenderBlockRareData::RenderBlockRareData):
1097         (WebCore::RenderBlock::styleWillChange):
1098         (WebCore::RenderBlock::styleDidChange):
1099         (WebCore::RenderBlock::collapseAnonymousBoxChild):
1100         (WebCore::RenderBlock::cachedFlowThreadContainingBlock):
1101         (WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate):
1102         (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
1103         (WebCore::RenderBlock::updateCachedFlowThreadContainingBlock):
1104         (WebCore::RenderBlock::locateFlowThreadContainingBlock):
1105         * rendering/RenderBlock.h:
1106         * rendering/RenderBlockFlow.cpp:
1107         (WebCore::RenderBlockFlow::styleWillChange):
1108         * rendering/RenderBox.cpp:
1109         (WebCore::RenderBox::borderBoxRectInRegion):
1110         * rendering/RenderFlowThread.cpp:
1111         (WebCore::RenderFlowThread::layout):
1112         (WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
1113         (WebCore::RenderFlowThread::repaintRectangleInRegions):
1114         (WebCore::CurrentRenderFlowThreadMaintainer::CurrentRenderFlowThreadMaintainer): Deleted.
1115         (WebCore::CurrentRenderFlowThreadMaintainer::~CurrentRenderFlowThreadMaintainer): Deleted.
1116         (WebCore::CurrentRenderFlowThreadDisabler::CurrentRenderFlowThreadDisabler): Deleted.
1117         (WebCore::CurrentRenderFlowThreadDisabler::~CurrentRenderFlowThreadDisabler): Deleted.
1118         * rendering/RenderFlowThread.h:
1119         * rendering/RenderLayer.cpp:
1120         (WebCore::RenderLayer::paintLayer):
1121         (WebCore::RenderLayer::hitTestLayer):
1122         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
1123         (WebCore::RenderLayer::calculateClipRects):
1124         * rendering/RenderObject.cpp:
1125         (WebCore::RenderObject::showRegionsInformation):
1126         (WebCore::RenderObject::insertedIntoTree):
1127         (WebCore::RenderObject::removeFromRenderFlowThread):
1128         (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants):
1129         (WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants):
1130         (WebCore::RenderObject::currentRenderNamedFlowFragment):
1131         (WebCore::RenderObject::locateFlowThreadContainingBlock):
1132         (WebCore::RenderObject::locateFlowThreadContainingBlockNoCache): Deleted.
1133         (WebCore::RenderObject::removeFromRenderFlowThreadRecursive): Deleted.
1134         * rendering/RenderObject.h:
1135         (WebCore::RenderObject::flowThreadContainingBlock):
1136         * rendering/RenderRegion.cpp:
1137         (WebCore::RenderRegion::computeOverflowFromFlowThread):
1138         * rendering/RenderView.cpp:
1139         (WebCore::RenderView::pushLayoutStateForCurrentFlowThread):
1140         (WebCore::RenderView::popLayoutStateForCurrentFlowThread):
1141         * rendering/RenderView.h:
1142
1143 2014-10-15  Chris Dumez  <cdumez@apple.com>
1144
1145         Use is<>() / downcast<>() for list-related render objects
1146         https://bugs.webkit.org/show_bug.cgi?id=137764
1147
1148         Reviewed by Benjamin Poulain.
1149
1150         Use is<>() / downcast<>() for list-related render objects and clean up
1151         the surrounding code.
1152
1153         No new tests, no behavior change.
1154
1155         * accessibility/AccessibilityListBox.cpp:
1156         (WebCore::AccessibilityListBox::visibleChildren):
1157         (WebCore::AccessibilityListBox::elementAccessibilityHitTest):
1158         * accessibility/AccessibilityListBoxOption.cpp:
1159         (WebCore::AccessibilityListBoxOption::elementRect):
1160         * accessibility/AccessibilityObject.cpp:
1161         (WebCore::renderListItemContainerForNode):
1162         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
1163         (getRangeLengthForObject):
1164         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1165         (accessibilityObjectLength):
1166         (offsetAdjustmentForListItem):
1167         (webkitAccessibleTextGetText):
1168         * editing/BreakBlockquoteCommand.cpp:
1169         (WebCore::BreakBlockquoteCommand::doApply):
1170         * html/HTMLLIElement.cpp:
1171         (WebCore::HTMLLIElement::didAttachRenderers):
1172         (WebCore::HTMLLIElement::parseValue):
1173         * html/HTMLSelectElement.cpp:
1174         (WebCore::HTMLSelectElement::nextSelectableListIndexPageAway):
1175         (WebCore::HTMLSelectElement::scrollToSelection):
1176         (WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
1177         (WebCore::HTMLSelectElement::selectOption):
1178         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
1179         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
1180         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1181         * html/HTMLSelectElementWin.cpp:
1182         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
1183         * page/mac/EventHandlerMac.mm:
1184         (WebCore::EventHandler::platformPrepareForWheelEvents):
1185         * rendering/InlineFlowBox.cpp:
1186         (WebCore::InlineFlowBox::addToLine):
1187         (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection):
1188         * rendering/RenderCounter.cpp:
1189         (WebCore::planCounter):
1190         * rendering/RenderListBox.h:
1191         * rendering/RenderListItem.cpp:
1192         (WebCore::nextListItem):
1193         (WebCore::previousListItem):
1194         * rendering/RenderListItem.h:
1195         * rendering/RenderListMarker.h:
1196         * rendering/RenderMenuList.h:
1197         * rendering/RenderTreeAsText.cpp:
1198         (WebCore::markerTextForListItem):
1199         * rendering/TextAutoSizing.cpp:
1200         (WebCore::TextAutoSizingValue::adjustNodeSizes):
1201         * rendering/line/BreakingContextInlineHeaders.h:
1202         (WebCore::BreakingContext::handleReplaced):
1203         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
1204         * testing/Internals.cpp:
1205         (WebCore::Internals::isSelectPopupVisible):
1206
1207 2014-10-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1208
1209         Use std::unique_ptr for CachedResource
1210         https://bugs.webkit.org/show_bug.cgi?id=137736
1211
1212         Reviewed by Darin Adler.
1213
1214         No new tests, no behavior change.
1215
1216         * loader/cache/CachedResource.cpp: Use std::unique_ptr instead of PassOwnPtr|OwnPtr.
1217         (WebCore::CachedResource::removeClient):
1218         * loader/cache/CachedResource.h: Set ctor from private to public.
1219         (WebCore::CachedResource::CachedResourceCallback::schedule):
1220
1221 2014-10-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1222
1223         Move TextCodec classes to std::unique_ptr
1224         https://bugs.webkit.org/show_bug.cgi?id=137738
1225
1226         Reviewed by Darin Adler.
1227
1228         Replace uses of PassOwnPtr in code under TextCodecFoo class with std::unique_ptr.
1229         To do this, ctor of TextCodecFoo classes is changed from private to public. Besides
1230         related classes follow this change as well.
1231
1232         No new tests, no behavior change.
1233
1234         * html/parser/HTMLMetaCharsetParser.h:
1235         * loader/TextResourceDecoder.cpp:
1236         (WebCore::TextResourceDecoder::setEncoding):
1237         (WebCore::TextResourceDecoder::flush):
1238         * loader/TextResourceDecoder.h:
1239         * platform/text/TextCodec.h:
1240         * platform/text/TextCodecICU.cpp:
1241         (WebCore::TextCodecICU::create):
1242         * platform/text/TextCodecICU.h:
1243         * platform/text/TextCodecLatin1.cpp:
1244         (WebCore::newStreamingTextDecoderWindowsLatin1):
1245         * platform/text/TextCodecUTF16.cpp:
1246         (WebCore::newStreamingTextDecoderUTF16LE):
1247         (WebCore::newStreamingTextDecoderUTF16BE):
1248         * platform/text/TextCodecUTF8.cpp:
1249         (WebCore::TextCodecUTF8::create):
1250         * platform/text/TextCodecUTF8.h:
1251         * platform/text/TextCodecUserDefined.cpp:
1252         (WebCore::newStreamingTextDecoderUserDefined):
1253         * platform/text/TextEncodingRegistry.cpp:
1254         (WebCore::newTextCodec):
1255         * platform/text/TextEncodingRegistry.h:
1256         * platform/text/mac/TextCodecMac.cpp:
1257         (WebCore::newTextCodecMac):
1258
1259 2014-10-15  Dean Jackson  <dino@apple.com>
1260
1261         [Media] Reduce style updates (painting) in controls
1262         https://bugs.webkit.org/show_bug.cgi?id=137763
1263         <rdar://problem/17833045>
1264
1265         Reviewed by Simon Fraser.
1266
1267         Media controls were causing a lot of repaints they were
1268         constantly updating the style of the widgets, the value
1269         of the forms, or the text in the display.
1270
1271         This is necessary when the controls are visible, but not
1272         necessary when they are hidden. Return immediately in that case.
1273
1274         * Modules/mediacontrols/mediaControlsApple.js:
1275         (Controller.prototype.createControls): Initialise the slider to a zero value.
1276         (Controller.prototype.handleDurationChange): Force an update even though we might be hidden.
1277         (Controller.prototype.updateProgress): Don't update if we're hidden.
1278         (Controller.prototype.updateTime): Ditto.
1279         * Modules/mediacontrols/mediaControlsiOS.js:
1280         (ControllerIOS.prototype.updateProgress): Ditto.
1281
1282 2014-10-15  Chris Dumez  <cdumez@apple.com>
1283
1284         [Mac] Fix inefficiencies in ResourceResponse::platformLazyInit(InitLevel) - Part 2
1285         https://bugs.webkit.org/show_bug.cgi?id=137721
1286
1287         Reviewed by Darin Adler.
1288
1289         Follow-up patch to r174717 addressing review comments made after the patch landed:
1290         - Use modern C++ loop
1291         - Remove explicit calls to String(NSString*) constructor
1292
1293         No new tests, no new tests.
1294
1295         * platform/network/mac/ResourceResponseMac.mm:
1296         (WebCore::ResourceResponse::platformLazyInit):
1297
1298 2014-10-15  Chris Dumez  <cdumez@apple.com>
1299
1300         Use is<>() / downcast<>() for InlineBox subclasses
1301         https://bugs.webkit.org/show_bug.cgi?id=137749
1302
1303         Reviewed by Darin Adler.
1304
1305         Use is<>() / downcast<>() for InlineBox subclasses and clean up the
1306         surrounding code.
1307
1308         No new tests, no behavior change.
1309
1310         * dom/Position.cpp:
1311         (WebCore::Position::upstream):
1312         (WebCore::Position::downstream):
1313         * editing/VisibleUnits.cpp:
1314         (WebCore::wordBreakIteratorForMinOffsetBoundary):
1315         (WebCore::wordBreakIteratorForMaxOffsetBoundary):
1316         (WebCore::visualWordPosition):
1317         (WebCore::startPositionForLine):
1318         (WebCore::endPositionForLine):
1319         * rendering/InlineBox.cpp:
1320         (WebCore::InlineBox::root):
1321         (WebCore::InlineBox::nextLeafChild):
1322         (WebCore::InlineBox::prevLeafChild):
1323         (WebCore::InlineBox::nextLeafChildIgnoringLineBreak):
1324         * rendering/InlineBox.h:
1325         * rendering/InlineElementBox.h:
1326         * rendering/InlineFlowBox.cpp:
1327         (WebCore::InlineFlowBox::getFlowSpacingLogicalWidth):
1328         (WebCore::InlineFlowBox::addToLine):
1329         (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
1330         (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection):
1331         (WebCore::InlineFlowBox::requiresIdeographicBaseline):
1332         (WebCore::InlineFlowBox::adjustMaxAscentAndDescent):
1333         (WebCore::InlineFlowBox::computeLogicalBoxHeights):
1334         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
1335         (WebCore::InlineFlowBox::computeMaxLogicalTop):
1336         (WebCore::InlineFlowBox::flipLinesInBlockDirection):
1337         (WebCore::InlineFlowBox::computeOverflow):
1338         (WebCore::InlineFlowBox::firstLeafChild):
1339         (WebCore::InlineFlowBox::lastLeafChild):
1340         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment):
1341         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment):
1342         * rendering/InlineFlowBox.h:
1343         * rendering/InlineTextBox.h:
1344         * rendering/RenderBlockFlow.cpp:
1345         (WebCore::RenderBlockFlow::positionForBox):
1346         * rendering/RenderBlockFlow.h:
1347         (WebCore::RenderBlockFlow::firstRootBox):
1348         (WebCore::RenderBlockFlow::lastRootBox):
1349         * rendering/RenderBlockLineLayout.cpp:
1350         (WebCore::RenderBlockFlow::createLineBoxes):
1351         (WebCore::RenderBlockFlow::constructLine):
1352         (WebCore::setLogicalWidthForTextRun):
1353         (WebCore::computeExpansionForJustifiedText):
1354         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1355         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine):
1356         (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns):
1357         * rendering/RenderText.cpp:
1358         (WebCore::RenderText::localCaretRect):
1359         * rendering/RootInlineBox.cpp:
1360         (WebCore::RootInlineBox::isHyphenated):
1361         (WebCore::RootInlineBox::ascentAndDescentForBox):
1362         * rendering/RootInlineBox.h:
1363         (WebCore::RootInlineBox::nextRootBox):
1364         (WebCore::RootInlineBox::prevRootBox):
1365         * rendering/svg/RenderSVGInlineText.cpp:
1366         (WebCore::RenderSVGInlineText::localCaretRect):
1367         (WebCore::RenderSVGInlineText::positionForPoint):
1368         * rendering/svg/RenderSVGText.cpp:
1369         (WebCore::RenderSVGText::positionForPoint):
1370         * rendering/svg/SVGInlineFlowBox.cpp:
1371         (WebCore::SVGInlineFlowBox::paintSelectionBackground):
1372         (WebCore::SVGInlineFlowBox::paint):
1373         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
1374         * rendering/svg/SVGInlineFlowBox.h:
1375         * rendering/svg/SVGInlineTextBox.h:
1376         * rendering/svg/SVGRenderTreeAsText.cpp:
1377         (WebCore::writeRenderSVGTextBox):
1378         (WebCore::writeSVGInlineTextBoxes):
1379         * rendering/svg/SVGRootInlineBox.cpp:
1380         (WebCore::SVGRootInlineBox::paint):
1381         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes):
1382         (WebCore::SVGRootInlineBox::layoutChildBoxes):
1383         (WebCore::reverseInlineBoxRangeAndValueListsIfNeeded):
1384         * rendering/svg/SVGRootInlineBox.h:
1385         * rendering/svg/SVGTextQuery.cpp:
1386         (WebCore::SVGTextQuery::collectTextBoxesInFlowBox):
1387
1388 2014-10-15  Roger Fong  <roger_fong@apple.com>
1389
1390         glReadPixels on NVIDIA cards returns the wrong values for the alpha channel when alpha is off.
1391         https://bugs.webkit.org/show_bug.cgi?id=137752.
1392         <rdar://problem/15408133>
1393
1394         Reviewed by Brent Fulgham.
1395
1396         This change fixed the 1.0.2 conformance test: context/context-attribute-preserve-drawing-buffer.html
1397
1398         * platform/graphics/GraphicsContext3D.h:
1399         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1400         Manually set the alpha channel to 255 when alpha is off on the rendering context.
1401
1402 2014-10-13  Chris Fleizach  <cfleizach@apple.com>
1403
1404         AX: Going back is broken for VoiceOver
1405         https://bugs.webkit.org/show_bug.cgi?id=137382
1406
1407         Reviewed by Darin Adler.
1408
1409         There were two issues preventing VoiceOver from navigating when using page history to go back/forward.
1410           1) Existing AXLoadComplete does not get fired when you just move through page history. 
1411                There were existing frameLoad notifications used by GTK. I think we should use those which seem more reliable.
1412           2) The AccessibilityScrollView cached its children, but on some history page loads, that cache was never cleared out.
1413                Rather than trying to find those places to clear out the cache, it's easier to just add the elements to the children
1414                array everytime it's asked for. Since there's only ever 3 elements (web area + 2 scroll bars) this should not be a performance hit.
1415
1416         Tests are not possible since they require monitoring notifications across multiple page loads.
1417
1418         * accessibility/AXObjectCache.h:
1419         * accessibility/AccessibilityScrollView.cpp:
1420         (WebCore::AccessibilityScrollView::updateChildrenIfNecessary):
1421         * accessibility/ios/AXObjectCacheIOS.mm:
1422         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
1423         * accessibility/mac/AXObjectCacheMac.mm:
1424         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
1425         * dom/Document.cpp:
1426         (WebCore::Document::implicitClose):
1427
1428 2014-10-15  Simon Fraser  <simon.fraser@apple.com>
1429
1430         Sometimes can't scroll overflow:scroll areas in subframes
1431         https://bugs.webkit.org/show_bug.cgi?id=137746
1432         rdar://problem/18603560
1433
1434         Reviewed by Tim Horton.
1435         
1436         r169733 introduced a regression which caused us to no longer update the non-fast
1437         scrollable region on every layout in subframes, by adding a bogus isMainFrame() check.
1438         Revert to the previous code.
1439
1440         Test: platform/mac-wk2/tiled-drawing/scrolling/frames/scroll-region-after-frame-layout.html
1441
1442         * page/scrolling/AsyncScrollingCoordinator.cpp:
1443         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1444
1445 2014-10-15  Chris Dumez  <cdumez@apple.com>
1446
1447         Use is<>() / downcast<>() for TransformOperation subclasses
1448         https://bugs.webkit.org/show_bug.cgi?id=137731
1449
1450         Reviewed by Darin Adler.
1451
1452         Use is<>() / downcast<>() for TransformOperation subclasses and clean
1453         up the surrounding code.
1454
1455         No new tests, no behavior change.
1456
1457         * platform/graphics/GraphicsLayer.cpp:
1458         (WebCore::GraphicsLayer::validateTransformOperations):
1459         * platform/graphics/ca/GraphicsLayerCA.cpp:
1460         (WebCore::getTransformFunctionValue):
1461         * platform/graphics/transforms/IdentityTransformOperation.h:
1462         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1463         (WebCore::Matrix3DTransformOperation::operator==):
1464         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1465         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1466         (WebCore::MatrixTransformOperation::operator==):
1467         (WebCore::MatrixTransformOperation::blend):
1468         * platform/graphics/transforms/MatrixTransformOperation.h:
1469         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
1470         (WebCore::PerspectiveTransformOperation::operator==):
1471         (WebCore::PerspectiveTransformOperation::blend):
1472         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1473         * platform/graphics/transforms/RotateTransformOperation.cpp:
1474         (WebCore::RotateTransformOperation::operator==):
1475         (WebCore::RotateTransformOperation::blend):
1476         * platform/graphics/transforms/RotateTransformOperation.h:
1477         * platform/graphics/transforms/ScaleTransformOperation.cpp:
1478         (WebCore::ScaleTransformOperation::operator==):
1479         (WebCore::ScaleTransformOperation::blend):
1480         * platform/graphics/transforms/ScaleTransformOperation.h:
1481         * platform/graphics/transforms/SkewTransformOperation.cpp:
1482         (WebCore::SkewTransformOperation::operator==):
1483         (WebCore::SkewTransformOperation::blend):
1484         * platform/graphics/transforms/SkewTransformOperation.h:
1485         * platform/graphics/transforms/TransformOperation.h:
1486         * platform/graphics/transforms/TranslateTransformOperation.cpp:
1487         (WebCore::TranslateTransformOperation::operator==):
1488         (WebCore::TranslateTransformOperation::blend):
1489         * platform/graphics/transforms/TranslateTransformOperation.h:
1490
1491 2014-10-15  Chris Dumez  <cdumez@apple.com>
1492
1493         Use is<>() / downcast<>() for RenderTextControl / RenderTextControlSingleLine
1494         https://bugs.webkit.org/show_bug.cgi?id=137727
1495
1496         Reviewed by Darin Adler.
1497
1498         Use is<>() / downcast<>() for RenderTextControl / RenderTextControlSingleLine.
1499
1500         No new tests, no behavior change.
1501
1502         * accessibility/AccessibilityRenderObject.cpp:
1503         (WebCore::AccessibilityRenderObject::selectedText):
1504         (WebCore::AccessibilityRenderObject::selectedTextRange):
1505         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1506         (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
1507         (WebCore::AccessibilityRenderObject::indexForVisiblePosition):
1508         * editing/TextIterator.cpp:
1509         (WebCore::TextIterator::handleReplacedElement):
1510         * html/TextFieldInputType.cpp:
1511         (WebCore::TextFieldInputType::forwardEvent):
1512         * html/shadow/TextControlInnerElements.cpp:
1513         (WebCore::TextControlInnerElement::customStyleForRenderer):
1514         * page/EventHandler.cpp:
1515         (WebCore::EventHandler::capsLockStateMayHaveChanged):
1516         * page/ios/FrameIOS.mm:
1517         (WebCore::ancestorRespondingToScrollWheelEvents):
1518         * rendering/RenderTextControl.h:
1519         * rendering/RenderTextControlSingleLine.h:
1520         * rendering/SimpleLineLayout.cpp:
1521         (WebCore::SimpleLineLayout::canUseFor):
1522
1523 2014-10-15  Chris Dumez  <cdumez@apple.com>
1524
1525         Use is<>() / downcast<>() for ClipPathOperation subclasses
1526         https://bugs.webkit.org/show_bug.cgi?id=137733
1527
1528         Reviewed by Mihnea Ovidenie.
1529
1530         Use is<>() / downcast<>() for ClipPathOperation subclasses.
1531
1532         No new tests, no behavior change.
1533
1534         * css/CSSComputedStyleDeclaration.cpp:
1535         (WebCore::ComputedStyleExtractor::propertyValue):
1536         * css/DeprecatedStyleBuilder.cpp:
1537         (WebCore::ApplyPropertyClipPath::applyValue):
1538         * rendering/ClipPathOperation.h:
1539         * rendering/RenderBlock.cpp:
1540         (WebCore::RenderBlock::nodeAtPoint):
1541         * rendering/RenderLayer.cpp:
1542         (WebCore::RenderLayer::setupClipPath):
1543         * rendering/svg/SVGRenderingContext.cpp:
1544         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1545
1546 2014-10-15  Chris Dumez  <cdumez@apple.com>
1547
1548         [Mac] Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable()
1549         https://bugs.webkit.org/show_bug.cgi?id=137723
1550
1551         Reviewed by Simon Fraser.
1552
1553         Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable() instead
1554         of CFDictionaryGetValue() as we are not actually interested in the
1555         value.
1556
1557         No new tests, no behavior change.
1558
1559         * platform/graphics/cg/ImageSourceCG.cpp:
1560         (WebCore::ImageSource::isSizeAvailable):
1561
1562 2014-10-15  Mihnea Ovidenie  <mihnea@adobe.com>
1563
1564         Use modern loops in subtrees selection code
1565         https://bugs.webkit.org/show_bug.cgi?id=137688
1566
1567         Reviewed by Andreas Kling.
1568
1569         No new tests as no change in functionality.
1570
1571         * rendering/RenderView.cpp:
1572         (WebCore::RenderView::splitSelectionBetweenSubtrees):
1573         (WebCore::RenderView::updateSelectionForSubtrees):
1574         (WebCore::RenderView::clearSubtreeSelection):
1575         (WebCore::RenderView::applySubtreeSelection):
1576         * rendering/RenderView.h:
1577
1578 2014-10-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1579
1580         Clean up unnecessary PassOwnPtr.h inclusion
1581         https://bugs.webkit.org/show_bug.cgi?id=137726
1582
1583         Reviewed by Chris Dumez.
1584
1585         No new tests, no behavior changes.
1586
1587         * dom/Document.h: Remove PassOwnPtr.h inclusion.
1588         * loader/ResourceBuffer.h: ditto.
1589         * loader/cocoa/DiskCacheMonitorCocoa.mm: ditto.
1590         * page/scrolling/AxisScrollSnapOffsets.h: ditto.
1591         * page/scrolling/ScrollingStateScrollingNode.h: ditto.
1592         * platform/ColorChooserClient.h: ditto.
1593         * platform/ScrollableArea.cpp: ditto.
1594         * platform/ScrollbarThemeClient.h: ditto.
1595         * platform/SharedBuffer.cpp: ditto.
1596         * platform/Supplementable.h: ditto.
1597         * platform/graphics/surfaces/GraphicsSurface.h: ditto.
1598         * platform/graphics/surfaces/GraphicsSurfaceToken.h: ditto.
1599         * platform/graphics/win/WKCAImageQueue.cpp: ditto.
1600         * platform/win/CursorWin.cpp: ditto.
1601
1602 2014-10-14  Chris Dumez  <cdumez@apple.com>
1603
1604         Have offsetFromContainer() / offsetFromAncestorContainer() take a RenderElement&
1605         https://bugs.webkit.org/show_bug.cgi?id=137728
1606
1607         Reviewed by Benjamin Poulain.
1608
1609         Have offsetFromContainer() / offsetFromAncestorContainer() take a RenderElement&
1610         instead of a RenderObject*. The argument passed is never null and the type
1611         should be a RenderElement as the argument is a container.
1612
1613         No new tests, no behavior change.
1614
1615         * editing/htmlediting.cpp:
1616         (WebCore::localCaretRectInRendererForCaretPainting):
1617         * page/GestureTapHighlighter.cpp:
1618         * rendering/RenderBox.cpp:
1619         (WebCore::RenderBox::mapLocalToContainer):
1620         (WebCore::RenderBox::pushMappingToContainer):
1621         (WebCore::RenderBox::offsetFromContainer):
1622         (WebCore::RenderBox::computeRectForRepaint):
1623         * rendering/RenderBox.h:
1624         * rendering/RenderBoxModelObject.cpp:
1625         (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
1626         * rendering/RenderInline.cpp:
1627         (WebCore::RenderInline::computeRectForRepaint):
1628         (WebCore::RenderInline::offsetFromContainer):
1629         (WebCore::RenderInline::mapLocalToContainer):
1630         (WebCore::RenderInline::pushMappingToContainer):
1631         * rendering/RenderInline.h:
1632         * rendering/RenderMultiColumnFlowThread.cpp:
1633         (WebCore::RenderMultiColumnFlowThread::offsetFromContainer):
1634         * rendering/RenderMultiColumnFlowThread.h:
1635         * rendering/RenderNamedFlowFragment.cpp:
1636         (WebCore::RenderNamedFlowFragment::offsetFromContainer):
1637         * rendering/RenderNamedFlowFragment.h:
1638         * rendering/RenderObject.cpp:
1639         (WebCore::RenderObject::offsetFromContainer):
1640         (WebCore::RenderObject::offsetFromAncestorContainer):
1641         * rendering/RenderObject.h:
1642         * rendering/RenderTableCell.cpp:
1643         (WebCore::RenderTableCell::offsetFromContainer):
1644         * rendering/RenderTableCell.h:
1645         * rendering/RenderThemeMac.mm:
1646         (WebCore::RenderThemeMac::convertToPaintingRect):
1647
1648 2014-10-14  Jer Noble  <jer.noble@apple.com>
1649
1650         REGRESSION (r159208): Crash when clicking scrubber after navigating away/back to video
1651         https://bugs.webkit.org/show_bug.cgi?id=137715
1652
1653         Reviewed by Darin Adler.
1654
1655         Simple null-check of m_player in refreshCachedTime.
1656
1657         * html/HTMLMediaElement.cpp:
1658         (WebCore::HTMLMediaElement::refreshCachedTime):
1659
1660 2014-10-14  Chris Dumez  <cdumez@apple.com>
1661
1662         [Mac] Fix inefficiencies in ResourceResponse::platformLazyInit(InitLevel)
1663         https://bugs.webkit.org/show_bug.cgi?id=137721
1664
1665         Reviewed by Geoffrey Garen.
1666
1667         There were several inefficiencies with the Mac implementation of
1668         ResourceResponse::platformLazyInit(InitLevel):
1669         1. We end up initializing uncommon fields even if called with
1670            'CommonFieldsOnly' initLevel.
1671         2. If called with 'AllFields' initLevel (and if currently
1672            uninitialized), we end up populating m_httpHeaderFields twice, once
1673            with only the common headers, then a second time with ALL the
1674            headers. We can skip the common-header case in this case to avoid
1675            wasting CPU time.
1676
1677         This patch addresses both inefficiencies and cleans up the code a
1678         little bit to reduce variable scope and to use fast enumeration of
1679         header names.
1680
1681         As a result, we spend almost twice as little time in platformLazyInit()
1682         when loading msn.com (~30ms -> ~18ms).
1683
1684         No new tests, no behavior change.
1685
1686         * platform/network/mac/ResourceResponseMac.mm:
1687         (WebCore::ResourceResponse::platformLazyInit):
1688
1689 2014-10-14  Zalan Bujtas  <zalan@apple.com>
1690
1691         REGRESSION (Safari 7.1/8.0): Border-radius and overflow hidden renders incorrectly.
1692         https://bugs.webkit.org/show_bug.cgi?id=137205
1693
1694         Reviewed by Simon Fraser.
1695
1696         Child layer should not reset radius clipping behaviour.
1697
1698         Test: fast/layers/parent-clipping-overflow-is-overwritten-by-child-clipping.html
1699
1700         * rendering/RenderLayer.cpp:
1701         (WebCore::RenderLayer::calculateClipRects):
1702
1703 2014-10-14  Chris Dumez  <cdumez@apple.com>
1704
1705         Use is<>() / downcast<>() for PlatformCAAnimation subclasses
1706         https://bugs.webkit.org/show_bug.cgi?id=137722
1707
1708         Reviewed by Simon Fraser.
1709
1710         Use is<>() / downcast<>() for PlatformCAAnimation subclasses and clean
1711         up the surrounding code.
1712
1713         No new tests, no behavior change.
1714
1715         * page/mac/ServicesOverlayController.mm:
1716         (WebCore::ServicesOverlayController::Highlight::fadeIn):
1717         (WebCore::ServicesOverlayController::Highlight::fadeOut):
1718         * platform/graphics/ca/GraphicsLayerCA.cpp:
1719         (WebCore::GraphicsLayerCA::moveOrCopyLayerAnimation):
1720         (WebCore::GraphicsLayerCA::updateAnimations):
1721         (WebCore::GraphicsLayerCA::setAnimationOnLayer):
1722         (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
1723         * platform/graphics/ca/GraphicsLayerCA.h:
1724         * platform/graphics/ca/PlatformCAAnimation.h:
1725         * platform/graphics/ca/PlatformCALayer.h:
1726         * platform/graphics/ca/mac/PlatformCAAnimationMac.h:
1727         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
1728         (PlatformCAAnimationMac::copy):
1729         (PlatformCAAnimationMac::copyTimingFunctionFrom):
1730         (PlatformCAAnimationMac::copyFromValueFrom):
1731         (PlatformCAAnimationMac::copyToValueFrom):
1732         (PlatformCAAnimationMac::copyValuesFrom):
1733         (PlatformCAAnimationMac::copyKeyTimesFrom):
1734         (PlatformCAAnimationMac::copyTimingFunctionsFrom):
1735         * platform/graphics/ca/mac/PlatformCALayerMac.h:
1736         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1737         (PlatformCALayerMac::addAnimationForKey):
1738         * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
1739         (PlatformCAAnimationWin::copy):
1740         (PlatformCAAnimationWin::copyTimingFunctionFrom):
1741         (PlatformCAAnimationWin::copyFromValueFrom):
1742         (PlatformCAAnimationWin::copyToValueFrom):
1743         (PlatformCAAnimationWin::copyValuesFrom):
1744         (PlatformCAAnimationWin::copyKeyTimesFrom):
1745         (PlatformCAAnimationWin::copyTimingFunctionsFrom):
1746         * platform/graphics/ca/win/PlatformCAAnimationWin.h:
1747         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1748         (PlatformCALayerWin::addAnimationForKey):
1749         * platform/graphics/ca/win/PlatformCALayerWin.h:
1750
1751 2014-10-14  Chris Dumez  <cdumez@apple.com>
1752
1753         Use is<>() / downcast<>() for RenderInline
1754         https://bugs.webkit.org/show_bug.cgi?id=137704
1755
1756         Reviewed by Darin Adler.
1757
1758         Use is<>() / downcast<>() for RenderInline and clean up the surrounding
1759         code.
1760
1761         No new tests, no behavior change.
1762
1763         * accessibility/AccessibilityRenderObject.cpp:
1764         (WebCore::firstChildInContinuation):
1765         * editing/SimplifyMarkupCommand.cpp:
1766         (WebCore::SimplifyMarkupCommand::doApply):
1767         * inspector/InspectorOverlay.cpp:
1768         (WebCore::buildRendererHighlight):
1769         * page/FrameView.cpp:
1770         (WebCore::FrameView::paintContents):
1771         * rendering/InlineFlowBox.cpp:
1772         (WebCore::InlineFlowBox::removeLineBoxFromRenderObject):
1773         (WebCore::InlineFlowBox::extractLineBoxFromRenderObject):
1774         (WebCore::InlineFlowBox::attachLineBoxToRenderObject):
1775         (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
1776         (WebCore::InlineFlowBox::nodeAtPoint):
1777         (WebCore::InlineFlowBox::paint):
1778         * rendering/InlineIterator.h:
1779         (WebCore::bidiFirstSkippingEmptyInlines):
1780         * rendering/LayoutState.cpp:
1781         (WebCore::LayoutState::LayoutState):
1782         * rendering/RenderBlock.cpp:
1783         (WebCore::RenderBlock::willBeDestroyed):
1784         (WebCore::RenderBlock::paintObject):
1785         (WebCore::RenderBlock::inlineElementContinuation):
1786         (WebCore::RenderBlock::addFocusRingRects):
1787         * rendering/RenderBlockFlow.cpp:
1788         (WebCore::RenderBlockFlow::willBeDestroyed):
1789         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
1790         * rendering/RenderBlockFlow.h:
1791         * rendering/RenderBlockLineLayout.cpp:
1792         (WebCore::constructBidiRunsForSegment):
1793         (WebCore::RenderBlockFlow::layoutLineBoxes):
1794         * rendering/RenderBox.cpp:
1795         (WebCore::RenderBox::offsetFromContainer):
1796         (WebCore::RenderBox::computeRectForRepaint):
1797         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
1798         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
1799         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
1800         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
1801         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1802         * rendering/RenderBoxModelObject.cpp:
1803         (WebCore::accumulateInFlowPositionOffsets):
1804         * rendering/RenderElement.cpp:
1805         (WebCore::RenderElement::willBeRemovedFromTree):
1806         * rendering/RenderElement.h:
1807         (WebCore::RenderElement::dirtyLinesFromChangedChild):
1808         * rendering/RenderFlowThread.cpp:
1809         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
1810         * rendering/RenderInline.cpp:
1811         (WebCore::RenderInline::willBeDestroyed):
1812         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
1813         (WebCore::RenderInline::clippedOverflowRectForRepaint):
1814         * rendering/RenderInline.h:
1815         * rendering/RenderLayer.cpp:
1816         (WebCore::RenderLayer::updateLayerPosition):
1817         (WebCore::RenderLayer::calculateClipRects):
1818         * rendering/RenderLineBoxList.cpp:
1819         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
1820         * rendering/RenderLineBoxList.h:
1821         * rendering/RenderNamedFlowThread.cpp:
1822         (WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):
1823         * rendering/RenderObject.cpp:
1824         (WebCore::RenderObject::insertedIntoTree):
1825         * rendering/RenderRegion.cpp:
1826         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
1827         (WebCore::RenderRegion::visualOverflowRectForBox):
1828         (WebCore::RenderRegion::visualOverflowRectForBoxForPropagation):
1829         * rendering/RenderRegion.h:
1830         * rendering/RenderReplaced.cpp:
1831         (WebCore::RenderReplaced::willBeDestroyed):
1832         * rendering/RenderTextLineBoxes.cpp:
1833         (WebCore::RenderTextLineBoxes::removeAllFromParent):
1834         (WebCore::RenderTextLineBoxes::dirtyRange):
1835         * rendering/line/BreakingContextInlineHeaders.h:
1836         (WebCore::inlineLogicalWidth):
1837         (WebCore::BreakingContext::handleEmptyInline):
1838         * rendering/line/LineInlineHeaders.h:
1839         (WebCore::requiresLineBox):
1840         (WebCore::setStaticPositions):
1841         * rendering/svg/SVGInlineTextBox.cpp:
1842         (WebCore::SVGInlineTextBox::paint):
1843
1844 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
1845
1846         [Win] Unreviewed build fix after r174710.
1847
1848         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1849         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
1850
1851 2014-10-14  Dan Bernstein  <mitz@apple.com>
1852
1853         URLs that start with http:/// and https:/// lose two slashes when parsed, causing assertion failure and inconsistent behavior
1854         https://bugs.webkit.org/show_bug.cgi?id=137718
1855
1856         Reviewed by Alexey Proskuryakov.
1857
1858         Added cases to fast/loader/url-parse-1.html.
1859
1860         * platform/URL.cpp:
1861         (WebCore::URL::parse): In hierarchical schemes other than file:, ignore any additional
1862         slashes after the ://, as prescribed by the authority-ignore-slashes state in the current
1863         URL spec.
1864
1865 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
1866
1867         [Win] Unreviewed build fix after r174698 and r174709.
1868
1869         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
1870         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
1871         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1872         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
1873         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
1874         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1875
1876 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
1877
1878         [Win] Unreviewed build fix after r174698
1879
1880         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
1881         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
1882         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1883         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
1884
1885 2014-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
1886
1887         Improve debug description of WAKViews
1888         https://bugs.webkit.org/show_bug.cgi?id=137716
1889
1890         Reviewed by Simon Fraser.
1891
1892         No new tests because there is no behavior change.
1893
1894         * platform/ios/wak/WAKView.mm:
1895         (-[WAKView description]):
1896         * platform/ios/wak/WKView.h:
1897         * platform/ios/wak/WKView.mm:
1898         (WKViewGetOrigin):
1899
1900 2014-10-14  Chris Dumez  <cdumez@apple.com>
1901
1902         Introduce an isCSSAnimated flag on RenderElement for performance
1903         https://bugs.webkit.org/show_bug.cgi?id=137583
1904
1905         Reviewed by Simon Fraser.
1906
1907         I noticed when profiling the ebay.com page load that isRunningAnimationOnRenderer()
1908         and isRunningAcceleratedAnimationOnRenderer() were called frequently, causing
1909         ~4.7 millions m_compositeAnimations HashMap lookups.
1910
1911         This patch introduces an isCSSAnimated flag on RenderElement to return early if
1912         there is no animation on the renderer, thus avoiding HashMap lookups. This reduces
1913         the number of HashMap lookups from ~4.7 millions to ~68k. On my machine, I see
1914         the following performance improvements:
1915         - isRunning*AnimationOnRenderer() / computeCompositingRequirements()
1916           - before: ~45ms  / ~90ms
1917           - after:  ~4ms / ~30ms
1918
1919         No new tests, no behavior change.
1920
1921         * page/animation/AnimationController.cpp:
1922         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
1923         (WebCore::AnimationControllerPrivate::clear):
1924         (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer):
1925         (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
1926         (WebCore::AnimationController::isRunningAnimationOnRenderer):
1927         (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer):
1928         * rendering/RenderElement.cpp:
1929         (WebCore::RenderElement::RenderElement):
1930         * rendering/RenderElement.h:
1931         (WebCore::RenderElement::isCSSAnimating):
1932         (WebCore::RenderElement::setIsCSSAnimating):
1933
1934 2014-10-14  Dean Jackson  <dino@apple.com>
1935
1936         Crash in WebCore::UserGestureIndicator::processingUserGesture with WebWorkers
1937         https://bugs.webkit.org/show_bug.cgi?id=137676
1938         <rdar://problem/15735049>
1939
1940         Reviewed by Alexey Proskuryakov.
1941
1942         Remove the code I added that tracks the timestamp of the most recent
1943         user gesture from the event handling dispatch, as it was both
1944         a silly place to do it and it originally crashed when events were fired from
1945         Worker threads (although this was fixed in r152238).
1946
1947         It's now recorded by going through UserGestureIndicator, which is good because
1948         it knows when a user has triggered an event. Its constructor now takes
1949         a pointer to Document, and updates the timestamp there if necessary.
1950
1951         Not all UserGestureIndicator instances needed to reset the timestamp; Those did
1952         not have to pass along the Document.
1953
1954         This is untestable due to the fix mentioned above.
1955
1956         * WebCore.exp.in: Change constructor signature.
1957
1958         * accessibility/AccessibilityNodeObject.cpp: Pass a pointer to the Document into the UserGestureIndicator.
1959         (WebCore::AccessibilityNodeObject::increment):
1960         (WebCore::AccessibilityNodeObject::decrement):
1961         * accessibility/AccessibilityObject.cpp: Ditto.
1962         (WebCore::AccessibilityObject::press):
1963
1964         * dom/Document.cpp:
1965         (WebCore::Document::updateLastHandledUserGestureTimestamp): Renamed.
1966         * dom/Document.h:
1967
1968         * dom/EventTarget.cpp: Remove the code to update the timestamp.
1969         (WebCore::EventTarget::fireEventListeners):
1970
1971         * dom/UserGestureIndicator.cpp:
1972         (WebCore::UserGestureIndicator::UserGestureIndicator): If there is a Document and
1973         this is a user gesture, then reset the timestamp.
1974         * dom/UserGestureIndicator.h:
1975
1976         * page/EventHandler.cpp: Pass a pointer to the Document.
1977         (WebCore::EventHandler::handleMousePressEvent):
1978         (WebCore::EventHandler::handleMouseDoubleClickEvent):
1979         (WebCore::EventHandler::handleMouseReleaseEvent):
1980         (WebCore::EventHandler::keyEvent):
1981         (WebCore::EventHandler::handleTouchEvent):
1982
1983         * rendering/HitTestResult.cpp: Ditto.
1984         (WebCore::HitTestResult::toggleMediaFullscreenState):
1985         (WebCore::HitTestResult::enterFullscreenForVideo):
1986
1987 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
1988
1989         [Win] Unreviewed gardening. Ignore Visual Studio *.sdf files.
1990
1991         * WebCore.vcxproj: Modified property svn:ignore.
1992
1993 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
1994
1995         [Win] Enable Encrypted Media Support
1996         https://bugs.webkit.org/show_bug.cgi?id=137710
1997         <rdar://problem/18652699>
1998
1999         Reviewed by Jer Noble.
2000
2001         This feature is covered by existing media tests.
2002
2003         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2004         (WebCore::destroyAVFWrapper): Remove redundant ASSERT.
2005         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2006         (displayOnMainThreadContext::displayOnMainThreadContext): Added.
2007         (redispatchOnMainQueue): Added.
2008         (PlatformCALayerWinInternal::displayCallback): Check if a display
2009         call is happening on a background queue, and re-dispatch on the
2010         main thread if necessary.
2011
2012 2014-10-14  Chris Dumez  <cdumez@apple.com>
2013
2014         [Mac] Avoid unnecessary dictionary lookup in ImageSource::isSizeAvailable()
2015         https://bugs.webkit.org/show_bug.cgi?id=137701
2016
2017         Reviewed by Simon Fraser.
2018
2019         The CG implementation of ImageSource::isSizeAvailable() was looking up
2020         both the width and the height keys in the dictionary before determining
2021         if the size is available. We can abort early and return false if the
2022         first key (the width) is missing, thus avoiding an extra dictionary
2023         lookup in this case.
2024
2025         This is a small win but ImageSource::isSizeAvailable() is called quite
2026         frequently during page loads
2027
2028         No new tests, no behavior change.
2029
2030         * platform/graphics/cg/ImageSourceCG.cpp:
2031         (WebCore::ImageSource::isSizeAvailable):
2032
2033 2014-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
2034
2035         Remove unnecessary logging from SimpleFontData
2036         https://bugs.webkit.org/show_bug.cgi?id=137699
2037
2038         Reviewed by Andreas Kling.
2039
2040         Because of web fonts, fonts that don't have a glyph page 0 are common and expected. Printing out a
2041         message is not helpful, especially if you're not dealing with a font-related piece of WebKit.
2042
2043         No new tests because there is no behavior change.
2044
2045         * platform/graphics/SimpleFontData.cpp:
2046         (WebCore::SimpleFontData::platformGlyphInit):
2047
2048 2014-10-14  Martin Hock  <mhock@apple.com>
2049
2050         Update ViewportConfiguration whenever its size attributes change
2051         https://bugs.webkit.org/show_bug.cgi?id=137682
2052         rdar://problem/18643655
2053
2054         Reviewed by Benjamin Poulain.
2055
2056         * page/ViewportConfiguration.cpp:
2057         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
2058         (WebCore::ViewportConfiguration::setMinimumLayoutSizeForMinimalUI):
2059
2060 2014-10-14  Joseph Pecoraro  <pecoraro@apple.com>
2061
2062         Web Inspector: Processing Instruction Nodes appear poorly in DOM Tree
2063         https://bugs.webkit.org/show_bug.cgi?id=137681
2064
2065         Reviewed by Timothy Hatcher.
2066
2067         * inspector/InspectorDOMAgent.cpp:
2068         (WebCore::InspectorDOMAgent::buildObjectForNode):
2069         Include the nodeName, localName, and nodeValue (string data)
2070         properties for processing instruction nodes.
2071
2072 2014-10-14  Chris Dumez  <cdumez@apple.com>
2073
2074         Use is<>() / downcast<>() for RenderFrame / RenderFrameSet
2075         https://bugs.webkit.org/show_bug.cgi?id=137696
2076
2077         Reviewed by Darin Adler.
2078
2079         Use is<>() / downcast<>() for RenderFrame / RenderFrameSet.
2080
2081         No new tests, no behavior change.
2082
2083         * html/HTMLFrameSetElement.cpp:
2084         (WebCore::HTMLFrameSetElement::defaultEventHandler):
2085         * rendering/RenderFrame.cpp:
2086         (WebCore::RenderFrame::updateFromElement):
2087         * rendering/RenderFrame.h:
2088         * rendering/RenderFrameSet.cpp:
2089         (WebCore::RenderFrameSet::computeEdgeInfo):
2090         (WebCore::RenderFrameSet::positionFramesWithFlattening):
2091         * rendering/RenderFrameSet.h:
2092
2093 2014-10-14  Youenn Fablet  <youennf@gmail.com>
2094
2095         [XHR] Abort method execution when m_loader->cancel() in internalAbort() caused reentry
2096         https://bugs.webkit.org/show_bug.cgi?id=126975
2097
2098         Reviewed by Alexey Proskuryakov.
2099
2100         Merging https://chromium.googlesource.com/chromium/blink/+/0d75daf2053631518606ae15daaece701a25b2c4
2101         Ensuring new test from https://codereview.chromium.org/76133002/ is passing.
2102
2103         Test: http/tests/xmlhttprequest/reentrant-cancel-abort.html
2104
2105         * xml/XMLHttpRequest.cpp:
2106         (WebCore::XMLHttpRequest::open): exit early if internalAbort asks so
2107         (WebCore::XMLHttpRequest::abort): exit early if internalAbort asks so
2108         (WebCore::XMLHttpRequest::internalAbort): ask calling function to exit early if a new loader is created during the cancellation of the loader (potential reentrant case through window.onload callback)   
2109         (WebCore::XMLHttpRequest::didTimeout): exit early if internalAbort asks so
2110         * xml/XMLHttpRequest.h:
2111
2112 2014-10-14  Alejandro G. Castro  <alex@igalia.com>
2113
2114         Multiple refactors in RenderMathMLOperator
2115         https://bugs.webkit.org/show_bug.cgi?id=137611
2116
2117         Reviewed by Darin Adler.
2118
2119         The changes include:
2120         - Rename m_operator to m_textContent.
2121         - Make most of the functions private, we needed to create some
2122         public member functions to be able to make the some funtions private
2123         and move trailingSpaceError to RenderMathMLOperator.
2124         - Fix incorrect capitalization of setOperatorProperties function.
2125         - Make all data members private and move them to the end of the
2126         class defition.
2127
2128         No new tests as no change in functionality.
2129
2130         * rendering/mathml/RenderMathMLOperator.cpp:
2131         (WebCore::RenderMathMLOperator::RenderMathMLOperator):
2132         (WebCore::RenderMathMLOperator::setOperatorProperties): Renamed,
2133         incorrect capitalization
2134         (WebCore::RenderMathMLOperator::stretchTo):
2135         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
2136         (WebCore::RenderMathMLOperator::rebuildTokenContent):
2137         (WebCore::RenderMathMLOperator::updateFromElement):
2138         (WebCore::RenderMathMLOperator::updateOperatorProperties):
2139         (WebCore::RenderMathMLOperator::shouldAllowStretching):
2140         (WebCore::RenderMathMLOperator::updateStyle):
2141         (WebCore::RenderMathMLOperator::trailingSpaceError):
2142         (WebCore::RenderMathMLOperator::SetOperatorProperties): Deleted.
2143         (WebCore::RenderMathMLOperator::advanceForGlyph): Deleted.
2144         (WebCore::RenderMathMLOperator::updateTokenContent): Deleted.
2145         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): Deleted.
2146         * rendering/mathml/RenderMathMLOperator.h:
2147         (WebCore::RenderMathMLOperator::setLeadingSpace): Added.
2148         (WebCore::RenderMathMLOperator::setTrailingSpace):  Added.
2149         (WebCore::RenderMathMLOperator::textContent): Added.
2150         (WebCore::RenderMathMLOperator::isInvisibleOperator):
2151         * rendering/mathml/RenderMathMLRadicalOperator.cpp:
2152         (WebCore::RenderMathMLRadicalOperator::setOperatorProperties):
2153         Renamed, incorrect capitalization
2154         (WebCore::RenderMathMLRadicalOperator::SetOperatorProperties): Deleted.
2155         (WebCore::RenderMathMLRadicalOperator::trailingSpaceError): Deleted.
2156         * rendering/mathml/RenderMathMLRadicalOperator.h:
2157
2158 2014-10-14  Alejandro G. Castro  <alex@igalia.com>
2159
2160         Changes in the stretchy attribute do not update rendering
2161         https://bugs.webkit.org/show_bug.cgi?id=136883
2162
2163         Reviewed by Darin Adler.
2164
2165         Test: mathml/presentation/mo-stretch-update.html
2166
2167         We need to relayout when a change in the stretchy attribute
2168         happens.
2169
2170         * mathml/MathMLTextElement.cpp:
2171         (WebCore::MathMLTextElement::parseAttribute): Parse the
2172         modifications of the stretchy attribute.
2173         * mathml/MathMLTextElement.h:
2174         * rendering/mathml/RenderMathMLOperator.cpp:
2175         (WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded):
2176         Add function that receives the value instead of looking for it and
2177         checks if the change should schedule a layout.
2178         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
2179         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue):
2180         Add function that receives the value instead of looking for it.
2181         * rendering/mathml/RenderMathMLOperator.h:
2182
2183 2014-10-14  Chris Dumez  <cdumez@apple.com>
2184
2185         Use is<>() / downcast<>() for RenderImage
2186         https://bugs.webkit.org/show_bug.cgi?id=137683
2187
2188         Reviewed by Mihnea Ovidenie.
2189
2190         Use is<>() / downcast<>() for RenderImage.
2191
2192         No new tests, no behavior change.
2193
2194         * accessibility/AccessibilityNodeObject.cpp:
2195         (WebCore::AccessibilityNodeObject::alternativeText):
2196         * accessibility/AccessibilityRenderObject.cpp:
2197         (WebCore::AccessibilityRenderObject::addImageMapChildren):
2198         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
2199         * bindings/objc/DOM.mm:
2200         (-[DOMElement image]):
2201         (-[DOMElement _imageTIFFRepresentation]):
2202         * editing/TextIterator.cpp:
2203         (WebCore::TextIterator::handleReplacedElement):
2204         * editing/cocoa/HTMLConverter.mm:
2205         (fileWrapperForElement):
2206         * editing/gtk/EditorGtk.cpp:
2207         (WebCore::getImageForElement):
2208         * editing/ios/EditorIOS.mm:
2209         (WebCore::getImage):
2210         * editing/mac/EditorMac.mm:
2211         (WebCore::getImage):
2212         * html/HTMLAnchorElement.cpp:
2213         (WebCore::appendServerMapMousePosition):
2214         * html/HTMLAreaElement.cpp:
2215         (WebCore::HTMLAreaElement::setFocus):
2216         * html/HTMLImageElement.cpp:
2217         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
2218         (WebCore::HTMLImageElement::parseAttribute):
2219         (WebCore::HTMLImageElement::didAttachRenderers):
2220         (WebCore::HTMLImageElement::createImageControls):
2221         (WebCore::HTMLImageElement::destroyImageControls):
2222         * html/HTMLVideoElement.cpp:
2223         (WebCore::HTMLVideoElement::didAttachRenderers):
2224         (WebCore::HTMLVideoElement::parseAttribute):
2225         * html/ImageInputType.cpp:
2226         (WebCore::ImageInputType::altAttributeChanged):
2227         (WebCore::ImageInputType::attach):
2228         * html/canvas/CanvasRenderingContext2D.cpp:
2229         (WebCore::size):
2230         * html/shadow/mac/ImageControlsRootElementMac.cpp:
2231         (WebCore::RenderImageControls::updateLogicalWidth):
2232         (WebCore::RenderImageControls::computeLogicalHeight):
2233         * loader/ImageLoader.cpp:
2234         (WebCore::ImageLoader::renderImageResource):
2235         * page/ContextMenuController.cpp:
2236         (WebCore::imageFromImageElementNode):
2237         * page/DragController.cpp:
2238         (WebCore::getCachedImage):
2239         (WebCore::getImage):
2240         * platform/win/PasteboardWin.cpp:
2241         (WebCore::Pasteboard::writeImage):
2242         (WebCore::getCachedImage):
2243         * rendering/HitTestResult.cpp:
2244         (WebCore::HitTestResult::image):
2245         * rendering/RenderImage.h:
2246         * rendering/RenderImageResource.cpp:
2247         (WebCore::RenderImageResource::getImageSize):
2248         * rendering/RenderLayerBacking.cpp:
2249         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
2250         (WebCore::RenderLayerBacking::updateImageContents):
2251         * rendering/RenderReplaced.cpp:
2252         (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox):
2253         * rendering/shapes/ShapeOutsideInfo.cpp:
2254         (WebCore::ShapeOutsideInfo::createShapeForImage):
2255
2256 2014-10-14  Andrzej Badowski  <a.badowski@samsung.com>
2257
2258         [AX] Improve AccessibilityTableCell columnHeaders and rowHeaders functions.
2259         https://bugs.webkit.org/show_bug.cgi?id=136818
2260
2261         Reviewed by Chris Fleizach.
2262
2263         Take into account that <th> elements can be both the column headers and row headers 
2264         improved the operation of two functions: columnHeaders and rowHeaders.
2265
2266         Test: accessibility/table-headers.html
2267
2268         * accessibility/AccessibilityTableCell.cpp:
2269         (WebCore::AccessibilityTableCell::isColumnHeaderCell):
2270         A new function that helps the main goal.
2271         (WebCore::AccessibilityTableCell::isRowHeaderCell):
2272         A new function that helps the main goal.
2273         (WebCore::AccessibilityTableCell::columnHeaders):
2274         Use isColumnHeaderCell instead of isTableHeaderCell.
2275         (WebCore::AccessibilityTableCell::rowHeaders):
2276         Use isRowHeaderCell also includes <th> row header element next to the scope attribute.
2277         * accessibility/AccessibilityTableCell.h:
2278         Adds new functions to the header file.
2279
2280 2014-10-14  Csaba Osztrogon√°c  <ossy@webkit.org>
2281
2282         Fix the !ENABLE(VIDEO) build after r174353
2283         https://bugs.webkit.org/show_bug.cgi?id=137655
2284
2285         Reviewed by Darin Adler.
2286
2287         * dom/Document.cpp:
2288         * dom/Document.h:
2289         * page/Page.cpp:
2290         * page/Page.h:
2291
2292 2014-10-14  peavo@outlook.com  <peavo@outlook.com>
2293
2294         [Curl] Compile error in CurlDownload.cpp.
2295         https://bugs.webkit.org/show_bug.cgi?id=137654
2296
2297         Reviewed by Philippe Normand.
2298
2299         A template specialization is not needed anymore.
2300
2301         * platform/network/curl/CurlDownload.cpp:
2302
2303 2014-10-13  Joseph Pecoraro  <pecoraro@apple.com>
2304
2305         Web Inspector: Remove unused stale Page protocol methods
2306         https://bugs.webkit.org/show_bug.cgi?id=137678
2307
2308         Reviewed by Andreas Kling.
2309
2310         * inspector/InspectorClient.h:
2311         (WebCore::InspectorClient::canShowDebugBorders): Deleted.
2312         (WebCore::InspectorClient::setShowDebugBorders): Deleted.
2313         (WebCore::InspectorClient::canShowFPSCounter): Deleted.
2314         (WebCore::InspectorClient::setShowFPSCounter): Deleted.
2315         (WebCore::InspectorClient::canContinuouslyPaint): Deleted.
2316         (WebCore::InspectorClient::setContinuousPaintingEnabled): Deleted.
2317         * inspector/InspectorPageAgent.cpp:
2318         (WebCore::InspectorPageAgent::disable):
2319         (WebCore::InspectorPageAgent::canShowDebugBorders): Deleted.
2320         (WebCore::InspectorPageAgent::setShowDebugBorders): Deleted.
2321         (WebCore::InspectorPageAgent::canShowFPSCounter): Deleted.
2322         (WebCore::InspectorPageAgent::setShowFPSCounter): Deleted.
2323         (WebCore::InspectorPageAgent::canContinuouslyPaint): Deleted.
2324         (WebCore::InspectorPageAgent::setContinuousPaintingEnabled): Deleted.
2325         * inspector/InspectorPageAgent.h:
2326         * inspector/protocol/Page.json:
2327
2328 2014-10-13  Eric Carlson  <eric.carlson@apple.com>
2329
2330         [iOS] Refactor AirPlay monitoring code
2331         https://bugs.webkit.org/show_bug.cgi?id=137645
2332         <rdar://problem/18444817>
2333
2334         Reviewed by Jer Noble.
2335
2336         Refactor AirPlay route change monitoring code:
2337         + Have MediaSessionManager register/unregister for route changes depending on the state of
2338             all sessions so it does the right thing when there is more than one media element.
2339         + Make HTMLMediaElement unregister with MediaSession as soon as the media player is cleared
2340             because there can be no wireless playback without a player.
2341
2342         * html/HTMLMediaElement.cpp:
2343         (WebCore::HTMLMediaElement::~HTMLMediaElement): Call mediaSession->setHasPlaybackTargetAvailabilityListeners
2344             when there are target availability changed listeners.
2345         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
2346         (WebCore::HTMLMediaElement::wirelessRoutesAvailableDidChange): New, media session client method.
2347         * html/HTMLMediaElement.h:
2348
2349         * html/HTMLMediaSession.cpp:
2350         (WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_hasPlaybackTargetAvailabilityListeners.
2351         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Remember whether or not
2352             the client has a target availability listener and tell the media session manager to reconfigure
2353             itself instead of telling it to start or stop listening for route changes so it does the 
2354             right thing when there is more than one media element.
2355         * html/HTMLMediaSession.h:
2356         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring): Return true when the client 
2357             has a target availability listener, false otherwise.
2358
2359         * platform/audio/MediaSession.cpp:
2360         (WebCore::MediaSession::wirelessRoutesAvailableDidChange): Inform the client that routes have changed.
2361         * platform/audio/MediaSession.h:
2362         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
2363         (WebCore::MediaSessionClient::wirelessRoutesAvailableDidChange):
2364
2365         * platform/audio/MediaSessionManager.cpp:
2366         (WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Implement it.
2367         * platform/audio/MediaSessionManager.h:
2368         (WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
2369         (WebCore::MediaSessionManager::hasWirelessTargetsAvailable):
2370         (WebCore::MediaSessionManager::sessions):
2371         (WebCore::MediaSessionManager::startMonitoringAirPlayRoutes): Deleted.
2372         (WebCore::MediaSessionManager::stopMonitoringAirPlayRoutes): Deleted.
2373
2374         * platform/audio/ios/MediaSessionManagerIOS.h:
2375         * platform/audio/ios/MediaSessionManagerIOS.mm:
2376         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): Start or stop monitoring
2377             for route changes depending on client state.
2378         (WebCore::MediaSessionManageriOS::startMonitoringAirPlayRoutes): Deleted.
2379         (WebCore::MediaSessionManageriOS::stopMonitoringAirPlayRoutes): Deleted.
2380
2381 2014-10-13  Chris Dumez  <cdumez@apple.com>
2382
2383         [Mac] Return value of createImageSourceOptions() is leaked in ImageSourceCG
2384         https://bugs.webkit.org/show_bug.cgi?id=137677
2385
2386         Reviewed by Simon Fraser.
2387
2388         The return value of createImageSourceOptions() was leaked in
2389         ImageSourceCG.cpp. It was returning a CFDictionaryRef created using
2390         CFDictionaryCreate(). Therefore, the return value should have been
2391         released but wasn't.
2392
2393         This patch makes createImageSourceOptions() return a
2394         RetainPtr<CFDictionaryRef> to make sure the CFDictionaryRef properly
2395         gets released after use.
2396
2397         No new tests, no behavior change.
2398
2399         * platform/graphics/cg/ImageSourceCG.cpp:
2400         (WebCore::createImageSourceOptions):
2401         (WebCore::imageSourceOptions):
2402         (WebCore::ImageSource::isSizeAvailable):
2403         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
2404         (WebCore::ImageSource::frameSizeAtIndex):
2405         (WebCore::ImageSource::orientationAtIndex):
2406         (WebCore::ImageSource::getHotSpot):
2407         (WebCore::ImageSource::repetitionCount):
2408         (WebCore::ImageSource::createFrameAtIndex):
2409         (WebCore::ImageSource::frameDurationAtIndex):
2410
2411 2014-10-13  Yusuke Suzuki  <utatane.tea@gmail.com>
2412
2413         CSS JIT: Implement :visited pseudo class
2414         https://bugs.webkit.org/show_bug.cgi?id=135293
2415
2416         Reviewed by Benjamin Poulain.
2417
2418         This patch implements CSS JIT for :visited. And it makes :not(:link) JIT-ed.
2419         Following the design discussed at the other bug[1], implemented :visited JIT
2420         without tracking VisitedMatchEnabled state.
2421
2422         In this patch, we change the semantics of :visited / :link
2423         inside functional pseudo classes for further CSS Selector Level 4 extensions.
2424
2425         Edge cases are tested by the existing tests.
2426         :not(:link)
2427             fast/history/link-inside-not.html
2428         :not(:visited)
2429             fast/history/visited-inside-not.html
2430         :-webkit-any(:link)
2431             fast/history/link-inside-any.html
2432         :-webkit-any(:visited)
2433             fast/history/visited-inside-any.html
2434
2435         [1]: https://bugs.webkit.org/show_bug.cgi?id=135639
2436
2437         Test: fast/history/link-inside-not-inside-any.html
2438             To cover the :-webkit-any(:not(:link)), added new tests.
2439
2440         * css/SelectorChecker.cpp:
2441         (WebCore::SelectorChecker::checkOne):
2442         * cssjit/SelectorCompiler.cpp:
2443         (WebCore::SelectorCompiler::addPseudoClassType):
2444         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2445         (WebCore::SelectorCompiler::constructFragments):
2446         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
2447         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
2448         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRightmostTreeWalker):
2449         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2450         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
2451         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstLink):
2452         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateStoreLastVisitedElement):
2453
2454 2014-10-13  Chris Dumez  <cdumez@apple.com>
2455
2456         Use modern loops in RenderLayerCompositor
2457         https://bugs.webkit.org/show_bug.cgi?id=137670
2458
2459         Reviewed by Simon Fraser.
2460
2461         Use modern range for-loops in RenderLayerCompositor.
2462
2463         No new tests, no behavior change.
2464
2465         * rendering/RenderLayerCompositor.cpp:
2466         (WebCore::OverlapMapContainer::overlapsLayers):
2467         (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects):
2468         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
2469         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
2470         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2471         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
2472         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2473         (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
2474         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed):
2475         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2476         (WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree):
2477         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
2478         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
2479         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
2480         (WebCore::resetTrackedRepaintRectsRecursive):
2481         (WebCore::RenderLayerCompositor::layerHas3DContent):
2482         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
2483         (WebCore::RenderLayerCompositor::registerAllScrollingLayers):
2484         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
2485
2486 2014-10-13  Chris Dumez  <cdumez@apple.com>
2487
2488         Drop unnecessary overlapMap null checks in computeCompositingRequirements()
2489         https://bugs.webkit.org/show_bug.cgi?id=137668
2490
2491         Reviewed by Andreas Kling.
2492
2493         Drop unnecessary overlapMap null checks in computeCompositingRequirements().
2494         The function is never called with a null overlapMap so we can make the
2495         argument a reference and drop all the null checks.
2496
2497         No new tests, no behavior change.
2498
2499         * rendering/RenderLayerCompositor.cpp:
2500         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2501         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
2502         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2503         (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
2504         * rendering/RenderLayerCompositor.h:
2505
2506 2014-10-13  Chris Dumez  <cdumez@apple.com>
2507
2508         Use is<>() / downcast<>() for PlatformCALayer subclasses
2509         https://bugs.webkit.org/show_bug.cgi?id=137661
2510
2511         Reviewed by Simon Fraser.
2512
2513         Use is<>() / downcast<>() for PlatformCALayer subclasses and clean up
2514         the surrounding code.
2515
2516         No new tests, no behavior change.
2517
2518         * platform/graphics/ca/GraphicsLayerCA.cpp:
2519         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
2520         (WebCore::GraphicsLayerCA::updateContentsRects):
2521         (WebCore::GraphicsLayerCA::updateReplicatedLayers):
2522         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
2523         (WebCore::GraphicsLayerCA::fetchCloneLayers): Deleted.
2524         * platform/graphics/ca/PlatformCALayer.h:
2525         * platform/graphics/ca/TileCoverageMap.cpp:
2526         (WebCore::TileCoverageMap::TileCoverageMap):
2527         * platform/graphics/ca/TileGrid.cpp:
2528         (WebCore::TileGrid::ensureTilesForRect):
2529         * platform/graphics/ca/mac/PlatformCALayerMac.h:
2530         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2531         (PlatformCALayerMac::clone):
2532         (PlatformCALayerMac::appendSublayer):
2533         (PlatformCALayerMac::insertSublayer):
2534         (PlatformCALayerMac::replaceSublayer):
2535         (PlatformCALayerMac::adoptSublayers):
2536         (PlatformCALayerMac::copyFiltersFrom):
2537         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2538         (WebCore::CACFLayerTreeHost::setRootChildLayer):
2539         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2540         (PlatformCALayerWin::clone):
2541         (PlatformCALayerWin::rootLayer):
2542         (PlatformCALayerWin::appendSublayer):
2543         (PlatformCALayerWin::insertSublayer):
2544         (PlatformCALayerWin::replaceSublayer):
2545         (PlatformCALayerWin::adoptSublayers):
2546         (PlatformCALayerWin::copyFiltersFrom):
2547         * platform/graphics/ca/win/PlatformCALayerWin.h:
2548         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2549         (PlatformCALayerWinInternal::insertSublayer):
2550         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
2551
2552 2014-10-13  Chris Dumez  <cdumez@apple.com>
2553
2554         Use is<>() / downcast<>() for Filter / FilterOperation subclasses
2555         https://bugs.webkit.org/show_bug.cgi?id=137644
2556
2557         Reviewed by Darin Adler.
2558
2559         Use is<>() / downcast<>() for Filter / FilterOperation subclasses.
2560
2561         No new tests, no behavior change.
2562
2563         * css/CSSComputedStyleDeclaration.cpp:
2564         (WebCore::ComputedStyleExtractor::valueForFilter):
2565         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
2566         (PlatformCAFilters::filterValueForOperation):
2567         (PlatformCAFilters::colorMatrixValueForFilter):
2568         * platform/graphics/filters/Filter.h:
2569         * platform/graphics/filters/FilterOperation.cpp:
2570         (WebCore::DefaultFilterOperation::operator==):
2571         (WebCore::ReferenceFilterOperation::operator==):
2572         (WebCore::BasicColorMatrixFilterOperation::blend):
2573         (WebCore::BasicColorMatrixFilterOperation::operator==):
2574         (WebCore::BasicComponentTransferFilterOperation::blend):
2575         (WebCore::BasicComponentTransferFilterOperation::operator==):
2576         (WebCore::BlurFilterOperation::operator==):
2577         (WebCore::BlurFilterOperation::blend):
2578         (WebCore::DropShadowFilterOperation::operator==):
2579         (WebCore::DropShadowFilterOperation::blend):
2580         * platform/graphics/filters/FilterOperation.h:
2581         * platform/graphics/filters/FilterOperations.cpp:
2582         (WebCore::FilterOperations::outsets):
2583         * rendering/FilterEffectRenderer.cpp:
2584         (WebCore::FilterEffectRenderer::build):
2585         * rendering/RenderLayerFilterInfo.cpp:
2586         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
2587         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
2588         (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
2589         * svg/graphics/filters/SVGFilter.h:
2590         (isType):
2591
2592 2014-10-13  Chris Dumez  <cdumez@apple.com>
2593
2594         Use is<>() / downcast<>() for Table render objects
2595         https://bugs.webkit.org/show_bug.cgi?id=137641
2596
2597         Reviewed by Mihnea Ovidenie.
2598
2599         Use is<>() / downcast<>() for table-related render objects and clean
2600         up the surrounding code.
2601
2602         No new tests, no behavior change.
2603
2604         * accessibility/AccessibilityARIAGrid.cpp:
2605         (WebCore::AccessibilityARIAGrid::addChildren):
2606         * accessibility/AccessibilityTable.cpp:
2607         (WebCore::AccessibilityTable::tableElement):
2608         (WebCore::AccessibilityTable::isDataTable):
2609         (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
2610         (WebCore::AccessibilityTable::addChildren):
2611         * accessibility/AccessibilityTableCell.cpp:
2612         (WebCore::AccessibilityTableCell::parentTable):
2613         (WebCore::AccessibilityTableCell::rowIndexRange):
2614         (WebCore::AccessibilityTableCell::columnIndexRange):
2615         (WebCore::AccessibilityTableCell::titleUIElement):
2616         * accessibility/AccessibilityTableColumn.cpp:
2617         (WebCore::AccessibilityTableColumn::headerObject):
2618         * editing/DeleteSelectionCommand.cpp:
2619         (WebCore::DeleteSelectionCommand::removeNode):
2620         * editing/TextIterator.cpp:
2621         (WebCore::shouldEmitTabBeforeNode):
2622         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
2623         * html/HTMLTableCellElement.cpp:
2624         (WebCore::HTMLTableCellElement::parseAttribute):
2625         (WebCore::HTMLTableCellElement::cellAbove):
2626         * html/HTMLTableColElement.cpp:
2627         (WebCore::HTMLTableColElement::parseAttribute):
2628         * mathml/MathMLElement.cpp:
2629         (WebCore::MathMLElement::parseAttribute):
2630         * rendering/AutoTableLayout.cpp:
2631         (WebCore::AutoTableLayout::recalcColumn):
2632         (WebCore::shouldScaleColumns):
2633         * rendering/RenderBlockFlow.cpp:
2634         (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths):
2635         * rendering/RenderBox.cpp:
2636         (WebCore::RenderBox::computePercentageLogicalHeight):
2637         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2638         * rendering/RenderElement.cpp:
2639         (WebCore::RenderElement::addChild):
2640         * rendering/RenderLayer.cpp:
2641         (WebCore::RenderLayer::calculateClipRects):
2642         * rendering/RenderTable.cpp:
2643         (WebCore::RenderTable::addChild):
2644         (WebCore::RenderTable::layout):
2645         (WebCore::RenderTable::firstColumn):
2646         (WebCore::RenderTable::recalcSections):
2647         (WebCore::RenderTable::sectionAbove):
2648         (WebCore::RenderTable::sectionBelow):
2649         (WebCore::RenderTable::bottomSection):
2650         * rendering/RenderTable.h:
2651         * rendering/RenderTableCaption.cpp:
2652         (WebCore::RenderTableCaption::table):
2653         * rendering/RenderTableCell.h:
2654         (WebCore::RenderTableCell::nextCell):
2655         (WebCore::RenderTableCell::previousCell):
2656         (WebCore::RenderTableRow::firstCell):
2657         (WebCore::RenderTableRow::lastCell):
2658         * rendering/RenderTableCol.cpp:
2659         (WebCore::RenderTableCol::table):
2660         (WebCore::RenderTableCol::enclosingColumnGroup):
2661         (WebCore::RenderTableCol::nextColumn):
2662         * rendering/RenderTableCol.h:
2663         Make updateFromElement() public to allow the callers to use tighter
2664         typing and devitualize the call as the class is final.
2665
2666         * rendering/RenderTableRow.cpp:
2667         (WebCore::RenderTableRow::addChild):
2668         * rendering/RenderTableRow.h:
2669         (WebCore::RenderTableSection::firstRow):
2670         (WebCore::RenderTableSection::lastRow):
2671         (WebCore::RenderTableRow::nextRow):
2672         (WebCore::RenderTableRow::previousRow):
2673         * rendering/RenderTableSection.cpp:
2674         (WebCore::RenderTableSection::addChild):
2675         (WebCore::RenderTableSection::layoutRows):
2676         (WebCore::RenderTableSection::paintCell):
2677         * rendering/RenderTableSection.h:
2678         * rendering/RenderTreeAsText.cpp:
2679         (WebCore::writeTextRun):
2680         (WebCore::writeSimpleLine):
2681
2682 2014-10-08  Jer Noble  <jer.noble@apple.com>
2683
2684         MediaPlayer::characteristicChanged() is not called when new tracks are found in SourceBufferPrivateAVFObjC
2685         https://bugs.webkit.org/show_bug.cgi?id=137533
2686
2687         Reviewed by Darin Adler.
2688
2689         When a new AVAsset is returned out of the AVStreamDataParser, notify the HTMLMediaElement that
2690         characteristics of the player may have changed.
2691
2692         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2693         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2694         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::characteristicsChanged):
2695         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2696         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2697
2698 2014-10-13  Jer Noble  <jer.noble@apple.com>
2699
2700         [iOS] Stop listening for wireless playback target availability when the default controls are hidden.
2701         https://bugs.webkit.org/show_bug.cgi?id=137633
2702
2703         Reviewed by Dean Jackson.
2704
2705         In order to minimize the excess bandwidth and power consumption required for actively listening
2706         for wireless playback target availablity, unregister for those notifications while the controls
2707         are hidden due to playback, or when the element's document is hidden.
2708
2709         * Modules/mediacontrols/mediaControlsiOS.js:
2710         (ControllerIOS.prototype.createBase): Register for document visiblity change notfications.
2711         (ControllerIOS.prototype.setControlsType): Call updateShouldListenForPlaybackTargetAvailabilityEvent()
2712             instead of setShouldListenForPlaybackTargetAvailabilityEvent()
2713         (ControllerIOS.prototype.hideControls): Ditto.
2714         (ControllerIOS.prototype.showControls): Ditto.
2715         (ControllerIOS.prototype.updateStatusDisplay): Ditto.
2716         (ControllerIOS.prototype.handleVisibilityChange): Ditto.
2717         (ControllerIOS.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent): Added. Only listen
2718             for target availability when the video has no errors, is not in the initial "big play button"
2719             controls state, and when the controls are not hidden.
2720         * platform/audio/ios/MediaSessionManagerIOS.mm:
2721         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Explicitly set the discoveryMode to "disabled"
2722             rather than waiting for the autoreleasepool to destroy our routing controller.
2723
2724 2014-10-13  Simon Fraser  <simon.fraser@apple.com>
2725
2726         iOS DRT snapshots are limited to the page visible area
2727         https://bugs.webkit.org/show_bug.cgi?id=137650
2728
2729         Reviewed by Daniel Bates.
2730
2731         LegacyTileCache drawing was limited to the window's visible area, found by
2732         crawling up the layer hierarchy to the root layer. This caused test snapshots to
2733         be missing non-composited content outside the iPhone visible area, which hinders
2734         testing.
2735         
2736         Fix by adding a test-only mode where the window visible area is the entire window.
2737
2738         * platform/ios/wak/WAKWindow.h:
2739         * platform/ios/wak/WAKWindow.mm:
2740         (-[WAKWindow setEntireWindowVisibleForTesting:]):
2741         (-[WAKWindow _visibleRectRespectingMasksToBounds:]):
2742
2743 2014-10-13  Mihnea Ovidenie  <mihnea@adobe.com>
2744
2745         [CSSRegions] Make RenderNamedFlowFragment::computeStyleInRegion const
2746         https://bugs.webkit.org/show_bug.cgi?id=137604
2747
2748         Reviewed by Andrei Bucur.
2749
2750         The method computeStyleInRegion should be const as it does not modify
2751         the state of the RenderNamedFlowFragment instance. Make pointers to
2752         the region used for styling const along the way. No new tests as no
2753         change in functionality.
2754
2755         * css/ElementRuleCollector.h:
2756         (WebCore::ElementRuleCollector::ElementRuleCollector):
2757         (WebCore::ElementRuleCollector::setRegionForStyling):
2758         * css/StyleResolver.cpp:
2759         (WebCore::StyleResolver::State::initForStyleResolve):
2760         (WebCore::StyleResolver::styleForElement):
2761         * css/StyleResolver.h:
2762         * rendering/RenderNamedFlowFragment.cpp:
2763         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
2764         * rendering/RenderNamedFlowFragment.h:
2765
2766 2014-09-30  Sergio Villar Senin  <svillar@igalia.com>
2767
2768         [CSS Grid Layout] Pass the valid set of tracks to grow beyond growth limits
2769         https://bugs.webkit.org/show_bug.cgi?id=137253
2770
2771         Reviewed by Darin Adler.
2772
2773         Section 10.4 of the specs describe how to resolve content based
2774         track sizing functions. Among others it describes the "distribute
2775         extra space" algorithm. The 3rd bullet of that algorithm specifies
2776         how to distribute (and also the target tracks) the extra space
2777         once all the tracks have reached their growth limits.
2778
2779         Our implementation had 2 problems. First we were not passing a
2780         valid subset of tracks (instead we were always using all of
2781         them). Now we use a function that filters the right tracks to be
2782         the target of the extra space distribution depending on whether
2783         we're computing the min track function or the max track function.
2784
2785         Secondly the algorithm that was distributing the extra space was
2786         not using that list of passed in tracks (it iterated over all of
2787         them). From now on it will use the set of tracks selected using
2788         the filter function described above.
2789
2790         * rendering/RenderGrid.cpp:
2791         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
2792         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2793         (WebCore::RenderGrid::distributeSpaceToTracks):
2794         * rendering/RenderGrid.h:
2795         * rendering/style/GridTrackSize.h:
2796         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth):
2797         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth):
2798
2799 2014-10-12  Mike West  <mkwst@chromium.org>
2800
2801         Referrer Policy: Update <meta name="referrer"> values to match the spec
2802         https://bugs.webkit.org/show_bug.cgi?id=137635
2803
2804         Reviewed by Jochen Eisinger.
2805
2806         The Referrer Policy specification ([Working Draft][WD], [Editor's
2807         draft[ED]) defines different keywords than we originally
2808         implemented. We should support them in the interests of clarity and
2809         interoperability with other browsers implementing the specification.
2810
2811         [WD]: http://www.w3.org/TR/referrer-policy/#referrer-policy-delivery-meta
2812         [ED]: http://w3c.github.io/webappsec/specs/referrer-policy/#referrer-policy-delivery-meta
2813
2814         This patch is a port of Blink's https://codereview.chromium.org/607433002/
2815
2816         Tests: http/tests/security/referrer-policy-conflicting-policies.html
2817                http/tests/security/referrer-policy-https-no-referrer-when-downgrade.html
2818                http/tests/security/referrer-policy-https-no-referrer.html
2819                http/tests/security/referrer-policy-https-unsafe-url.html
2820                http/tests/security/referrer-policy-no-referrer-when-downgrade.html
2821                http/tests/security/referrer-policy-no-referrer.html
2822
2823         * dom/Document.cpp:
2824         (WebCore::Document::processReferrerPolicy):
2825
2826 2014-10-12  Dhi Aurrahman  <diorahman@rockybars.com>
2827
2828         Support activation behavior of link element
2829         https://bugs.webkit.org/show_bug.cgi?id=137597
2830
2831         Reviewed by Benjamin Poulain.
2832
2833         Support activation behavior of link elements as defined in [1],
2834         i.e. to follow the hyperlink created by the link element when it is fully active.
2835
2836         [1] https://html.spec.whatwg.org/multipage/semantics.html#the-link-element
2837
2838         Tests: fast/dom/html-link-element-activation-behavior-on-element-click.html
2839                fast/dom/html-link-element-activation-behavior-on-mouse-click.html
2840                fast/dom/html-link-element-activation-behavior-url-is-null.html
2841
2842         * dom/MouseEvent.cpp:
2843         (WebCore::MouseEvent::triggerActivationBehavior):
2844         * dom/MouseEvent.h:
2845         * html/HTMLAnchorElement.cpp:
2846         (WebCore::HTMLAnchorElement::defaultEventHandler):
2847         (WebCore::isLinkClick): Deleted.
2848         * html/HTMLAnchorElement.h:
2849         * html/HTMLLinkElement.cpp:
2850         (WebCore::HTMLLinkElement::defaultEventHandler):
2851         (WebCore::HTMLLinkElement::handleClick):
2852         * html/HTMLLinkElement.h:
2853         * svg/SVGAElement.cpp:
2854         (WebCore::SVGAElement::defaultEventHandler):
2855
2856 2014-10-11  KwangHyuk Kim  <hyuki.kim@samsung.com>
2857
2858         [EFL] Enable WebP support.
2859         https://bugs.webkit.org/show_bug.cgi?id=136156
2860
2861         Reviewed by Gyuyoung Kim.
2862
2863         Add WebP library and inlcude path to WebCore path for WK2 Efl.
2864         No new tests since existing feature is just enabled for WK2 Efl.
2865
2866         * PlatformEfl.cmake:
2867
2868 2014-10-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2869
2870         [GLIB] Split GMainLoopSource moving thread safe implementation to its own class GThreadSafeMainLoopSource
2871         https://bugs.webkit.org/show_bug.cgi?id=137485
2872
2873         Reviewed by Sergio Villar Senin.
2874
2875         Use GThreadSafeMainLoopSource for GStreamer sources, since they
2876         can be used from different threads. Also update GMutexLocker
2877         usages, since it's now a template.
2878
2879         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
2880         (WebCore::AudioFileReader::createBus):
2881         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
2882         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2883         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2884         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
2885         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2886         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2887         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2888         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
2889         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2890         (webkitVideoSinkTimeoutCallback):
2891         (webkitVideoSinkRender):
2892         (unlockBufferMutex):
2893         (webkitVideoSinkUnlockStop):
2894         (webkitVideoSinkStart):
2895         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
2896         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2897         (webKitWebSrcGetProperty):
2898         (webKitWebSrcStop):
2899         (webKitWebSrcStart):
2900         (webKitWebSrcChangeState):
2901         (webKitWebSrcQueryWithParent):
2902         (webKitWebSrcGetUri):
2903         (webKitWebSrcSetUri):
2904         (webKitWebSrcNeedDataMainCb):
2905         (webKitWebSrcNeedDataCb):
2906         (webKitWebSrcEnoughDataMainCb):
2907         (webKitWebSrcEnoughDataCb):
2908         (webKitWebSrcSeekDataCb):
2909         (webKitWebSrcSetMediaPlayer):
2910         (StreamingClient::createReadBuffer):
2911         (StreamingClient::handleResponseReceived):
2912         (StreamingClient::handleDataReceived):
2913         (StreamingClient::handleNotifyFinished):
2914         (ResourceHandleStreamingClient::wasBlocked):
2915         (ResourceHandleStreamingClient::cannotShowURL):
2916
2917 2014-10-10  Chris Dumez  <cdumez@apple.com>
2918
2919         Use is<>() / downcast<>() for Image subclasses
2920         https://bugs.webkit.org/show_bug.cgi?id=137625
2921
2922         Reviewed by Andreas Kling.
2923
2924         Use is<>() / downcast<>() for Image subclasses.
2925
2926         No new tests, no behavior change.
2927
2928         * accessibility/AccessibilityRenderObject.cpp:
2929         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
2930         * loader/cache/CachedImage.cpp:
2931         (WebCore::CachedImage::imageSizeForRenderer):
2932         (WebCore::CachedImage::createImage):
2933         * platform/graphics/BitmapImage.h:
2934         * platform/graphics/Image.h:
2935         * platform/mac/DragImageMac.mm:
2936         (WebCore::createDragImageFromImage):
2937         * rendering/RenderImage.cpp:
2938         (WebCore::RenderImage::embeddedContentBox):
2939         * svg/graphics/SVGImage.h:
2940
2941 2014-10-10  Chris Dumez  <cdumez@apple.com>
2942
2943         Use is<>() / downcast<>() for RenderElement
2944         https://bugs.webkit.org/show_bug.cgi?id=137622
2945
2946         Reviewed by Benjamin Poulain.
2947
2948         Use is<>() / downcast<>() for RenderElement and clean up the
2949         surrounding code.
2950
2951         No new tests, no behavior change.
2952
2953         * accessibility/AccessibilityImageMapLink.cpp:
2954         (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
2955         * accessibility/AccessibilityRenderObject.cpp:
2956         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2957         * css/CSSComputedStyleDeclaration.cpp:
2958         (WebCore::computeRenderStyleForProperty):
2959         * dom/Node.cpp:
2960         (WebCore::Node::materializeRareData):
2961         * dom/Position.cpp:
2962         (WebCore::isNonTextLeafChild):
2963         (WebCore::searchAheadForBetterMatch):
2964         * dom/PseudoElement.cpp:
2965         (WebCore::PseudoElement::didRecalcStyle):
2966         * editing/CompositeEditCommand.cpp:
2967         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2968         * editing/htmlediting.cpp:
2969         (WebCore::isEmptyTableCell):
2970         * rendering/InlineIterator.h:
2971         (WebCore::bidiNextShared):
2972         * rendering/RenderBlock.cpp:
2973         (WebCore::RenderBlock::getFirstLetter):
2974         * rendering/RenderBox.cpp:
2975         (WebCore::RenderBox::layout):
2976         * rendering/RenderCounter.cpp:
2977         (WebCore::RenderCounter::rendererRemovedFromTree):
2978         (WebCore::RenderCounter::rendererSubtreeAttached):
2979         (showCounterRendererTree):
2980         * rendering/RenderElement.cpp:
2981         (WebCore::RenderElement::insertChildInternal):
2982         (WebCore::RenderElement::removeChildInternal):
2983         (WebCore::RenderElement::findNextLayer):
2984         (WebCore::RenderElement::layout):
2985         * rendering/RenderElement.h:
2986         (WebCore::RenderObject::isRenderLayerModelObject):
2987         (WebCore::RenderObject::isBoxModelObject):
2988         (WebCore::RenderObject::isRenderBlock):
2989         (WebCore::RenderObject::isRenderBlockFlow):
2990         (WebCore::RenderObject::isRenderReplaced):
2991         (WebCore::RenderObject::isRenderInline):
2992         (WebCore::RenderObject::style):
2993         (WebCore::RenderObject::firstLineStyle):
2994         (WebCore::ContainerNode::renderer):
2995         * rendering/RenderFrameSet.cpp:
2996         (WebCore::RenderFrameSet::paint):
2997         * rendering/RenderLayer.cpp:
2998         (WebCore::RenderLayer::calculateClipRects):
2999         * rendering/RenderNamedFlowFragment.cpp:
3000         (WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
3001         (WebCore::RenderNamedFlowFragment::setObjectStyleInRegion):
3002         (WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle):
3003         * rendering/RenderObject.cpp:
3004         (WebCore::RenderObject::clearNeedsLayout):
3005         (WebCore::RenderObject::willBeDestroyed):
3006         (WebCore::RenderObject::collectAnnotatedRegions):
3007         * rendering/RenderVTTCue.cpp:
3008         (WebCore::RenderVTTCue::initializeLayoutParameters):
3009         (WebCore::RenderVTTCue::repositionGenericCue):
3010         * rendering/mathml/RenderMathMLFraction.cpp:
3011         (WebCore::RenderMathMLFraction::addChild):
3012         * rendering/mathml/RenderMathMLMenclose.cpp:
3013         (WebCore::RenderMathMLMenclose::addChild):
3014         * rendering/mathml/RenderMathMLOperator.cpp:
3015         (WebCore::RenderMathMLOperator::rebuildTokenContent):
3016         (WebCore::RenderMathMLOperator::updateStyle):
3017         * rendering/mathml/RenderMathMLRoot.cpp:
3018         (WebCore::RenderMathMLRoot::addChild):
3019         (WebCore::RenderMathMLRoot::layout):
3020         * rendering/mathml/RenderMathMLToken.cpp:
3021         (WebCore::RenderMathMLToken::addChild):
3022         (WebCore::RenderMathMLToken::updateTokenContent):
3023         (WebCore::RenderMathMLToken::updateStyle):
3024         * rendering/mathml/RenderMathMLUnderOver.cpp:
3025         (WebCore::RenderMathMLUnderOver::layout):
3026         * rendering/svg/RenderSVGResource.cpp:
3027         (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
3028         * rendering/svg/RenderSVGText.cpp:
3029         (WebCore::findPreviousAndNextAttributes):
3030         (WebCore::RenderSVGText::subtreeStyleDidChange):
3031         (WebCore::updateFontInAllDescendants):
3032         * rendering/svg/SVGRenderSupport.cpp:
3033         (WebCore::SVGRenderSupport::layoutChildren):
3034         * rendering/svg/SVGResourcesCache.cpp:
3035         (WebCore::SVGResourcesCache::clientWasAddedToTree):
3036         (WebCore::SVGResourcesCache::clientWillBeRemovedFromTree):
3037         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
3038         (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer):
3039         (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree):
3040         (WebCore::SVGTextLayoutAttributesBuilder::rebuildMetricsForTextRenderer):
3041         * rendering/svg/SVGTextLayoutAttributesBuilder.h:
3042         * rendering/svg/SVGTextMetricsBuilder.cpp:
3043         (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
3044         (WebCore::SVGTextMetricsBuilder::measureTextRenderer):
3045         (WebCore::SVGTextMetricsBuilder::walkTree):
3046         (WebCore::SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes):
3047         * rendering/svg/SVGTextMetricsBuilder.h:
3048         * rendering/svg/SVGTextRunRenderingContext.cpp:
3049         (WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator):
3050         (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
3051         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
3052         * svg/SVGFontData.cpp:
3053         (WebCore::SVGFontData::applySVGGlyphSelection):
3054
3055 2014-10-10  Benjamin Poulain  <benjamin@webkit.org>
3056
3057         Update :nth-child(An+B of selector-list) to the latest specification
3058         https://bugs.webkit.org/show_bug.cgi?id=137593
3059
3060         Reviewed by Andreas Kling.
3061
3062         Following my implementation feedback on :nth-child(An+B of selector-list),
3063         the CSS WG decided to change the definition such that the current element on which
3064         the selector is matched must also match the selector list in :nth-child().
3065
3066         This patch updates the implementation accordingly.
3067
3068         Test: fast/selectors/nth-child-of-chained-3.html
3069
3070         * css/SelectorChecker.cpp:
3071         (WebCore::SelectorChecker::checkOne):
3072         (WebCore::SelectorChecker::matchSelectorList):
3073         * css/SelectorChecker.h:
3074         * cssjit/SelectorCompiler.cpp:
3075         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
3076         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
3077
3078 2014-10-10  Chris Dumez  <cdumez@apple.com>
3079
3080         Drop RENDER_OBJECT_TYPE_CASTS() for a lot of RenderObject subclasses
3081         https://bugs.webkit.org/show_bug.cgi?id=137594
3082
3083         Reviewed by Darin Adler.
3084
3085         Drop RENDER_OBJECT_TYPE_CASTS() for RenderObject subclasses that no
3086         longer needed it or that required very few changes to do so. This will
3087         make sure developers start using is<>() / downcast<>() for those
3088         classes.
3089
3090         No new tests, no behavior change.
3091
3092         * accessibility/AccessibilityRenderObject.cpp:
3093         (WebCore::AccessibilityRenderObject::textUnderElement):
3094         (WebCore::AccessibilityRenderObject::stringValue):
3095         (WebCore::AccessibilityRenderObject::titleUIElement):
3096         * dom/PseudoElement.cpp:
3097         (WebCore::PseudoElement::didAttachRenderers):
3098         * html/HTMLCanvasElement.cpp:
3099         (WebCore::HTMLCanvasElement::reset):
3100         * html/HTMLPlugInElement.cpp:
3101         (WebCore::HTMLPlugInElement::defaultEventHandler):
3102         * html/HTMLPlugInImageElement.cpp:
3103         (WebCore::HTMLPlugInImageElement::updateSnapshot):
3104         (WebCore::HTMLPlugInImageElement::checkSnapshotStatus):
3105         * html/SearchInputType.cpp:
3106         (WebCore::SearchInputType::addSearchResult):
3107         (WebCore::SearchInputType::didSetValueByUserEdit):
3108         * html/shadow/TextControlInnerElements.cpp:
3109         (WebCore::TextControlInnerTextElement::renderer):
3110         (WebCore::TextControlInnerTextElement::customStyleForRenderer):
3111         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
3112         * page/FrameView.cpp:
3113         (WebCore::FrameView::isInChildFrameWithFrameFlattening):
3114         * rendering/RenderButton.h:
3115         * rendering/RenderCounter.h:
3116         * rendering/RenderDetailsMarker.h:
3117         * rendering/RenderFieldset.h:
3118         * rendering/RenderFileUploadControl.cpp:
3119         (WebCore::RenderFileUploadControl::paintObject):
3120         * rendering/RenderFileUploadControl.h:
3121         * rendering/RenderFlexibleBox.h:
3122         * rendering/RenderFullScreen.h:
3123         * rendering/RenderGrid.h:
3124         * rendering/RenderHTMLCanvas.h:
3125         * rendering/RenderIFrame.h:
3126         * rendering/RenderLayerBacking.cpp:
3127         (WebCore::RenderLayerBacking::contentsBox):
3128         * rendering/RenderMedia.h:
3129         * rendering/RenderQuote.cpp:
3130         (WebCore::RenderQuote::attachQuote):
3131         * rendering/RenderQuote.h:
3132         * rendering/RenderReplaced.h:
3133         * rendering/RenderScrollbarPart.h:
3134         * rendering/RenderSearchField.h:
3135         * rendering/RenderSnapshottedPlugIn.h:
3136         * rendering/RenderTableCaption.h:
3137         * rendering/RenderTextControlMultiLine.h:
3138         * rendering/RenderTextControlSingleLine.h:
3139         * rendering/RenderThemeMac.mm:
3140         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
3141         * rendering/RenderTreeAsText.cpp:
3142         (WebCore::RenderTreeAsText::writeRenderObject):
3143         * rendering/RenderVideo.cpp:
3144         (WebCore::rendererPlaceholder):
3145         * rendering/line/BreakingContextInlineHeaders.h:
3146         (WebCore::updateCounterIfNeeded):
3147         * rendering/svg/RenderSVGContainer.h:
3148         * rendering/svg/RenderSVGGradientStop.h:
3149         * rendering/svg/RenderSVGModelObject.h:
3150         * rendering/svg/RenderSVGPath.h:
3151         * rendering/svg/RenderSVGResourceFilter.h:
3152         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
3153         (WebCore::RenderSVGResourceFilterPrimitive::styleDidChange):
3154         * rendering/svg/RenderSVGTextPath.h:
3155         * rendering/svg/RenderSVGTransformableContainer.h:
3156         * rendering/svg/RenderSVGViewportContainer.h:
3157         * rendering/svg/SVGRenderSupport.cpp:
3158         (WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow):
3159         (WebCore::SVGRenderSupport::checkForSVGRepaintDuringLayout):
3160         (WebCore::updateObjectBoundingBox):
3161         (WebCore::layoutSizeOfNearestViewportChanged):
3162         (WebCore::SVGRenderSupport::transformToRootChanged):
3163         (WebCore::SVGRenderSupport::rendererHasSVGShadow):
3164         (WebCore::SVGRenderSupport::setRendererHasSVGShadow):
3165         * rendering/svg/SVGTextLayoutEngine.cpp:
3166         (WebCore::SVGTextLayoutEngine::beginTextPathLayout):
3167         * svg/SVGPathElement.cpp:
3168         (WebCore::SVGPathElement::svgAttributeChanged):
3169         (WebCore::SVGPathElement::pathSegListChanged):
3170         (WebCore::SVGPathElement::getBBox):
3171         * svg/SVGSVGElement.cpp:
3172         (WebCore::SVGSVGElement::currentViewportSize):
3173
3174 2014-10-10  Chris Dumez  <cdumez@apple.com>
3175
3176         Use is<>() / downcast<>() for GraphicsLayer subclasses
3177         https://bugs.webkit.org/show_bug.cgi?id=137595
3178
3179         Reviewed by Darin Adler.
3180
3181         Use is<>() / downcast<>() for GraphicsLayer subclasses and clean up the
3182         surrounding code.
3183
3184         No new tests, no behavior change.
3185
3186         * page/mac/ServicesOverlayController.mm:
3187         (WebCore::ServicesOverlayController::Highlight::Highlight):
3188         (WebCore::ServicesOverlayController::Highlight::fadeIn):
3189         (WebCore::ServicesOverlayController::Highlight::fadeOut):
3190         * platform/graphics/GraphicsLayer.h:
3191         * platform/graphics/ca/GraphicsLayerCA.cpp:
3192         (WebCore::GraphicsLayerCA::removeFromParent):
3193         (WebCore::GraphicsLayerCA::setMaskLayer):
3194         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush):
3195         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
3196         (WebCore::GraphicsLayerCA::updateSublayerList):
3197         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
3198         (WebCore::GraphicsLayerCA::updateMaskLayer):
3199         (WebCore::GraphicsLayerCA::replicatedLayerRoot):
3200         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
3201         (WebCore::GraphicsLayerCA::propagateLayerChangeToReplicas):
3202         (WebCore::GraphicsLayerCA::fetchCloneLayers):
3203         * platform/graphics/ca/GraphicsLayerCA.h:
3204
3205 2014-10-10  Chris Dumez  <cdumez@apple.com>
3206
3207         Use is<>() / downcast<>() for RenderBoxModelObject
3208         https://bugs.webkit.org/show_bug.cgi?id=137587
3209
3210         Reviewed by Mihnea Ovidenie.
3211
3212         Use is<>() / downcast<>() for RenderBoxModelObject and clean up the
3213         surrounding code.
3214
3215         No new tests, no behavior change.
3216
3217         * accessibility/AXObjectCache.cpp:
3218         (WebCore::createFromRenderer):
3219         * accessibility/AccessibilityRenderObject.cpp:
3220         (WebCore::AccessibilityRenderObject::renderBoxModelObject):
3221         (WebCore::isInlineWithContinuation):
3222         (WebCore::firstChildConsideringContinuation):
3223         (WebCore::lastChildHasContinuation):
3224         (WebCore::AccessibilityRenderObject::nextSibling):
3225         (WebCore::AccessibilityRenderObject::widget):
3226         (WebCore::AccessibilityRenderObject::renderObjectIsObservable):
3227         (WebCore::AccessibilityRenderObject::observableObject):
3228         (WebCore::msaaRoleForRenderer):
3229         * accessibility/AccessibilityRenderObject.h:
3230         * accessibility/AccessibilityTable.cpp:
3231         (WebCore::AccessibilityTable::isDataTable):
3232         * dom/Node.cpp:
3233         (WebCore::Node::renderBox):
3234         (WebCore::Node::renderBoxModelObject):
3235         * inspector/InspectorOverlay.cpp:
3236         (WebCore::buildObjectForElementInfo):
3237         * page/FrameView.cpp:
3238         (WebCore::FrameView::scrollContentsFastPath):
3239         * page/PrintContext.cpp:
3240         (WebCore::enclosingBoxModelObject):
3241         * page/animation/AnimationBase.cpp:
3242         (WebCore::AnimationBase::freezeAtTime):
3243         * page/animation/ImplicitAnimation.cpp:
3244         (WebCore::ImplicitAnimation::startAnimation):
3245         (WebCore::ImplicitAnimation::pauseAnimation):
3246         (WebCore::ImplicitAnimation::endAnimation):
3247         * page/animation/KeyframeAnimation.cpp:
3248         (WebCore::KeyframeAnimation::startAnimation):
3249         (WebCore::KeyframeAnimation::pauseAnimation):
3250         (WebCore::KeyframeAnimation::endAnimation):
3251         * page/ios/FrameIOS.mm:
3252         (WebCore::Frame::overflowScrollPositionChangedForNode):
3253         * page/scrolling/ScrollingCoordinator.cpp:
3254         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
3255         * rendering/InlineBox.h:
3256         (WebCore::InlineBox::boxModelObject):
3257         * rendering/InlineElementBox.h:
3258         (WebCore::InlineElementBox::renderer):
3259         * rendering/InlineFlowBox.cpp:
3260         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
3261         * rendering/InlineFlowBox.h:
3262         (WebCore::InlineFlowBox::renderer):
3263         * rendering/InlineTextBox.cpp:
3264         (WebCore::InlineTextBox::baselinePosition):
3265         (WebCore::InlineTextBox::lineHeight):
3266         * rendering/RenderBlock.cpp:
3267         (WebCore::RenderBlock::addChildToContinuation):
3268         * rendering/RenderBox.cpp:
3269         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
3270         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
3271         (WebCore::RenderBox::computePositionedLogicalWidth):
3272         (WebCore::RenderBox::computePositionedLogicalHeight):
3273         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
3274         (WebCore::RenderBox::computePositionedLogicalHeightReplaced):
3275         * rendering/RenderBoxModelObject.h:
3276         * rendering/RenderFlowThread.cpp:
3277         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
3278         * rendering/RenderInline.cpp:
3279         (WebCore::RenderInline::splitInlines):
3280         (WebCore::RenderInline::addChildToContinuation):
3281         * rendering/RenderLayer.cpp:
3282         (WebCore::RenderLayer::updateLayerPosition):
3283         (WebCore::RenderLayer::calculateClipRects):
3284         * rendering/RenderLayerBacking.cpp:
3285         (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread):
3286         * rendering/RenderLayerCompositor.cpp:
3287         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason):
3288         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints):
3289         * rendering/RenderObject.cpp:
3290         (WebCore::RenderObject::destroy):
3291         (WebCore::RenderObject::offsetParent):
3292         * rendering/mathml/RenderMathMLScripts.cpp:
3293         (WebCore::RenderMathMLScripts::base):
3294
3295 2014-10-10  Zan Dobersek  <zdobersek@igalia.com>
3296
3297         Remove CrossThreadTask
3298         https://bugs.webkit.org/show_bug.cgi?id=137570
3299
3300         Reviewed by Darin Adler.
3301
3302         Replace uses of CrossThreadTask with C++11 lambdas. The initializations
3303         of cross-thread copies are rather verbose at the moment, but should look
3304         better once we can switch to using C++14 init capture for lambdas.
3305
3306         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3307         (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize):
3308         * WebCore.order:
3309         * WebCore.vcxproj/WebCore.vcxproj:
3310         * WebCore.vcxproj/WebCore.vcxproj.filters:
3311         * WebCore.xcodeproj/project.pbxproj:
3312         * dom/CrossThreadTask.h: Removed.
3313         * loader/WorkerThreadableLoader.cpp:
3314         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
3315         (WebCore::WorkerThreadableLoader::MainThreadBridge::destroy):
3316         (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel):
3317         (WebCore::WorkerThreadableLoader::MainThreadBridge::didSendData):
3318         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
3319         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData):
3320         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
3321         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
3322         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck):
3323         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck):
3324         (WebCore::WorkerThreadableLoader::MainThreadBridge::~MainThreadBridge): Deleted.
3325         (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCreateLoader): Deleted.
3326         (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadDestroy): Deleted.
3327         (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCancel): Deleted.
3328         (WebCore::workerGlobalScopeDidSendData): Deleted.
3329         (WebCore::workerGlobalScopeDidReceiveResponse): Deleted.
3330         (WebCore::workerGlobalScopeDidReceiveData): Deleted.
3331         (WebCore::workerGlobalScopeDidFinishLoading): Deleted.
3332         (WebCore::workerGlobalScopeDidFail): Deleted.
3333         (WebCore::workerGlobalScopeDidFailAccessControlCheck): Deleted.
3334         (WebCore::workerGlobalScopeDidFailRedirectCheck): Deleted.
3335         * loader/WorkerThreadableLoader.h:
3336         * loader/cache/MemoryCache.cpp:
3337         (WebCore::MemoryCache::removeRequestFromCache):
3338         (WebCore::MemoryCache::removeRequestFromSessionCaches):
3339         (WebCore::MemoryCache::removeRequestFromCacheImpl): Deleted.
3340         (WebCore::MemoryCache::removeRequestFromSessionCachesImpl): Deleted.
3341         (WebCore::MemoryCache::crossThreadRemoveRequestFromCache): Deleted.
3342         (WebCore::MemoryCache::crossThreadRemoveRequestFromSessionCaches): Deleted.
3343         * loader/cache/MemoryCache.h:
3344
3345 2014-10-10  Zan Dobersek  <zdobersek@igalia.com>
3346
3347         Avoid defaulting to capture-by-value for C++11 lambdas in WebCore
3348         https://bugs.webkit.org/show_bug.cgi?id=137565
3349
3350         Reviewed by Darin Adler.
3351
3352         C++11 lambas should avoid defaulting to capturing used variables by value as that
3353         can lead to unintended captures that, in worst cases, result in lambdas that are
3354         not self-contained and end up operating on dangling pointers.
3355
3356         Explicitly stating the variables that are to be copied by value can also serve as
3357         a checklist of variables that are actually intented for use in the lambda body. 
3358
3359         * Modules/quota/StorageErrorCallback.cpp:
3360         (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
3361         * Modules/webdatabase/Database.cpp:
3362         (WebCore::Database::~Database):
3363         (WebCore::Database::runTransaction):
3364         (WebCore::Database::scheduleTransactionCallback):
3365         * Modules/webdatabase/DatabaseManager.cpp:
3366         (WebCore::DatabaseManager::openDatabase):
3367         * Modules/webdatabase/SQLCallbackWrapper.h:
3368         (WebCore::SQLCallbackWrapper::clear):
3369         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
3370         (WebCore::ThreadableWebSocketChannelClientWrapper::didConnect):
3371         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessage):
3372         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
3373         (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount):
3374         (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
3375         (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
3376         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError):
3377         (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
3378         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3379         (WebCore::WorkerThreadableWebSocketChannel::Peer::send):
3380         (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
3381         (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
3382         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage):
3383         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
3384         (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
3385         (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
3386         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
3387         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
3388         (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
3389         (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
3390         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
3391         (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
3392         (WebCore::WorkerThreadableWebSocketChannel::Bridge::close):
3393         (WebCore::WorkerThreadableWebSocketChannel::Bridge::fail):
3394         (WebCore::WorkerThreadableWebSocketChannel::Bridge::disconnect):
3395         (WebCore::WorkerThreadableWebSocketChannel::Bridge::suspend):
3396         (WebCore::WorkerThreadableWebSocketChannel::Bridge::resume):
3397         * bindings/js/JSCallbackData.h:
3398         (WebCore::DeleteCallbackDataTask::DeleteCallbackDataTask):
3399         * bindings/js/JSDOMGlobalObjectTask.cpp:
3400         (WebCore::JSGlobalObjectTask::JSGlobalObjectTask):
3401         * dom/ScriptExecutionContext.h:
3402         (WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
3403         * dom/StringCallback.cpp:
3404         (WebCore::StringCallback::scheduleCallback):
3405         * fileapi/FileReader.cpp:
3406         (WebCore::FileReader::abort):
3407         * loader/appcache/ApplicationCacheGroup.cpp:
3408         (WebCore::ApplicationCacheGroup::postListenerTask):
3409         * workers/DefaultSharedWorkerRepository.cpp:
3410         (WebCore::SharedWorkerProxy::postExceptionToWorkerObject):
3411         (WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject):
3412         (WebCore::SharedWorkerConnectTask::SharedWorkerConnectTask):
3413         * workers/WorkerEventQueue.cpp:
3414         (WebCore::WorkerEventQueue::enqueueEvent):
3415         * workers/WorkerMessagingProxy.cpp:
3416         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
3417         (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
3418         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
3419         (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
3420         (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
3421         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
3422         (WebCore::WorkerMessagingProxy::confirmMessageFromWorkerObject):
3423         (WebCore::WorkerMessagingProxy::reportPendingActivity):
3424
3425 2014-10-10  Zan Dobersek  <zdobersek@igalia.com>
3426
3427         Remove MainThreadTask
3428         https://bugs.webkit.org/show_bug.cgi?id=137563
3429
3430         Reviewed by Darin Adler.
3431
3432         Replace the remaining uses of MainThreadTask with C++11 lambdas.
3433         Remove the MainThreadTask header from the build.
3434
3435         * WebCore.order:
3436         * WebCore.vcxproj/WebCore.vcxproj:
3437         * WebCore.vcxproj/WebCore.vcxproj.filters:
3438         * WebCore.xcodeproj/project.pbxproj:
3439         * platform/MainThreadTask.h: Removed.
3440         * platform/network/curl/CurlDownload.cpp: