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