Fix FrameLoader build without video
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-05-21  Olivier Blin  <olivier.blin@softathome.com>
2
3         Fix FrameLoader build without video
4         https://bugs.webkit.org/show_bug.cgi?id=185821
5
6         Reviewed by Michael Catanzaro.
7
8         Regression(r231392): Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
9         https://bugs.webkit.org/show_bug.cgi?id=185288
10
11         No new tests, build fix only.
12
13         * loader/FrameLoader.cpp:
14         (WebCore::FrameLoader::checkCompleted): Flag HTMLMediaElement::isRunningDestructor() usage.
15
16 2018-05-21  Sam Weinig  <sam@webkit.org>
17
18         Modernize RenderStyleConstants.h - Part 1
19         https://bugs.webkit.org/show_bug.cgi?id=185809
20
21         Reviewed by Yusuke Suzuki.
22             
23         Modernized the first set of enums in RenderStyleConstants.h by:
24             - Converting them to enum classes
25             - Renaming them to remove unnecessary prefix 'E's
26             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
27             - Renaming to match modern conventions (e.g BNONE -> None)
28             - Reformatting them so that each value is on its own line.
29
30         Modernizes the following enums:
31             PrintColorAdjust
32             StyleDifference
33             StyleDifferenceContextSensitiveProperty
34             ColumnFill
35             ColumnSpan
36             BorderCollapse (renamed from EBorderCollapse)
37             BorderStyle (renamed from EBorderStyle)
38             BorderPrecedence (renamed from EBorderPrecedence)
39             OutlineIsAuto
40             PositionType (renamed from EPosition)
41             Float (renamed from EFloat)
42             MarginCollapse (renamed from EMarginCollapse)
43             BoxDecorationBreak (renamed from EBoxDecorationBreak)
44             BoxSizing (renamed from EBoxSizing)
45             Overflow (renamed from EOverflow)
46             VerticalAlign (renamed from EVerticalAlign)
47             Clear (renamed from EClear)
48             TableLayoutType (renamed from ETableLayout)
49             TextCombine
50             FillAttachment (renamed from EFillAttachment)
51             FillBox (renamed from EFillBox)
52             FillRepeat (renamed from EFillRepeat)
53             FillLayerType (renamed from EFillLayerType)
54             FillSizeType (renamed from EFillSizeType)
55             MaskSourceType (renamed from EMaskSourceType)
56             BoxPack (renamed from EBoxPack)
57             BoxAlignment (renamed from EBoxAlignment)
58             BoxOrient (renamed from EBoxOrient)
59             BoxLines (renamed from EBoxLines)
60             BoxDirection (renamed from EBoxDirection)
61             AlignContent (renamed from EAlignContent)
62             FlexDirection (renamed from EFlexDirection)
63             FlexWrap (renamed from EFlexWrap)
64             ItemPosition
65             OverflowAlignment
66             ItemPositionType
67             ContentPosition
68             ContentDistribution (renamed from ContentDistributionType)
69             TextSecurity (renamed from ETextSecurity)
70             UserModify (renamed from EUserModify)
71             UserDrag (renamed from EUserDrag)
72             UserSelect (renamed from EUserSelect)
73             ObjectFit
74             AspectRatioType
75             WordBreak (renamed from EWordBreak)
76             OverflowWrap (renamed from EOverflowWrap)
77             NBSPMode (renamed from ENBSPMode)
78             LineBreak
79             Resize (renamed from EResize)
80             QuoteType
81             TransformStyle3D (renamed from ETransformStyle3D)
82             BackfaceVisibility (renamed from EBackfaceVisibility)
83             LineClamp (renamed from ELineClamp)
84             TextOverflow
85             ImageRendering (renamed from EImageRendering)
86             TextIndentLine
87             TextIndentType
88             Isolation
89
90         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
91         (AXAttributeStringSetStyle):
92         * css/BasicShapeFunctions.cpp:
93         (WebCore::valueForCenterCoordinate):
94         (WebCore::valueForBasicShape):
95         * css/CSSComputedStyleDeclaration.cpp:
96         (WebCore::sizingBox):
97         (WebCore::fillRepeatToCSSValue):
98         (WebCore::fillSourceTypeToCSSValue):
99         (WebCore::fillSizeToCSSValue):
100         (WebCore::valueForItemPositionWithOverflowAlignment):
101         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
102         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
103         * css/CSSPrimitiveValueMappings.h:
104         (WebCore::CSSPrimitiveValue::operator LineClampValue const):
105         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
106         (WebCore::CSSPrimitiveValue::operator ColumnFill const):
107         (WebCore::CSSPrimitiveValue::operator ColumnSpan const):
108         (WebCore::CSSPrimitiveValue::operator PrintColorAdjust const):
109         (WebCore::CSSPrimitiveValue::operator BorderStyle const):
110         (WebCore::CSSPrimitiveValue::operator OutlineIsAuto const):
111         (WebCore::CSSPrimitiveValue::operator BackfaceVisibility const):
112         (WebCore::CSSPrimitiveValue::operator FillAttachment const):
113         (WebCore::CSSPrimitiveValue::operator FillBox const):
114         (WebCore::CSSPrimitiveValue::operator FillRepeat const):
115         (WebCore::CSSPrimitiveValue::operator BoxPack const):
116         (WebCore::CSSPrimitiveValue::operator BoxAlignment const):
117         (WebCore::CSSPrimitiveValue::operator BoxDecorationBreak const):
118         (WebCore::CSSPrimitiveValue::operator BoxSizing const):
119         (WebCore::CSSPrimitiveValue::operator BoxDirection const):
120         (WebCore::CSSPrimitiveValue::operator BoxLines const):
121         (WebCore::CSSPrimitiveValue::operator BoxOrient const):
122         (WebCore::CSSPrimitiveValue::operator Clear const):
123         (WebCore::CSSPrimitiveValue::operator FlexDirection const):
124         (WebCore::CSSPrimitiveValue::operator AlignContent const):
125         (WebCore::CSSPrimitiveValue::operator FlexWrap const):
126         (WebCore::CSSPrimitiveValue::operator Float const):
127         (WebCore::CSSPrimitiveValue::operator LineBreak const):
128         (WebCore::CSSPrimitiveValue::operator MarginCollapse const):
129         (WebCore::CSSPrimitiveValue::operator NBSPMode const):
130         (WebCore::CSSPrimitiveValue::operator Overflow const):
131         (WebCore::CSSPrimitiveValue::operator PositionType const):
132         (WebCore::CSSPrimitiveValue::operator Resize const):
133         (WebCore::CSSPrimitiveValue::operator TableLayoutType const):
134         (WebCore::CSSPrimitiveValue::operator TextSecurity const):
135         (WebCore::CSSPrimitiveValue::operator UserDrag const):
136         (WebCore::CSSPrimitiveValue::operator UserModify const):
137         (WebCore::CSSPrimitiveValue::operator UserSelect const):
138         (WebCore::CSSPrimitiveValue::operator VerticalAlign const):
139         (WebCore::CSSPrimitiveValue::operator WordBreak const):
140         (WebCore::CSSPrimitiveValue::operator OverflowWrap const):
141         (WebCore::CSSPrimitiveValue::operator TextCombine const):
142         (WebCore::CSSPrimitiveValue::operator TextOverflow const):
143         (WebCore::CSSPrimitiveValue::operator ObjectFit const):
144         (WebCore::CSSPrimitiveValue::operator Isolation const):
145         (WebCore::CSSPrimitiveValue::operator BorderCollapse const):
146         (WebCore::CSSPrimitiveValue::operator ImageRendering const):
147         (WebCore::CSSPrimitiveValue::operator TransformStyle3D const):
148         (WebCore::CSSPrimitiveValue::operator ItemPosition const):
149         (WebCore::CSSPrimitiveValue::operator OverflowAlignment const):
150         (WebCore::CSSPrimitiveValue::operator ContentPosition const):
151         (WebCore::CSSPrimitiveValue::operator ContentDistribution const):
152         (WebCore::CSSPrimitiveValue::operator EBorderStyle const): Deleted.
153         (WebCore::CSSPrimitiveValue::operator EBackfaceVisibility const): Deleted.
154         (WebCore::CSSPrimitiveValue::operator EFillAttachment const): Deleted.
155         (WebCore::CSSPrimitiveValue::operator EFillBox const): Deleted.
156         (WebCore::CSSPrimitiveValue::operator EFillRepeat const): Deleted.
157         (WebCore::CSSPrimitiveValue::operator EBoxPack const): Deleted.
158         (WebCore::CSSPrimitiveValue::operator EBoxAlignment const): Deleted.
159         (WebCore::CSSPrimitiveValue::operator EBoxDecorationBreak const): Deleted.
160         (WebCore::CSSPrimitiveValue::operator EBoxSizing const): Deleted.
161         (WebCore::CSSPrimitiveValue::operator EBoxDirection const): Deleted.
162         (WebCore::CSSPrimitiveValue::operator EBoxLines const): Deleted.
163         (WebCore::CSSPrimitiveValue::operator EBoxOrient const): Deleted.
164         (WebCore::CSSPrimitiveValue::operator EClear const): Deleted.
165         (WebCore::CSSPrimitiveValue::operator EFlexDirection const): Deleted.
166         (WebCore::CSSPrimitiveValue::operator EAlignContent const): Deleted.
167         (WebCore::CSSPrimitiveValue::operator EFlexWrap const): Deleted.
168         (WebCore::CSSPrimitiveValue::operator EFloat const): Deleted.
169         (WebCore::CSSPrimitiveValue::operator EMarginCollapse const): Deleted.
170         (WebCore::CSSPrimitiveValue::operator ENBSPMode const): Deleted.
171         (WebCore::CSSPrimitiveValue::operator EOverflow const): Deleted.
172         (WebCore::CSSPrimitiveValue::operator EPosition const): Deleted.
173         (WebCore::CSSPrimitiveValue::operator EResize const): Deleted.
174         (WebCore::CSSPrimitiveValue::operator ETableLayout const): Deleted.
175         (WebCore::CSSPrimitiveValue::operator ETextSecurity const): Deleted.
176         (WebCore::CSSPrimitiveValue::operator EUserDrag const): Deleted.
177         (WebCore::CSSPrimitiveValue::operator EUserModify const): Deleted.
178         (WebCore::CSSPrimitiveValue::operator EUserSelect const): Deleted.
179         (WebCore::CSSPrimitiveValue::operator EVerticalAlign const): Deleted.
180         (WebCore::CSSPrimitiveValue::operator EWordBreak const): Deleted.
181         (WebCore::CSSPrimitiveValue::operator EOverflowWrap const): Deleted.
182         (WebCore::CSSPrimitiveValue::operator EBorderCollapse const): Deleted.
183         (WebCore::CSSPrimitiveValue::operator EImageRendering const): Deleted.
184         (WebCore::CSSPrimitiveValue::operator ETransformStyle3D const): Deleted.
185         (WebCore::CSSPrimitiveValue::operator ContentDistributionType const): Deleted.
186         * css/CSSProperties.json:
187         * css/CSSToStyleMap.cpp:
188         (WebCore::CSSToStyleMap::mapFillAttachment):
189         (WebCore::CSSToStyleMap::mapFillSize):
190         (WebCore::CSSToStyleMap::mapFillMaskSourceType):
191         * css/CSSValueKeywords.in:
192         * css/StyleBuilderConverter.h:
193         (WebCore::StyleBuilderConverter::convertResize):
194         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
195         * css/StyleBuilderCustom.h:
196         (WebCore::StyleBuilderCustom::applyValueTextIndent):
197         (WebCore::StyleBuilderCustom::applyInheritWebkitAspectRatio):
198         (WebCore::StyleBuilderCustom::applyValueWebkitAspectRatio):
199         (WebCore::StyleBuilderCustom::applyValueContent):
200         * css/StyleResolver.cpp:
201         (WebCore::isScrollableOverflow):
202         (WebCore::StyleResolver::adjustRenderStyle):
203         * css/StyleResolver.h:
204         * css/makeprop.pl:
205         (getFillLayerType):
206         * dom/Element.h:
207         * dom/Node.cpp:
208         (WebCore::computeEditabilityFromComputedStyle):
209         (WebCore::Node::canStartSelection const):
210         * dom/Position.cpp:
211         (WebCore::Position::nodeIsUserSelectNone):
212         (WebCore::Position::nodeIsUserSelectAll):
213         * dom/Range.cpp:
214         (WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const):
215         * editing/ApplyBlockElementCommand.cpp:
216         (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
217         * editing/DeleteSelectionCommand.cpp:
218         (WebCore::DeleteSelectionCommand::doApply):
219         * editing/Editing.cpp:
220         (WebCore::isSpecialHTMLElement):
221         * editing/EditorCommand.cpp:
222         (WebCore::verticalScrollDistance):
223         * editing/ReplaceSelectionCommand.cpp:
224         (WebCore::ReplaceSelectionCommand::doApply):
225         * editing/SimplifyMarkupCommand.cpp:
226         (WebCore::SimplifyMarkupCommand::doApply):
227         * editing/VisibleUnits.cpp:
228         (WebCore::backwardSearchForBoundaryWithTextIterator):
229         (WebCore::forwardSearchForBoundaryWithTextIterator):
230         * editing/cocoa/EditorCocoa.mm:
231         (WebCore::Editor::fontAttributesForSelectionStart const):
232         * editing/cocoa/HTMLConverter.mm:
233         (WebCore::editingAttributedStringFromRange):
234         * html/HTMLInputElement.cpp:
235         (WebCore::HTMLInputElement::shouldTruncateText const):
236         (WebCore::HTMLInputElement::createInnerTextStyle):
237         * html/HTMLTextFormControlElement.cpp:
238         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
239         * html/shadow/SliderThumbElement.cpp:
240         (WebCore::RenderSliderContainer::layout):
241         * html/shadow/TextControlInnerElements.cpp:
242         (WebCore::TextControlInnerContainer::resolveCustomStyle):
243         (WebCore::TextControlInnerElement::resolveCustomStyle):
244         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
245         * layout/displaytree/DisplayBox.cpp:
246         (WebCore::Display::Box::borderBox const):
247         (WebCore::Display::Box::contentBox const):
248         * layout/displaytree/DisplayBox.h:
249         * layout/layouttree/LayoutBox.cpp:
250         (WebCore::Layout::Box::isRelativelyPositioned const):
251         (WebCore::Layout::Box::isStickyPositioned const):
252         (WebCore::Layout::Box::isAbsolutelyPositioned const):
253         (WebCore::Layout::Box::isFixedPositioned const):
254         (WebCore::Layout::Box::isFloatingPositioned const):
255         (WebCore::Layout::Box::isOverflowVisible const):
256         * page/DragController.cpp:
257         (WebCore::DragController::draggableElement const):
258         * page/Frame.cpp:
259         (WebCore::Frame::rangeForPoint):
260         * page/FrameView.cpp:
261         (WebCore::paginationModeForRenderStyle):
262         (WebCore::FrameView::applyOverflowToViewport):
263         (WebCore::FrameView::applyPaginationToViewport):
264         (WebCore::FrameView::calculateScrollbarModesForLayout):
265         (WebCore::FrameView::calculateExtendedBackgroundMode const):
266         (WebCore::FrameView::adjustScrollStepForFixedContent):
267         * page/SpatialNavigation.cpp:
268         (WebCore::canScrollInDirection):
269         (WebCore::canBeScrolledIntoView):
270         * page/ios/FrameIOS.mm:
271         (WebCore::Frame::nodeRespondingToScrollWheelEvents):
272         * page/mac/EventHandlerMac.mm:
273         (WebCore::scrolledToEdgeInDominantDirection):
274         * rendering/BorderEdge.cpp:
275         (WebCore::BorderEdge::BorderEdge):
276         (WebCore::BorderEdge::obscuresBackgroundEdge const):
277         (WebCore::BorderEdge::obscuresBackground const):
278         * rendering/BorderEdge.h:
279         (WebCore::BorderEdge::style const):
280         (WebCore::BorderEdge::hasVisibleColorAndStyle const):
281         * rendering/FlexibleBoxAlgorithm.h:
282         (WebCore::FlexLayoutAlgorithm::isMultiline const):
283         * rendering/FloatingObjects.cpp:
284         (WebCore::FloatingObject::FloatingObject):
285         * rendering/GridTrackSizingAlgorithm.cpp:
286         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
287         (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks):
288         * rendering/HitTestResult.cpp:
289         (WebCore::HitTestResult::innerTextIfTruncated const):
290         * rendering/ImageQualityController.cpp:
291         (WebCore::ImageQualityController::interpolationQualityFromStyle):
292         * rendering/InlineBox.h:
293         (WebCore::InlineBox::verticalAlign const):
294         * rendering/InlineFlowBox.cpp:
295         (WebCore::InlineFlowBox::addToLine):
296         (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
297         (WebCore::InlineFlowBox::adjustMaxAscentAndDescent):
298         (WebCore::InlineFlowBox::computeLogicalBoxHeights):
299         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
300         (WebCore::InlineFlowBox::paintFillLayer):
301         * rendering/LogicalSelectionOffsetCaches.h:
302         (WebCore::LogicalSelectionOffsetCaches::containingBlockInfo const):
303         * rendering/RenderBlock.cpp:
304         (WebCore::RenderBlock::removePositionedObjectsIfNeeded):
305         (WebCore::RenderBlock::styleDidChange):
306         (WebCore::RenderBlock::isSelfCollapsingBlock const):
307         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
308         (WebCore::RenderBlock::markFixedPositionObjectForLayoutIfNeeded):
309         (WebCore::RenderBlock::isSelectionRoot const):
310         (WebCore::RenderBlock::selectionGaps):
311         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
312         (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing const):
313         (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing const):
314         * rendering/RenderBlockFlow.cpp:
315         (WebCore::RenderBlockFlow::MarginInfo::MarginInfo):
316         (WebCore::RenderBlockFlow::willCreateColumns const):
317         (WebCore::RenderBlockFlow::marginOffsetForSelfCollapsingBlock):
318         (WebCore::RenderBlockFlow::clearFloatsIfNeeded):
319         (WebCore::RenderBlockFlow::marginBeforeEstimateForChild const):
320         (WebCore::RenderBlockFlow::setMustDiscardMarginBefore):
321         (WebCore::RenderBlockFlow::setMustDiscardMarginAfter):
322         (WebCore::RenderBlockFlow::mustDiscardMarginBefore const):
323         (WebCore::RenderBlockFlow::mustDiscardMarginAfter const):
324         (WebCore::RenderBlockFlow::mustDiscardMarginBeforeForChild const):
325         (WebCore::RenderBlockFlow::mustDiscardMarginAfterForChild const):
326         (WebCore::RenderBlockFlow::mustSeparateMarginBeforeForChild const):
327         (WebCore::RenderBlockFlow::mustSeparateMarginAfterForChild const):
328         (WebCore::RenderBlockFlow::styleDidChange):
329         (WebCore::RenderBlockFlow::styleWillChange):
330         (WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
331         (WebCore::RenderBlockFlow::positionNewFloats):
332         (WebCore::RenderBlockFlow::clearFloats):
333         (WebCore::RenderBlockFlow::getClearDelta):
334         (WebCore::RenderBlockFlow::inlineBlockBaseline const):
335         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
336         * rendering/RenderBlockFlow.h:
337         * rendering/RenderBlockLineLayout.cpp:
338         (WebCore::expansionBehaviorForInlineTextBox):
339         (WebCore::isCollapsibleSpace):
340         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
341         (WebCore::RenderBlockFlow::layoutLineBoxes):
342         * rendering/RenderBox.cpp:
343         (WebCore::RenderBox::styleWillChange):
344         (WebCore::RenderBox::styleDidChange):
345         (WebCore::RenderBox::updateFromStyle):
346         (WebCore::RenderBox::includeVerticalScrollbarSize const):
347         (WebCore::RenderBox::includeHorizontalScrollbarSize const):
348         (WebCore::RenderBox::intrinsicScrollbarLogicalWidth const):
349         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
350         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
351         (WebCore::RenderBox::adjustBorderBoxLogicalWidthForBoxSizing const):
352         (WebCore::RenderBox::adjustBorderBoxLogicalHeightForBoxSizing const):
353         (WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing const):
354         (WebCore::RenderBox::adjustContentBoxLogicalHeightForBoxSizing const):
355         (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const):
356         (WebCore::isCandidateForOpaquenessTest):
357         (WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
358         (WebCore::RenderBox::backgroundHasOpaqueTopLayer const):
359         (WebCore::RenderBox::computeRectForRepaint const):
360         (WebCore::RenderBox::computeLogicalWidthInFragment const):
361         (WebCore::RenderBox::columnFlexItemHasStretchAlignment const):
362         (WebCore::RenderBox::isStretchingColumnFlexItem const):
363         (WebCore::RenderBox::hasStretchedLogicalWidth const):
364         (WebCore::RenderBox::sizesLogicalWidthToFitContent const):
365         (WebCore::RenderBox::computeLogicalHeight const):
366         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing const):
367         (WebCore::RenderBox::createsNewFormattingContext const):
368         * rendering/RenderBox.h:
369         (WebCore::RenderBox::scrollsOverflowX const):
370         (WebCore::RenderBox::scrollsOverflowY const):
371         (WebCore::RenderBox::selfAlignmentNormalBehavior const):
372         * rendering/RenderBoxModelObject.cpp:
373         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
374         (WebCore::RenderBoxModelObject::calculateFillTileSize const):
375         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
376         (WebCore::styleRequiresClipPolygon):
377         (WebCore::borderStyleFillsBorderArea):
378         (WebCore::borderStyleHasInnerDetail):
379         (WebCore::borderStyleIsDottedOrDashed):
380         (WebCore::borderStyleHasUnmatchedColorsAtCorner):
381         (WebCore::borderStylesRequireMitre):
382         (WebCore::RenderBoxModelObject::paintBorder):
383         (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
384         (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
385         * rendering/RenderBoxModelObject.h:
386         * rendering/RenderDeprecatedFlexibleBox.cpp:
387         (WebCore::FlexBoxIterator::FlexBoxIterator):
388         (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
389         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
390         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
391         * rendering/RenderDeprecatedFlexibleBox.h:
392         * rendering/RenderElement.cpp:
393         (WebCore::RenderElement::adjustStyleDifference const):
394         (WebCore::RenderElement::shouldRepaintForStyleDifference const):
395         (WebCore::RenderElement::initializeStyle):
396         (WebCore::RenderElement::setStyle):
397         (WebCore::RenderElement::didAttachChild):
398         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
399         (WebCore::RenderElement::styleWillChange):
400         (WebCore::RenderElement::styleDidChange):
401         (WebCore::mustRepaintFillLayers):
402         (WebCore::RenderElement::selectionColor const):
403         (WebCore::RenderElement::selectionBackgroundColor const):
404         (WebCore::RenderElement::drawLineForBoxSide const):
405         (WebCore::RenderElement::paintFocusRing):
406         (WebCore::RenderElement::paintOutline):
407         (WebCore::RenderElement::updateOutlineAutoAncestor):
408         (WebCore::includeNonFixedHeight):
409         * rendering/RenderElement.h:
410         (WebCore::RenderElement::hasHiddenBackface const):
411         (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const):
412         * rendering/RenderFlexibleBox.cpp:
413         (WebCore::RenderFlexibleBox::firstLineBaseline const):
414         (WebCore::contentAlignmentNormalBehavior):
415         (WebCore::RenderFlexibleBox::styleDidChange):
416         (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems):
417         (WebCore::RenderFlexibleBox::isLeftToRightFlow const):
418         (WebCore::RenderFlexibleBox::isMultiline const):
419         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
420         (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
421         (WebCore::initialJustifyContentOffset):
422         (WebCore::justifyContentSpaceBetweenChildren):
423         (WebCore::alignmentOffset):
424         (WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild):
425         (WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild):
426         (WebCore::RenderFlexibleBox::alignmentForChild const):
427         (WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight const):
428         (WebCore::RenderFlexibleBox::mainAxisOverflowForChild const):
429         (WebCore::RenderFlexibleBox::crossAxisOverflowForChild const):
430         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
431         (WebCore::RenderFlexibleBox::layoutColumnReverse):
432         (WebCore::initialAlignContentOffset):
433         (WebCore::alignContentSpaceBetweenChildren):
434         (WebCore::RenderFlexibleBox::alignFlexLines):
435         (WebCore::RenderFlexibleBox::alignChildren):
436         * rendering/RenderFlexibleBox.h:
437         * rendering/RenderFragmentContainer.cpp:
438         (WebCore::RenderFragmentContainer::overflowRectForFragmentedFlowPortion):
439         * rendering/RenderFullScreen.cpp:
440         (WebCore::createFullScreenStyle):
441         * rendering/RenderFullScreen.h:
442         * rendering/RenderGrid.cpp:
443         (WebCore::RenderGrid::selfAlignmentChangedToStretch const):
444         (WebCore::RenderGrid::selfAlignmentChangedFromStretch const):
445         (WebCore::RenderGrid::styleDidChange):
446         (WebCore::contentAlignmentNormalBehaviorGrid):
447         (WebCore::computeOverflowAlignmentOffset):
448         (WebCore::RenderGrid::isInlineBaselineAlignedChild const):
449         (WebCore::RenderGrid::columnAxisPositionForChild const):
450         (WebCore::RenderGrid::rowAxisPositionForChild const):
451         (WebCore::RenderGrid::resolveAutoStartGridPosition const):
452         (WebCore::RenderGrid::resolveAutoEndGridPosition const):
453         (WebCore::resolveContentDistributionFallback):
454         (WebCore::contentDistributionOffset):
455         (WebCore::RenderGrid::computeContentPositionAndDistributionOffset const):
456         * rendering/RenderGrid.h:
457         * rendering/RenderIFrame.cpp:
458         (WebCore::RenderIFrame::requiresLayer const):
459         * rendering/RenderImage.cpp:
460         (WebCore::RenderImage::styleDidChange):
461         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect const):
462         * rendering/RenderInline.cpp:
463         (WebCore::RenderInline::styleWillChange):
464         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
465         (WebCore::RenderInline::paintOutline):
466         (WebCore::RenderInline::paintOutlineForLine):
467         * rendering/RenderLayer.cpp:
468         (WebCore::isContainerForPositioned):
469         (WebCore::RenderLayer::enclosingAncestorForPosition const):
470         (WebCore::accumulateOffsetTowardsAncestor):
471         (WebCore::RenderLayer::canResize const):
472         (WebCore::RenderLayer::resize):
473         (WebCore::RenderLayer::scrollCornerRect const):
474         (WebCore::resizerCornerRect):
475         (WebCore::RenderLayer::hasOverflowControls const):
476         (WebCore::styleRequiresScrollbar):
477         (WebCore::styleDefinesAutomaticScrollbar):
478         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
479         (WebCore::RenderLayer::paintResizer):
480         (WebCore::RenderLayer::hitTestOverflowControls):
481         (WebCore::RenderLayer::hitTestLayer):
482         (WebCore::RenderLayer::calculateClipRects const):
483         * rendering/RenderLayer.h:
484         * rendering/RenderLayerBacking.cpp:
485         (WebCore::RenderLayerBacking::updateGeometry):
486         (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
487         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
488         (WebCore::backgroundRectForBox):
489         * rendering/RenderLayerCompositor.cpp:
490         (WebCore::isScrollableOverflow):
491         (WebCore::styleChangeRequiresLayerRebuild):
492         (WebCore::RenderLayerCompositor::layerStyleChanged):
493         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
494         (WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
495         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
496         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
497         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
498         (WebCore::RenderLayerCompositor::layerHas3DContent const):
499         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
500         * rendering/RenderLayerModelObject.cpp:
501         (WebCore::RenderLayerModelObject::styleWillChange):
502         * rendering/RenderMenuList.cpp:
503         (WebCore::RenderMenuList::adjustInnerStyle):
504         * rendering/RenderMultiColumnFlow.cpp:
505         (WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const):
506         * rendering/RenderMultiColumnSet.cpp:
507         (WebCore::RenderMultiColumnSet::requiresBalancing const):
508         (WebCore::RenderMultiColumnSet::paintColumnRules):
509         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
510         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
511         * rendering/RenderObject.cpp:
512         (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
513         (WebCore::containerForElement):
514         (WebCore::RenderObject::calculateBorderStyleColor):
515         * rendering/RenderObject.h:
516         (WebCore::RenderObject::isFixedPositioned const):
517         (WebCore::RenderObject::isAbsolutelyPositioned const):
518         (WebCore::RenderObject::setPositionState):
519         (WebCore::RenderObject::RenderObjectBitfields::setPositionedState):
520         (WebCore::RenderObject::RenderObjectBitfields::clearPositionedState):
521         * rendering/RenderQuote.cpp:
522         (WebCore::RenderQuote::styleDidChange):
523         (WebCore::RenderQuote::computeText const):
524         (WebCore::RenderQuote::isOpen const):
525         * rendering/RenderReplaced.cpp:
526         (WebCore::RenderReplaced::layout):
527         (WebCore::RenderReplaced::setNeedsLayoutIfNeededAfterIntrinsicSizeChange):
528         (WebCore::RenderReplaced::replacedContentRect const):
529         * rendering/RenderScrollbarPart.cpp:
530         (WebCore::RenderScrollbarPart::styleDidChange):
531         * rendering/RenderTable.cpp:
532         (WebCore::RenderTable::styleDidChange):
533         (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
534         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
535         (WebCore::RenderTable::calcBorderStart const):
536         (WebCore::RenderTable::calcBorderEnd const):
537         (WebCore::RenderTable::outerBorderBefore const):
538         (WebCore::RenderTable::outerBorderAfter const):
539         (WebCore::RenderTable::outerBorderStart const):
540         (WebCore::RenderTable::outerBorderEnd const):
541         * rendering/RenderTable.h:
542         (WebCore::RenderTable::collapseBorders const):
543         * rendering/RenderTableCell.cpp:
544         (WebCore::RenderTableCell::computeIntrinsicPadding):
545         (WebCore::RenderTableCell::styleDidChange):
546         (WebCore::compareBorders):
547         (WebCore::chooseBorder):
548         (WebCore::emptyBorder):
549         (WebCore::RenderTableCell::computeCollapsedStartBorder const):
550         (WebCore::RenderTableCell::computeCollapsedEndBorder const):
551         (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
552         (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
553         (WebCore::CollapsedBorders::addBorder):
554         (WebCore::RenderTableCell::paintCollapsedBorders):
555         (WebCore::RenderTableCell::scrollbarsChanged):
556         * rendering/RenderTableCell.h:
557         (WebCore::RenderTableCell::logicalHeightForRowSizing const):
558         (WebCore::RenderTableCell::isBaselineAligned const):
559         * rendering/RenderTableRow.cpp:
560         (WebCore::RenderTableRow::styleDidChange):
561         * rendering/RenderTableSection.cpp:
562         (WebCore::RenderTableSection::calcOuterBorderBefore const):
563         (WebCore::RenderTableSection::calcOuterBorderAfter const):
564         (WebCore::RenderTableSection::calcOuterBorderStart const):
565         (WebCore::RenderTableSection::calcOuterBorderEnd const):
566         (WebCore::RenderTableSection::paintRowGroupBorder):
567         (WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
568         (WebCore::RenderTableSection::cachedCollapsedBorder):
569         * rendering/RenderTableSection.h:
570         * rendering/RenderText.cpp:
571         (WebCore::RenderText::styleDidChange):
572         (WebCore::RenderText::absoluteQuadsClippedToEllipsis const):
573         (WebCore::isSpaceAccordingToStyle):
574         (WebCore::mapLineBreakToIteratorMode):
575         (WebCore::RenderText::computePreferredLogicalWidths):
576         (WebCore::RenderText::setRenderedText):
577         (WebCore::RenderText::textWithoutConvertingBackslashToYenSymbol const):
578         (WebCore::RenderText::momentarilyRevealLastTypedCharacter):
579         * rendering/RenderTextControl.cpp:
580         (WebCore::RenderTextControl::computeLogicalHeight const):
581         * rendering/RenderTextControlSingleLine.cpp:
582         (WebCore::RenderTextControlSingleLine::styleDidChange):
583         * rendering/RenderTheme.cpp:
584         (WebCore::RenderTheme::extractControlStatesForRenderer const):
585         * rendering/RenderThemeIOS.mm:
586         (WebCore::adjustInputElementButtonStyle):
587         * rendering/RenderThemeMac.mm:
588         (WebCore::RenderThemeMac::updateFocusedState):
589         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
590         (WebCore::RenderThemeMac::adjustSearchFieldStyle const):
591         * rendering/RenderTreeAsText.cpp:
592         (WebCore::printBorderStyle):
593         * rendering/RenderVideo.cpp:
594         (WebCore::RenderVideo::updatePlayer):
595         * rendering/RenderView.cpp:
596         (WebCore::RenderView::RenderView):
597         (WebCore::rendererObscuresBackground):
598         * rendering/RootInlineBox.cpp:
599         (WebCore::RootInlineBox::verticalPositionForBox):
600         * rendering/SimpleLineLayout.cpp:
601         (WebCore::SimpleLineLayout::canUseForStyle):
602         (WebCore::SimpleLineLayout::canUseForWithReason):
603         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
604         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
605         * rendering/TextPaintStyle.cpp:
606         (WebCore::computeTextPaintStyle):
607         * rendering/line/BreakingContext.h:
608         (WebCore::BreakingContext::handleBR):
609         (WebCore::shouldAddBorderPaddingMargin):
610         (WebCore::BreakingContext::handleText):
611         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
612         * rendering/line/LineBreaker.cpp:
613         (WebCore::LineBreaker::reset):
614         * rendering/line/LineBreaker.h:
615         (WebCore::LineBreaker::clear):
616         * rendering/line/LineInlineHeaders.h:
617         (WebCore::skipNonBreakingSpace):
618         * rendering/line/LineWidth.cpp:
619         (WebCore::requiresIndent):
620         * rendering/style/BorderData.h:
621         (WebCore::BorderData::borderLeftWidth const):
622         (WebCore::BorderData::borderRightWidth const):
623         (WebCore::BorderData::borderTopWidth const):
624         (WebCore::BorderData::borderBottomWidth const):
625         * rendering/style/BorderValue.h:
626         (WebCore::BorderValue::BorderValue):
627         (WebCore::BorderValue::nonZero const):
628         (WebCore::BorderValue::isVisible const):
629         (WebCore::BorderValue::style const):
630         * rendering/style/CollapsedBorderValue.h:
631         (WebCore::CollapsedBorderValue::CollapsedBorderValue):
632         (WebCore::CollapsedBorderValue::width const):
633         (WebCore::CollapsedBorderValue::style const):
634         (WebCore::CollapsedBorderValue::exists const):
635         (WebCore::CollapsedBorderValue::precedence const):
636         * rendering/style/FillLayer.cpp:
637         (WebCore::FillLayer::FillLayer):
638         (WebCore::clipMax):
639         (WebCore::FillLayer::computeClipMax const):
640         (WebCore::FillLayer::hasRepeatXY const):
641         (WebCore::FillLayer::hasFixedImage const):
642         * rendering/style/FillLayer.h:
643         (WebCore::FillSize::FillSize):
644         (WebCore::FillLayer::attachment const):
645         (WebCore::FillLayer::clip const):
646         (WebCore::FillLayer::origin const):
647         (WebCore::FillLayer::repeatX const):
648         (WebCore::FillLayer::repeatY const):
649         (WebCore::FillLayer::sizeType const):
650         (WebCore::FillLayer::size const):
651         (WebCore::FillLayer::maskSourceType const):
652         (WebCore::FillLayer::isSizeSet const):
653         (WebCore::FillLayer::setAttachment):
654         (WebCore::FillLayer::setClip):
655         (WebCore::FillLayer::setOrigin):
656         (WebCore::FillLayer::setRepeatX):
657         (WebCore::FillLayer::setRepeatY):
658         (WebCore::FillLayer::setComposite):
659         (WebCore::FillLayer::setBlendMode):
660         (WebCore::FillLayer::setSizeType):
661         (WebCore::FillLayer::setSize):
662         (WebCore::FillLayer::setMaskSourceType):
663         (WebCore::FillLayer::clearSize):
664         (WebCore::FillLayer::type const):
665         (WebCore::FillLayer::initialFillAttachment):
666         (WebCore::FillLayer::initialFillClip):
667         (WebCore::FillLayer::initialFillOrigin):
668         (WebCore::FillLayer::initialFillRepeatX):
669         (WebCore::FillLayer::initialFillRepeatY):
670         (WebCore::FillLayer::initialFillComposite):
671         (WebCore::FillLayer::initialFillBlendMode):
672         (WebCore::FillLayer::initialFillSize):
673         (WebCore::FillLayer::initialFillXPosition):
674         (WebCore::FillLayer::initialFillYPosition):
675         (WebCore::FillLayer::initialFillImage):
676         (WebCore::FillLayer::initialFillMaskSourceType):
677         * rendering/style/LineClampValue.h:
678         (WebCore::LineClampValue::LineClampValue):
679         (WebCore::LineClampValue::isPercentage const):
680         * rendering/style/RenderStyle.cpp:
681         (WebCore::RenderStyle::RenderStyle):
682         (WebCore::resolvedSelfAlignment):
683         (WebCore::RenderStyle::resolvedAlignSelf const):
684         (WebCore::RenderStyle::resolvedJustifySelf const):
685         (WebCore::resolvedContentAlignment):
686         (WebCore::resolvedContentAlignmentPosition):
687         (WebCore::resolvedContentAlignmentDistribution):
688         (WebCore::RenderStyle::resolvedJustifyContentDistribution const):
689         (WebCore::RenderStyle::resolvedAlignContentDistribution const):
690         (WebCore::RenderStyle::changeRequiresLayout const):
691         (WebCore::RenderStyle::changeRequiresPositionedLayoutOnly const):
692         (WebCore::RenderStyle::changeRequiresLayerRepaint const):
693         (WebCore::RenderStyle::changeRequiresRepaint const):
694         (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline const):
695         (WebCore::RenderStyle::changeRequiresRecompositeLayer const):
696         (WebCore::RenderStyle::diff const):
697         (WebCore::RenderStyle::diffRequiresLayerRepaint const):
698         (WebCore::allLayersAreFixed):
699         (WebCore::RenderStyle::colorIncludingFallback const):
700         (WebCore::RenderStyle::setColumnStylesFromPaginationMode):
701         (WebCore::RenderStyle::outlineWidth const):
702         (WebCore::RenderStyle::outlineOffset const):
703         * rendering/style/RenderStyle.h:
704         (WebCore::RenderStyle::isFloating const):
705         (WebCore::RenderStyle::position const):
706         (WebCore::RenderStyle::hasOutOfFlowPosition const):
707         (WebCore::RenderStyle::hasInFlowPosition const):
708         (WebCore::RenderStyle::hasViewportConstrainedPosition const):
709         (WebCore::RenderStyle::floating const):
710         (WebCore::RenderStyle::borderLeftStyle const):
711         (WebCore::RenderStyle::borderRightStyle const):
712         (WebCore::RenderStyle::borderTopStyle const):
713         (WebCore::RenderStyle::borderBottomStyle const):
714         (WebCore::RenderStyle::hasOutline const):
715         (WebCore::RenderStyle::outlineStyle const):
716         (WebCore::RenderStyle::overflowX const):
717         (WebCore::RenderStyle::overflowY const):
718         (WebCore::RenderStyle::overflowInlineDirection const):
719         (WebCore::RenderStyle::overflowBlockDirection const):
720         (WebCore::RenderStyle::verticalAlign const):
721         (WebCore::RenderStyle::clear const):
722         (WebCore::RenderStyle::tableLayout const):
723         (WebCore::RenderStyle::backgroundRepeatX const):
724         (WebCore::RenderStyle::backgroundRepeatY const):
725         (WebCore::RenderStyle::backgroundAttachment const):
726         (WebCore::RenderStyle::backgroundClip const):
727         (WebCore::RenderStyle::backgroundOrigin const):
728         (WebCore::RenderStyle::backgroundSizeType const):
729         (WebCore::RenderStyle::maskRepeatX const):
730         (WebCore::RenderStyle::maskRepeatY const):
731         (WebCore::RenderStyle::maskClip const):
732         (WebCore::RenderStyle::maskOrigin const):
733         (WebCore::RenderStyle::maskSizeType const):
734         (WebCore::RenderStyle::borderCollapse const):
735         (WebCore::RenderStyle::boxAlign const):
736         (WebCore::RenderStyle::boxDirection const):
737         (WebCore::RenderStyle::boxLines const):
738         (WebCore::RenderStyle::boxOrient const):
739         (WebCore::RenderStyle::boxPack const):
740         (WebCore::RenderStyle::flexDirection const):
741         (WebCore::RenderStyle::isColumnFlexDirection const):
742         (WebCore::RenderStyle::isReverseFlexDirection const):
743         (WebCore::RenderStyle::flexWrap const):
744         (WebCore::RenderStyle::boxDecorationBreak const):
745         (WebCore::RenderStyle::boxSizing const):
746         (WebCore::RenderStyle::userModify const):
747         (WebCore::RenderStyle::userDrag const):
748         (WebCore::RenderStyle::userSelect const):
749         (WebCore::RenderStyle::marginBeforeCollapse const):
750         (WebCore::RenderStyle::marginAfterCollapse const):
751         (WebCore::RenderStyle::wordBreak const):
752         (WebCore::RenderStyle::overflowWrap const):
753         (WebCore::RenderStyle::nbspMode const):
754         (WebCore::RenderStyle::resize const):
755         (WebCore::RenderStyle::columnRuleStyle const):
756         (WebCore::RenderStyle::hasTextCombine const):
757         (WebCore::RenderStyle::transformStyle3D const):
758         (WebCore::RenderStyle::preserves3D const):
759         (WebCore::RenderStyle::backfaceVisibility const):
760         (WebCore::RenderStyle::textSecurity const):
761         (WebCore::RenderStyle::imageRendering const):
762         (WebCore::RenderStyle::setIsolation):
763         (WebCore::RenderStyle::hasIsolation const):
764         (WebCore::RenderStyle::isolation const):
765         (WebCore::RenderStyle::setPosition):
766         (WebCore::RenderStyle::setFloating):
767         (WebCore::RenderStyle::setBackgroundSize):
768         (WebCore::RenderStyle::setBorderLeftStyle):
769         (WebCore::RenderStyle::setBorderRightStyle):
770         (WebCore::RenderStyle::setBorderTopStyle):
771         (WebCore::RenderStyle::setBorderBottomStyle):
772         (WebCore::RenderStyle::setOutlineStyleIsAuto):
773         (WebCore::RenderStyle::setOutlineStyle):
774         (WebCore::RenderStyle::setOverflowX):
775         (WebCore::RenderStyle::setOverflowY):
776         (WebCore::RenderStyle::setVerticalAlign):
777         (WebCore::RenderStyle::setVerticalAlignLength):
778         (WebCore::RenderStyle::setClear):
779         (WebCore::RenderStyle::setTableLayout):
780         (WebCore::RenderStyle::setImageRendering):
781         (WebCore::RenderStyle::clearBackgroundLayers):
782         (WebCore::RenderStyle::clearMaskLayers):
783         (WebCore::RenderStyle::setBorderCollapse):
784         (WebCore::RenderStyle::setAspectRatioType):
785         (WebCore::RenderStyle::setPrintColorAdjust):
786         (WebCore::RenderStyle::setBoxAlign):
787         (WebCore::RenderStyle::setBoxDirection):
788         (WebCore::RenderStyle::setBoxLines):
789         (WebCore::RenderStyle::setBoxOrient):
790         (WebCore::RenderStyle::setBoxPack):
791         (WebCore::RenderStyle::setBoxSizing):
792         (WebCore::RenderStyle::setFlexDirection):
793         (WebCore::RenderStyle::setFlexWrap):
794         (WebCore::RenderStyle::setBoxDecorationBreak):
795         (WebCore::RenderStyle::setUserModify):
796         (WebCore::RenderStyle::setUserDrag):
797         (WebCore::RenderStyle::setUserSelect):
798         (WebCore::RenderStyle::setTextOverflow):
799         (WebCore::RenderStyle::setMarginBeforeCollapse):
800         (WebCore::RenderStyle::setMarginAfterCollapse):
801         (WebCore::RenderStyle::setWordBreak):
802         (WebCore::RenderStyle::setOverflowWrap):
803         (WebCore::RenderStyle::setNBSPMode):
804         (WebCore::RenderStyle::setLineBreak):
805         (WebCore::RenderStyle::setResize):
806         (WebCore::RenderStyle::setColumnFill):
807         (WebCore::RenderStyle::setColumnRuleStyle):
808         (WebCore::RenderStyle::setColumnSpan):
809         (WebCore::RenderStyle::setTextCombine):
810         (WebCore::RenderStyle::setObjectFit):
811         (WebCore::RenderStyle::setTransformStyle3D):
812         (WebCore::RenderStyle::setBackfaceVisibility):
813         (WebCore::RenderStyle::setTextSecurity):
814         (WebCore::RenderStyle::initialOverflowX):
815         (WebCore::RenderStyle::initialOverflowY):
816         (WebCore::RenderStyle::initialClear):
817         (WebCore::RenderStyle::initialPosition):
818         (WebCore::RenderStyle::initialVerticalAlign):
819         (WebCore::RenderStyle::initialFloating):
820         (WebCore::RenderStyle::initialTableLayout):
821         (WebCore::RenderStyle::initialBorderCollapse):
822         (WebCore::RenderStyle::initialBorderStyle):
823         (WebCore::RenderStyle::initialOutlineStyleIsAuto):
824         (WebCore::RenderStyle::initialTextCombine):
825         (WebCore::RenderStyle::initialObjectFit):
826         (WebCore::RenderStyle::initialBoxAlign):
827         (WebCore::RenderStyle::initialBoxDecorationBreak):
828         (WebCore::RenderStyle::initialBoxDirection):
829         (WebCore::RenderStyle::initialBoxLines):
830         (WebCore::RenderStyle::initialBoxOrient):
831         (WebCore::RenderStyle::initialBoxPack):
832         (WebCore::RenderStyle::initialBoxSizing):
833         (WebCore::RenderStyle::initialJustifyItems):
834         (WebCore::RenderStyle::initialSelfAlignment):
835         (WebCore::RenderStyle::initialDefaultAlignment):
836         (WebCore::RenderStyle::initialContentAlignment):
837         (WebCore::RenderStyle::initialFlexDirection):
838         (WebCore::RenderStyle::initialFlexWrap):
839         (WebCore::RenderStyle::initialUserModify):
840         (WebCore::RenderStyle::initialUserDrag):
841         (WebCore::RenderStyle::initialUserSelect):
842         (WebCore::RenderStyle::initialTextOverflow):
843         (WebCore::RenderStyle::initialMarginBeforeCollapse):
844         (WebCore::RenderStyle::initialMarginAfterCollapse):
845         (WebCore::RenderStyle::initialWordBreak):
846         (WebCore::RenderStyle::initialOverflowWrap):
847         (WebCore::RenderStyle::initialNBSPMode):
848         (WebCore::RenderStyle::initialLineBreak):
849         (WebCore::RenderStyle::initialResize):
850         (WebCore::RenderStyle::initialAspectRatioType):
851         (WebCore::RenderStyle::initialColumnFill):
852         (WebCore::RenderStyle::initialColumnSpan):
853         (WebCore::RenderStyle::initialTransformStyle3D):
854         (WebCore::RenderStyle::initialBackfaceVisibility):
855         (WebCore::RenderStyle::initialImageRendering):
856         (WebCore::RenderStyle::initialPrintColorAdjust):
857         (WebCore::RenderStyle::initialTextIndentLine):
858         (WebCore::RenderStyle::initialTextIndentType):
859         (WebCore::RenderStyle::initialTextSecurity):
860         (WebCore::RenderStyle::initialIsolation):
861         (WebCore::collapsedBorderStyle):
862         (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const):
863         (WebCore::RenderStyle::breakWords const):
864         (WebCore::RenderStyle::setTextOrientation):
865         * rendering/style/RenderStyleConstants.cpp:
866         (WebCore::operator<<):
867         * rendering/style/RenderStyleConstants.h:
868         (WebCore::operator|):
869         (WebCore::operator|=):
870         (WebCore::operator| ): Deleted.
871         (WebCore::operator|= ): Deleted.
872         * rendering/style/SVGRenderStyle.cpp:
873         (WebCore::SVGRenderStyle::diff const):
874         * rendering/style/StyleBackgroundData.cpp:
875         (WebCore::StyleBackgroundData::StyleBackgroundData):
876         * rendering/style/StyleBoxData.cpp:
877         (WebCore::StyleBoxData::StyleBoxData):
878         * rendering/style/StyleBoxData.h:
879         (WebCore::StyleBoxData::boxSizing const):
880         (WebCore::StyleBoxData::boxDecorationBreak const):
881         * rendering/style/StyleContentAlignmentData.h:
882         (WebCore::StyleContentAlignmentData::StyleContentAlignmentData):
883         (WebCore::StyleContentAlignmentData::setPosition):
884         (WebCore::StyleContentAlignmentData::setDistribution):
885         (WebCore::StyleContentAlignmentData::setOverflow):
886         (WebCore::StyleContentAlignmentData::distribution const):
887         * rendering/style/StyleDeprecatedFlexibleBoxData.cpp:
888         (WebCore::StyleDeprecatedFlexibleBoxData::StyleDeprecatedFlexibleBoxData):
889         * rendering/style/StyleDeprecatedFlexibleBoxData.h:
890         * rendering/style/StyleFlexibleBoxData.cpp:
891         (WebCore::StyleFlexibleBoxData::StyleFlexibleBoxData):
892         * rendering/style/StyleFlexibleBoxData.h:
893         * rendering/style/StyleMultiColData.cpp:
894         (WebCore::StyleMultiColData::StyleMultiColData):
895         * rendering/style/StyleMultiColData.h:
896         (WebCore::StyleMultiColData::ruleWidth const):
897         * rendering/style/StyleRareInheritedData.cpp:
898         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
899         * rendering/style/StyleRareInheritedData.h:
900         * rendering/style/StyleRareNonInheritedData.cpp:
901         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
902         * rendering/style/StyleRareNonInheritedData.h:
903         * rendering/style/StyleSelfAlignmentData.h:
904         (WebCore::StyleSelfAlignmentData::StyleSelfAlignmentData):
905         (WebCore::StyleSelfAlignmentData::setPosition):
906         (WebCore::StyleSelfAlignmentData::setPositionType):
907         (WebCore::StyleSelfAlignmentData::setOverflow):
908         * rendering/svg/RenderSVGBlock.cpp:
909         (WebCore::RenderSVGBlock::styleDidChange):
910         * rendering/svg/RenderSVGGradientStop.cpp:
911         (WebCore::RenderSVGGradientStop::styleDidChange):
912         * rendering/svg/RenderSVGInline.cpp:
913         (WebCore::RenderSVGInline::styleDidChange):
914         * rendering/svg/RenderSVGInlineText.cpp:
915         (WebCore::RenderSVGInlineText::styleDidChange):
916         * rendering/svg/RenderSVGModelObject.cpp:
917         (WebCore::RenderSVGModelObject::styleDidChange):
918         * rendering/svg/RenderSVGResourceContainer.cpp:
919         (WebCore::RenderSVGResourceContainer::registerResource):
920         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
921         (WebCore::RenderSVGResourceFilterPrimitive::styleDidChange):
922         * rendering/svg/RenderSVGRoot.cpp:
923         (WebCore::RenderSVGRoot::layout):
924         (WebCore::RenderSVGRoot::shouldApplyViewportClip const):
925         (WebCore::RenderSVGRoot::styleDidChange):
926         * rendering/svg/SVGInlineTextBox.cpp:
927         (WebCore::SVGInlineTextBox::paintText):
928         * rendering/svg/SVGRenderSupport.cpp:
929         (WebCore::SVGRenderSupport::isOverflowHidden):
930         * rendering/svg/SVGResourcesCache.cpp:
931         (WebCore::SVGResourcesCache::clientStyleChanged):
932         * rendering/updating/RenderTreeBuilder.cpp:
933         (WebCore::RenderTreeBuilder::attachToRenderElementInternal):
934         * rendering/updating/RenderTreeBuilderBlock.cpp:
935         (WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
936         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
937         (WebCore::styleForFirstLetter):
938         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
939         (WebCore::isValidColumnSpanner):
940         (WebCore::RenderTreeBuilder::MultiColumn::resolveMovedChild):
941         (WebCore::RenderTreeBuilder::MultiColumn::multiColumnRelativeWillBeRemoved):
942         * rendering/updating/RenderTreeUpdater.cpp:
943         (WebCore::RenderTreeUpdater::updateElementRenderer):
944         * style/StyleResolveForDocument.cpp:
945         (WebCore::Style::resolveForDocument):
946
947 2018-05-21  Alicia Boya García  <aboya@igalia.com>
948
949         [MSE][GStreamer] Stream::decodebinSinkPad is read but never assigned
950         https://bugs.webkit.org/show_bug.cgi?id=185724
951
952         Reviewed by Xabier Rodriguez-Calvar.
953
954         This is a dead code removal patch; except when a Stream instance
955         happens to be instantiated in such a place that the non-initialized
956         decodeSinkPad is != 0, then it is a crash bug fix.
957
958         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
959         (webKitMediaSrcLinkStreamToSrcPad):
960         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
961
962 2018-05-21  Alicia Boya García  <aboya@igalia.com>
963
964         [MSE][GStreamer] Force segment.start = 0 after matroskademux
965         https://bugs.webkit.org/show_bug.cgi?id=185740
966
967         Reviewed by Xabier Rodriguez-Calvar.
968
969         This patch ensures that when WebM MSE media segments are appended in
970         an out of order fashion their frames are not discarded by opusparse or
971         any other potential elements downstream in the AppendPipeline that
972         perform segment clipping.
973
974         This patch fixes the following YTTV 2018 tests:
975
976         38. OpusAudioWithOverlap
977         39. OpusAudioWithSmallGap
978         40. OpusAudioWithLargeGap
979         70. VP9VideoWithOverlap
980         71. VP9VideoWithSmallGap
981
982         This patch is necessary, but not sufficient for fixing the following
983         YTTV 2018 tests:
984
985         36. AppendOpusAudioOutOfOrder
986         67. AppendVP9VideoOutOfOrder
987
988         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
989         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
990         (WebCore::matroskademuxForceSegmentStartToEqualZero):
991
992 2018-05-19  Eric Carlson  <eric.carlson@apple.com>
993
994         Improve NowPlaying "title"
995         https://bugs.webkit.org/show_bug.cgi?id=185680
996         <rdar://problem/40296700>
997
998         Reviewed by Dean Jackson.
999
1000         * html/HTMLMediaElement.cpp:
1001         (WebCore::HTMLMediaElement::mediaSessionTitle const): Use decodeHostName and 
1002         topPrivatelyControlledDomain when possible to make the host name more readable.
1003
1004         * platform/PublicSuffix.h:
1005         * platform/mac/PublicSuffixMac.mm:
1006         (WebCore::decodeHostName): Expose topPrivatelyControlledDomain method to .cpp functions.
1007
1008 2018-05-19  Commit Queue  <commit-queue@webkit.org>
1009
1010         Unreviewed, rolling out r231996.
1011         https://bugs.webkit.org/show_bug.cgi?id=185799
1012
1013          Broke the GTK build (Requested by eric_carlson on #webkit).
1014
1015         Reverted changeset:
1016
1017         "Improve NowPlaying "title""
1018         https://bugs.webkit.org/show_bug.cgi?id=185680
1019         https://trac.webkit.org/changeset/231996
1020
1021 2018-05-18  Eric Carlson  <eric.carlson@apple.com>
1022
1023         Improve NowPlaying "title"
1024         https://bugs.webkit.org/show_bug.cgi?id=185680
1025         <rdar://problem/40296700>
1026
1027         Reviewed by Dean Jackson.
1028
1029         * html/HTMLMediaElement.cpp:
1030         (WebCore::HTMLMediaElement::mediaSessionTitle const): Use decodeHostName and 
1031         topPrivatelyControlledDomain when possible to make the host name more readable.
1032
1033         * platform/PublicSuffix.h:
1034         * platform/mac/PublicSuffixMac.mm:
1035         (WebCore::decodeHostName): Expose topPrivatelyControlledDomain method to .cpp functions.
1036
1037 2018-05-18  Rob Buis  <rbuis@igalia.com>
1038
1039         Cannot unset transition with important
1040         https://bugs.webkit.org/show_bug.cgi?id=177684
1041
1042         Reviewed by Chris Dumez.
1043
1044         Make removeProperty remove the property regardless
1045         if it was set using !important [1].
1046
1047         The new behavior is consistent with Firefox, Chrome and Edge.
1048
1049         [1] https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-removeproperty
1050
1051         Test: web-platform-tests/cssom/cssom-setProperty-shorthand.html
1052
1053         * css/StyleProperties.cpp:
1054         (WebCore::MutableStyleProperties::removePropertiesInSet):
1055
1056 2018-05-18  Commit Queue  <commit-queue@webkit.org>
1057
1058         Unreviewed, rolling out r231982.
1059         https://bugs.webkit.org/show_bug.cgi?id=185793
1060
1061         Caused layout test failures (Requested by realdawei on
1062         #webkit).
1063
1064         Reverted changeset:
1065
1066         "Complete fix for enabling modern EME by default"
1067         https://bugs.webkit.org/show_bug.cgi?id=185770
1068         https://trac.webkit.org/changeset/231982
1069
1070 2018-05-18  Jer Noble  <jer.noble@apple.com>
1071
1072         Complete fix for enabling modern EME by default
1073         https://bugs.webkit.org/show_bug.cgi?id=185770
1074         <rdar://problem/40368220>
1075
1076         Reviewed by Eric Carlson.
1077
1078         * Configurations/FeatureDefines.xcconfig:
1079
1080 2018-05-18  Brent Fulgham  <bfulgham@apple.com>
1081
1082         Convert ProcessPrivilege assertions to regular debug-only assertions
1083         https://bugs.webkit.org/show_bug.cgi?id=185775
1084         <rdar://problem/40372286>
1085
1086         Reviewed by Geoffrey Garen.
1087
1088         In Bug 184322 I added a number of RELEASE_ASSERT checks that certain
1089         UI-only calls were not being made in the WebContent process.
1090
1091         Measurements have shown that these RELEASE_ASSERTs have regressed performance
1092         by around 1% on some benchmarks, so we should convert them to normal asserts.
1093
1094         This patch changes the RELEASE_ASSERTs into ASSERTs.
1095
1096         * platform/mac/PasteboardMac.mm:
1097         (WebCore::Pasteboard::setDragImage):
1098         * platform/mac/PlatformScreenMac.mm:
1099         (WebCore::displayID):
1100         (WebCore::firstScreen):
1101         (WebCore::window):
1102         (WebCore::screen):
1103         (WebCore::getScreenProperties):
1104         (WebCore::screenIsMonochrome):
1105
1106 2018-05-18  Eric Carlson  <eric.carlson@apple.com>
1107
1108         Handle failure to extend sandbox gracefully
1109         https://bugs.webkit.org/show_bug.cgi?id=185779
1110         <rdar://problem/40316349>
1111
1112         Reviewed by Brent Fulgham.
1113
1114         Test: TestWebKitAPI/Tests/WebKitCocoa/UserMediaSimulateFailedSandbox.mm
1115
1116         * Modules/mediastream/UserMediaRequest.cpp:
1117         (WebCore::UserMediaRequest::deny): Include the error string in the promise rejection.
1118         * Modules/mediastream/UserMediaRequest.h:
1119
1120 2018-05-18  Antoine Quint  <graouts@apple.com>
1121
1122         [Web Animations] Turn Web Animations with CSS integration on for test runners
1123         https://bugs.webkit.org/show_bug.cgi?id=184819
1124         <rdar://problem/39597337>
1125
1126         Unreviewed. Rolling out the patch for this bug, it caused some flaky timeouts for animation suspension tests.
1127
1128         Tests: animations/animation-internals-api-multiple-keyframes.html
1129                animations/animation-internals-api.html
1130                transitions/transition-drt-api-delay.html
1131                transitions/transition-drt-api.html
1132
1133         * dom/Element.cpp:
1134         (WebCore::Element::removedFromAncestor):
1135         * dom/PseudoElement.cpp:
1136         (WebCore::PseudoElement::clearHostElement):
1137         * page/FrameView.cpp:
1138         (WebCore::FrameView::didDestroyRenderTree):
1139         * page/RuntimeEnabledFeatures.h:
1140         * rendering/updating/RenderTreeUpdater.cpp:
1141         (WebCore::RenderTreeUpdater::tearDownRenderers):
1142
1143 2018-05-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1144
1145         [Curl] Bug fix on suspend/resume behavior.
1146         https://bugs.webkit.org/show_bug.cgi?id=183089
1147
1148         The flag was not set correctly. Also wrong method was called.
1149
1150         Reviewed by Youenn Fablet.
1151
1152         Enable loader tests to cover this case.
1153
1154         * platform/network/curl/CurlRequest.cpp:
1155         (WebCore::CurlRequest::cancel): Remove unnecessary cleanup. Use runXXX method.
1156         (WebCore::CurlRequest::suspend): Added cancel check.
1157         (WebCore::CurlRequest::resume): Ditto.
1158         (WebCore::CurlRequest::callClient): Use runXXX method. Change to move semantics.
1159         (WebCore::runOnMainThread): Added.
1160         (WebCore::CurlRequest::runOnWorkerThreadIfRequired): Added.
1161         (WebCore::CurlRequest::setupTransfer): Bug fix. Call setRequestPaused directly.
1162         (WebCore::CurlRequest::didReceiveData): Add state flag update.
1163         (WebCore::CurlRequest::invokeDidReceiveResponseForFile): Use runXXX to simplify.
1164         (WebCore::CurlRequest::completeDidReceiveResponse): Ditto.
1165         (WebCore::CurlRequest::setRequestPaused): Protect state change by mutex.
1166         (WebCore::CurlRequest::setCallbackPaused): Ditto.
1167         (WebCore::CurlRequest::invokeCancel): Added.
1168         (WebCore::CurlRequest::pausedStatusChanged): Use runXXX to simplify.
1169         (WebCore::CurlRequest::updateHandlePauseState): Accessor for m_isHandlePaused.
1170         (WebCore::CurlRequest::isHandlePaused const): Ditto.
1171         * platform/network/curl/CurlRequest.h: Add mutex and paused state.
1172         (WebCore::CurlRequest::shouldBePaused const): Rename from isPaused.
1173         (WebCore::CurlRequest::isPaused const): Deleted.
1174
1175 2018-05-18  Chris Dumez  <cdumez@apple.com>
1176
1177         Avoid keeping the frame alive when ref'ing a WindowProxy
1178         https://bugs.webkit.org/show_bug.cgi?id=185737
1179         <rdar://problem/40004666>
1180
1181         Reviewed by Sam Weinig.
1182
1183         Avoid keeping the frame alive when ref'ing a WindowProxy by making WindowProxy
1184         manage its own refcount (instead of proxying refcounting to the Frame). As a
1185         result, a WindowProxy can now be detached from its Frame. When detached, it
1186         return null when asked for a JSWindowProxy.
1187
1188         It is important to not extend the lifetime of the Frame because we want script
1189         to stop running when the Page gets destroyed.
1190
1191         * bindings/js/JSWindowProxy.cpp:
1192         (WebCore::toJS):
1193         (WebCore::toJSWindowProxy):
1194         * bindings/js/JSWindowProxy.h:
1195         (WebCore::toJSWindowProxy):
1196         * bindings/js/ScriptController.cpp:
1197         (WebCore::ScriptController::evaluateInWorld):
1198         (WebCore::ScriptController::loadModuleScriptInWorld):
1199         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
1200         (WebCore::ScriptController::evaluateModule):
1201         (WebCore::ScriptController::setupModuleScriptHandlers):
1202         (WebCore::ScriptController::jsWindowProxy):
1203         (WebCore::ScriptController::windowScriptNPObject):
1204         (WebCore::ScriptController::executeIfJavaScriptURL):
1205         * bindings/js/ScriptController.h:
1206         (WebCore::ScriptController::globalObject):
1207         * bindings/js/ScriptControllerMac.mm:
1208         (WebCore::ScriptController::windowScriptObject):
1209         * bindings/js/ScriptState.cpp:
1210         (WebCore::mainWorldExecState):
1211         * bindings/js/WindowProxy.cpp:
1212         (WebCore::WindowProxy::WindowProxy):
1213         (WebCore::WindowProxy::~WindowProxy):
1214         (WebCore::WindowProxy::detachFromFrame):
1215         (WebCore::WindowProxy::createJSWindowProxy):
1216         (WebCore::WindowProxy::globalObject):
1217         (WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
1218         (WebCore::WindowProxy::setDOMWindow):
1219         (WebCore::WindowProxy::window const):
1220         (WebCore::WindowProxy::ref): Deleted.
1221         (WebCore::WindowProxy::deref): Deleted.
1222         * bindings/js/WindowProxy.h:
1223         (WebCore::WindowProxy::create):
1224         (WebCore::WindowProxy::frame const):
1225         (WebCore::WindowProxy::jsWindowProxy):
1226         * dom/DocumentTouch.cpp:
1227         (WebCore::DocumentTouch::createTouch):
1228         * page/AbstractFrame.cpp:
1229         (WebCore::AbstractFrame::AbstractFrame):
1230         (WebCore::AbstractFrame::~AbstractFrame):
1231         * page/AbstractFrame.h:
1232
1233 2018-05-18  Myles C. Maxfield  <mmaxfield@apple.com>
1234
1235         [iOS] Password fields obscure the text with rectangles instead of circles
1236         https://bugs.webkit.org/show_bug.cgi?id=185760
1237         <rdar://problem/38644697>
1238
1239         Reviewed by Zalan Bujtas.
1240
1241         Password fields are obscured by drawing U+25CF BLACK CIRCLE. On iOS, we have custom handling
1242         for this character. However, this custom handling is unnecessary and isn't present on macOS.
1243         Instead, we should simply unify the password obscuring codepath between iOS and macOS.
1244
1245         Test: fast/text/black-circle.html
1246
1247         * platform/graphics/ios/FontCacheIOS.mm:
1248         (WebCore::requiresCustomFallbackFont):
1249         (WebCore::FontCache::getCustomFallbackFont):
1250
1251 2018-05-18  Chris Dumez  <cdumez@apple.com>
1252
1253         Unreviewed, rolling out r231935.
1254
1255         Caused an accessibility test to fail
1256
1257         Reverted changeset:
1258
1259         "RenderLayer::scrollRectToVisible() should not propagate a
1260         subframe's scroll to its cross-origin parent"
1261         https://bugs.webkit.org/show_bug.cgi?id=185664
1262         https://trac.webkit.org/changeset/231935
1263
1264 2018-05-18  Zalan Bujtas  <zalan@apple.com>
1265
1266         [LFC] Implement height computation for non-replaced floating elements.
1267         https://bugs.webkit.org/show_bug.cgi?id=185767
1268
1269         Reviewed by Antti Koivisto.
1270
1271         * layout/FormattingContext.cpp:
1272         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
1273         (WebCore::Layout::FormattingContext::computeFloatingNonReplacedHeight const):
1274         (WebCore::Layout::FormattingContext::contentHeightForFormattingContextRoot const):
1275         * layout/FormattingContext.h:
1276
1277 2018-05-18  Dirk Schulze  <krit@webkit.org>
1278
1279         Make all SVG shape interfaces inherit from SVGGeometryElement
1280         https://bugs.webkit.org/show_bug.cgi?id=185600
1281
1282         Reviewed by Antti Koivisto.
1283
1284         Make all SVG shape interfaces inherit from SVGGeometryElement
1285         as defined by SVG2:
1286
1287         https://svgwg.org/svg2-draft/shapes.html#DOMInterfaces
1288
1289         Tests: svg/dom/SVGGeometry-circle.xhtml
1290                svg/dom/SVGGeometry-ellipse.xhtml
1291                svg/dom/SVGGeometry-line.xhtml
1292                svg/dom/SVGGeometry-polygon.xhtml
1293                svg/dom/SVGGeometry-polyline.xhtml
1294                svg/dom/SVGGeometry-rect.xhtml
1295
1296         * rendering/svg/RenderSVGShape.cpp:
1297         (WebCore::RenderSVGShape::getTotalLength const): Added shape
1298                 independent implementation for all methods defined
1299                 by SVGGeometryElement interface. Calculations are
1300                 based on the Path object created and referenced by
1301                 RenderSVGShape.
1302         (WebCore::RenderSVGShape::getPointAtLength const):
1303         * rendering/svg/RenderSVGShape.h:
1304         * svg/SVGCircleElement.cpp:
1305                 Repeating pattern: Change inheritance from
1306                 SVGGraphicsElement to SVGGeometryElement.
1307         (WebCore::SVGCircleElement::SVGCircleElement):
1308         * svg/SVGCircleElement.h:
1309         * svg/SVGCircleElement.idl:
1310         * svg/SVGEllipseElement.cpp:
1311         (WebCore::SVGEllipseElement::SVGEllipseElement):
1312         * svg/SVGEllipseElement.h:
1313         * svg/SVGEllipseElement.idl:
1314         * svg/SVGGeometryElement.cpp:
1315         (WebCore::SVGGeometryElement::getTotalLength const):
1316         (WebCore::SVGGeometryElement::getPointAtLength const):
1317         * svg/SVGGeometryElement.h:
1318         * svg/SVGLineElement.cpp:
1319         (WebCore::SVGLineElement::SVGLineElement):
1320         * svg/SVGLineElement.h:
1321         * svg/SVGLineElement.idl:
1322         * svg/SVGPolyElement.cpp:
1323         (WebCore::SVGPolyElement::SVGPolyElement):
1324         * svg/SVGPolyElement.h:
1325         * svg/SVGPolygonElement.idl:
1326         * svg/SVGPolylineElement.idl:
1327         * svg/SVGRectElement.cpp:
1328         (WebCore::SVGRectElement::SVGRectElement):
1329         * svg/SVGRectElement.h:
1330         * svg/SVGRectElement.idl:
1331
1332 2018-05-18  Zalan Bujtas  <zalan@apple.com>
1333
1334         [LFC] Implement height computation for replaced elements.
1335         https://bugs.webkit.org/show_bug.cgi?id=185756
1336
1337         Reviewed by Antti Koivisto.
1338
1339         * layout/FormattingContext.cpp:
1340         (WebCore::Layout::FormattingContext::computeHeight const):
1341         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
1342         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1343         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
1344         (WebCore::Layout::FormattingContext::computeReplacedHeight const):
1345         (WebCore::Layout::FormattingContext::computeReplacedWidth const):
1346         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedHeight const):
1347         * layout/FormattingContext.h:
1348
1349 2018-05-18  Zalan Bujtas  <zalan@apple.com>
1350
1351         [LFC] Implement width computation for non-replaced floating elements.
1352         https://bugs.webkit.org/show_bug.cgi?id=185759
1353
1354         Reviewed by Antti Koivisto.
1355
1356         * layout/FormattingContext.cpp:
1357         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
1358         (WebCore::Layout::FormattingContext::computeFloatingNonReplacedWidth const):
1359         * layout/FormattingContext.h:
1360
1361 2018-05-18  Antoine Quint  <graouts@apple.com>
1362
1363         [modern-media-controls] AirPlaySupport should be disabled by default
1364         https://bugs.webkit.org/show_bug.cgi?id=185658
1365         <rdar://problem/40272213>
1366
1367         Reviewed by Simon Fraser.
1368
1369         We now only enable AirplaySupport if the controls are visible to the user _and_ media has played.
1370
1371         Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-until-play.html
1372
1373         * Modules/modern-media-controls/media/airplay-support.js:
1374         (AirplaySupport.prototype.enable):
1375         (AirplaySupport.prototype.controlsUserVisibilityDidChange):
1376         (AirplaySupport.prototype._shouldBeEnabled):
1377         (AirplaySupport):
1378
1379 2018-05-18  Tim Horton  <timothy_horton@apple.com>
1380
1381         Stop softlinking QuickLook when loading from client-registered schemes
1382         https://bugs.webkit.org/show_bug.cgi?id=185716
1383         <rdar://problem/40303227>
1384
1385         Reviewed by Dan Bernstein.
1386
1387         No new tests, just a performance improvement.
1388
1389         * dom/Document.cpp:
1390         * platform/SchemeRegistry.cpp:
1391         * platform/ios/QuickLook.h:
1392         * platform/ios/QuickLook.mm:
1393         (WebCore::isQuickLookPreviewURL):
1394         (WebCore::QLPreviewProtocol): Deleted.
1395         Hard-code the QuickLook preview URL scheme, instead of loading the QuickLook
1396         framework to retrieve it. It will never change, and just in case it does,
1397         add an ASSERT (which does load QuickLook) so that we'll find out.
1398
1399 2018-05-18  Antoine Quint  <graouts@apple.com>
1400
1401         [Web Animations] Turn Web Animations with CSS integration on for test runners
1402         https://bugs.webkit.org/show_bug.cgi?id=184819
1403         <rdar://problem/39597337>
1404
1405         Reviewed by Jon Lee.
1406
1407         We ensure we always call into both CSSAnimationController::cancelAnimations() and
1408         AnimationTimeline::cancelDeclarativeAnimationsForElement() since we want teardown of animations
1409         to be performed no matter which animation code path is used. What that in mind, we don't
1410         conditionalize the CSSAnimationController-related ASSERT() in FrameView::didDestroyRenderTree().
1411
1412         * dom/Element.cpp:
1413         (WebCore::Element::removedFromAncestor):
1414         * dom/PseudoElement.cpp:
1415         (WebCore::PseudoElement::clearHostElement):
1416         * page/FrameView.cpp:
1417         (WebCore::FrameView::didDestroyRenderTree):
1418         * page/RuntimeEnabledFeatures.h:
1419         * rendering/updating/RenderTreeUpdater.cpp:
1420         (WebCore::RenderTreeUpdater::tearDownRenderers):
1421
1422 2018-05-17  David Kilzer  <ddkilzer@apple.com>
1423
1424         Lazily create WebCore::Timer for WebCore::Image
1425         <https://webkit.org/b/185752>
1426
1427         Reviewed by Simon Fraser.
1428
1429         Not every image is an animated image, so lazily creating
1430         m_animationStartTimer saves 64 bytes per instance of
1431         WebCore::Image.
1432
1433         * platform/graphics/Image.cpp:
1434         (WebCore::Image::Image): Remove default initializer for
1435         m_animationStartTimer.
1436         (WebCore::Image::startAnimationAsynchronously): Initialize
1437         m_animationStartTimer if it's not already created.
1438         * platform/graphics/Image.h:
1439         (WebCore::Image::animationPending const): Update to check if
1440         m_animationStartTimer has been set before dereferencing it.
1441         (WebCore::Image::m_animationStartTimer): Change type to
1442         std::unique_ptr<Timer>.
1443
1444 2018-05-17  Nan Wang  <n_wang@apple.com>
1445
1446         AX: [macOS] Expose the primary screen height through AX API
1447         https://bugs.webkit.org/show_bug.cgi?id=185742
1448
1449         Reviewed by Chris Fleizach.
1450
1451         Added a new attribute to expose the primary screen size on both
1452         WebAccessibilityObjectWrapper and WKAccessibilityWebPageObject.
1453
1454         Test: accessibility/mac/primary-screen-height.html
1455
1456         * WebCore.xcodeproj/project.pbxproj:
1457         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
1458         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1459         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
1460         (-[WebAccessibilityObjectWrapper primaryScreenHeight]):
1461         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1462         * platform/PlatformScreen.h:
1463         * platform/mac/PlatformScreenMac.mm:
1464         (WebCore::screenRectForPrimaryScreen):
1465
1466 2018-05-17  Chris Dumez  <cdumez@apple.com>
1467
1468         RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its cross-origin parent
1469         https://bugs.webkit.org/show_bug.cgi?id=185664
1470         <rdar://problem/36185260>
1471
1472         Reviewed by Simon Fraser.
1473
1474         RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its
1475         cross-origin parent. There was logic in FrameLoader::scrollToFragmentWithParentBoundary()
1476         to temporarily set the 'safeToPropagateScrollToParent' flag to false on the cross-origin
1477         ancestor frame during the call to FrameView::scrollToFragment(). This would correctly
1478         prevent RenderLayer::scrollRectToVisible() to propagate the scroll to the cross-origin
1479         ancestor frame when scrollRectToVisible() is called synchronously. However,
1480         scrollRectToVisible() can get called asynchronously in case of a dirty layout, as part
1481         of the post layout tasks.
1482
1483         To address the issue, we get rid of the safeToPropagateScrollToParent flag on FrameView
1484         and instead update FrameView::safeToPropagateScrollToParent() to do the cross-origin
1485         check. FrameView::safeToPropagateScrollToParent() is called by RenderLayer::scrollRectToVisible()
1486         and this is a lot more robust than relying on a flag which gets temporarily set.
1487
1488         Test: http/tests/navigation/fragment-navigation-cross-origin-subframe-no-scrolling-parent.html
1489
1490         * dom/Document.cpp:
1491         * dom/Document.h:
1492         * loader/FrameLoader.cpp:
1493         (WebCore::FrameLoader::scrollToFragmentWithParentBoundary):
1494         * page/FrameView.cpp:
1495         (WebCore::FrameView::FrameView):
1496         (WebCore::FrameView::reset):
1497         (WebCore::FrameView::safeToPropagateScrollToParent const):
1498         * page/FrameView.h:
1499
1500 2018-05-17  Don Olmstead  <don.olmstead@sony.com>
1501
1502         [Curl] Enable HTTP/2 Multiplexing
1503         https://bugs.webkit.org/show_bug.cgi?id=185746
1504
1505         Reviewed by Youenn Fablet.
1506
1507         Covered by existing tests.
1508
1509         * platform/network/curl/CurlContext.cpp:
1510         (WebCore::CurlMultiHandle::CurlMultiHandle):
1511
1512 2018-05-17  Jeremy Jones  <jeremyj@apple.com>
1513
1514         Remove unnecessary exit fullscreen call on application resume
1515         https://bugs.webkit.org/show_bug.cgi?id=185747
1516         rdar://problem/40345725
1517
1518         Reviewed by Jer Noble.
1519
1520         No new tests because no behavior change.
1521
1522         Auto-PiP doesn't automatically return to fullscreen on app resume,
1523         so we don't need to keep this vestigial code for handling a corner case of that feature.
1524         Also, this can cause an unnecessary exit fullscreen that could cause debug asserts.
1525
1526         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1527         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
1528
1529 2018-05-17  Jeremy Jones  <jeremyj@apple.com>
1530
1531         Fullscreen to PiP results in exit fullscreen call failure
1532         https://bugs.webkit.org/show_bug.cgi?id=185699
1533         rdar://problem/40310291
1534
1535         Reviewed by Eric Carlson.
1536
1537         No new tests because no behavior change.
1538
1539         Prevent multiple exit fullscreen calls when transitioning from fullscreen to picture-in-picture.
1540
1541         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1542         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart:]):
1543         Implement this to prevent AVKit from automatically initiating exit fullscreen on pip.
1544         
1545         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
1546         Set the return to fullscreen flag here, since this is where exit fullscreen happens.
1547
1548         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1549         Don't exit fullscreen here since it is already initiated in didStartPictureInPicture.
1550
1551 2018-05-17  Ryan Haddad  <ryanhaddad@apple.com>
1552
1553         Unreviewed, rolling out r231899.
1554
1555         Caused flakiness in two existing modern-media-controls tests.
1556
1557         Reverted changeset:
1558
1559         "[modern-media-controls] AirPlaySupport should be disabled by
1560         default"
1561         https://bugs.webkit.org/show_bug.cgi?id=185658
1562         https://trac.webkit.org/changeset/231899
1563
1564 2018-05-17  Eric Carlson  <eric.carlson@apple.com>
1565
1566         [iOS] Update AirPlay route monitoring
1567         https://bugs.webkit.org/show_bug.cgi?id=185706
1568         <rdar://problem/40230677>
1569
1570         Unreviewed, fix extra zoom mode build after r231913.
1571
1572         * platform/audio/ios/MediaSessionManagerIOS.mm:
1573         (-[WebMediaSessionHelper dealloc]):
1574         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
1575
1576 2018-05-17  Jer Noble  <jer.noble@apple.com>
1577
1578         CRASH in ImageDecoderAVFObjC::sampleAtIndex()
1579         https://bugs.webkit.org/show_bug.cgi?id=185734
1580         <rdar://problem/40295094>
1581
1582         Reviewed by Eric Carlson.
1583
1584         Test: fast/images/animated-image-mp4-crash.html
1585
1586         Test the correct size value before iterating over the SampleMap in presentationOrder()
1587
1588         * Modules/mediasource/SampleMap.h:
1589         (WebCore::PresentationOrderSampleMap::size const):
1590         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1591         (WebCore::ImageDecoderAVFObjC::sampleAtIndex const):
1592
1593 2018-05-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1594
1595         [Extra zoom mode] Disabled adaptations are not reset upon mainframe navigation
1596         https://bugs.webkit.org/show_bug.cgi?id=185735
1597         <rdar://problem/40335311>
1598
1599         Reviewed by Tim Horton.
1600
1601         When performing mainframe navigation, we currently don't update the Page's ViewportConfiguration's disabled
1602         adaptations. This causes disabled adaptations from the previous main document to persist. To fix this, propagate
1603         the new document's disabled adaptations to the client when it becomes the main document in the page.
1604
1605         Test: fast/viewport/extrazoom/viewport-adaptations-after-navigation.html
1606
1607         * dom/Document.cpp:
1608         (WebCore::Document::didBecomeCurrentDocumentInFrame):
1609         (WebCore::Document::processDisabledAdaptations):
1610         (WebCore::Document::dispatchDisabledAdaptationsDidChangeForMainFrame):
1611         * dom/Document.h:
1612
1613 2018-05-17  Eric Carlson  <eric.carlson@apple.com>
1614
1615         [iOS] Update AirPlay route monitoring
1616         https://bugs.webkit.org/show_bug.cgi?id=185706
1617         <rdar://problem/40230677>
1618
1619         Reviewed by Jer Noble.
1620
1621         Use an AVRouteDetector instead of an MPVolumeView and an MPAVRoutingController for AirPlay
1622         route detection and availability monitoring.
1623
1624         No new tests, tested manually.
1625
1626         * html/MediaElementSession.cpp:
1627         (WebCore::MediaElementSession::hasWirelessPlaybackTargets): No need to update m_hasPlaybackTargets
1628         manually, it is always updated by the session manager when route availability changes.
1629
1630         * platform/audio/ios/MediaSessionManagerIOS.mm:
1631         (-[WebMediaSessionHelper dealloc]): Pull the logic from safelyTearDown inline.
1632         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Use the AVRouteDetector.
1633         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Ditto.  Simplify logic, there is no
1634         need to dispatch twice.
1635         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Don't release the route detector
1636         completely, just disable route detection, because AVRouteDetector is a lightweight object so
1637         it is not worth the overhead of dealloc/realloc to disable/enable route detection.
1638         (-[WebMediaSessionHelper interruption:]): Use callOnWebThreadOrDispatchAsyncOnMainThread
1639         instead of WebThreadRun so it works correctly in WK2 as well as in WK1.
1640         (-[WebMediaSessionHelper applicationWillEnterForeground:]): Ditto.
1641         (-[WebMediaSessionHelper applicationDidBecomeActive:]): Ditto.
1642         (-[WebMediaSessionHelper applicationWillResignActive:]): Ditto.
1643         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): Ditto.
1644         (-[WebMediaSessionHelper applicationDidEnterBackground:]): Ditto.
1645         (safelyTearDown): Deleted.
1646
1647 2018-05-17  Chris Dumez  <cdumez@apple.com>
1648
1649         Cross-Origin-Options: deny/allow-postmessage should prevent getting navigated by cross-origin scripts
1650         https://bugs.webkit.org/show_bug.cgi?id=185681
1651         <rdar://problem/40296313>
1652
1653         Reviewed by Geoffrey Garen.
1654
1655         Update our canNavigate() implementation [1] to take into account the Cross-Origin-Options header.
1656         If the window being navigated or the window trigerring the navigation have a Cross-Origin-Options
1657         header value different than 'allow', then the attempt to navigate will be blocked.
1658
1659         Note that it was already not possible to navigate via setting window.location since trying to set
1660         it would throw a SecurityError with 'Cross-Origin-Options: deny/allow-postmessage'. However, it was
1661         possible to trigger a "targeted" navigation via <a target="foo"> or open(url, "foo").
1662
1663         [1] https://html.spec.whatwg.org/#allowed-to-navigate
1664
1665         Tests: http/wpt/cross-origin-options/navigation-from-opener-via-open-target.html
1666                http/wpt/cross-origin-options/navigation-from-subframe-via-anchor-target.html
1667
1668         * dom/Document.cpp:
1669         (WebCore::Document::canNavigate):
1670
1671 2018-05-17  Brent Fulgham  <bfulgham@apple.com>
1672
1673         Storage Access API: Allow documents that have been granted storage access to also do a popup
1674         https://bugs.webkit.org/show_bug.cgi?id=185615
1675         <rdar://problem/39105791>
1676
1677         Reviewed by Chris Dumez.
1678
1679         * dom/Document.cpp:
1680         (WebCore::Document::consumeTemporaryUserGesture): Added. Clear the document's active one-time user
1681         activity (for window opening) state.
1682         (WebCore::Document::enableTemporaryUserGesture): Added. Establish a new active one-time user
1683         activity (for window opening) state.
1684         (WebCore::Document::requestStorageAccess): If the user approves Storage Access, establish a new
1685         UserInteraction scope, then resolve the promise. Also post a task to clear the one-time user
1686         gesture state.
1687
1688 2018-05-17  Zalan Bujtas  <zalan@apple.com>
1689
1690         [LFC] Introduce DisplayBox::Style
1691         https://bugs.webkit.org/show_bug.cgi?id=185733
1692
1693         Reviewed by Antti Koivisto.
1694
1695         This is the collection of computed style data needed to paint/hittest the display boxtree.
1696
1697         * layout/LayoutContext.cpp:
1698         (WebCore::Layout::LayoutContext::createDisplayBox):
1699         * layout/displaytree/DisplayBox.cpp:
1700         (WebCore::Display::Box::Box):
1701         (WebCore::Display::Box::Style::Style):
1702         (WebCore::Display::Box::borderBox const):
1703         (WebCore::Display::Box::contentBox const):
1704         * layout/displaytree/DisplayBox.h:
1705
1706 2018-05-17  Antoine Quint  <graouts@apple.com>
1707
1708         [modern-media-controls] AirPlaySupport should be disabled by default
1709         https://bugs.webkit.org/show_bug.cgi?id=185658
1710         <rdar://problem/40272213>
1711
1712         Reviewed by Simon Fraser.
1713
1714         We now only enable AirplaySupport if the controls are visible to the user _and_ media has played.
1715
1716         Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-until-play.html
1717
1718         * Modules/modern-media-controls/media/airplay-support.js:
1719         (AirplaySupport.prototype.enable):
1720         (AirplaySupport.prototype.controlsUserVisibilityDidChange):
1721         (AirplaySupport.prototype._shouldBeEnabled):
1722         (AirplaySupport):
1723
1724 2018-05-17  Zalan Bujtas  <zalan@apple.com>
1725
1726         [LFC] Replace ASSERT_NOT_REACHED with ASSERT_NOT_IMPLEMENTED_YET where applicable.
1727         https://bugs.webkit.org/show_bug.cgi?id=185728
1728
1729         Reviewed by Antti Koivisto.
1730
1731         * layout/FormattingContext.cpp:
1732         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const): leftover from previous patch.
1733         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
1734         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1735         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
1736         (WebCore::Layout::FormattingContext::computeReplacedWidth const):
1737         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
1738         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedWidth const):
1739         * layout/LayoutContext.cpp:
1740         (WebCore::Layout::LayoutContext::styleChanged):
1741         (WebCore::Layout::LayoutContext::formattingContext):
1742         * layout/blockformatting/BlockFormattingContext.cpp:
1743         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedWidth const):
1744         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
1745         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const):
1746         * layout/layouttree/LayoutTreeBuilder.cpp:
1747         (WebCore::Layout::TreeBuilder::createSubTree):
1748
1749 2018-05-17  Zalan Bujtas  <zalan@apple.com>
1750
1751         [LFC] Move replaced logic from Layout::Box to Layout::Replaced class
1752         https://bugs.webkit.org/show_bug.cgi?id=185711
1753
1754         Reviewed by Antti Koivisto.
1755
1756         * Sources.txt:
1757         * WebCore.xcodeproj/project.pbxproj:
1758         * layout/FormattingContext.cpp:
1759         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
1760         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
1761         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1762         (WebCore::Layout::FormattingContext::computeInFlowReplacedWidth const):
1763         * layout/blockformatting/BlockFormattingContext.cpp:
1764         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
1765         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
1766         * layout/layouttree/LayoutBox.cpp:
1767         (WebCore::Layout::Box::isReplaced const): Deleted.
1768         (WebCore::Layout::Box::hasIntrinsicWidth const): Deleted.
1769         (WebCore::Layout::Box::hasIntrinsicHeight const): Deleted.
1770         (WebCore::Layout::Box::hasIntrinsicRatio const): Deleted.
1771         (WebCore::Layout::Box::intrinsicWidth const): Deleted.
1772         (WebCore::Layout::Box::intrinsicHeight const): Deleted.
1773         (WebCore::Layout::Box::intrinsicRatio const): Deleted.
1774         * layout/layouttree/LayoutBox.h:
1775         (WebCore::Layout::Box::replaced const):
1776
1777 2018-05-17  Zalan Bujtas  <zalan@apple.com>
1778
1779         [LFC] Implement width computation for replaced out if flow elements.
1780         https://bugs.webkit.org/show_bug.cgi?id=185701
1781
1782         Reviewed by Antti Koivisto.
1783         
1784         The used value of 'width' is determined as for inline replaced elements.
1785
1786         * layout/FormattingContext.cpp:
1787         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
1788         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
1789         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedWidth const):
1790         * layout/FormattingContext.h:
1791
1792 2018-05-17  Thibault Saunier  <tsaunier@igalia.com>
1793
1794         [GStreamer]: Consider GstStream(Collection) as if if was not a GInitiallyUnowned
1795         https://bugs.webkit.org/show_bug.cgi?id=185657
1796
1797         Reviewed by Philippe Normand.
1798
1799         Starting with GStreamer 1.14[1] the reference is sunk at object creation time, making it a normal
1800         GObject in practice, in our GRefPtr template implementation we should just consider GstStream
1801         as if it was a normal GObject and not care about its floating reference state as
1802         the ref is never sunk by anyone before 1.14 though that floating ref is considered
1803         as a hard reference by the GstStreamCollection (leading to assertions/)
1804
1805         The exact same issue happens with GstStreamCollection, so fix it at the same time.
1806
1807         Also do not adoptRef() on the result of gst_stream_collection_get_stream() as this function
1808         is transfer-none.
1809
1810         [1] commit f119e93b47efb06ffc68c01d3e094d5346c30041 `gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent`
1811
1812         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
1813         (WTF::adoptGRef):
1814         (WTF::refGPtr<GstStream>):
1815         (WTF::refGPtr<GstStreamCollection>):
1816         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1817         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1818
1819 2018-05-16  Devin Rousso  <webkit@devinrousso.com>
1820
1821         Web Inspector: create a navigation item for toggling the overlay rulers/guides
1822         https://bugs.webkit.org/show_bug.cgi?id=185644
1823
1824         Reviewed by Matt Baker.
1825
1826         This patch is purely a visual change for WebInspector, and doesn't affect anything else.
1827
1828         * inspector/agents/InspectorPageAgent.h:
1829         * inspector/agents/InspectorPageAgent.cpp:
1830         (WebCore::InspectorPageAgent::setShowRulers): Added.
1831
1832         * inspector/InspectorOverlay.h:
1833         * inspector/InspectorOverlay.cpp:
1834         (WebCore::InspectorOverlay::shouldShowOverlay):
1835         (WebCore::InspectorOverlay::update):
1836         (WebCore::InspectorOverlay::setShowRulers): Added.
1837         (WebCore::InspectorOverlay::drawRulers): Added.
1838         (WebCore::InspectorOverlay::reset):
1839
1840         * inspector/InspectorOverlayPage.js:
1841         (drawNodeHighlight):
1842         (drawQuadHighlight):
1843         (drawRulers): Added.
1844         (_drawBounds): Added.
1845         (reset):
1846         (_drawRulers): Deleted.
1847
1848 2018-05-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1849
1850         [GTK] SoupNetworkSession.h:68:62: error: unknown type name 'URL'
1851         https://bugs.webkit.org/show_bug.cgi?id=185378
1852
1853         Unreviewed, just replace unneeded #include with a forward declaration
1854
1855         * platform/network/soup/SoupNetworkSession.h:
1856
1857 2018-05-16  Jer Noble  <jer.noble@apple.com>
1858
1859         CRASH: Exception thrown from -[AVContentKeySession processContentKeyRequestWithIdentifier:initializationData:options:] after -expire called
1860         https://bugs.webkit.org/show_bug.cgi?id=185690
1861         <rdar://problem/38297768>
1862
1863         Reviewed by Eric Carlson.
1864
1865         Reject all calls to update() after close() has been called on the session.
1866
1867         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1868         (WebCore::CDMSessionAVContentKeySession::update):
1869
1870 2018-05-16  Andy VanWagoner  <andy@vanwagoner.family>
1871
1872         Add support for Intl NumberFormat formatToParts
1873         https://bugs.webkit.org/show_bug.cgi?id=185375
1874
1875         Reviewed by Yusuke Suzuki.
1876
1877         Test: js/intl-numberformat-format-to-parts.html
1878
1879         Add flag & tests for NumberFormat formatToParts.
1880
1881         * Configurations/FeatureDefines.xcconfig:
1882
1883 2018-05-16  Eric Carlson  <eric.carlson@apple.com>
1884
1885         Improve NowPlaying "title"
1886         https://bugs.webkit.org/show_bug.cgi?id=185680
1887         <rdar://problem/40296700>
1888
1889         Reviewed by Jer Noble.
1890         
1891         We send NowPlaying the element's title attribute if not empty, else the element's current url.
1892         Title should be preferred because it is the most specific, but we should use the document
1893         title if non-empty next, and if falling back to the element's url use just the domain instead
1894         of the full url because it isn't likely to be useful to the user given the small amount of
1895         space control center uses to display the title. Further, don't use any title at all when
1896         in private browsing mode.
1897
1898         Tests: http/tests/media/now-playing-info-private-browsing.html
1899                http/tests/media/now-playing-info.html
1900
1901         * html/HTMLMediaElement.cpp:
1902         (WebCore::HTMLMediaElement::parseAttribute): Update NowPlaying when the title attribute changes.
1903         (WebCore::HTMLMediaElement::finishSeek): Update NowPlaying when a seek completes.
1904         (WebCore::HTMLMediaElement::mediaSessionTitle const): Update logic.
1905         (WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const): Use the hash of the current 
1906         url as the unique identifier.
1907         * html/HTMLMediaElement.h:
1908
1909         * platform/audio/PlatformMediaSession.cpp:
1910         (WebCore::PlatformMediaSession::uniqueIdentifier const): New.
1911         (WebCore::PlatformMediaSessionClient::mediaSessionUniqueIdentifier const): Ditto.
1912         * platform/audio/PlatformMediaSession.h:
1913
1914         * platform/audio/ios/MediaSessionManagerIOS.mm:
1915         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Update m_lastUpdatedNowPlayingInfoUniqueIdentifier.
1916
1917         * platform/audio/mac/MediaSessionManagerMac.mm:
1918         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Update.
1919
1920         * testing/Internals.cpp:
1921         (WebCore::Internals::nowPlayingState const): Expose NowPlaying state.
1922         * testing/Internals.h:
1923         * testing/Internals.idl:
1924
1925 2018-05-16  Daniel Bates  <dabates@apple.com>
1926
1927         Attempt to fix the WinCairo build following r231859
1928         (https://bugs.webkit.org/show_bug.cgi?id=185654)
1929
1930         Instantiate Cookie as a struct and set applicable fields.
1931
1932         * platform/network/curl/CookieJarDB.cpp:
1933         (WebCore::CookieJarDB::searchCookies):
1934
1935 2018-05-16  Daniel Bates  <dabates@apple.com>
1936
1937         Cleanup platform Cookie
1938         https://bugs.webkit.org/show_bug.cgi?id=185654
1939
1940         Reviewed by Per Arne Vollan.
1941
1942         Remove unnecessary constructor and use =default for default constructor.
1943         Simplify Cookie::decode() by having it decode directly into a stack-allocated
1944         cookie. Remove some unnecessary local variables. Fix style nits.
1945
1946         * platform/Cookie.h:
1947         (WebCore::Cookie::Cookie):
1948         (WebCore::Cookie::isNull const):
1949         (WebCore::Cookie::encode const):
1950         (WebCore::Cookie::decode):
1951         * platform/network/cf/CookieJarCFNet.cpp:
1952         (WebCore::getRawCookies):
1953         * platform/network/cocoa/CookieCocoa.mm:
1954         (WebCore::cookieCreated):
1955         (WebCore::Cookie::Cookie):
1956         (WebCore::Cookie::operator== const):
1957         (WebCore::Cookie::hash const):
1958         * platform/network/soup/CookieJarSoup.cpp:
1959         (WebCore::getRawCookies):
1960
1961 2018-05-14  Yusuke Suzuki  <utatane.tea@gmail.com>
1962
1963         [Win] Use C++17 in MSVC
1964         https://bugs.webkit.org/show_bug.cgi?id=185232
1965
1966         Reviewed by Alex Christensen.
1967
1968         Workaround for MSVC + /std:c++17.
1969
1970         * Modules/geolocation/Coordinates.h:
1971         (WebCore::Coordinates::isolatedCopy const):
1972
1973 2018-05-16  Chris Nardi  <cnardi@chromium.org>
1974
1975         Remove Document#selectedStylesheetSet/preferredStylesheetSet
1976         https://bugs.webkit.org/show_bug.cgi?id=185381
1977
1978         Reviewed by Darin Adler.
1979
1980         Document#selectedStylesheetSet/preferredStylesheetSet are non-standard methods that
1981         are only implemented WebKit. Blink removed these methods in https://crbug.com/690609.
1982         The standard versions of these methods are are no longer in the spec. Remove them
1983         entirely from our implementation.
1984
1985         Updated existing tests and imported/w3c/web-platform-tests/cssom/historical.html.
1986
1987         * dom/Document.cpp:
1988         (WebCore::Document::processHttpEquiv):
1989         * dom/Document.h:
1990         * dom/Document.idl:
1991         * style/StyleScope.cpp:
1992         (WebCore::Style::Scope::collectActiveStyleSheets):
1993         * style/StyleScope.h:
1994         (WebCore::Style::Scope::preferredStylesheetSetName const):
1995
1996 2018-05-16  Zalan Bujtas  <zalan@apple.com>
1997
1998         [LFC] Implement width computation for replaced inflow elements.
1999         https://bugs.webkit.org/show_bug.cgi?id=185672
2000
2001         Reviewed by Antti Koivisto.
2002
2003         Replaced width for block, inline and float elements compute the same way. 
2004
2005         * layout/FormattingContext.cpp:
2006         (WebCore::Layout::FormattingContext::computeWidth const):
2007         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
2008         (WebCore::Layout::FormattingContext::computeInFlowReplacedWidth const):
2009         * layout/FormattingContext.h:
2010         * layout/blockformatting/BlockFormattingContext.cpp:
2011         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
2012         * layout/layouttree/LayoutBox.cpp:
2013         (WebCore::Layout::Box::hasIntrinsicWidth const):
2014         (WebCore::Layout::Box::hasIntrinsicHeight const):
2015         (WebCore::Layout::Box::hasIntrinsicRatio const):
2016         (WebCore::Layout::Box::intrinsicWidth const):
2017         (WebCore::Layout::Box::intrinsicHeight const):
2018         (WebCore::Layout::Box::intrinsicRatio const):
2019         * layout/layouttree/LayoutBox.h:
2020
2021 2018-05-16  Zalan Bujtas  <zalan@apple.com>
2022
2023         [LFC] Make Display::Box box sizing aware
2024         https://bugs.webkit.org/show_bug.cgi?id=185649
2025
2026         Reviewed by Antti Koivisto.
2027
2028         Display::Box::width() == Display::Box::contentBox().width() <= box-sizing: content-box; (initial and default value)
2029         Display::Box::width() == Display::Box::borderBox().width() <= box-sizing: border-box;
2030
2031         * layout/LayoutContext.cpp:
2032         (WebCore::Layout::LayoutContext::createDisplayBox):
2033         * layout/displaytree/DisplayBox.cpp:
2034         (WebCore::Display::Box::Box):
2035         (WebCore::Display::Box::marginBox const):
2036         (WebCore::Display::Box::borderBox const):
2037         (WebCore::Display::Box::paddingBox const):
2038         (WebCore::Display::Box::contentBox const):
2039         * layout/displaytree/DisplayBox.h:
2040
2041 2018-05-16  Antoine Quint  <graouts@apple.com>
2042
2043         REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
2044         https://bugs.webkit.org/show_bug.cgi?id=185299
2045         <rdar://problem/39630230>
2046
2047         Reviewed by Simon Fraser.
2048
2049         In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first
2050         process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause
2051         or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation
2052         running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since
2053         the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a
2054         newly-uncommitted animation.
2055
2056         Test: transitions/interrupted-transition-hardware.html
2057
2058         * platform/graphics/ca/GraphicsLayerCA.cpp:
2059         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2060         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
2061         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2062         * platform/graphics/ca/GraphicsLayerCA.h:
2063         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
2064
2065 2018-05-15  Yusuke Suzuki  <utatane.tea@gmail.com>
2066
2067         [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function
2068         https://bugs.webkit.org/show_bug.cgi?id=185601
2069
2070         Reviewed by Saam Barati.
2071
2072         No behavior change.
2073
2074         * Modules/plugins/QuickTimePluginReplacement.mm:
2075         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
2076         * bindings/js/JSCustomElementRegistryCustom.cpp:
2077         (WebCore::getCustomElementCallback):
2078         * bindings/js/JSDOMConstructorBase.h:
2079         * bindings/js/JSDOMConvertCallbacks.h:
2080         (WebCore::Converter<IDLCallbackFunction<T>>::convert):
2081         * bindings/js/JSDOMPromise.cpp:
2082         (WebCore::DOMPromise::whenSettled):
2083         * bindings/js/ReadableStream.cpp:
2084         (WebCore::ReadableStream::pipeTo):
2085         (WebCore::ReadableStream::tee):
2086         * bindings/js/ReadableStreamDefaultController.cpp:
2087         (WebCore::ReadableStreamDefaultController::invoke):
2088         * bindings/scripts/CodeGeneratorJS.pm:
2089         (GenerateHeader):
2090         (GenerateOverloadDispatcher):
2091         * bindings/scripts/test/JS/JSTestObj.h:
2092         * bindings/scripts/test/JS/JSTestPluginInterface.h:
2093         * bridge/objc/objc_runtime.h:
2094         * bridge/runtime_method.h:
2095         * bridge/runtime_object.h:
2096         * html/HTMLMediaElement.cpp:
2097         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
2098         * testing/Internals.cpp:
2099         (WebCore::Internals::parserMetaData):
2100         (WebCore::Internals::cloneArrayBuffer):
2101
2102 2018-05-15  Matt Baker  <mattbaker@apple.com>
2103
2104         Web Inspector: element details hanger in inspector overlay should have better placement logic
2105         https://bugs.webkit.org/show_bug.cgi?id=128482
2106         <rdar://problem/16020709>
2107
2108         Reviewed by Timothy Hatcher.
2109
2110         When determining the best position for the hovered element details "tooltip",
2111         perform placement tests in view space, not canvas space, and account for the
2112         top content inset.
2113
2114         * inspector/InspectorOverlayPage.js:
2115         (reset): Drive by fix: added missing `.height`.
2116         (_drawElementTitle):
2117
2118 2018-05-15  Commit Queue  <commit-queue@webkit.org>
2119
2120         Unreviewed, rolling out r231765.
2121         https://bugs.webkit.org/show_bug.cgi?id=185668
2122
2123         the layout test added with this change is very flaky
2124         (Requested by realdawei on #webkit).
2125
2126         Reverted changeset:
2127
2128         "REGRESSION (r230574): Interrupted hardware transitions don't
2129         behave correctly"
2130         https://bugs.webkit.org/show_bug.cgi?id=185299
2131         https://trac.webkit.org/changeset/231765
2132
2133 2018-05-15  Devin Rousso  <webkit@devinrousso.com>
2134
2135         Web Inspector: Add rulers and guides
2136         https://bugs.webkit.org/show_bug.cgi?id=32263
2137         <rdar://problem/19281564>
2138
2139         Reviewed by Matt Baker.
2140
2141         This patch is purely a visual change for WebInspector, and doesn't affect anything else.
2142
2143         * inspector/InspectorOverlay.h:
2144         * inspector/InspectorOverlay.cpp:
2145         (WebCore::InspectorOverlay::update):
2146         (WebCore::InspectorOverlay::reset):
2147         (WebCore::InspectorOverlay::drawGutter): Deleted.
2148
2149         * inspector/InspectorOverlayPage.html:
2150         * inspector/InspectorOverlayPage.js:
2151         (Bounds): Added.
2152         (Bounds.prototype.get minX): Added.
2153         (Bounds.prototype.get minY): Added.
2154         (Bounds.prototype.get maxX): Added.
2155         (Bounds.prototype.get maxY): Added.
2156         (Bounds.prototype.update): Added.
2157         (drawNodeHighlight):
2158         (drawQuadHighlight):
2159         (reset):
2160         (_isolateActions): Added.
2161         (_quadToPath): Added.
2162         (_quadToPath.parseQuadPoint): Added.
2163         (_drawOutlinedQuad): Added.
2164         (_drawPath): Added.
2165         (_drawPath.parsePoints): Added.
2166         (_drawOutlinedQuadWithClip): Added.
2167         (_drawElementTitle):
2168         (_drawShapeHighlight):
2169         (_drawFragmentHighlight):
2170         (_drawRulers): Added.
2171         (quadToPath): Deleted.
2172         (drawOutlinedQuad): Deleted.
2173         (pathCommand): Deleted.
2174         (drawPath): Deleted.
2175         (drawOutlinedQuadWithClip): Deleted.
2176         (drawGutter): Deleted.
2177         * inspector/InspectorOverlayPage.css:
2178         (#log): Added.
2179         (#right-gutter): Deleted.
2180         (#bottom-gutter): Deleted.
2181
2182 2018-05-15  Jer Noble  <jer.noble@apple.com>
2183
2184         Media continues loading after rendered invisible (removed from DOM; scrolled off screen)
2185         https://bugs.webkit.org/show_bug.cgi?id=185487
2186
2187         Reviewed by Eric Carlson.
2188
2189         Test: media/video-buffering-allowed.html
2190
2191         When a media element is removed from the dom (e.g. through innerHTML=""), it doesn't
2192         necessarily stop loading media data; it will continue to do so until its destructor is
2193         called through garbage collection. Similarly, when a media element is rendered not-visible
2194         by being scrolled off-screen or being made display:none, media loading continues. There
2195         are legitimate use cases for out-of-DOM media loading, so only temporarily block loading
2196         when the element transitions out of the document. Similarly, only block loading for non-visible
2197         media elements when returning from the "page is hidden" state, and only until the media
2198         element is asked to play or is otherwise made visible.
2199
2200         Note: this refactors a lot of code out of PlatformMediaSession and into MediaElementSession,
2201         since this code is specific to "media elements".
2202
2203         * html/HTMLMediaElement.cpp:
2204         (WebCore::HTMLMediaElement::HTMLMediaElement):
2205         (WebCore::HTMLMediaElement::insertedIntoAncestor):
2206         (WebCore::HTMLMediaElement::removedFromAncestor):
2207         (WebCore::HTMLMediaElement::playInternal):
2208         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
2209         (WebCore::HTMLMediaElement::resume):
2210         (WebCore::HTMLMediaElement::visibilityStateChanged):
2211         (WebCore::HTMLMediaElement::createMediaPlayer):
2212         (WebCore::HTMLMediaElement::setShouldBufferData):
2213         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
2214         (WebCore::HTMLMediaElement::isVisibleInViewportChanged):
2215         (WebCore::HTMLMediaElement::fullscreenModeChanged):
2216         (WebCore::HTMLMediaElement::setInActiveDocument):
2217         * html/HTMLMediaElement.h:
2218         (WebCore::HTMLMediaElement::shouldBufferData const):
2219         (WebCore::HTMLMediaElement::elementIsHidden const):
2220         * html/MediaElementSession.cpp:
2221         (WebCore::MediaElementSession::MediaElementSession):
2222         (WebCore::MediaElementSession::clientWillBeginAutoplaying):
2223         (WebCore::MediaElementSession::clientWillBeginPlayback):
2224         (WebCore::MediaElementSession::clientWillPausePlayback):
2225         (WebCore::MediaElementSession::visibilityChanged):
2226         (WebCore::MediaElementSession::isVisibleInViewportChanged):
2227         (WebCore::MediaElementSession::inActiveDocumentChanged):
2228         (WebCore::MediaElementSession::scheduleClientDataBufferingCheck):
2229         (WebCore::MediaElementSession::clientDataBufferingTimerFired):
2230         (WebCore::MediaElementSession::updateClientDataBuffering):
2231         (WebCore::MediaElementSession::dataBufferingPermitted const):
2232         (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay const):
2233         * html/MediaElementSession.h:
2234         * platform/audio/PlatformMediaSession.cpp:
2235         (WebCore::PlatformMediaSession::PlatformMediaSession):
2236         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
2237         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
2238         (WebCore::PlatformMediaSession::clientWillPausePlayback):
2239         (): Deleted.
2240         (WebCore::PlatformMediaSession::visibilityChanged): Deleted.
2241         (WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck): Deleted.
2242         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired): Deleted.
2243         (WebCore::PlatformMediaSession::updateClientDataBuffering): Deleted.
2244         (WebCore::PlatformMediaSession::isHidden const): Deleted.
2245         * platform/audio/PlatformMediaSession.h:
2246         (WebCore::PlatformMediaSessionClient::setShouldBufferData): Deleted.
2247         (WebCore::PlatformMediaSessionClient::elementIsHidden const): Deleted.
2248         * platform/audio/PlatformMediaSessionManager.cpp:
2249         (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia const): Deleted.
2250         * platform/audio/PlatformMediaSessionManager.h:
2251         * platform/audio/ios/MediaSessionManagerIOS.h:
2252         * platform/audio/ios/MediaSessionManagerIOS.mm:
2253         (WebCore::MediaSessionManageriOS::sessionCanLoadMedia const): Deleted.
2254         * rendering/RenderVideo.cpp:
2255         (WebCore::RenderVideo::willBeDestroyed):
2256         * testing/Internals.cpp:
2257         (WebCore::Internals::elementShouldBufferData):
2258         * testing/Internals.h:
2259         * testing/Internals.idl:
2260
2261 2018-05-15  Charles Vazac  <cvazac@gmail.com>
2262
2263         Add the PerformanceServerTiming Interface which makes Server-Timing header timing values available to JavaScript running in the browser.
2264         https://bugs.webkit.org/show_bug.cgi?id=175569
2265
2266         Reviewed by Youenn Fablet.
2267
2268         Tests were imported from web-platform-tests: WebKit/LayoutTests/imported/w3c/web-platform-tests/server-timing/*
2269
2270         * Sources.txt: Added references to HeaderFieldTokenizer.cpp, ServerTiming.cpp, and ServerTimingParser.cpp.
2271         * WebCore.xcodeproj/project.pbxproj: Added various files.
2272         * loader/HeaderFieldTokenizer.cpp: Added.
2273         (WebCore::HeaderFieldTokenizer::HeaderFieldTokenizer): Added class for tokenizing header values.
2274         (WebCore::HeaderFieldTokenizer::consume): Added method to consume a specified character.
2275         (WebCore::HeaderFieldTokenizer::consumeQuotedString): Added method to consume a quote-string.
2276         (WebCore::HeaderFieldTokenizer::consumeToken): Added a method to consume a token.
2277         (WebCore::HeaderFieldTokenizer::consumeTokenOrQuotedString): Added method to consume a quote-string or quote-string, depending on net character.
2278         (WebCore::HeaderFieldTokenizer::skipSpaces): Added method to skip whitespace.
2279         (WebCore::HeaderFieldTokenizer::consumeBeforeAnyCharMatch): Added method to advance the cursor up until any of a list of characters.
2280         * loader/HeaderFieldTokenizer.h: Added.
2281         * loader/HTTPHeaderField.cpp: Expose isTokenCharacter and isWhitespace.
2282         * loader/HTTPHeaderField.h: Expose isTokenCharacter and isWhitespace.
2283         * loader/PolicyChecker.cpp: Added #include so source compiled on my machine.
2284         * loader/ResourceTiming.cpp:
2285         (WebCore::ResourceTiming::ResourceTiming): Added call to initServerTiming to parse the header.
2286         (WebCore::ResourceTiming::initServerTiming): Added method to parse the header.
2287         (WebCore::ResourceTiming::populateServerTiming): Added method to populate the server timing entries on a PerformanceResourceTiming object.
2288         (WebCore::ResourceTiming::isolatedCopy const): Added code to copy over the server timing entries.
2289         * loader/ResourceTiming.h:
2290         (WebCore::ResourceTiming::ResourceTiming): Accept collection of server timing entries in c'tor.
2291         * loader/ServerTiming.cpp: Added.
2292         (WebCore::ServerTiming::setParameter): Set named parameters, ignoring unrecognized or duplicates.
2293         (WebCore::ServerTiming::isolatedCopy const): Return a new pointer to the object.
2294         * loader/ServerTiming.h: Added.
2295         (WebCore::ServerTiming::ServerTiming): Added struct for the data needed by a server timing entry.
2296         (WebCore::ServerTiming::name const): Added name field of a server timing entry.
2297         (WebCore::ServerTiming::duration const): Added duration field of a server timing entry.
2298         (WebCore::ServerTiming::description const): Added description field of a server timing entry.
2299         * loader/ServerTimingParser.cpp: Added.
2300         (WebCore::ServerTimingParser::parseServerTiming): Parses the header generating a collection of server timing structs.
2301         * loader/ServerTimingParser.h: Added.
2302         * loader/WorkerThreadableLoader.h: Fix build.
2303         * page/Performance.cpp:
2304         (WebCore::Performance::addResourceTiming): Fixed a typo.
2305         * page/PerformanceResourceTiming.cpp:
2306         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming): Given a ResourceTiming object, populate our collection of PerformanceServerTiming objects.
2307         * page/PerformanceResourceTiming.h: Added serverTiming member and getter.
2308         * page/PerformanceResourceTiming.idl: Added serverTiming member to interface.
2309         * platform/network/HTTPHeaderNames.in: Added "Server-Timing" to the header enum.
2310         * platform/network/ResourceResponseBase.cpp: Added "Server-Timing" to isSafeCrossOriginResponseHeader whitelist.
2311
2312 2018-05-15  Brady Eidson  <beidson@apple.com>
2313
2314         Fix crash after a Worker terminates but there are still IDB transactions the server is trying to open for it.
2315         <rdar://problem/33744241> and https://bugs.webkit.org/show_bug.cgi?id=185653
2316
2317         Reviewed by Andy Estes.
2318
2319         Test: storage/indexeddb/modern/worker-transaction-open-after-worker-stop.html
2320
2321         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2322         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction): It's okay to not be able to find a pending TX
2323           that the server has started. e.g. When it was a WebWorker that asked for the TX but it has since terminated.
2324
2325 2018-05-15  Thomas Klausner  <tk@giga.or.at>
2326
2327         Add missing header to fix build.
2328         https://bugs.webkit.org/show_bug.cgi?id=185378
2329
2330         Reviewed by Michael Catanzaro.
2331
2332         * platform/network/soup/SoupNetworkSession.h:
2333
2334 2018-05-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2335
2336         [WPE] Build failure with RPi userland drivers and gstreamer-gl
2337         https://bugs.webkit.org/show_bug.cgi?id=185639
2338
2339         Reviewed by Philippe Normand.
2340
2341         When building for the RPi with userland drivers (dispmanx) override the
2342         value of GST_GL_HAVE_GLSYNC to 1 to avoid that the gstreamer-gl headers
2343         try to redefine the GLsync type that is already defined in libepoxy.
2344
2345         Defining __gl2_h_ is also needed to avoid other conflicting type
2346         definitions that happen between libepoxy and RPi GLES2 userland
2347         headers when the gstreamer-gl headers are included.
2348
2349         The issue doesn't happen with 1.14.0, so a check for that is added
2350         as well.
2351
2352         No new tests, no behavior change. It is a build fix.
2353
2354         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2355
2356 2018-05-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2357
2358         Unreviewed, rolling out r230749
2359
2360         This did not work as desired.
2361
2362         * platform/UserAgentQuirks.cpp:
2363         (WebCore::urlRequiresMacintoshPlatform):
2364
2365 2018-05-15  Dirk Schulze  <krit@webkit.org>
2366
2367         Add new SVGDOM SVGFEBLEND constants
2368         https://bugs.webkit.org/show_bug.cgi?id=185581
2369
2370         Reviewed by Simon Fraser.
2371
2372         Provide new SVG DOM constants for the new blend modes added to feBlend.
2373
2374         https://drafts.fxtf.org/filter-effects-1/#InterfaceSVGFEBlendElement
2375
2376         * platform/graphics/GraphicsTypes.cpp:
2377         (WebCore::blendModeName):
2378         * platform/graphics/GraphicsTypes.h:
2379         * svg/SVGFEBlendElement.h:
2380         (WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
2381         (WebCore::SVGPropertyTraits<BlendMode>::toString):
2382         * svg/SVGFEBlendElement.idl:
2383
2384 2018-05-15  Antoine Quint  <graouts@apple.com>
2385
2386         [Web Animations] Expose Web Animations CSS integration as an experimental feature
2387         https://bugs.webkit.org/show_bug.cgi?id=185647
2388
2389         Reviewed by Dean Jackson.
2390
2391         Make the Web Animations CSS integration flag an experimental feature, and only indicate that it is on if the Web Animations
2392         experimental feature is also enabled.
2393
2394         * dom/Document.cpp:
2395         (WebCore::Document::didBecomeCurrentDocumentInFrame):
2396         (WebCore::Document::resume):
2397         * dom/Element.cpp:
2398         (WebCore::Element::removedFromAncestor):
2399         * dom/PseudoElement.cpp:
2400         (WebCore::PseudoElement::clearHostElement):
2401         * history/CachedFrame.cpp:
2402         (WebCore::CachedFrameBase::restore):
2403         * page/Frame.cpp:
2404         (WebCore::Frame::clearTimers):
2405         * page/FrameView.cpp:
2406         (WebCore::FrameView::didDestroyRenderTree):
2407         * page/Page.cpp:
2408         (WebCore::Page::handleLowModePowerChange):
2409         (WebCore::Page::setIsVisibleInternal):
2410         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
2411         * page/RuntimeEnabledFeatures.h:
2412         (WebCore::RuntimeEnabledFeatures::setWebAnimationsCSSIntegrationEnabled):
2413         (WebCore::RuntimeEnabledFeatures::webAnimationsCSSIntegrationEnabled const):
2414         (WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
2415         (WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const): Deleted.
2416         * rendering/RenderLayer.cpp:
2417         (WebCore::RenderLayer::currentTransform const):
2418         (WebCore::RenderLayer::calculateClipRects const):
2419         * rendering/RenderLayerBacking.cpp:
2420         (WebCore::RenderLayerBacking::updateGeometry):
2421         * rendering/RenderLayerCompositor.cpp:
2422         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
2423         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
2424         * rendering/updating/RenderTreeUpdater.cpp:
2425         (WebCore::RenderTreeUpdater::tearDownRenderers):
2426         * style/StyleTreeResolver.cpp:
2427         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2428         * testing/InternalSettings.cpp:
2429         (WebCore::InternalSettings::webAnimationsCSSIntegrationEnabled):
2430         (WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
2431         * testing/InternalSettings.h:
2432         * testing/InternalSettings.idl:
2433         * testing/Internals.cpp:
2434         (WebCore::Internals::numberOfActiveAnimations const):
2435         (WebCore::Internals::animationsAreSuspended const):
2436         (WebCore::Internals::animationsInterval const):
2437         (WebCore::Internals::suspendAnimations const):
2438         (WebCore::Internals::resumeAnimations const):
2439
2440 2018-05-15  David Kilzer  <ddkilzer@apple.com>
2441
2442         Fix -Wreturn-std-move warnings in WebKit found by new clang compiler
2443         <https://webkit.org/b/185621>
2444
2445         Reviewed by Youenn Fablet.
2446
2447         Fix warnings like the following:
2448
2449             In file included from DerivedSources/WebCore/unified-sources/UnifiedSource139.cpp:5:
2450             ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: error: local variable 'sdp' will be copied despite being returned by name [-Werror,-Wreturn-std-move]
2451                     return sdp;
2452                            ^~~
2453             ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: note: call 'std::move' explicitly to avoid copying
2454                     return sdp;
2455                            ^~~
2456                            std::move(sdp)
2457             1 error generated.
2458
2459         * Modules/mediastream/PeerConnectionBackend.cpp:
2460         (WebCore::PeerConnectionBackend::filterSDP const):
2461         * accessibility/AccessibilityObject.cpp:
2462         (WebCore::rangeClosestToRange):
2463         * bindings/js/JSDOMConvertSequences.h:
2464         (WebCore::Detail::GenericSequenceConverter::convert):
2465         (WebCore::Detail::NumericSequenceConverter::convertArray):
2466         * bindings/js/JSDOMConvertStrings.cpp:
2467         (WebCore::stringToByteString):
2468         (WebCore::stringToUSVString):
2469         - Use WTFMove() in return statements to fix the warnings.
2470
2471 2018-05-14  Dean Jackson  <dino@apple.com>
2472
2473         Download and present System Preview
2474         https://bugs.webkit.org/show_bug.cgi?id=185459
2475         <rdar://problem/40079228>
2476
2477         Reviewed by Tim Horton.
2478
2479         If an <a> is a system preview, tell the resource request about it.
2480
2481         * html/HTMLAnchorElement.cpp:
2482         (WebCore::HTMLAnchorElement::handleClick):
2483
2484 2018-05-15  Antti Koivisto  <antti@apple.com>
2485
2486         animation-play-state: paused causes very high cpu load because of style invalidation loop
2487         https://bugs.webkit.org/show_bug.cgi?id=182436
2488         <rdar://problem/37182562>
2489
2490         Reviewed by Dean Jackson.
2491
2492         Test: animations/animation-playstate-paused-style-resolution.html
2493
2494         If the style of an element with 'animation-play-state: paused' is recomputed so it stays
2495         paused we would enter zero-duration animation timer loop.
2496
2497         * page/animation/AnimationBase.cpp:
2498         (WebCore::AnimationBase::updateStateMachine):
2499
2500         Don't move to AnimationState::PausedWaitResponse unless we get AnimationStateInput::StyleAvailable
2501         (matching the comments). Otherwise just stay in the existing paused state.
2502
2503         Remove AnimationStateInput::StartAnimation from assertion as the case can't happen.
2504
2505 2018-05-14  Youenn Fablet  <youenn@apple.com>
2506
2507         readableStreamDefaultControllerError should return early if stream is not readable
2508         https://bugs.webkit.org/show_bug.cgi?id=185602
2509
2510         Reviewed by Chris Dumez.
2511
2512         Return early if stream is not readable in @readableStreamDefaultControllerError.
2513         Update call sites to no longer check for ReadableStream state.
2514         Covered by unflaked and rebased tests.
2515
2516         * Modules/streams/ReadableStreamDefaultController.js:
2517         (error):
2518         * Modules/streams/ReadableStreamInternals.js:
2519         (readableStreamDefaultControllerError):
2520         (readableStreamDefaultControllerCallPullIfNeeded):
2521
2522 2018-05-14  Zalan Bujtas  <zalan@apple.com>
2523
2524         [LFC] Implement width computation for non-replaced block level inflow elements.
2525         https://bugs.webkit.org/show_bug.cgi?id=185641
2526
2527         Reviewed by Sam Weinig.
2528
2529         Block level inflow elements participate in block formatting context.
2530
2531         * layout/FormattingContext.cpp:
2532         (WebCore::Layout::FormattingContext::computeWidth const):
2533         * layout/FormattingContext.h:
2534         * layout/blockformatting/BlockFormattingContext.cpp:
2535         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
2536         * layout/blockformatting/BlockFormattingContext.h:
2537         * layout/inlineformatting/InlineFormattingContext.cpp:
2538         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
2539         * layout/inlineformatting/InlineFormattingContext.h:
2540
2541 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2542
2543         Unreviewed, fix the iOS build after r231779
2544
2545         Also address a minor in-person review comment by returning "extrazoom" instead of the empty string.
2546
2547         * page/DisabledAdaptations.cpp:
2548         (WebCore::extraZoomModeAdaptationName):
2549
2550 2018-05-14  Zalan Bujtas  <zalan@apple.com>
2551
2552         [LFC] FormattingContext:computeOutOfFlowNonReplacedHeight/Width should use the computed margins/paddings/borders
2553         https://bugs.webkit.org/show_bug.cgi?id=185633
2554
2555         Reviewed by Sam Weinig.
2556
2557         By the time we start computing height and width, DisplayBox should already have the computed values for margin/padding/border.
2558
2559         * layout/FormattingContext.cpp:
2560         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
2561         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
2562         * layout/displaytree/DisplayBox.h:
2563         (WebCore::Display::Box::paddingTop const):
2564         (WebCore::Display::Box::paddingLeft const):
2565         (WebCore::Display::Box::paddingBottom const):
2566         (WebCore::Display::Box::paddingRight const):
2567         (WebCore::Display::Box::borderTop const):
2568         (WebCore::Display::Box::borderLeft const):
2569         (WebCore::Display::Box::borderBottom const):
2570         (WebCore::Display::Box::borderRight const):
2571
2572 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2573
2574         [Extra zoom mode] Google search results are excessively zoomed in
2575         https://bugs.webkit.org/show_bug.cgi?id=185347
2576         <rdar://problem/39999778>
2577
2578         Reviewed by Tim Horton.
2579
2580         It turns out that basing minimum layout size and shrink-to-fit behaviors off of the `shrink-to-fit` viewport
2581         argument poses compatibility risks with web pages that already specify `shrink-to-fit` to opt out of default
2582         viewport shrinking behaviors in 1/3 multitasking mode on iPad.
2583
2584         One way to resolve this is to introduce a new viewport meta content attribute to disable viewport heuristics in
2585         extra zoom mode. However, combined shrink-to-fit and minimum device width behaviors are difficult to describe
2586         using a single backwards-compatible viewport meta content attribute, and the need to suppress the default
2587         behavior of `shrink-to-fit=no` if such an attribute is not disabled further muddles our viewport story.
2588
2589         After some internal deliberation, we’ve decided to experiment with a new meta tag named "disabled-adaptations".
2590         The content of this meta tag is a comma-separated list of adaptation names; if an adaptation name matches a
2591         known adaptation type (for instance, extra zoom mode), we disable the class of behaviors used to adapt web
2592         content. The first and only known adaptation type is extra zoom mode, which affects `shrink-to-fit` and layout
2593         size adjustments.
2594
2595         See per-method changes below for more details.
2596
2597         Test: fast/viewport/extrazoom/viewport-disable-extra-zoom-adaptations.html
2598
2599         * Sources.txt:
2600         * WebCore.xcodeproj/project.pbxproj:
2601         * dom/Document.cpp:
2602         (WebCore::Document::processDisabledAdaptations):
2603         * dom/Document.h:
2604         (WebCore::Document::disabledAdaptations const):
2605
2606         Add disabled adaptations to Document. Changes to disabled adaptations are not propagated if the parsed disabled
2607         adaptation types don't change; upon changing adaptation types, notify the client to adjust for the new disabled
2608         adaptations (currently, this only affects the viewport configuration).
2609
2610         * dom/ViewportArguments.h:
2611         * html/HTMLMetaElement.cpp:
2612         (WebCore::HTMLMetaElement::process):
2613         * html/parser/HTMLPreloadScanner.cpp:
2614         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
2615         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2616         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2617         * loader/FrameLoader.cpp:
2618         (WebCore::FrameLoader::commitProvisionalLoad):
2619
2620         Restore the set of disabled adaptations when restoring a page from the cache.
2621
2622         * page/Chrome.cpp:
2623         (WebCore::Chrome::dispatchDisabledAdaptationsDidChange const):
2624         * page/Chrome.h:
2625         * page/ChromeClient.h:
2626
2627         Add plumbing for changes to the set of disabled adaptations.
2628
2629         * page/DisabledAdaptations.cpp: Added.
2630         (WebCore::extraZoomModeAdaptationName):
2631         * page/DisabledAdaptations.h: Added.
2632
2633         Introduce a header containing a new enum for the extra zoom mode adaptation, as well as a helper function to
2634         return the extra zoom mode adaptation name.
2635
2636         * page/Page.cpp:
2637         (WebCore::Page::disabledAdaptations const):
2638
2639         Returns the mainframe's set of adaptations to disable.
2640
2641         * page/Page.h:
2642         * page/RemoteFrame.h:
2643         * page/RuntimeEnabledFeatures.h:
2644         (WebCore::RuntimeEnabledFeatures::setDisabledAdaptationsMetaTagEnabled):
2645         (WebCore::RuntimeEnabledFeatures::disabledAdaptationsMetaTagEnabled const):
2646
2647         Add a new runtime feature to gate handling the "disabled-adaptations" meta tag.
2648
2649         * page/ViewportConfiguration.cpp:
2650         (WebCore::shouldOverrideShrinkToFitArgument):
2651         (WebCore::needsUpdateAfterChangingDisabledAdaptations):
2652         (WebCore::ViewportConfiguration::setDisabledAdaptations):
2653         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
2654
2655         Consult whether or not extra zoom mode adaptations are disabled, instead of the shrink-to-fit attribute value.
2656
2657         (WebCore::ViewportConfiguration::updateConfiguration):
2658         * page/ViewportConfiguration.h:
2659
2660         Add an OptionSet of disabled adaptation types to ViewportConfiguration. Updates to the adaptation type are
2661         propagated to the ViewportConfiguration from Document, through the ChromeClient and the client layer (refer to
2662         changes in WebKit). Once the OptionSet is changed, we recompute the viewport configuration only if needed by the
2663         platform.
2664
2665         (WebCore::ViewportConfiguration::viewLayoutSize const):
2666         (WebCore::ViewportConfiguration::disabledAdaptations const):
2667         * page/WindowFeatures.cpp:
2668         (WebCore::parseDisabledAdaptations):
2669         * page/WindowFeatures.h:
2670
2671         Add a new helper to parse the meta content of a "disabled-adaptations" tag as an OptionSet of disabled
2672         adaptation types. The string is parsed by first splitting on the comma character, and then iterating over lower
2673         case, whitespace-stripped tokens to look for known adaptation names. So far, only extra zoom mode is supported.
2674
2675         * testing/Internals.cpp:
2676         (WebCore::Internals::extraZoomModeAdaptationName const):
2677         * testing/Internals.h:
2678         * testing/Internals.idl:
2679
2680         Expose the extra zoom mode adaptation name to the DOM, only when running layout tests.
2681
2682 2018-05-14  Joanmarie Diggs  <jdiggs@igalia.com>
2683
2684         AX: Listbox and Combobox roles embedded in labels should participate in name calculation
2685         https://bugs.webkit.org/show_bug.cgi?id=185521
2686
2687         Reviewed by Chris Fleizach.
2688
2689         Take selected children into account when computing the name in accessibleNameForNode.
2690         Add ListBox to the roles for which accessibleNameDerivesFromContent returns false so
2691         that native select elements with size > 1 are treated the same way as ARIA listbox.
2692         Also add ListBox to the roles which are treated as controls when used in ARIA. Finally,
2693         prevent labels which contain unrelated controls from being used as an AXTitleUIElement.
2694         This causes us to build a string from the label and its descendants, ensuring the latter
2695         participate in the name calculation.
2696
2697         Test: accessibility/text-alternative-calculation-from-listbox.html
2698
2699         * accessibility/AccessibilityLabel.cpp:
2700         (WebCore::childrenContainUnrelatedControls):
2701         (WebCore::AccessibilityLabel::containsUnrelatedControls const):
2702         * accessibility/AccessibilityLabel.h:
2703         * accessibility/AccessibilityNodeObject.cpp:
2704         (WebCore::accessibleNameForNode):
2705         * accessibility/AccessibilityObject.cpp:
2706         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
2707         (WebCore::AccessibilityObject::isARIAControl):
2708         * accessibility/AccessibilityRenderObject.cpp:
2709         (WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
2710         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
2711
2712 2018-05-14  Antoine Quint  <graouts@apple.com>
2713
2714         [Web Animations] Tests using the new animation engine may crash under WebCore::FrameView::didDestroyRenderTree when using internals methods
2715         https://bugs.webkit.org/show_bug.cgi?id=185612
2716         <rdar://problem/39579344>
2717
2718         Reviewed by Dean Jackson.
2719
2720         Add a new internals.pseudoElement() method to obtain a pseudo element matching a given pseudo-id. This is necessary to be able to move off
2721         internals.pauseTransitionAtTimeOnPseudoElement() and internals.pauseAnimationAtTimeOnPseudoElement() for Web Animations testing.
2722
2723         * testing/Internals.cpp:
2724         (WebCore::Internals::pseudoElement):
2725         * testing/Internals.h:
2726         * testing/Internals.idl:
2727
2728 2018-05-14  Antoine Quint  <graouts@apple.com>
2729
2730         REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
2731         https://bugs.webkit.org/show_bug.cgi?id=185299
2732         <rdar://problem/39630230>
2733
2734         Reviewed by Simon Fraser.
2735
2736         In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first
2737         process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause
2738         or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation
2739         running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since
2740         the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a
2741         newly-uncommitted animation.
2742
2743         Test: transitions/interrupted-transition-hardware.html
2744
2745         * platform/graphics/ca/GraphicsLayerCA.cpp:
2746         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2747         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
2748         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2749         * platform/graphics/ca/GraphicsLayerCA.h:
2750         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
2751
2752 2018-05-14  Thibault Saunier  <tsaunier@igalia.com>
2753
2754         [GStreamer] Fix style issue in MediaPlayerPrivateGStreamerBase
2755         https://bugs.webkit.org/show_bug.cgi?id=185510
2756
2757         Reviewed by Philippe Normand.
2758
2759         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:629:  More than one command on the same line  [whitespace/newline] [4]
2760         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:684:  More than one command on the same line  [whitespace/newline] [4]
2761         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:807:  More than one command on the same line  [whitespace/newline] [4]
2762
2763         Indentation and style issue fixed only.
2764
2765         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2766         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
2767         (WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
2768         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2769
2770 2018-05-14  Zalan Bujtas  <zalan@apple.com>
2771
2772         [LFC] Implement height computation for non-replaced out of flow elements.
2773         https://bugs.webkit.org/show_bug.cgi?id=185585
2774
2775         Reviewed by Antti Koivisto.
2776
2777         * layout/FormattingContext.cpp:
2778         (WebCore::Layout::FormattingContext::computeHeight const):
2779         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
2780         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2781         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
2782         (WebCore::Layout::FormattingContext::computeHeightForBlockFormattingContextRootWithAutoHeight const):
2783         * layout/FormattingContext.h:
2784         * layout/blockformatting/BlockFormattingContext.h:
2785         * layout/displaytree/DisplayBox.h:
2786
2787 2018-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
2788
2789         Renaming of overrides in LayoutBox
2790         https://bugs.webkit.org/show_bug.cgi?id=185609
2791
2792         Reviewed by Javier Fernandez.
2793
2794         The names of the methods for the overrides were not consistent,
2795         this patch fixes it by using the same structure in all the cases.
2796
2797         No new tests, no change of behavior.
2798
2799         * rendering/GridLayoutFunctions.cpp:
2800         (WebCore::GridLayoutFunctions::hasOverrideContainingBlockContentSizeForChild):
2801         * rendering/GridTrackSizingAlgorithm.cpp:
2802         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
2803         * rendering/RenderBlock.cpp:
2804         (WebCore::RenderBlock::computeChildPreferredLogicalWidths const):
2805         (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const):
2806         * rendering/RenderBlockFlow.cpp:
2807         (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
2808         * rendering/RenderBlockLineLayout.cpp:
2809         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
2810         * rendering/RenderBox.cpp:
2811         (WebCore::RenderBox::willBeDestroyed):
2812         (WebCore::RenderBox::hasOverrideContentLogicalHeight const):
2813         (WebCore::RenderBox::hasOverrideContentLogicalWidth const):
2814         (WebCore::RenderBox::setOverrideContentLogicalHeight):
2815         (WebCore::RenderBox::setOverrideContentLogicalWidth):
2816         (WebCore::RenderBox::clearOverrideContentLogicalHeight):
2817         (WebCore::RenderBox::clearOverrideContentLogicalWidth):
2818         (WebCore::RenderBox::clearOverrideContentSize):
2819         (WebCore::RenderBox::overrideContentLogicalWidth const):
2820         (WebCore::RenderBox::overrideContentLogicalHeight const):
2821         (WebCore::RenderBox::overrideContainingBlockContentLogicalWidth const):
2822         (WebCore::RenderBox::overrideContainingBlockContentLogicalHeight const):
2823         (WebCore::RenderBox::hasOverrideContainingBlockContentLogicalWidth const):
2824         (WebCore::RenderBox::hasOverrideContainingBlockContentLogicalHeight const):
2825         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
2826         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
2827         (WebCore::RenderBox::clearOverrideContainingBlockContentSize):
2828         (WebCore::RenderBox::clearOverrideContainingBlockContentLogicalHeight):
2829         (WebCore::RenderBox::containingBlockLogicalWidthForContent const):
2830         (WebCore::RenderBox::containingBlockLogicalHeightForContent const):
2831         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight const):
2832         (WebCore::RenderBox::computeLogicalWidthInFragment const):
2833         (WebCore::RenderBox::computeLogicalHeight const):
2834         (WebCore::RenderBox::computePercentageLogicalHeight const):
2835         (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
2836         (WebCore::RenderBox::availableLogicalHeightUsing const):
2837         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
2838         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
2839         * rendering/RenderBox.h:
2840         * rendering/RenderBoxModelObject.cpp:
2841         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight const):
2842         * rendering/RenderDeprecatedFlexibleBox.cpp:
2843         (WebCore::contentWidthForChild):
2844         (WebCore::contentHeightForChild):
2845         (WebCore::gatherFlexChildrenInfo):
2846         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
2847         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
2848         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2849         (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
2850         * rendering/RenderFlexibleBox.cpp:
2851         (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
2852         (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
2853         (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
2854         (WebCore::RenderFlexibleBox::constructFlexItem):
2855         (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
2856         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
2857         * rendering/RenderFullScreen.cpp:
2858         (WebCore::RenderFullScreen::unwrapRenderer):
2859         * rendering/RenderGrid.cpp:
2860         (WebCore::RenderGrid::layoutBlock):
2861         (WebCore::RenderGrid::layoutGridItems):
2862         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
2863         * rendering/RenderRubyBase.cpp:
2864         (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds const):
2865         * rendering/RenderTableCell.cpp:
2866         (WebCore::RenderTableCell::setOverrideContentLogicalHeightFromRowHeight):
2867         * rendering/RenderTableCell.h:
2868         * rendering/RenderTableSection.cpp:
2869         (WebCore::RenderTableSection::calcRowLogicalHeight):
2870         (WebCore::RenderTableSection::relayoutCellIfFlexed):
2871
2872 2018-05-14  Zalan Bujtas  <zalan@apple.com>
2873
2874         [LFC] Implement width computation for non-replaced out of flow elements.
2875         https://bugs.webkit.org/show_bug.cgi?id=185598
2876
2877         Reviewed by Antti Koivisto.
2878
2879         * layout/FormattingContext.cpp:
2880         (WebCore::Layout::FormattingContext::computeWidth const):
2881         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
2882         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2883         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
2884         (WebCore::Layout::FormattingContext::shrinkToFitWidth const):
2885         * layout/FormattingContext.h:
2886         * layout/blockformatting/BlockFormattingContext.cpp:
2887         (WebCore::Layout::BlockFormattingContext::layout const):
2888         * layout/displaytree/DisplayBox.h:
2889
2890 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
2891
2892         Drop the m_compositorTexture member variable in TextureMapperGC3DPlatformLayer.
2893         It's not used at all inside the class or outside it.
2894
2895         Rubber-stamped by Michael Catanzaro.
2896
2897         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
2898
2899 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
2900
2901         [GTK] REGRESSION(r231170) Build broken with Clang 5.0
2902         https://bugs.webkit.org/show_bug.cgi?id=185198
2903
2904         Reviewed by Michael Catanzaro.
2905
2906         Avoid gperf files using the register keyword which has been made
2907         reserved and as such unusable in C++17.
2908
2909         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
2910         * css/makeSelectorPseudoElementsMap.py:
2911         * css/makeprop.pl:
2912         * css/makevalues.pl:
2913         * platform/ColorData.gperf:
2914         * platform/ReferrerPolicy.h: With std::optional forward declaration
2915         gone, explicitly include the WTF Optional.h header.
2916         * platform/Theme.h: Ditto.
2917         * platform/network/create-http-header-name-table:
2918
2919 2018-05-14  Commit Queue  <commit-queue@webkit.org>
2920
2921         Unreviewed, rolling out r219515.
2922         https://bugs.webkit.org/show_bug.cgi?id=185603
2923
2924         It sometimes makes AudioUnitInitialize call to fail in
2925         CoreAudioCaptureSource (Requested by youenn on #webkit).
2926
2927         Reverted changeset:
2928
2929         "Remove CoreAudioCaptureSource speaker configuration"
2930         https://bugs.webkit.org/show_bug.cgi?id=174512
2931         https://trac.webkit.org/changeset/219515
2932
2933 2018-05-13  Dirk Schulze  <krit@webkit.org>
2934
2935         Implement SVGGeometryElement's isPointInFill and isPointInStroke
2936         https://bugs.webkit.org/show_bug.cgi?id=185580
2937
2938         Reviewed by Antti Koivisto.
2939
2940         Implement isPointInFill and isPointInStroke methods for
2941         SVGGeometryElement interface from SVG2.
2942
2943         https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
2944
2945         Tests: svg/dom/SVGGeometry-isPointInFill.xhtml
2946                svg/dom/SVGGeometry-isPointInStroke.xhtml
2947
2948         * rendering/svg/RenderSVGEllipse.cpp:
2949         (WebCore::RenderSVGEllipse::shapeDependentStrokeContains): Flag
2950                 to switch between local and "global" coordinate space for hit testing.
2951         * rendering/svg/RenderSVGEllipse.h:
2952         * rendering/svg/RenderSVGPath.cpp:
2953         (WebCore::RenderSVGPath::shapeDependentStrokeContains): Flag
2954                 to switch between local and "global" coordinate space for hit testing.
2955         * rendering/svg/RenderSVGPath.h:
2956         * rendering/svg/RenderSVGRect.cpp:
2957         (WebCore::RenderSVGRect::shapeDependentStrokeContains): Flag
2958                 to switch between local and "global" coordinate space for hit testing.
2959         * rendering/svg/RenderSVGRect.h:
2960         * rendering/svg/RenderSVGShape.cpp:
2961         (WebCore::RenderSVGShape::shapeDependentStrokeContains): Flag
2962                 to switch between local and "global" coordinate space for hit testing.
2963         (WebCore::RenderSVGShape::isPointInFill): Take the winding rule given by
2964                 `fill-rule` to test if a given point is in the fill area of a path.
2965         (WebCore::RenderSVGShape::isPointInStroke): Take stroke properties into
2966                 account to check if a point is on top of the stroke area.
2967         * rendering/svg/RenderSVGShape.h:
2968         * svg/SVGGeometryElement.cpp:
2969         (WebCore::SVGGeometryElement::isPointInFill):
2970         (WebCore::SVGGeometryElement::isPointInStroke):
2971         (WebCore::SVGGeometryElement::createElementRenderer): Deleted. This is getting implemented
2972                 by inheriting classes. No need to create RenderSVGPath here.
2973         * svg/SVGGeometryElement.h:
2974         * svg/SVGGeometryElement.idl:
2975
2976 2018-05-12  Zalan Bujtas  <zalan@apple.com>
2977
2978         Use WeakPtr for m_enclosingPaginationLayer in RenderLayer
2979         https://bugs.webkit.org/show_bug.cgi?id=185566
2980         <rdar://problem/36486052>
2981
2982         Reviewed by Simon Fraser.
2983
2984         Since RenderLayer does not own the enclosing pagination layout, it should
2985         construct a weak pointer instead of holding on to a raw pointer.
2986
2987         Unable to create a reliably reproducible test case.
2988
2989         * page/mac/EventHandlerMac.mm:
2990         (WebCore::scrollableAreaForEventTarget):
2991         (WebCore::scrollableAreaForContainerNode):
2992         (WebCore::EventHandler::platformPrepareForWheelEvents):
2993         * platform/ScrollableArea.h:
2994         (WebCore::ScrollableArea::weakPtrFactory const):
2995         (WebCore::ScrollableArea::createWeakPtr): Deleted.
2996         * rendering/RenderLayer.cpp:
2997         (WebCore::RenderLayer::RenderLayer):
2998         (WebCore::RenderLayer::updatePagination):
2999         * rendering/RenderLayer.h:
3000
3001 2018-05-11  Daniel Bates  <dabates@apple.com>
3002
3003         X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
3004         https://bugs.webkit.org/show_bug.cgi?id=185567
3005         <rdar://problem/40175008>
3006
3007         Reviewed by Brent Fulgham.
3008
3009         Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
3010         are same-origin with the document that delivered this header. This prevents an intermediary
3011         malicious frame from clickjacking a child frame whose document is same-origin with the top-
3012         level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
3013         the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.
3014         
3015         Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
3016         with the top-level frame's document in order to be displayed. This prevents clickjacking by
3017         a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
3018         it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
3019         if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
3020         document same origin with the victim page. We should protect against such attacks. 
3021
3022         Tests: http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-allow.html
3023                http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-deny.html
3024
3025         * loader/FrameLoader.cpp:
3026         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
3027
3028 2018-05-11  Daniel Bates  <dabates@apple.com>
3029
3030         [iOS] Text decoration of dragged content does not paint with opacity
3031         https://bugs.webkit.org/show_bug.cgi?id=185551
3032         <rdar://problem/40166867>
3033
3034         Reviewed by Wenson Hsieh.
3035
3036         Respect alpha when painting the text decoration for dragged content.
3037
3038         * rendering/InlineTextBox.cpp:
3039         (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual): Consider alpha when
3040         comparing decoration styles for equality so that we do not coalesce styles with differing alpha.
3041         (WebCore::InlineTextBox::paintMarkedTextDecoration): Respect alpha when painting dragged content.
3042
3043 2018-05-11  Nan Wang  <n_wang@apple.com>
3044
3045         AX: In role=dialog elements with aria-modal=true VoiceOver iOS/macOS can't manually focus or read dialog paragraph description text inside the modal.
3046         https://bugs.webkit.org/show_bug.cgi?id=185219
3047         <rdar://problem/39920009>
3048
3049         Reviewed by Chris Fleizach.
3050
3051         The text node descendants of a modal dialog are ignored. Fixed it by using AccessibilityObject's 
3052         node() to determine if it's the descendant of the modal dialog node.
3053
3054         Test: accessibility/aria-modal-text-descendants.html
3055
3056         * accessibility/AccessibilityObject.cpp:
3057         (WebCore::AccessibilityObject::isModalDescendant const):
3058
3059 2018-05-11  Ryosuke Niwa  <rniwa@webkit.org>
3060
3061         Tapping after CSS-based table casues an infinite loop in wordRangeFromPosition
3062         https://bugs.webkit.org/show_bug.cgi?id=185465
3063         <rdar://problem/35263057>
3064
3065         Reviewed by Antti Koivisto.
3066
3067         The bug was caused by TextIterator not emitting a line break when exiting a CSS-based table when an element
3068         with `display: table-row` has an invisible text node. Specifically, TextIterator::exitNode is never called on
3069         an element with `table-cell: row` when m_node is a text node with whitespaces which appears after an element
3070         with `display: table-cell`.
3071
3072         For example, for a tree structure like:
3073         table-row (R)
3074           table-cell (C)
3075             "text" (1)
3076           " " (2)
3077         Getting out of (C) would result in moving onto (2) without generating a line break for (R).
3078
3079         When this happens in nextBoundary as it tries to find the end of the last word in the table cell, we end up
3080         finding the end of the document as the end of the word. As a result, nextWordBoundaryInDirection, the caller
3081         of nextBoundary, ends up infinite looping between the positon at the end of the document and the position
3082         immediately before the last word in the last table cell when it traverses words backwards.
3083
3084         This patch fixes the hang by addressing this root cause in TextIterator. Namely, TextIterator now generates
3085         a line break when exiting a block while walking up ancestors in TextIterator::advance().
3086
3087         Tests: editing/selection/tapping-in-table-at-end-of-document.html
3088                editing/text-iterator/table-at-end-of-document.html
3089
3090         * editing/TextIterator.cpp:
3091         (WebCore::TextIterator::advance): Fixed the bug.
3092         (WebCore::shouldEmitNewlineAfterNode): Do generate a new line at the end of a document when we're trying to
3093         generate every visible poitions even there are no renderers beyond this point. e.g. a position inside the
3094         last cell of a table at the end of a document hits this condition.
3095         (WebCore::shouldEmitExtraNewlineForNode): Don't emit a line break when the render box's height is 0px
3096         to avoid generating many empty lines for empty paragraph and header elements (this function is used to generate
3097         a blank line between p's and h1/h2/...'s).
3098         (WebCore::TextIterator::exitNode):
3099
3100 2018-05-11  Dean Jackson  <dino@apple.com>
3101
3102         System preview badge doesn't show on <picture> elements
3103         https://bugs.webkit.org/show_bug.cgi?id=185559
3104         <rdar://problem/40150066>
3105
3106         Reviewed by Tim Horton.
3107
3108         We should also identify <img>s that are the child of a <picture>
3109         contained inside the appropriate <a> element.
3110
3111         Tested internally, since the badge is platform specific.
3112
3113         * html/HTMLImageElement.cpp:
3114         (WebCore::HTMLImageElement::isSystemPreviewImage const): Add logic
3115         to look for <picture> parents.
3116
3117 2018-05-11  Chris Dumez  <cdumez@apple.com>
3118
3119         REGRESSION (async policy delegate): Revoking an object URL immediately after triggering download breaks file download
3120         https://bugs.webkit.org/show_bug.cgi?id=185531
3121         <rdar://problem/39909589>
3122
3123         Reviewed by Geoffrey Garen.
3124
3125         Whenever we start an asynchronous navigation policy decision for a blob URL, create a temporary
3126         blob URL pointing to the same data, and update the request's URL. This way, if the page's JS revokes
3127         the URL during the policy decision, the load will still succeed.
3128
3129         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-then-revoke.html
3130
3131         * loader/DocumentLoader.cpp:
3132         (WebCore::DocumentLoader::willSendRequest):
3133         * loader/FrameLoader.cpp:
3134         (WebCore::FrameLoader::loadURL):
3135         (WebCore::FrameLoader::load):
3136         (WebCore::FrameLoader::loadPostRequest):
3137         * loader/PolicyChecker.cpp:
3138         (WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
3139         (WebCore::PolicyChecker::checkNavigationPolicy):
3140         (WebCore::PolicyChecker::checkNewWindowPolicy):
3141         * loader/PolicyChecker.h:
3142
3143 2018-05-11  Antti Koivisto  <antti@apple.com>
3144
3145         LinkLoader fails to remove CachedResourceClient in some cases
3146         https://bugs.webkit.org/show_bug.cgi?id=185553
3147         <rdar://problem/36879656>
3148
3149         Reviewed by Geoffrey Garen.
3150
3151         Test: http/tests/preload/link-preload-client-remove.html
3152
3153         * loader/LinkLoader.cpp:
3154         (WebCore::LinkLoader::loadLink):
3155
3156         If there is a link preload already in progress, we fail to clear the client for the ongoing load.
3157         This may leave the CachedResource client map in a bad state.
3158
3159 2018-05-11  Charles Vazac  <cvazac@gmail.com>
3160
3161         Runtime feature flag for Server-Timing
3162         https://bugs.webkit.org/show_bug.cgi?id=184758
3163
3164         Reviewed by Youenn Fablet.
3165
3166         * Source/WebCore/CMakeLists.txt: Added reference to PerformanceServerTiming.idl.
3167         * Source/WebCore/DerivedSources.make: Added reference to PerformanceServerTiming.idl.
3168         * Source/WebCore/Sources.txt: Added reference to PerformanceServerTiming.cpp and JSPerformanceServerTiming.cpp.
3169         * Source/WebCore/WebCore.xcodeproj/project.pbxproj: Added references to PerformanceServerTiming.cpp, PerformanceServerTiming.h, and PerformanceServerTiming.idl.
3170         * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: Added PerformanceServerTiming.
3171         * Source/WebCore/page/PerformanceResourceTiming.h: Added serverTiming member.
3172         * Source/WebCore/page/PerformanceResourceTiming.idl: Added serverTiming attribute.
3173         * Source/WebCore/page/PerformanceServerTiming.cpp: Added.
3174         * Source/WebCore/page/PerformanceServerTiming.h: Added.
3175         * Source/WebCore/page/PerformanceServerTiming.idl: Added.
3176
3177 2018-05-11  Brady Eidson  <beidson@apple.com>
3178
3179         Make sure history navigations reuse the existing process when necessary.
3180         <rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532
3181
3182         Reviewed by Ryosuke Niwa.
3183
3184         Covered by new API tests.
3185
3186         In WebCore-land, make sure *all* NavigationActions to a back/forward item are tagged with
3187         the item identifier.
3188
3189         * history/HistoryItem.cpp:
3190         (WebCore::HistoryItem::HistoryItem):
3191         (WebCore::HistoryItem::logString const):
3192         * history/HistoryItem.h:
3193
3194         * loader/FrameLoader.cpp:
3195         (WebCore::FrameLoader::loadDifferentDocumentItem):
3196
3197         * loader/NavigationAction.cpp:
3198         (WebCore::NavigationAction::setTargetBackForwardItem):
3199
3200         * loader/NavigationAction.h:
3201         (WebCore::NavigationAction::targetBackForwardItemIdentifier const):
3202
3203 2018-05-11  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3204
3205         [EME][GStreamer] Handle the protection event in MediaPlayerPrivate
3206         https://bugs.webkit.org/show_bug.cgi?id=185535
3207
3208         Reviewed by Xabier Rodriguez-Calvar.
3209
3210         This patch is based on this calvaris's commit
3211         https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d966168b0d2b65f9ca9415426e26d3752c78b03e
3212
3213         It adds a handler for the protection event in MediaPalyerPrivateGStreamerBase, it extracts the InitData from the event
3214         and sends the encrypted event to JS via HTMLMediaElement.
3215         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3216         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
3217         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
3218         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3219         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Add a new type InitData.
3220
3221 2018-05-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3222
3223         [Curl] Make the cipher suites, the signing algorithms and the curve lists configurable.
3224         https://bugs.webkit.org/show_bug.cgi?id=185139
3225
3226         Add interface to configure the cipher suites, the signing algorithms and the curve lists 
3227         used by OpenSSL and libcurl to exchange, to sign or to verify keys.
3228
3229         Reviewed by Youenn Fablet.
3230
3231         No new tests in public. Have tested internally.
3232
3233         * platform/network/curl/CurlContext.cpp:
3234         (WebCore::CurlHandle::setSslCipherList):
3235         * platform/network/curl/CurlContext.h:
3236         * platform/network/curl/CurlRequest.cpp:
3237         (WebCore::CurlRequest::setupTransfer):
3238         (WebCore::CurlRequest::willSetupSslCtx):
3239         * platform/network/curl/CurlSSLHandle.cpp:
3240         (WebCore::CurlSSLHandle::getCACertPathEnv):
3241         * platform/network/curl/CurlSSLHandle.h:
3242         (WebCore::CurlSSLHandle::getCipherList const):
3243         (WebCore::CurlSSLHandle::getSignatureAlgorithmsList const):
3244         (WebCore::CurlSSLHandle::getCurvesList const):
3245         (WebCore::CurlSSLHandle::setCipherList):
3246         (WebCore::CurlSSLHandle::setSignatureAlgorithmsList):
3247         (WebCore::CurlSSLHandle::setCurvesList):
3248         (WebCore::CurlSSLHandle::getCACertPath const):
3249         (WebCore::CurlSSLHandle::setCACertPath):
3250         * platform/network/curl/CurlSSLVerifier.cpp:
3251         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
3252
3253 2018-05-10  Daniel Bates  <dabates@apple.com>
3254
3255         Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
3256         https://bugs.webkit.org/show_bug.cgi?id=185412
3257
3258         Reviewed by Ryosuke Niwa.
3259
3260         Consolidate the knowledge on how to determine whether security checks were performed on a ResourceResponse
3261         into LoaderStrategy::havePerformedSecurityChecks() (default implementation returns false) and query it
3262         to determine whether CSP frame-ancestors and X-Frame-Options need to be checked for a ResourceResponse.
3263
3264         Additionally, rename LoaderStrategy::isDoingLoadingSecurityChecks() to shouldPerformSecurityChecks()
3265         for consistency with havePerformedSecurityChecks(). Querying shouldPerformSecurityChecks() answers the
3266         question of whether the loader strategy is responsible for performing security checks when building up
3267         a ResourceRequest to have the loader strategy load. And LoaderStrategy::havePerformedSecurityChecks()
3268         is used to determine whether the loader strategy performed these security checks for a given ResourceResponse.
3269
3270         * inspector/agents/InspectorNetworkAgent.cpp:
3271         (WebCore::InspectorNetworkAgent::didReceiveResponse):
3272         (WebCore::InspectorNetworkAgent::didFinishLoading):
3273         (WebCore::isResponseProbablyComingFromNetworkProcess): Deleted.
3274         * loader/DocumentLoader.cpp:
3275         (WebCore::DocumentLoader::responseReceived):
3276         * loader/DocumentThreadableLoader.cpp:
3277         (WebCore::shouldPerformSecurityChecks):
3278         (WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
3279         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
3280         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
3281         (WebCore::DocumentThreadableLoader::redirectReceived):
3282         (WebCore::DocumentThreadableLoader::didFail):
3283         (WebCore::DocumentThreadableLoader::loadRequest):
3284         (WebCore::isDoingSecurityChecksInNetworkProcess): Deleted.
3285         (WebCore::isResponseComingFromNetworkProcess): Deleted.
3286         * loader/LoaderStrategy.cpp:
3287         * loader/LoaderStrategy.h:
3288         * page/Settings.yaml: Remove setting networkProcessCSPFrameAncestorsCheckingEnabled as we now make
3289         use of the loader strategy to determine whether to perform CSP frame-ancestors and X-Frame-Options
3290         checking in DocumentLoader.
3291         * platform/network/ResourceResponseBase.h:
3292         (WebCore::ResourceResponseBase::setSource): Added an ASSERT to catch the programming error of setting
3293         source to ResourceResponse::Source::Unknown. This source type represents an uninitialized ResourceResponse.
3294
3295 2018-05-10  Tim Horton  <timothy_horton@apple.com>
3296
3297         Lookup sometimes shows a second yellow highlight on top of WebKit's TextIndicator
3298         https://bugs.webkit.org/show_bug.cgi?id=185538
3299         <rdar://problem/38817825>
3300
3301         Reviewed by Sam Weinig.
3302
3303         * editing/mac/DictionaryLookup.mm:
3304         (WebCore::showPopupOrCreateAnimationController):
3305         Options can be nil, in which case we can't mutableCopy it and add
3306         LUTermOptionDisableSearchTermIndicator. Instead, create a new dictionary,
3307         and add the items from options, if it's not nil.
3308
3309 2018-05-10  Matt Baker  <mattbaker@apple.com>
3310
3311         Web Inspector: ASSERT_NOT_REACHED in PageDebuggerAgent::didAddEventListener when page adds attribute event listener
3312         https://bugs.webkit.org/show_bug.cgi?id=181580
3313         <rdar://problem/36461309>
3314
3315         Reviewed by Brian Burg.
3316
3317         EventTarget should pass newly added EventListeners to InspectorInstrumentation,
3318         instead of PageDebuggerAgent assuming the last item in the EventListenerVector
3319         is the most recently added listener. This assumption does not hold when
3320         the new listener replaces an existing listener.
3321
3322         * dom/EventTarget.cpp:
3323         (WebCore::EventTarget::addEventListener):
3324         (WebCore::EventTarget::setAttributeEventListener):
3325
3326         * inspector/InspectorInstrumentation.cpp:
3327         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
3328
3329         * inspector/InspectorInstrumentation.h:
3330         (WebCore::InspectorInstrumentation::didAddEventListener):
3331
3332         * inspector/agents/page/PageDebuggerAgent.cpp:
3333         (WebCore::PageDebuggerAgent::didAddEventListener):
3334         * inspector/agents/page/PageDebuggerAgent.h:
3335
3336 2018-05-10  Chris Dumez  <cdumez@apple.com>
3337
3338         'Cross-Origin-Options header implementation follow-up
3339         https://bugs.webkit.org/show_bug.cgi?id=185520
3340
3341         Reviewed by Ryosuke Niwa.
3342
3343         * dom/Document.cpp:
3344         * dom/Document.h:
3345         * loader/FrameLoader.cpp:
3346         (WebCore::FrameLoader::didBeginDocument):
3347         Using isNull() check is sufficient here as the header parsing
3348         function will do the right thing when passed the empty string.
3349         Also set the options directly on the window instead of the
3350         document. The window is guaranteed to have been constructed
3351         by then because didBeginDocument() is called DocumentWriter::begin()
3352         which calls Document::createDOMWindow() or Document::takeDOMWindowFrom().
3353
3354         * page/AbstractDOMWindow.cpp:
3355         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
3356         * page/AbstractDOMWindow.h:
3357         * page/DOMWindow.cpp:
3358         (WebCore::DOMWindow::DOMWindow):
3359         (WebCore::DOMWindow::didSecureTransitionTo):
3360         * page/RemoteDOMWindow.cpp:
3361         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
3362         * page/RemoteDOMWindow.h:
3363         CrossOriginOptions are now stored only on the Window, not the Document.
3364
3365         * platform/network/HTTPParsers.cpp:
3366         (WebCore::parseCrossOriginOptionsHeader):
3367         Drop strippedHeader local variable as it is not strictly needed.
3368
3369 2018-05-10  Tim Horton  <timothy_horton@apple.com>
3370
3371         Fix the build after r231393
3372         https://bugs.webkit.org/show_bug.cgi?id=185519
3373         <rdar://problem/40131741>
3374
3375         Reviewed by Simon Fraser.
3376
3377         * Configurations/WebCore.xcconfig:
3378
3379 2018-05-10  Eric Carlson  <eric.carlson@apple.com>
3380
3381         Log missing cues correctly
3382         https://bugs.webkit.org/show_bug.cgi?id=185499
3383         <rdar://problem/40113821>
3384
3385         Reviewed by Daniel Bates.
3386
3387         No new tests, tested manually.
3388
3389         * html/track/InbandGenericTextTrack.cpp:
3390         (WebCore::InbandGenericTextTrack::removeGenericCue): Log the cue we searched for, not
3391         the NULL cue.
3392
3393 2018-05-10  Zalan Bujtas  <zalan@apple.com>
3394
3395         [LFC] Implement height computation for non-replaced inflow elements.
3396         https://bugs.webkit.org/show_bug.cgi?id=185474
3397
3398         Reviewed by Antti Koivisto.
3399
3400         Initial implementation. Does not cover all the cases.
3401
3402         * layout/FormattingContext.cpp:
3403         (WebCore::Layout::FormattingContext::computeHeight const):
3404         * layout/FormattingContext.h:
3405         * layout/blockformatting/BlockFormattingContext.cpp:
3406         (WebCore::Layout::BlockFormattingContext::layout const):
3407         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
3408         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const):
3409         * layout/blockformatting/BlockFormattingContext.h:
3410         * layout/blockformatting/BlockMarginCollapse.cpp:
3411         (WebCore::Layout::collapsedMarginBottomFromLastChild):
3412         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent):
3413         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
3414         (WebCore::Layout::isMarginBottomCollapsedWithParent): Deleted.
3415         * layout/blockformatting/BlockMarginCollapse.h:
3416         * layout/inlineformatting/InlineFormattingContext.cpp:
3417         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
3418         * layout/inlineformatting/InlineFormattingContext.h:
3419         * layout/layouttree/LayoutBox.cpp:
3420         (WebCore::Layout::Box::isReplaced const):
3421         * layout/layouttree/LayoutBox.h:
3422
3423 2018-05-10  Thibault Saunier  <tsaunier@igalia.com>
3424
3425         [GTK] Implement ImageBuffer::toBGRAData
3426         https://bugs.webkit.org/show_bug.cgi?id=185511
3427
3428         Reviewed by Michael Catanzaro.
3429
3430         This was never implemented but will be required for the MediaStream API
3431         tests.
3432
3433         * platform/graphics/ImageBuffer.cpp:
3434         (WebCore::ImageBuffer::toBGRAData const):
3435         * platform/graphics/cg/ImageBufferCG.cpp:
3436         (WebCore::ImageBuffer::toBGRAData const):
3437         * platform/graphics/gtk/ImageBufferGtk.cpp:
3438         (WebCore::ImageBuffer::toBGRAData const):
3439
3440 2018-05-10  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3441
3442         [EME][GStreamer] Add a handler for GStreamer protection event
3443         https://bugs.webkit.org/show_bug.cgi?id=185245
3444
3445         Reviewed by Xabier Rodriguez-Calvar.
3446
3447         Qtdemux sends the protection event when encountered a new PSSH box (encrypted content).
3448
3449         The Decryptor is moved from AppendPipeline to PlaybackPipeline (see https://bugs.webkit.org/show_bug.cgi?id=181855),
3450         thus the protection event is no longer handled because the Decryptor is not in the same pipeline as qtdemux.
3451
3452         AppendPipeline: httpsrc-->qtdemux-->appsink
3453         PlaybackPipeline: appsrc-->parser--> decryptor-->decoder-->sink
3454
3455         This patch attaches a probe to the sink pad of the appsink in the appendPipeline in order to
3456         catch and manage the protection event.
3457
3458         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3459         (WebCore::AppendPipeline::AppendPipeline):
3460         (WebCore::AppendPipeline::~AppendPipeline):
3461         (WebCore::appendPipelineAppsinkPadEventProbe):
3462         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3463         (WebCore::AppendPipeline::playerPrivate):
3464
3465 2018-05-10  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3466
3467         [EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
3468         https://bugs.webkit.org/show_bug.cgi?id=181855
3469
3470         Reviewed by Xabier Rodriguez-Calvar.
3471
3472         The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.
3473
3474         When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
3475         the decrypted GstBuffers that are in SVP memory.
3476         This behavior cause an out-of-memory error, because we are limited in SVP memory size.
3477
3478         By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
3479         which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.
3480
3481         This new architecture also allows to start the buffering before obtaining the DRM license
3482         and it makes easier to manage dynamic change of the license or Key.
3483
3484         The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.
3485
3486         SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
3487         protected by a hardware access control engine, it is not accessible to other unauthorised
3488         software or hardware components.
3489
3490         Tests:
3491             media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
3492             media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
3493
3494         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3495         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
3496         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3497         (WebCore::dumpAppendState):
3498         (WebCore::AppendPipeline::AppendPipeline):
3499         (WebCore::AppendPipeline::handleNeedContextSyncMessage):
3500         (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
3501         (WebCore::AppendPipeline::setAppendState):
3502         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
3503         (WebCore::AppendPipeline::appsinkNewSample):
3504         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
3505         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
3506         (WebCore::appendPipelineElementMessageCallback): Deleted.
3507         (WebCore::AppendPipeline::handleElementMessage): Deleted.
3508         (WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
3509         (WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
3510         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3511         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3512         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
3513         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
3514
3515 2018-05-09  Nan Wang  <n_wang@apple.com>
3516
3517         AX: VoiceOver iframe scrolling focus jumping bug
3518         https://bugs.webkit.org/show_bug.cgi?id=176615
3519         <rdar://problem/34333067>
3520
3521         Reviewed by Chris Fleizach.
3522
3523         Scrolling to make elements visible is not working correctly for elements inside an
3524         offscreen iframe. Fixed it by using RenderLayer::scrollRectToVisible() to handle
3525         scrolling more properly.
3526
3527         Test: accessibility/scroll-to-make-visible-iframe-offscreen.html
3528
3529         * accessibility/AccessibilityObject.cpp:
3530         (WebCore::AccessibilityObject::scrollToMakeVisible const):
3531
3532 2018-05-09  Joanmarie Diggs  <jdiggs@igalia.com>
3533
3534         AX: accessibleNameForNode should simplify whitespace when using innerText
3535         https://bugs.webkit.org/show_bug.cgi?id=185498
3536
3537         Reviewed by Chris Fleizach.
3538
3539         Test: accessibility/text-alternative-calculation-from-unrendered-table.html
3540
3541         Call simplifyWhiteSpace() before returning the innerText value.
3542
3543         * accessibility/AccessibilityNodeObject.cpp:
3544         (WebCore::accessibleNameForNode):
3545
3546 2018-05-09  Chris Dumez  <cdumez@apple.com>
3547
3548         Add initial support for 'Cross-Origin-Options' HTTP response header
3549         https://bugs.webkit.org/show_bug.cgi?id=184996
3550         <rdar://problem/39664620>
3551
3552         Reviewed by Geoff Garen.
3553
3554         Add initial support for 'Cross-Origin-Options' HTTP response header behind an experimental
3555         feature flag, on by default. When the HTTP server services this HTTP response header for a
3556         main resource, we'll set these options on the corresponding Document. This will impact the
3557         behavior of the Document's associated Window API when cross-origin.
3558
3559         The HTTP header has 3 possible values:
3560         - allow: This is the default. Regular cross-origin Window API is available.
3561         - allow-postmessage: Only postMessage() is available on a cross-origin window, trying to
3562           access anything else will throw a SecurityError.
3563         - deny: Trying to do anything with a cross-origin window will throw a SecurityError.
3564
3565         The header has no effect when accessing same origin windows.
3566
3567         Note that on cross-origin access from Window A to Window B, we check the cross-origin
3568         options for both Window A and Window B and use the lowest common denominator as effective
3569         cross-origin options for the access. So if Window A has 'Cross-Origin-Options: deny' and
3570         tries to call postMessage() on Window B which has 'Cross-Origin-Options: allow-postmessage',
3571         we will throw a SecurityError. This is because Window A's more restrictive options (deny)
3572         apply.
3573
3574         Tests: http/wpt/cross-origin-options/allow-postmessage-from-deny.html
3575                http/wpt/cross-origin-options/allow-postmessage.html
3576                http/wpt/cross-origin-options/cross-origin-options-header.html
3577
3578         * bindings/js/JSDOMBindingSecurity.cpp:
3579         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginOptions):
3580         * bindings/js/JSDOMBindingSecurity.h:
3581         * bindings/js/JSDOMWindowCustom.cpp:
3582         (WebCore::effectiveCrossOriginOptionsForAccess):
3583         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
3584         (WebCore::JSDOMWindow::getOwnPropertySlot):
3585         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
3586         (WebCore::addCrossOriginWindowPropertyNames):
3587         (WebCore::addScopedChildrenIndexes):
3588         (WebCore::addCrossOriginWindowOwnPropertyNames):
3589         (WebCore::JSDOMWindow::getOwnPropertyNames):
3590         * bindings/js/JSDOMWindowCustom.h:
3591         * bindings/js/JSRemoteDOMWindowCustom.cpp:
3592         (WebCore::JSRemoteDOMWindow::getOwnPropertySlot):
3593         (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
3594         (WebCore::JSRemoteDOMWindow::getOwnPropertyNames):
3595         * bindings/scripts/CodeGeneratorJS.pm:
3596         (GenerateAttributeGetterBodyDefinition):
3597         (GetCrossOriginsOptionsFromExtendedAttributeValue):
3598         (GenerateAttributeSetterBodyDefinition):
3599         (GenerateOperationBodyDefinition):
3600         * bindings/scripts/IDLAttributes.json:
3601         * dom/Document.cpp:
3602         (WebCore::Document::setCrossOriginOptions):
3603         * dom/Document.h:
3604         (WebCore::Document::crossOriginOptions const):
3605         * loader/FrameLoader.cpp:
3606         (WebCore::FrameLoader::didBeginDocument):
3607         * page/AbstractDOMWindow.cpp:
3608         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
3609         * page/AbstractDOMWindow.h:
3610         (WebCore::AbstractDOMWindow::crossOriginOptions):
3611         (WebCore::AbstractDOMWindow::setCrossOriginOptions):
3612         * page/DOMWindow.cpp:
3613         (WebCore::DOMWindow::DOMWindow):
3614         (WebCore::DOMWindow::didSecureTransitionTo):
3615         * page/DOMWindow.idl:
3616         * page/Frame.h:
3617         * page/RemoteDOMWindow.cpp:
3618         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
3619         * page/RemoteDOMWindow.h:
3620         * page/Settings.yaml:
3621         * platform/network/HTTPHeaderNames.in:
3622         * platform/network/HTTPParsers.cpp:
3623         (WebCore::parseCrossOriginOptionsHeader):
3624         * platform/network/HTTPParsers.h:
3625
3626 2018-05-09  Ryosuke Niwa  <rniwa@webkit.org>
3627
3628         Release assert in TreeScopeOrderedMap::remove via HTMLImageElement::removedFromAncestor
3629         https://bugs.webkit.org/show_bug.cgi?id=185493
3630
3631         Reviewed by Brent Fulgham.
3632
3633         Fixed the bug that HTMLImageElement::removedFromAncestor and HTMLMapElement::removedFromAncestor
3634         were calling removeImageElementByUsemap on the document instead of the shadow tree from which it was removed.
3635
3636         Test: fast/images/imagemap-in-shadow-tree-removed.html
3637
3638         * html/HTMLImageElement.cpp:
3639         (WebCore::HTMLImageElement::removedFromAncestor):
3640         * html/HTMLMapElement.cpp:
3641         (WebCore::HTMLMapElement::removedFromAncestor):
3642
3643 2018-05-09  Joanmarie Diggs  <jdiggs@igalia.com>
3644
3645         AX: Hidden nodes which are not directly referenced should not participate name/description from content
3646         https://bugs.webkit.org/show_bug.cgi?id=185478
3647
3648         Reviewed by Chris Fleizach.
3649
3650         Add a check to AccessibilityNodeObject::textUnderElement() and return early
3651         if the node is hidden, not referenced by aria-labelledby or aria-describedby,
3652         not an HTMLLabelElement, and not fallback content for an HTMLCanvasElement.
3653
3654         Test: accessibility/text-alternative-calculation-hidden-nodes.html
3655
3656         * accessibility/AccessibilityNodeObject.cpp:
3657         (WebCore::AccessibilityNodeObject::textUnderElement const):
3658
3659 2018-05-09  Eric Carlson  <eric.carlson@apple.com>
3660
3661         Update MediaSession to use release logging
3662         https://bugs.webkit.org/show_bug.cgi?id=185376
3663         <rdar://problem/40022203>
3664
3665         Reviewed by Youenn Fablet.
3666
3667         No new tests, tested manually.
3668
3669         * Modules/mediastream/MediaStream.h: hostingDocument() doesn't need to return a const Document.
3670         * Modules/webaudio/AudioContext.cpp:
3671         (WebCore::AudioContext::hostingDocument const): Ditto.
3672         * Modules/webaudio/AudioContext.h:
3673
3674         * html/HTMLMediaElement.h: Ditto.
3675
3676         * html/MediaElementSession.cpp:
3677         (WebCore::MediaElementSession::MediaElementSession):
3678         (WebCore::MediaElementSession::addBehaviorRestriction):
3679         (WebCore::MediaElementSession::removeBehaviorRestriction):
3680         (WebCore::MediaElementSession::dataLoadingPermitted const):
3681         (WebCore::MediaElementSession::fullscreenPermitted const):
3682         (WebCore::MediaElementSession::pageAllowsDataLoading const):
3683         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
3684         (WebCore::MediaElementSession::canShowControlsManager const):
3685         (WebCore::MediaElementSession::showPlaybackTargetPicker):
3686         (WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
3687         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
3688         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
3689         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
3690         (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
3691         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
3692         (WebCore::MediaElementSession::mediaEngineUpdated):
3693         (WebCore::MediaElementSession::willLog const): Deleted.
3694         (WebCore::MediaElementSession::logger const): Deleted.
3695         (WebCore::MediaElementSession::logIdentifier const): Deleted.
3696         (WebCore::MediaElementSession::logChannel const): Deleted.
3697         * html/MediaElementSession.h:
3698
3699         * platform/audio/PlatformMediaSession.cpp:
3700         (WebCore::nextLogIdentifier):
3701         (WebCore::convertEnumerationToString):
3702         (WebCore::PlatformMediaSession::PlatformMediaSession):
3703         (WebCore::PlatformMediaSession::setState):
3704         (WebCore::PlatformMediaSession::beginInterruption):
3705         (WebCore::PlatformMediaSession::endInterruption):
3706         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
3707         (WebCore::PlatformMediaSession::clientWillPausePlayback):
3708         (WebCore::PlatformMediaSession::pauseSession):
3709         (WebCore::PlatformMediaSession::stopSession):
3710         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
3711         (WebCore::PlatformMediaSession::logChannel const):
3712         (WebCore::stateName): Deleted.
3713         (WebCore::interruptionName): Deleted.
3714         * platform/audio/PlatformMediaSession.h:
3715         (WTF::LogArgument<WebCore::PlatformMediaSession::State>::toString):
3716         (WTF::LogArgument<WebCore::PlatformMediaSession::InterruptionType>::toString):
3717
3718 2018-05-09  Thibault Saunier  <tsaunier@igalia.com>
3719
3720         [GStreamer] Never call updateTracks if running on legacy pipeline
3721         https://bugs.webkit.org/show_bug.cgi?id=184581
3722
3723         This makes sure failling code path is never reached in the conditions where it should not have been reached.
3724
3725         Reviewed by Philippe Normand.
3726
3727         Re enables all tests that were disabled after fixing.
3728
3729         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3730         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3731
3732 2018-05-09  Daniel Bates  <dabates@apple.com>
3733
3734         REGRESSION (r231479): http/tests/appcache/x-frame-options-prevents-framing.php is timing out
3735         https://bugs.webkit.org/show_bug.cgi?id=185443
3736         <rdar://problem/40100660>
3737
3738         Reviewed by Andy Estes.
3739
3740         Following r231479 when using WebKit2 and Restricted HTTP Response Access is enabled (enabled in
3741         WebKitTestRunner) we only check the CSP frame-ancestors directive and X-Frame-Options in
3742         NetworkProcess. We need to check these security requirements in WebContent process whenever
3743         we are performing a substitute data load, such as for app cache, as these loads do not go
3744         through NetworkProcess.
3745
3746         * loader/DocumentLoader.cpp:
3747         (WebCore::DocumentLoader::responseReceived):
3748
3749 2018-05-09  Justin Fan  <justin_fan@apple.com>
3750
3751         Hooked up ASTC support in WebGL; requires OpenGL ES 3 context to work. 
3752         https://bugs.webkit.org/show_bug.cgi?id=185272
3753         <rdar://problem/15745737>
3754
3755         Reviewed by Dean Jackson.
3756
3757         Also added in Khronos' ASTC test from version 1.0.4 beta of their conformance test suite,
3758         although again, this requires OpenGL ES 3 context for WebKit to detect proper support.
3759
3760         Test: fast/canvas/webgl/webgl-compressed-texture-astc.html
3761
3762         * DerivedSources.make:
3763         * Sources.txt:
3764         * WebCore.xcodeproj/project.pbxproj:
3765         * bindings/js/JSDOMConvertWebGL.cpp:
3766         (WebCore::convertToJSValue):
3767         * html/canvas/WebGL2RenderingContext.cpp:
3768         (WebCore::WebGL2RenderingContext::getExtension):
3769         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
3770         * html/canvas/WebGLCompressedTextureASTC.cpp: Added.
3771         (WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
3772         (WebCore::WebGLCompressedTextureASTC::getName const):
3773         (WebCore::WebGLCompressedTextureASTC::supported):
3774         (WebCore::WebGLCompressedTextureASTC::getSupportedProfiles):
3775         * html/canvas/WebGLCompressedTextureASTC.h: Added.
3776         * html/canvas/WebGLCompressedTextureASTC.idl: Added.
3777         * html/canvas/WebGLExtension.h:
3778         * html/canvas/WebGLRenderingContext.cpp:
3779         (WebCore::WebGLRenderingContext::getExtension):
3780         (WebCore::WebGLRenderingContext::getSupportedExtensions):
3781         * html/canvas/WebGLRenderingContextBase.cpp:
3782         (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
3783         (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
3784         * html/canvas/WebGLRenderingContextBase.h:
3785         * platform/graphics/Extensions3D.h:
3786
3787 2018-05-09  Youenn Fablet  <youenn@apple.com>
3788
3789         Allow WebResourceLoader to cancel a load served from a service worker
3790         https://bugs.webkit.org/show_bug.cgi?id=185274
3791
3792         Reviewed by Chris Dumez.
3793
3794         Add support for cancelling a fetch from WebProcess to service worker process.
3795         Use FetchIdentifier instead of uint64_t.
3796
3797         * Modules/fetch/FetchIdentifier.h: Added.
3798         * WebCore.xcodeproj/project.pbxproj:
3799         * workers/service/context/ServiceWorkerFetch.h:
3800         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3801         (WebCore::ServiceWorkerThreadProxy::startFetch):
3802         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
3803         * workers/service/context/ServiceWorkerThreadProxy.h:
3804
3805 2018-05-09  Thibault Saunier  <tsaunier@igalia.com>
3806
3807         [GStreamer] Fix style issue in MediaPlayerPrivateGStreamer
3808         https://bugs.webkit.org/show_bug.cgi?id=185479
3809
3810         Reviewed by Philippe Normand.
3811
3812         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:114:  Multi line control clauses should use braces.  [whitespace/braces] [4]
3813         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:194:  Multi line control clauses should use braces.  [whitespace/braces] [4]
3814         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:398:  One line control clauses should not use braces.  [whitespace/braces] [4]
3815         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:440:  One line control clauses should not use braces.  [whitespace/braces] [4]
3816         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:806:  More than one command on the same line  [whitespace/newline] [4]
3817         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:869:  More than one command on the same line  [whitespace/newline] [4]
3818         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:880:  More than one command on the same line  [whitespace/newline] [4]
3819         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:940:  More than one command on the same line  [whitespace/newline] [4]
3820         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1102:  Multi line control clauses should use braces.  [whitespace/braces] [4]
3821         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1109:  Multi line control clauses should use braces.  [whitespace/braces] [4]
3822
3823         Indentation and style issue fixed only.
3824
3825         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3826         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
3827         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
3828         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
3829         (WebCore::MediaPlayerPrivateGStreamer::play):
3830         (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
3831         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
3832         (WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
3833         (WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
3834         (WebCore::MediaPlayerPrivateGStreamer::buffered const):
3835         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
3836
3837 2018-05-09  Daniel Bates  <dabates@apple.com>
3838
3839         REGRESSION (r231479): com.apple.WebCore crash in WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied()
3840         https://bugs.webkit.org/show_bug.cgi?id=185475
3841         <rdar://problem/40093853>
3842
3843         Reviewed by Andy Estes.
3844
3845         DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() must extends its lifetime
3846         until completion as dispatching a DOM load event at the associated frame can cause JavaScript execution
3847         that can do anything, including destroying the loader that dispatched the event.
3848
3849         Following r231479 DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() is now
3850         invoked by both DocumentLoader::responseReceived() and WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
3851         The latter only can happen when using WebKit2 and the experimental feature Restricted HTTP Response Access
3852         is enabled (RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()). Unlike DocumentLoader::responseReceived()
3853         WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() does not take out a ref
3854         on the DocumentLoader before invoking DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
3855         Therefore, DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() can cause its
3856         own destruction as a result of dispatching a DOM load event at the frame. We should take out a ref on
3857         the DocumentLoader when executing DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
3858
3859         * loader/DocumentLoader.cpp:
3860         (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
3861
3862 2018-05-09  Tim Horton  <timothy_horton@apple.com>
3863
3864         Fix the build by ignoring some deprecation warnings
3865
3866         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3867         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
3868
3869 2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
3870
3871         [WPE] Build cleanly with GCC 8 and ICU 60
3872         https://bugs.webkit.org/show_bug.cgi?id=185462
3873
3874         Reviewed by Carlos Alberto Lopez Perez.
3875
3876         * PlatformGTK.cmake: Include directories are in the wrong place.
3877         * accessibility/AXObjectCache.cpp: Silence -Wclass-memaccess problems and leave warnings.
3878         (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
3879         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
3880         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
3881         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
3882         * css/CSSFontFace.cpp: Silence -Wfallthrough
3883         (WebCore::CSSFontFace::fontLoadTiming const):
3884         * css/CSSSelectorList.cpp: Silence -Wclass-memaccess, this one is intentional.
3885         (WebCore::CSSSelectorList::adoptSelectorVector):
3886         * editing/TextIterator.cpp: Silence ICU deprecation warnings.
3887         * platform/Length.h:
3888         (WebCore::Length::operator=): More -Wclass-memaccess, looks benign.
3889         * platform/graphics/Gradient.cpp:
3890         (WebCore::Gradient::hash const): -Wclass-memaccess again. Leave a warning.
3891         * platform/graphics/SurrogatePairAwareTextIterator.cpp: Silence ICU deprecation warnings.
3892         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3893         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Silence ICU deprecation.
3894         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
3895         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Silence -Wcast-function-type.
3896         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
3897         (WebCore::Font::canRenderCombiningCharacterSequence const): Silence ICU deprecation.
3898         * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:
3899         (gstAllocatorFastMallocMemUnmap): Fix -Wcast-function-type.
3900         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3901         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Fix bad printf.
3902         (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Another bad printf.
3903         (WebCore::findHLSQueue): Fix -Wcast-function-type.
3904         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
3905         (webKitMediaClearKeyDecryptorDecrypt): Fix another bad printf.
3906         * platform/network/soup/SocketStreamHandleImplSoup.cpp: Silence -Wcast-function-type.
3907         (WebCore::SocketStreamHandleImpl::beginWaitingForSocketWritability):
3908         * platform/text/TextEncoding.cpp: Silence ICU deprecration.
3909
3910 2018-05-08  Simon Fraser  <simon.fraser@apple.com>
3911
3912         SVG lighting colors need to be converted into linearSRGB
3913         https://bugs.webkit.org/show_bug.cgi?id=181196
3914
3915         Reviewed by Darin Adler.
3916
3917         Address post-commit comments. Don't make a Color that contains linearRGB components,
3918         but use FloatComponents instead. Since these FloatComponents are in the 0-1 range,
3919         FELighting::setPixelInternal() needs to multiply by 255 since the output pixels are
3920         8-bit 0-255.
3921         
3922         Change linearToSRGBColorComponent() and sRGBToLinearColorComponent() to do math in
3923         floats without promoting to doubles.
3924
3925         * platform/graphics/ColorUtilities.cpp:
3926         (WebCore::FloatComponents::FloatComponents):
3927         (WebCore::linearToSRGBColorComponent):
3928         (WebCore::sRGBToLinearColorComponent):
3929         (WebCore::sRGBColorToLinearComponents):
3930         (WebCore::linearToSRGBColor): Deleted.
3931         (WebCore::sRGBToLinearColor): Deleted.
3932         * platform/graphics/ColorUtilities.h:
3933         * platform/graphics/filters/FELighting.cpp:
3934         (WebCore::FELighting::setPixelInternal):
3935         (WebCore::FELighting::drawLighting):
3936
3937 2018-05-09  Timothy Hatcher  <timothy@apple.com>
3938
3939         Use StyleColor::Options in more places.
3940
3941         https://bugs.webkit.org/show_bug.cgi?id=185458
3942         rdar://problem/39853798
3943
3944         Add UseDefaultAppearance to StyleColor::Options, to avoid passing yet another
3945         boolean on some of these functions.
3946
3947         Reviewed by Tim Horton.
3948
3949         * css/MediaQueryEvaluator.cpp:
3950         * css/StyleColor.h:
3951         * dom/Document.cpp:
3952</