[Media] Reduce style updates (painting) in controls
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-10-15  Dean Jackson  <dino@apple.com>
2
3         [Media] Reduce style updates (painting) in controls
4         https://bugs.webkit.org/show_bug.cgi?id=137763
5         <rdar://problem/17833045>
6
7         Reviewed by Simon Fraser.
8
9         Media controls were causing a lot of repaints they were
10         constantly updating the style of the widgets, the value
11         of the forms, or the text in the display.
12
13         This is necessary when the controls are visible, but not
14         necessary when they are hidden. Return immediately in that case.
15
16         * Modules/mediacontrols/mediaControlsApple.js:
17         (Controller.prototype.createControls): Initialise the slider to a zero value.
18         (Controller.prototype.handleDurationChange): Force an update even though we might be hidden.
19         (Controller.prototype.updateProgress): Don't update if we're hidden.
20         (Controller.prototype.updateTime): Ditto.
21         * Modules/mediacontrols/mediaControlsiOS.js:
22         (ControllerIOS.prototype.updateProgress): Ditto.
23
24 2014-10-15  Chris Dumez  <cdumez@apple.com>
25
26         [Mac] Fix inefficiencies in ResourceResponse::platformLazyInit(InitLevel) - Part 2
27         https://bugs.webkit.org/show_bug.cgi?id=137721
28
29         Reviewed by Darin Adler.
30
31         Follow-up patch to r174717 addressing review comments made after the patch landed:
32         - Use modern C++ loop
33         - Remove explicit calls to String(NSString*) constructor
34
35         No new tests, no new tests.
36
37         * platform/network/mac/ResourceResponseMac.mm:
38         (WebCore::ResourceResponse::platformLazyInit):
39
40 2014-10-15  Chris Dumez  <cdumez@apple.com>
41
42         Use is<>() / downcast<>() for InlineBox subclasses
43         https://bugs.webkit.org/show_bug.cgi?id=137749
44
45         Reviewed by Darin Adler.
46
47         Use is<>() / downcast<>() for InlineBox subclasses and clean up the
48         surrounding code.
49
50         No new tests, no behavior change.
51
52         * dom/Position.cpp:
53         (WebCore::Position::upstream):
54         (WebCore::Position::downstream):
55         * editing/VisibleUnits.cpp:
56         (WebCore::wordBreakIteratorForMinOffsetBoundary):
57         (WebCore::wordBreakIteratorForMaxOffsetBoundary):
58         (WebCore::visualWordPosition):
59         (WebCore::startPositionForLine):
60         (WebCore::endPositionForLine):
61         * rendering/InlineBox.cpp:
62         (WebCore::InlineBox::root):
63         (WebCore::InlineBox::nextLeafChild):
64         (WebCore::InlineBox::prevLeafChild):
65         (WebCore::InlineBox::nextLeafChildIgnoringLineBreak):
66         * rendering/InlineBox.h:
67         * rendering/InlineElementBox.h:
68         * rendering/InlineFlowBox.cpp:
69         (WebCore::InlineFlowBox::getFlowSpacingLogicalWidth):
70         (WebCore::InlineFlowBox::addToLine):
71         (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
72         (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection):
73         (WebCore::InlineFlowBox::requiresIdeographicBaseline):
74         (WebCore::InlineFlowBox::adjustMaxAscentAndDescent):
75         (WebCore::InlineFlowBox::computeLogicalBoxHeights):
76         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
77         (WebCore::InlineFlowBox::computeMaxLogicalTop):
78         (WebCore::InlineFlowBox::flipLinesInBlockDirection):
79         (WebCore::InlineFlowBox::computeOverflow):
80         (WebCore::InlineFlowBox::firstLeafChild):
81         (WebCore::InlineFlowBox::lastLeafChild):
82         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment):
83         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment):
84         * rendering/InlineFlowBox.h:
85         * rendering/InlineTextBox.h:
86         * rendering/RenderBlockFlow.cpp:
87         (WebCore::RenderBlockFlow::positionForBox):
88         * rendering/RenderBlockFlow.h:
89         (WebCore::RenderBlockFlow::firstRootBox):
90         (WebCore::RenderBlockFlow::lastRootBox):
91         * rendering/RenderBlockLineLayout.cpp:
92         (WebCore::RenderBlockFlow::createLineBoxes):
93         (WebCore::RenderBlockFlow::constructLine):
94         (WebCore::setLogicalWidthForTextRun):
95         (WebCore::computeExpansionForJustifiedText):
96         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
97         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine):
98         (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns):
99         * rendering/RenderText.cpp:
100         (WebCore::RenderText::localCaretRect):
101         * rendering/RootInlineBox.cpp:
102         (WebCore::RootInlineBox::isHyphenated):
103         (WebCore::RootInlineBox::ascentAndDescentForBox):
104         * rendering/RootInlineBox.h:
105         (WebCore::RootInlineBox::nextRootBox):
106         (WebCore::RootInlineBox::prevRootBox):
107         * rendering/svg/RenderSVGInlineText.cpp:
108         (WebCore::RenderSVGInlineText::localCaretRect):
109         (WebCore::RenderSVGInlineText::positionForPoint):
110         * rendering/svg/RenderSVGText.cpp:
111         (WebCore::RenderSVGText::positionForPoint):
112         * rendering/svg/SVGInlineFlowBox.cpp:
113         (WebCore::SVGInlineFlowBox::paintSelectionBackground):
114         (WebCore::SVGInlineFlowBox::paint):
115         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
116         * rendering/svg/SVGInlineFlowBox.h:
117         * rendering/svg/SVGInlineTextBox.h:
118         * rendering/svg/SVGRenderTreeAsText.cpp:
119         (WebCore::writeRenderSVGTextBox):
120         (WebCore::writeSVGInlineTextBoxes):
121         * rendering/svg/SVGRootInlineBox.cpp:
122         (WebCore::SVGRootInlineBox::paint):
123         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes):
124         (WebCore::SVGRootInlineBox::layoutChildBoxes):
125         (WebCore::reverseInlineBoxRangeAndValueListsIfNeeded):
126         * rendering/svg/SVGRootInlineBox.h:
127         * rendering/svg/SVGTextQuery.cpp:
128         (WebCore::SVGTextQuery::collectTextBoxesInFlowBox):
129
130 2014-10-15  Roger Fong  <roger_fong@apple.com>
131
132         glReadPixels on NVIDIA cards returns the wrong values for the alpha channel when alpha is off.
133         https://bugs.webkit.org/show_bug.cgi?id=137752.
134         <rdar://problem/15408133>
135
136         Reviewed by Brent Fulgham.
137
138         This change fixed the 1.0.2 conformance test: context/context-attribute-preserve-drawing-buffer.html
139
140         * platform/graphics/GraphicsContext3D.h:
141         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
142         Manually set the alpha channel to 255 when alpha is off on the rendering context.
143
144 2014-10-13  Chris Fleizach  <cfleizach@apple.com>
145
146         AX: Going back is broken for VoiceOver
147         https://bugs.webkit.org/show_bug.cgi?id=137382
148
149         Reviewed by Darin Adler.
150
151         There were two issues preventing VoiceOver from navigating when using page history to go back/forward.
152           1) Existing AXLoadComplete does not get fired when you just move through page history. 
153                There were existing frameLoad notifications used by GTK. I think we should use those which seem more reliable.
154           2) The AccessibilityScrollView cached its children, but on some history page loads, that cache was never cleared out.
155                Rather than trying to find those places to clear out the cache, it's easier to just add the elements to the children
156                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.
157
158         Tests are not possible since they require monitoring notifications across multiple page loads.
159
160         * accessibility/AXObjectCache.h:
161         * accessibility/AccessibilityScrollView.cpp:
162         (WebCore::AccessibilityScrollView::updateChildrenIfNecessary):
163         * accessibility/ios/AXObjectCacheIOS.mm:
164         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
165         * accessibility/mac/AXObjectCacheMac.mm:
166         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
167         * dom/Document.cpp:
168         (WebCore::Document::implicitClose):
169
170 2014-10-15  Simon Fraser  <simon.fraser@apple.com>
171
172         Sometimes can't scroll overflow:scroll areas in subframes
173         https://bugs.webkit.org/show_bug.cgi?id=137746
174         rdar://problem/18603560
175
176         Reviewed by Tim Horton.
177         
178         r169733 introduced a regression which caused us to no longer update the non-fast
179         scrollable region on every layout in subframes, by adding a bogus isMainFrame() check.
180         Revert to the previous code.
181
182         Test: platform/mac-wk2/tiled-drawing/scrolling/frames/scroll-region-after-frame-layout.html
183
184         * page/scrolling/AsyncScrollingCoordinator.cpp:
185         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
186
187 2014-10-15  Chris Dumez  <cdumez@apple.com>
188
189         Use is<>() / downcast<>() for TransformOperation subclasses
190         https://bugs.webkit.org/show_bug.cgi?id=137731
191
192         Reviewed by Darin Adler.
193
194         Use is<>() / downcast<>() for TransformOperation subclasses and clean
195         up the surrounding code.
196
197         No new tests, no behavior change.
198
199         * platform/graphics/GraphicsLayer.cpp:
200         (WebCore::GraphicsLayer::validateTransformOperations):
201         * platform/graphics/ca/GraphicsLayerCA.cpp:
202         (WebCore::getTransformFunctionValue):
203         * platform/graphics/transforms/IdentityTransformOperation.h:
204         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
205         (WebCore::Matrix3DTransformOperation::operator==):
206         * platform/graphics/transforms/Matrix3DTransformOperation.h:
207         * platform/graphics/transforms/MatrixTransformOperation.cpp:
208         (WebCore::MatrixTransformOperation::operator==):
209         (WebCore::MatrixTransformOperation::blend):
210         * platform/graphics/transforms/MatrixTransformOperation.h:
211         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
212         (WebCore::PerspectiveTransformOperation::operator==):
213         (WebCore::PerspectiveTransformOperation::blend):
214         * platform/graphics/transforms/PerspectiveTransformOperation.h:
215         * platform/graphics/transforms/RotateTransformOperation.cpp:
216         (WebCore::RotateTransformOperation::operator==):
217         (WebCore::RotateTransformOperation::blend):
218         * platform/graphics/transforms/RotateTransformOperation.h:
219         * platform/graphics/transforms/ScaleTransformOperation.cpp:
220         (WebCore::ScaleTransformOperation::operator==):
221         (WebCore::ScaleTransformOperation::blend):
222         * platform/graphics/transforms/ScaleTransformOperation.h:
223         * platform/graphics/transforms/SkewTransformOperation.cpp:
224         (WebCore::SkewTransformOperation::operator==):
225         (WebCore::SkewTransformOperation::blend):
226         * platform/graphics/transforms/SkewTransformOperation.h:
227         * platform/graphics/transforms/TransformOperation.h:
228         * platform/graphics/transforms/TranslateTransformOperation.cpp:
229         (WebCore::TranslateTransformOperation::operator==):
230         (WebCore::TranslateTransformOperation::blend):
231         * platform/graphics/transforms/TranslateTransformOperation.h:
232
233 2014-10-15  Chris Dumez  <cdumez@apple.com>
234
235         Use is<>() / downcast<>() for RenderTextControl / RenderTextControlSingleLine
236         https://bugs.webkit.org/show_bug.cgi?id=137727
237
238         Reviewed by Darin Adler.
239
240         Use is<>() / downcast<>() for RenderTextControl / RenderTextControlSingleLine.
241
242         No new tests, no behavior change.
243
244         * accessibility/AccessibilityRenderObject.cpp:
245         (WebCore::AccessibilityRenderObject::selectedText):
246         (WebCore::AccessibilityRenderObject::selectedTextRange):
247         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
248         (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
249         (WebCore::AccessibilityRenderObject::indexForVisiblePosition):
250         * editing/TextIterator.cpp:
251         (WebCore::TextIterator::handleReplacedElement):
252         * html/TextFieldInputType.cpp:
253         (WebCore::TextFieldInputType::forwardEvent):
254         * html/shadow/TextControlInnerElements.cpp:
255         (WebCore::TextControlInnerElement::customStyleForRenderer):
256         * page/EventHandler.cpp:
257         (WebCore::EventHandler::capsLockStateMayHaveChanged):
258         * page/ios/FrameIOS.mm:
259         (WebCore::ancestorRespondingToScrollWheelEvents):
260         * rendering/RenderTextControl.h:
261         * rendering/RenderTextControlSingleLine.h:
262         * rendering/SimpleLineLayout.cpp:
263         (WebCore::SimpleLineLayout::canUseFor):
264
265 2014-10-15  Chris Dumez  <cdumez@apple.com>
266
267         Use is<>() / downcast<>() for ClipPathOperation subclasses
268         https://bugs.webkit.org/show_bug.cgi?id=137733
269
270         Reviewed by Mihnea Ovidenie.
271
272         Use is<>() / downcast<>() for ClipPathOperation subclasses.
273
274         No new tests, no behavior change.
275
276         * css/CSSComputedStyleDeclaration.cpp:
277         (WebCore::ComputedStyleExtractor::propertyValue):
278         * css/DeprecatedStyleBuilder.cpp:
279         (WebCore::ApplyPropertyClipPath::applyValue):
280         * rendering/ClipPathOperation.h:
281         * rendering/RenderBlock.cpp:
282         (WebCore::RenderBlock::nodeAtPoint):
283         * rendering/RenderLayer.cpp:
284         (WebCore::RenderLayer::setupClipPath):
285         * rendering/svg/SVGRenderingContext.cpp:
286         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
287
288 2014-10-15  Chris Dumez  <cdumez@apple.com>
289
290         [Mac] Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable()
291         https://bugs.webkit.org/show_bug.cgi?id=137723
292
293         Reviewed by Simon Fraser.
294
295         Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable() instead
296         of CFDictionaryGetValue() as we are not actually interested in the
297         value.
298
299         No new tests, no behavior change.
300
301         * platform/graphics/cg/ImageSourceCG.cpp:
302         (WebCore::ImageSource::isSizeAvailable):
303
304 2014-10-15  Mihnea Ovidenie  <mihnea@adobe.com>
305
306         Use modern loops in subtrees selection code
307         https://bugs.webkit.org/show_bug.cgi?id=137688
308
309         Reviewed by Andreas Kling.
310
311         No new tests as no change in functionality.
312
313         * rendering/RenderView.cpp:
314         (WebCore::RenderView::splitSelectionBetweenSubtrees):
315         (WebCore::RenderView::updateSelectionForSubtrees):
316         (WebCore::RenderView::clearSubtreeSelection):
317         (WebCore::RenderView::applySubtreeSelection):
318         * rendering/RenderView.h:
319
320 2014-10-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
321
322         Clean up unnecessary PassOwnPtr.h inclusion
323         https://bugs.webkit.org/show_bug.cgi?id=137726
324
325         Reviewed by Chris Dumez.
326
327         No new tests, no behavior changes.
328
329         * dom/Document.h: Remove PassOwnPtr.h inclusion.
330         * loader/ResourceBuffer.h: ditto.
331         * loader/cocoa/DiskCacheMonitorCocoa.mm: ditto.
332         * page/scrolling/AxisScrollSnapOffsets.h: ditto.
333         * page/scrolling/ScrollingStateScrollingNode.h: ditto.
334         * platform/ColorChooserClient.h: ditto.
335         * platform/ScrollableArea.cpp: ditto.
336         * platform/ScrollbarThemeClient.h: ditto.
337         * platform/SharedBuffer.cpp: ditto.
338         * platform/Supplementable.h: ditto.
339         * platform/graphics/surfaces/GraphicsSurface.h: ditto.
340         * platform/graphics/surfaces/GraphicsSurfaceToken.h: ditto.
341         * platform/graphics/win/WKCAImageQueue.cpp: ditto.
342         * platform/win/CursorWin.cpp: ditto.
343
344 2014-10-14  Chris Dumez  <cdumez@apple.com>
345
346         Have offsetFromContainer() / offsetFromAncestorContainer() take a RenderElement&
347         https://bugs.webkit.org/show_bug.cgi?id=137728
348
349         Reviewed by Benjamin Poulain.
350
351         Have offsetFromContainer() / offsetFromAncestorContainer() take a RenderElement&
352         instead of a RenderObject*. The argument passed is never null and the type
353         should be a RenderElement as the argument is a container.
354
355         No new tests, no behavior change.
356
357         * editing/htmlediting.cpp:
358         (WebCore::localCaretRectInRendererForCaretPainting):
359         * page/GestureTapHighlighter.cpp:
360         * rendering/RenderBox.cpp:
361         (WebCore::RenderBox::mapLocalToContainer):
362         (WebCore::RenderBox::pushMappingToContainer):
363         (WebCore::RenderBox::offsetFromContainer):
364         (WebCore::RenderBox::computeRectForRepaint):
365         * rendering/RenderBox.h:
366         * rendering/RenderBoxModelObject.cpp:
367         (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
368         * rendering/RenderInline.cpp:
369         (WebCore::RenderInline::computeRectForRepaint):
370         (WebCore::RenderInline::offsetFromContainer):
371         (WebCore::RenderInline::mapLocalToContainer):
372         (WebCore::RenderInline::pushMappingToContainer):
373         * rendering/RenderInline.h:
374         * rendering/RenderMultiColumnFlowThread.cpp:
375         (WebCore::RenderMultiColumnFlowThread::offsetFromContainer):
376         * rendering/RenderMultiColumnFlowThread.h:
377         * rendering/RenderNamedFlowFragment.cpp:
378         (WebCore::RenderNamedFlowFragment::offsetFromContainer):
379         * rendering/RenderNamedFlowFragment.h:
380         * rendering/RenderObject.cpp:
381         (WebCore::RenderObject::offsetFromContainer):
382         (WebCore::RenderObject::offsetFromAncestorContainer):
383         * rendering/RenderObject.h:
384         * rendering/RenderTableCell.cpp:
385         (WebCore::RenderTableCell::offsetFromContainer):
386         * rendering/RenderTableCell.h:
387         * rendering/RenderThemeMac.mm:
388         (WebCore::RenderThemeMac::convertToPaintingRect):
389
390 2014-10-14  Jer Noble  <jer.noble@apple.com>
391
392         REGRESSION (r159208): Crash when clicking scrubber after navigating away/back to video
393         https://bugs.webkit.org/show_bug.cgi?id=137715
394
395         Reviewed by Darin Adler.
396
397         Simple null-check of m_player in refreshCachedTime.
398
399         * html/HTMLMediaElement.cpp:
400         (WebCore::HTMLMediaElement::refreshCachedTime):
401
402 2014-10-14  Chris Dumez  <cdumez@apple.com>
403
404         [Mac] Fix inefficiencies in ResourceResponse::platformLazyInit(InitLevel)
405         https://bugs.webkit.org/show_bug.cgi?id=137721
406
407         Reviewed by Geoffrey Garen.
408
409         There were several inefficiencies with the Mac implementation of
410         ResourceResponse::platformLazyInit(InitLevel):
411         1. We end up initializing uncommon fields even if called with
412            'CommonFieldsOnly' initLevel.
413         2. If called with 'AllFields' initLevel (and if currently
414            uninitialized), we end up populating m_httpHeaderFields twice, once
415            with only the common headers, then a second time with ALL the
416            headers. We can skip the common-header case in this case to avoid
417            wasting CPU time.
418
419         This patch addresses both inefficiencies and cleans up the code a
420         little bit to reduce variable scope and to use fast enumeration of
421         header names.
422
423         As a result, we spend almost twice as little time in platformLazyInit()
424         when loading msn.com (~30ms -> ~18ms).
425
426         No new tests, no behavior change.
427
428         * platform/network/mac/ResourceResponseMac.mm:
429         (WebCore::ResourceResponse::platformLazyInit):
430
431 2014-10-14  Zalan Bujtas  <zalan@apple.com>
432
433         REGRESSION (Safari 7.1/8.0): Border-radius and overflow hidden renders incorrectly.
434         https://bugs.webkit.org/show_bug.cgi?id=137205
435
436         Reviewed by Simon Fraser.
437
438         Child layer should not reset radius clipping behaviour.
439
440         Test: fast/layers/parent-clipping-overflow-is-overwritten-by-child-clipping.html
441
442         * rendering/RenderLayer.cpp:
443         (WebCore::RenderLayer::calculateClipRects):
444
445 2014-10-14  Chris Dumez  <cdumez@apple.com>
446
447         Use is<>() / downcast<>() for PlatformCAAnimation subclasses
448         https://bugs.webkit.org/show_bug.cgi?id=137722
449
450         Reviewed by Simon Fraser.
451
452         Use is<>() / downcast<>() for PlatformCAAnimation subclasses and clean
453         up the surrounding code.
454
455         No new tests, no behavior change.
456
457         * page/mac/ServicesOverlayController.mm:
458         (WebCore::ServicesOverlayController::Highlight::fadeIn):
459         (WebCore::ServicesOverlayController::Highlight::fadeOut):
460         * platform/graphics/ca/GraphicsLayerCA.cpp:
461         (WebCore::GraphicsLayerCA::moveOrCopyLayerAnimation):
462         (WebCore::GraphicsLayerCA::updateAnimations):
463         (WebCore::GraphicsLayerCA::setAnimationOnLayer):
464         (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
465         * platform/graphics/ca/GraphicsLayerCA.h:
466         * platform/graphics/ca/PlatformCAAnimation.h:
467         * platform/graphics/ca/PlatformCALayer.h:
468         * platform/graphics/ca/mac/PlatformCAAnimationMac.h:
469         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
470         (PlatformCAAnimationMac::copy):
471         (PlatformCAAnimationMac::copyTimingFunctionFrom):
472         (PlatformCAAnimationMac::copyFromValueFrom):
473         (PlatformCAAnimationMac::copyToValueFrom):
474         (PlatformCAAnimationMac::copyValuesFrom):
475         (PlatformCAAnimationMac::copyKeyTimesFrom):
476         (PlatformCAAnimationMac::copyTimingFunctionsFrom):
477         * platform/graphics/ca/mac/PlatformCALayerMac.h:
478         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
479         (PlatformCALayerMac::addAnimationForKey):
480         * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
481         (PlatformCAAnimationWin::copy):
482         (PlatformCAAnimationWin::copyTimingFunctionFrom):
483         (PlatformCAAnimationWin::copyFromValueFrom):
484         (PlatformCAAnimationWin::copyToValueFrom):
485         (PlatformCAAnimationWin::copyValuesFrom):
486         (PlatformCAAnimationWin::copyKeyTimesFrom):
487         (PlatformCAAnimationWin::copyTimingFunctionsFrom):
488         * platform/graphics/ca/win/PlatformCAAnimationWin.h:
489         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
490         (PlatformCALayerWin::addAnimationForKey):
491         * platform/graphics/ca/win/PlatformCALayerWin.h:
492
493 2014-10-14  Chris Dumez  <cdumez@apple.com>
494
495         Use is<>() / downcast<>() for RenderInline
496         https://bugs.webkit.org/show_bug.cgi?id=137704
497
498         Reviewed by Darin Adler.
499
500         Use is<>() / downcast<>() for RenderInline and clean up the surrounding
501         code.
502
503         No new tests, no behavior change.
504
505         * accessibility/AccessibilityRenderObject.cpp:
506         (WebCore::firstChildInContinuation):
507         * editing/SimplifyMarkupCommand.cpp:
508         (WebCore::SimplifyMarkupCommand::doApply):
509         * inspector/InspectorOverlay.cpp:
510         (WebCore::buildRendererHighlight):
511         * page/FrameView.cpp:
512         (WebCore::FrameView::paintContents):
513         * rendering/InlineFlowBox.cpp:
514         (WebCore::InlineFlowBox::removeLineBoxFromRenderObject):
515         (WebCore::InlineFlowBox::extractLineBoxFromRenderObject):
516         (WebCore::InlineFlowBox::attachLineBoxToRenderObject):
517         (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
518         (WebCore::InlineFlowBox::nodeAtPoint):
519         (WebCore::InlineFlowBox::paint):
520         * rendering/InlineIterator.h:
521         (WebCore::bidiFirstSkippingEmptyInlines):
522         * rendering/LayoutState.cpp:
523         (WebCore::LayoutState::LayoutState):
524         * rendering/RenderBlock.cpp:
525         (WebCore::RenderBlock::willBeDestroyed):
526         (WebCore::RenderBlock::paintObject):
527         (WebCore::RenderBlock::inlineElementContinuation):
528         (WebCore::RenderBlock::addFocusRingRects):
529         * rendering/RenderBlockFlow.cpp:
530         (WebCore::RenderBlockFlow::willBeDestroyed):
531         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
532         * rendering/RenderBlockFlow.h:
533         * rendering/RenderBlockLineLayout.cpp:
534         (WebCore::constructBidiRunsForSegment):
535         (WebCore::RenderBlockFlow::layoutLineBoxes):
536         * rendering/RenderBox.cpp:
537         (WebCore::RenderBox::offsetFromContainer):
538         (WebCore::RenderBox::computeRectForRepaint):
539         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
540         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
541         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
542         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
543         (WebCore::RenderBox::layoutOverflowRectForPropagation):
544         * rendering/RenderBoxModelObject.cpp:
545         (WebCore::accumulateInFlowPositionOffsets):
546         * rendering/RenderElement.cpp:
547         (WebCore::RenderElement::willBeRemovedFromTree):
548         * rendering/RenderElement.h:
549         (WebCore::RenderElement::dirtyLinesFromChangedChild):
550         * rendering/RenderFlowThread.cpp:
551         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
552         * rendering/RenderInline.cpp:
553         (WebCore::RenderInline::willBeDestroyed):
554         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
555         (WebCore::RenderInline::clippedOverflowRectForRepaint):
556         * rendering/RenderInline.h:
557         * rendering/RenderLayer.cpp:
558         (WebCore::RenderLayer::updateLayerPosition):
559         (WebCore::RenderLayer::calculateClipRects):
560         * rendering/RenderLineBoxList.cpp:
561         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
562         * rendering/RenderLineBoxList.h:
563         * rendering/RenderNamedFlowThread.cpp:
564         (WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):
565         * rendering/RenderObject.cpp:
566         (WebCore::RenderObject::insertedIntoTree):
567         * rendering/RenderRegion.cpp:
568         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
569         (WebCore::RenderRegion::visualOverflowRectForBox):
570         (WebCore::RenderRegion::visualOverflowRectForBoxForPropagation):
571         * rendering/RenderRegion.h:
572         * rendering/RenderReplaced.cpp:
573         (WebCore::RenderReplaced::willBeDestroyed):
574         * rendering/RenderTextLineBoxes.cpp:
575         (WebCore::RenderTextLineBoxes::removeAllFromParent):
576         (WebCore::RenderTextLineBoxes::dirtyRange):
577         * rendering/line/BreakingContextInlineHeaders.h:
578         (WebCore::inlineLogicalWidth):
579         (WebCore::BreakingContext::handleEmptyInline):
580         * rendering/line/LineInlineHeaders.h:
581         (WebCore::requiresLineBox):
582         (WebCore::setStaticPositions):
583         * rendering/svg/SVGInlineTextBox.cpp:
584         (WebCore::SVGInlineTextBox::paint):
585
586 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
587
588         [Win] Unreviewed build fix after r174710.
589
590         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
591         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
592
593 2014-10-14  Dan Bernstein  <mitz@apple.com>
594
595         URLs that start with http:/// and https:/// lose two slashes when parsed, causing assertion failure and inconsistent behavior
596         https://bugs.webkit.org/show_bug.cgi?id=137718
597
598         Reviewed by Alexey Proskuryakov.
599
600         Added cases to fast/loader/url-parse-1.html.
601
602         * platform/URL.cpp:
603         (WebCore::URL::parse): In hierarchical schemes other than file:, ignore any additional
604         slashes after the ://, as prescribed by the authority-ignore-slashes state in the current
605         URL spec.
606
607 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
608
609         [Win] Unreviewed build fix after r174698 and r174709.
610
611         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
612         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
613         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
614         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
615         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
616         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
617
618 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
619
620         [Win] Unreviewed build fix after r174698
621
622         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
623         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
624         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
625         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
626
627 2014-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
628
629         Improve debug description of WAKViews
630         https://bugs.webkit.org/show_bug.cgi?id=137716
631
632         Reviewed by Simon Fraser.
633
634         No new tests because there is no behavior change.
635
636         * platform/ios/wak/WAKView.mm:
637         (-[WAKView description]):
638         * platform/ios/wak/WKView.h:
639         * platform/ios/wak/WKView.mm:
640         (WKViewGetOrigin):
641
642 2014-10-14  Chris Dumez  <cdumez@apple.com>
643
644         Introduce an isCSSAnimated flag on RenderElement for performance
645         https://bugs.webkit.org/show_bug.cgi?id=137583
646
647         Reviewed by Simon Fraser.
648
649         I noticed when profiling the ebay.com page load that isRunningAnimationOnRenderer()
650         and isRunningAcceleratedAnimationOnRenderer() were called frequently, causing
651         ~4.7 millions m_compositeAnimations HashMap lookups.
652
653         This patch introduces an isCSSAnimated flag on RenderElement to return early if
654         there is no animation on the renderer, thus avoiding HashMap lookups. This reduces
655         the number of HashMap lookups from ~4.7 millions to ~68k. On my machine, I see
656         the following performance improvements:
657         - isRunning*AnimationOnRenderer() / computeCompositingRequirements()
658           - before: ~45ms  / ~90ms
659           - after:  ~4ms / ~30ms
660
661         No new tests, no behavior change.
662
663         * page/animation/AnimationController.cpp:
664         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
665         (WebCore::AnimationControllerPrivate::clear):
666         (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer):
667         (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
668         (WebCore::AnimationController::isRunningAnimationOnRenderer):
669         (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer):
670         * rendering/RenderElement.cpp:
671         (WebCore::RenderElement::RenderElement):
672         * rendering/RenderElement.h:
673         (WebCore::RenderElement::isCSSAnimating):
674         (WebCore::RenderElement::setIsCSSAnimating):
675
676 2014-10-14  Dean Jackson  <dino@apple.com>
677
678         Crash in WebCore::UserGestureIndicator::processingUserGesture with WebWorkers
679         https://bugs.webkit.org/show_bug.cgi?id=137676
680         <rdar://problem/15735049>
681
682         Reviewed by Alexey Proskuryakov.
683
684         Remove the code I added that tracks the timestamp of the most recent
685         user gesture from the event handling dispatch, as it was both
686         a silly place to do it and it originally crashed when events were fired from
687         Worker threads (although this was fixed in r152238).
688
689         It's now recorded by going through UserGestureIndicator, which is good because
690         it knows when a user has triggered an event. Its constructor now takes
691         a pointer to Document, and updates the timestamp there if necessary.
692
693         Not all UserGestureIndicator instances needed to reset the timestamp; Those did
694         not have to pass along the Document.
695
696         This is untestable due to the fix mentioned above.
697
698         * WebCore.exp.in: Change constructor signature.
699
700         * accessibility/AccessibilityNodeObject.cpp: Pass a pointer to the Document into the UserGestureIndicator.
701         (WebCore::AccessibilityNodeObject::increment):
702         (WebCore::AccessibilityNodeObject::decrement):
703         * accessibility/AccessibilityObject.cpp: Ditto.
704         (WebCore::AccessibilityObject::press):
705
706         * dom/Document.cpp:
707         (WebCore::Document::updateLastHandledUserGestureTimestamp): Renamed.
708         * dom/Document.h:
709
710         * dom/EventTarget.cpp: Remove the code to update the timestamp.
711         (WebCore::EventTarget::fireEventListeners):
712
713         * dom/UserGestureIndicator.cpp:
714         (WebCore::UserGestureIndicator::UserGestureIndicator): If there is a Document and
715         this is a user gesture, then reset the timestamp.
716         * dom/UserGestureIndicator.h:
717
718         * page/EventHandler.cpp: Pass a pointer to the Document.
719         (WebCore::EventHandler::handleMousePressEvent):
720         (WebCore::EventHandler::handleMouseDoubleClickEvent):
721         (WebCore::EventHandler::handleMouseReleaseEvent):
722         (WebCore::EventHandler::keyEvent):
723         (WebCore::EventHandler::handleTouchEvent):
724
725         * rendering/HitTestResult.cpp: Ditto.
726         (WebCore::HitTestResult::toggleMediaFullscreenState):
727         (WebCore::HitTestResult::enterFullscreenForVideo):
728
729 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
730
731         [Win] Unreviewed gardening. Ignore Visual Studio *.sdf files.
732
733         * WebCore.vcxproj: Modified property svn:ignore.
734
735 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
736
737         [Win] Enable Encrypted Media Support
738         https://bugs.webkit.org/show_bug.cgi?id=137710
739         <rdar://problem/18652699>
740
741         Reviewed by Jer Noble.
742
743         This feature is covered by existing media tests.
744
745         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
746         (WebCore::destroyAVFWrapper): Remove redundant ASSERT.
747         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
748         (displayOnMainThreadContext::displayOnMainThreadContext): Added.
749         (redispatchOnMainQueue): Added.
750         (PlatformCALayerWinInternal::displayCallback): Check if a display
751         call is happening on a background queue, and re-dispatch on the
752         main thread if necessary.
753
754 2014-10-14  Chris Dumez  <cdumez@apple.com>
755
756         [Mac] Avoid unnecessary dictionary lookup in ImageSource::isSizeAvailable()
757         https://bugs.webkit.org/show_bug.cgi?id=137701
758
759         Reviewed by Simon Fraser.
760
761         The CG implementation of ImageSource::isSizeAvailable() was looking up
762         both the width and the height keys in the dictionary before determining
763         if the size is available. We can abort early and return false if the
764         first key (the width) is missing, thus avoiding an extra dictionary
765         lookup in this case.
766
767         This is a small win but ImageSource::isSizeAvailable() is called quite
768         frequently during page loads
769
770         No new tests, no behavior change.
771
772         * platform/graphics/cg/ImageSourceCG.cpp:
773         (WebCore::ImageSource::isSizeAvailable):
774
775 2014-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
776
777         Remove unnecessary logging from SimpleFontData
778         https://bugs.webkit.org/show_bug.cgi?id=137699
779
780         Reviewed by Andreas Kling.
781
782         Because of web fonts, fonts that don't have a glyph page 0 are common and expected. Printing out a
783         message is not helpful, especially if you're not dealing with a font-related piece of WebKit.
784
785         No new tests because there is no behavior change.
786
787         * platform/graphics/SimpleFontData.cpp:
788         (WebCore::SimpleFontData::platformGlyphInit):
789
790 2014-10-14  Martin Hock  <mhock@apple.com>
791
792         Update ViewportConfiguration whenever its size attributes change
793         https://bugs.webkit.org/show_bug.cgi?id=137682
794         rdar://problem/18643655
795
796         Reviewed by Benjamin Poulain.
797
798         * page/ViewportConfiguration.cpp:
799         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
800         (WebCore::ViewportConfiguration::setMinimumLayoutSizeForMinimalUI):
801
802 2014-10-14  Joseph Pecoraro  <pecoraro@apple.com>
803
804         Web Inspector: Processing Instruction Nodes appear poorly in DOM Tree
805         https://bugs.webkit.org/show_bug.cgi?id=137681
806
807         Reviewed by Timothy Hatcher.
808
809         * inspector/InspectorDOMAgent.cpp:
810         (WebCore::InspectorDOMAgent::buildObjectForNode):
811         Include the nodeName, localName, and nodeValue (string data)
812         properties for processing instruction nodes.
813
814 2014-10-14  Chris Dumez  <cdumez@apple.com>
815
816         Use is<>() / downcast<>() for RenderFrame / RenderFrameSet
817         https://bugs.webkit.org/show_bug.cgi?id=137696
818
819         Reviewed by Darin Adler.
820
821         Use is<>() / downcast<>() for RenderFrame / RenderFrameSet.
822
823         No new tests, no behavior change.
824
825         * html/HTMLFrameSetElement.cpp:
826         (WebCore::HTMLFrameSetElement::defaultEventHandler):
827         * rendering/RenderFrame.cpp:
828         (WebCore::RenderFrame::updateFromElement):
829         * rendering/RenderFrame.h:
830         * rendering/RenderFrameSet.cpp:
831         (WebCore::RenderFrameSet::computeEdgeInfo):
832         (WebCore::RenderFrameSet::positionFramesWithFlattening):
833         * rendering/RenderFrameSet.h:
834
835 2014-10-14  Youenn Fablet  <youennf@gmail.com>
836
837         [XHR] Abort method execution when m_loader->cancel() in internalAbort() caused reentry
838         https://bugs.webkit.org/show_bug.cgi?id=126975
839
840         Reviewed by Alexey Proskuryakov.
841
842         Merging https://chromium.googlesource.com/chromium/blink/+/0d75daf2053631518606ae15daaece701a25b2c4
843         Ensuring new test from https://codereview.chromium.org/76133002/ is passing.
844
845         Test: http/tests/xmlhttprequest/reentrant-cancel-abort.html
846
847         * xml/XMLHttpRequest.cpp:
848         (WebCore::XMLHttpRequest::open): exit early if internalAbort asks so
849         (WebCore::XMLHttpRequest::abort): exit early if internalAbort asks so
850         (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)   
851         (WebCore::XMLHttpRequest::didTimeout): exit early if internalAbort asks so
852         * xml/XMLHttpRequest.h:
853
854 2014-10-14  Alejandro G. Castro  <alex@igalia.com>
855
856         Multiple refactors in RenderMathMLOperator
857         https://bugs.webkit.org/show_bug.cgi?id=137611
858
859         Reviewed by Darin Adler.
860
861         The changes include:
862         - Rename m_operator to m_textContent.
863         - Make most of the functions private, we needed to create some
864         public member functions to be able to make the some funtions private
865         and move trailingSpaceError to RenderMathMLOperator.
866         - Fix incorrect capitalization of setOperatorProperties function.
867         - Make all data members private and move them to the end of the
868         class defition.
869
870         No new tests as no change in functionality.
871
872         * rendering/mathml/RenderMathMLOperator.cpp:
873         (WebCore::RenderMathMLOperator::RenderMathMLOperator):
874         (WebCore::RenderMathMLOperator::setOperatorProperties): Renamed,
875         incorrect capitalization
876         (WebCore::RenderMathMLOperator::stretchTo):
877         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
878         (WebCore::RenderMathMLOperator::rebuildTokenContent):
879         (WebCore::RenderMathMLOperator::updateFromElement):
880         (WebCore::RenderMathMLOperator::updateOperatorProperties):
881         (WebCore::RenderMathMLOperator::shouldAllowStretching):
882         (WebCore::RenderMathMLOperator::updateStyle):
883         (WebCore::RenderMathMLOperator::trailingSpaceError):
884         (WebCore::RenderMathMLOperator::SetOperatorProperties): Deleted.
885         (WebCore::RenderMathMLOperator::advanceForGlyph): Deleted.
886         (WebCore::RenderMathMLOperator::updateTokenContent): Deleted.
887         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): Deleted.
888         * rendering/mathml/RenderMathMLOperator.h:
889         (WebCore::RenderMathMLOperator::setLeadingSpace): Added.
890         (WebCore::RenderMathMLOperator::setTrailingSpace):  Added.
891         (WebCore::RenderMathMLOperator::textContent): Added.
892         (WebCore::RenderMathMLOperator::isInvisibleOperator):
893         * rendering/mathml/RenderMathMLRadicalOperator.cpp:
894         (WebCore::RenderMathMLRadicalOperator::setOperatorProperties):
895         Renamed, incorrect capitalization
896         (WebCore::RenderMathMLRadicalOperator::SetOperatorProperties): Deleted.
897         (WebCore::RenderMathMLRadicalOperator::trailingSpaceError): Deleted.
898         * rendering/mathml/RenderMathMLRadicalOperator.h:
899
900 2014-10-14  Alejandro G. Castro  <alex@igalia.com>
901
902         Changes in the stretchy attribute do not update rendering
903         https://bugs.webkit.org/show_bug.cgi?id=136883
904
905         Reviewed by Darin Adler.
906
907         Test: mathml/presentation/mo-stretch-update.html
908
909         We need to relayout when a change in the stretchy attribute
910         happens.
911
912         * mathml/MathMLTextElement.cpp:
913         (WebCore::MathMLTextElement::parseAttribute): Parse the
914         modifications of the stretchy attribute.
915         * mathml/MathMLTextElement.h:
916         * rendering/mathml/RenderMathMLOperator.cpp:
917         (WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded):
918         Add function that receives the value instead of looking for it and
919         checks if the change should schedule a layout.
920         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
921         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue):
922         Add function that receives the value instead of looking for it.
923         * rendering/mathml/RenderMathMLOperator.h:
924
925 2014-10-14  Chris Dumez  <cdumez@apple.com>
926
927         Use is<>() / downcast<>() for RenderImage
928         https://bugs.webkit.org/show_bug.cgi?id=137683
929
930         Reviewed by Mihnea Ovidenie.
931
932         Use is<>() / downcast<>() for RenderImage.
933
934         No new tests, no behavior change.
935
936         * accessibility/AccessibilityNodeObject.cpp:
937         (WebCore::AccessibilityNodeObject::alternativeText):
938         * accessibility/AccessibilityRenderObject.cpp:
939         (WebCore::AccessibilityRenderObject::addImageMapChildren):
940         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
941         * bindings/objc/DOM.mm:
942         (-[DOMElement image]):
943         (-[DOMElement _imageTIFFRepresentation]):
944         * editing/TextIterator.cpp:
945         (WebCore::TextIterator::handleReplacedElement):
946         * editing/cocoa/HTMLConverter.mm:
947         (fileWrapperForElement):
948         * editing/gtk/EditorGtk.cpp:
949         (WebCore::getImageForElement):
950         * editing/ios/EditorIOS.mm:
951         (WebCore::getImage):
952         * editing/mac/EditorMac.mm:
953         (WebCore::getImage):
954         * html/HTMLAnchorElement.cpp:
955         (WebCore::appendServerMapMousePosition):
956         * html/HTMLAreaElement.cpp:
957         (WebCore::HTMLAreaElement::setFocus):
958         * html/HTMLImageElement.cpp:
959         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
960         (WebCore::HTMLImageElement::parseAttribute):
961         (WebCore::HTMLImageElement::didAttachRenderers):
962         (WebCore::HTMLImageElement::createImageControls):
963         (WebCore::HTMLImageElement::destroyImageControls):
964         * html/HTMLVideoElement.cpp:
965         (WebCore::HTMLVideoElement::didAttachRenderers):
966         (WebCore::HTMLVideoElement::parseAttribute):
967         * html/ImageInputType.cpp:
968         (WebCore::ImageInputType::altAttributeChanged):
969         (WebCore::ImageInputType::attach):
970         * html/canvas/CanvasRenderingContext2D.cpp:
971         (WebCore::size):
972         * html/shadow/mac/ImageControlsRootElementMac.cpp:
973         (WebCore::RenderImageControls::updateLogicalWidth):
974         (WebCore::RenderImageControls::computeLogicalHeight):
975         * loader/ImageLoader.cpp:
976         (WebCore::ImageLoader::renderImageResource):
977         * page/ContextMenuController.cpp:
978         (WebCore::imageFromImageElementNode):
979         * page/DragController.cpp:
980         (WebCore::getCachedImage):
981         (WebCore::getImage):
982         * platform/win/PasteboardWin.cpp:
983         (WebCore::Pasteboard::writeImage):
984         (WebCore::getCachedImage):
985         * rendering/HitTestResult.cpp:
986         (WebCore::HitTestResult::image):
987         * rendering/RenderImage.h:
988         * rendering/RenderImageResource.cpp:
989         (WebCore::RenderImageResource::getImageSize):
990         * rendering/RenderLayerBacking.cpp:
991         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
992         (WebCore::RenderLayerBacking::updateImageContents):
993         * rendering/RenderReplaced.cpp:
994         (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox):
995         * rendering/shapes/ShapeOutsideInfo.cpp:
996         (WebCore::ShapeOutsideInfo::createShapeForImage):
997
998 2014-10-14  Andrzej Badowski  <a.badowski@samsung.com>
999
1000         [AX] Improve AccessibilityTableCell columnHeaders and rowHeaders functions.
1001         https://bugs.webkit.org/show_bug.cgi?id=136818
1002
1003         Reviewed by Chris Fleizach.
1004
1005         Take into account that <th> elements can be both the column headers and row headers 
1006         improved the operation of two functions: columnHeaders and rowHeaders.
1007
1008         Test: accessibility/table-headers.html
1009
1010         * accessibility/AccessibilityTableCell.cpp:
1011         (WebCore::AccessibilityTableCell::isColumnHeaderCell):
1012         A new function that helps the main goal.
1013         (WebCore::AccessibilityTableCell::isRowHeaderCell):
1014         A new function that helps the main goal.
1015         (WebCore::AccessibilityTableCell::columnHeaders):
1016         Use isColumnHeaderCell instead of isTableHeaderCell.
1017         (WebCore::AccessibilityTableCell::rowHeaders):
1018         Use isRowHeaderCell also includes <th> row header element next to the scope attribute.
1019         * accessibility/AccessibilityTableCell.h:
1020         Adds new functions to the header file.
1021
1022 2014-10-14  Csaba Osztrogon√°c  <ossy@webkit.org>
1023
1024         Fix the !ENABLE(VIDEO) build after r174353
1025         https://bugs.webkit.org/show_bug.cgi?id=137655
1026
1027         Reviewed by Darin Adler.
1028
1029         * dom/Document.cpp:
1030         * dom/Document.h:
1031         * page/Page.cpp:
1032         * page/Page.h:
1033
1034 2014-10-14  peavo@outlook.com  <peavo@outlook.com>
1035
1036         [Curl] Compile error in CurlDownload.cpp.
1037         https://bugs.webkit.org/show_bug.cgi?id=137654
1038
1039         Reviewed by Philippe Normand.
1040
1041         A template specialization is not needed anymore.
1042
1043         * platform/network/curl/CurlDownload.cpp:
1044
1045 2014-10-13  Joseph Pecoraro  <pecoraro@apple.com>
1046
1047         Web Inspector: Remove unused stale Page protocol methods
1048         https://bugs.webkit.org/show_bug.cgi?id=137678
1049
1050         Reviewed by Andreas Kling.
1051
1052         * inspector/InspectorClient.h:
1053         (WebCore::InspectorClient::canShowDebugBorders): Deleted.
1054         (WebCore::InspectorClient::setShowDebugBorders): Deleted.
1055         (WebCore::InspectorClient::canShowFPSCounter): Deleted.
1056         (WebCore::InspectorClient::setShowFPSCounter): Deleted.
1057         (WebCore::InspectorClient::canContinuouslyPaint): Deleted.
1058         (WebCore::InspectorClient::setContinuousPaintingEnabled): Deleted.
1059         * inspector/InspectorPageAgent.cpp:
1060         (WebCore::InspectorPageAgent::disable):
1061         (WebCore::InspectorPageAgent::canShowDebugBorders): Deleted.
1062         (WebCore::InspectorPageAgent::setShowDebugBorders): Deleted.
1063         (WebCore::InspectorPageAgent::canShowFPSCounter): Deleted.
1064         (WebCore::InspectorPageAgent::setShowFPSCounter): Deleted.
1065         (WebCore::InspectorPageAgent::canContinuouslyPaint): Deleted.
1066         (WebCore::InspectorPageAgent::setContinuousPaintingEnabled): Deleted.
1067         * inspector/InspectorPageAgent.h:
1068         * inspector/protocol/Page.json:
1069
1070 2014-10-13  Eric Carlson  <eric.carlson@apple.com>
1071
1072         [iOS] Refactor AirPlay monitoring code
1073         https://bugs.webkit.org/show_bug.cgi?id=137645
1074         <rdar://problem/18444817>
1075
1076         Reviewed by Jer Noble.
1077
1078         Refactor AirPlay route change monitoring code:
1079         + Have MediaSessionManager register/unregister for route changes depending on the state of
1080             all sessions so it does the right thing when there is more than one media element.
1081         + Make HTMLMediaElement unregister with MediaSession as soon as the media player is cleared
1082             because there can be no wireless playback without a player.
1083
1084         * html/HTMLMediaElement.cpp:
1085         (WebCore::HTMLMediaElement::~HTMLMediaElement): Call mediaSession->setHasPlaybackTargetAvailabilityListeners
1086             when there are target availability changed listeners.
1087         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
1088         (WebCore::HTMLMediaElement::wirelessRoutesAvailableDidChange): New, media session client method.
1089         * html/HTMLMediaElement.h:
1090
1091         * html/HTMLMediaSession.cpp:
1092         (WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_hasPlaybackTargetAvailabilityListeners.
1093         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Remember whether or not
1094             the client has a target availability listener and tell the media session manager to reconfigure
1095             itself instead of telling it to start or stop listening for route changes so it does the 
1096             right thing when there is more than one media element.
1097         * html/HTMLMediaSession.h:
1098         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring): Return true when the client 
1099             has a target availability listener, false otherwise.
1100
1101         * platform/audio/MediaSession.cpp:
1102         (WebCore::MediaSession::wirelessRoutesAvailableDidChange): Inform the client that routes have changed.
1103         * platform/audio/MediaSession.h:
1104         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
1105         (WebCore::MediaSessionClient::wirelessRoutesAvailableDidChange):
1106
1107         * platform/audio/MediaSessionManager.cpp:
1108         (WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Implement it.
1109         * platform/audio/MediaSessionManager.h:
1110         (WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
1111         (WebCore::MediaSessionManager::hasWirelessTargetsAvailable):
1112         (WebCore::MediaSessionManager::sessions):
1113         (WebCore::MediaSessionManager::startMonitoringAirPlayRoutes): Deleted.
1114         (WebCore::MediaSessionManager::stopMonitoringAirPlayRoutes): Deleted.
1115
1116         * platform/audio/ios/MediaSessionManagerIOS.h:
1117         * platform/audio/ios/MediaSessionManagerIOS.mm:
1118         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): Start or stop monitoring
1119             for route changes depending on client state.
1120         (WebCore::MediaSessionManageriOS::startMonitoringAirPlayRoutes): Deleted.
1121         (WebCore::MediaSessionManageriOS::stopMonitoringAirPlayRoutes): Deleted.
1122
1123 2014-10-13  Chris Dumez  <cdumez@apple.com>
1124
1125         [Mac] Return value of createImageSourceOptions() is leaked in ImageSourceCG
1126         https://bugs.webkit.org/show_bug.cgi?id=137677
1127
1128         Reviewed by Simon Fraser.
1129
1130         The return value of createImageSourceOptions() was leaked in
1131         ImageSourceCG.cpp. It was returning a CFDictionaryRef created using
1132         CFDictionaryCreate(). Therefore, the return value should have been
1133         released but wasn't.
1134
1135         This patch makes createImageSourceOptions() return a
1136         RetainPtr<CFDictionaryRef> to make sure the CFDictionaryRef properly
1137         gets released after use.
1138
1139         No new tests, no behavior change.
1140
1141         * platform/graphics/cg/ImageSourceCG.cpp:
1142         (WebCore::createImageSourceOptions):
1143         (WebCore::imageSourceOptions):
1144         (WebCore::ImageSource::isSizeAvailable):
1145         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
1146         (WebCore::ImageSource::frameSizeAtIndex):
1147         (WebCore::ImageSource::orientationAtIndex):
1148         (WebCore::ImageSource::getHotSpot):
1149         (WebCore::ImageSource::repetitionCount):
1150         (WebCore::ImageSource::createFrameAtIndex):
1151         (WebCore::ImageSource::frameDurationAtIndex):
1152
1153 2014-10-13  Yusuke Suzuki  <utatane.tea@gmail.com>
1154
1155         CSS JIT: Implement :visited pseudo class
1156         https://bugs.webkit.org/show_bug.cgi?id=135293
1157
1158         Reviewed by Benjamin Poulain.
1159
1160         This patch implements CSS JIT for :visited. And it makes :not(:link) JIT-ed.
1161         Following the design discussed at the other bug[1], implemented :visited JIT
1162         without tracking VisitedMatchEnabled state.
1163
1164         In this patch, we change the semantics of :visited / :link
1165         inside functional pseudo classes for further CSS Selector Level 4 extensions.
1166
1167         Edge cases are tested by the existing tests.
1168         :not(:link)
1169             fast/history/link-inside-not.html
1170         :not(:visited)
1171             fast/history/visited-inside-not.html
1172         :-webkit-any(:link)
1173             fast/history/link-inside-any.html
1174         :-webkit-any(:visited)
1175             fast/history/visited-inside-any.html
1176
1177         [1]: https://bugs.webkit.org/show_bug.cgi?id=135639
1178
1179         Test: fast/history/link-inside-not-inside-any.html
1180             To cover the :-webkit-any(:not(:link)), added new tests.
1181
1182         * css/SelectorChecker.cpp:
1183         (WebCore::SelectorChecker::checkOne):
1184         * cssjit/SelectorCompiler.cpp:
1185         (WebCore::SelectorCompiler::addPseudoClassType):
1186         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
1187         (WebCore::SelectorCompiler::constructFragments):
1188         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1189         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
1190         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRightmostTreeWalker):
1191         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1192         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
1193         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstLink):
1194         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateStoreLastVisitedElement):
1195
1196 2014-10-13  Chris Dumez  <cdumez@apple.com>
1197
1198         Use modern loops in RenderLayerCompositor
1199         https://bugs.webkit.org/show_bug.cgi?id=137670
1200
1201         Reviewed by Simon Fraser.
1202
1203         Use modern range for-loops in RenderLayerCompositor.
1204
1205         No new tests, no behavior change.
1206
1207         * rendering/RenderLayerCompositor.cpp:
1208         (WebCore::OverlapMapContainer::overlapsLayers):
1209         (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects):
1210         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
1211         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
1212         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
1213         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
1214         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1215         (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
1216         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed):
1217         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1218         (WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree):
1219         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
1220         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
1221         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
1222         (WebCore::resetTrackedRepaintRectsRecursive):
1223         (WebCore::RenderLayerCompositor::layerHas3DContent):
1224         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
1225         (WebCore::RenderLayerCompositor::registerAllScrollingLayers):
1226         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
1227
1228 2014-10-13  Chris Dumez  <cdumez@apple.com>
1229
1230         Drop unnecessary overlapMap null checks in computeCompositingRequirements()
1231         https://bugs.webkit.org/show_bug.cgi?id=137668
1232
1233         Reviewed by Andreas Kling.
1234
1235         Drop unnecessary overlapMap null checks in computeCompositingRequirements().
1236         The function is never called with a null overlapMap so we can make the
1237         argument a reference and drop all the null checks.
1238
1239         No new tests, no behavior change.
1240
1241         * rendering/RenderLayerCompositor.cpp:
1242         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1243         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
1244         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1245         (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
1246         * rendering/RenderLayerCompositor.h:
1247
1248 2014-10-13  Chris Dumez  <cdumez@apple.com>
1249
1250         Use is<>() / downcast<>() for PlatformCALayer subclasses
1251         https://bugs.webkit.org/show_bug.cgi?id=137661
1252
1253         Reviewed by Simon Fraser.
1254
1255         Use is<>() / downcast<>() for PlatformCALayer subclasses and clean up
1256         the surrounding code.
1257
1258         No new tests, no behavior change.
1259
1260         * platform/graphics/ca/GraphicsLayerCA.cpp:
1261         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
1262         (WebCore::GraphicsLayerCA::updateContentsRects):
1263         (WebCore::GraphicsLayerCA::updateReplicatedLayers):
1264         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
1265         (WebCore::GraphicsLayerCA::fetchCloneLayers): Deleted.
1266         * platform/graphics/ca/PlatformCALayer.h:
1267         * platform/graphics/ca/TileCoverageMap.cpp:
1268         (WebCore::TileCoverageMap::TileCoverageMap):
1269         * platform/graphics/ca/TileGrid.cpp:
1270         (WebCore::TileGrid::ensureTilesForRect):
1271         * platform/graphics/ca/mac/PlatformCALayerMac.h:
1272         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1273         (PlatformCALayerMac::clone):
1274         (PlatformCALayerMac::appendSublayer):
1275         (PlatformCALayerMac::insertSublayer):
1276         (PlatformCALayerMac::replaceSublayer):
1277         (PlatformCALayerMac::adoptSublayers):
1278         (PlatformCALayerMac::copyFiltersFrom):
1279         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1280         (WebCore::CACFLayerTreeHost::setRootChildLayer):
1281         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1282         (PlatformCALayerWin::clone):
1283         (PlatformCALayerWin::rootLayer):
1284         (PlatformCALayerWin::appendSublayer):
1285         (PlatformCALayerWin::insertSublayer):
1286         (PlatformCALayerWin::replaceSublayer):
1287         (PlatformCALayerWin::adoptSublayers):
1288         (PlatformCALayerWin::copyFiltersFrom):
1289         * platform/graphics/ca/win/PlatformCALayerWin.h:
1290         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1291         (PlatformCALayerWinInternal::insertSublayer):
1292         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
1293
1294 2014-10-13  Chris Dumez  <cdumez@apple.com>
1295
1296         Use is<>() / downcast<>() for Filter / FilterOperation subclasses
1297         https://bugs.webkit.org/show_bug.cgi?id=137644
1298
1299         Reviewed by Darin Adler.
1300
1301         Use is<>() / downcast<>() for Filter / FilterOperation subclasses.
1302
1303         No new tests, no behavior change.
1304
1305         * css/CSSComputedStyleDeclaration.cpp:
1306         (WebCore::ComputedStyleExtractor::valueForFilter):
1307         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
1308         (PlatformCAFilters::filterValueForOperation):
1309         (PlatformCAFilters::colorMatrixValueForFilter):
1310         * platform/graphics/filters/Filter.h:
1311         * platform/graphics/filters/FilterOperation.cpp:
1312         (WebCore::DefaultFilterOperation::operator==):
1313         (WebCore::ReferenceFilterOperation::operator==):
1314         (WebCore::BasicColorMatrixFilterOperation::blend):
1315         (WebCore::BasicColorMatrixFilterOperation::operator==):
1316         (WebCore::BasicComponentTransferFilterOperation::blend):
1317         (WebCore::BasicComponentTransferFilterOperation::operator==):
1318         (WebCore::BlurFilterOperation::operator==):
1319         (WebCore::BlurFilterOperation::blend):
1320         (WebCore::DropShadowFilterOperation::operator==):
1321         (WebCore::DropShadowFilterOperation::blend):
1322         * platform/graphics/filters/FilterOperation.h:
1323         * platform/graphics/filters/FilterOperations.cpp:
1324         (WebCore::FilterOperations::outsets):
1325         * rendering/FilterEffectRenderer.cpp:
1326         (WebCore::FilterEffectRenderer::build):
1327         * rendering/RenderLayerFilterInfo.cpp:
1328         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
1329         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
1330         (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
1331         * svg/graphics/filters/SVGFilter.h:
1332         (isType):
1333
1334 2014-10-13  Chris Dumez  <cdumez@apple.com>
1335
1336         Use is<>() / downcast<>() for Table render objects
1337         https://bugs.webkit.org/show_bug.cgi?id=137641
1338
1339         Reviewed by Mihnea Ovidenie.
1340
1341         Use is<>() / downcast<>() for table-related render objects and clean
1342         up the surrounding code.
1343
1344         No new tests, no behavior change.
1345
1346         * accessibility/AccessibilityARIAGrid.cpp:
1347         (WebCore::AccessibilityARIAGrid::addChildren):
1348         * accessibility/AccessibilityTable.cpp:
1349         (WebCore::AccessibilityTable::tableElement):
1350         (WebCore::AccessibilityTable::isDataTable):
1351         (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
1352         (WebCore::AccessibilityTable::addChildren):
1353         * accessibility/AccessibilityTableCell.cpp:
1354         (WebCore::AccessibilityTableCell::parentTable):
1355         (WebCore::AccessibilityTableCell::rowIndexRange):
1356         (WebCore::AccessibilityTableCell::columnIndexRange):
1357         (WebCore::AccessibilityTableCell::titleUIElement):
1358         * accessibility/AccessibilityTableColumn.cpp:
1359         (WebCore::AccessibilityTableColumn::headerObject):
1360         * editing/DeleteSelectionCommand.cpp:
1361         (WebCore::DeleteSelectionCommand::removeNode):
1362         * editing/TextIterator.cpp:
1363         (WebCore::shouldEmitTabBeforeNode):
1364         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
1365         * html/HTMLTableCellElement.cpp:
1366         (WebCore::HTMLTableCellElement::parseAttribute):
1367         (WebCore::HTMLTableCellElement::cellAbove):
1368         * html/HTMLTableColElement.cpp:
1369         (WebCore::HTMLTableColElement::parseAttribute):
1370         * mathml/MathMLElement.cpp:
1371         (WebCore::MathMLElement::parseAttribute):
1372         * rendering/AutoTableLayout.cpp:
1373         (WebCore::AutoTableLayout::recalcColumn):
1374         (WebCore::shouldScaleColumns):
1375         * rendering/RenderBlockFlow.cpp:
1376         (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths):
1377         * rendering/RenderBox.cpp:
1378         (WebCore::RenderBox::computePercentageLogicalHeight):
1379         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1380         * rendering/RenderElement.cpp:
1381         (WebCore::RenderElement::addChild):
1382         * rendering/RenderLayer.cpp:
1383         (WebCore::RenderLayer::calculateClipRects):
1384         * rendering/RenderTable.cpp:
1385         (WebCore::RenderTable::addChild):
1386         (WebCore::RenderTable::layout):
1387         (WebCore::RenderTable::firstColumn):
1388         (WebCore::RenderTable::recalcSections):
1389         (WebCore::RenderTable::sectionAbove):
1390         (WebCore::RenderTable::sectionBelow):
1391         (WebCore::RenderTable::bottomSection):
1392         * rendering/RenderTable.h:
1393         * rendering/RenderTableCaption.cpp:
1394         (WebCore::RenderTableCaption::table):
1395         * rendering/RenderTableCell.h:
1396         (WebCore::RenderTableCell::nextCell):
1397         (WebCore::RenderTableCell::previousCell):
1398         (WebCore::RenderTableRow::firstCell):
1399         (WebCore::RenderTableRow::lastCell):
1400         * rendering/RenderTableCol.cpp:
1401         (WebCore::RenderTableCol::table):
1402         (WebCore::RenderTableCol::enclosingColumnGroup):
1403         (WebCore::RenderTableCol::nextColumn):
1404         * rendering/RenderTableCol.h:
1405         Make updateFromElement() public to allow the callers to use tighter
1406         typing and devitualize the call as the class is final.
1407
1408         * rendering/RenderTableRow.cpp:
1409         (WebCore::RenderTableRow::addChild):
1410         * rendering/RenderTableRow.h:
1411         (WebCore::RenderTableSection::firstRow):
1412         (WebCore::RenderTableSection::lastRow):
1413         (WebCore::RenderTableRow::nextRow):
1414         (WebCore::RenderTableRow::previousRow):
1415         * rendering/RenderTableSection.cpp:
1416         (WebCore::RenderTableSection::addChild):
1417         (WebCore::RenderTableSection::layoutRows):
1418         (WebCore::RenderTableSection::paintCell):
1419         * rendering/RenderTableSection.h:
1420         * rendering/RenderTreeAsText.cpp:
1421         (WebCore::writeTextRun):
1422         (WebCore::writeSimpleLine):
1423
1424 2014-10-08  Jer Noble  <jer.noble@apple.com>
1425
1426         MediaPlayer::characteristicChanged() is not called when new tracks are found in SourceBufferPrivateAVFObjC
1427         https://bugs.webkit.org/show_bug.cgi?id=137533
1428
1429         Reviewed by Darin Adler.
1430
1431         When a new AVAsset is returned out of the AVStreamDataParser, notify the HTMLMediaElement that
1432         characteristics of the player may have changed.
1433
1434         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1435         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1436         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::characteristicsChanged):
1437         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1438         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1439
1440 2014-10-13  Jer Noble  <jer.noble@apple.com>
1441
1442         [iOS] Stop listening for wireless playback target availability when the default controls are hidden.
1443         https://bugs.webkit.org/show_bug.cgi?id=137633
1444
1445         Reviewed by Dean Jackson.
1446
1447         In order to minimize the excess bandwidth and power consumption required for actively listening
1448         for wireless playback target availablity, unregister for those notifications while the controls
1449         are hidden due to playback, or when the element's document is hidden.
1450
1451         * Modules/mediacontrols/mediaControlsiOS.js:
1452         (ControllerIOS.prototype.createBase): Register for document visiblity change notfications.
1453         (ControllerIOS.prototype.setControlsType): Call updateShouldListenForPlaybackTargetAvailabilityEvent()
1454             instead of setShouldListenForPlaybackTargetAvailabilityEvent()
1455         (ControllerIOS.prototype.hideControls): Ditto.
1456         (ControllerIOS.prototype.showControls): Ditto.
1457         (ControllerIOS.prototype.updateStatusDisplay): Ditto.
1458         (ControllerIOS.prototype.handleVisibilityChange): Ditto.
1459         (ControllerIOS.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent): Added. Only listen
1460             for target availability when the video has no errors, is not in the initial "big play button"
1461             controls state, and when the controls are not hidden.
1462         * platform/audio/ios/MediaSessionManagerIOS.mm:
1463         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Explicitly set the discoveryMode to "disabled"
1464             rather than waiting for the autoreleasepool to destroy our routing controller.
1465
1466 2014-10-13  Simon Fraser  <simon.fraser@apple.com>
1467
1468         iOS DRT snapshots are limited to the page visible area
1469         https://bugs.webkit.org/show_bug.cgi?id=137650
1470
1471         Reviewed by Daniel Bates.
1472
1473         LegacyTileCache drawing was limited to the window's visible area, found by
1474         crawling up the layer hierarchy to the root layer. This caused test snapshots to
1475         be missing non-composited content outside the iPhone visible area, which hinders
1476         testing.
1477         
1478         Fix by adding a test-only mode where the window visible area is the entire window.
1479
1480         * platform/ios/wak/WAKWindow.h:
1481         * platform/ios/wak/WAKWindow.mm:
1482         (-[WAKWindow setEntireWindowVisibleForTesting:]):
1483         (-[WAKWindow _visibleRectRespectingMasksToBounds:]):
1484
1485 2014-10-13  Mihnea Ovidenie  <mihnea@adobe.com>
1486
1487         [CSSRegions] Make RenderNamedFlowFragment::computeStyleInRegion const
1488         https://bugs.webkit.org/show_bug.cgi?id=137604
1489
1490         Reviewed by Andrei Bucur.
1491
1492         The method computeStyleInRegion should be const as it does not modify
1493         the state of the RenderNamedFlowFragment instance. Make pointers to
1494         the region used for styling const along the way. No new tests as no
1495         change in functionality.
1496
1497         * css/ElementRuleCollector.h:
1498         (WebCore::ElementRuleCollector::ElementRuleCollector):
1499         (WebCore::ElementRuleCollector::setRegionForStyling):
1500         * css/StyleResolver.cpp:
1501         (WebCore::StyleResolver::State::initForStyleResolve):
1502         (WebCore::StyleResolver::styleForElement):
1503         * css/StyleResolver.h:
1504         * rendering/RenderNamedFlowFragment.cpp:
1505         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
1506         * rendering/RenderNamedFlowFragment.h:
1507
1508 2014-09-30  Sergio Villar Senin  <svillar@igalia.com>
1509
1510         [CSS Grid Layout] Pass the valid set of tracks to grow beyond growth limits
1511         https://bugs.webkit.org/show_bug.cgi?id=137253
1512
1513         Reviewed by Darin Adler.
1514
1515         Section 10.4 of the specs describe how to resolve content based
1516         track sizing functions. Among others it describes the "distribute
1517         extra space" algorithm. The 3rd bullet of that algorithm specifies
1518         how to distribute (and also the target tracks) the extra space
1519         once all the tracks have reached their growth limits.
1520
1521         Our implementation had 2 problems. First we were not passing a
1522         valid subset of tracks (instead we were always using all of
1523         them). Now we use a function that filters the right tracks to be
1524         the target of the extra space distribution depending on whether
1525         we're computing the min track function or the max track function.
1526
1527         Secondly the algorithm that was distributing the extra space was
1528         not using that list of passed in tracks (it iterated over all of
1529         them). From now on it will use the set of tracks selected using
1530         the filter function described above.
1531
1532         * rendering/RenderGrid.cpp:
1533         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1534         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
1535         (WebCore::RenderGrid::distributeSpaceToTracks):
1536         * rendering/RenderGrid.h:
1537         * rendering/style/GridTrackSize.h:
1538         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth):
1539         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth):
1540
1541 2014-10-12  Mike West  <mkwst@chromium.org>
1542
1543         Referrer Policy: Update <meta name="referrer"> values to match the spec
1544         https://bugs.webkit.org/show_bug.cgi?id=137635
1545
1546         Reviewed by Jochen Eisinger.
1547
1548         The Referrer Policy specification ([Working Draft][WD], [Editor's
1549         draft[ED]) defines different keywords than we originally
1550         implemented. We should support them in the interests of clarity and
1551         interoperability with other browsers implementing the specification.
1552
1553         [WD]: http://www.w3.org/TR/referrer-policy/#referrer-policy-delivery-meta
1554         [ED]: http://w3c.github.io/webappsec/specs/referrer-policy/#referrer-policy-delivery-meta
1555
1556         This patch is a port of Blink's https://codereview.chromium.org/607433002/
1557
1558         Tests: http/tests/security/referrer-policy-conflicting-policies.html
1559                http/tests/security/referrer-policy-https-no-referrer-when-downgrade.html
1560                http/tests/security/referrer-policy-https-no-referrer.html
1561                http/tests/security/referrer-policy-https-unsafe-url.html
1562                http/tests/security/referrer-policy-no-referrer-when-downgrade.html
1563                http/tests/security/referrer-policy-no-referrer.html
1564
1565         * dom/Document.cpp:
1566         (WebCore::Document::processReferrerPolicy):
1567
1568 2014-10-12  Dhi Aurrahman  <diorahman@rockybars.com>
1569
1570         Support activation behavior of link element
1571         https://bugs.webkit.org/show_bug.cgi?id=137597
1572
1573         Reviewed by Benjamin Poulain.
1574
1575         Support activation behavior of link elements as defined in [1],
1576         i.e. to follow the hyperlink created by the link element when it is fully active.
1577
1578         [1] https://html.spec.whatwg.org/multipage/semantics.html#the-link-element
1579
1580         Tests: fast/dom/html-link-element-activation-behavior-on-element-click.html
1581                fast/dom/html-link-element-activation-behavior-on-mouse-click.html
1582                fast/dom/html-link-element-activation-behavior-url-is-null.html
1583
1584         * dom/MouseEvent.cpp:
1585         (WebCore::MouseEvent::triggerActivationBehavior):
1586         * dom/MouseEvent.h:
1587         * html/HTMLAnchorElement.cpp:
1588         (WebCore::HTMLAnchorElement::defaultEventHandler):
1589         (WebCore::isLinkClick): Deleted.
1590         * html/HTMLAnchorElement.h:
1591         * html/HTMLLinkElement.cpp:
1592         (WebCore::HTMLLinkElement::defaultEventHandler):
1593         (WebCore::HTMLLinkElement::handleClick):
1594         * html/HTMLLinkElement.h:
1595         * svg/SVGAElement.cpp:
1596         (WebCore::SVGAElement::defaultEventHandler):
1597
1598 2014-10-11  KwangHyuk Kim  <hyuki.kim@samsung.com>
1599
1600         [EFL] Enable WebP support.
1601         https://bugs.webkit.org/show_bug.cgi?id=136156
1602
1603         Reviewed by Gyuyoung Kim.
1604
1605         Add WebP library and inlcude path to WebCore path for WK2 Efl.
1606         No new tests since existing feature is just enabled for WK2 Efl.
1607
1608         * PlatformEfl.cmake:
1609
1610 2014-10-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1611
1612         [GLIB] Split GMainLoopSource moving thread safe implementation to its own class GThreadSafeMainLoopSource
1613         https://bugs.webkit.org/show_bug.cgi?id=137485
1614
1615         Reviewed by Sergio Villar Senin.
1616
1617         Use GThreadSafeMainLoopSource for GStreamer sources, since they
1618         can be used from different threads. Also update GMutexLocker
1619         usages, since it's now a template.
1620
1621         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1622         (WebCore::AudioFileReader::createBus):
1623         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
1624         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1625         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1626         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
1627         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1628         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
1629         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1630         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
1631         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1632         (webkitVideoSinkTimeoutCallback):
1633         (webkitVideoSinkRender):
1634         (unlockBufferMutex):
1635         (webkitVideoSinkUnlockStop):
1636         (webkitVideoSinkStart):
1637         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
1638         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1639         (webKitWebSrcGetProperty):
1640         (webKitWebSrcStop):
1641         (webKitWebSrcStart):
1642         (webKitWebSrcChangeState):
1643         (webKitWebSrcQueryWithParent):
1644         (webKitWebSrcGetUri):
1645         (webKitWebSrcSetUri):
1646         (webKitWebSrcNeedDataMainCb):
1647         (webKitWebSrcNeedDataCb):
1648         (webKitWebSrcEnoughDataMainCb):
1649         (webKitWebSrcEnoughDataCb):
1650         (webKitWebSrcSeekDataCb):
1651         (webKitWebSrcSetMediaPlayer):
1652         (StreamingClient::createReadBuffer):
1653         (StreamingClient::handleResponseReceived):
1654         (StreamingClient::handleDataReceived):
1655         (StreamingClient::handleNotifyFinished):
1656         (ResourceHandleStreamingClient::wasBlocked):
1657         (ResourceHandleStreamingClient::cannotShowURL):
1658
1659 2014-10-10  Chris Dumez  <cdumez@apple.com>
1660
1661         Use is<>() / downcast<>() for Image subclasses
1662         https://bugs.webkit.org/show_bug.cgi?id=137625
1663
1664         Reviewed by Andreas Kling.
1665
1666         Use is<>() / downcast<>() for Image subclasses.
1667
1668         No new tests, no behavior change.
1669
1670         * accessibility/AccessibilityRenderObject.cpp:
1671         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
1672         * loader/cache/CachedImage.cpp:
1673         (WebCore::CachedImage::imageSizeForRenderer):
1674         (WebCore::CachedImage::createImage):
1675         * platform/graphics/BitmapImage.h:
1676         * platform/graphics/Image.h:
1677         * platform/mac/DragImageMac.mm:
1678         (WebCore::createDragImageFromImage):
1679         * rendering/RenderImage.cpp:
1680         (WebCore::RenderImage::embeddedContentBox):
1681         * svg/graphics/SVGImage.h:
1682
1683 2014-10-10  Chris Dumez  <cdumez@apple.com>
1684
1685         Use is<>() / downcast<>() for RenderElement
1686         https://bugs.webkit.org/show_bug.cgi?id=137622
1687
1688         Reviewed by Benjamin Poulain.
1689
1690         Use is<>() / downcast<>() for RenderElement and clean up the
1691         surrounding code.
1692
1693         No new tests, no behavior change.
1694
1695         * accessibility/AccessibilityImageMapLink.cpp:
1696         (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
1697         * accessibility/AccessibilityRenderObject.cpp:
1698         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1699         * css/CSSComputedStyleDeclaration.cpp:
1700         (WebCore::computeRenderStyleForProperty):
1701         * dom/Node.cpp:
1702         (WebCore::Node::materializeRareData):
1703         * dom/Position.cpp:
1704         (WebCore::isNonTextLeafChild):
1705         (WebCore::searchAheadForBetterMatch):
1706         * dom/PseudoElement.cpp:
1707         (WebCore::PseudoElement::didRecalcStyle):
1708         * editing/CompositeEditCommand.cpp:
1709         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
1710         * editing/htmlediting.cpp:
1711         (WebCore::isEmptyTableCell):
1712         * rendering/InlineIterator.h:
1713         (WebCore::bidiNextShared):
1714         * rendering/RenderBlock.cpp:
1715         (WebCore::RenderBlock::getFirstLetter):
1716         * rendering/RenderBox.cpp:
1717         (WebCore::RenderBox::layout):
1718         * rendering/RenderCounter.cpp:
1719         (WebCore::RenderCounter::rendererRemovedFromTree):
1720         (WebCore::RenderCounter::rendererSubtreeAttached):
1721         (showCounterRendererTree):
1722         * rendering/RenderElement.cpp:
1723         (WebCore::RenderElement::insertChildInternal):
1724         (WebCore::RenderElement::removeChildInternal):
1725         (WebCore::RenderElement::findNextLayer):
1726         (WebCore::RenderElement::layout):
1727         * rendering/RenderElement.h:
1728         (WebCore::RenderObject::isRenderLayerModelObject):
1729         (WebCore::RenderObject::isBoxModelObject):
1730         (WebCore::RenderObject::isRenderBlock):
1731         (WebCore::RenderObject::isRenderBlockFlow):
1732         (WebCore::RenderObject::isRenderReplaced):
1733         (WebCore::RenderObject::isRenderInline):
1734         (WebCore::RenderObject::style):
1735         (WebCore::RenderObject::firstLineStyle):
1736         (WebCore::ContainerNode::renderer):
1737         * rendering/RenderFrameSet.cpp:
1738         (WebCore::RenderFrameSet::paint):
1739         * rendering/RenderLayer.cpp:
1740         (WebCore::RenderLayer::calculateClipRects):
1741         * rendering/RenderNamedFlowFragment.cpp:
1742         (WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
1743         (WebCore::RenderNamedFlowFragment::setObjectStyleInRegion):
1744         (WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle):
1745         * rendering/RenderObject.cpp:
1746         (WebCore::RenderObject::clearNeedsLayout):
1747         (WebCore::RenderObject::willBeDestroyed):
1748         (WebCore::RenderObject::collectAnnotatedRegions):
1749         * rendering/RenderVTTCue.cpp:
1750         (WebCore::RenderVTTCue::initializeLayoutParameters):
1751         (WebCore::RenderVTTCue::repositionGenericCue):
1752         * rendering/mathml/RenderMathMLFraction.cpp:
1753         (WebCore::RenderMathMLFraction::addChild):
1754         * rendering/mathml/RenderMathMLMenclose.cpp:
1755         (WebCore::RenderMathMLMenclose::addChild):
1756         * rendering/mathml/RenderMathMLOperator.cpp:
1757         (WebCore::RenderMathMLOperator::rebuildTokenContent):
1758         (WebCore::RenderMathMLOperator::updateStyle):
1759         * rendering/mathml/RenderMathMLRoot.cpp:
1760         (WebCore::RenderMathMLRoot::addChild):
1761         (WebCore::RenderMathMLRoot::layout):
1762         * rendering/mathml/RenderMathMLToken.cpp:
1763         (WebCore::RenderMathMLToken::addChild):
1764         (WebCore::RenderMathMLToken::updateTokenContent):
1765         (WebCore::RenderMathMLToken::updateStyle):
1766         * rendering/mathml/RenderMathMLUnderOver.cpp:
1767         (WebCore::RenderMathMLUnderOver::layout):
1768         * rendering/svg/RenderSVGResource.cpp:
1769         (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
1770         * rendering/svg/RenderSVGText.cpp:
1771         (WebCore::findPreviousAndNextAttributes):
1772         (WebCore::RenderSVGText::subtreeStyleDidChange):
1773         (WebCore::updateFontInAllDescendants):
1774         * rendering/svg/SVGRenderSupport.cpp:
1775         (WebCore::SVGRenderSupport::layoutChildren):
1776         * rendering/svg/SVGResourcesCache.cpp:
1777         (WebCore::SVGResourcesCache::clientWasAddedToTree):
1778         (WebCore::SVGResourcesCache::clientWillBeRemovedFromTree):
1779         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
1780         (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer):
1781         (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree):
1782         (WebCore::SVGTextLayoutAttributesBuilder::rebuildMetricsForTextRenderer):
1783         * rendering/svg/SVGTextLayoutAttributesBuilder.h:
1784         * rendering/svg/SVGTextMetricsBuilder.cpp:
1785         (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
1786         (WebCore::SVGTextMetricsBuilder::measureTextRenderer):
1787         (WebCore::SVGTextMetricsBuilder::walkTree):
1788         (WebCore::SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes):
1789         * rendering/svg/SVGTextMetricsBuilder.h:
1790         * rendering/svg/SVGTextRunRenderingContext.cpp:
1791         (WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator):
1792         (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
1793         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
1794         * svg/SVGFontData.cpp:
1795         (WebCore::SVGFontData::applySVGGlyphSelection):
1796
1797 2014-10-10  Benjamin Poulain  <benjamin@webkit.org>
1798
1799         Update :nth-child(An+B of selector-list) to the latest specification
1800         https://bugs.webkit.org/show_bug.cgi?id=137593
1801
1802         Reviewed by Andreas Kling.
1803
1804         Following my implementation feedback on :nth-child(An+B of selector-list),
1805         the CSS WG decided to change the definition such that the current element on which
1806         the selector is matched must also match the selector list in :nth-child().
1807
1808         This patch updates the implementation accordingly.
1809
1810         Test: fast/selectors/nth-child-of-chained-3.html
1811
1812         * css/SelectorChecker.cpp:
1813         (WebCore::SelectorChecker::checkOne):
1814         (WebCore::SelectorChecker::matchSelectorList):
1815         * css/SelectorChecker.h:
1816         * cssjit/SelectorCompiler.cpp:
1817         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
1818         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
1819
1820 2014-10-10  Chris Dumez  <cdumez@apple.com>
1821
1822         Drop RENDER_OBJECT_TYPE_CASTS() for a lot of RenderObject subclasses
1823         https://bugs.webkit.org/show_bug.cgi?id=137594
1824
1825         Reviewed by Darin Adler.
1826
1827         Drop RENDER_OBJECT_TYPE_CASTS() for RenderObject subclasses that no
1828         longer needed it or that required very few changes to do so. This will
1829         make sure developers start using is<>() / downcast<>() for those
1830         classes.
1831
1832         No new tests, no behavior change.
1833
1834         * accessibility/AccessibilityRenderObject.cpp:
1835         (WebCore::AccessibilityRenderObject::textUnderElement):
1836         (WebCore::AccessibilityRenderObject::stringValue):
1837         (WebCore::AccessibilityRenderObject::titleUIElement):
1838         * dom/PseudoElement.cpp:
1839         (WebCore::PseudoElement::didAttachRenderers):
1840         * html/HTMLCanvasElement.cpp:
1841         (WebCore::HTMLCanvasElement::reset):
1842         * html/HTMLPlugInElement.cpp:
1843         (WebCore::HTMLPlugInElement::defaultEventHandler):
1844         * html/HTMLPlugInImageElement.cpp:
1845         (WebCore::HTMLPlugInImageElement::updateSnapshot):
1846         (WebCore::HTMLPlugInImageElement::checkSnapshotStatus):
1847         * html/SearchInputType.cpp:
1848         (WebCore::SearchInputType::addSearchResult):
1849         (WebCore::SearchInputType::didSetValueByUserEdit):
1850         * html/shadow/TextControlInnerElements.cpp:
1851         (WebCore::TextControlInnerTextElement::renderer):
1852         (WebCore::TextControlInnerTextElement::customStyleForRenderer):
1853         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
1854         * page/FrameView.cpp:
1855         (WebCore::FrameView::isInChildFrameWithFrameFlattening):
1856         * rendering/RenderButton.h:
1857         * rendering/RenderCounter.h:
1858         * rendering/RenderDetailsMarker.h:
1859         * rendering/RenderFieldset.h:
1860         * rendering/RenderFileUploadControl.cpp:
1861         (WebCore::RenderFileUploadControl::paintObject):
1862         * rendering/RenderFileUploadControl.h:
1863         * rendering/RenderFlexibleBox.h:
1864         * rendering/RenderFullScreen.h:
1865         * rendering/RenderGrid.h:
1866         * rendering/RenderHTMLCanvas.h:
1867         * rendering/RenderIFrame.h:
1868         * rendering/RenderLayerBacking.cpp:
1869         (WebCore::RenderLayerBacking::contentsBox):
1870         * rendering/RenderMedia.h:
1871         * rendering/RenderQuote.cpp:
1872         (WebCore::RenderQuote::attachQuote):
1873         * rendering/RenderQuote.h:
1874         * rendering/RenderReplaced.h:
1875         * rendering/RenderScrollbarPart.h:
1876         * rendering/RenderSearchField.h:
1877         * rendering/RenderSnapshottedPlugIn.h:
1878         * rendering/RenderTableCaption.h:
1879         * rendering/RenderTextControlMultiLine.h:
1880         * rendering/RenderTextControlSingleLine.h:
1881         * rendering/RenderThemeMac.mm:
1882         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
1883         * rendering/RenderTreeAsText.cpp:
1884         (WebCore::RenderTreeAsText::writeRenderObject):
1885         * rendering/RenderVideo.cpp:
1886         (WebCore::rendererPlaceholder):
1887         * rendering/line/BreakingContextInlineHeaders.h:
1888         (WebCore::updateCounterIfNeeded):
1889         * rendering/svg/RenderSVGContainer.h:
1890         * rendering/svg/RenderSVGGradientStop.h:
1891         * rendering/svg/RenderSVGModelObject.h:
1892         * rendering/svg/RenderSVGPath.h:
1893         * rendering/svg/RenderSVGResourceFilter.h:
1894         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
1895         (WebCore::RenderSVGResourceFilterPrimitive::styleDidChange):
1896         * rendering/svg/RenderSVGTextPath.h:
1897         * rendering/svg/RenderSVGTransformableContainer.h:
1898         * rendering/svg/RenderSVGViewportContainer.h:
1899         * rendering/svg/SVGRenderSupport.cpp:
1900         (WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow):
1901         (WebCore::SVGRenderSupport::checkForSVGRepaintDuringLayout):
1902         (WebCore::updateObjectBoundingBox):
1903         (WebCore::layoutSizeOfNearestViewportChanged):
1904         (WebCore::SVGRenderSupport::transformToRootChanged):
1905         (WebCore::SVGRenderSupport::rendererHasSVGShadow):
1906         (WebCore::SVGRenderSupport::setRendererHasSVGShadow):
1907         * rendering/svg/SVGTextLayoutEngine.cpp:
1908         (WebCore::SVGTextLayoutEngine::beginTextPathLayout):
1909         * svg/SVGPathElement.cpp:
1910         (WebCore::SVGPathElement::svgAttributeChanged):
1911         (WebCore::SVGPathElement::pathSegListChanged):
1912         (WebCore::SVGPathElement::getBBox):
1913         * svg/SVGSVGElement.cpp:
1914         (WebCore::SVGSVGElement::currentViewportSize):
1915
1916 2014-10-10  Chris Dumez  <cdumez@apple.com>
1917
1918         Use is<>() / downcast<>() for GraphicsLayer subclasses
1919         https://bugs.webkit.org/show_bug.cgi?id=137595
1920
1921         Reviewed by Darin Adler.
1922
1923         Use is<>() / downcast<>() for GraphicsLayer subclasses and clean up the
1924         surrounding code.
1925
1926         No new tests, no behavior change.
1927
1928         * page/mac/ServicesOverlayController.mm:
1929         (WebCore::ServicesOverlayController::Highlight::Highlight):
1930         (WebCore::ServicesOverlayController::Highlight::fadeIn):
1931         (WebCore::ServicesOverlayController::Highlight::fadeOut):
1932         * platform/graphics/GraphicsLayer.h:
1933         * platform/graphics/ca/GraphicsLayerCA.cpp:
1934         (WebCore::GraphicsLayerCA::removeFromParent):
1935         (WebCore::GraphicsLayerCA::setMaskLayer):
1936         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush):
1937         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1938         (WebCore::GraphicsLayerCA::updateSublayerList):
1939         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
1940         (WebCore::GraphicsLayerCA::updateMaskLayer):
1941         (WebCore::GraphicsLayerCA::replicatedLayerRoot):
1942         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
1943         (WebCore::GraphicsLayerCA::propagateLayerChangeToReplicas):
1944         (WebCore::GraphicsLayerCA::fetchCloneLayers):
1945         * platform/graphics/ca/GraphicsLayerCA.h:
1946
1947 2014-10-10  Chris Dumez  <cdumez@apple.com>
1948
1949         Use is<>() / downcast<>() for RenderBoxModelObject
1950         https://bugs.webkit.org/show_bug.cgi?id=137587
1951
1952         Reviewed by Mihnea Ovidenie.
1953
1954         Use is<>() / downcast<>() for RenderBoxModelObject and clean up the
1955         surrounding code.
1956
1957         No new tests, no behavior change.
1958
1959         * accessibility/AXObjectCache.cpp:
1960         (WebCore::createFromRenderer):
1961         * accessibility/AccessibilityRenderObject.cpp:
1962         (WebCore::AccessibilityRenderObject::renderBoxModelObject):
1963         (WebCore::isInlineWithContinuation):
1964         (WebCore::firstChildConsideringContinuation):
1965         (WebCore::lastChildHasContinuation):
1966         (WebCore::AccessibilityRenderObject::nextSibling):
1967         (WebCore::AccessibilityRenderObject::widget):
1968         (WebCore::AccessibilityRenderObject::renderObjectIsObservable):
1969         (WebCore::AccessibilityRenderObject::observableObject):
1970         (WebCore::msaaRoleForRenderer):
1971         * accessibility/AccessibilityRenderObject.h:
1972         * accessibility/AccessibilityTable.cpp:
1973         (WebCore::AccessibilityTable::isDataTable):
1974         * dom/Node.cpp:
1975         (WebCore::Node::renderBox):
1976         (WebCore::Node::renderBoxModelObject):
1977         * inspector/InspectorOverlay.cpp:
1978         (WebCore::buildObjectForElementInfo):
1979         * page/FrameView.cpp:
1980         (WebCore::FrameView::scrollContentsFastPath):
1981         * page/PrintContext.cpp:
1982         (WebCore::enclosingBoxModelObject):
1983         * page/animation/AnimationBase.cpp:
1984         (WebCore::AnimationBase::freezeAtTime):
1985         * page/animation/ImplicitAnimation.cpp:
1986         (WebCore::ImplicitAnimation::startAnimation):
1987         (WebCore::ImplicitAnimation::pauseAnimation):
1988         (WebCore::ImplicitAnimation::endAnimation):
1989         * page/animation/KeyframeAnimation.cpp:
1990         (WebCore::KeyframeAnimation::startAnimation):
1991         (WebCore::KeyframeAnimation::pauseAnimation):
1992         (WebCore::KeyframeAnimation::endAnimation):
1993         * page/ios/FrameIOS.mm:
1994         (WebCore::Frame::overflowScrollPositionChangedForNode):
1995         * page/scrolling/ScrollingCoordinator.cpp:
1996         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
1997         * rendering/InlineBox.h:
1998         (WebCore::InlineBox::boxModelObject):
1999         * rendering/InlineElementBox.h:
2000         (WebCore::InlineElementBox::renderer):
2001         * rendering/InlineFlowBox.cpp:
2002         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2003         * rendering/InlineFlowBox.h:
2004         (WebCore::InlineFlowBox::renderer):
2005         * rendering/InlineTextBox.cpp:
2006         (WebCore::InlineTextBox::baselinePosition):
2007         (WebCore::InlineTextBox::lineHeight):
2008         * rendering/RenderBlock.cpp:
2009         (WebCore::RenderBlock::addChildToContinuation):
2010         * rendering/RenderBox.cpp:
2011         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
2012         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2013         (WebCore::RenderBox::computePositionedLogicalWidth):
2014         (WebCore::RenderBox::computePositionedLogicalHeight):
2015         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
2016         (WebCore::RenderBox::computePositionedLogicalHeightReplaced):
2017         * rendering/RenderBoxModelObject.h:
2018         * rendering/RenderFlowThread.cpp:
2019         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
2020         * rendering/RenderInline.cpp:
2021         (WebCore::RenderInline::splitInlines):
2022         (WebCore::RenderInline::addChildToContinuation):
2023         * rendering/RenderLayer.cpp:
2024         (WebCore::RenderLayer::updateLayerPosition):
2025         (WebCore::RenderLayer::calculateClipRects):
2026         * rendering/RenderLayerBacking.cpp:
2027         (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread):
2028         * rendering/RenderLayerCompositor.cpp:
2029         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason):
2030         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints):
2031         * rendering/RenderObject.cpp:
2032         (WebCore::RenderObject::destroy):
2033         (WebCore::RenderObject::offsetParent):
2034         * rendering/mathml/RenderMathMLScripts.cpp:
2035         (WebCore::RenderMathMLScripts::base):
2036
2037 2014-10-10  Zan Dobersek  <zdobersek@igalia.com>
2038
2039         Remove CrossThreadTask
2040         https://bugs.webkit.org/show_bug.cgi?id=137570
2041
2042         Reviewed by Darin Adler.
2043
2044         Replace uses of CrossThreadTask with C++11 lambdas. The initializations
2045         of cross-thread copies are rather verbose at the moment, but should look
2046         better once we can switch to using C++14 init capture for lambdas.
2047
2048         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2049         (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize):
2050         * WebCore.order:
2051         * WebCore.vcxproj/WebCore.vcxproj:
2052         * WebCore.vcxproj/WebCore.vcxproj.filters:
2053         * WebCore.xcodeproj/project.pbxproj:
2054         * dom/CrossThreadTask.h: Removed.
2055         * loader/WorkerThreadableLoader.cpp:
2056         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2057         (WebCore::WorkerThreadableLoader::MainThreadBridge::destroy):
2058         (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel):
2059         (WebCore::WorkerThreadableLoader::MainThreadBridge::didSendData):
2060         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
2061         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData):
2062         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
2063         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
2064         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck):
2065         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck):
2066         (WebCore::WorkerThreadableLoader::MainThreadBridge::~MainThreadBridge): Deleted.
2067         (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCreateLoader): Deleted.
2068         (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadDestroy): Deleted.
2069         (WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCancel): Deleted.
2070         (WebCore::workerGlobalScopeDidSendData): Deleted.
2071         (WebCore::workerGlobalScopeDidReceiveResponse): Deleted.
2072         (WebCore::workerGlobalScopeDidReceiveData): Deleted.
2073         (WebCore::workerGlobalScopeDidFinishLoading): Deleted.
2074         (WebCore::workerGlobalScopeDidFail): Deleted.
2075         (WebCore::workerGlobalScopeDidFailAccessControlCheck): Deleted.
2076         (WebCore::workerGlobalScopeDidFailRedirectCheck): Deleted.
2077         * loader/WorkerThreadableLoader.h:
2078         * loader/cache/MemoryCache.cpp:
2079         (WebCore::MemoryCache::removeRequestFromCache):
2080         (WebCore::MemoryCache::removeRequestFromSessionCaches):
2081         (WebCore::MemoryCache::removeRequestFromCacheImpl): Deleted.
2082         (WebCore::MemoryCache::removeRequestFromSessionCachesImpl): Deleted.
2083         (WebCore::MemoryCache::crossThreadRemoveRequestFromCache): Deleted.
2084         (WebCore::MemoryCache::crossThreadRemoveRequestFromSessionCaches): Deleted.
2085         * loader/cache/MemoryCache.h:
2086
2087 2014-10-10  Zan Dobersek  <zdobersek@igalia.com>
2088
2089         Avoid defaulting to capture-by-value for C++11 lambdas in WebCore
2090         https://bugs.webkit.org/show_bug.cgi?id=137565
2091
2092         Reviewed by Darin Adler.
2093
2094         C++11 lambas should avoid defaulting to capturing used variables by value as that
2095         can lead to unintended captures that, in worst cases, result in lambdas that are
2096         not self-contained and end up operating on dangling pointers.
2097
2098         Explicitly stating the variables that are to be copied by value can also serve as
2099         a checklist of variables that are actually intented for use in the lambda body. 
2100
2101         * Modules/quota/StorageErrorCallback.cpp:
2102         (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
2103         * Modules/webdatabase/Database.cpp:
2104         (WebCore::Database::~Database):
2105         (WebCore::Database::runTransaction):
2106         (WebCore::Database::scheduleTransactionCallback):
2107         * Modules/webdatabase/DatabaseManager.cpp:
2108         (WebCore::DatabaseManager::openDatabase):
2109         * Modules/webdatabase/SQLCallbackWrapper.h:
2110         (WebCore::SQLCallbackWrapper::clear):
2111         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
2112         (WebCore::ThreadableWebSocketChannelClientWrapper::didConnect):
2113         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessage):
2114         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
2115         (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount):
2116         (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
2117         (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
2118         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError):
2119         (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
2120         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2121         (WebCore::WorkerThreadableWebSocketChannel::Peer::send):
2122         (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
2123         (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
2124         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage):
2125         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
2126         (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
2127         (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
2128         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
2129         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
2130         (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
2131         (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
2132         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
2133         (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
2134         (WebCore::WorkerThreadableWebSocketChannel::Bridge::close):
2135         (WebCore::WorkerThreadableWebSocketChannel::Bridge::fail):
2136         (WebCore::WorkerThreadableWebSocketChannel::Bridge::disconnect):
2137         (WebCore::WorkerThreadableWebSocketChannel::Bridge::suspend):
2138         (WebCore::WorkerThreadableWebSocketChannel::Bridge::resume):
2139         * bindings/js/JSCallbackData.h:
2140         (WebCore::DeleteCallbackDataTask::DeleteCallbackDataTask):
2141         * bindings/js/JSDOMGlobalObjectTask.cpp:
2142         (WebCore::JSGlobalObjectTask::JSGlobalObjectTask):
2143         * dom/ScriptExecutionContext.h:
2144         (WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
2145         * dom/StringCallback.cpp:
2146         (WebCore::StringCallback::scheduleCallback):
2147         * fileapi/FileReader.cpp:
2148         (WebCore::FileReader::abort):
2149         * loader/appcache/ApplicationCacheGroup.cpp:
2150         (WebCore::ApplicationCacheGroup::postListenerTask):
2151         * workers/DefaultSharedWorkerRepository.cpp:
2152         (WebCore::SharedWorkerProxy::postExceptionToWorkerObject):
2153         (WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject):
2154         (WebCore::SharedWorkerConnectTask::SharedWorkerConnectTask):
2155         * workers/WorkerEventQueue.cpp:
2156         (WebCore::WorkerEventQueue::enqueueEvent):
2157         * workers/WorkerMessagingProxy.cpp:
2158         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
2159         (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
2160         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
2161         (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
2162         (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
2163         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
2164         (WebCore::WorkerMessagingProxy::confirmMessageFromWorkerObject):
2165         (WebCore::WorkerMessagingProxy::reportPendingActivity):
2166
2167 2014-10-10  Zan Dobersek  <zdobersek@igalia.com>
2168
2169         Remove MainThreadTask
2170         https://bugs.webkit.org/show_bug.cgi?id=137563
2171
2172         Reviewed by Darin Adler.
2173
2174         Replace the remaining uses of MainThreadTask with C++11 lambdas.
2175         Remove the MainThreadTask header from the build.
2176
2177         * WebCore.order:
2178         * WebCore.vcxproj/WebCore.vcxproj:
2179         * WebCore.vcxproj/WebCore.vcxproj.filters:
2180         * WebCore.xcodeproj/project.pbxproj:
2181         * platform/MainThreadTask.h: Removed.
2182         * platform/network/curl/CurlDownload.cpp:
2183         (WebCore::CurlDownloadManager::downloadThread):
2184         (WebCore::CurlDownload::didReceiveHeader):
2185         (WebCore::CurlDownload::didReceiveData):
2186
2187 2014-10-10  Andrzej Badowski  <a.badowski@samsung.com>
2188
2189         [ATK] Changing the mapping of ARIA rowheader and columnheader into respective ATK roles.
2190         https://bugs.webkit.org/show_bug.cgi?id=136150
2191
2192         Reviewed by Chris Fleizach.
2193
2194         Expose ColumnHeaderRole and RowHeaderRole objects into ATK.
2195
2196         Test: accessibility/table-roles-hierarchy.html
2197
2198         * accessibility/AccessibilityRenderObject.cpp:
2199         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2200         Platforms based on ATK: added distinction of roles for the <th> elements.
2201         * accessibility/AccessibilityTableCell.cpp:
2202         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
2203         Platforms based on ATK: the return value is determined in the ancestor.
2204         * accessibility/atk/AccessibilityObjectAtk.cpp:
2205         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
2206         In addition to CellRole also included ColumnHeaderRole and RowHeaderRole.
2207         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2208         (atkRole):
2209         Changing the mapping of ARIA rowheader and columnheader into respective ATK roles.
2210         (getInterfaceMaskFromObject):
2211         In addition to CellRole also included ColumnHeaderRole and RowHeaderRole.
2212
2213 2014-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2214
2215         MediaPlayer should use a reference for the MediaPlayerClient
2216         https://bugs.webkit.org/show_bug.cgi?id=137552
2217
2218         Reviewed by Darin Adler.
2219
2220         The MediaPlayer client is set on constructor by HTMLMediaElement
2221         and cleared on HTMLMediaElement destructor that also frees the
2222         MediaPlayer object. Since the client will never be null while the
2223         MediaPlayer player is alive, we can use a reference and remove all
2224         the unneeded null checks. The member has also been renamed to m_client.
2225
2226         * html/HTMLMediaElement.cpp:
2227         (WebCore::HTMLMediaElement::~HTMLMediaElement):
2228         (WebCore::HTMLMediaElement::parseAttribute):
2229         * platform/graphics/MediaPlayer.cpp:
2230         (WebCore::MediaPlayer::MediaPlayer):
2231         (WebCore::MediaPlayer::~MediaPlayer):
2232         (WebCore::MediaPlayer::loadWithNextMediaEngine):
2233         (WebCore::MediaPlayer::inMediaDocument):
2234         (WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
2235         (WebCore::MediaPlayer::networkStateChanged):
2236         (WebCore::MediaPlayer::readyStateChanged):
2237         (WebCore::MediaPlayer::volumeChanged):
2238         (WebCore::MediaPlayer::muteChanged):
2239         (WebCore::MediaPlayer::timeChanged):
2240         (WebCore::MediaPlayer::sizeChanged):
2241         (WebCore::MediaPlayer::repaint):
2242         (WebCore::MediaPlayer::durationChanged):
2243         (WebCore::MediaPlayer::rateChanged):
2244         (WebCore::MediaPlayer::playbackStateChanged):
2245         (WebCore::MediaPlayer::firstVideoFrameAvailable):
2246         (WebCore::MediaPlayer::characteristicChanged):
2247         (WebCore::MediaPlayer::keyAdded):
2248         (WebCore::MediaPlayer::keyError):
2249         (WebCore::MediaPlayer::keyMessage):
2250         (WebCore::MediaPlayer::keyNeeded):
2251         (WebCore::MediaPlayer::referrer):
2252         (WebCore::MediaPlayer::userAgent):
2253         (WebCore::MediaPlayer::graphicsDeviceAdapter):
2254         (WebCore::MediaPlayer::cachedResourceLoader):
2255         (WebCore::MediaPlayer::addAudioTrack):
2256         (WebCore::MediaPlayer::removeAudioTrack):
2257         (WebCore::MediaPlayer::addTextTrack):
2258         (WebCore::MediaPlayer::removeTextTrack):
2259         (WebCore::MediaPlayer::addVideoTrack):
2260         (WebCore::MediaPlayer::removeVideoTrack):
2261         (WebCore::MediaPlayer::outOfBandTrackSources):
2262         (WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge):
2263         (WebCore::MediaPlayer::handlePlaybackCommand):
2264         (WebCore::MediaPlayer::sourceApplicationIdentifier):
2265         (WebCore::MediaPlayer::doesHaveAttribute):
2266         (WebCore::MediaPlayer::mediaPlayerNetworkInterfaceName):
2267         (WebCore::MediaPlayer::getRawCookies):
2268         (WebCore::MediaPlayer::setWirelessVideoPlaybackDisabled): Deleted.
2269         (WebCore::MediaPlayer::audioSourceProvider): Deleted.
2270         (WebCore::MediaPlayer::engineDescription): Deleted.
2271         (WebCore::MediaPlayer::notifyTrackModeChanged): Deleted.
2272         (WebCore::MediaPlayer::totalFrameDelay): Deleted.
2273         (WebCore::MediaPlayerFactorySupport::callRegisterMediaEngine): Deleted.
2274         * platform/graphics/MediaPlayer.h:
2275         (WebCore::MediaPlayer::create):
2276         (WebCore::MediaPlayer::platformVolumeConfigurationRequired):
2277         (WebCore::MediaPlayer::client):
2278         (WebCore::MediaPlayer::mediaPlayerClient): Deleted.
2279         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2280         (WebCore::MediaPlayerPrivateAVFoundation::preferredRenderingMode):
2281         (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
2282         (WebCore::MediaPlayerPrivateAVFoundation::prepareForRendering):
2283         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2284         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
2285         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2286         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2287         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2288         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged):
2289         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer):
2290         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer):
2291         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
2292         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
2293         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2294         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
2295         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2296         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideoCaps):
2297         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
2298         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
2299         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2300         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2301         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2302         (webKitWebSrcStart):
2303         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2304         (WebCore::MediaPlayerPrivateQTKit::preferredRenderingMode):
2305         (WebCore::MediaPlayerPrivateQTKit::setUpVideoRendering):
2306         (WebCore::MediaPlayerPrivateQTKit::prepareForRendering):
2307         (WebCore::MediaPlayerPrivateQTKit::sawUnsupportedTracks):
2308
2309 2014-10-09  Mihnea Ovidenie  <mihnea@adobe.com>
2310
2311         [CSSRegions] Make RenderFlowThread::regionAtBlockOffset const
2312         https://bugs.webkit.org/show_bug.cgi?id=137555
2313
2314         Reviewed by David Hyatt.
2315
2316         Make the method const and remove autoGenerateRegionsToBlockOffset method as it
2317         is not used by region-based multicolumn code. Also removed the RegionAutoGenerationPolicy
2318         parameter in the process and the call sites. Make const some of the methods that call
2319         regionAtBlockOffset.
2320
2321         * rendering/RenderFlowThread.cpp:
2322         (WebCore::RenderFlowThread::regionForCompositedLayer):
2323         (WebCore::RenderFlowThread::regionAtBlockOffset):
2324         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
2325         (WebCore::RenderFlowThread::pageLogicalTopForOffset):
2326         (WebCore::RenderFlowThread::pageLogicalWidthForOffset):
2327         (WebCore::RenderFlowThread::pageLogicalHeightForOffset):
2328         (WebCore::RenderFlowThread::pageRemainingLogicalHeightForOffset):
2329         (WebCore::RenderFlowThread::mapFromFlowToRegion):
2330         (WebCore::RenderFlowThread::computedRegionRangeForBox):
2331         * rendering/RenderFlowThread.h:
2332         * rendering/RenderMultiColumnFlowThread.cpp:
2333         (WebCore::RenderMultiColumnFlowThread::regionAtBlockOffset):
2334         (WebCore::RenderMultiColumnFlowThread::mapFromFlowToRegion):
2335         (WebCore::RenderMultiColumnFlowThread::physicalTranslationFromFlowToRegion):
2336         (WebCore::RenderMultiColumnFlowThread::autoGenerateRegionsToBlockOffset): Deleted.
2337         * rendering/RenderMultiColumnFlowThread.h:
2338
2339 2014-10-09  Chris Dumez  <cdumez@apple.com>
2340
2341         Use is<>() / downcast<>() for FontData subclasses
2342         https://bugs.webkit.org/show_bug.cgi?id=137591
2343
2344         Reviewed by Andreas Kling.
2345
2346         Use is<>() / downcast<>() for FontData subclasses.
2347
2348         No new tests, no behavior change.
2349
2350         * platform/graphics/FontData.h:
2351         * platform/graphics/FontGlyphs.cpp:
2352         (WebCore::FontGlyphs::releaseFontData):
2353         (WebCore::FontGlyphs::determinePitch):
2354         * platform/graphics/GlyphPageTreeNode.cpp:
2355         (WebCore::GlyphPageTreeNode::initializePage):
2356         * platform/graphics/SegmentedFontData.h:
2357         (isType):
2358         * platform/graphics/SimpleFontData.h:
2359         (isType):
2360
2361 2014-10-09  Simon Fraser  <simon.fraser@apple.com>
2362
2363         Revert part of r174543 that broke grid layout tests.
2364
2365         * css/CSSComputedStyleDeclaration.cpp:
2366         (WebCore::specifiedValueForGridTrackBreadth):
2367
2368 2014-10-09  Dean Jackson  <dino@apple.com>
2369
2370         Computed style for clip is wrong with respect to auto
2371         https://bugs.webkit.org/show_bug.cgi?id=137567
2372
2373         Reviewed by Simon Fraser.
2374
2375         Make sure that the computed style of clip returns the
2376         correct value when the input is "auto", or in this
2377         case "rect(auto, auto, auto, auto)". Before this
2378         patch it returned "rect(0px, 0px, 0px, 0px)" which
2379         was completely wrong.
2380
2381         Test: fast/css/computed-clip-with-auto-rect.html
2382
2383         * css/CSSComputedStyleDeclaration.cpp:
2384         (WebCore::autoOrZoomAdjustedValue): Helper function to make the correct keyword or length.
2385         (WebCore::specifiedValueForGridTrackBreadth): It can use the helper too.
2386         (WebCore::ComputedStyleExtractor::propertyValue): If the
2387         top/right/bottom/left is "auto", add that identifier
2388         to the output rectangle.
2389
2390 2014-10-09  Chris Dumez  <cdumez@apple.com>
2391
2392         Use RenderObject::firstChildSlow() / lastChildSlow() less
2393         https://bugs.webkit.org/show_bug.cgi?id=137573
2394
2395         Reviewed by Andreas Kling.
2396
2397         Use RenderObject::firstChildSlow() / lastChildSlow() less by using
2398         tighter typing at call sites whenever possible to be able to call the
2399         faster RenderElement::firstChild() / lastChild() instead.
2400
2401         This patch also uses more references instead of pointers when possible.
2402
2403         No new tests, no behavior change.
2404
2405         * accessibility/AccessibilityRenderObject.cpp:
2406         (WebCore::firstChildIsInlineContinuation):
2407         (WebCore::AccessibilityRenderObject::previousSibling):
2408         (WebCore::lastChildHasContinuation):
2409         (WebCore::AccessibilityRenderObject::nextSibling):
2410         * page/FrameView.cpp:
2411         (WebCore::countRenderedCharactersInRenderObjectWithThreshold):
2412         (WebCore::FrameView::renderedCharactersExceed):
2413         * rendering/RenderElement.h:
2414         * rendering/RenderRuby.cpp:
2415         (WebCore::isAnonymousRubyInlineBlock):
2416         (WebCore::isRubyBeforeBlock):
2417         (WebCore::isRubyAfterBlock):
2418         * rendering/svg/RenderSVGInline.h:
2419         * rendering/svg/RenderSVGText.cpp:
2420         (WebCore::RenderSVGText::layout):
2421         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
2422         (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer):
2423         (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree):
2424         (WebCore::SVGTextLayoutAttributesBuilder::collectTextPositioningElements):
2425         (WebCore::SVGTextLayoutAttributesBuilder::buildCharacterDataMap):
2426         * rendering/svg/SVGTextLayoutAttributesBuilder.h:
2427         * svg/SVGTextPositioningElement.cpp:
2428         (WebCore::SVGTextPositioningElement::elementFromRenderer):
2429         * svg/SVGTextPositioningElement.h:
2430
2431 2014-10-09  Roger Fong  <roger_fong@apple.com>
2432
2433         Build fix for Win EWS bots.
2434
2435         * testing/Internals.idl: Move enum declaration to the top of the file.
2436
2437 2014-10-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
2438
2439         RenderMathMLUnderOver adds spacing to the child operator indefinitely when resizing the window.
2440         https://bugs.webkit.org/show_bug.cgi?id=137330
2441
2442         Reviewed by Darin Adler.
2443
2444         The layout for the <mundercover> math object happens in two separate passes. The first pass runs
2445         the layout for the two children and then calculates the maximum child width.  It then sets the 
2446         stretch size for the math operator child.  And finally it runs the second layout pass by calling
2447         the base class layout() function. The base class function then runs the layout for the children
2448         rendering blocks.  In the operator child function computePreferredLogicalWidths(), the stretch 
2449         size is used to adjust the width (or the height) of the operator. Then it adds the leading and
2450         trailing spaces and the total will be the operator child width.
2451
2452         When resizing or zooming the window, the render objects are just invalidated but marked as 'needs-
2453         Layout'.  The problem is happening because the stretch size of the math operator is not reset
2454         before running the layout.  The old logical width (or height) of the the math operator child which
2455         is equal to the stretch size plus the leading and trailing spaces for is compared with the glyph
2456         size if the old logical width ( or height) is larger, it is set to be the stretch size.  When it
2457         is used again because of invalidation, new leading and trailing spaces are included in the new
2458         logical width.  So with every zooming-in or out or window resizing, new leading and trailing 
2459         spaces are added to the logical width of the math operator child or the math <munderober> object.
2460         
2461         Ensure the stretch size of the math operator render object is reset before running its layout.
2462         Running the layout means either the page is just loaded or it's invalidated which means, no 
2463         layout stall data should be used.
2464
2465         Test: mathml/opentype/munderover-window-resize.html
2466
2467         * rendering/mathml/RenderMathMLOperator.cpp:
2468         (WebCore::RenderMathMLOperator::resetStretchSize):
2469         * rendering/mathml/RenderMathMLOperator.h:
2470         resetStretchSize() sets the stretch size to its original value when the class is created.
2471         * rendering/mathml/RenderMathMLUnderOver.cpp:
2472         (WebCore::RenderMathMLUnderOver::layout):
2473         Make sure the operator stretch size is reset before calling its layout. Also make sure the new 
2474         maximum stretch size to the operator objects that were invalid and needsLayout.
2475
2476 2014-10-09  Dean Jackson  <dino@apple.com>
2477
2478         Remove ENABLE_CSS3_CONDITIONAL_RULES
2479         https://bugs.webkit.org/show_bug.cgi?id=137571
2480
2481         Reviewed by Simon Fraser.
2482
2483         We have good enough support for @supports that
2484         it should be a consistent part of the platform. Remove
2485         the compile-time guard.
2486
2487         * Configurations/FeatureDefines.xcconfig:
2488         * WebCore.exp.in:
2489         * bindings/js/JSCSSRuleCustom.cpp:
2490         (WebCore::toJS):
2491         * bindings/objc/DOMCSS.mm:
2492         (kitClass):
2493         * css/CSSGrammar.y.in:
2494         * css/CSSParser.cpp:
2495         (WebCore::CSSParser::CSSParser):
2496         (WebCore::CSSParser::parseSupportsCondition):
2497         (WebCore::CSSParser::detectAtToken):
2498         (WebCore::CSSParser::detectSupportsToken):
2499         (WebCore::CSSParser::realLex):
2500         * css/CSSParser.h:
2501         * css/CSSRule.h:
2502         * css/CSSRule.idl:
2503         * css/CSSSupportsRule.cpp:
2504         * css/CSSSupportsRule.h:
2505         * css/CSSSupportsRule.idl:
2506         * css/DOMWindowCSS.cpp:
2507         * css/DOMWindowCSS.h:
2508         * css/DOMWindowCSS.idl:
2509         * css/InspectorCSSOMWrappers.cpp:
2510         (WebCore::InspectorCSSOMWrappers::collect):
2511         * css/RuleSet.cpp:
2512         (WebCore::RuleSet::addChildRules):
2513         * css/StyleRule.cpp:
2514         (WebCore::StyleRuleBase::destroy):
2515         (WebCore::StyleRuleBase::copy):
2516         (WebCore::StyleRuleBase::createCSSOMWrapper):
2517         (WebCore::StyleRuleSupports::StyleRuleSupports):
2518         * css/StyleRule.h:
2519         (WebCore::toStyleRuleSupports):
2520         * css/StyleSheetContents.cpp:
2521         (WebCore::childRulesHaveFailedOrCanceledSubresources):
2522         * inspector/InspectorStyleSheet.cpp:
2523         (flattenSourceData):
2524         (WebCore::asCSSRuleList):
2525         * page/DOMWindow.cpp:
2526         (WebCore::DOMWindow::css):
2527         * page/DOMWindow.h:
2528         * page/DOMWindow.idl:
2529
2530 2014-10-09  Benjamin Poulain  <benjamin@webkit.org>
2531
2532         Add the baseline implementation of :not(selectorList)
2533         https://bugs.webkit.org/show_bug.cgi?id=137548
2534
2535         Reviewed by Andreas Kling.
2536
2537         This patch extend the pseudo class :not() to support the new definition
2538         in CSS Selectors level 4.
2539
2540         Instead of supporting a single simple selector, :not() now support
2541         an arbitrary selector list, excepted pseudo elements.
2542
2543         One side effect of this change is :visited and :link are no longer supported
2544         inside :not(). The reason has to do with complexity and performance.
2545         Since :not() and :matches() can have arbitrary selector list, keeping track of
2546         :visited and :link can have many combination superposing, some valid, some invalid.
2547
2548         Supporting :visited and :link should be possible by chaning the way we handle
2549         them for style resolution, but given the limited use cases for such features
2550         I'll wait to see if there is any interest before changing everything.
2551
2552         This patch only covers SelectorChecker to keep things simple. The CSS JIT
2553         will come later.
2554
2555         Tests: fast/css/not-basics.html
2556                fast/css/parsing-css-not-1.html
2557                fast/css/parsing-css-not-2.html
2558                fast/css/parsing-css-not-3.html
2559                fast/css/parsing-css-not-4.html
2560                fast/css/parsing-css-not-5.html
2561                fast/css/parsing-css-not-6.html
2562                fast/css/parsing-css-not-7.html
2563                fast/css/parsing-css-not-8.html
2564                fast/css/parsing-css-not-9.html
2565                fast/css/parsing-css-nth-child-of-4.html
2566                fast/selectors/not-basics.html
2567                fast/selectors/not-nested.html
2568                fast/selectors/not-selector-list.html
2569
2570         * css/CSSGrammar.y.in:
2571         Rename selectorListDoesNotMatchAnyPseudoElement() to selectorListDoesNotMatchAnyPseudoElement()
2572         since both :not() and :nth-child(An+B of selectorList) have the same requirements at the moment. 
2573
2574         * css/CSSParserValues.cpp:
2575         (WebCore::selectorListMatchesPseudoElement):
2576         The patch adding :matches() introduced the possibility of putting pseudo element
2577         arbitrary deep in a sequence of nested :matches(). Since this case is forbidded
2578         by :not() and :nth-child(An+B of selectorList), selectorListMatchesPseudoElement()
2579         now becomes recursive to find those pseudo elements.
2580
2581         * css/CSSSelector.cpp:
2582         (WebCore::CSSSelector::selectorText):
2583         CSSOM for the extended :not().
2584
2585         * css/SelectorChecker.cpp:
2586         (WebCore::SelectorChecker::checkOne):
2587         (WebCore::SelectorChecker::determineLinkMatchType):
2588         * cssjit/SelectorCompiler.cpp:
2589
2590         (WebCore::SelectorCompiler::addPseudoClassType):
2591         Disable the new capabilities from the JIT for now.
2592
2593 2014-10-09  Tim Horton  <timothy_horton@apple.com>
2594
2595         Move ServicesOverlayController to WebCore
2596         https://bugs.webkit.org/show_bug.cgi?id=137416
2597         <rdar://problem/18546283>
2598
2599         Reviewed by Anders Carlsson.
2600
2601         Move ServicesOverlayController from WebKit2 to WebCore, as it can be used by both Legacy WebKit and WebKit2.
2602
2603         * WebCore.xcodeproj/project.pbxproj:
2604         * editing/Editor.cpp:
2605         (WebCore::Editor::scanSelectionForTelephoneNumbers):
2606         * editing/SelectionRectGatherer.cpp:
2607         (WebCore::SelectionRectGatherer::Notifier::~Notifier):
2608         Notify ServicesOverlayController of changes via Page instead of EditorClient.
2609
2610         * page/ChromeClient.h:
2611         (WebCore::ChromeClient::handleTelephoneNumberClick):
2612         (WebCore::ChromeClient::handleSelectionServiceClick):
2613         (WebCore::ChromeClient::hasRelevantSelectionServices):
2614         Add ChromeClient functions for services actions.
2615
2616         * page/EditorClient.h:
2617         (WebCore::EditorClient::selectedTelephoneNumberRangesChanged): Deleted.
2618         (WebCore::EditorClient::selectionRectsDidChange): Deleted.
2619         Remove EditorClient functions for notifying ServicesOverlayController of changes,
2620         because it lives in WebCore proper now.
2621
2622         * page/Page.cpp:
2623         (WebCore::Page::Page):
2624         * page/Page.h:
2625         (WebCore::Page::servicesOverlayController):
2626         Keep a ServicesOverlayController on Page.
2627
2628         * page/PageOverlay.cpp:
2629         (WebCore::PageOverlay::mouseEvent):
2630         Use windowToContents instead of rootViewToContents; events come in in window coordinates.
2631
2632         * page/PageOverlayController.cpp:
2633         (WebCore::PageOverlayController::updateSettingsForLayer):
2634         Get Settings from MainFrame, not Page.
2635
2636         * page/Settings.in:
2637         Add servicesControlsEnabled setting.
2638
2639         * page/mac/ServicesOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/ServicesOverlayController.h.
2640         * page/mac/ServicesOverlayController.mm: Renamed from Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm.
2641         Moved from WebKit2. Mostly mechanical changes, plus:
2642             - Use windowToContents instead of rootViewToContents; events come in in window coordinates.
2643             - Cut off rebuild* if serviceControlsEnabled setting is false
2644             - Don't create the overlay if serviceControlsEnabled setting is false
2645             - Send click events via ChromeClient.
2646             - Tie our lifetime to MainFrame instead of Page, and get lots of things from MainFrame instead.
2647
2648         * platform/Logging.h:
2649         Add Services logging channel (moved from WebKit2).
2650
2651 2014-10-09  Brent Fulgham  <bfulgham@apple.com>
2652
2653         [Win] Unreviewed build fix: Revert r174378
2654
2655         Roll back this change, as it didn't fix the EWS builders, and has only
2656         served to make Windows builds take forever.
2657
2658         * WebCore.vcxproj/WebCoreGenerated.make: Don't delete all generated content
2659         every time we build.
2660
2661 2014-10-09  Chris Dumez  <cdumez@apple.com>
2662
2663         Unreviewed GTK build fix after r174504.
2664
2665         Missing header include.
2666
2667         * rendering/svg/SVGTextQuery.cpp:
2668
2669 2014-10-09  Myles C. Maxfield  <mmaxfield@apple.com>
2670
2671         Remove second-to-last client of WebFontCache
2672         https://bugs.webkit.org/show_bug.cgi?id=137550
2673
2674         Reviewed by Darin Adler.
2675
2676         No new tests because no behavior change.
2677
2678         * WebCore.exp.in:
2679         * platform/graphics/FontCache.h: Allow migration of client to getCachedFontData()
2680
2681 2014-10-09  Chris Dumez  <cdumez@apple.com>
2682
2683         [Mac] Spending too much time mapping desired font families to available ones
2684         https://bugs.webkit.org/show_bug.cgi?id=137539
2685
2686         Reviewed by Darin Adler.
2687
2688         While profiling the load of weather.com, I noticed that we are spending
2689         quite a bit of time trying to map the font family requested to a font
2690         that is available on the system. The process involves:
2691         1. Doing a linear search of all the installed font families and do a
2692            case-insensitive string comparison for each of them until we find a
2693            match,
2694         2. Then, if we don't find a match, do another linear search of the
2695            fonts' postscript names this time and do again a case-insensitive
2696            string comparison for each of them.
2697
2698         This process is costly and the fonts requested by weather.com are not
2699         available, causing us to do 2 linear searches and a lot of string
2700         comparisons (accounting for ~2% of the WebProcess CPU time for the page
2701         load). As a result, we end up spending ~90ms in
2702         internalFontWithFamily() when loading weather.com.
2703
2704         This patch introduces a cache for the mapping between desired font
2705         families and available font families. This cuts the time spent in
2706         internalFontWithFamily() in half (~45ms). The cache gets invalidated
2707         when fonts are installed / uninstalled on the system so we don't break
2708         that scenario. The cache is also limited in size to avoid using too
2709         much memory.
2710
2711         No new tests, but manual testing making sure the cache gets invalidated
2712         when installing a font on the system.
2713
2714         * platform/graphics/mac/FontCacheMac.mm:
2715         (WebCore::invalidateFontCache):
2716         * platform/mac/WebFontCache.h:
2717         * platform/mac/WebFontCache.mm:
2718         (desiredFamilyToAvailableFamilyDictionary):
2719         (rememberDesiredFamilyToAvailableFamilyMapping):
2720         (+[WebFontCache internalFontWithFamily:traits:weight:size:]):
2721         (+[WebFontCache invalidate]):
2722
2723 2014-10-09  Bear Travis  <betravis@adobe.com>
2724
2725         [CSS Font Loading] Decrement the font loading count before notifying callbacks
2726         https://bugs.webkit.org/show_bug.cgi?id=137401
2727
2728         Reviewed by Alexey Proskuryakov.
2729
2730         In the callbacks, it should appear that font load has completed. This is
2731         accessed through loading(), which relies on the current number of
2732         fonts loading via JS and CSS.
2733
2734         Unskipping the failing test http/tests/webfont/fontloader-loading-attribute.html
2735         test which tests this.
2736
2737         * css/FontLoader.cpp:
2738         (WebCore::LoadFontCallback::notifyLoaded):
2739
2740 2014-10-09  Chris Dumez  <cdumez@apple.com>
2741
2742         Unreviewed Windows build fix after r174506.
2743
2744         We no longer needed to dereference as it is a reference instead of a
2745         pointer now.
2746
2747         * page/win/EventHandlerWin.cpp:
2748         (WebCore::EventHandler::passWheelEventToWidget):
2749
2750 2014-10-09  Chris Dumez  <cdumez@apple.com>
2751
2752         Use is<>() / downcast<>() for Widget subclasses
2753         https://bugs.webkit.org/show_bug.cgi?id=137549
2754
2755         Reviewed by Darin Adler.
2756
2757         Use is<>() / downcast<>() for Widget subclasses and clean up the
2758         surrounding code.
2759
2760         No new tests, no behavior change.
2761
2762         * accessibility/AXObjectCache.cpp:
2763         (WebCore::AXObjectCache::getOrCreate):
2764         * accessibility/AccessibilityObject.cpp:
2765         (WebCore::appendAccessibilityObject):
2766         * accessibility/AccessibilityRenderObject.cpp:
2767         (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
2768         * accessibility/AccessibilityScrollView.cpp:
2769         (WebCore::AccessibilityScrollView::webAreaObject):
2770         (WebCore::AccessibilityScrollView::documentFrameView):
2771         (WebCore::AccessibilityScrollView::parentObject):
2772         (WebCore::AccessibilityScrollView::parentObjectIfExists):
2773         * bindings/js/JSPluginElementFunctions.cpp:
2774         (WebCore::pluginScriptObjectFromPluginViewBase):
2775         * html/HTMLObjectElement.cpp:
2776         (WebCore::HTMLObjectElement::appendFormData):
2777         * html/HTMLPlugInElement.cpp:
2778         (WebCore::HTMLPlugInElement::canProcessDrag):
2779         (WebCore::HTMLPlugInElement::isKeyboardFocusable):
2780         (WebCore::HTMLPlugInElement::isUserObservable):
2781         * html/HTMLPlugInImageElement.cpp:
2782         (WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting):
2783         (WebCore::HTMLPlugInImageElement::subframeLoaderDidCreatePlugIn):
2784         * html/HTMLPlugInImageElement.h:
2785         * loader/SubframeLoader.cpp:
2786         (WebCore::SubframeLoader::loadPlugin):
2787         * page/DragController.cpp:
2788         (WebCore::DragController::operationForLoad):
2789         * page/EventHandler.cpp:
2790         (WebCore::EventHandler::subframeForTargetNode):
2791         (WebCore::EventHandler::handleWheelEvent):
2792         * page/EventHandler.h:
2793         * page/Frame.cpp:
2794         (WebCore::Frame::frameForWidget):
2795         * page/FrameView.cpp:
2796         (WebCore::FrameView::hasCustomScrollbars):
2797         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
2798         (WebCore::FrameView::convertToContainingView):
2799         (WebCore::FrameView::convertFromContainingView):
2800         (WebCore::FrameView::removeChild):
2801         * page/FrameView.h:
2802         * page/Page.cpp:
2803         (WebCore::Page::pluginViews):
2804         * page/efl/EventHandlerEfl.cpp:
2805         (WebCore::EventHandler::passWheelEventToWidget):
2806         * page/gtk/EventHandlerGtk.cpp:
2807         (WebCore::EventHandler::passWheelEventToWidget):
2808         * page/ios/EventHandlerIOS.mm:
2809         (WebCore::EventHandler::passWheelEventToWidget):
2810         * page/mac/EventHandlerMac.mm:
2811         (WebCore::EventHandler::passWheelEventToWidget):
2812         * page/scrolling/ScrollingCoordinator.cpp:
2813         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
2814         * page/win/EventHandlerWin.cpp:
2815         (WebCore::EventHandler::passWheelEventToWidget):
2816         * platform/ScrollView.cpp:
2817         (WebCore::ScrollView::removeChild):
2818         (WebCore::ScrollView::setHasHorizontalScrollbar):
2819         (WebCore::ScrollView::setHasVerticalScrollbar):
2820         * platform/ScrollView.h:
2821         * platform/Scrollbar.cpp:
2822         (WebCore::Scrollbar::root):
2823         Uninline as root() because Widget::root() returns a FrameView now and
2824         it is impossible to include FrameView.h in Scrollbar.h without causing
2825         a cycle.
2826
2827         * platform/Scrollbar.h:
2828         * platform/Widget.cpp:
2829         (WebCore::Widget::root):
2830         Use tighter typing and return a FrameView instead of a ScrollView.
2831
2832         (WebCore::Widget::removeFromParent):
2833         * platform/Widget.h:
2834         * platform/efl/WidgetEfl.cpp:
2835         (WebCore::Widget::setCursor):
2836         * platform/gtk/PlatformScreenGtk.cpp:
2837         * platform/gtk/WidgetGtk.cpp:
2838         (WebCore::Widget::setCursor):
2839         * platform/mac/PlatformScreenMac.mm:
2840         (WebCore::displayFromWidget):
2841         * platform/mac/WidgetMac.mm:
2842         (WebCore::Widget::setCursor):
2843         * platform/win/WidgetWin.cpp:
2844         (WebCore::Widget::setCursor):
2845         * plugins/PluginViewBase.h:
2846         * plugins/win/PluginViewWin.cpp:
2847         (WebCore::PluginView::updatePluginWidget):
2848         (WebCore::PluginView::paintIntoTransformedContext):
2849         (WebCore::PluginView::paintWindowedPluginIntoContext):
2850         (WebCore::PluginView::paint):
2851         (WebCore::PluginView::handleMouseEvent):
2852         (WebCore::PluginView::setNPWindowRect):
2853         (WebCore::PluginView::snapshot):
2854         * rendering/RenderEmbeddedObject.cpp:
2855         (WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing):
2856         (WebCore::RenderEmbeddedObject::nodeAtPoint):
2857         (WebCore::RenderEmbeddedObject::scroll):
2858         * rendering/RenderFrameBase.h:
2859         (WebCore::RenderFrameBase::childView):
2860         * rendering/RenderLayerBacking.cpp:
2861         (WebCore::RenderLayerBacking::layerWillBeDestroyed):
2862         (WebCore::RenderLayerBacking::updateConfiguration):
2863         * rendering/RenderLayerCompositor.cpp:
2864         (WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame):
2865         * rendering/RenderTreeAsText.cpp:
2866         (WebCore::write):
2867         * rendering/RenderWidget.cpp:
2868         (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets):
2869         (WebCore::RenderWidget::paintContents):
2870         (WebCore::RenderWidget::setOverlapTestResult):
2871         (WebCore::RenderWidget::updateWidgetPosition):
2872         (WebCore::RenderWidget::nodeAtPoint):
2873         (WebCore::RenderWidget::embeddedContentBox):
2874
2875 2014-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2876
2877         Layering violation: MediaPlayer should not reference/use FrameView
2878         https://bugs.webkit.org/show_bug.cgi?id=21562
2879
2880         Reviewed by Darin Adler.
2881
2882         Remove FrameView dependency from MediaPlayer.
2883
2884         * html/HTMLMediaElement.cpp:
2885         (WebCore::HTMLMediaElement::mediaPlayerIsInMediaDocument): Check if
2886         the element document is a media document.
2887         * html/HTMLMediaElement.h:
2888         * platform/graphics/MediaPlayer.cpp:
2889         (WebCore::MediaPlayer::MediaPlayer): Remove m_frameView initialization.
2890         (WebCore::MediaPlayer::inMediaDocument): Use the MediaPlayerClient
2891         to check if the media player is in a media document.
2892         * platform/graphics/MediaPlayer.h:
2893         (WebCore::MediaPlayerClient::mediaPlayerIsInMediaDocument):
2894         (WebCore::MediaPlayer::setFrameView): Deleted.
2895         (WebCore::MediaPlayer::frameView): Deleted.
2896         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2897         (WebCore::MediaPlayerPrivateAVFoundation::preferredRenderingMode):
2898         Do not check if the media player has a frame view, checking whether it's visible
2899         is enough.
2900         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2901         Remove unneeded header include.
2902         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
2903         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: Ditto.
2904         * rendering/RenderVideo.cpp:
2905         (WebCore::RenderVideo::~RenderVideo): Do not call MediaPlayer::setFrameView().
2906         (WebCore::RenderVideo::updatePlayer): Ditto.
2907
2908 2014-10-09  Christophe Dumez  <cdumez@apple.com>
2909
2910         Use is<>() / downcast<>() for RenderBlockFlow
2911         https://bugs.webkit.org/show_bug.cgi?id=137545
2912
2913         Reviewed by Darin Adler.
2914
2915         Use is<>() / downcast<>() for RenderBlockFlow and clean up the
2916         surrounding code.
2917
2918         No new tests, no behavior change.
2919
2920         * accessibility/AccessibilityRenderObject.cpp:
2921         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2922         * dom/Element.cpp:
2923         (WebCore::Element::renderNamedFlowFragment):
2924         (WebCore::Element::webkitGetRegionFlowRanges):
2925         * editing/Editor.cpp:
2926         (WebCore::Editor::hasBidiSelection):
2927         * inspector/InspectorOverlay.cpp:
2928         (WebCore::buildObjectForRegionHighlight):
2929         (WebCore::buildObjectForElementInfo):
2930         * rendering/EllipsisBox.h:
2931         * rendering/HitTestResult.cpp:
2932         (WebCore::HitTestResult::innerTextIfTruncated):
2933         * rendering/LayoutState.cpp:
2934         (WebCore::LayoutState::LayoutState):
2935         * rendering/RenderBlock.cpp:
2936         (WebCore::RenderBlock::removeChild):
2937         * rendering/RenderBlock.h:
2938         (WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo):
2939         * rendering/RenderBlockFlow.cpp:
2940         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
2941         (WebCore::RenderBlockFlow::layoutBlockChild):
2942         (WebCore::RenderBlockFlow::marginOffsetForSelfCollapsingBlock):
2943         (WebCore::RenderBlockFlow::marginValuesForChild):
2944         (WebCore::RenderBlockFlow::collapseMargins):
2945         (WebCore::RenderBlockFlow::marginBeforeEstimateForChild):
2946         (WebCore::RenderBlockFlow::handleAfterSideOfBlock):
2947         (WebCore::RenderBlockFlow::mustDiscardMarginBeforeForChild):
2948         (WebCore::RenderBlockFlow::mustDiscardMarginAfterForChild):
2949         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
2950         (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo):
2951         (WebCore::RenderBlockFlow::markAllDescendantsWithFloatsForLayout):
2952         (WebCore::RenderBlockFlow::adjustForBorderFit):
2953         (WebCore::getHeightForLineCount):
2954         * rendering/RenderBlockFlow.h:
2955         (WebCore::RenderElement::isRenderNamedFlowFragmentContainer):
2956         * rendering/RenderBlockLineLayout.cpp:
2957         (WebCore::RenderBlockFlow::createLineBoxes):
2958         * rendering/RenderBox.cpp:
2959         (WebCore::RenderBox::styleDidChange):
2960         * rendering/RenderBoxModelObject.cpp:
2961         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
2962         * rendering/RenderDeprecatedFlexibleBox.cpp:
2963         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2964         (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
2965         * rendering/RenderFlowThread.cpp:
2966         (WebCore::RenderFlowThread::removeFlowChildInfo):
2967         * rendering/RenderLayer.cpp:
2968         (WebCore::RenderLayer::updateLayerPositions):
2969         (WebCore::expandClipRectForRegionAndReflection):
2970         (WebCore::RenderLayer::calculateClipRects):
2971         * rendering/RenderLayerCompositor.cpp:
2972         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2973         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2974         * rendering/RenderMultiColumnFlowThread.cpp:
2975         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
2976         (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
2977         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
2978         * rendering/RenderMultiColumnFlowThread.h:
2979         * rendering/RenderMultiColumnSet.cpp:
2980         (WebCore::RenderMultiColumnSet::heightAdjustedForSetOffset):
2981         (WebCore::RenderMultiColumnSet::columnGap):
2982         * rendering/RenderMultiColumnSet.h:
2983         * rendering/RenderNamedFlowFragment.cpp:
2984         (WebCore::RenderNamedFlowFragment::fragmentContainer):
2985         * rendering/RenderObject.cpp:
2986         (WebCore::RenderObject::adjustComputedFontSizesOnBlocks):
2987         (WebCore::RenderObject::resetTextAutosizing):
2988         (WebCore::RenderObject::showLineTreeForThis):
2989         (WebCore::RenderObject::showRenderSubTreeAndMark):
2990         * rendering/RenderText.cpp:
2991         (WebCore::RenderText::setText):
2992         (WebCore::RenderText::ensureLineBoxes):
2993         (WebCore::RenderText::simpleLineLayout):
2994         * rendering/RenderTreeAsText.cpp:
2995         (WebCore::write):
2996         * rendering/RootInlineBox.cpp:
2997         (WebCore::RootInlineBox::selectionTopAdjustedForPrecedingBlock):
2998         (WebCore::RootInlineBox::blockFlow):
2999         * rendering/SimpleLineLayoutFunctions.cpp:
3000         (WebCore::SimpleLineLayout::computeTextBoundingBox):
3001         (WebCore::SimpleLineLayout::computeTextFirstRunLocation):
3002         (WebCore::SimpleLineLayout::collectTextAbsoluteRects):
3003         (WebCore::SimpleLineLayout::collectTextAbsoluteQuads):
3004         * rendering/svg/SVGTextQuery.cpp:
3005         (WebCore::flowBoxForRenderer):
3006
3007 2014-10-09  Philip Chimento  <philip.chimento@gmail.com>
3008
3009         [GTK] Netscape plugin API symbol used outside feature guards
3010         https://bugs.webkit.org/show_bug.cgi?id=137385
3011
3012         Reviewed by Philippe Normand.
3013
3014         * plugins/PluginPackage.cpp:
3015         (WebCore::PluginPackage::unload): Add guards for Netscape Plugin
3016         API around symbol, so that it compiles OK when the API is not
3017         available.
3018
3019 2014-10-08  Mihnea Ovidenie  <mihnea@adobe.com>
3020
3021         [CSSRegions]Remove unused parameter in adjustRegionBoundsFromFlowThreadPortionRect
3022         https://bugs.webkit.org/show_bug.cgi?id=137518
3023
3024         Reviewed by Andrei Bucur.
3025
3026         This method is used only by region code in accelerated compositing.
3027         The first parameter for the method was introduced with the intent to be used for multicolumn,
3028         but without being actually used in multicolumn code. Also make the method const.
3029         No new tests as no change in functionality.
3030
3031         * rendering/RenderLayerBacking.cpp:
3032         (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread):
3033         * rendering/RenderMultiColumnSet.cpp:
3034         (WebCore::RenderMultiColumnSet::adjustRegionBoundsFromFlowThreadPortionRect):
3035         * rendering/RenderMultiColumnSet.h:
3036         * rendering/RenderRegion.cpp:
3037         (WebCore::RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect):
3038         * rendering/RenderRegion.h:
3039
3040 2014-10-08  Andreas Kling  <akling@apple.com>
3041
3042         [Mac] Show repaint counters in tile coverage map.
3043         <https://webkit.org/b/137544>
3044
3045         Reviewed by Simon Fraser.
3046
3047         Add repaint counters to the tile layers in the "tiled scrolling
3048         indicator" display. This will be helpful for diagnosing issues with
3049         excessive tile repaints outside the visible viewport.
3050
3051         * platform/graphics/ca/TileController.cpp:
3052         (WebCore::TileController::setNeedsDisplayInRect):
3053         * platform/graphics/ca/TileGrid.cpp:
3054         (WebCore::TileGrid::drawTileMapContents):
3055
3056 2014-10-08  Myles C. Maxfield  <mmaxfield@apple.com>
3057
3058         Unreviewed build fix after r174480. Broke iOS build.
3059
3060         * rendering/RenderObject.cpp:
3061         (WebCore::includeNonFixedHeight):
3062
3063 2014-10-08  Myles C. Maxfield  <litherum@gmail.com>
3064
3065         Inline ruby does not get justified correctly
3066         https://bugs.webkit.org/show_bug.cgi?id=137421
3067
3068         Reviewed by Dave Hyatt.
3069
3070         We justify text in two passes: one counts expansion opportunities within a line,
3071         and the other doles out widths and expansion amounts to constituent inline boxes.
3072         This patch simply modifies both passes to descend into ruby bases. Once it has
3073         done so, we then re-layout the ruby run with the newly found width.
3074
3075         Tests: fast/ruby/ruby-justification-hittest.html
3076                fast/ruby/ruby-justification.html
3077
3078         * rendering/InlineBox.h:
3079         (WebCore::InlineBox::setExpansion): updateRubyForJustifiedText() has to set the
3080         expansion for an inline box, so make setExpansion() public.
3081         * rendering/RenderBlockLineLayout.cpp:
3082         (WebCore::updateRubyForJustifiedText): Given values that have already been
3083         computed in computeInlineDirectionPositionsForSegment(), adjust the widths and
3084         expansion values for all the various pieces of ruby.
3085         (WebCore::computeExpansionForJustifiedText): Call updateRubyForJustifiedText() if
3086         necessary.
3087         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment): When
3088         counting expansion opportunities in a line, include ruby bases.
3089         * rendering/RenderRubyRun.h: Fix grammar in comment.
3090         * rendering/RenderText.cpp:
3091         (WebCore::RenderText::stringView): Give default arguments to function.
3092         * rendering/RenderText.h: Ditto.
3093
3094 2014-10-08  Dean Jackson  <dino@apple.com>
3095
3096         PopupMenus should indicate if they are using a custom rendering
3097         https://bugs.webkit.org/show_bug.cgi?id=137543
3098         <rdar://problem/18544212>
3099
3100         Reviewed by Beth Dakin.
3101
3102         On Yosemite there is an animation as a popup menu closes. We can't use
3103         this when there is a custom rendering, since the animation doesn't match
3104         the final result. Implement this by hooking into the existing code
3105         for hiding the arrows during animation - a WebKitSystemInterface update
3106         will implement the other side.
3107
3108         * platform/mac/WebCoreSystemInterface.h: Rename parameter to be more clear.
3109         * platform/mac/WebCoreSystemInterface.mm:
3110         * rendering/RenderMenuList.cpp:
3111         (RenderMenuList::menuStyle): We need to check that we are a native-looking
3112         button, not just something with appearance.
3113
3114 2014-10-08  Christophe Dumez  <cdumez@apple.com>
3115
3116         Use is<>() / downcast<>() for RenderBlock objects
3117         https://bugs.webkit.org/show_bug.cgi?id=137512
3118
3119         Reviewed by Darin Adler.
3120
3121         Use is<>() / downcast<>() for RenderBlock objects and clean up the
3122         surrounding code.
3123
3124         No new tests, no behavior change.
3125
3126         * accessibility/AccessibilityRenderObject.cpp:
3127         (WebCore::firstChildConsideringContinuation):
3128         (WebCore::lastChildConsideringContinuation):
3129         (WebCore::AccessibilityRenderObject::firstChild):
3130         (WebCore::startOfContinuations):
3131         (WebCore::endOfContinuations):
3132         (WebCore::childBeforeConsideringContinuations):
3133         (WebCore::AccessibilityRenderObject::previousSibling):
3134         (WebCore::AccessibilityRenderObject::nextSibling):
3135         (WebCore::nextContinuation):
3136         (WebCore::AccessibilityRenderObject::renderParentObject):
3137         (WebCore::AccessibilityRenderObject::anchorElement):
3138         (WebCore::AccessibilityRenderObject::setValue):
3139         * bindings/objc/DOMUIKitExtensions.mm:
3140         (-[DOMNode containsOnlyInlineObjects]):
3141         (-[DOMNode isSelectableBlock]):
3142         (-[DOMHTMLElement structuralComplexityContribution]):
3143         * css/CSSComputedStyleDeclaration.cpp:
3144         (WebCore::valueForGridTrackList):
3145         * editing/CompositeEditCommand.cpp:
3146         (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
3147         * editing/TextIterator.cpp:
3148         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
3149         * page/ios/FrameIOS.mm:
3150         (WebCore::Frame::preferredHeight):
3151         * rendering/LogicalSelectionOffsetCaches.h:
3152         (WebCore::containingBlockForFixedPosition):
3153         (WebCore::containingBlockForAbsolutePosition):
3154         (WebCore::containingBlockForObjectInFlow):
3155         * rendering/RenderBlock.cpp:
3156         (WebCore::RenderBlock::styleWillChange):
3157         (WebCore::RenderBlock::continuationBefore):
3158         (WebCore::RenderBlock::splitBlocks):
3159         (WebCore::RenderBlock::addChildIgnoringContinuation):
3160         (WebCore::canMergeAnonymousBlock):
3161         (WebCore::canMergeContiguousAnonymousBlocks):
3162         (WebCore::RenderBlock::collapseAnonymousBoxChild):
3163         (WebCore::RenderBlock::removeChild):
3164         (WebCore::RenderBlock::blockElementContinuation):
3165         (WebCore::RenderBlock::blockSelectionGaps):
3166         (WebCore::RenderBlock::blockBeforeWithinSelectionRoot):
3167         (WebCore::isChildHitTestCandidate):
3168         (WebCore::RenderBlock::firstLineBlock):
3169         (WebCore::findFirstLetterBlock):
3170         (WebCore::RenderBlock::childBecameNonInline):
3171         (WebCore::RenderBlock::hasMarginBeforeQuirk):
3172         (WebCore::RenderBlock::hasMarginAfterQuirk):
3173         * rendering/RenderBlock.h:
3174         * rendering/RenderBlockFlow.cpp:
3175         (WebCore::RenderBlockFlow::marginBeforeEstimateForChild):
3176         (WebCore::RenderBlockFlow::estimateLogicalTopPosition):
3177         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
3178         (WebCore::RenderBlockFlow::positionNewFloats):
3179         (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
3180         * rendering/RenderBlockLineLayout.cpp:
3181         (WebCore::RenderBlockFlow::positionNewFloatOnLine):
3182         * rendering/RenderBox.cpp:
3183         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
3184         (WebCore::RenderBox::availableLogicalHeightUsing):
3185         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
3186         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
3187         (WebCore::computeInlineStaticDistance):
3188         (WebCore::RenderBox::computePositionedLogicalWidth):
3189         (WebCore::RenderBox::computePositionedLogicalHeight):
3190         * rendering/RenderBoxModelObject.cpp:
3191         (WebCore::accumulateInFlowPositionOffsets):
3192         (WebCore::RenderBoxModelObject::moveChildTo):
3193         (WebCore::RenderBoxModelObject::moveChildrenTo):
3194         * rendering/RenderElement.cpp:
3195         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
3196         * rendering/RenderFlowThread.cpp:
3197         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
3198         * rendering/RenderFullScreen.cpp:
3199         (WebCore::RenderFullScreen::unwrapRenderer):
3200         * rendering/RenderInline.cpp:
3201         (WebCore::RenderInline::inlineElementContinuation):
3202         (WebCore::updateStyleOfAnonymousBlockContinuations):
3203         (WebCore::RenderInline::styleDidChange):
3204         (WebCore::nextContinuation):
3205         (WebCore::RenderInline::splitFlow):
3206         (WebCore::RenderInline::positionForPoint):
3207         * rendering/RenderLayer.cpp:
3208         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
3209         (WebCore::RenderLayer::calculateClipRects):
3210         * rendering/RenderListItem.cpp:
3211         (WebCore::getParentOfFirstLineBox):
3212         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
3213         (WebCore::RenderListItem::positionListMarker):
3214         * rendering/RenderNamedFlowFragment.cpp:
3215         (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
3216         * rendering/RenderObject.cpp:
3217         (WebCore::includeNonFixedHeight):
3218         (WebCore::RenderObject::checkBlockPositionedObjectsNeedLayout):
3219         (WebCore::RenderObject::containingBlock):
3220         (WebCore::RenderObject::handleDynamicFloatPositionChange):
3221         (WebCore::RenderObject::removeAnonymousWrappersForInlinesIfNecessary):
3222         (WebCore::RenderObject::getTextDecorationColors):
3223         * rendering/RenderRuby.cpp:
3224         (WebCore::rubyBeforeBlock):
3225         (WebCore::rubyAfterBlock):
3226         * rendering/RenderRubyBase.cpp:
3227         (WebCore::RenderRubyBase::moveInlineChildren):
3228         (WebCore::RenderRubyBase::moveBlockChildren):
3229         * rendering/RenderThemeMac.mm:
3230         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
3231         * rendering/TextAutosizer.cpp:
3232         (WebCore::TextAutosizer::processSubtree):
3233         (WebCore::TextAutosizer::processContainer):
3234         (WebCore::TextAutosizer::measureDescendantTextWidth):
3235         (WebCore::TextAutosizer::findDeepestBlockContainingAllText):
3236         (WebCore::TextAutosizer::findFirstTextLeafNotInCluster):
3237         * rendering/mathml/RenderMathMLRoot.cpp:
3238         (WebCore::RenderMathMLRoot::layout):
3239
3240 2014-10-08  Jer Noble  <jer.noble@apple.com>
3241
3242         Unreviewed follow-up fix for r174460. Do not register for KVOs if the object does not respond to the requested property.
3243
3244         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
3245         (-[CDMSessionMediaSourceAVFObjCObserver beginObserving:]):
3246         (-[CDMSessionMediaSourceAVFObjCObserver stopObserving:]):
3247         (-[CDMSessionMediaSourceAVFObjCObserver invalidate]):
3248
3249 2014-10-08  Dean Jackson  <dino@apple.com>
3250
3251         Add deprecation warning for CSSKeyframesRule::appendRule
3252         https://bugs.webkit.org/show_bug.cgi?id=137532
3253         <rdar://problem/18585745>
3254
3255         Reviewed by Brent Fulgham.
3256
3257         In r173982 (webkit.org/b/57910) we added insertRule to match
3258         the spec. We should print a warning to the JS console suggesting
3259         users move to insertRule.
3260
3261         * css/WebKitCSSKeyframesRule.cpp:
3262         (WebCore::WebKitCSSKeyframesRule::appendRule): Add a message to the system
3263         console.
3264         * css/WebKitCSSKeyframesRule.h:
3265
3266 2014-10-08  Myles C. Maxfield  <mmaxfield@apple.com>
3267
3268         Text drawn with an SVG font has no spaces when word-rounding hacks are enabled
3269         https://bugs.webkit.org/show_bug.cgi?id=137463
3270
3271         Reviewed by Darin Adler.
3272
3273         When rounding hacks are enabled, we use the "adjusted space width" instead of the
3274         regular space width. However, the SVG-font-specific implementation of the
3275         SimpleFontData constructor doesn't initialize this value, so it was getting set
3276         to an undefined value (which happened to be close to 0 in my tests).
3277
3278         Test: svg/text/svg-font-word-rounding-hacks-spaces.html
3279
3280         * css/CSSFontFaceSource.cpp:
3281         (WebCore::CSSFontFaceSource::getFontData):
3282         (WebCore::CSSFontFaceSource::ensureFontData):
3283         * loader/cache/CachedFont.cpp:
3284         (WebCore::CachedFont::ensureCustomFontData):
3285         (WebCore::CachedFont::getSVGFontById):
3286         * platform/graphics/SimpleFontData.h:
3287         * svg/SVGFontData.cpp:
3288         (WebCore::SVGFontData::initializeFontData):
3289
3290 2014-10-08  Brent Fulgham  <bfulgham@apple.com>
3291
3292         [Win] Resolve various static analyzer warnings in WebCore.
3293         https://bugs.webkit.org/show_bug.cgi?id=137526
3294
3295         Reviewed by Dean Jackson.
3296
3297         A series of small changes to resolve various issues found by the MSVC static analyzer.
3298
3299         * inspector/NetworkResourcesData.cpp:
3300         (WebCore::NetworkResourcesData::clear): Add assertion that it->value should never be null.
3301         * page/SessionIDHash.h:
3302         (WTF::HashTraits<WebCore::SessionID>::constructDeletedValue): Add explicit cast to avoid
3303         compiler warning.
3304         (WTF::HashTraits<WebCore::SessionID>::isDeletedValue): Ditto.
3305         * page/win/FrameCGWin.cpp:
3306         (WebCore::imageFromRect): Resolve static analyzer warnings by initializing bits, and
3307         checking the return value of ::CreateDIBSection, which return nullptr on error.
3308         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3309         (printLayer): Use correct MSVC format specifier for size_t.
3310         * platform/graphics/win/FontCacheWin.cpp:
3311         (WebCore::getLinkedFonts): Handle possibility that a font link key does not exist.
3312         (WebCore::FontCache::systemFallbackForCharacters): Handle error case when a valid code page
3313         does not exist for a given character.
3314         * platform/graphics/win/SimpleFontDataWin.cpp:
3315         (WebCore::SimpleFontData::containsCharacters): Handle error cases for mapping to the CP_ACP code page,
3316         and related failures when attempting to access the contents of a given code page.
3317         * platform/graphics/win/UniscribeController.cpp:
3318         (WebCore::UniscribeController::itemizeShapeAndPlace): Handle possible failure in the
3319         ScriptItemize API call.
3320         (WebCore::UniscribeController::shapeAndPlaceItem): Ditto for ScriptXtoCP API call.
3321         * platform/win/BString.h: Use consistent SAL annotations for our typedeof of BSTR as in
3322         the system header.
3323         * platform/win/COMPtr.h: Ditto for HRESULT.
3324         * platform/win/DragImageCGWin.cpp:
3325         (WebCore::allocImage): Handle case of failing CreateDIBSection API call.
3326         * platform/win/PopupMenuWin.cpp:
3327         (WebCore::PopupMenuWin::show): Handle case of failing SystemParamtersInfo API call.
3328         (WebCore::PopupMenuWin::wndProc): Ditto.
3329
3330 2014-10-07  Jer Noble  <jer.noble@apple.com>
3331
3332         [EME][Mac] Update CDMSessionMediaSourceAVFObjC to match new API provided by AVStreamSession
3333         https://bugs.webkit.org/show_bug.cgi?id=137469
3334
3335         Reviewed by Brent Fulgham.
3336
3337         Update our forward declaration to match the API provided by AVStreamSession.
3338         AVStreamSession now takes an error: parameter in its initialiazer. It also provides the
3339         sessionIdentifier used by the CDM, which CDMSessionMediaSourceAVFObjC will use as the
3340         value of sessionId. Having this identifier allows us to fire a
3341         secure-proof-of-key-release message after the client calls MediaKeySession.close().
3342         Because this call will now generate messages, which have to be responded to in order
3343         to remove those proofs from storage, do not clear the CDMSession from MediaKeySession
3344         after calling close().
3345
3346         * Modules/encryptedmedia/MediaKeySession.cpp:
3347         (WebCore::MediaKeySession::~MediaKeySession):
3348         (WebCore::MediaKeySession::close):
3349         (WebCore::MediaKeySession::setError): Deleted.
3350         (WebCore::MediaKeySession::sessionId): Deleted.
3351         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
3352         (WebCore::CDMSessionMediaSourceAVFObjC::setSessionId):
3353         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
3354         (-[CDMSessionMediaSourceAVFObjCListener initWithParent:]):
3355         (-[CDMSessionMediaSourceAVFObjCObserver dealloc]):
3356         (-[CDMSessionMediaSourceAVFObjCObserver beginObserving:]):
3357         (-[CDMSessionMediaSourceAVFObjCObserver stopObserving:]):
3358         (-[CDMSessionMediaSourceAVFObjCObserver invalidate]):
3359         (-[CDMSessionMediaSourceAVFObjCListener observeValueForKeyPath:ofObject:change:context:]):
3360         (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
3361         (WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC):
3362         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys):
3363         (WebCore::CDMSessionMediaSourceAVFObjC::update):
3364         (WebCore::CDMSessionMediaSourceAVFObjC::addSourceBuffer):
3365         (WebCore::CDMSessionMediaSourceAVFObjC::removeSourceBuffer):
3366
3367 2014-10-08  Chris Dumez  <cdumez@apple.com>
3368
3369         Unreviewed build fix after r174456.
3370
3371         I was comparing a signed int to an unsigned one.
3372
3373         * platform/graphics/mac/FontCacheMac.mm:
3374         (WebCore::shouldAutoActivateFontIfNeeded):
3375
3376 2014-10-08  Christophe Dumez  <cdumez@apple.com>
3377
3378         [Mac] We are spending a lot of time loading fonts when loading weather.com
3379         https://bugs.webkit.org/show_bug.cgi?id=137454
3380
3381         Reviewed by Darin Adler.
3382
3383         We are spending a lot of time loading fonts when loading weather.com:
3384         ~4.2% of WebProcess's cpu time in FontCache::getCachedFrontData().
3385         In particular, we are spending a lot of time doing font auto-activation
3386         because we don't have the Open Sans fonts installed and weather.com is
3387         trying to load those.
3388
3389         Before this patch, we were doing font auto-activation ~250 times when
3390         loading weather.com, even though the site is loading ~10 distinct font
3391         families.
3392
3393         This patch adds a cache of font families we already tried to
3394         auto-activate so that we don't try again. This results in ~10 font
3395         auto-activations when loading weather.com instead of 250. It reduces
3396         the amount of time spent in getCachedFrontData() to 62.6ms from 276ms
3397         (4.4x less) when loading weather.com.
3398
3399         No new tests, no behavior change.
3400
3401         * platform/graphics/mac/FontCacheMac.mm:
3402         (WebCore::shouldAutoActivateFontIfNeeded):
3403         (WebCore::FontCache::createFontPlatformData):
3404         * platform/mac/WebFontCache.h:
3405         * platform/mac/WebFontCache.mm:
3406         (+[WebFontCache fontWithFamily:traits:weight:size:shouldAutoActivateIfNeeded:]):
3407         (+[WebFontCache fontWithFamily:traits:weight:size:]):
3408         (+[WebFontCache fontWithFamily:traits:size:]):
3409
3410 2014-10-08  Darin Adler  <darin@apple.com>
3411
3412         ASSERTION FAILED: underlyingStringIsValid()
3413         https://bugs.webkit.org/show_bug.cgi?id=137502
3414
3415         Reviewed by Anders Carlsson.
3416
3417         * rendering/RenderTreeAsText.cpp:
3418         (WebCore::quoteAndEscapeNonPrintables): Take a StringView instead of a String.
3419         (WebCore::writeTextRun): Ditto.
3420         (WebCore::writeSimpleLine): Ditto.
3421
3422         * rendering/RenderTreeAsText.h: Removed unneeded include, tweaked formatting,
3423         changed quoteAndEscapeNonPrintables to take a StringView.
3424
3425         * rendering/SimpleLineLayoutFunctions.cpp:
3426         (WebCore::SimpleLineLayout::paintFlow): Tighten code using a modern for loop.
3427         (WebCore::SimpleLineLayout::showLineLayoutForFlow): Update to work with a
3428         StringView result for SimpleLineLayout::RunResolver::Run::text.
3429
3430         * rendering/SimpleLineLayoutResolver.h:
3431         (WebCore::SimpleLineLayout::RunResolver::Run::text): Changed return type to
3432         StringView to fix the lifetime bug and also to improve performance by getting
3433