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