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