9747d620a13be4560dfcd775f4fed638e617e9e5
[WebKit.git] / Source / WebCore / ChangeLog
1 2018-05-28  Darin Adler  <darin@apple.com>
2
3         Straighten out HTMLInputElement attribute handling
4         https://bugs.webkit.org/show_bug.cgi?id=186043
5
6         Reviewed by Daniel Bates.
7
8         * dom/RadioButtonGroups.cpp:
9         (WebCore::RadioButtonGroup::requiredStateChanged): Renamed from requiredAttributeChanged,
10         and changed to take a reference.
11         (WebCore::RadioButtonGroups::requiredStateChanged): Ditto.
12         * dom/RadioButtonGroups.h: Updated for changes above.
13
14         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
15         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree): Call
16         updateInnerTextValue by its new name.
17         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue): Renamed
18         from updateAppearance.
19         (WebCore::BaseChooserOnlyDateAndTimeInputType::setValue): Call
20         updateInnerTextValue by its new name.
21         (WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Override this
22         instead of valueAttributeChanged.
23         * html/BaseChooserOnlyDateAndTimeInputType.h: Tighten up inheritance a bit.
24         Also use final a bit more and update for changes above.
25
26         * html/BaseDateAndTimeInputType.cpp:
27         (WebCore::BaseDateAndTimeInputType::attributeChanged): Replaced
28         minOrMaxAttributeChanged with this override, checking for the attribute names.
29         * html/BaseDateAndTimeInputType.h: Updated for changes above.
30
31         * html/FileInputType.cpp:
32         (WebCore::FileInputType::disabledStateChanged): Renamed from disabledAttributeChanged.
33         (WebCore::FileInputType::attributeChanged): Replaced
34         multipleAttributeChanged with this override, checking for the attribute names.
35         * html/FileInputType.h: Updated for changes above.
36
37         * html/HTMLFormControlElement.cpp:
38         (WebCore::HTMLFormControlElement::parseAttribute): Updated function names to say
39         "state changed" rather than "attribute changed" if they are called only when the
40         computed value is changed, not the raw attribute value.
41         (WebCore::HTMLFormControlElement::readOnlyStateChanged): Updated name.
42         (WebCore::HTMLFormControlElement::requiredStateChanged): Ditto.
43         * html/HTMLFormControlElement.h: Updated for changes above.
44
45         * html/HTMLInputElement.cpp:
46         (WebCore::HTMLInputElement::parseAttribute): Removed the code to call lots of specific
47         attribute changed functions that have now been deleted. Also removed empty code for a
48         couple of attributes.
49         (WebCore::HTMLInputElement::disabledStateChanged): Added. Forward call to input type.
50         (WebCore::HTMLInputElement::readOnlyStateChanged): Ditto.
51         (WebCore::HTMLInputElement::requiredStateChanged): Renamed from requiredAttributeChanged.
52         * html/HTMLInputElement.h: Updated for changes above.
53
54         * html/HTMLTextFormControlElement.cpp:
55         (WebCore::HTMLTextFormControlElement::readOnlyStateChanged): Renamed from
56         readOnlyAttributeChanged. Also fixed incorrect call to base class. This may have
57         fixed a bug: With some work we could probably create a test case to demonstrate that.
58         * html/HTMLTextFormControlElement.h: Updated for changes above.
59
60         * html/ImageInputType.cpp:
61         (WebCore::ImageInputType::attributeChanged): Replaced
62         altAttributeChanged and srcAttributeChanged with this override, checking for the
63         attribute names.
64         * html/ImageInputType.h: Updated for changes above.
65
66         * html/InputType.cpp:
67         (WebCore::InputType::altAttributeChanged): Deleted.
68         (WebCore::InputType::srcAttributeChanged): Deleted.
69         (WebCore::InputType::maxResultsAttributeChanged): Deleted.
70         (WebCore::InputType::minOrMaxAttributeChanged): Deleted.
71         (WebCore::InputType::stepAttributeChanged): Deleted.
72         (WebCore::InputType::valueAttributeChanged): Deleted.
73         (WebCore::InputType::attributeChanged): Moved to header as an inline so derived
74         classes can call through to the base class with the empty function inlined.
75         (WebCore::InputType::multipleAttributeChanged): Deleted.
76         (WebCore::InputType::disabledAttributeChanged): Moved to header as an inline.
77         (WebCore::InputType::readonlyAttributeChanged): Ditto.
78         (WebCore::InputType::requiredAttributeChanged): Ditto.
79         * html/InputType.h: Updated for changes above.
80
81         * html/NumberInputType.cpp:
82         (WebCore::NumberInputType::attributeChanged): Replaced
83         minOrMaxAttributeChanged and stepAttributeChanged with this override, checking
84         for the attribute names.
85         * html/NumberInputType.h: Updated for changes above.
86
87         * html/RangeInputType.cpp:
88         (WebCore::RangeInputType::disabledStateChanged): Renamed from
89         disabledAttributeChanged.
90         (WebCore::RangeInputType::attributeChanged): Replaced
91         minOrMaxAttributeChanged with this override, checking for the attribute names.
92         * html/RangeInputType.h: Updated for changes above.
93
94         * html/SearchInputType.cpp:
95         (WebCore::SearchInputType::SearchInputType): Removed unneeded initialization of
96         RefPtr data members to nullptr.
97         (WebCore::updateResultButtonPseudoType): Removed unneeded if statement; the two
98         cases above cover 0, and less than 0, so there is no need to check for greater
99         than 0 for the third case.
100         (WebCore::SearchInputType::attributeChanged): Replaced
101         maxResultsAttributeChanged with this override, checking for the attribute name.
102         * html/SearchInputType.h: Updated for changes above and marked more
103         member functions final.
104
105         * html/TextFieldInputType.cpp:
106         (WebCore::TextFieldInputType::attributeChanged): Added a call through to the
107         base class to match the style of other overrides of this function.
108         (WebCore::TextFieldInputType::disabledStateChanged): Renamed from disabledAttributeChanged.
109         (WebCore::TextFieldInputType::readOnlyStateChanged): Renamed from readonlyAttributeChanged.
110         * html/TextFieldInputType.h: Updated for changes above. Also made attributeChanged no
111         longer be marked final since derived classes now override it.
112
113         * html/shadow/SliderThumbElement.cpp:
114         (WebCore::SliderThumbElement::SliderThumbElement): Moved some data member initialization
115         from this constructor to the class definition.
116         (WebCore::SliderThumbElement::hostDisabledStateChanged): Renamed from disabledAttributeChanged.
117         * html/shadow/SliderThumbElement.h: Updated for changes above and marked more
118         member functions final.
119
120 2018-05-30  Nan Wang  <n_wang@apple.com>
121
122         AX: VoiceOver on macOS does not announce fieldset description from aria-describedby when focussing inputs
123         https://bugs.webkit.org/show_bug.cgi?id=185246
124         <rdar://problem/39939028>
125
126         Reviewed by Chris Fleizach.
127
128         Exposed the fieldset's description to its form control children.
129
130         Test: accessibility/mac/aria-describedby-fieldset.html
131
132         * accessibility/AccessibilityNodeObject.cpp:
133         (WebCore::AccessibilityNodeObject::helpText const):
134
135 2018-05-30  Chris Fleizach  <cfleizach@apple.com>
136
137         AX: Expose link rel type to voiceover
138         https://bugs.webkit.org/show_bug.cgi?id=186084
139         <rdar://problem/40640871>
140
141         Reviewed by Sam Weinig.
142
143         Make the link rel attribute available to accessibility clients.
144
145         Test: accessibility/mac/linkrel.html
146
147         * accessibility/AccessibilityObject.cpp:
148         (WebCore::AccessibilityObject::linkRelValue const):
149         * accessibility/AccessibilityObject.h:
150         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
151         (-[WebAccessibilityObjectWrapper accessibilityLinkRelationshipType]):
152         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
153         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
154         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
155
156 2018-05-30  Brady Eidson  <beidson@apple.com>
157
158         REGRESSION (r224684): User-agent seen by page does not change when modified by the develop menu options after reloading.
159         <rdar://problem/34918109> and https://bugs.webkit.org/show_bug.cgi?id=186111
160
161         Reviewed by Andy Estes.
162
163         Test: http/tests/navigation/useragent-reload.php
164
165         * Modules/websockets/WebSocketHandshake.cpp:
166         (WebCore::WebSocketHandshake::clientHandshakeRequest const): Use setUserAgent() for consistency.
167
168         * loader/DocumentLoader.cpp:
169         (WebCore::DocumentLoader::startLoadingMainResource): Clear the user agent from the original DocumentLoader request
170           before adding additional fields, as reloads should pick up user agent changes.
171
172 2018-05-30  Dean Jackson  <dino@apple.com>
173
174         WebContent crashes with system preview content
175         https://bugs.webkit.org/show_bug.cgi?id=186118
176
177         Reviewed by Myles Maxfield.
178
179         We were receiving crash reports on iOS devices when getting
180         platformContext() from a GraphicsContext. This usually
181         occurred when the page was invisible. Debugging showed that
182         it was trying to draw with a disabled context.
183
184         * rendering/RenderThemeIOS.mm:
185         (WebCore::RenderThemeIOS::paintSystemPreviewBadge): Early
186         return if the context has painting disabled.
187
188 2018-05-30  Daniel Bates  <dabates@apple.com>
189
190         Web Inspector: Annotate Same-Site cookies
191         https://bugs.webkit.org/show_bug.cgi?id=184897
192         <rdar://problem/35178209>
193
194         Reviewed by Brian Burg.
195
196         Store and retrieve the Same-Site cookie policy from CFNetwork.
197
198         * inspector/agents/InspectorPageAgent.cpp:
199         (WebCore::cookieSameSitePolicyJSON): Added.
200         (WebCore::buildObjectForCookie): Modified to include cookie Same-Site policy. 
201         * platform/Cookie.h:
202         (WebCore::Cookie::encode const): Encode Same-Site policy.
203         (WebCore::Cookie::decode): Decode Same-Site policy.
204         * platform/network/cocoa/CookieCocoa.mm:
205         (WebCore::portStringFromVector):
206         (WebCore::coreSameSitePolicy):
207         (WebCore::nsSameSitePolicy):
208         (WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):
209         (WebCore::Cookie::operator NSHTTPCookie * const): Deleted.
210
211 2018-05-30  Daniel Bates  <dabates@apple.com>
212
213         NavigationAction does not need to hold initiating DOM Event
214         https://bugs.webkit.org/show_bug.cgi?id=185958
215         <rdar://problem/40531539>
216
217         Reviewed by Simon Fraser.
218
219         Take a similar approach as was done in <https://bugs.webkit.org/show_bug.cgi?id=185712>
220         and have NavigationAction hold only as many details of the initiating DOM Event as
221         necessary to support WebKit functionality. Retaining a DOM Event effectively retains
222         the document that associated with the event. And DocumentLoader always keeps around
223         the NavigationAction of the last navigation for the "benefit of the various policy handlers".
224         Therefore, having NavigationAction hold only the relevant details of the DOM Event
225         instead of the DOM Event itself we avoid keeping the document we navigated from alive
226         longer than necessary. 
227
228         * dom/MouseRelatedEvent.h:
229         * dom/UIEventWithKeyState.h:
230         * loader/NavigationAction.cpp:
231         (WebCore::NavigationAction::UIEventWithKeyStateData::UIEventWithKeyStateData): Added.
232         (WebCore::NavigationAction::MouseEventData::MouseEventData): Added.
233         (WebCore::keyStateDataForFirstEventWithKeyState): Added.
234         (WebCore::mouseEventDataForFirstMouseEvent): Added.
235         * loader/NavigationAction.h:
236         (WebCore::NavigationAction::keyStateEventData const): Added.
237         (WebCore::NavigationAction::mouseEventData const): Added
238         (WebCore::NavigationAction::event const): Deleted.
239
240 2018-05-30  Youenn Fablet  <youenn@apple.com>
241
242         Revert changes made to URLWithUserTypedString made in https://trac.webkit.org/changeset/232281
243         https://bugs.webkit.org/show_bug.cgi?id=186108
244         <rdar://problem/40663065>
245
246         Reviewed by Alex Christensen.
247
248         Covered by existing API tests.
249
250         * platform/mac/WebCoreNSURLExtras.mm:
251         (WebCore::URLWithUserTypedString):
252         Return early if WebCore::URL is not able to create a CFURL.
253         Use CFURL otherwise to keep the existing behavior as much as possible.
254
255 2018-05-30  Youenn Fablet  <youenn@apple.com>
256
257         Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
258         https://bugs.webkit.org/show_bug.cgi?id=186082
259
260         Reviewed by Chris Dumez.
261
262         No change of behavior.
263
264         * page/RuntimeEnabledFeatures.h:
265         (WebCore::RuntimeEnabledFeatures::setCrossOriginResourcePolicyEnabled):
266         (WebCore::RuntimeEnabledFeatures::crossOriginResourcePolicyEnabled const):
267         (WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled): Deleted.
268         (WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const): Deleted.
269
270 2018-05-30  Chris Dumez  <cdumez@apple.com>
271
272         Referrer-Policy response header is ignored
273         https://bugs.webkit.org/show_bug.cgi?id=186037
274         <rdar://problem/40600335>
275
276         Reviewed by Youenn Fablet.
277
278         Add support for Referrer-Policy HTTP response header:
279         - https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-header
280
281         Tests: http/tests/security/referrer-policy-header-and-meta-tag-emptyString.html
282                http/tests/security/referrer-policy-header-and-meta-tag.html
283                http/tests/security/referrer-policy-header.html
284
285         * dom/Document.cpp:
286         (WebCore::Document::setReferrerPolicy):
287         (WebCore::Document::processReferrerPolicy):
288         * dom/Document.h:
289         (WebCore::Document::referrerPolicy const):
290         * html/HTMLMetaElement.cpp:
291         (WebCore::HTMLMetaElement::process):
292         * loader/FrameLoader.cpp:
293         (WebCore::FrameLoader::didBeginDocument):
294         * loader/SubresourceLoader.cpp:
295         (WebCore::SubresourceLoader::updateReferrerPolicy):
296         * platform/ReferrerPolicy.cpp:
297         (WebCore::parseReferrerPolicyToken):
298         (WebCore::parseReferrerPolicy):
299         * platform/ReferrerPolicy.h:
300
301 2018-05-30  Youenn Fablet  <youenn@apple.com>
302
303         Rename CrossOriginResourcePolicy same to same-origin
304         https://bugs.webkit.org/show_bug.cgi?id=186080
305
306         Reviewed by Chris Dumez.
307
308         Covered by updated tests.
309
310         * platform/network/HTTPParsers.cpp:
311         (WebCore::parseCrossOriginResourcePolicyHeader):
312         * platform/network/HTTPParsers.h:
313
314 2018-05-30  Aditya Keerthi  <akeerthi@apple.com>
315
316         Fix the ENABLE(DATALIST_ELEMENT) build
317         https://bugs.webkit.org/show_bug.cgi?id=186105
318
319         Reviewed by Wenson Hsieh.
320
321         * WebCore.xcodeproj/project.pbxproj:
322         * html/ColorInputType.cpp:
323         (WebCore::ColorInputType::suggestions const):
324         * html/HTMLInputElement.h:
325         * html/HTMLOptionElement.cpp:
326         (WebCore::HTMLOptionElement::ownerDataListElement const):
327         * rendering/RenderTheme.cpp:
328         (WebCore::RenderTheme::paintSliderTicks):
329
330 2018-05-30  Alex Christensen  <achristensen@webkit.org>
331
332         Reduce String allocations
333         https://bugs.webkit.org/show_bug.cgi?id=186059
334
335         Reviewed by Darin Adler.
336
337         Don't allocate Strings just to convert it to another form.
338         Based mostly on Darin's feedback on bug 185986.
339
340         No change in behavior.
341
342         * Modules/websockets/WebSocketHandshake.cpp:
343         (WebCore::hostName):
344         (WebCore::WebSocketHandshake::host const):
345         * css/parser/CSSSelectorParser.cpp:
346         (WebCore::CSSSelectorParser::consumePseudo):
347         (WebCore::CSSSelectorParser::consumeANPlusB):
348         * loader/mac/LoaderNSURLExtras.mm:
349         (suggestedFilenameWithMIMEType):
350         * page/SecurityOriginData.h:
351         (WebCore::SecurityOriginData::fromURL):
352         * page/csp/ContentSecurityPolicySource.cpp:
353         (WebCore::wildcardMatches):
354         (WebCore::ContentSecurityPolicySource::hostMatches const):
355         * platform/URL.cpp:
356         (WebCore::URL::hostAndPort const):
357         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
358         (WebCore::SocketStreamHandleImpl::createStreams):
359
360 2018-05-30  Jer Noble  <jer.noble@apple.com>
361
362         Media elements outside fullscreen should not be considered main content.
363         https://bugs.webkit.org/show_bug.cgi?id=186063
364         <rdar://problem/40630437>
365
366         Reviewed by Eric Carlson.
367
368         Test: platform/mac/media/video-best-element-for-playback-controls-purpose.html
369
370         Media elements outside the current fullscreen element are not visible, and thus should not be considered
371         main content.
372
373         Drive-by fix: set the m_hasEverNotifiedAboutPlaying before dispatching the 'playing' event, so that
374         tests can check bestMediaElementForShowingPlaybackControlsManager() in the 'playing' handler.
375
376         * html/HTMLMediaElement.cpp:
377         (WebCore::HTMLMediaElement::notifyAboutPlaying):
378         * html/HTMLMediaElement.h:
379         * html/MediaElementSession.cpp:
380         (WebCore::MediaElementSession::canShowControlsManager const):
381         * testing/Internals.cpp:
382         (WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
383         * testing/Internals.h:
384         * testing/Internals.idl:
385
386 2018-05-30  Michael Catanzaro  <mcatanzaro@igalia.com>
387
388         Unreviewed, silence a -Wreturn-type warning
389
390         * css/SVGCSSComputedStyleDeclaration.cpp:
391         (WebCore::glyphOrientationToCSSPrimitiveValue):
392
393 2018-05-30  Alexey Proskuryakov  <ap@apple.com>
394
395         Build fix attempt after https://trac.webkit.org/r232198
396
397         * platform/network/cf/ResourceHandleCFNet.cpp:
398         (WebCore::ResourceHandle::createCFURLConnection): Added some toString() calls.
399
400 2018-05-30  Zalan Bujtas  <zalan@apple.com>
401
402         [LFC] Miscellaneous fixes to get closer to geometry correctness
403         https://bugs.webkit.org/show_bug.cgi?id=186083
404
405         Reviewed by Antti Koivisto.
406
407         * layout/FormattingContextGeometry.cpp:
408         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
409         * layout/LayoutContext.cpp:
410         (WebCore::Layout::LayoutContext::initializeRoot):
411         * layout/Verification.cpp:
412         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
413         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
414         (WebCore::Layout::isStretchedToViewport):
415         (WebCore::Layout::initialContainingBlock):
416         (WebCore::Layout::computedInFlowNonReplacedComputedHeight):
417         (WebCore::Layout::inFlowNonReplacedComputedWidth):
418         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): lambda should capture the specification part. 
419         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth):
420         * layout/displaytree/DisplayBox.cpp:
421         (WebCore::Display::Box::marginBox const):
422         (WebCore::Display::Box::paddingBox const):
423         (WebCore::Display::Box::contentBox const):
424         * layout/layouttree/LayoutBox.cpp:
425         (WebCore::Layout::Box::isDocumentBox const):
426         (WebCore::Layout::Box::isBodyBox const):
427         * layout/layouttree/LayoutBox.h:
428         * rendering/style/BorderValue.h: ignore border-width when type is hidden or none. 
429         (WebCore::BorderValue::boxModelWidth const):
430
431 2018-05-30  Stephen McGruer  <smcgruer@chromium.org>
432
433         iOS: setting 'defaultValue' of input type=date from script should cause a UI update
434         https://bugs.webkit.org/show_bug.cgi?id=185982
435
436         Reviewed by Darin Adler.
437
438         Test: fast/forms/date/date-appearance-defaultValue.html
439
440         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
441         (WebCore::BaseChooserOnlyDateAndTimeInputType::valueAttributeChanged):
442         * html/BaseChooserOnlyDateAndTimeInputType.h:
443         * html/HTMLInputElement.cpp:
444         (WebCore::HTMLInputElement::parseAttribute):
445         * html/InputType.cpp:
446         (WebCore::InputType::valueAttributeChanged):
447         * html/InputType.h:
448
449 2018-05-29  Nan Wang  <n_wang@apple.com>
450
451         Unreviewed, follow-up after r232285
452         https://bugs.webkit.org/show_bug.cgi?id=180871
453
454         Removed redundant null check.
455
456         * accessibility/AccessibilityObject.cpp:
457         (WebCore::AccessibilityObject::isExpanded const):
458
459 2018-05-29  Nan Wang  <n_wang@apple.com>
460
461         AX: macOS VoiceOver doesn't announce when details element is expanded when using role group
462         https://bugs.webkit.org/show_bug.cgi?id=180866
463         <rdar://problem/36074338>
464
465         Reviewed by Chris Fleizach.
466
467         We should use is<HTMLDetailsElement> to check for the details parent instead
468         of using the role.
469
470         Added test cases to the existing test.
471
472         * accessibility/AccessibilityObject.cpp:
473         (WebCore::AccessibilityObject::isExpanded const):
474
475 2018-05-29  Youenn Fablet  <youenn@apple.com>
476
477         Add a consistency check between URL and CFURL
478         https://bugs.webkit.org/show_bug.cgi?id=186057
479         <rdar://problem/40258457>
480
481         Reviewed by Geoff Garen.
482
483         It is important that WebCore::URL used in WebCore and CFURL that gets serialized in the network pipe remain consistent.
484         Otherwise, we will end-up with odd bugs.
485
486         We add such a check when creating a CFURL from an URL.
487         To make things more consistent, we also rely now more on WebCore::URL instead of directly creating a CFURL.
488
489         * platform/URL.h:
490         * platform/cf/CFURLExtras.cpp:
491         (WebCore::isCFURLSameOrigin):
492         * platform/cf/CFURLExtras.h:
493         * platform/cf/URLCF.cpp:
494         (WebCore::URL::createCFURL const):
495         * platform/mac/URLMac.mm:
496         (WebCore::URL::createCFURL const):
497         * platform/mac/WebCoreNSURLExtras.mm:
498         (WebCore::URLWithUserTypedString):
499
500 2018-05-29  Timothy Hatcher  <timothy@apple.com>
501
502         Printing does not apply the right colors in all cases.
503
504         https://bugs.webkit.org/show_bug.cgi?id=186066
505         rdar://problem/40274975
506
507         Reviewed by Tim Horton.
508
509         * inspector/agents/InspectorPageAgent.cpp:
510         (WebCore::InspectorPageAgent::setEmulatedMedia): Call RenderTheme::platformColorsDidChange
511         to invalidate the color cache.
512         * page/FrameView.cpp:
513         (WebCore::FrameView::adjustMediaTypeForPrinting): Ditto.
514         * page/Page.cpp:
515         (WebCore::Page::defaultAppearance const): Added. Use default when not screen.
516         * page/Page.h:
517         (WebCore::Page::defaultAppearance const): Deleted.
518
519 2018-05-29  Per Arne Vollan  <pvollan@apple.com>
520
521         Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
522         https://bugs.webkit.org/show_bug.cgi?id=186056
523
524         Reviewed by Brent Fulgham.
525
526         No new tests, no change in behavior.
527
528         * platform/PlatformScreen.h:
529         * platform/mac/PlatformScreenMac.mm:
530         (WebCore::screenProperties):
531         (WebCore::getScreenProperties):
532         (WebCore::setScreenProperties):
533
534 2018-05-29  Ryosuke Niwa  <rniwa@webkit.org>
535
536         iOS WK1: Occasional crash in sanitizedMarkupForFragmentInDocument
537         https://bugs.webkit.org/show_bug.cgi?id=186011
538
539         Reviewed by David Kilzer.
540
541         The crash was caused by the HTML parser in sanitizedMarkupForFragmentInDocument yielding in the web thread
542         when _WebThreadLock() sets webThreadShouldYield to true in the main thread.
543
544         No new tests. This is occasionally caught by existing tests.
545
546         * editing/markup.cpp:
547         (WebCore::createPageForSanitizingWebContent): Fixed the bug by making the HTML parser never yield.
548         Also release-assert that the body is never null here.
549         (WebCore::sanitizedMarkupForFragmentInDocument): Removed superflous call to WTFMove since appendChild
550         takes a reference, not a Ref.
551         * inspector/InspectorOverlay.cpp:
552         (WebCore::InspectorOverlay::overlayPage): Deployed the same fix.
553         * loader/DocumentWriter.cpp:
554         (WebCore::DocumentWriter::insertDataSynchronously): Added.
555         * loader/DocumentWriter.h:
556
557 2018-05-29  Chris Dumez  <cdumez@apple.com>
558
559         Avoid unnecessary String allocation in isPublicSuffix(const String&)
560         https://bugs.webkit.org/show_bug.cgi?id=186054
561
562         Reviewed by Sam Weinig.
563
564         Avoid unnecessary String allocation in isPublicSuffix(const String&) by calling directly
565         the decodeHostName() overload taking in a NSString*. This overload returns a NSString*,
566         which is what we need. We would previously call the overloading taking in a String, which
567         would return a String, which we would have to convert back to a NSString*.
568
569         * platform/mac/PublicSuffixMac.mm:
570         (WebCore::isPublicSuffix):
571
572 2018-05-29  Alex Christensen  <achristensen@webkit.org>
573
574         Do even fewer allocations in URL host operations
575         https://bugs.webkit.org/show_bug.cgi?id=186003
576
577         Reviewed by Geoffrey Garen.
578
579         * loader/ResourceLoadStatistics.cpp:
580         (WebCore::ResourceLoadStatistics::primaryDomain):
581         * loader/ResourceLoadStatistics.h:
582         * platform/URL.cpp:
583         (WebCore::URL::hostIsIPAddress):
584         * platform/URL.h:
585         * platform/mac/URLMac.mm:
586         (WebCore::URL::hostIsIPAddress):
587         * platform/soup/URLSoup.cpp:
588         (WebCore::URL::hostIsIPAddress):
589
590 2018-05-29  Tadeu Zagallo  <tzagallo@apple.com>
591
592         Don't assert on m_actionsStart when setting actions on DFA nodes
593         https://bugs.webkit.org/show_bug.cgi?id=185979
594         <rdar://problem/39669458>
595
596         Reviewed by Geoffrey Garen.
597
598         DFANode::setActions is called immediately after the node is created, and once again to set
599         the actions of catch-all regular expressions (.*) on the root node. That works because
600         m_actionsStart is initially 0, since the root was the first node to be created, but may fail
601         after minimizing the DFA, when the root may no longer be the first node, and therefore
602         m_actionsStart would not be 0, even if there are no actions attached to that node.
603
604         Test: http/tests/contentextensions/root-actions.html
605
606         * contentextensions/DFANode.h:
607
608 2018-05-29  Nan Wang  <n_wang@apple.com>
609
610         AX: setValue on contenteditable should preserve whitespace
611         https://bugs.webkit.org/show_bug.cgi?id=185897
612
613         Reviewed by Ryosuke Niwa.
614
615         We should mimic typing when setting value to a contenteditable from accessibility
616         instead of mutating the DOM by using setInnerText.
617
618         Updated tests to cover this change.
619
620         * accessibility/AccessibilityRenderObject.cpp:
621         (WebCore::AccessibilityRenderObject::setValue):
622
623 2018-05-29  Zalan Bujtas  <zalan@apple.com>
624
625         [LFC] Miscellaneous fixes to ensure no assertion in LayoutContext::layout
626         https://bugs.webkit.org/show_bug.cgi?id=186052
627
628         Reviewed by Antti Koivisto.
629
630         With this patch, LayoutContext::layout() does not assert on <html><body><div></div></body></html> anymore.
631
632         * layout/LayoutContext.cpp:
633         (WebCore::Layout::LayoutContext::initializeRoot): New context root is always a layout root.
634         * layout/LayoutContext.h:
635         * layout/Verification.cpp:
636         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
637         * layout/blockformatting/BlockFormattingContext.cpp:
638         (WebCore::Layout::BlockFormattingContext::layout const): we need computed margin/border/padding for width computation  
639         * layout/displaytree/DisplayBox.cpp: Add clone() method to be able to carry over the 'hasValid*' bits.
640         (WebCore::Display::Box::Style::Style):
641         (WebCore::Display::Box::borderBox const):
642         (WebCore::Display::Box::contentBox const):
643         * layout/displaytree/DisplayBox.h:
644         (WebCore::Display::Box::Rect::operator LayoutRect const):
645         (WebCore::Display::Box::setSize):
646         (WebCore::Display::Box::setHasValidMargin):
647         (WebCore::Display::Box::setHasValidBorder):
648         (WebCore::Display::Box::setHasValidPadding):
649         (WebCore::Display::Box::Rect::setHasValidPosition):
650         (WebCore::Display::Box::Rect::setHasValidSize):
651         (WebCore::Display::Box::Rect::setSize):
652         (WebCore::Display::Box::Rect::clone const):
653         (WebCore::Display::Box::setMargin):
654         (WebCore::Display::Box::setBorder):
655         (WebCore::Display::Box::setPadding):
656         (WebCore::Display::Box::Rect::Rect): Deleted.
657
658 2018-05-29  Wenson Hsieh  <wenson_hsieh@apple.com>
659
660         [Extra zoom mode] "Significant area painted" rendering progress event is rarely fired
661         https://bugs.webkit.org/show_bug.cgi?id=186042
662         <rdar://problem/40604182>
663
664         Reviewed by Tim Horton.
665
666         Makes a minor tweak to the size of the relevant view rect in extra zoom mode, such that it's no wider than the
667         visible content rect. Previously, the width of this rect has hard-coded to a value optimized for macOS (980),
668         which makes it difficult for content laid out at device width in extra zoom mode to cover a significant portion
669         of the relevant view rect.
670
671         Test: RenderingProgressTests.FirstPaintWithSignificantArea
672
673         * page/Page.cpp:
674         (WebCore::relevantViewRect):
675
676 2018-05-29  Antoine Quint  <graouts@apple.com>
677
678         [Web Animations] Handle relative length units
679         https://bugs.webkit.org/show_bug.cgi?id=186047
680
681         Reviewed by Dean Jackson.
682
683         In order to correctly handle relative units, such as "em", "vw" and "vh", we need to do two things.
684
685         First, because we need to apply the cascade to correctly compute relative lengths, we need to delay the computation of
686         "blending keyframes" to when we have both keyframes data and a valid target. This also means that we need to reset blending
687         keyframes when the target changes. As a result, old call sites of updateBlendingKeyframes() have been replaced by a call to
688         m_blendingKeyframes.clear() and the method now gets called as part of apply() with the RenderStyle of the targeted element
689         as a parameter.
690
691         Second, and as a result of the first change, we need to update the accelerated animation state based on animation
692         progress rather than when calling specific methods, such as Animation.play() and Animation.pause(), since blending
693         keyframes may not be available at those more specific call sites. We now have a new updateAcceleratedAnimationState()
694         method that gets called as part of apply(). We also rename animationPlayStateDidChange() to animationSuspensionStateDidChange()
695         since this method was specific to suspension and had a confusing name.
696
697         * animation/AnimationEffectReadOnly.h: Rename animationPlayStateDidChange() to animationSuspensionStateDidChange().
698         * animation/KeyframeEffectReadOnly.cpp:
699         (WebCore::KeyframeEffectReadOnly::getKeyframes): Fix a crash that revealed itself after other changes in this patch. We would later
700         call into ComputedStyleExtractor::animationSuspensionStateDidChange() and this would yield an assertion because we'd call potentially
701         call it with a custom CSS property.
702         (WebCore::KeyframeEffectReadOnly::processKeyframes): Reset blending keyframes instead of calling updateBlendingKeyframes() since
703         blending keyframes is now performed asynchronously upon style resolution.
704         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes): Take the target's RenderStyle as a parameter and use it to reset the
705         associated StyleResolver's state, just like we do in StyleResolver::keyframeStylesForAnimation(), so that the CSS cascade is correctly
706         accounted for when computing values using relative length units. Since blending keyframes can now be computed several times for a
707         given set of keyframes, since the effect's target may change, we also need to create a copy of the MutableStyleProperties to pass
708         to StyleRuleKeyframe::create().
709         (WebCore::KeyframeEffectReadOnly::setTarget): Reset blending keyframes instead of calling updateBlendingKeyframes() since
710         blending keyframes is now performed asynchronously upon style resolution.
711         (WebCore::KeyframeEffectReadOnly::apply): Update blending keyframes and the accelerated animation state.
712         (WebCore::KeyframeEffectReadOnly::getAnimatedStyle): Make sure we have blending keyframes with a call to updateBlendingKeyframes()
713         in case the animation hasn't naturally progressed when this method is called.
714         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): Make sure we have blending keyframes with a call to
715         updateBlendingKeyframes() in case the animation hasn't naturally progressed when this method is called.
716         (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState): Account for the animation's local time and play state to update
717         the accelerated animation state.
718         (WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Record the last accelerated action in a member variable which we can
719         use to determine if we're running accelerated accounting for uncommited changes.
720         (WebCore::KeyframeEffectReadOnly::animationDidSeek): Only record an AcceleratedAction::Seek action if we're already running accelerated.
721         (WebCore::KeyframeEffectReadOnly::animationSuspensionStateDidChange): Only record an AcceleratedAction::Pause or AcceleratedAction::Play
722         action if we're already running accelerated.
723         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Ensure we clone and clear the list of accelerated actions and check that
724         we have any cloned actions before proceeding any further. Then we can stop accounting for m_startedAccelerated since the list of accelerated
725         actions already account for animation state changes.
726         (WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Deleted.
727         * animation/KeyframeEffectReadOnly.h:
728         (WebCore::KeyframeEffectReadOnly::isRunningAccelerated const): Account for the m_lastRecordedAcceleratedAction to identify whether we're running.
729         * animation/WebAnimation.cpp:
730         (WebCore::WebAnimation::play): Stop calling animationPlayStateDidChange() directly since the accelerated animation state is now updated when
731         the animation's effect is applied.
732         (WebCore::WebAnimation::pause): Stop calling animationPlayStateDidChange() directly since the accelerated animation state is now updated when
733         the animation's effect is applied.
734         (WebCore::WebAnimation::resolve): Make sure we update the finished state prior to applying the animation's effect since the play state can
735         change when updating the finished state and KeyframeEffectReadOnly::updateAcceleratedAnimationState(), which is called when calling into
736         KeyframeEffectReadOnly::apply(), relies on it to correctly update the accelerated animation state.
737         (WebCore::WebAnimation::setSuspended): Rename animationPlayStateDidChange() to animationSuspensionStateDidChange().
738         * css/StyleResolver.cpp:
739         (WebCore::StyleResolver::setNewStateWithElement): Add a new public method to reset a StyleResolver's state such that we can call it when creating
740         blending keyframes for JS-originated animations just like we do when creating blending keyframes for CSS Animations in keyframeStylesForAnimation().
741         (WebCore::StyleResolver::keyframeStylesForAnimation): Use the new setNewStateWithElement() method.
742         * css/StyleResolver.h:
743
744 2018-05-29  Thibault Saunier  <tsaunier@igalia.com>
745
746         [GStreamer] Update "qtdemux: Clarify field name about stream-encryption-system" patch
747         https://bugs.webkit.org/show_bug.cgi?id=186040
748
749         Reviewed by Xabier Rodriguez-Calvar.
750
751         s/avalaible-stream-encryption-systems/available-stream-encryption-systems/g
752
753         Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
754
755         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
756         (WebCore::extractEventsAndSystemsFromMessage):
757
758 2018-05-28  Zalan Bujtas  <zalan@apple.com>
759
760         Unreviewed build fix.
761
762         * layout/displaytree/DisplayBox.h:
763         (WebCore::Display::Box::Rect::operator LayoutRect const):
764
765 2018-05-28  Zalan Bujtas  <zalan@apple.com>
766
767         [LFC] Add Rect interface to Display::Box
768         https://bugs.webkit.org/show_bug.cgi?id=186019
769
770         Reviewed by Antti Koivisto.
771
772         Having a dedicated Rect class and moving the geometry invalidation to it enables us to call
773         displayBox.contentBox().left() even when the widht/height are not computed yet.
774         Also having Rect with top/left/bottom/right interface is more aligned with the rest of the layout code than x/y/maxX/maxY.
775
776         * layout/FormattingContextGeometry.cpp:
777         (WebCore::Layout::contentHeightForFormattingContextRoot):
778         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
779         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
780         * layout/displaytree/DisplayBox.cpp:
781         (WebCore::Display::Box::marginBox const):
782         (WebCore::Display::Box::borderBox const):
783         (WebCore::Display::Box::paddingBox const):
784         (WebCore::Display::Box::contentBox const):
785         * layout/displaytree/DisplayBox.h:
786         (WebCore::Display::Box::Rect::invalidateTop):
787         (WebCore::Display::Box::Rect::invalidateLeft):
788         (WebCore::Display::Box::Rect::invalidateWidth):
789         (WebCore::Display::Box::Rect::invalidateHeight):
790         (WebCore::Display::Box::Rect::hasValidPosition const):
791         (WebCore::Display::Box::Rect::hasValidSize const):
792         (WebCore::Display::Box::Rect::hasValidGeometry const):
793         (WebCore::Display::Box::rect const):
794         (WebCore::Display::Box::top const):
795         (WebCore::Display::Box::left const):
796         (WebCore::Display::Box::bottom const):
797         (WebCore::Display::Box::right const):
798         (WebCore::Display::Box::topLeft const):
799         (WebCore::Display::Box::bottomRight const):
800         (WebCore::Display::Box::size const):
801         (WebCore::Display::Box::width const):
802         (WebCore::Display::Box::height const):
803         (WebCore::Display::Box::setTopLeft):
804         (WebCore::Display::Box::setTop):
805         (WebCore::Display::Box::setLeft):
806         (WebCore::Display::Box::setWidth):
807         (WebCore::Display::Box::setHeight):
808         (WebCore::Display::Box::Rect::invalidatePosition):
809         (WebCore::Display::Box::Rect::setHasValidPosition):
810         (WebCore::Display::Box::Rect::Rect):
811         (WebCore::Display::Box::Rect::top const):
812         (WebCore::Display::Box::Rect::left const):
813         (WebCore::Display::Box::Rect::bottom const):
814         (WebCore::Display::Box::Rect::right const):
815         (WebCore::Display::Box::Rect::topLeft const):
816         (WebCore::Display::Box::Rect::bottomRight const):
817         (WebCore::Display::Box::Rect::size const):
818         (WebCore::Display::Box::Rect::width const):
819         (WebCore::Display::Box::Rect::height const):
820         (WebCore::Display::Box::Rect::setTopLeft):
821         (WebCore::Display::Box::Rect::setTop):
822         (WebCore::Display::Box::Rect::setLeft):
823         (WebCore::Display::Box::Rect::setWidth):
824         (WebCore::Display::Box::Rect::setHeight):
825         (WebCore::Display::Box::Rect::shiftLeftTo):
826         (WebCore::Display::Box::Rect::shiftRightTo):
827         (WebCore::Display::Box::Rect::shiftTopTo):
828         (WebCore::Display::Box::Rect::shiftBottomTo):
829         (WebCore::Display::Box::Rect::expand):
830         (WebCore::Display::Box::invalidateTop): Deleted.
831         (WebCore::Display::Box::invalidateLeft): Deleted.
832         (WebCore::Display::Box::invalidateWidth): Deleted.
833         (WebCore::Display::Box::invalidateHeight): Deleted.
834         (WebCore::Display::Box::hasValidPosition const): Deleted.
835         (WebCore::Display::Box::hasValidSize const): Deleted.
836         (WebCore::Display::Box::hasValidGeometry const): Deleted.
837         (WebCore::Display::Box::invalidatePosition): Deleted.
838         (WebCore::Display::Box::setHasValidPosition): Deleted.
839
840 2018-05-28  Zalan Bujtas  <zalan@apple.com>
841
842         [LFC] Add formatting context testing codepath in FrameViewLayoutContext
843         https://bugs.webkit.org/show_bug.cgi?id=186036
844
845         Reviewed by Antti Koivisto.
846
847         This is to verify the formatting context layout correctness.
848
849         * layout/LayoutContext.cpp:
850         (WebCore::Layout::LayoutContext::LayoutContext):
851         (WebCore::Layout::LayoutContext::initializeRoot):
852         * layout/LayoutContext.h:
853         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
854         * page/FrameViewLayoutContext.cpp:
855         (WebCore::layoutUsingFormattingContext):
856         (WebCore::FrameViewLayoutContext::layout):
857
858 2018-05-28  Zalan Bujtas  <zalan@apple.com>
859
860         [LFC] Add layout tree verification.
861         https://bugs.webkit.org/show_bug.cgi?id=186018
862
863         Reviewed by Antti Koivisto.
864
865         Compare layout and render tree geometry and output the mismtaching rectangles.
866
867         * Sources.txt:
868         * WebCore.xcodeproj/project.pbxproj: Add missing headers and make then private.
869         * layout/LayoutContext.h:
870         * layout/Verification.cpp: Added.
871         (WebCore::Layout::outputMismatchedBoxInformationIfNeeded):
872         (WebCore::Layout::verifySubtree):
873         (WebCore::Layout::LayoutContext::verifyAndOutputLayoutTree const):
874
875 2018-05-28  Sam Weinig  <sam@webkit.org>
876
877         Modernize SVGRenderStyleDefs.h
878         https://bugs.webkit.org/show_bug.cgi?id=186024
879
880         Reviewed by Daniel Bates.
881
882         Modernized the set of enums in SVGRenderStyleDefs.h and WindRule.h by:
883             - Converting them to enum classes
884             - Renaming them to remove unnecessary prefix 'E's
885             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
886             - Renaming to match modern conventions (e.g BNONE -> None)
887
888         Modernizes the following enums:
889             SVGPaintType
890             BaselineShift (renamed from EBaselineShift)
891             TextAnchor (renamed from ETextAnchor)
892             ColorInterpolation (renamed from EColorInterpolation)
893             ColorRendering (renamed from EColorRendering)
894             ShapeRendering (renamed from EShapeRendering)
895             GlyphOrientation (renamed from EGlyphOrientation)
896             AlignmentBaseline (renamed from EAlignmentBaseline)
897             DominantBaseline (renamed from EDominantBaseline)
898             VectorEffect (renamed from EVectorEffect)
899             BufferedRendering (renamed from EBufferedRendering)
900             MaskType (renamed from EMaskType)
901             WindRule
902
903         * css/CSSBasicShapes.cpp:
904         (WebCore::buildPathString):
905         (WebCore::buildPolygonString):
906         * css/CSSBasicShapes.h:
907         * css/CSSPrimitiveValueMappings.h:
908         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
909         (WebCore::CSSPrimitiveValue::operator WindRule const):
910         (WebCore::CSSPrimitiveValue::operator AlignmentBaseline const):
911         (WebCore::CSSPrimitiveValue::operator BufferedRendering const):
912         (WebCore::CSSPrimitiveValue::operator ColorInterpolation const):
913         (WebCore::CSSPrimitiveValue::operator ColorRendering const):
914         (WebCore::CSSPrimitiveValue::operator DominantBaseline const):
915         (WebCore::CSSPrimitiveValue::operator ShapeRendering const):
916         (WebCore::CSSPrimitiveValue::operator TextAnchor const):
917         (WebCore::CSSPrimitiveValue::operator VectorEffect const):
918         (WebCore::CSSPrimitiveValue::operator MaskType const):
919         (WebCore::CSSPrimitiveValue::operator EAlignmentBaseline const): Deleted.
920         (WebCore::CSSPrimitiveValue::operator EBufferedRendering const): Deleted.
921         (WebCore::CSSPrimitiveValue::operator EColorInterpolation const): Deleted.
922         (WebCore::CSSPrimitiveValue::operator EColorRendering const): Deleted.
923         (WebCore::CSSPrimitiveValue::operator EDominantBaseline const): Deleted.
924         (WebCore::CSSPrimitiveValue::operator EShapeRendering const): Deleted.
925         (WebCore::CSSPrimitiveValue::operator ETextAnchor const): Deleted.
926         (WebCore::CSSPrimitiveValue::operator EVectorEffect const): Deleted.
927         (WebCore::CSSPrimitiveValue::operator EMaskType const): Deleted.
928         * css/SVGCSSComputedStyleDeclaration.cpp:
929         (WebCore::glyphOrientationToCSSPrimitiveValue):
930         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
931         (WebCore::ComputedStyleExtractor::svgPropertyValue):
932         * css/StyleBuilderConverter.h:
933         (WebCore::StyleBuilderConverter::convertGlyphOrientation):
934         (WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
935         * css/StyleBuilderCustom.h:
936         (WebCore::StyleBuilderCustom::applyValueBaselineShift):
937         (WebCore::StyleBuilderCustom::applyValueFill):
938         (WebCore::StyleBuilderCustom::applyValueStroke):
939         * css/parser/CSSPropertyParser.cpp:
940         (WebCore::consumeBasicShapePolygon):
941         (WebCore::consumeBasicShapePath):
942         * html/canvas/CanvasRenderingContext2DBase.cpp:
943         (WebCore::toWindRule):
944         * page/animation/CSSPropertyAnimation.cpp:
945         (WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
946         * platform/graphics/FloatPolygon.cpp:
947         (WebCore::FloatPolygon::contains const):
948         * platform/graphics/GraphicsContext.cpp:
949         (WebCore::GraphicsContext::fillRectWithRoundedHole):
950         * platform/graphics/GraphicsContext.h:
951         * platform/graphics/GraphicsLayer.cpp:
952         (WebCore::GraphicsLayer::shapeLayerWindRule const):
953         * platform/graphics/GraphicsLayer.h:
954         * platform/graphics/GraphicsTypes.cpp:
955         (WebCore::operator<<):
956         * platform/graphics/Path.h:
957         * platform/graphics/ShadowBlur.cpp:
958         (WebCore::ShadowBlur::drawInsetShadow):
959         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
960         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
961         * platform/graphics/WindRule.h:
962         (): Deleted.
963         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
964         (PlatformCALayerCocoa::shapeWindRule const):
965         (PlatformCALayerCocoa::setShapeWindRule):
966         * platform/graphics/cg/GraphicsContextCG.cpp:
967         (WebCore::calculateDrawingMode):
968         (WebCore::GraphicsContext::fillPath):
969         (WebCore::GraphicsContext::fillRectWithRoundedHole):
970         (WebCore::GraphicsContext::clipPath):
971         * platform/graphics/cg/PathCG.cpp:
972         (WebCore::Path::contains const):
973         * platform/mock/MockRealtimeVideoSource.cpp:
974         (WebCore::MockRealtimeVideoSource::drawAnimation):
975         * rendering/FilterEffectRenderer.cpp:
976         (WebCore::FilterEffectRenderer::buildReferenceFilter):
977         * rendering/RenderBoxModelObject.cpp:
978         (WebCore::RenderBoxModelObject::paintBorder):
979         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
980         * rendering/RenderElement.cpp:
981         (WebCore::RenderElement::paintOutline):
982         * rendering/RenderLayer.cpp:
983         (WebCore::RenderLayer::computeClipPath const):
984         * rendering/style/BasicShapes.h:
985         (WebCore::BasicShape::windRule const):
986         * rendering/style/RenderStyle.h:
987         (WebCore::RenderStyle::fillPaintType const):
988         (WebCore::RenderStyle::setFillPaintColor):
989         (WebCore::RenderStyle::strokePaintType const):
990         (WebCore::RenderStyle::setStrokePaintColor):
991         * rendering/style/SVGRenderStyle.h:
992         (WebCore::SVGRenderStyle::initialAlignmentBaseline):
993         (WebCore::SVGRenderStyle::initialDominantBaseline):
994         (WebCore::SVGRenderStyle::initialBaselineShift):
995         (WebCore::SVGRenderStyle::initialVectorEffect):
996         (WebCore::SVGRenderStyle::initialBufferedRendering):
997         (WebCore::SVGRenderStyle::initialClipRule):
998         (WebCore::SVGRenderStyle::initialColorInterpolation):
999         (WebCore::SVGRenderStyle::initialColorInterpolationFilters):
1000         (WebCore::SVGRenderStyle::initialColorRendering):
1001         (WebCore::SVGRenderStyle::initialFillRule):
1002         (WebCore::SVGRenderStyle::initialShapeRendering):
1003         (WebCore::SVGRenderStyle::initialTextAnchor):
1004         (WebCore::SVGRenderStyle::initialGlyphOrientationHorizontal):
1005         (WebCore::SVGRenderStyle::initialGlyphOrientationVertical):
1006         (WebCore::SVGRenderStyle::initialFillPaintType):
1007         (WebCore::SVGRenderStyle::initialStrokePaintType):
1008         (WebCore::SVGRenderStyle::initialMaskType):
1009         (WebCore::SVGRenderStyle::setAlignmentBaseline):
1010         (WebCore::SVGRenderStyle::setDominantBaseline):
1011         (WebCore::SVGRenderStyle::setBaselineShift):
1012         (WebCore::SVGRenderStyle::setVectorEffect):
1013         (WebCore::SVGRenderStyle::setBufferedRendering):
1014         (WebCore::SVGRenderStyle::setClipRule):
1015         (WebCore::SVGRenderStyle::setColorInterpolation):
1016         (WebCore::SVGRenderStyle::setColorInterpolationFilters):
1017         (WebCore::SVGRenderStyle::setColorRendering):
1018         (WebCore::SVGRenderStyle::setFillRule):
1019         (WebCore::SVGRenderStyle::setShapeRendering):
1020         (WebCore::SVGRenderStyle::setTextAnchor):
1021         (WebCore::SVGRenderStyle::setGlyphOrientationHorizontal):
1022         (WebCore::SVGRenderStyle::setGlyphOrientationVertical):
1023         (WebCore::SVGRenderStyle::setMaskType):
1024         (WebCore::SVGRenderStyle::alignmentBaseline const):
1025         (WebCore::SVGRenderStyle::dominantBaseline const):
1026         (WebCore::SVGRenderStyle::baselineShift const):
1027         (WebCore::SVGRenderStyle::vectorEffect const):
1028         (WebCore::SVGRenderStyle::bufferedRendering const):
1029         (WebCore::SVGRenderStyle::clipRule const):
1030         (WebCore::SVGRenderStyle::colorInterpolation const):
1031         (WebCore::SVGRenderStyle::colorInterpolationFilters const):
1032         (WebCore::SVGRenderStyle::colorRendering const):
1033         (WebCore::SVGRenderStyle::fillRule const):
1034         (WebCore::SVGRenderStyle::shapeRendering const):
1035         (WebCore::SVGRenderStyle::textAnchor const):
1036         (WebCore::SVGRenderStyle::glyphOrientationHorizontal const):
1037         (WebCore::SVGRenderStyle::glyphOrientationVertical const):
1038         (WebCore::SVGRenderStyle::fillPaintType const):
1039         (WebCore::SVGRenderStyle::strokePaintType const):
1040         (WebCore::SVGRenderStyle::maskType const):
1041         (WebCore::SVGRenderStyle::visitedLinkFillPaintType const):
1042         (WebCore::SVGRenderStyle::visitedLinkStrokePaintType const):
1043         (WebCore::SVGRenderStyle::hasStroke const):
1044         (WebCore::SVGRenderStyle::hasFill const):
1045         (WebCore::SVGRenderStyle::setBitDefaults):
1046         * rendering/style/SVGRenderStyleDefs.h:
1047         (WebCore::StyleFillData::create):
1048         (WebCore::StyleFillData::operator!= const):
1049         (WebCore::StyleStrokeData::create):
1050         (WebCore::StyleStrokeData::operator!= const):
1051         (WebCore::StyleStopData::create):
1052         (WebCore::StyleStopData::operator!= const):
1053         (WebCore::StyleTextData::create):
1054         (WebCore::StyleTextData::operator!= const):
1055         (WebCore::StyleMiscData::create):
1056         (WebCore::StyleMiscData::operator!= const):
1057         (WebCore::StyleShadowSVGData::create):
1058         (WebCore::StyleShadowSVGData::operator!= const):
1059         (WebCore::StyleResourceData::create):
1060         (WebCore::StyleResourceData::operator!= const):
1061         (WebCore::StyleInheritedResourceData::create):
1062         (WebCore::StyleInheritedResourceData::operator!= const):
1063         (WebCore::StyleLayoutData::create):
1064         (WebCore::StyleLayoutData::operator!= const):
1065         (): Deleted.
1066         * rendering/svg/RenderSVGImage.cpp:
1067         (WebCore::RenderSVGImage::paint):
1068         * rendering/svg/RenderSVGRect.cpp:
1069         (WebCore::RenderSVGRect::updateShapeFromElement):
1070         * rendering/svg/RenderSVGResource.cpp:
1071         (WebCore::requestPaintingResource):
1072         * rendering/svg/RenderSVGResourceClipper.cpp:
1073         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
1074         * rendering/svg/RenderSVGResourceFilter.cpp:
1075         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
1076         * rendering/svg/RenderSVGResourceGradient.cpp:
1077         (WebCore::RenderSVGResourceGradient::applyResource):
1078         * rendering/svg/RenderSVGResourceMasker.cpp:
1079         (WebCore::RenderSVGResourceMasker::applyResource):
1080         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
1081         * rendering/svg/RenderSVGResourcePattern.cpp:
1082         (WebCore::RenderSVGResourcePattern::applyResource):
1083         * rendering/svg/RenderSVGShape.cpp:
1084         (WebCore::RenderSVGShape::paint):
1085         * rendering/svg/RenderSVGShape.h:
1086         (WebCore::RenderSVGShape::hasNonScalingStroke const):
1087         * rendering/svg/SVGRenderTreeAsText.cpp:
1088         (WebCore::writeStyle):
1089         (WebCore::writeSVGInlineTextBox):
1090         * rendering/svg/SVGResources.cpp:
1091         (WebCore::paintingResourceFromSVGPaint):
1092         * rendering/svg/SVGTextChunk.cpp:
1093         (WebCore::SVGTextChunk::SVGTextChunk):
1094         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
1095         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
1096         (WebCore::SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline const):
1097         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
1098         (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
1099         * rendering/svg/SVGTextLayoutEngineBaseline.h:
1100
1101 2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1102
1103         [Web Animations] Test webanimations/css-animations.html is crashing
1104         https://bugs.webkit.org/show_bug.cgi?id=186031
1105
1106         Reviewed by Antoine Quint.
1107
1108         This is another case of std::optional value being used while it's nullopt, I guess this started to fail when we
1109         stopped using the WTF implementation of std::optional. The problem is that we try to get the current iteration
1110         of a declarative animation when the active time is unresolved.
1111
1112         * animation/DeclarativeAnimation.cpp:
1113         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Use value_or(0) instead of value() to get the current
1114         iteration of the effect.
1115
1116 2018-05-28  Thibault Saunier  <tsaunier@igalia.com>
1117
1118         [GStreamer] Handle changes in the "drm-preferred-decryption-system-id" NEED_CONTEXT message.
1119         https://bugs.webkit.org/show_bug.cgi?id=185948
1120
1121         Reviewed by Xabier Rodriguez-Calvar.
1122
1123         - The "stream-encryption-systems" field of the "drm-preferred-decryption-system-id" query was renamed to
1124           "avalaible-stream-encryption-systems"
1125         - It can now be NULL, meaning there is no decryptor avalaible.
1126
1127         Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
1128
1129         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1130         (WebCore::extractEventsAndSystemsFromMessage): Handle NULL value for "avalaible-stream-encryption-systems",
1131         moved some code to make the order of the Arrays in the pair clearer.
1132
1133 2018-05-27  Dan Bernstein  <mitz@apple.com>
1134
1135         Reverted the changes made for https://webkit.org/b/186016
1136
1137         They broke the USE(APPLE_INTERNAL_SDK) Sierra build.
1138
1139 2018-05-27  David Kilzer  <ddkilzer@apple.com>
1140
1141         [iOS] Fix warnings about leaks found by clang static analyzer
1142         <https://webkit.org/b/186009>
1143         <rdar://problem/40574267>
1144
1145         Reviewed by Daniel Bates.
1146
1147         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
1148         (WebCore::LocalAuthenticator::makeCredential):
1149         (WebCore::LocalAuthenticator::getAssertion):
1150         (WebCore::LocalAuthenticator::issueClientCertificate const):
1151         - Don't leak CF objects in early return paths, and get rid of
1152           `retained*` variables, by making original variables use
1153           RetainPtr<>.
1154         * bridge/objc/WebScriptObject.mm:
1155         (+[WebUndefined allocWithZone:]): Modernize WebUndefined by
1156         using NeverDestroyed<RetainPr<WebUndefined>> type.  Explicitly
1157         retain the object returned on each call.
1158         (+[WebUndefined undefined]): Explicitly autorelease the object
1159         returned.  Note that neither of these changes fixes the static
1160         analyzer warnings in this source file.
1161         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1162         (WebCore::exernalDeviceDisplayNameForPlayer): Use RetainPtr<> to
1163         stop leaking NSString objects in a loop.
1164         * platform/ios/wak/WAKWindow.h:
1165         (-[WAKWindow _newFirstResponderAfterResigning]): Mark as
1166         NS_RETURNS_NOT_RETAINED like the corresponding AppKit method
1167         since this doesn't return a new object.  This fixes some
1168         false-positive leaks warnings.
1169
1170 2018-05-27  Dan Bernstein  <mitz@apple.com>
1171
1172         [Cocoa] Avoid importing directly from subumbrella frameworks
1173         https://bugs.webkit.org/show_bug.cgi?id=186016
1174
1175         Reviewed by Sam Weinig.
1176
1177         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
1178           OTHER_CPLUSPLUSFLAGS.
1179         * editing/mac/DictionaryLookup.mm: Import Quartz.h instead of a PDFKit header.
1180         * html/HTMLKeygenElement.cpp: Removed "using namespace WebCore" from this WebCore
1181           implementation file.
1182         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
1183         * platform/mac/PlatformScreenMac.mm: Import ApplicationServices.h instead of ColorSync.h
1184           when using SDKs earlier than 10.13.
1185         * platform/mediastream/CaptureDeviceManager.cpp: Enclosed the definitions in the WebCore
1186           namespace and removed "using namespace WebCore" from this WebCore implementation file.
1187         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
1188
1189 2018-05-27  Fujii Hironori  <Hironori.Fujii@sony.com>
1190
1191         REGRESSION(r232198) [WinCairo] cannot convert from 'WTF::StringView' to 'const WTF::String'
1192         https://bugs.webkit.org/show_bug.cgi?id=186027
1193
1194         Unreviewed build fix
1195
1196         No new tests (No behavior change).
1197
1198         * platform/network/curl/AuthenticationChallengeCurl.cpp:
1199         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
1200         * platform/network/curl/CurlRequest.cpp:
1201         (WebCore::CurlRequest::setupTransfer):
1202         (WebCore::CurlRequest::willSetupSslCtx):
1203
1204 2018-05-27  Sam Weinig  <sam@webkit.org>
1205
1206         Modernize RenderStyleConstants.h - Part 3
1207         https://bugs.webkit.org/show_bug.cgi?id=186015
1208
1209         Reviewed by Yusuke Suzuki.
1210
1211         Modernized the third and final set of enums in RenderStyleConstants.h by:
1212             - Converting them to enum classes
1213             - Renaming them to remove unnecessary prefix 'E's
1214             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
1215
1216         Modernizes the following enums:
1217             TextDecoration
1218             TextDecorationSkip (renamed from TextDecorationSkipItems)
1219             TextUnderlinePosition
1220             HangingPunctuation
1221             SpeakAs (renamed from ESpeakAs)
1222             TextEmphasisPosition (renamed from TextEmphasisPositions)
1223
1224         This final set of enums are mostly (TextUnderlinePosition isn't really) used as bitmasks,
1225         so this change also converts their uses to use OptionSet. 
1226
1227         * accessibility/AccessibilityObject.h:
1228         (WebCore::AccessibilityObject::speakAsProperty const):
1229         * accessibility/AccessibilityRenderObject.cpp:
1230         (WebCore::AccessibilityRenderObject::speakAsProperty const):
1231         (WebCore::AccessibilityRenderObject::hasPlainText const):
1232         (WebCore::AccessibilityRenderObject::hasUnderline const):
1233         * accessibility/AccessibilityRenderObject.h:
1234         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1235         (AXAttributeStringSetStyle):
1236         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1237         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
1238         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1239         (AXAttributeStringSetStyle):
1240         * css/CSSComputedStyleDeclaration.cpp:
1241         (WebCore::renderTextDecorationFlagsToCSSValue):
1242         (WebCore::renderTextDecorationSkipFlagsToCSSValue):
1243         (WebCore::renderEmphasisPositionFlagsToCSSValue):
1244         (WebCore::speakAsToCSSValue):
1245         (WebCore::hangingPunctuationToCSSValue):
1246         * css/CSSLineBoxContainValue.h:
1247         * css/CSSPrimitiveValueMappings.h:
1248         (WebCore::CSSPrimitiveValue::operator HangingPunctuation const):
1249         (WebCore::CSSPrimitiveValue::operator TextDecoration const):
1250         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1251         (WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
1252         (WebCore::CSSPrimitiveValue::operator SpeakAs const):
1253         (WebCore::CSSPrimitiveValue::operator ESpeakAs const): Deleted.
1254         * css/StyleBuilderConverter.h:
1255         (WebCore::StyleBuilderConverter::convertTextDecoration):
1256         (WebCore::StyleBuilderConverter::valueToEmphasisPosition):
1257         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
1258         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
1259         (WebCore::StyleBuilderConverter::valueToDecorationSkip):
1260         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
1261         (WebCore::StyleBuilderConverter::convertSpeakAs):
1262         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
1263         * editing/cocoa/EditorCocoa.mm:
1264         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const):
1265         * editing/cocoa/HTMLConverter.mm:
1266         (WebCore::editingAttributedStringFromRange):
1267         * rendering/InlineFlowBox.cpp:
1268         (WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine const):
1269         (WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine const):
1270         * rendering/InlineFlowBox.h:
1271         * rendering/InlineTextBox.cpp:
1272         (WebCore::emphasisPositionHasNeitherLeftNorRight):
1273         (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
1274         (WebCore::InlineTextBox::paint):
1275         (WebCore::InlineTextBox::paintMarkedTextDecoration):
1276         * rendering/RenderBlockFlow.cpp:
1277         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
1278         * rendering/RenderBlockLineLayout.cpp:
1279         (WebCore::setLogicalWidthForTextRun):
1280         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1281         * rendering/RenderElement.cpp:
1282         (WebCore::RenderElement::enclosingRendererWithTextDecoration const):
1283         * rendering/RenderElement.h:
1284         * rendering/RenderTableSection.cpp:
1285         (WebCore::RenderTableSection::addCell):
1286         * rendering/SimpleLineLayout.cpp:
1287         (WebCore::SimpleLineLayout::canUseForStyle):
1288         (WebCore::SimpleLineLayout::canUseForWithReason):
1289         * rendering/SimpleLineLayoutFunctions.cpp:
1290         (WebCore::SimpleLineLayout::paintFlow):
1291         * rendering/TextDecorationPainter.cpp:
1292         (WebCore::TextDecorationPainter::TextDecorationPainter):
1293         (WebCore::TextDecorationPainter::paintTextDecoration):
1294         (WebCore::collectStylesForRenderer):
1295         (WebCore::TextDecorationPainter::stylesForRenderer):
1296         * rendering/TextDecorationPainter.h:
1297         * rendering/TextPaintStyle.cpp:
1298         (WebCore::computeTextPaintStyle):
1299         * rendering/line/BreakingContext.h:
1300         (WebCore::BreakingContext::handleText):
1301         * rendering/style/RenderStyle.cpp:
1302         (WebCore::RenderStyle::RenderStyle):
1303         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
1304         * rendering/style/RenderStyle.h:
1305         (WebCore::RenderStyle::textDecorationsInEffect const):
1306         (WebCore::RenderStyle::textDecoration const):
1307         (WebCore::RenderStyle::textDecorationSkip const):
1308         (WebCore::RenderStyle::hangingPunctuation const):
1309         (WebCore::RenderStyle::textEmphasisPosition const):
1310         (WebCore::RenderStyle::speakAs const):
1311         (WebCore::RenderStyle::addToTextDecorationsInEffect):
1312         (WebCore::RenderStyle::setTextDecorationsInEffect):
1313         (WebCore::RenderStyle::setTextDecoration):
1314         (WebCore::RenderStyle::setTextDecorationSkip):
1315         (WebCore::RenderStyle::setSpeakAs):
1316         (WebCore::RenderStyle::setTextEmphasisPosition):
1317         (WebCore::RenderStyle::setHangingPunctuation):
1318         (WebCore::RenderStyle::initialHangingPunctuation):
1319         (WebCore::RenderStyle::initialTextDecoration):
1320         (WebCore::RenderStyle::initialTextDecorationSkip):
1321         (WebCore::RenderStyle::initialTextUnderlinePosition):
1322         (WebCore::RenderStyle::initialSpeakAs):
1323         (WebCore::RenderStyle::initialTextEmphasisPosition):
1324         * rendering/style/RenderStyleConstants.h:
1325         (WebCore::operator|): Deleted.
1326         (WebCore::operator|=): Deleted.
1327         * rendering/style/StyleRareInheritedData.cpp:
1328         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1329         * rendering/style/StyleVisualData.cpp:
1330         (WebCore::StyleVisualData::StyleVisualData):
1331         * rendering/svg/SVGInlineTextBox.cpp:
1332         (WebCore::SVGInlineTextBox::paint):
1333         (WebCore::positionOffsetForDecoration):
1334         (WebCore::thicknessForDecoration):
1335         (WebCore::findRendererDefininingTextDecoration):
1336         (WebCore::SVGInlineTextBox::paintDecoration):
1337         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
1338         * rendering/svg/SVGInlineTextBox.h:
1339         * style/InlineTextBoxStyle.cpp:
1340         (WebCore::computeUnderlineOffset):
1341         (WebCore::visualOverflowForDecorations):
1342
1343 2018-05-26  Zalan Bujtas  <zalan@apple.com>
1344
1345         [LFC] Implement margin computation
1346         https://bugs.webkit.org/show_bug.cgi?id=186008
1347
1348         Reviewed by Antti Koivisto.
1349
1350         * WebCore.xcodeproj/project.pbxproj:
1351         * layout/FormattingContext.cpp:
1352         (WebCore::Layout::FormattingContext::computeMargin const):
1353         (WebCore::Layout::FormattingContext::marginTop const): Deleted.
1354         (WebCore::Layout::FormattingContext::marginLeft const): Deleted.
1355         (WebCore::Layout::FormattingContext::marginBottom const): Deleted.
1356         (WebCore::Layout::FormattingContext::marginRight const): Deleted.
1357         * layout/FormattingContext.h:
1358         * layout/blockformatting/BlockFormattingContext.cpp:
1359         (WebCore::Layout::BlockFormattingContext::layout const):
1360         (WebCore::Layout::BlockFormattingContext::computeMargin const):
1361         (WebCore::Layout::BlockFormattingContext::marginTop const): Deleted.
1362         (WebCore::Layout::BlockFormattingContext::marginBottom const): Deleted.
1363         * layout/blockformatting/BlockFormattingContext.h:
1364         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1365         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight):
1366         (WebCore::Layout::BlockFormattingContext::Geometry::computedMargin):
1367         * layout/blockformatting/BlockMarginCollapse.cpp:
1368         (WebCore::Layout::_isMarginBottomCollapsedWithParent):
1369         (WebCore::Layout::collapsedMarginBottomFromLastChild):
1370         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
1371         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
1372         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
1373         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
1374         (WebCore::Layout::BlockMarginCollapse::marginTop): Deleted.
1375         (WebCore::Layout::BlockMarginCollapse::marginBottom): Deleted.
1376         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
1377         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
1378         * layout/blockformatting/BlockMarginCollapse.h: Removed.
1379
1380 2018-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
1381
1382         [Cocoa] Delete unnecessary WebCascadeList in ComplexTextController
1383         https://bugs.webkit.org/show_bug.cgi?id=186007
1384
1385         Reviewed by Zalan Bujtas.
1386
1387         Inside ComplexTextController::collectComplexTextRuns(), we chop up text based on which fonts should be
1388         used to render which grapheme clusters. For each grapheme cluster, we run through the font-family list
1389         in FontCascade::fontForCombiningCharacterSequence() and find the first font that can render the cluster.
1390         If no items can render the cluster, we construct a WebCascadeList and let CoreText try to figure out
1391         which fonts can render which clusters.
1392
1393         Except there's no point, because we just determined that no font in the list can be used to render the
1394         cluster. CoreText isn't magic; it isn't going to somehow disagree with us. WebCascadeList is just
1395         useless code.
1396
1397         No new tests because there is no behavior change.
1398
1399         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1400         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1401         (-[WebCascadeList initWithFont:character:]): Deleted.
1402         (-[WebCascadeList count]): Deleted.
1403         (-[WebCascadeList objectAtIndex:]): Deleted.
1404
1405 2018-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
1406
1407         Improve the performance of Font::canRenderCombiningCharacterSequence()
1408         https://bugs.webkit.org/show_bug.cgi?id=185933
1409
1410         Reviewed by Ryosuke Niwa.
1411
1412         We don't need to create a whole CTLine just to determine whether or not a font supports rendering a grapheme cluster.
1413         Instead, the right way to do it is just see if the font's cmap table supports every code point in the cluster.
1414
1415         This patch reports a 2% progression on the attached PerformanceTest.
1416
1417         Test: Layout/ComplexLongUnique.html
1418
1419         * platform/graphics/Font.cpp:
1420         (WebCore::Font::canRenderCombiningCharacterSequence const):
1421         * platform/graphics/Font.h:
1422         * platform/graphics/cocoa/FontCocoa.mm:
1423         (WebCore::provideStringAndAttributes): Deleted.
1424         (WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
1425         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1426         (WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
1427
1428 2018-05-25  Eric Carlson  <eric.carlson@apple.com>
1429
1430         Captions are sized incorrectly in PiP mode
1431         https://bugs.webkit.org/show_bug.cgi?id=186005
1432         <rdar://problem/39729718>
1433
1434         Reviewed by Dean Jackson.
1435
1436         * html/shadow/MediaControlElements.cpp:
1437         (WebCore::MediaControlTextTrackContainerElement::updateSizes): Only sync text track bounds 
1438         when the size actually changes.
1439
1440         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
1441         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame): Call syncTextTrackBounds.
1442         (WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds): Set the text track layer size
1443         to m_videoFullscreenFrame, it is always set the size of the PiP/Fullscreen layer.
1444
1445 2018-05-25  Timothy Hatcher  <timothy@apple.com>
1446
1447         Setting drawsBackground to YES on a WKView doesn't take effect immediately
1448         https://bugs.webkit.org/show_bug.cgi?id=185885
1449         rdar://problem/39706506
1450
1451         Reviewed by Simon Fraser.
1452
1453         * page/Frame.cpp:
1454         (WebCore::Frame::createView): Always call updateBackgroundRecursively, it handles
1455         invalid colors correctly already.
1456         * page/FrameView.cpp:
1457         (WebCore::FrameView::setTransparent): Call setNeedsLayout() since base background color
1458         and transparent is used to update layers.
1459         (WebCore::FrameView::setBaseBackgroundColor): Ditto.
1460         (WebCore::FrameView::updateBackgroundRecursively): Schedule layout if needed.
1461         * page/FrameView.h:
1462         * rendering/RenderLayerCompositor.cpp:
1463         (WebCore::RenderLayerCompositor::viewHasTransparentBackground const): Use baseBackgroundColor
1464         instead of hardcoding white.
1465         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): Fixed incorrect changed logging.
1466
1467 2018-05-25  Youenn Fablet  <youenn@apple.com>
1468
1469         Migrate From-Origin to Cross-Origin-Resource-Policy
1470         https://bugs.webkit.org/show_bug.cgi?id=185840
1471
1472         Reviewed by Chris Dumez.
1473
1474         Tests: http/wpt/cross-origin-resource-policy/fetch-in-iframe.html
1475                http/wpt/cross-origin-resource-policy/fetch.html
1476                http/wpt/cross-origin-resource-policy/iframe-loads.html
1477                http/wpt/cross-origin-resource-policy/image-loads.html
1478                http/wpt/cross-origin-resource-policy/script-loads.html
1479
1480         * platform/network/HTTPHeaderNames.in:
1481         * platform/network/HTTPParsers.cpp:
1482         (WebCore::parseCrossOriginResourcePolicyHeader):
1483         * platform/network/HTTPParsers.h:
1484
1485 2018-05-25  Daniel Bates  <dabates@apple.com>
1486
1487         NavigationAction should not hold a strong reference to a Document
1488         https://bugs.webkit.org/show_bug.cgi?id=185712
1489         <rdar://problem/40320916>
1490
1491         Reviewed by Brent Fulgham.
1492
1493         Have NavigationAction store all the relevant details callers need to know about the document
1494         that initiated the navigation in an independent data structure, called NavigationAction::Requester,
1495         as opposed to holding a RefPtr to the document itself. The benefit of this approach is that it
1496         is a step towards ensuring that NavigationAction does not keep the document alive after navigating
1497         to a new document given that DocumentLoader stores the NavigationAction for the last navigation.
1498
1499         * loader/NavigationAction.cpp:
1500         (WebCore::NavigationAction::Requester::Requester): Track all relevant details of the document that
1501         requested this navigation that are needed to support WebKit API/SPI. We hold the SecurityOrigin in
1502         a RefPtr to avoid the need to explicitly define a copy constructor and copy-assignment constructor
1503         because Requester needs to be copyable as NavigationAction, which owns a Requester, is copyable.
1504         (WebCore::shouldTreatAsSameOriginNavigation): Fix some style nits.
1505         (WebCore::NavigationAction::NavigationAction): Instantiate a Requester from the specified document.
1506         * loader/NavigationAction.h:
1507         (WebCore::NavigationAction::Requester::url const): Added.
1508         (WebCore::NavigationAction::Requester::securityOrigin const): Added.
1509         (WebCore::NavigationAction::Requester::pageID const): Added.
1510         (WebCore::NavigationAction::Requester::frameID const): Added.
1511         (WebCore::NavigationAction::requester const): Returns details about the document that requested
1512         this navigation, if applicable.
1513         (WebCore::NavigationAction::isEmpty const): Update criterion for being empty to consider the
1514         requester.
1515         (WebCore::NavigationAction::setOpener): Extracted out the datatype of the parameter into a
1516         type alias to avoid duplication and updated this code to use the alias.
1517         (WebCore::NavigationAction::opener const): Ditto.
1518         (WebCore::NavigationAction::sourceDocument const): Deleted.
1519
1520 2018-05-25  Jeremy Jones  <jeremyj@apple.com>
1521
1522         Fullscreen element can be clipped by ancestor.
1523         https://bugs.webkit.org/show_bug.cgi?id=185980
1524         rdar://problem/40320006
1525
1526         Reviewed by Jer Noble.
1527
1528         Adds style to fullscreen css to prevent the fullscreen element from being clipped by an ancestor element.
1529
1530         * css/fullscreen.css:
1531         (:-webkit-full-screen-ancestor:not(iframe)):
1532
1533 2018-05-25  Jeremy Jones  <jeremyj@apple.com>
1534
1535         Use correct AVKit delegate for picture in picture failure.
1536         https://bugs.webkit.org/show_bug.cgi?id=185981
1537         rdar://problem/40549652
1538
1539         Reviewed by Eric Carlson.
1540
1541         No new tests since we don't have a way to simulate picture-in-picture failure.
1542
1543         Use the new name for this delegate callback.
1544
1545         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1546         (-[WebAVPlayerViewControllerDelegate playerViewController:failedToStartPictureInPictureWithError:]):
1547         (-[WebAVPlayerViewControllerDelegate playerViewControllerFailedToStartPictureInPicture:withError:]): Deleted.
1548
1549 2018-05-25  Zalan Bujtas  <zalan@apple.com>
1550
1551         iBooks: text can disappear/flash during finger drag highlight
1552         https://bugs.webkit.org/show_bug.cgi?id=185993
1553         <rdar://problem/34026943>
1554
1555         Reviewed by Simon Fraser.
1556
1557         Reuse existing tiles when override rect is fully covered by the active grid.
1558         Also, recover dropped tiles if override rect forces us to create new ones. 
1559
1560         Unable to create a reproducible test case.
1561
1562         * platform/ios/LegacyTileCache.h:
1563         * platform/ios/LegacyTileCache.mm:
1564         (WebCore::LegacyTileCache::setOverrideVisibleRect):
1565         * platform/ios/LegacyTileLayer.mm:
1566         (-[LegacyTileHostLayer renderInContext:]):
1567
1568 2018-05-25  Eric Carlson  <eric.carlson@apple.com>
1569
1570         Encode ISOWebVTTCue "strings" when logging
1571         https://bugs.webkit.org/show_bug.cgi?id=185991
1572         <rdar://problem/40563902>
1573
1574         Reviewed by Jer Noble.
1575
1576         * platform/graphics/iso/ISOVTTCue.cpp:
1577         (WebCore::ISOWebVTTCue::toJSONString const): Use encodeWithURLEscapeSequences for all Strings
1578         taken from ISO boxes.
1579
1580 2018-05-25  Alex Christensen  <achristensen@webkit.org>
1581
1582         URL::host should return a StringView to reduce allocations
1583         https://bugs.webkit.org/show_bug.cgi?id=185986
1584
1585         Reviewed by Geoff Garen.
1586
1587         No change in behaviour.  Just fewer allocations.
1588
1589         * Modules/plugins/YouTubePluginReplacement.cpp:
1590         (WebCore::isYouTubeURL):
1591         (WebCore::processAndCreateYouTubeURL):
1592         * Modules/websockets/WebSocketHandshake.cpp:
1593         (WebCore::hostName):
1594         (WebCore::WebSocketHandshake::host const):
1595         * contentextensions/ContentExtension.cpp:
1596         (WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
1597         * html/HTMLAnchorElement.cpp:
1598         (WebCore::HTMLAnchorElement::parseAttribute):
1599         * html/HTMLMediaElement.cpp:
1600         (WebCore::HTMLMediaElement::mediaSessionTitle const):
1601         (WebCore::needsSeekingSupportQuirk):
1602         * html/HTMLPlugInImageElement.cpp:
1603         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
1604         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
1605         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
1606         * html/ImageDocument.cpp:
1607         (WebCore::ImageDocument::finishedParsing):
1608         * html/URLUtils.h:
1609         (WebCore::URLUtils<T>::hostname const):
1610         * loader/FrameLoader.cpp:
1611         (WebCore::FrameLoader::setFirstPartyForCookies):
1612         * loader/LinkLoader.cpp:
1613         (WebCore::LinkLoader::loadLink):
1614         * loader/ResourceLoadStatistics.cpp:
1615         (WebCore::ResourceLoadStatistics::primaryDomain):
1616         * loader/mac/LoaderNSURLExtras.mm:
1617         (suggestedFilenameWithMIMEType):
1618         * page/Chrome.cpp:
1619         (WebCore::Chrome::mouseDidMoveOverElement):
1620         * page/Location.cpp:
1621         (WebCore::Location::hostname const):
1622         * page/Page.cpp:
1623         (WebCore::Page::mainFrameLoadStarted):
1624         * page/PerformanceMonitor.cpp:
1625         (WebCore::reportPageOverPostLoadResourceThreshold):
1626         * page/SecurityOrigin.cpp:
1627         (WebCore::isLoopbackIPAddress):
1628         (WebCore::shouldTreatAsPotentiallyTrustworthy):
1629         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
1630         * page/SecurityOrigin.h:
1631         * page/SecurityOriginData.h:
1632         (WebCore::SecurityOriginData::fromURL):
1633         * page/UserContentURLPattern.cpp:
1634         (WebCore::UserContentURLPattern::matchesHost const):
1635         * page/csp/ContentSecurityPolicySource.cpp:
1636         (WebCore::ContentSecurityPolicySource::hostMatches const):
1637         * platform/PublicSuffix.h:
1638         * platform/URL.cpp:
1639         (WebCore::URL::host const):
1640         (WebCore::URL::hostAndPort const):
1641         (WebCore::URL::isMatchingDomain const):
1642         * platform/URL.h:
1643         * platform/mac/SSLKeyGeneratorMac.mm:
1644         (WebCore::signedPublicKeyAndChallengeString):
1645         * platform/network/ResourceRequestBase.h:
1646         (WebCore::registrableDomainsAreEqual):
1647         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1648         (WebCore::getPartitioningDomain):
1649         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1650         (WebCore::SocketStreamHandleImpl::createStreams):
1651         * workers/WorkerLocation.cpp:
1652         (WebCore::WorkerLocation::hostname const):
1653         * workers/service/server/SWServer.cpp:
1654         (WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):
1655
1656 2018-05-24  Dean Jackson  <dino@apple.com>
1657
1658         Need to provide a way to feature detect support for system preview
1659         https://bugs.webkit.org/show_bug.cgi?id=185970
1660         <rdar://problem/40538321>
1661
1662         Reviewed by Sam Weinig.
1663
1664         Update the supports function in the DOMTokenList that HTMLAnchorElement
1665         produces for relList to return true for the system preview token.
1666
1667         Tested internally.
1668
1669         * html/HTMLAnchorElement.cpp:
1670         (WebCore::HTMLAnchorElement::relList const):
1671
1672 2018-05-25  Chris Dumez  <cdumez@apple.com>
1673
1674         Minor ApplicationCacheStorage clean up
1675         https://bugs.webkit.org/show_bug.cgi?id=185984
1676
1677         Reviewed by Youenn Fablet.
1678
1679         * loader/appcache/ApplicationCacheStorage.cpp:
1680         (WebCore::ApplicationCacheStorage::getManifestURLs):
1681         (WebCore::ApplicationCacheStorage::deleteCacheGroup):
1682         (WebCore::ApplicationCacheStorage::originsWithCache):
1683         (WebCore::ApplicationCacheStorage::deleteAllCaches):
1684         (WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
1685         (WebCore::ApplicationCacheStorage::ApplicationCacheStorage):
1686         (WebCore::ApplicationCacheStorage::cacheDirectory const): Deleted.
1687         (WebCore::ApplicationCacheStorage::cacheGroupSize): Deleted.
1688         (WebCore::ApplicationCacheStorage::getOriginsWithCache): Deleted.
1689         (WebCore::ApplicationCacheStorage::create): Deleted.
1690         * loader/appcache/ApplicationCacheStorage.h:
1691         (WebCore::ApplicationCacheStorage::create):
1692
1693 2018-05-25  Sihui Liu  <sihui_liu@apple.com>
1694
1695         [WKHTTPCookieStore getAllCookies] returns inconsistent creation time
1696         https://bugs.webkit.org/show_bug.cgi?id=185041
1697         <rdar://problem/34684214>
1698
1699         Reviewed by Geoffrey Garen.
1700
1701         Set creationtime property when creating Cookie object to keep consistency after conversion.
1702
1703         New API test: WebKit.WKHTTPCookieStoreCreationTime.
1704
1705         * platform/network/cocoa/CookieCocoa.mm:
1706         (WebCore::Cookie::operator NSHTTPCookie * const):
1707
1708 2018-05-25  Zalan Bujtas  <zalan@apple.com>
1709
1710         [LFC] Implement border and padding computation
1711         https://bugs.webkit.org/show_bug.cgi?id=185972
1712
1713         Reviewed by Antti Koivisto.
1714
1715         This patch also removes redundant Display::Box methods and adds a lightweight Edge struct.
1716         (Since padding is optional, if during layout we mistakenly try to access paddingTop/Left/Bottom/Right, Display::Box will assert!)
1717
1718         * layout/FormattingContext.cpp:
1719         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
1720         * layout/FormattingContext.h:
1721         * layout/FormattingContextGeometry.cpp:
1722         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
1723         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
1724         * layout/blockformatting/BlockFormattingContext.cpp:
1725         (WebCore::Layout::BlockFormattingContext::layout const):
1726         * layout/displaytree/DisplayBox.cpp:
1727         (WebCore::Display::Box::marginBox const):
1728         (WebCore::Display::Box::paddingBox const):
1729         (WebCore::Display::Box::contentBox const):
1730         * layout/displaytree/DisplayBox.h:
1731         (WebCore::Display::Box::Edges::Edges):
1732         (WebCore::Display::Box::setHasValidPosition):
1733         (WebCore::Display::Box::setWidth):
1734         (WebCore::Display::Box::setHeight):
1735         (WebCore::Display::Box::setMargin):
1736         (WebCore::Display::Box::setBorder):
1737         (WebCore::Display::Box::setPadding):
1738         (WebCore::Display::Box::marginTop const):
1739         (WebCore::Display::Box::marginLeft const):
1740         (WebCore::Display::Box::marginBottom const):
1741         (WebCore::Display::Box::marginRight const):
1742         (WebCore::Display::Box::paddingTop const):
1743         (WebCore::Display::Box::paddingLeft const):
1744         (WebCore::Display::Box::paddingBottom const):
1745         (WebCore::Display::Box::paddingRight const):
1746         (WebCore::Display::Box::borderTop const):
1747         (WebCore::Display::Box::borderLeft const):
1748         (WebCore::Display::Box::borderBottom const):
1749         (WebCore::Display::Box::borderRight const):
1750         (WebCore::Display::Box::invalidateSize): Deleted.
1751         (WebCore::Display::Box::setHasValidSize): Deleted.
1752         (WebCore::Display::Box::setHasValidGeometry): Deleted.
1753         (WebCore::Display::Box::setRect): Deleted.
1754         (WebCore::Display::Box::setSize): Deleted.
1755         * layout/layouttree/LayoutBox.cpp:
1756         (WebCore::Layout::Box::isPaddingEnabled const):
1757         * layout/layouttree/LayoutBox.h:
1758
1759 2018-05-25  David Kilzer  <ddkilzer@apple.com>
1760
1761         Fix issues with -dealloc methods found by clang static analyzer
1762         <https://webkit.org/b/185887>
1763
1764         Reviewed by Joseph Pecoraro.
1765
1766         * platform/ios/WebAVPlayerController.mm:
1767         (-[WebAVPlayerController dealloc]): Release `_minTiming` and
1768         `_maxTiming` to fix leaks.
1769         * platform/ios/WebBackgroundTaskController.mm:
1770         (-[WebBackgroundTaskController dealloc]): Release
1771         `_backgroundTaskStartBlock` and `_backgroundTaskEndBlock` to fix
1772         leaks.
1773         * platform/ios/WebItemProviderPasteboard.mm:
1774         (-[WebItemProviderRegistrationInfoList dealloc]): Release
1775         `_teamData` to fix leak.
1776
1777 2018-05-25  Antoine Quint  <graouts@apple.com>
1778
1779         [Web Animations] WebAnimation objects never get destroyed
1780         https://bugs.webkit.org/show_bug.cgi?id=185917
1781         <rdar://problem/39539371>
1782
1783         Reviewed by Dean Jackson and Antti Koivisto.
1784
1785         The AnimationTimeline class keeps references to WebAnimation objects organized in various ways. First, there
1786         are three main maps across which all animations are stored, one for non-subclass WebAnimation objects
1787         (m_elementToAnimationsMap), one for CSSSAnimation objects (m_elementToCSSAnimationsMap) and one for CSSTranstion
1788         objects (m_elementToCSSTransitionsMap). On top of that, we also keep a map to access CSSAnimation objects for
1789         a given element by CSS animation name (m_elementToCSSAnimationByName) and another map to access CSSTransition 
1790         objects for a given element by CSS property (m_elementToCSSTransitionByCSSPropertyID).
1791
1792         None of the RefPtr<WebAnimation> stored in these maps would get cleared when the document would get torn down,
1793         which would also prevent the AnimationTimeline (and its DocumentTimeline subclass) from being destroyed.
1794
1795         We now ensure that element and document tear-down correctly removes animations and clears those maps, which
1796         in turn allows the DocumentTimeline to be destroyed, fixing the significant memory leak introduced by Web Animations
1797         so far.
1798
1799         Finally, we change the collection type for those maps to be ListHashRef instead of Vector to guarantee we only
1800         add an animation once per collection due to changes in how setEffect() and setTimeline() operate.
1801
1802         Test: animations/leak-document-with-css-animation.html
1803
1804         * animation/AnimationTimeline.cpp:
1805         (WebCore::AnimationTimeline::~AnimationTimeline): There is no need to clear those tables as they'll need to be empty
1806         for the AnimationTimeline to even be destroyed.
1807         (WebCore::AnimationTimeline::relevantMapForAnimation): Change to use ListHashRef instead of Vector.
1808         (WebCore::AnimationTimeline::animationWasAddedToElement): Change to use ListHashRef instead of Vector.
1809         (WebCore::AnimationTimeline::animationWasRemovedFromElement): When an animation is removed from an element, ensure that
1810         references to this animation stored in the m_elementToCSSAnimationByName and m_elementToCSSTransitionByCSSPropertyID maps
1811         are cleared.
1812         (WebCore::AnimationTimeline::animationsForElement const): Change to use ListHashRef instead of Vector.
1813         (WebCore::AnimationTimeline::removeAnimationsForElement): Instead of just calling cancel() on all known declarative animations
1814         (this method used to be called cancelDeclarativeAnimationsForElement()), we now set the effect of known animations, declarative
1815         or not, for the provided element which will in turn call animationWasRemovedFromElement() and remove the animation from all
1816         maps that might keep a reference to it.
1817         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Replace call to removeDeclarativeAnimation() with a simple call
1818         to removeAnimation() which will remove references for this animation from the relevant maps.
1819         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Ditto.
1820         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement): Deleted.
1821         (WebCore::AnimationTimeline::removeDeclarativeAnimation): Deleted.
1822         * animation/AnimationTimeline.h:
1823         (WebCore::AnimationTimeline::elementToAnimationsMap): Change to use ListHashRef instead of Vector.
1824         (WebCore::AnimationTimeline::elementToCSSAnimationsMap): Change to use ListHashRef instead of Vector.
1825         (WebCore::AnimationTimeline::elementToCSSTransitionsMap): Change to use ListHashRef instead of Vector.
1826         * animation/WebAnimation.cpp:
1827         (WebCore::WebAnimation::setEffect): In the case of a declarative animation, we don't want to remove the animation from the relevant
1828         maps because while the effect was set via the API, the element still has a transition or animation set up and we must not break the
1829         timeline-to-animation relationship.
1830         (WebCore::WebAnimation::setEffectInternal): Factor parts of setEffect() out into a new method that can be called from
1831         AnimationTimeline::removeAnimationsForElement() to reset the m_effect member and correctly call animationWasRemovedFromElement()
1832         without all the Web Animations machinery of setEffect(), which is a public API that has unwanted side effects (such as rejecting
1833         promises).
1834         (WebCore::WebAnimation::setTimeline): In the case of a declarative animation, we don't want to remove the animation from the
1835         relevant maps because, while the timeline was set via the API, the element still has a transition or animation set up and we must
1836         not break the relationship.
1837         * animation/DocumentTimeline.cpp:
1838         (WebCore::DocumentTimeline::~DocumentTimeline):
1839         (WebCore::DocumentTimeline::detachFromDocument): Close the GenericTaskQueues when detaching from the document as it's too late to
1840         perform this work in the destructor. We also cancel the schedule timer which we had forgotten to do before.
1841         * animation/WebAnimation.h:
1842         * dom/Document.cpp:
1843         (WebCore::Document::prepareForDestruction):
1844         * dom/Element.cpp:
1845         (WebCore::Element::removedFromAncestor):
1846         * dom/PseudoElement.cpp:
1847         (WebCore::PseudoElement::clearHostElement):
1848         * rendering/updating/RenderTreeUpdater.cpp:
1849         (WebCore::RenderTreeUpdater::tearDownRenderers):
1850
1851 2018-05-24  Chris Dumez  <cdumez@apple.com>
1852
1853         Avoid doing unnecessary work in Document::shouldEnforceContentDispositionAttachmentSandbox() when setting is disabled
1854         https://bugs.webkit.org/show_bug.cgi?id=185964
1855
1856         Reviewed by Geoffrey Garen.
1857
1858         * dom/Document.cpp:
1859         (WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox const):
1860
1861 2018-05-24  Chris Dumez  <cdumez@apple.com>
1862
1863         [iOS] Avoid dlopening QuickLooks in the common case where the main resource is HTML or plain text
1864         https://bugs.webkit.org/show_bug.cgi?id=185966
1865
1866         Reviewed by Geoffrey Garen.
1867
1868         Avoid dlopening QuickLooks in the common case where the main resource is HTML or plain text
1869         for performance reasons.
1870
1871         * loader/ios/PreviewLoader.mm:
1872         (WebCore::PreviewLoader::shouldCreateForMIMEType):
1873
1874 2018-05-24  Sam Weinig  <sam@webkit.org>
1875
1876         Modernize RenderStyleConstants.h - Part 2
1877         https://bugs.webkit.org/show_bug.cgi?id=185901
1878
1879         Reviewed by Simon Fraser.
1880
1881         Modernized the second set of enums in RenderStyleConstants.h by:
1882             - Converting them to enum classes
1883             - Renaming them to remove unnecessary prefix 'E's
1884             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
1885             - Renaming to match modern conventions (e.g BNONE -> None)
1886             - Reformatting them so that each value is on its own line.
1887
1888         Modernizes the following enums:
1889             PseudoId
1890             ListStyleType (renamed from EListStyleType)
1891             BorderFit (renamed from EBorderFit)
1892             AnimationFillMode (renamed from EAnimationFillMode)
1893             AnimationPlayState (renamed from EAnimPlayState)
1894             WhiteSpace (renamed from EWhiteSpace)
1895             TextAlignMode (renamed from ETextAlign)
1896             TextTransform (renamed from ETextTransform)
1897             TextDecorationStyle
1898             TextAlignLast
1899             TextJustify
1900             TextZoom
1901             BreakBetween
1902             BreakInside
1903             EmptyCell (renamed from EEmptyCell)
1904             CaptionSide (renamed from ECaptionSide)
1905             ListStylePosition (renamed from EListStylePosition)
1906             Visibility (renamed from EVisibility)
1907             CursorType (renamed from ECursor)
1908             CursorVisibility
1909             DisplayType (renamed from EDisplay)
1910             InsideLink (renamed from EInsideLink)
1911             PointerEvents (renamed from EPointerEvents)
1912             Hyphens
1913             TextEmphasisFill
1914             TextEmphasisMark
1915             ImageResolutionSource
1916             ImageResolutionSnap
1917             Order
1918             ColumnAxis
1919             ColumnProgression
1920             LineSnap
1921             LineAlign
1922             RubyPosition
1923             AutoRepeatType
1924             CSSBoxType
1925
1926         * accessibility/AXObjectCache.cpp:
1927         (WebCore::AXObjectCache::isNodeVisible const):
1928         * accessibility/AccessibilityList.cpp:
1929         (WebCore::AccessibilityList::determineAccessibilityRole):
1930         * accessibility/AccessibilityMediaControls.cpp:
1931         (WebCore::AccessibilityMediaControl::computeAccessibilityIsIgnored const):
1932         (WebCore::AccessibilityMediaTimeDisplay::computeAccessibilityIsIgnored const):
1933         * accessibility/AccessibilityObject.cpp:
1934         (WebCore::AccessibilityObject::isDOMHidden const):
1935         * accessibility/AccessibilityRenderObject.cpp:
1936         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
1937         (WebCore::AccessibilityRenderObject::isUnvisited const):
1938         (WebCore::AccessibilityRenderObject::isVisited const):
1939         (WebCore::AccessibilityRenderObject::setValue):
1940         * accessibility/AccessibilityTable.cpp:
1941         (WebCore::AccessibilityTable::isDataTable const):
1942         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1943         (getAttributeSetForAccessibilityObject):
1944         * animation/AnimationTimeline.cpp:
1945         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
1946         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
1947         * animation/CSSAnimation.cpp:
1948         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
1949         * animation/DeclarativeAnimation.cpp:
1950         (WebCore::DeclarativeAnimation::initialize):
1951         * animation/KeyframeEffectReadOnly.cpp:
1952         (WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const):
1953         * css/CSSComputedStyleDeclaration.cpp:
1954         (WebCore::renderTextDecorationStyleFlagsToCSSValue):
1955         (WebCore::convertToPageBreak):
1956         (WebCore::convertToColumnBreak):
1957         (WebCore::ComputedStyleExtractor::styledElement const):
1958         (WebCore::ComputedStyleExtractor::styledRenderer const):
1959         (WebCore::computeRenderStyleForProperty):
1960         (WebCore::shapePropertyValue):
1961         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1962         * css/CSSComputedStyleDeclaration.h:
1963         * css/CSSPrimitiveValueMappings.h:
1964         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1965         (WebCore::CSSPrimitiveValue::operator CaptionSide const):
1966         (WebCore::CSSPrimitiveValue::operator CursorType const):
1967         (WebCore::CSSPrimitiveValue::operator CursorVisibility const):
1968         (WebCore::CSSPrimitiveValue::operator DisplayType const):
1969         (WebCore::CSSPrimitiveValue::operator EmptyCell const):
1970         (WebCore::CSSPrimitiveValue::operator ListStylePosition const):
1971         (WebCore::CSSPrimitiveValue::operator ListStyleType const):
1972         (WebCore::CSSPrimitiveValue::operator BreakBetween const):
1973         (WebCore::CSSPrimitiveValue::operator BreakInside const):
1974         (WebCore::CSSPrimitiveValue::operator TextAlignMode const):
1975         (WebCore::CSSPrimitiveValue::operator TextAlignLast const):
1976         (WebCore::CSSPrimitiveValue::operator TextJustify const):
1977         (WebCore::CSSPrimitiveValue::operator TextDecorationStyle const):
1978         (WebCore::CSSPrimitiveValue::operator TextTransform const):
1979         (WebCore::CSSPrimitiveValue::operator Visibility const):
1980         (WebCore::CSSPrimitiveValue::operator WhiteSpace const):
1981         (WebCore::CSSPrimitiveValue::operator RubyPosition const):
1982         (WebCore::CSSPrimitiveValue::operator TextEmphasisFill const):
1983         (WebCore::CSSPrimitiveValue::operator TextEmphasisMark const):
1984         (WebCore::CSSPrimitiveValue::operator PointerEvents const):
1985         (WebCore::CSSPrimitiveValue::operator Hyphens const):
1986         (WebCore::CSSPrimitiveValue::operator LineSnap const):
1987         (WebCore::CSSPrimitiveValue::operator LineAlign const):
1988         (WebCore::CSSPrimitiveValue::operator Order const):
1989         (WebCore::CSSPrimitiveValue::operator BorderFit const):
1990         (WebCore::CSSPrimitiveValue::operator ColumnAxis const):
1991         (WebCore::CSSPrimitiveValue::operator ColumnProgression const):
1992         (WebCore::CSSPrimitiveValue::operator CSSBoxType const):
1993         (WebCore::CSSPrimitiveValue::operator TextZoom const):
1994         (WebCore::CSSPrimitiveValue::operator ECaptionSide const): Deleted.
1995         (WebCore::CSSPrimitiveValue::operator ECursor const): Deleted.
1996         (WebCore::CSSPrimitiveValue::operator EDisplay const): Deleted.
1997         (WebCore::CSSPrimitiveValue::operator EEmptyCell const): Deleted.
1998         (WebCore::CSSPrimitiveValue::operator EListStylePosition const): Deleted.
1999         (WebCore::CSSPrimitiveValue::operator EListStyleType const): Deleted.
2000         (WebCore::CSSPrimitiveValue::operator ETextAlign const): Deleted.
2001         (WebCore::CSSPrimitiveValue::operator ETextTransform const): Deleted.
2002         (WebCore::CSSPrimitiveValue::operator EVisibility const): Deleted.
2003         (WebCore::CSSPrimitiveValue::operator EWhiteSpace const): Deleted.
2004         (WebCore::CSSPrimitiveValue::operator EPointerEvents const): Deleted.
2005         (WebCore::CSSPrimitiveValue::operator EBorderFit const): Deleted.
2006         * css/CSSSelector.cpp:
2007         (WebCore::CSSSelector::pseudoId):
2008         * css/CSSToStyleMap.cpp:
2009         (WebCore::CSSToStyleMap::mapAnimationFillMode):
2010         (WebCore::CSSToStyleMap::mapAnimationPlayState):
2011         * css/CSSValueKeywords.in:
2012         * css/ElementRuleCollector.cpp:
2013         (WebCore::ElementRuleCollector::collectMatchingRules):
2014         (WebCore::ElementRuleCollector::ruleMatches):
2015         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
2016         * css/ElementRuleCollector.h:
2017         * css/SelectorChecker.cpp:
2018         (WebCore::SelectorChecker::match const):
2019         (WebCore::SelectorChecker::matchHostPseudoClass const):
2020         (WebCore::hasScrollbarPseudoElement):
2021         (WebCore::SelectorChecker::matchRecursively const):
2022         * css/SelectorChecker.h:
2023         * css/StyleBuilderConverter.h:
2024         (WebCore::StyleBuilderConverter::convertTextAlign):
2025         (WebCore::StyleBuilderConverter::convertClipPath):
2026         (WebCore::StyleBuilderConverter::convertShapeValue):
2027         (WebCore::StyleBuilderConverter::createGridTrackList):
2028         (WebCore::StyleBuilderConverter::csstoLengthConversionDataWithTextZoomFactor):
2029         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
2030         (WebCore::StyleBuilderConverter::convertPageBreakInside):
2031         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
2032         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
2033         * css/StyleBuilderCustom.h:
2034         (WebCore::StyleBuilderCustom::applyValueImageResolution):
2035         (WebCore::computeBaseSpecifiedFontSize):
2036         (WebCore::StyleBuilderCustom::applyValueWebkitTextZoom):
2037         (WebCore::StyleBuilderCustom::isValidDisplayValue):
2038         (WebCore::StyleBuilderCustom::applyInheritDisplay):
2039         (WebCore::StyleBuilderCustom::applyValueDisplay):
2040         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
2041         (WebCore::StyleBuilderCustom::applyValueCursor):
2042         (WebCore::StyleBuilderCustom::applyValueContent):
2043         (WebCore::StyleBuilderCustom::determineRubyTextSizeMultiplier):
2044         (WebCore::StyleBuilderCustom::applyValueAlt):
2045         * css/StyleResolver.cpp:
2046         (WebCore::StyleResolver::styleForElement):
2047         (WebCore::equivalentBlockDisplay):
2048         (WebCore::doesNotInheritTextDecoration):
2049         (WebCore::StyleResolver::adjustStyleForInterCharacterRuby):
2050         (WebCore::adjustDisplayContentsStyle):
2051         (WebCore::StyleResolver::adjustSVGElementStyle):
2052         (WebCore::StyleResolver::adjustRenderStyle):
2053         (WebCore::StyleResolver::styleRulesForElement):
2054         (WebCore::isCacheableInMatchedPropertiesCache):
2055         (WebCore::StyleResolver::applyMatchedProperties):
2056         (WebCore::StyleResolver::CascadedProperties::Property::apply):
2057         * css/StyleResolver.h:
2058         (WebCore::StyleResolver::State::elementLinkState const):
2059         * cssjit/SelectorCompiler.cpp:
2060         (WebCore::SelectorCompiler::constructFragmentsInternal):
2061         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
2062         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateMarkPseudoStyleForPseudoElement):
2063         * dom/Document.cpp:
2064         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
2065         (WebCore::Document::isPageBoxVisible):
2066         (WebCore::Document::setVisuallyOrdered):
2067         * dom/Document.h:
2068         * dom/Element.cpp:
2069         (WebCore::Element::isFocusable const):
2070         (WebCore::Element::hasDisplayContents const):
2071         (WebCore::Element::storeDisplayContentsStyle):
2072         (WebCore::Element::rendererIsNeeded):
2073         (WebCore::beforeOrAfterPseudoElement):
2074         (WebCore::Element::computedStyle):
2075         * dom/Element.h:
2076         * dom/Node.cpp:
2077         (WebCore::computeEditabilityFromComputedStyle):
2078         * dom/Node.h:
2079         (WebCore::Node::isPseudoElement const):
2080         (WebCore::Node::isBeforePseudoElement const):
2081         (WebCore::Node::isAfterPseudoElement const):
2082         (WebCore::Node::pseudoId const):
2083         (WebCore::Node::customPseudoId const):
2084         * dom/Position.cpp:
2085         (WebCore::Position::upstream const):
2086         (WebCore::Position::downstream const):
2087         (WebCore::Position::isCandidate const):
2088         (WebCore::Position::rendersInDifferentPosition const):
2089         * dom/PositionIterator.cpp:
2090         (WebCore::PositionIterator::isCandidate const):
2091         * dom/PseudoElement.cpp:
2092         (WebCore::PseudoElement::pseudoElementNameForEvents):
2093         (WebCore::PseudoElement::PseudoElement):
2094         * dom/VisitedLinkState.cpp:
2095         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
2096         * dom/VisitedLinkState.h:
2097         (WebCore::VisitedLinkState::determineLinkState):
2098         * editing/Editing.cpp:
2099         (WebCore::isSpecialHTMLElement):
2100         (WebCore::isNodeRendered):
2101         * editing/TextIterator.cpp:
2102         (WebCore::hasVisibleTextNode):
2103         (WebCore::TextIterator::handleTextNode):
2104         (WebCore::TextIterator::handleTextBox):
2105         (WebCore::TextIterator::handleTextNodeFirstLetter):
2106         (WebCore::TextIterator::handleReplacedElement):
2107         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
2108         (WebCore::SimplifiedBackwardsTextIterator::advance):
2109         * editing/VisibleUnits.cpp:
2110         (WebCore::findStartOfParagraph):
2111         (WebCore::findEndOfParagraph):
2112         * editing/ios/EditorIOS.mm:
2113         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
2114         * html/HTMLAreaElement.cpp:
2115         (WebCore::HTMLAreaElement::isFocusable const):
2116         * html/HTMLFormElement.cpp:
2117         (WebCore::HTMLFormElement::rendererIsNeeded):
2118         * html/HTMLIFrameElement.cpp:
2119         (WebCore::HTMLIFrameElement::rendererIsNeeded):
2120         * html/HTMLInputElement.cpp:
2121         (WebCore::HTMLInputElement::createInnerTextStyle):
2122         * html/HTMLOptGroupElement.cpp:
2123         (WebCore::HTMLOptGroupElement::isFocusable const):
2124         * html/HTMLOptionElement.cpp:
2125         (WebCore::HTMLOptionElement::isFocusable const):
2126         * html/HTMLTextAreaElement.cpp:
2127         (WebCore::HTMLTextAreaElement::createInnerTextStyle):
2128         * html/HTMLTextFormControlElement.cpp:
2129         (WebCore::HTMLTextFormControlElement::setSelectionRange):
2130         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
2131         * html/MediaElementSession.cpp:
2132         (WebCore::MediaElementSession::autoplayPermitted const):
2133         (WebCore::isMainContentForPurposesOfAutoplay):
2134         * html/RubyElement.cpp:
2135         (WebCore::RubyElement::createElementRenderer):
2136         * html/RubyTextElement.cpp:
2137         (WebCore::RubyTextElement::createElementRenderer):
2138         * html/shadow/TextControlInnerElements.cpp:
2139         (WebCore::TextControlInnerElement::resolveCustomStyle):
2140         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
2141         * inspector/InspectorOverlay.cpp:
2142         (WebCore::buildObjectForElementData):
2143         * inspector/agents/InspectorCSSAgent.cpp:
2144         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
2145         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
2146         * inspector/agents/InspectorDOMAgent.cpp:
2147         (WebCore::pseudoElementType):
2148         (WebCore::InspectorDOMAgent::buildObjectForNode):
2149         * inspector/agents/InspectorLayerTreeAgent.cpp:
2150         (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
2151         * layout/layouttree/LayoutBox.cpp:
2152         (WebCore::Layout::Box::isInlineBlockBox const):
2153         (WebCore::Layout::Box::isBlockLevelBox const):
2154         (WebCore::Layout::Box::isInlineLevelBox const):
2155         (WebCore::Layout::Box::isBlockContainerBox const):
2156         * page/EventHandler.cpp:
2157         (WebCore::EventHandler::selectCursor):
2158         * page/Frame.cpp:
2159         (WebCore::Frame::searchForLabelsAboveCell):
2160         (WebCore::Frame::searchForLabelsBeforeElement):
2161         * page/FrameView.cpp:
2162         (WebCore::FrameView::createScrollbar):
2163         (WebCore::FrameView::adjustScrollStepForFixedContent):
2164         (WebCore::FrameView::updateScrollCorner):
2165         * page/animation/AnimationBase.cpp:
2166         (WebCore::AnimationBase::playStatePlaying const):
2167         (WebCore::AnimationBase::updatePlayState):
2168         * page/animation/AnimationBase.h:
2169         * page/animation/CSSPropertyAnimation.cpp:
2170         (WebCore::blendFunc):
2171         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2172         * page/animation/CompositeAnimation.cpp:
2173         (WebCore::CompositeAnimation::updateTransitions):
2174         (WebCore::CompositeAnimation::updateKeyframeAnimations):
2175         (WebCore::CompositeAnimation::suspendAnimations):
2176         (WebCore::CompositeAnimation::resumeAnimations):
2177         * page/animation/KeyframeAnimation.cpp:
2178         (WebCore::KeyframeAnimation::animate):
2179         * page/ios/FrameIOS.mm:
2180         (WebCore::Frame::nodeRespondingToClickEvents):
2181         * platform/animation/Animation.cpp:
2182         (WebCore::Animation::Animation):
2183         * platform/animation/Animation.h:
2184         (WebCore::Animation::clearPlayState):
2185         (WebCore::Animation::fillMode const):
2186         (WebCore::Animation::playState const):
2187         (WebCore::Animation::setFillMode):
2188         (WebCore::Animation::setPlayState):
2189         (WebCore::Animation::fillsBackwards const):
2190         (WebCore::Animation::fillsForwards const):
2191         (WebCore::Animation::initialFillMode):
2192         (WebCore::Animation::initialPlayState):
2193         * platform/graphics/GraphicsTypes.h:
2194         * platform/graphics/ca/GraphicsLayerCA.cpp:
2195         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2196         * platform/ios/wak/WAKWindow.mm:
2197         (-[WAKWindow dumpTiles]):
2198         * platform/mac/WebCoreNSURLExtras.mm:
2199         (WebCore::isLookalikeCharacter):
2200         * rendering/ClipPathOperation.h:
2201         * rendering/InlineBox.h:
2202         (WebCore::InlineBox::visibleToHitTesting const):
2203         * rendering/InlineFlowBox.cpp:
2204         (WebCore::InlineFlowBox::addToLine):
2205         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2206         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
2207         (WebCore::InlineFlowBox::paint):
2208         (WebCore::InlineFlowBox::paintBoxDecorations):
2209         (WebCore::InlineFlowBox::paintMask):
2210         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
2211         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
2212         (WebCore::InlineFlowBox::collectLeafBoxesInLogicalOrder const):
2213         * rendering/InlineFlowBox.h:
2214         (WebCore::InlineFlowBox::InlineFlowBox):
2215         * rendering/InlineTextBox.cpp:
2216         (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
2217         (WebCore::InlineTextBox::paint):
2218         (WebCore::InlineTextBox::createTextRun const):
2219         * rendering/PointerEventsHitRules.cpp:
2220         (WebCore::PointerEventsHitRules::PointerEventsHitRules):
2221         * rendering/PointerEventsHitRules.h:
2222         * rendering/RenderBlock.cpp:
2223         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
2224         (WebCore::RenderBlock::paint):
2225         (WebCore::RenderBlock::paintObject):
2226         (WebCore::RenderBlock::shouldPaintSelectionGaps const):
2227         (WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
2228         (WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
2229         (WebCore::isChildHitTestCandidate):
2230         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
2231         (WebCore::RenderBlock::firstLineBlock const):
2232         (WebCore::findFirstLetterBlock):
2233         (WebCore::RenderBlock::getFirstLetter):
2234         (WebCore::RenderBlock::createAnonymousBlockWithStyleAndDisplay):
2235         (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
2236         (WebCore::RenderBlock::constructTextRun):
2237         (WebCore::RenderBlock::layoutExcludedChildren):
2238         * rendering/RenderBlock.h:
2239         (WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay):
2240         (WebCore::RenderBlock::createAnonymousBlock const):
2241         * rendering/RenderBlockFlow.cpp:
2242         (WebCore::RenderBlockFlow::willCreateColumns const):
2243         (WebCore::RenderBlockFlow::layoutBlock):
2244         (WebCore::RenderBlockFlow::applyBeforeBreak):
2245         (WebCore::RenderBlockFlow::applyAfterBreak):
2246         (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
2247         (WebCore::RenderBlockFlow::updateStylesForColumnChildren):
2248         (WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
2249         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
2250         (WebCore::RenderBlockFlow::adjustForBorderFit const):
2251         (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
2252         (WebCore::RenderBlockFlow::lineAtIndex const):
2253         (WebCore::RenderBlockFlow::lineCount const):
2254         (WebCore::getHeightForLineCount):
2255         (WebCore::RenderBlockFlow::clearTruncation):
2256         (WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
2257         (WebCore::RenderBlockFlow::lineCountForTextAutosizing):
2258         (WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):
2259         (WebCore::RenderBlockFlow::updateColumnProgressionFromStyle):
2260         (WebCore::RenderBlockFlow::isTopLayoutOverflowAllowed const):
2261         (WebCore::RenderBlockFlow::isLeftLayoutOverflowAllowed const):
2262         * rendering/RenderBlockFlow.h:
2263         * rendering/RenderBlockLineLayout.cpp:
2264         (WebCore::RenderBlockFlow::constructLine):
2265         (WebCore::RenderBlockFlow::textAlignmentForLine const):
2266         (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
2267         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
2268         (WebCore::expansionBehaviorForInlineTextBox):
2269         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
2270         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2271         (WebCore::RenderBlockFlow::checkFloatInCleanLine):
2272         (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
2273         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
2274         (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
2275         * rendering/RenderBox.cpp:
2276         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
2277         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
2278         (WebCore::isCandidateForOpaquenessTest):
2279         (WebCore::RenderBox::paintMask):
2280         (WebCore::RenderBox::paintClippingMask):
2281         (WebCore::RenderBox::positionLineBox):
2282         (WebCore::RenderBox::clippedOverflowRectForRepaint const):
2283         (WebCore::RenderBox::computeLogicalWidthInFragment const):
2284         (WebCore::RenderBox::computeInlineDirectionMargins const):
2285         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation const):
2286         (WebCore::RenderBox::positionForPoint):
2287         (WebCore::RenderBox::isUnsplittableForPagination const):
2288         * rendering/RenderBoxModelObject.cpp:
2289         (WebCore::RenderBoxModelObject::localCaretRectForEmptyElement):
2290         * rendering/RenderBoxModelObject.h:
2291         * rendering/RenderCounter.cpp:
2292         (WebCore::planCounter):
2293         (WebCore::RenderCounter::originalText const):
2294         * rendering/RenderDeprecatedFlexibleBox.cpp:
2295         (WebCore::childDoesNotAffectWidthOrFlexing):
2296         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
2297         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
2298         * rendering/RenderDetailsMarker.cpp:
2299         (WebCore::RenderDetailsMarker::paint):
2300         * rendering/RenderElement.cpp:
2301         (WebCore::RenderElement::createFor):
2302         (WebCore::RenderElement::computeFirstLineStyle const):
2303         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
2304         (WebCore::RenderElement::styleWillChange):
2305         (WebCore::RenderElement::insertedIntoTree):
2306         (WebCore::RenderElement::willBeRemovedFromTree):
2307         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
2308         (WebCore::RenderElement::isVisibleInDocumentRect const):
2309         (WebCore::RenderElement::getCachedPseudoStyle const):
2310         (WebCore::RenderElement::getUncachedPseudoStyle const):
2311         (WebCore::RenderElement::selectionPseudoStyle const):
2312         * rendering/RenderElement.h:
2313         (WebCore::RenderElement::visibleToHitTesting const):
2314         * rendering/RenderFileUploadControl.cpp:
2315         (WebCore::RenderFileUploadControl::paintObject):
2316         * rendering/RenderFullScreen.cpp:
2317         (WebCore::createFullScreenStyle):
2318         * rendering/RenderGrid.cpp:
2319         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const):
2320         * rendering/RenderImage.cpp:
2321         (WebCore::RenderImage::repaintOrMarkForLayout):
2322         * rendering/RenderInline.cpp:
2323         (WebCore::RenderInline::willBeDestroyed):
2324         (WebCore::updateStyleOfAnonymousBlockContinuations):
2325         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
2326         (WebCore::RenderInline::clippedOverflowRectForRepaint const):
2327         (WebCore::RenderInline::addAnnotatedRegions):
2328         * rendering/RenderLayer.cpp:
2329         (WebCore::RenderLayer::RenderLayer):
2330         (WebCore::RenderLayer::updateDescendantDependentFlags):
2331         (WebCore::RenderLayer::createScrollbar):
2332         (WebCore::styleRequiresScrollbar):
2333         (WebCore::styleDefinesAutomaticScrollbar):
2334         (WebCore::computeReferenceBox):
2335         (WebCore::RenderLayer::calculateClipRects const):
2336         * rendering/RenderLayerBacking.cpp:
2337         (WebCore::RenderLayerBacking::updateAfterDescendants):
2338         * rendering/RenderLayerCompositor.cpp:
2339         (WebCore::scrollbarHasDisplayNone):
2340         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
2341         (WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
2342         * rendering/RenderListBox.cpp:
2343         (WebCore::RenderListBox::paintObject):
2344         (WebCore::itemOffsetForAlignment):
2345         (WebCore::RenderListBox::paintItemForeground):
2346         (WebCore::RenderListBox::paintItemBackground):
2347         (WebCore::RenderListBox::createScrollbar):
2348         * rendering/RenderListItem.cpp:
2349         (WebCore::RenderListItem::computeMarkerStyle const):
2350         * rendering/RenderListMarker.cpp:
2351         (WebCore::effectiveListMarkerType):
2352         (WebCore::listMarkerSuffix):
2353         (WebCore::listMarkerText):
2354         (WebCore::RenderListMarker::paint):
2355         (WebCore::RenderListMarker::updateContent):
2356         (WebCore::RenderListMarker::computePreferredLogicalWidths):
2357         (WebCore::RenderListMarker::updateMargins):
2358         (WebCore::RenderListMarker::suffix const):
2359         (WebCore::RenderListMarker::isInside const):
2360         (WebCore::RenderListMarker::getRelativeMarkerRect):
2361         * rendering/RenderListMarker.h:
2362         * rendering/RenderMediaControlElements.cpp:
2363         (WebCore::RenderMediaVolumeSliderContainer::layout):
2364         (WebCore::RenderTextTrackContainerElement::layout):
2365         * rendering/RenderMenuList.cpp:
2366         (WebCore::RenderMenuList::adjustInnerStyle):
2367         (WebCore::if):
2368         (RenderMenuList::itemStyle const):
2369         (RenderMenuList::menuStyle const):
2370         (RenderMenuList::createScrollbar):
2371         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
2372         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
2373         * rendering/RenderObject.cpp:
2374         (WebCore::RenderObject::addAnnotatedRegions):
2375         * rendering/RenderObject.h:
2376         (WebCore::RenderObject::isAnonymousBlock const):
2377         (WebCore::RenderObject::isBeforeContent const):
2378         (WebCore::RenderObject::isAfterContent const):
2379         * rendering/RenderReplaced.cpp:
2380         (WebCore::RenderReplaced::shouldPaint):
2381         (WebCore::RenderReplaced::clippedOverflowRectForRepaint const):
2382         * rendering/RenderRubyBase.cpp:
2383         (WebCore::RenderRubyBase::textAlignmentForLine const):
2384         * rendering/RenderRubyBase.h:
2385         * rendering/RenderRubyRun.cpp:
2386         (WebCore::RenderRubyRun::createRubyBase const):
2387         (WebCore::RenderRubyRun::staticCreateRubyRun):
2388         (WebCore::RenderRubyRun::layoutBlock):
2389         * rendering/RenderRubyText.cpp:
2390         (WebCore::RenderRubyText::textAlignmentForLine const):
2391         (WebCore::RenderRubyText::adjustInlineDirectionLineBounds const):
2392         * rendering/RenderRubyText.h:
2393         * rendering/RenderScrollbar.cpp:
2394         (WebCore::pseudoForScrollbarPart):
2395         (WebCore::RenderScrollbar::updateScrollbarPart):
2396         * rendering/RenderSearchField.cpp:
2397         (WebCore::RenderSearchField::updateCancelButtonVisibility const):
2398         (WebCore::RenderSearchField::visibilityForCancelButton const):
2399         (WebCore::RenderSearchField::menuStyle const):
2400         (WebCore::RenderSearchField::createScrollbar):
2401         * rendering/RenderSearchField.h:
2402         * rendering/RenderTable.cpp:
2403         (WebCore::RenderTable::willInsertTableSection):
2404         (WebCore::RenderTable::layoutCaptions):
2405         (WebCore::RenderTable::layout):
2406         (WebCore::RenderTable::paintObject):
2407         (WebCore::RenderTable::adjustBorderBoxRectForPainting):
2408         (WebCore::RenderTable::paintMask):
2409         (WebCore::RenderTable::recalcSections const):
2410         (WebCore::RenderTable::createTableWithStyle):
2411         * rendering/RenderTableCell.cpp:
2412         (WebCore::RenderTableCell::styleDidChange):
2413         (WebCore::RenderTableCell::paintCollapsedBorders):
2414         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
2415         (WebCore::RenderTableCell::paintBoxDecorations):
2416         (WebCore::RenderTableCell::paintMask):
2417         (WebCore::RenderTableCell::createTableCellWithStyle):
2418         * rendering/RenderTableCol.cpp:
2419         (WebCore::RenderTableCol::updateFromElement):
2420         (WebCore::RenderTableCol::isChildAllowed const):
2421         * rendering/RenderTableCol.h:
2422         * rendering/RenderTableRow.cpp:
2423         (WebCore::RenderTableRow::styleDidChange):
2424         (WebCore::RenderTableRow::paintOutlineForRowIfNeeded):
2425         (WebCore::RenderTableRow::createTableRowWithStyle):
2426         * rendering/RenderTableSection.cpp:
2427         (WebCore::RenderTableSection::addCell):
2428         (WebCore::RenderTableSection::paint):
2429         (WebCore::RenderTableSection::createTableSectionWithStyle):
2430         * rendering/RenderText.cpp:
2431         (WebCore::RenderText::styleDidChange):
2432         (WebCore::RenderText::computePreferredLogicalWidths):
2433         (WebCore::applyTextTransform):
2434         * rendering/RenderTextFragment.cpp:
2435         (WebCore::RenderTextFragment::styleDidChange):
2436         (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
2437         * rendering/RenderTheme.cpp:
2438         (WebCore::RenderTheme::adjustStyle):
2439         * rendering/RenderThemeMac.mm:
2440         (WebCore::RenderThemeMac::adjustMenuListStyle const):
2441         * rendering/RenderThemeWin.cpp:
2442         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
2443         * rendering/RenderView.cpp:
2444         (WebCore::rendererObscuresBackground):
2445         * rendering/RenderWidget.cpp:
2446         (WebCore::RenderWidget::setWidget):
2447         (WebCore::RenderWidget::styleDidChange):
2448         * rendering/RootInlineBox.cpp:
2449         (WebCore::RootInlineBox::paintEllipsisBox const):
2450         (WebCore::RootInlineBox::lineSnapAdjustment const):
2451         (WebCore::RootInlineBox::lineSelectionGap):
2452         (WebCore::RootInlineBox::computeCaretRect const):
2453         * rendering/SimpleLineLayout.cpp:
2454         (WebCore::SimpleLineLayout::canUseForFontAndText):
2455         (WebCore::SimpleLineLayout::canUseForStyle):
2456         (WebCore::SimpleLineLayout::computeLineLeft):
2457         (WebCore::SimpleLineLayout::updateLineConstrains):
2458         (WebCore::SimpleLineLayout::createLineRuns):
2459         (WebCore::SimpleLineLayout::textAlignForLine):
2460         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
2461         * rendering/SimpleLineLayoutFunctions.cpp:
2462         (WebCore::SimpleLineLayout::paintFlow):
2463         (WebCore::SimpleLineLayout::hitTestFlow):
2464         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2465         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2466         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2467         * rendering/TextDecorationPainter.cpp:
2468         (WebCore::textDecorationStyleToStrokeStyle):
2469         (WebCore::TextDecorationPainter::paintTextDecoration):
2470         (WebCore::collectStylesForRenderer):
2471         * rendering/TextDecorationPainter.h:
2472         * rendering/line/BreakingContext.h:
2473         (WebCore::BreakingContext::BreakingContext):
2474         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
2475         (WebCore::BreakingContext::handleBR):
2476         (WebCore::BreakingContext::handleOutOfFlowPositioned):
2477         (WebCore::BreakingContext::handleText):
2478         (WebCore::BreakingContext::canBreakAtThisPosition):
2479         (WebCore::BreakingContext::handleEndOfLine):
2480         * rendering/line/LineInlineHeaders.h:
2481         (WebCore::shouldCollapseWhiteSpace):
2482         * rendering/line/LineWidth.cpp:
2483         (WebCore::newFloatShrinksLine):
2484         * rendering/mathml/MathOperator.cpp:
2485         (WebCore::MathOperator::paint):
2486         * rendering/mathml/RenderMathMLFraction.cpp:
2487         (WebCore::RenderMathMLFraction::paint):
2488         * rendering/mathml/RenderMathMLMath.cpp:
2489         (WebCore::RenderMathMLMath::layoutBlock):
2490         * rendering/mathml/RenderMathMLMenclose.cpp:
2491         (WebCore::RenderMathMLMenclose::paint):
2492         * rendering/mathml/RenderMathMLRoot.cpp:
2493         (WebCore::RenderMathMLRoot::paint):
2494         * rendering/mathml/RenderMathMLToken.cpp:
2495         (WebCore::RenderMathMLToken::paint):
2496         * rendering/shapes/BoxShape.cpp:
2497         (WebCore::computeRoundedRectForBoxShape):
2498         * rendering/shapes/ShapeOutsideInfo.cpp:
2499         (WebCore::referenceBox):
2500         (WebCore::ShapeOutsideInfo::setReferenceBoxLogicalSize):
2501         (WebCore::ShapeOutsideInfo::logicalTopOffset const):
2502         (WebCore::ShapeOutsideInfo::logicalLeftOffset const):
2503         * rendering/style/CounterContent.h:
2504         (WebCore::CounterContent::CounterContent):
2505         (WebCore::CounterContent::listStyle const):
2506         * rendering/style/RenderStyle.cpp:
2507         (WebCore::RenderStyle::createAnonymousStyleWithDisplay):
2508         (WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
2509         (WebCore::RenderStyle::RenderStyle):
2510         (WebCore::RenderStyle::hasUniquePseudoStyle const):
2511         (WebCore::RenderStyle::getCachedPseudoStyle const):
2512         (WebCore::RenderStyle::addCachedPseudoStyle):
2513         (WebCore::RenderStyle::changeRequiresLayout const):
2514         (WebCore::requiresPainting):
2515         (WebCore::RenderStyle::hyphenString const):
2516         (WebCore::RenderStyle::textEmphasisMarkString const):
2517         (WebCore::RenderStyle::visitedDependentColor const):
2518         (WebCore::RenderStyle::textEmphasisMark const):
2519         (WebCore::RenderStyle::setColumnStylesFromPaginationMode):
2520         * rendering/style/RenderStyle.h:
2521         (WebCore::RenderStyle::setStyleType):
2522         (WebCore::RenderStyle::setRTLOrdering):
2523         (WebCore::RenderStyle::display const):
2524         (WebCore::RenderStyle::visibility const):
2525         (WebCore::RenderStyle::textAlign const):
2526         (WebCore::RenderStyle::textTransform const):
2527         (WebCore::RenderStyle::whiteSpace const):
2528         (WebCore::RenderStyle::emptyCells const):
2529         (WebCore::RenderStyle::captionSide const):
2530         (WebCore::RenderStyle::listStyleType const):
2531         (WebCore::RenderStyle::listStylePosition const):
2532         (WebCore::RenderStyle::cursor const):
2533         (WebCore::RenderStyle::insideLink const):
2534         (WebCore::RenderStyle::borderFit const):
2535         (WebCore::RenderStyle::pointerEvents const):
2536         (WebCore::RenderStyle::setDisplay):
2537         (WebCore::RenderStyle::setOriginalDisplay):
2538         (WebCore::RenderStyle::setVisibility):
2539         (WebCore::RenderStyle::setTextAlign):
2540         (WebCore::RenderStyle::setTextTransform):
2541         (WebCore::RenderStyle::setTextDecorationStyle):
2542         (WebCore::RenderStyle::setTextDecorationSkip):
2543         (WebCore::RenderStyle::setTextUnderlinePosition):
2544         (WebCore::RenderStyle::setDirection):
2545         (WebCore::RenderStyle::setTextZoom):
2546         (WebCore::RenderStyle::setWhiteSpace):
2547         (WebCore::RenderStyle::setEmptyCells):
2548         (WebCore::RenderStyle::setCaptionSide):
2549         (WebCore::RenderStyle::setListStyleType):
2550         (WebCore::RenderStyle::setListStylePosition):
2551         (WebCore::RenderStyle::setCursor):
2552         (WebCore::RenderStyle::setCursorVisibility):
2553         (WebCore::RenderStyle::setInsideLink):
2554         (WebCore::RenderStyle::setHyphens):
2555         (WebCore::RenderStyle::setBorderFit):
2556         (WebCore::RenderStyle::setColumnAxis):
2557         (WebCore::RenderStyle::setColumnProgression):
2558         (WebCore::RenderStyle::setTextEmphasisFill):
2559         (WebCore::RenderStyle::setTextEmphasisMark):
2560         (WebCore::RenderStyle::setRubyPosition):
2561         (WebCore::RenderStyle::setBreakBefore):
2562         (WebCore::RenderStyle::setBreakAfter):
2563         (WebCore::RenderStyle::setBreakInside):
2564         (WebCore::RenderStyle::setHangingPunctuation):
2565         (WebCore::RenderStyle::setLineSnap):
2566         (WebCore::RenderStyle::setLineAlign):
2567         (WebCore::RenderStyle::setPointerEvents):
2568         (WebCore::RenderStyle::initialDisplay):
2569         (WebCore::RenderStyle::initialBreakBetween):
2570         (WebCore::RenderStyle::initialBreakInside):
2571         (WebCore::RenderStyle::initialCaptionSide):
2572         (WebCore::RenderStyle::initialColumnAxis):
2573         (WebCore::RenderStyle::initialColumnProgression):
2574         (WebCore::RenderStyle::initialEmptyCells):
2575         (WebCore::RenderStyle::initialListStylePosition):
2576         (WebCore::RenderStyle::initialListStyleType):
2577         (WebCore::RenderStyle::initialTextTransform):
2578         (WebCore::RenderStyle::initialVisibility):
2579         (WebCore::RenderStyle::initialWhiteSpace):
2580         (WebCore::RenderStyle::initialCursor):
2581         (WebCore::RenderStyle::initialTextAlign):
2582         (WebCore::RenderStyle::initialTextDecorationStyle):
2583         (WebCore::RenderStyle::initialTextZoom):
2584         (WebCore::RenderStyle::initialHyphens):
2585         (WebCore::RenderStyle::initialBorderFit):
2586         (WebCore::RenderStyle::initialRTLOrdering):
2587         (WebCore::RenderStyle::initialPointerEvents):
2588         (WebCore::RenderStyle::initialTextEmphasisColor):
2589         (WebCore::RenderStyle::initialTextEmphasisFill):
2590         (WebCore::RenderStyle::initialTextEmphasisMark):
2591         (WebCore::RenderStyle::initialRubyPosition):
2592         (WebCore::RenderStyle::initialImageResolutionSource):
2593         (WebCore::RenderStyle::initialImageResolutionSnap):
2594         (WebCore::RenderStyle::initialTextAlignLast):
2595         (WebCore::RenderStyle::initialTextJustify):
2596         (WebCore::RenderStyle::initialCursorVisibility):
2597         (WebCore::RenderStyle::initialGridAutoRepeatType):
2598         (WebCore::RenderStyle::initialLineSnap):
2599         (WebCore::RenderStyle::initialLineAlign):
2600         (WebCore::RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles const):
2601         (WebCore::RenderStyle::originalDisplay const):
2602         (WebCore::RenderStyle::NonInheritedFlags::hasPseudoStyle const):
2603         (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyle):
2604         (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyles):
2605         (WebCore::RenderStyle::autoWrap):
2606         (WebCore::RenderStyle::preserveNewline):
2607         (WebCore::RenderStyle::collapseWhiteSpace):
2608         (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const):
2609         (WebCore::RenderStyle::hasInlineColumnAxis const):
2610         (WebCore::RenderStyle::isDisplayRegionType const):
2611         (WebCore::RenderStyle::isDisplayReplacedType):
2612         (WebCore::RenderStyle::isDisplayInlineType):
2613         (WebCore::RenderStyle::isDisplayFlexibleBox):
2614         (WebCore::RenderStyle::isDisplayGridBox):
2615         (WebCore::RenderStyle::isDisplayFlexibleOrGridBox):
2616         (WebCore::pseudoElementRendererIsNeeded):
2617         * rendering/style/RenderStyleConstants.cpp:
2618         (WebCore::operator<<):
2619         (WebCore::alwaysPageBreak):
2620         * rendering/style/RenderStyleConstants.h:
2621         (WebCore::PseudoIdSet::has const):
2622         (WebCore::PseudoIdSet::add):
2623         * rendering/style/ShapeValue.h:
2624         * rendering/style/StyleMultiColData.cpp:
2625         (WebCore::StyleMultiColData::StyleMultiColData):
2626         * rendering/style/StyleRareInheritedData.cpp:
2627         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2628         * rendering/style/StyleRareNonInheritedData.cpp:
2629         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2630         * rendering/style/StyleRareNonInheritedData.h:
2631         * rendering/svg/RenderSVGContainer.cpp:
2632         (WebCore::RenderSVGContainer::paint):
2633         * rendering/svg/RenderSVGImage.cpp:
2634         (WebCore::RenderSVGImage::paint):
2635         (WebCore::RenderSVGImage::nodeAtFloatPoint):
2636         * rendering/svg/RenderSVGInlineText.cpp:
2637         (WebCore::RenderSVGInlineText::styleDidChange):
2638         * rendering/svg/RenderSVGModelObject.cpp:
2639         (WebCore::RenderSVGModelObject::checkIntersection):
2640         (WebCore::RenderSVGModelObject::checkEnclosure):
2641         * rendering/svg/RenderSVGResource.cpp:
2642         (WebCore::requestPaintingResource):
2643         * rendering/svg/RenderSVGResourceClipper.cpp:
2644         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
2645         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
2646         (WebCore::RenderSVGResourceClipper::calculateClipContentRepaintRect):
2647         * rendering/svg/RenderSVGResourceMasker.cpp:
2648         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
2649         (WebCore::RenderSVGResourceMasker::calculateMaskContentRepaintRect):
2650         * rendering/svg/RenderSVGRoot.cpp:
2651         (WebCore::RenderSVGRoot::clippedOverflowRectForRepaint const):
2652         * rendering/svg/RenderSVGShape.cpp:
2653         (WebCore::RenderSVGShape::paint):
2654         (WebCore::RenderSVGShape::nodeAtFloatPoint):
2655         * rendering/svg/RenderSVGText.cpp:
2656         (WebCore::RenderSVGText::nodeAtFloatPoint):
2657         * rendering/svg/SVGInlineTextBox.cpp:
2658         (WebCore::SVGInlineTextBox::paintSelectionBackground):
2659         (WebCore::SVGInlineTextBox::paint):
2660         (WebCore::SVGInlineTextBox::constructTextRun const):
2661         (WebCore::SVGInlineTextBox::paintDecoration):
2662         (WebCore::SVGInlineTextBox::nodeAtPoint):
2663         * rendering/svg/SVGRenderSupport.cpp:
2664         (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
2665         * rendering/svg/SVGRenderingContext.cpp:
2666         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2667         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
2668         (WebCore::processRenderSVGInlineText):
2669         * rendering/svg/SVGTextMetricsBuilder.cpp:
2670         (WebCore::SVGTextMetricsBuilder::measureTextRenderer):
2671         * rendering/updating/RenderTreeBuilderBlock.cpp:
2672         (WebCore::RenderTreeBuilder::Block::detach):
2673         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2674         (WebCore::styleForFirstLetter):
2675         (WebCore::RenderTreeBuilder::FirstLetter::updateAfterDescendants):
2676         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
2677         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2678         * rendering/updating/RenderTreeBuilderInline.cpp:
2679         (WebCore::RenderTreeBuilder::Inline::attachIgnoringContinuation):
2680         (WebCore::RenderTreeBuilder::Inline::newChildIsInline):
2681         * rendering/updating/RenderTreeBuilderList.cpp:
2682         (WebCore::RenderTreeBuilder::List::updateItemMarker):
2683         * rendering/updating/RenderTreeBuilderMathML.cpp:
2684         (WebCore::RenderTreeBuilder::MathML::createMathMLOperator):
2685         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
2686         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
2687         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
2688         * rendering/updating/RenderTreeBuilderRuby.cpp:
2689         (WebCore::isAnonymousRubyInlineBlock):
2690         (WebCore::isRubyBeforeBlock):
2691         (WebCore::isRubyAfterBlock):
2692         (WebCore::createAnonymousRubyInlineBlock):
2693         * rendering/updating/RenderTreeBuilderTable.cpp:
2694         (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
2695         * rendering/updating/RenderTreeUpdater.cpp:
2696         (WebCore::RenderTreeUpdater::updateBeforeDescendants):
2697         (WebCore::RenderTreeUpdater::updateAfterDescendants):
2698         (WebCore::RenderTreeUpdater::updateElementRenderer):
2699         (WebCore::elementImplicitVisibility):
2700         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
2701         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
2702         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
2703         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
2704         * style/InlineTextBoxStyle.cpp:
2705         (WebCore::visualOverflowForDecorations):
2706         * style/StyleChange.cpp:
2707         (WebCore::Style::determineChange):
2708         * style/StyleFontSizeFunctions.cpp:
2709         (WebCore::Style::computedFontSizeFromSpecifiedSize):
2710         * style/StyleResolveForDocument.cpp:
2711         (WebCore::Style::resolveForDocument):
2712         * style/StyleSharingResolver.cpp:
2713         * style/StyleTreeResolver.cpp:
2714         (WebCore::Style::affectsRenderedSubtree):
2715         (WebCore::Style::TreeResolver::resolveElement):
2716         (WebCore::Style::TreeResolver::resolvePseudoStyle):
2717         (WebCore::Style::TreeResolver::parentBoxStyle const):
2718         (WebCore::Style::createInheritedDisplayContentsStyleIfNeeded):
2719         (WebCore::Style::TreeResolver::resolveComposedTree):
2720         * svg/SVGElement.h:
2721         * svg/SVGGElement.cpp:
2722         (WebCore::SVGGElement::createElementRenderer):
2723
2724 2018-05-24  Chris Dumez  <cdumez@apple.com>
2725
2726         Enable subsampling for progressive JPEG images
2727         https://bugs.webkit.org/show_bug.cgi?id=185956
2728
2729         Reviewed by Said Abou-Hallawa.
2730
2731         Enable subsampling for progressive JPEG images now that it is supposed (rdar://problem/5191418).
2732         I verified locally that such images are still loading and do not cause any hang on iOS.
2733
2734         * platform/graphics/cg/ImageDecoderCG.cpp:
2735         (WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const):
2736
2737 2018-05-24  Chris Dumez  <cdumez@apple.com>
2738
2739         Reduce copying of FontCascadeDescription objects by moving them around
2740         https://bugs.webkit.org/show_bug.cgi?id=185963
2741
2742         Reviewed by Simon Fraser.
2743
2744         Reduce copying of FontCascadeDescription objects by moving them around when possible.
2745
2746         * css/StyleBuilderCustom.h:
2747         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
2748         (WebCore::StyleBuilderCustom::applyInitialFontFamily):
2749         (WebCore::StyleBuilderCustom::applyInheritFontFamily):
2750         (WebCore::StyleBuilderCustom::applyValueFontFamily):
2751         (WebCore::StyleBuilderCustom::applyInheritFontVariantLigatures):
2752         (WebCore::StyleBuilderCustom::applyInitialFontVariantLigatures):
2753         (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
2754         (WebCore::StyleBuilderCustom::applyInheritFontVariantNumeric):
2755         (WebCore::StyleBuilderCustom::applyInitialFontVariantNumeric):
2756         (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
2757         (WebCore::StyleBuilderCustom::applyInheritFontVariantEastAsian):
2758         (WebCore::StyleBuilderCustom::applyInitialFontVariantEastAsian):
2759         (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
2760         (WebCore::StyleBuilderCustom::applyInitialFontSize):
2761         (WebCore::StyleBuilderCustom::applyInheritFontSize):
2762         (WebCore::StyleBuilderCustom::applyInitialFontStyle):
2763         (WebCore::StyleBuilderCustom::applyInheritFontStyle):
2764         (WebCore::StyleBuilderCustom::applyValueFontStyle):
2765         (WebCore::StyleBuilderCustom::applyValueFontSize):
2766         * css/StyleResolver.cpp:
2767         (WebCore::checkForOrientationChange):
2768         (WebCore::StyleResolver::checkForTextSizeAdjust):
2769         (WebCore::StyleResolver::checkForZoomChange):
2770         (WebCore::StyleResolver::checkForGenericFamilyChange):
2771         (WebCore::StyleResolver::initializeFontStyle):
2772         * css/StyleResolver.h:
2773         (WebCore::StyleResolver::State::setFontDescription):
2774         (WebCore::StyleResolver::setFontDescription):
2775         * css/makeprop.pl:
2776         (generateInitialValueSetter):
2777         (generateInheritValueSetter):
2778         (generateValueSetter):
2779         * html/canvas/CanvasRenderingContext2D.cpp:
2780         (WebCore::CanvasRenderingContext2D::setFont):
2781         * page/DebugPageOverlays.cpp:
2782         (WebCore::NonFastScrollableRegionOverlay::drawRect):
2783         * page/linux/ResourceUsageOverlayLinux.cpp:
2784         * platform/graphics/FontCascade.cpp:
2785         (WebCore::FontCascade::FontCascade):
2786         * platform/graphics/FontCascade.h:
2787         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2788         (PlatformCALayerWin::drawTextAtPoint const):
2789         * platform/mock/MockRealtimeVideoSource.cpp:
2790         (WebCore::MockRealtimeVideoSource::drawText):
2791         * platform/win/DragImageWin.cpp:
2792         (WebCore::dragLabelFont):
2793         * platform/win/PopupMenuWin.cpp:
2794         (WebCore::PopupMenuWin::calculatePositionAndSize):
2795         (WebCore::PopupMenuWin::paint):
2796         * rendering/RenderBox.cpp:
2797         (WebCore::RenderBox::styleDidChange):
2798         * rendering/RenderCombineText.cpp:
2799         (WebCore::RenderCombineText::combineTextIfNeeded):
2800         * rendering/RenderEmbeddedObject.cpp:
2801         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
2802         * rendering/RenderListBox.cpp:
2803         (WebCore::bolder):
2804         (WebCore::RenderListBox::paintItemForeground):
2805         * rendering/RenderListItem.cpp:
2806         (WebCore::RenderListItem::computeMarkerStyle const):
2807         * rendering/RenderTheme.cpp:
2808         (WebCore::RenderTheme::adjustStyle):
2809         * rendering/RenderThemeMac.mm:
2810         (WebCore::RenderThemeMac::setFontFromControlSize const):
2811         * rendering/TextAutoSizing.cpp:
2812         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
2813         (WebCore::TextAutoSizingValue::reset):
2814         * rendering/style/RenderStyle.cpp:
2815         (WebCore::RenderStyle::setFontDescription):
2816         (WebCore::RenderStyle::setFontSize):
2817         (WebCore::RenderStyle::setFontVariationSettings):
2818         (WebCore::RenderStyle::setFontWeight):
2819         (WebCore::RenderStyle::setFontStretch):
2820         (WebCore::RenderStyle::setFontItalic):
2821         * rendering/style/RenderStyle.h:
2822         * rendering/svg/RenderSVGInlineText.cpp:
2823         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
2824         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2825         (WebCore::styleForFirstLetter):
2826         * style/StyleResolveForDocument.cpp:
2827         (WebCore::Style::resolveForDocument):
2828
2829 2018-05-24  Chris Dumez  <cdumez@apple.com>
2830
2831         Avoid constructing the string "all" repeatedly in MediaQueryParser
2832         https://bugs.webkit.org/show_bug.cgi?id=185961
2833
2834         Reviewed by Simon Fraser.
2835
2836         Avoid constructing the string "all" repeatedly in MediaQueryParser by:
2837         - Having MediaQueryData use an std::optional<String> instead of a String
2838         - Updating MediaQueryParser to use a static to store the default media type
2839           and use it when the MediaQueryData's media type is std::nullopt.
2840
2841         Also do some cleanup.
2842
2843         * css/parser/MediaQueryParser.cpp:
2844         (WebCore::MediaQueryParser::commitMediaQuery):
2845         (WebCore::MediaQueryParser::MediaQueryData::MediaQueryData):
2846         (WebCore::MediaQueryParser::MediaQueryData::clear):
2847         (WebCore::MediaQueryParser::MediaQueryData::addExpression):
2848         (WebCore::MediaQueryParser::MediaQueryData::lastExpressionValid):
2849         (WebCore::MediaQueryParser::MediaQueryData::removeLastExpression):
2850         * css/parser/MediaQueryParser.h:
2851         (WebCore::MediaQueryParser::MediaQueryData::setMediaType):
2852         (WebCore::MediaQueryParser::MediaQueryData::restrictor const):
2853         (WebCore::MediaQueryParser::MediaQueryData::expressions):
2854         (WebCore::MediaQueryParser::MediaQueryData::mediaType const):
2855         (WebCore::MediaQueryParser::MediaQueryData::currentMediaQueryChanged const):
2856         (WebCore::MediaQueryParser::MediaQueryData::restrictor):
2857         (WebCore::MediaQueryParser::MediaQueryData::setRestrictor):
2858         (WebCore::MediaQueryParser::MediaQueryData::setMediaFeature):
2859         (WebCore::MediaQueryParser::MediaQueryData::setMediaQueryParserContext):
2860
2861 2018-05-24  Joseph Pecoraro  <pecoraro@apple.com>
2862
2863         [iOS] Hard link AppSupport instead of soft linking
2864         https://bugs.webkit.org/show_bug.cgi?id=185959
2865         <rdar://problem/40506538>
2866
2867         Reviewed by Timothy Horton.
2868
2869         * Configurations/WebCore.xcconfig:
2870         * platform/network/ios/NetworkStateNotifierIOS.mm:
2871         (-[WebNetworkStateObserver initWithBlock:]):
2872         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
2873
2874 2018-05-24  Chris Dumez  <cdumez@apple.com>
2875
2876         Cache navigator.userAgent for performance
2877         https://bugs.webkit.org/show_bug.cgi?id=185952
2878
2879         Reviewed by Geoffrey Garen.
2880
2881         Cache navigator.userAgent for performance. Previously, we would ask the client 5 times
2882         while loading apple.com.
2883
2884         * page/Navigator.cpp:
2885         (WebCore::Navigator::userAgent const):
2886         * page/Navigator.h:
2887         * page/NavigatorBase.h:
2888         * page/NavigatorID.idl:
2889         * page/WorkerNavigator.cpp:
2890         (WebCore::WorkerNavigator::userAgent const):
2891         * page/WorkerNavigator.h:
2892
2893 2018-05-24  Chris Dumez  <cdumez@apple.com>
2894
2895         Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
2896         https://bugs.webkit.org/show_bug.cgi?id=185951
2897
2898         Reviewed by Geoffrey Garen.
2899
2900         Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
2901         launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
2902         should be enabled.
2903
2904         * platform/mac/LoggingMac.mm:
2905         (WebCore::logLevelString):
2906         * platform/unix/LoggingUnix.cpp:
2907         (WebCore::logLevelString):
2908         * platform/win/LoggingWin.cpp:
2909         (WebCore::logLevelString):
2910
2911 2018-05-24  Chris Dumez  <cdumez@apple.com>
2912
2913         [iOS WK2] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html is a flaky failure
2914         https://bugs.webkit.org/show_bug.cgi?id=181499
2915         <rdar://problem/36443428>
2916
2917         Reviewed by Youenn Fablet.
2918
2919         After resolving a registration promise, we send an IPC back to the StorageProcess
2920         for synchronization purposes, to make sure the registration does not get updated
2921         before the promise's JS code has been executed. However, resolving a promise
2922         schedules a microtask to run the JS and we would therefore send the IPC back too
2923         early, thus causing flakiness. We now only send the IPC back back only after that
2924         microtask has run and the JS has been executed.
2925
2926         * bindings/js/JSDOMPromiseDeferred.cpp:
2927         (WebCore::DeferredPromise::callFunction):
2928         (WebCore::DeferredPromise::whenSettled):
2929         * bindings/js/JSDOMPromiseDeferred.h:
2930         * workers/service/ServiceWorkerContainer.cpp:
2931         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2932
2933 2018-05-24  Jinho Bang  <zino@chromium.org>
2934
2935         [PaymentRequest] Remove currencySystem member
2936         https://bugs.webkit.org/show_bug.cgi?id=185860
2937
2938         Reviewed by Andy Estes.
2939
2940         After a long discussion, Web Payment Working Group decided to remove
2941         the `currencySystem` member[1]. The currency code should be well-formed
2942         3-letter alphabetic code and is allowed even if that is not part of
2943         the official ISO 4217 list.
2944
2945         [1] https://github.com/w3c/payment-request/pull/694
2946
2947         Test: http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html
2948
2949         * Modules/paymentrequest/PaymentCurrencyAmount.h:
2950         * Modules/paymentrequest/PaymentCurrencyAmount.idl:
2951         * Modules/paymentrequest/PaymentRequest.cpp:
2952         (WebCore::checkAndCanonicalizeAmount):
2953         (WebCore::checkAndCanonicalizeTotal):
2954         * inspector/WebInjectedScriptHost.cpp:
2955         (WebCore::objectForPaymentCurrencyAmount):
2956
2957 2018-05-24  Zalan Bujtas  <zalan@apple.com>
2958
2959         [LFC] Implement position computation for inflow positioned elements
2960         https://bugs.webkit.org/show_bug.cgi?id=185936
2961
2962         Reviewed by Antti Koivisto.
2963
2964         * layout/blockformatting/BlockFormattingContext.cpp:
2965         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
2966         * layout/blockformatting/BlockFormattingContext.h:
2967         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2968         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
2969
2970 2018-05-24  Zalan Bujtas  <zalan@apple.com>
2971
2972         [LFC] Implement FormattingContext::placeInFlowPositionedChildren
2973         https://bugs.webkit.org/show_bug.cgi?id=185934
2974
2975         Reviewed by Antti Koivisto.
2976
2977         * layout/FormattingContext.cpp:
2978         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
2979         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
2980         * layout/FormattingContext.h:
2981         * layout/blockformatting/BlockFormattingContext.cpp:
2982         (WebCore::Layout::BlockFormattingContext::layout const):
2983
2984 2018-05-23  Joseph Pecoraro  <pecoraro@apple.com>
2985
2986         Use ASCIILiteral with applicationBundleIsEqualTo in RuntimeApplicationChecksCocoa
2987         https://bugs.webkit.org/show_bug.cgi?id=185935
2988
2989         Reviewed by Yusuke Suzuki.
2990
2991         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2992         (WebCore::MacApplication::isSafari):
2993         (WebCore::MacApplication::isAppleMail):
2994         (WebCore::MacApplication::isIBooks):
2995         (WebCore::MacApplication::isITunes):
2996         (WebCore::MacApplication::isMicrosoftMessenger):
2997         (WebCore::MacApplication::isAdobeInstaller):
2998         (WebCore::MacApplication::isAOLInstantMessenger):
2999         (WebCore::MacApplication::isMicrosoftMyDay):
3000         (WebCore::MacApplication::isMicrosoftOutlook):
3001         (WebCore::MacApplication::isQuickenEssentials):
3002         (WebCore::MacApplication::isAperture):
3003         (WebCore::MacApplication::isVersions):
3004         (WebCore::MacApplication::isHRBlock):
3005         (WebCore::MacApplication::isIAdProducer):
3006         (WebCore::MacApplication::isSolidStateNetworksDownloader):
3007         (WebCore::IOSApplication::isMobileMail):
3008         (WebCore::IOSApplication::isMobileSafari):
3009         (WebCore::IOSApplication::isWebBookmarksD):
3010         (WebCore::IOSApplication::isDumpRenderTree):
3011         (WebCore::IOSApplication::isMobileStore):
3012         (WebCore::IOSApplication::isSpringBoard):
3013         (WebCore::IOSApplication::isWebApp):
3014         (WebCore::IOSApplication::isIBooks):
3015         (WebCore::IOSApplication::isIBooksStorytime):
3016         (WebCore::IOSApplication::isTheSecretSocietyHiddenMystery):
3017         (WebCore::IOSApplication::isCardiogram):
3018         (WebCore::IOSApplication::isNike):
3019
3020 2018-05-23  Brent Fulgham  <bfulgham@apple.com>
3021
3022         Avoid keeping FormState alive longer than necessary
3023         https://bugs.webkit.org/show_bug.cgi?id=185877
3024         <rdar://problem/39329219>
3025
3026         Reviewed by Ryosuke Niwa.
3027
3028         A number of crash fixes were done to prevent FormState objects from being
3029         accessed after their relevant Frames had been destroyed. Unfortunately, this
3030         could cause the FormState to persist after the owning Frame had been
3031         destroyed, resulting in nullptr dereferences.
3032
3033         This patch does the following:
3034
3035         1. Uses WeakPtr's for FormState objects passed to completion handlers, rather
3036            than RefPtr, since those completion handlers might fire as part of the
3037            clean-up process during Frame destruction. This allows us to use the FormState
3038            if they are still valid, but gracefully handle cases where a form submission
3039            is cancelled in-flight.
3040         2. Moves FormState object as they pass through the loader.
3041         3. Removes some extraneous WTFMove() calls being made on bare FormState pointers.
3042         4. Changes FormSubmission to hold a RefPtr so we can move the FormState to the
3043            loader in the code path that uses it (the FormSubmission is always destroyed
3044            shortly afterwards).
3045         5. Changes the trap from Bug 183704 so that it only fires if the FormState object
3046            is being retained more than once.
3047
3048         * loader/DocumentLoader.cpp:
3049         (WebCore::DocumentLoader::willSendRequest): Update for new CompletionHandler
3050         signature.
3051         * loader/FormState.cpp:
3052         (WebCore::FormState::willDetachPage): Revise trap to check for retain counts
3053         above one.
3054         * loader/FormState.h:
3055         (WebCore::FormState::weakPtrFactory const): Added.
3056         * loader/FormSubmission.h:
3057         (WebCore::FormSubmission::state const): Revised for change to RefPtr.
3058         (WebCore::FormSubmission::takeState): Added.
3059         * loader/FrameLoader.cpp:
3060         (WebCore::FrameLoader::urlSelected): Update for new CompletionHandler signature.
3061         (WebCore::FrameLoader::loadURLIntoChildFrame): Ditto.
3062         (WebCore::FrameLoader::loadFrameRequest): Ditto.
3063         (WebCore::FrameLoader::loadURL): Ditto.
3064         (WebCore::FrameLoader::load): Ditto.
3065         (WebCore::FrameLoader::loadWithNavigationAction): Ditto.
3066         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
3067         (WebCore::FrameLoader::reloadWithOverrideEncoding): Ditto.
3068         (WebCore::FrameLoader::reload): Ditto.
3069         (WebCore::FrameLoader::loadPostRequest): Ditto.
3070         (WebCore::FrameLoader::loadDifferentDocumentItem): Ditto.
3071         * loader/FrameLoader.h:
3072         * loader/NavigationScheduler.cpp:
3073         * loader/PolicyChecker.cpp:
3074         (WebCore::PolicyChecker::checkNavigationPolicy):Revise to use WeakPtr for
3075         FormState passed to the completion handler. Remove some extraneous WTFMove()
3076         calls on bare pointers.
3077         (WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.
3078         * loader/PolicyChecker.h:
3079         * page/ContextMenuController.cpp:
3080         (WebCore::openNewWindow): Revise for new signatures.
3081         (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
3082
3083 2018-05-23  Keith Miller  <keith_miller@apple.com>
3084
3085         Expose $vm if window.internals is exposed
3086         https://bugs.webkit.org/show_bug.cgi?id=185900
3087
3088         Reviewed by Mark Lam.
3089
3090         This is useful for testing vm internals when running LayoutTests.
3091
3092         * testing/js/WebCoreTestSupport.cpp:
3093         (WebCoreTestSupport::injectInternalsObject):
3094
3095 2018-05-23  David Kilzer  <ddkilzer@apple.com>
3096
3097         Don't create the SubimageCache just to clear an image from it
3098         <https://webkit.org/b/185757>
3099
3100         Reviewed by Said Abou-Hallawa.
3101
3102         To fix this we make SubimageCacheWithTimer::clearImage() a
3103         static class method that checks whether the cache exists before
3104         removing it.  We also make SubimageCacheWithTimer::getImage() a
3105         static class method, and move more methods into the
3106         SubimageCacheWithTimer class and make them private to reduce API
3107         footprint.
3108
3109         * platform/graphics/cg/GraphicsContextCG.cpp:
3110         (WebCore::GraphicsContext::drawNativeImage): Switch to use new
3111         SubimageCacheWithTimer::getSubimage() static class method.
3112         * platform/graphics/cg/NativeImageCG.cpp:
3113         (WebCore::clearNativeImageSubimages): Switch to use new
3114         SubimageCacheWithTimer::clearImage() static class method which
3115         returns early if the subimage cache has not been created yet.
3116         This fixes the bug.
3117
3118         * platform/graphics/cg/SubimageCacheWithTimer.cpp:
3119         (WebCore::SubimageCacheWithTimer::s_cache): Allocate space for
3120         static class variable.
3121         (WebCore::SubimageCacheWithTimer::getSubimage): Replace instance
3122         method with new static class method that gets the subimage cache
3123         singleton and calls the subimage() instance method.
3124         (WebCore::SubimageCacheWithTimer::clearImage): Replace instance
3125         methdod with new static class method that returns early if the
3126         static cache singleton doesn't exist (fixes the bug), otherwise
3127         calls the clearImageAndSubimages() instance method.
3128         (WebCore::SubimageCacheWithTimer::subimage): Rename from
3129         getSubimage().  Use `auto` after renaming SubimageCache typedef
3130         to SubimageCacheHashSet.
3131         (WebCore::SubimageCacheWithTimer::clearImageAndSubimages):
3132         Rename from clearImage().  Modernize loops.
3133         (WebCore::SubimageCacheWithTimer::subimageCache): Change
3134         WebCore::subimageCache() to a static class method that creates
3135         the subimage cache singleton if it doesn't exist yet, and
3136         returns it.
3137         (WebCore::SubimageCacheWithTimer::subimageCacheExists): Add.
3138         Returns false if the subimage cache singleton has not been
3139         created yet.
3140
3141         * platform/graphics/cg/SubimageCacheWithTimer.h:
3142         - Rename typedef SubimageCache to SubimageCacheHashSet to avoid
3143           general confusion.
3144         (WebCore::SubimageCacheWithTimer::getSubimage):
3145         (WebCore::SubimageCacheWithTimer::clearImage):
3146         - Change to static class methods.
3147         (WebCore::SubimageCacheWithTimer::SubimageCacheWithTimer):
3148         - Make private.
3149         (WebCore::SubimageCacheWithTimer::subimage):
3150         - Rename from getSubimage() and make private.
3151         (WebCore::SubimageCacheWithTimer::clearImageAndSubimages):
3152         - Rename from clearImage() and make private.
3153         (WebCore::SubimageCacheWithTimer::subimageCache):
3154         - Rename from WebCore::subimageCache() and make a private static
3155           class method.
3156         (WebCore::SubimageCacheWithTimer::subimageCacheExists):
3157         - Add private static class method.
3158         (WebCore::SubimageCacheWithTimer::s_cache):
3159         - Declare private static variable to hold singleton.
3160
3161 2018-05-23  Eric Carlson  <eric.carlson@apple.com>
3162
3163         Avoid loading AVFoundation to check supported MIME types if possible
3164         https://bugs.webkit.org/show_bug.cgi?id=185839
3165         <rdar://problem/40182010>
3166
3167         Reviewed by Jer Noble.
3168
3169         Avoid loading AVFoundation to call +[AVURLAssetClass audiovisualMIMETypes] as long as possible,
3170         and when they are loaded send the list to the UI process so it can pass it to all extant
3171         and all new web processes so they can won't have call it at all.
3172
3173         * WebCore.xcodeproj/project.pbxproj:
3174         * platform/graphics/ImageDecoder.cpp:
3175         (WebCore::ImageDecoder::create): Don't call ImageDecoderAVFObjC::canDecodeType if 
3176         ImageDecoderCG can decode the type so we don't have to load AVFoundation.
3177         (WebCore::ImageDecoder::supportsMediaType): Return as soon as a decoder class says
3178         it supports a media type to avoid calling more than one. Call ImageDecoderAVFObjC last.
3179
3180         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h:
3181         (WebCore::AVFoundationMIMETypeCache::setCacheMIMETypesCallback):
3182         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
3183         (WebCore::AVFoundationMIMETypeCache::singleton): Simplify.
3184         (WebCore::AVFoundationMIMETypeCache::setSupportedTypes): Cache the supplied list of types
3185         so we won't have to load AVFoundation when asked for types later.
3186         (WebCore::AVFoundationMIMETypeCache::types):
3187         (WebCore::AVFoundationMIMETypeCache::supportsContentType): New convenience routine.
3188         (WebCore::AVFoundationMIMETypeCache::canDecodeType): Ditto.
3189         (WebCore::AVFoundationMIMETypeCache::isAvailable const): New, check to see if AVFoundation.framework
3190         is available without actually loading it.
3191         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes): Load types if possible.
3192         (WebCore::AVFoundationMIMETypeCache::AVFoundationMIMETypeCache): Deleted.
3193         (WebCore::AVFoundationMIMETypeCache::loadTypes): Deleted.
3194
3195         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3196         (WebCore::ImageDecoderAVFObjC::create): Use AVFoundationMIMETypeCache::isAvailable instead
3197         of loading the frameworks.
3198         (WebCore::ImageDecoderAVFObjC::supportsMediaType): Ditto.
3199         (WebCore::ImageDecoderAVFObjC::supportsContentType): Use AVFoundationMIMETypeCache::supportsContentType.
3200         (WebCore::ImageDecoderAVFObjC::canDecodeType): Use AVFoundationMIMETypeCache::canDecodeType.
3201
3202         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3203         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): ASSERT if the 
3204         AVFoundationMIMETypeCache is empty, it shouldn't be possible to get here in that state.
3205         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Use AVFoundationMIMETypeCache::supportsContentType.
3206         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Use AVFoundationMIMETypeCache::canDecodeType.
3207
3208         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3209         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): ASSERT if the 
3210         AVFoundationMIMETypeCache is empty, it shouldn't be possible to get here in that state.
3211         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Use AVFoundationMIMETypeCache::canDecodeType.
3212
3213         * platform/graphics/cg/ImageDecoderCG.cpp:
3214         (WebCore::ImageDecoderCG::canDecodeType): New.
3215         * platform/graphics/cg/ImageDecoderCG.h:
3216
3217 2018-05-23  Chris Dumez  <cdumez@apple.com>
3218
3219         RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its cross-origin parent
3220         https://bugs.webkit.org/show_bug.cgi?id=185664
3221         <rdar://problem/36185260>
3222
3223         Reviewed by Simon Fraser.
3224
3225         RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its
3226         cross-origin parent. There was logic in FrameLoader::scrollToFragmentWithParentBoundary()
3227         to temporarily set the 'safeToPropagateScrollToParent' flag to false on the cross-origin
3228         ancestor frame during the call to FrameView::scrollToFragment(). This would correctly
3229         prevent RenderLayer::scrollRectToVisible() to propagate the scroll to the cross-origin
3230         ancestor frame when scrollRectToVisible() is called synchronously. However,
3231         scrollRectToVisible() can get called asynchronously in case of a dirty layout, as part
3232         of the post layout tasks.
3233
3234         To address the issue, we get rid of the safeToPropagateScrollToParent flag on FrameView
3235         and instead update FrameView::safeToPropagateScrollToParent() to do the cross-origin
3236         check. FrameView::safeToPropagateScrollToParent() is called by RenderLayer::scrollRectToVisible()
3237         and this is a lot more robust than relying on a flag which gets temporarily set.
3238
3239         Test: http/tests/navigation/fragment-navigation-cross-origin-subframe-no-scrolling-parent.html
3240
3241         * dom/Document.cpp:
3242         * dom/Document.h:
3243         * loader/FrameLoader.cpp:
3244         (WebCore::FrameLoader::scrollToFragmentWithParentBoundary):
3245         * page/FrameView.cpp:
3246         (WebCore::FrameView::FrameView):
3247         (WebCore::FrameView::reset):
3248         (WebCore::FrameView::safeToPropagateScrollToParent const):
3249         * page/FrameView.h:
3250
3251 2018-05-23  Youenn Fablet  <youenn@apple.com>
3252
3253         NetworkLoadChecker should check cached redirections
3254         https://bugs.webkit.org/show_bug.cgi?id=185849
3255
3256         Reviewed by Chris Dumez.
3257
3258         Covered by rebased tests.
3259
3260         * loader/SubresourceLoader.cpp:
3261         (WebCore::SubresourceLoader::willSendRequestInternal):
3262        Log the case of a redirection with fetch error mode.
3263
3264 2018-05-23  Nan Wang  <n_wang@apple.com>
3265
3266         AX: setValue on contenteditable should preserve whitespace
3267         https://bugs.webkit.org/show_bug.cgi?id=185897
3268
3269         Reviewed by Chris Fleizach.
3270
3271         RenderText is using its parent renderer's style to determine if
3272         whitespace collapsing is necessary. So when setting the innerText
3273         of the element in setValue, let's also set its style in order to 
3274         preserve whitespaces.
3275
3276         Modified an existing test to cover this change.
3277
3278         * accessibility/AccessibilityRenderObject.cpp:
3279         (WebCore::AccessibilityRenderObject::setValue):
3280
3281 2018-05-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3282
3283         [GTK] Silence GCC 8 warnings
3284         https://bugs.webkit.org/show_bug.cgi?id=185556
3285
3286         Reviewed by Žan Doberšek.
3287
3288         Silence remaining -Wcast-function-type warnings by casting through void (*)(void), aka
3289         GCallback.
3290
3291         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
3292         (webkitAccessibleHyperlinkSetProperty):
3293         (webkitAccessibleHyperlinkGetType):
3294         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3295         (webkitAccessibleGetType):
3296         * platform/network/soup/NetworkStorageSessionSoup.cpp:
3297         (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
3298
3299 2018-05-23  Zalan Bujtas  <zalan@apple.com>
3300
3301         [LFC] Move sizing/positioning logic to helper classes
3302         https://bugs.webkit.org/show_bug.cgi?id=185898
3303
3304         Reviewed by Antti Koivisto.
3305
3306         The idea here is to move all the sizing and positioning logic to helper classes so that
3307         the formatting context code stays lean.
3308         This is similar to the dedicated BlockMarginCollapse class for the collapsing logic.
3309         The helper classes have only static functions. These static functions do not mutate the associated DisplayBoxes,
3310         but instead they simply retun the computed values.
3311
3312         * Sources.txt:
3313         * WebCore.xcodeproj/project.pbxproj:
3314         * layout/FormattingContext.cpp:
3315         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
3316         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
3317         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
3318         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
3319         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
3320         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const): Deleted.
3321         (WebCore::Layout::FormattingContext::computeFloatingNonReplacedHeight const): Deleted.
3322         (WebCore::Layout::FormattingContext::computeReplacedHeight const): Deleted.
3323         (WebCore::Layout::FormattingContext::computeReplacedWidth const): Deleted.
3324         (WebCore::Layout::FormattingContext::contentHeightForFormattingContextRoot const): Deleted.
3325         (WebCore::Layout::FormattingContext::computeFloatingNonReplacedWidth const): Deleted.
3326         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const): Deleted.
3327         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedHeight const): Deleted.
3328         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedWidth const): Deleted.
3329         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedPosition const): Deleted.
3330         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const): Deleted.
3331         (WebCore::Layout::FormattingContext::shrinkToFitWidth const): Deleted.
3332         * layout/FormattingContext.h:
3333         * layout/FormattingContextGeometry.cpp: Copied from Source/WebCore/layout/FormattingContext.cpp.
3334         (WebCore::Layout::contentHeightForFormattingContextRoot):
3335         (WebCore::Layout::shrinkToFitWidth):
3336         (WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedHeight):
3337         (WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedWidth):
3338         (WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedHeight):
3339         (WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedWidth):
3340         (WebCore::Layout::FormattingContextGeometry::floatingNonReplacedHeight):
3341         (WebCore::Layout::FormattingContextGeometry::floatingNonReplacedWidth):
3342         (WebCore::Layout::FormattingContextGeometry::floatingReplacedHeight):
3343         (WebCore::Layout::FormattingContextGeometry::floatingReplacedWidth):
3344         (WebCore::Layout::FormattingContextGeometry::outOfFlowNonReplacedPosition):
3345         (WebCore::Layout::FormattingContextGeometry::outOfFlowReplacedPosition):
3346         (WebCore::Layout::FormattingContextGeometry::replacedHeight):
3347         (WebCore::Layout::FormattingContextGeometry::replacedWidth):
3348         * layout/FormattingContextGeometry.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingContext.h.
3349         * layout/blockformatting/BlockFormattingContext.cpp:
3350         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
3351         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
3352         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
3353         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedWidth const): Deleted.
3354         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const): Deleted.
3355         * layout/blockformatting/BlockFormattingContext.h:
3356         * layout/blockformatting/BlockFormattingContextGeometry.cpp: Added.
3357         (WebCore::Layout::BlockFormattingContextGeometry::inFlowNonReplacedHeight):
3358         (WebCore::Layout::BlockFormattingContextGeometry::inFlowNonReplacedWidth):
3359         (WebCore::Layout::BlockFormattingContextGeometry::inFlowReplacedHeight):
3360         (WebCore::Layout::BlockFormattingContextGeometry::inFlowReplacedWidth):
3361         (WebCore::Layout::BlockFormattingContextGeometry::staticPosition):
3362         * layout/blockformatting/BlockFormattingContextGeometry.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingContext.h.
3363         * layout/displaytree/DisplayBox.h:
3364
3365 2018-05-23  Antti Koivisto  <antti@apple.com>
3366
3367         Page keeps reloading when viewing photos in google drive (due to too high canvas memory limits)
3368         https://bugs.webkit.org/show_bug.cgi?id=185903
3369         <rdar://problem/38420562>
3370
3371         Reviewed by Simon Fraser.
3372
3373         The canvas memory usage limits don't work on iOS since the current 2GB minimum limit is
3374         larger than the maximum process size.
3375
3376         * html/HTMLCanvasElement.cpp:
3377         (WebCore::maxActivePixelMemory):
3378
3379         Always base this on the reported ramSize() on iOS. Make it still fairly large to not risk breaking
3380         any currently working content. In practice the limit computes to 448MB on device at the moment.
3381
3382 2018-05-23  Zalan Bujtas  <zalan@apple.com>
3383
3384         [LFC] Implement positioning for replaced out-of-flow elements
3385         https://bugs.webkit.org/show_bug.cgi?id=185902
3386
3387         Reviewed by Antti Koivisto.
3388
3389         * layout/FormattingContext.cpp:
3390         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const):
3391
3392 2018-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
3393
3394         Text can wrap between hyphens and commas
3395         https://bugs.webkit.org/show_bug.cgi?id=185899
3396         <rdar://problem/40118983>
3397
3398         Reviewed by Zalan Bujtas.
3399
3400         Chrome, Firefox, and ICU all agree that text shouldn't wrap there.
3401
3402         Test: fast/text/line-break-hyphen-comma.html
3403
3404         * rendering/BreakLines.cpp:
3405
3406 2018-05-22  Simon Fraser  <simon.fraser@apple.com>
3407
3408         Add notifyutil callbacks to dump the memory cache, and the list of live Pages and Documents
3409         https://bugs.webkit.org/show_bug.cgi?id=185853
3410
3411         Reviewed by Keith Miller.
3412
3413         Add a notifyutil callback to dump the PageCache, which dumps the stats, and the list of live pages.
3414         This can be invoked on iOS and macOS via "notifyutil -p com.apple.WebKit.showPageCache".
3415         
3416         Add a notifyutil callback that dumps the list of all Pages, and the list of all Documents, with
3417         Document pointer address and URL.
3418         This can be invoked on iOS and macOS via "notifyutil -p com.apple.WebKit.showAllDocuments".
3419
3420         * history/PageCache.cpp:
3421         (WebCore::PageCache::PageCache):
3422         (WebCore::PageCache::dump const):
3423         * history/PageCache.h:
3424         * loader/cache/CachedResource.h:
3425         (WebCore::CachedResource::numberOfClients const):
3426         (WebCore::CachedResource::count const): Deleted.
3427         * loader/cache/MemoryCache.cpp:
3428         (WebCore::MemoryCache::MemoryCache):
3429         (WebCore::MemoryCache::pruneLiveResourcesToSize):
3430         (WebCore::MemoryCache::dumpStats):
3431         (WebCore::MemoryCache::dumpLRULists const):
3432         * loader/cache/MemoryCache.h:
3433         * page/mac/PageMac.mm:
3434         (WebCore::Page::platformInitialize):
3435
3436 2018-05-22  Dean Jackson  <dino@apple.com>
3437
3438         Optimized path zoom animation needs a valid UIImage and CGRect
3439         https://bugs.webkit.org/show_bug.cgi?id=185883
3440         <rdar://problem/40306056>
3441
3442         Build fix.
3443
3444         * loader/FrameLoadRequest.h:
3445
3446 2018-05-22  Commit Queue  <commit-queue@webkit.org>
3447
3448         Unreviewed, rolling out r232081.
3449         https://bugs.webkit.org/show_bug.cgi?id=185895
3450
3451         Broke two API tests (Requested by bfulgham_ on #webkit).
3452
3453         Reverted changeset:
3454
3455         "Avoid keeping FormState alive longer than necessary"
3456         https://bugs.webkit.org/show_bug.cgi?id=185877
3457         https://trac.webkit.org/changeset/232081
3458
3459 2018-05-22  Dean Jackson  <dino@apple.com>
3460
3461         Optimized path zoom animation needs a valid UIImage and CGRect
3462         https://bugs.webkit.org/show_bug.cgi?id=185883
3463         <rdar://problem/40306056>
3464
3465         Reviewed by Jon Lee.
3466
3467         Pass the bounding box of the element that was clicked onto
3468         the UI process, so it can perform an animation from that spot.
3469
3470         This involved adding an IntRect to the ResourceRequest, and passing
3471         that info into it from the HTMLAnchorElement, using a new struct
3472         called SystemPreviewInfo.
3473
3474         * html/HTMLAnchorElement.cpp:
3475         (WebCore::HTMLAnchorElement::handleClick):
3476         * loader/FrameLoadRequest.cpp:
3477         (WebCore::FrameLoadRequest::FrameLoadRequest):
3478         * loader/FrameLoadRequest.h:
3479         (WebCore::FrameLoadRequest::FrameLoadRequest):
3480         (WebCore::FrameLoadRequest::isSystemPreview const):
3481         (WebCore::FrameLoadRequest::systemPreviewRect const):
3482         * loader/FrameLoader.cpp:
3483         (WebCore::FrameLoader::urlSelected):
3484         (WebCore::FrameLoader::loadURL):
3485         * loader/FrameLoader.h:
3486         (WebCore::FrameLoader::urlSelected):
3487         * loader/FrameLoaderTypes.h:
3488         * platform/network/ResourceRequestBase.cpp:
3489         (WebCore::ResourceRequestBase::systemPreviewRect const):
3490         (WebCore::ResourceRequestBase::setSystemPreviewRect):
3491         * platform/network/ResourceRequestBase.h:
3492
3493 2018-05-22  Chris Dumez  <cdumez@apple.com>
3494
3495         [POSIX] Use access() instead of stat() in FileSystem::fileExists()
3496         https://bugs.webkit.org/show_bug.cgi?id=185882
3497
3498         Reviewed by Geoffrey Garen.
3499
3500         Use access() instead of stat() in FileSystem::fileExists(). stat() returns a lot of information we
3501         do not leverage and local benchmarking on macOS shows access() being > 80% faster than stat():
3502         stat: 0.31567 (lower is better)
3503         access: 0.16074 (lower is better)
3504         stat: 0.303665 (lower is better)
3505         access: 0.165468 (lower is better)
3506
3507         * platform/posix/FileSystemPOSIX.cpp:
3508         (WebCore::FileSystem::fileExists):
3509
3510 2018-05-22  Brent Fulgham  <bfulgham@apple.com>
3511
3512         Avoid keeping FormState alive longer than necessary
3513         https://bugs.webkit.org/show_bug.cgi?id=185877
3514         <rdar://problem/39329219>
3515
3516         Reviewed by Ryosuke Niwa.
3517
3518         A number of crash fixes were done to prevent FormState objects from being
3519         accessed after their relevant Frames had been destroyed. Unfortunately, this
3520         could cause the FormState to persist after the owning Frame had been
3521         destroyed, resulting in nullptr dereferences.
3522
3523         This patch does the following:
3524
3525         1. Changes to use WeakPtr's for FormState objects passed to completion handlers,
3526            rather than RefPtr, since those completion handlers might fire as part of
3527            the clean-up process during Frame destruction. This allows us to use the FormState
3528            if they are still valid, but gracefully handle cases where a form submission
3529            is cancelled in-flight.
3530         2. Removes some extraneous WTFMove() calls being made on bare FormState pointers.
3531         3. Changes the trap from Bug 183704 so that it only fires if the FormState object
3532            is being retained more than once.
3533
3534         * loader/DocumentLoader.cpp:
3535         (WebCore::DocumentLoader::willSendRequest): Update for new CompletionHandler
3536         signature.
3537         * loader/FormState.cpp:
3538         (WebCore::FormState::willDetachPage): Revise trap to check for retain counts
3539         above one.
3540         * loader/FormState.h:
3541         (WebCore::FormState::weakPtrFactory const): Added.
3542         * loader/FrameLoader.cpp:
3543         (WebCore::FrameLoader::loadFrameRequest): Revise to use WeakPtr for FormState
3544         passed to the completion handler.
3545         (WebCore::FrameLoader::loadURL): Update for new CompletionHandler signature.
3546         (WebCore::FrameLoader::load): Ditto.
3547         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
3548         (WebCore::FrameLoader::loadPostRequest): Ditto.
3549         * loader/PolicyChecker.cpp:
3550         (WebCore::PolicyChecker::checkNavigationPolicy): Revise to use WeakPtr for
3551         FormState passed to the completion handler. Remove some extraneous WTFMove()
3552         calls on bare pointers.
3553         (WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.
3554         * loader/PolicyChecker.h:
3555
3556 2018-05-22  Sihui Liu  <sihui_liu@apple.com>
3557
3558         Conversion between SecurityOriginData and DatabaseIdentifier is asymmetric when port is null
3559         https://bugs.webkit.org/show_bug.cgi?id=185715
3560
3561         Reviewed by Geoffrey Garen.
3562
3563         Fixed the issue of null port when converting between SecurityOriginData and DatabaseIdentifier.
3564
3565         Test: WKWebView.LocalStorageFetchDataRecords.
3566
3567         * page/SecurityOriginData.cpp:
3568         (WebCore::SecurityOriginData::fromDatabaseIdentifier):
3569
3570 2018-05-22  Keith Miller  <keith_miller@apple.com>
3571
3572         We should have a CoW storage for NewArrayBuffer arrays.
3573         https://bugs.webkit.org/show_bug.cgi?id=185003
3574
3575         Reviewed by Filip Pizlo.
3576
3577         * bindings/js/JSDOMConvertSequences.h:
3578         (WebCore::Detail::NumericSequenceConverter::convertArray):
3579         (WebCore::Detail::SequenceConverter::convertArray):
3580
3581 2018-05-22  Ryan Haddad  <ryanhaddad@apple.com>
3582
3583         Unreviewed, rolling out r232052.
3584
3585         Breaks internal builds.
3586
3587         Reverted changeset:
3588
3589         "Use more C++17"
3590         https://bugs.webkit.org/show_bug.cgi?id=185176
3591         https://trac.webkit.org/changeset/232052
3592
3593 2018-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3594
3595         [GTK] WebDriver: Network process crash when running imported/w3c/webdriver/tests/delete_cookie/delete.py::test_unknown_cookie
3596         https://bugs.webkit.org/show_bug.cgi?id=185867
3597
3598         Reviewed by Michael Catanzaro.
3599
3600         We need to null check the value returned by URL::createSoupURI() before passing it to soup.
3601
3602         * platform/network/soup/CookieJarSoup.cpp:
3603         (WebCore::setCookiesFromDOM):
3604         (WebCore::cookiesForSession):
3605         (WebCore::getRawCookies):
3606         (WebCore::deleteCookie):
3607         * platform/network/soup/NetworkStorageSessionSoup.cpp:
3608         (WebCore::NetworkStorageSession::getCookies):
3609
3610 2018-05-22  Zalan Bujtas  <zalan@apple.com>
3611
3612         [LFC] Implement positioning for non-replaced out-of-flow elements.
3613         https://bugs.webkit.org/show_bug.cgi?id=185858
3614
3615         Reviewed by Antti Koivisto.
3616
3617         In certain cases, the out-of-flow element's final position depends on the element's size.
3618         Call computeOutOfFlowPosition() after width/height are resolved.
3619
3620         * layout/FormattingContext.cpp:
3621         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
3622         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
3623         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedPosition const):
3624         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedPosition const):
3625         * layout/FormattingContext.h:
3626
3627 2018-05-22  Olivier Blin  <olivier.blin@softathome.com>
3628
3629         Fix build without MathML
3630         https://bugs.webkit.org/show_bug.cgi?id=185865
3631
3632         Reviewed by Frédéric Wang.
3633
3634         Regression(r226654): [RenderTreeBuilder] Move MathML addChild logic to RenderTreeBuilder
3635         https://bugs.webkit.org/show_bug.cgi?id=181443
3636
3637         Regression(r229694): Put the DOM in IsoHeaps
3638         https://bugs.webkit.org/show_bug.cgi?id=183546
3639
3640         No new tests, build fix.
3641
3642         * mathml/MathMLUnknownElement.cpp:
3643         * mathml/MathMLUnknownElement.h:
3644         * rendering/updating/RenderTreeBuilder.cpp:
3645         (WebCore::RenderTreeBuilder::RenderTreeBuilder):
3646         (WebCore::RenderTreeBuilder::attach):
3647         * rendering/updating/RenderTreeBuilder.h:
3648         * rendering/updating/RenderTreeBuilderMathML.cpp:
3649         * rendering/updating/RenderTreeBuilderMathML.h:
3650
3651 2018-05-22  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3652
3653         [GStreamer] Don't set the ReadyState to HaveNothing when an error occurs in playback pipeline
3654         https://bugs.webkit.org/show_bug.cgi?id=185725
3655
3656         Reviewed by Philippe Normand.
3657
3658         The ReadyState should not be set to HaveNothing when an error occurs in playback pipeline, because
3659         at least we should have the metadata in order to have an error in pipeline.
3660
3661         Here is the definition of HaveNothing state in W3C spec https://dev.w3.org/html5/spec-preview/media-elements.html#ready-states
3662         "HAVE_NOTHING (numeric value 0): No information regarding the media resource is available. No data for the current
3663         playback position is available. Media elements whose networkState attribute is NETWORK_EMPTY are always in the HAVE_NOTHING state."
3664
3665         In MSE case, this patch fixes the crashes of the followings WPT encrypted-media tests:
3666         - clearkey-mp4-playback-temporary-clear-encrypted.https.html
3667         - clearkey-mp4-playback-temporary-multikey-sequential.https.html
3668         - clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html
3669
3670         Here is the cause of the crashes: When an error occurs in playback pipeline like no decipher key, in case of encrypted content,
3671         the MediaPlayerPrivateGstreamer sets NetworkState to FormatError which causes the detachment of MediaElement from MediaSource,
3672         then MediaPlayerPrivateGstreamer sets the ReadyState to HaveNothing which causes a trying again to play the same URI,
3673         thus the crash occurs because the MediaElement is detached from MediaSource, see bugzilla for more details.
3674         Note: these crashes should be fixed in 185242 but unfortunately it isn't the case. See bug 185242 for more details.
3675
3676         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3677         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3678
3679 2018-05-22  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3680
3681         [MSE][GStreamer] Fix the deadlock caused by bug 185242 (r231351)
3682         https://bugs.webkit.org/show_bug.cgi?id=185723
3683
3684         Reviewed by Xabier Rodriguez-Calvar.
3685
3686         After a detailed investigation, we found that, the patch r231351 doesn't fix the crash that expected to fix,
3687         it just replaces it by a deadlock. Now the crash is fixed in the bug 185725.
3688
3689         This Patch will remove a part of r231351 that causes the deadlock.
3690
3691         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
3692         (webKitMediaSrcFreeStream):
3693
3694 2018-05-21  Yusuke Suzuki  <utatane.tea@gmail.com>
3695
3696         Use more C++17
3697         https://bugs.webkit.org/show_bug.cgi?id=185176
3698
3699         Reviewed by JF Bastien.
3700
3701         * Configurations/Base.xcconfig:
3702         * DerivedSources.make:
3703         * platform/ios/LegacyTileGrid.mm:
3704         (WebCore::LegacyTileGrid::dropDistantTiles):
3705
3706 2018-05-21  Zalan Bujtas  <zalan@apple.com>
3707
3708         [LFC] Box::isDescendantOf() should work with out-of-flow elements.
3709         https://bugs.webkit.org/show_bug.cgi?id=185812
3710
3711         Reviewed by Antti Koivisto.
3712
3713         Use the containing block chain instead of the parent chain to check for isDescendantOf().
3714         (containing block is not always the direct parent)
3715
3716         * layout/layouttree/LayoutBox.cpp:
3717         (WebCore::Layout::Box::isDescendantOf const):
3718
3719 2018-05-21  Chris Nardi  <cnardi@chromium.org>
3720
3721         Remove dead exception in MediaList.appendMedium
3722         https://bugs.webkit.org/show_bug.cgi?id=185278
3723
3724         Reviewed by Chris Dumez.
3725
3726         MediaList.appendMedium was able to throw an exception, but MediaQuerySet::add() always
3727         returned true, making it impossible for that exception to be thrown. This matched the
3728         spec, as |appendMedium| is not specified to throw an exception. Remove the dead code
3729         surrounding the exception, and make MediaQuerySet::add() return false if the medium is
3730         not added.
3731
3732         No new/modified tests as there should be no functional changes.
3733
3734         * css/MediaList.cpp:
3735         (WebCore::MediaQuerySet::add):
3736         (WebCore::MediaList::appendMedium):
3737         * css/MediaList.h:
3738         * css/MediaList.idl:
3739
3740 2018-05-21  Chris Dumez  <cdumez@apple.com>
3741
3742         File's structured serialization should serialize lastModified attribute
3743         https://bugs.webkit.org/show_bug.cgi?id=185773
3744
3745         Reviewed by Youenn Fablet.
3746
3747         Update our implementation for the stuctured serialization of a File to include
3748         its lastModified attribute, as per:
3749         - https://w3c.github.io/FileAPI/#file-section
3750
3751         No new tests, rebaselined existing test.
3752
3753         * bindings/js/SerializedScriptValue.cpp:
3754         (WebCore::CloneSerializer::write):
3755         (WebCore::CloneDeserializer::readFile):
3756         * fileapi/File.cpp:
3757         (WebCore::File::File):
3758         * fileapi/File.h:
3759
3760 2018-05-21  Zalan Bujtas  <zalan@apple.com>
3761
3762         [LFC] Add FormattingContext::validateGeometryConstraintsAfterLayout
3763         https://bugs.webkit.org/show_bug.cgi?id=185811
3764
3765         Reviewed by Antti Koivisto.
3766
3767         Also implement LayoutDescendantIterator and fix LayoutIterator.
3768
3769         * WebCore.xcodeproj/project.pbxproj:
3770         * layout/FormattingContext.cpp:
3771         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3772         * layout/FormattingContext.h:
3773         * layout/blockformatting/BlockFormattingContext.cpp:
3774         (WebCore::Layout::BlockFormattingContext::layout const):
3775         * layout/layouttree/LayoutDescendantIterator.h: Added.
3776         (WebCore::Layout::LayoutDescendantIterator<T>::LayoutDescendantIterator):
3777         (WebCore::Layout::LayoutDescendantIterator<T>::operator):
3778         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::LayoutDescendantIteratorAdapter):
3779         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::begin):
3780         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::end):
3781         (WebCore::Layout::LayoutDescendantIteratorAdapter<T>::at):
3782         (WebCore::Layout::descendantsOfType):
3783         * layout/layouttree/LayoutIterator.h:
3784         (WebCore::Layout::LayoutBoxTraversal::firstChild):
3785         (WebCore::Layout::LayoutBoxTraversal::nextAncestorSibling):
3786         (WebCore::Layout::LayoutBoxTraversal::next):
3787         (WebCore::Layout::LayoutBoxTraversal::nextSkippingChildren):
3788         (WebCore::Layout::Traversal::firstChild):
3789         (WebCore::Layout::Traversal::nextSibling):
3790         (WebCore::Layout::Traversal::previousSibling):
3791         (WebCore::Layout::Traversal::findAncestorOfType):
3792         (WebCore::Layout::Traversal::firstWithin):
3793         (WebCore::Layout::Traversal::next):
3794         (WebCore::Layout::LayoutIterator<T>::traversePreviousSibling):
3795         (WebCore::Layout::LayoutIterator<T>::traverseAncestor):
3796         (WebCore::Layout::Traversal::nextAncestorSibling): Deleted.
3797         (WebCore::Layout::Traversal::nextWithin): Deleted.
3798
3799 2018-05-21  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3800
3801         [Curl] Bugfix for r231968, Suspend/Resume with WK2
3802         https://bugs.webkit.org/show_bug.cgi?id=185830
3803
3804         The flags are needed to be updated even if it is cancelled or finished to cleanup correctly.
3805         Also fixed trivial bug for very rare case (hard to produce the situation).
3806
3807         Reviewed by Youenn Fablet.
3808
3809         No new tests because WK2 is not ready for WinCairo yet in public., tested internaly.
3810
3811         * platform/network/curl/CurlRequest.cpp:
3812         (WebCore::CurlRequest::suspend):
3813         (WebCore::CurlRequest::resume):
3814         (WebCore::CurlRequest::pausedStatusChanged):
3815
3816 2018-05-21  Commit Queue  <commit-queue@webkit.org>
3817
3818         Unreviewed, rolling out r232030.
3819         https://bugs.webkit.org/show_bug.cgi?id=185850
3820
3821         "Caused
3822         TestWebKitAPI.IndexedDB.StructuredCloneBackwardCompatibility
3823         API test to fail" (Requested by cdumez on #webkit).
3824
3825         Reverted changeset:
3826
3827         "File's structured serialization should serialize lastModified
3828         attribute"
3829         https://bugs.webkit.org/show_bug.cgi?id=185773
3830         https://trac.webkit.org/changeset/232030
3831
3832 2018-05-21  Daniel Bates  <dabates@apple.com>
3833
3834         REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR
3835         https://bugs.webkit.org/show_bug.cgi?id=185789
3836         <rdar://problem/40380175>
3837
3838         Reviewed by Andy Estes.
3839
3840         Fixes an issue where CSP report-only policies were ignored for DocumentThreadableLoader and
3841         PingLoad initiated loads as a result of moving CSP processing to NetworkProcess.
3842
3843         Have NetworkLoadChecker implement the ContentSecurityPolicyClient interface and support logging
3844         console messages, sending CSP reports, and dispatching SecurityPolicyViolation events. To support
3845         the latter we introduce a new WebPage message, EnqueueSecurityPolicyViolationEvent, to enqueue
3846         a SecurityPolicyViolationEvent created from an event init dictionary on the document's event
3847         dispatch queue.
3848
3849         Additionally, shorten the description for a ResourceError caused by CSP to "Blocked by Content Security Policy"
3850         because the CSP code run in NetworkProcess can now log its more detailed error description to
3851         Web Inspector.
3852
3853         Tests: http/tests/security/contentSecurityPolicy/connect-src-beacon-allowed.html
3854                http/tests/security/contentSecurityPolicy/connect-src-beacon-blocked.html
3855                http/tests/security/contentSecurityPolicy/report-only-connect-src-beacon-redirect-blocked.php
3856                http/tests/security/contentSecurityPolicy/report-only-connect-src-xmlhttprequest-redirect-to-blocked.php
3857
3858         * WebCore.xcodeproj/project.pbxproj: Change SecurityPolicyViolationEvent.h from a project header to
3859         a private header so that we can include it in WebKit code.
3860         * dom/Document.cpp:
3861         (WebCore::Document::enqueueSecurityPolicyViolationEvent): Added.
3862         * dom/Document.h:
3863
3864         * dom/EventInit.h:
3865         (WebCore::EventInit::encode const):
3866         (WebCore::EventInit::decode
3867         * dom/SecurityPolicyViolationEvent.h:
3868         (WebCore::SecurityPolicyViolationEvent::Init::encode const):
3869         (WebCore::SecurityPolicyViolationEvent::Init::decode):
3870         Support encoding and decoding for the event.
3871
3872         * loader/DocumentLoader.cpp:
3873         (WebCore::DocumentLoader::enqueueSecurityPolicyViolationEvent): Formerly named "dispatchSecurityPolicyViolationEvent".
3874         (WebCore::DocumentLoader::dispatchSecurityPolicyViolationEvent): Deleted; renamed to "enqueueSecurityPolicyViolationEvent".
3875         * loader/DocumentLoader.h:
3876
3877         * loader/DocumentThreadableLoader.cpp:
3878         (WebCore::DocumentThreadableLoader::redirectReceived): While I am here, move the check for whether the loader
3879         strategy took responsibility for performing security checks to be before we perform the CSP check to avoid doing
3880         such CSP checks twice in the case that the loader strategy already did them.
3881         (WebCore::DocumentThreadableLoader::didFail): Remove code that checked the CSP policy if the load failed. When
3882         the loader strategy (NetworkProcess) is responsible for performing security checks then this code would never
3883         be executed for a violation of a CSP report-only policy because the loader does not and should not fail the load
3884         for a report-only violations. As the name implies, a report-only violation is only reported. That is, it is not
3885         enforced such that the load is blocked; => fail the load.
3886         (WebCore::DocumentThreadableLoader::reportContentSecurityPolicyError): Update the error description to more
3887         accurately describe the error and be consistent with the error message used in NetworkProcess. This error
3888         message is shown for a redirect blocked by CSP regardless of whether the redirect was to a same-origin or
3889         cross-origin resource. I chose to make the error message more vague than necessary for simplicity because
3890         the CSP code will log a more detailed message for this error than could ever be captured by error message
3891         for the ResourceError. Also use ASCIILiteral to efficiently construct the String object for the error
3892         message.
3893
3894         * page/csp/ContentSecurityPolicy.cpp:
3895         (WebCore::ContentSecurityPolicy::reportViolation const): Build up a SecurityPolicyViolationEvent::Init and
3896         pass that to the delegate to dispatch.
3897         * page/csp/ContentSecurityPolicy.h: Export allowScriptFromSource() and allowChildContextFromSource() so that
3898         we can call them from WebKit.
3899         * page/csp/ContentSecurityPolicyClient.h: Update for renaming.
3900         * platform/network/ResourceRequestBase.h: Define a new requester type to be able to differentiate a request
3901         initiated by importScripts() from other requests. We use this to perform the appropriate CSP checks in NetworkProcess.
3902         * workers/WorkerScriptLoader.cpp:
3903         (WebCore::WorkerScriptLoader::loadSynchronously): Set the requester on the ResourceRequest to ResourceRequest::Requester::ImportScripts
3904         so that we can differentiate this request from other requests. See remark for file ResourceRequestBase.h for
3905         more details.
3906
3907 2018-05-21  Chris Dumez  <cdumez@apple.com>
3908
3909         File's structured serialization should serialize lastModified attribute
3910         https://bugs.webkit.org/show_bug.cgi?id=185773
3911
3912         Reviewed by Youenn Fablet.
3913
3914         Update our implementation for the stuctured serialization of a File to include
3915         its lastModified attribute, as per:
3916         - https://w3c.github.io/FileAPI/#file-section
3917
3918         No new tests, rebaselined existing test.
3919
3920         * bindings/js/SerializedScriptValue.cpp:
3921         (WebCore::CloneSerializer::write):
3922         (WebCore::CloneDeserializer::readFile):
3923         * fileapi/File.cpp:
3924         (WebCore::File::File):
3925         * fileapi/File.h:
3926
3927 2018-05-21  Jer Noble  <jer.noble@apple.com>
3928
3929         Complete fix for enabling modern EME by default
3930         https://bugs.webkit.org/show_bug.cgi?id=185770
3931         <rdar://problem/40368220>
3932
3933         Reviewed by Eric Carlson.
3934
3935         * Configurations/FeatureDefines.xcconfig:
3936
3937 2018-05-21  Olivier Blin  <olivier.blin@softathome.com>
3938
3939         [CMake][WebCore] fix sqlite include dir variable
3940         https://bugs.webkit.org/show_bug.cgi?id=185825
3941
3942         Reviewed by Konstantin Tokarev.
3943
3944         WebCore's CMakeLists.txt used SQLITE_INCLUDE_DIRS, but only SQLITE_INCLUDE_DIR is defined.
3945
3946         No new tests, build fix only.
3947
3948         * CMakeLists.txt: Use SQLITE_INCLUDE_DIR instead of SQLITE_INCLUDE_DIRS.
3949
3950 2018-05-21  Olivier Blin  <olivier.blin@softathome.com>
3951
3952         Propagate WebCore system include dirs in WebCoreHeaderInterface
3953         https://bugs.webkit.org/show_bug.cgi?id=185822
3954
3955         Reviewed by Michael Catanzaro.
3956
3957         System include directories from WebCore are not propagated anymore to its users.
3958         For example gcrypt, sqlite and ICU system headers defined in PAL are not properly passed to WebKit build.
3959
3960         This may have been caused partly by the fix in r230385:
3961         [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
3962         https://bugs.webkit.org/show_bug.cgi?id=184127
3963
3964         No new tests, build fix.
3965
3966         * CMakeLists.txt:
3967
3968 2018-05-21  Olivier Blin  <olivier.blin@softathome.com>
3969
3970         Fix FrameLoader build without video
3971         https://bugs.webkit.org/show_bug.cgi?id=185821
3972
3973         Reviewed by Michael Catanzaro.
3974
3975         Regression(r231392): Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
3976         https://bugs.webkit.org/show_bug.cgi?id=185288
3977
3978         No new tests, build fix only.
3979
3980         * loader/FrameLoader.cpp:
3981         (WebCore::FrameLoader::checkCompleted): Flag HTMLMediaElement::isRunningDestructor() usage.
3982
3983 2018-05-21  Sam Weinig  <sam@webkit.org>
3984
3985         Modernize RenderStyleConstants.h - Part 1
3986         https://bugs.webkit.org/show_bug.cgi?id=185809
3987
3988         Reviewed by Yusuke Suzuki.
3989             
3990         Modernized the first set of enums in RenderStyleConstants.h by:
3991             - Converting them to enum classes
3992             - Renaming them to remove unnecessary prefix 'E's
3993             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
3994             - Renaming to match modern conventions (e.g BNONE -> None)
3995             - Reformatting them so that each value is on its own line.
3996
3997         Modernizes the following enums:
3998             PrintColorAdjust
3999             StyleDifference
4000             StyleDifferenceContextSensitiveProperty
4001             ColumnFill
4002             ColumnSpan
4003             BorderCollapse (renamed from EBorderCollapse)
4004             BorderStyle (renamed from EBorderStyle)
4005             BorderPrecedence (renamed from EBorderPrecedence)
4006             OutlineIsAuto
4007             PositionType (renamed from EPosition)
4008             Float (renamed from EFloat)
4009             MarginCollapse (renamed from EMarginCollapse)
4010             BoxDecorationBreak (renamed from EBoxDecorationBreak)
4011             BoxSizing (renamed from EBoxSizing)
4012             Overflow (renamed from EOverflow)
4013             VerticalAlign (renamed from EVerticalAlign)
4014             Clear (renamed from EClear)
4015             TableLayoutType (renamed from ETableLayout)
4016             TextCombine
4017             FillAttachment (renamed from EFillAttachment)
4018             FillBox (renamed from EFillBox)
4019             FillRepeat (renamed from EFillRepeat)
4020             FillLayerType (renamed from EFillLayerType)
4021             FillSizeType (renamed from EFillSizeType)
4022             MaskSourceType (renamed from EMaskSourceType)
4023             BoxPack (renamed from EBoxPack)
4024             BoxAlignment (renamed from EBoxAlignment)
4025             BoxOrient (renamed from EBoxOrient)
4026             BoxLines (renamed from EBoxLines)
4027             BoxDirection (renamed from EBoxDirection)
4028             AlignContent (renamed from EAlignContent)
4029             FlexDirection (renamed from EFlexDirection)