[Win] REGRESSION(r232486) 'WebCore::RenderTheme::activeListBoxSelectionBackgroundColo...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-06-04  Timothy Hatcher  <timothy@apple.com>
2
3         [Win] REGRESSION(r232486) 'WebCore::RenderTheme::activeListBoxSelectionBackgroundColor': function does not take 0 arguments
4         https://bugs.webkit.org/show_bug.cgi?id=186296
5
6         Unreviewed build fix.
7
8         * platform/win/PopupMenuWin.cpp:
9         (WebCore::PopupMenuWin::paint):
10         * rendering/RenderThemeWin.cpp:
11         (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
12
13 2018-06-04  Chris Dumez  <cdumez@apple.com>
14
15         Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
16         https://bugs.webkit.org/show_bug.cgi?id=186287
17         <rdar://problem/40783352>
18
19         Reviewed by Youenn Fablet.
20
21         Tests: http/wpt/cross-origin-window-policy/allow-postmessage-from-deny.html
22                http/wpt/cross-origin-window-policy/allow-postmessage.html
23                http/wpt/cross-origin-window-policy/cross-origin-window-policy-header.html
24                http/wpt/cross-origin-window-policy/navigation-from-opener-via-open-target.html
25                http/wpt/cross-origin-window-policy/navigation-from-subframe-via-anchor-target.html
26
27         * bindings/js/JSDOMBindingSecurity.cpp:
28         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginWindowPolicy):
29         * bindings/js/JSDOMBindingSecurity.h:
30         * bindings/js/JSDOMWindowCustom.cpp:
31         (WebCore::effectiveCrossOriginWindowPolicyForAccess):
32         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
33         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
34         (WebCore::addCrossOriginWindowPropertyNames):
35         (WebCore::addScopedChildrenIndexes):
36         * bindings/scripts/CodeGeneratorJS.pm:
37         (GenerateAttributeGetterBodyDefinition):
38         (GetCrossOriginsOptionsFromExtendedAttributeValue):
39         (GenerateAttributeSetterBodyDefinition):
40         (GenerateOperationBodyDefinition):
41         * bindings/scripts/IDLAttributes.json:
42         * dom/Document.cpp:
43         (WebCore::Document::canNavigate):
44         * loader/FrameLoader.cpp:
45         (WebCore::FrameLoader::didBeginDocument):
46         * page/AbstractDOMWindow.cpp:
47         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
48         * page/AbstractDOMWindow.h:
49         (WebCore::AbstractDOMWindow::crossOriginWindowPolicy):
50         (WebCore::AbstractDOMWindow::setCrossOriginWindowPolicy):
51         * page/DOMWindow.idl:
52         * page/Settings.yaml:
53         * platform/network/HTTPHeaderNames.in:
54         * platform/network/HTTPParsers.cpp:
55         (WebCore::parseCrossOriginWindowPolicyHeader):
56         * platform/network/HTTPParsers.h:
57
58 2018-06-04  Brent Fulgham  <bfulgham@apple.com>
59
60         REGRESSION(r231291): InputType should hold a WeakPtr to its HTMLInputElement
61         https://bugs.webkit.org/show_bug.cgi?id=186096
62         <rdar://problem/40651015>
63
64         Reviewed by Ryosuke Niwa.
65
66         Now that the InputType may be kept alive as part of in-flight form submissions, we
67         shouldn't assume that the referenced HTMLInputElement is still valid before using it.
68
69         The only time we should be lacking a referencing element is in cases where the InputType
70         is changing, either through a change in the HTMLInputElement's type attribute. In those
71         cases we should check for a valid HTMLInputElement. In other cases, we should ASSERT.
72
73         * html/BaseButtonInputType.cpp:
74         (WebCore::BaseButtonInputType::createInputRenderer):
75         (WebCore::BaseButtonInputType::setValue):
76         * html/BaseCheckableInputType.cpp:
77         (WebCore::BaseCheckableInputType::saveFormControlState const):
78         (WebCore::BaseCheckableInputType::restoreFormControlState):
79         (WebCore::BaseCheckableInputType::appendFormData const):
80         (WebCore::BaseCheckableInputType::handleKeydownEvent):
81         (WebCore::BaseCheckableInputType::accessKeyAction):
82         (WebCore::BaseCheckableInputType::setValue):
83         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
84         (WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Add a nullptr check
85         here, since this is called directly by code that causes the old InputType to be removed,
86         which could leave us with a nullptr element().
87         * html/BaseClickableWithKeyInputType.cpp:
88         (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
89         (WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
90         (WebCore::BaseClickableWithKeyInputType::accessKeyAction):
91         * html/BaseDateAndTimeInputType.cpp:
92         (WebCore::BaseDateAndTimeInputType::attributeChanged): Add a nullptr check
93         here, since this is called directly by code that causes the old InputType to be removed,
94         which could leave us with a nullptr element().
95         * html/BaseTextInputType.cpp:
96         (WebCore::BaseTextInputType::patternMismatch const):
97         * html/CheckboxInputType.cpp:
98         (WebCore::CheckboxInputType::valueMissing const):
99         (WebCore::CheckboxInputType::willDispatchClick):
100         (WebCore::CheckboxInputType::didDispatchClick):
101         (WebCore::CheckboxInputType::shouldAppearIndeterminate const):
102         * html/ColorInputType.cpp:
103         (WebCore::ColorInputType::valueAsColor const):
104         (WebCore::ColorInputType::createShadowSubtree):
105         (WebCore::ColorInputType::handleDOMActivateEvent):
106         (WebCore::ColorInputType::didChooseColor):
107         (WebCore::ColorInputType::updateColorSwatch):
108         (WebCore::ColorInputType::shadowColorSwatch const):
109         (WebCore::ColorInputType::elementRectRelativeToRootView const):
110         (WebCore::ColorInputType::shouldShowSuggestions const):
111         (WebCore::ColorInputType::suggestions const):
112         * html/EmailInputType.cpp:
113         (WebCore::EmailInputType::typeMismatchFor const):
114         (WebCore::EmailInputType::typeMismatch const):
115         (WebCore::EmailInputType::typeMismatchText const):
116         (WebCore::EmailInputType::sanitizeValue const):
117         * html/FileInputType.cpp:
118         (WebCore::FileInputType::appendFormData const):
119         (WebCore::FileInputType::attributeChanged): Add a nullptr check here, since
120         this is called directly by code that causes the old InputType to be removed,
121         which could leave us with a nullptr element().
122         (WebCore::FileInputType::valueMissing const):
123         (WebCore::FileInputType::valueMissingText const):
124         (WebCore::FileInputType::handleDOMActivateEvent):
125         (WebCore::FileInputType::createInputRenderer):
126         (WebCore::FileInputType::setValue):
127         (WebCore::FileInputType::createShadowSubtree):
128         (WebCore::FileInputType::disabledAttributeChanged):
129         (WebCore::FileInputType::multipleAttributeChanged):
130         (WebCore::FileInputType::allowsDirectories const):
131         (WebCore::FileInputType::setFiles):
132         (WebCore::FileInputType::iconLoaded):
133         (WebCore::FileInputType::receiveDroppedFiles):
134         (WebCore::FileInputType::defaultToolTip const):
135         * html/HTMLInputElement.h:
136         (WebCore::HTMLInputElement::weakPtrFactory const):
137         * html/HiddenInputType.cpp:
138         (WebCore::HiddenInputType::saveFormControlState const):
139         (WebCore::HiddenInputType::restoreFormControlState):
140         (WebCore::HiddenInputType::setValue):
141         (WebCore::HiddenInputType::appendFormData const):
142         * html/ImageInputType.cpp:
143         (WebCore::ImageInputType::appendFormData const):
144         (WebCore::ImageInputType::handleDOMActivateEvent):
145         (WebCore::ImageInputType::createInputRenderer):
146         (WebCore::ImageInputType::altAttributeChanged):
147         (WebCore::ImageInputType::srcAttributeChanged):
148         (WebCore::ImageInputType::attach):
149         (WebCore::ImageInputType::height const):
150         (WebCore::ImageInputType::width const):
151         * html/InputType.cpp:
152         (WebCore::InputType::saveFormControlState const):
153         (WebCore::InputType::restoreFormControlState):
154         (WebCore::InputType::isFormDataAppendable const):
155         (WebCore::InputType::appendFormData const):
156         (WebCore::InputType::sizeShouldIncludeDecoration const):
157         (WebCore::InputType::validationMessage const):
158         (WebCore::InputType::createInputRenderer):
159         (WebCore::InputType::blur):
160         (WebCore::InputType::destroyShadowSubtree):
161         (WebCore::InputType::dispatchSimulatedClickIfActive const):
162         (WebCore::InputType::chrome const):
163         (WebCore::InputType::isKeyboardFocusable const):
164         (WebCore::InputType::isMouseFocusable const):
165         (WebCore::InputType::accessKeyAction):
166         (WebCore::InputType::setValue):
167         (WebCore::InputType::visibleValue const):
168         (WebCore::InputType::applyStep):
169         (WebCore::InputType::stepUpFromRenderer):
170         * html/InputType.h:
171         (WebCore::InputType::InputType):
172         (WebCore::InputType::element const):
173         * html/NumberInputType.cpp:
174         (WebCore::NumberInputType::attributeChanged): Add a nullptr check here, since
175         this is called directly by code that causes the old InputType to be removed,
176         which could leave us with a nullptr element().
177         (WebCore::NumberInputType::setValue):
178         (WebCore::NumberInputType::valueAsDouble const):
179         (WebCore::NumberInputType::setValueAsDouble const):
180         (WebCore::NumberInputType::setValueAsDecimal const):
181         (WebCore::NumberInputType::typeMismatch const):
182         (WebCore::NumberInputType::createStepRange const):
183         (WebCore::NumberInputType::sizeShouldIncludeDecoration const):
184         (WebCore::NumberInputType::decorationWidth const):
185         (WebCore::NumberInputType::localizeValue const):
186         (WebCore::NumberInputType::visibleValue const):
187         (WebCore::NumberInputType::convertFromVisibleValue const):
188         (WebCore::NumberInputType::hasBadInput const):
189         (WebCore::NumberInputType::minOrMaxAttributeChanged):
190         (WebCore::NumberInputType::stepAttributeChanged):
191         * html/RadioInputType.cpp:
192         (WebCore::RadioInputType::valueMissing const):
193         (WebCore::RadioInputType::handleKeydownEvent):
194         (WebCore::RadioInputType::handleKeyupEvent):
195         (WebCore::RadioInputType::isKeyboardFocusable const):
196         (WebCore::RadioInputType::shouldSendChangeEventAfterCheckedChanged):
197         (WebCore::RadioInputType::willDispatchClick):
198         (WebCore::RadioInputType::didDispatchClick):
199         (WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
200         * html/RangeInputType.cpp:
201         (WebCore::RangeInputType::attributeChanged): Add a nullptr check here, since
202         this is called directly by code that causes the old InputType to be removed,
203         which could leave us with a nullptr element().
204         (WebCore::RangeInputType::valueAsDouble const):
205         (WebCore::RangeInputType::setValueAsDecimal const):
206         (WebCore::RangeInputType::createStepRange const):
207         (WebCore::RangeInputType::handleMouseDownEvent):
208         (WebCore::RangeInputType::handleTouchEvent):
209         (WebCore::RangeInputType::handleKeydownEvent):
210         (WebCore::RangeInputType::createShadowSubtree):
211         (WebCore::RangeInputType::sliderTrackElement const):
212         (WebCore::RangeInputType::createInputRenderer):
213         (WebCore::RangeInputType::accessKeyAction):
214         (WebCore::RangeInputType::minOrMaxAttributeChanged):
215         (WebCore::RangeInputType::setValue):
216         (WebCore::RangeInputType::updateTickMarkValues):
217         * html/ResetInputType.cpp:
218         (WebCore::ResetInputType::handleDOMActivateEvent):
219         * html/SearchInputType.cpp:
220         (WebCore::SearchInputType::addSearchResult):
221         (WebCore::SearchInputType::maxResultsAttributeChanged):
222         (WebCore::SearchInputType::createInputRenderer):
223         (WebCore::SearchInputType::createShadowSubtree):
224         (WebCore::SearchInputType::handleKeydownEvent):
225         (WebCore::SearchInputType::startSearchEventTimer):
226         (WebCore::SearchInputType::searchEventTimerFired):
227         (WebCore::SearchInputType::searchEventsShouldBeDispatched const):
228         (WebCore::SearchInputType::didSetValueByUserEdit):
229         (WebCore::SearchInputType::sizeShouldIncludeDecoration const):
230         * html/SubmitInputType.cpp:
231         (WebCore::SubmitInputType::appendFormData const):
232         (WebCore::SubmitInputType::handleDOMActivateEvent):
233         * html/TextFieldInputType.cpp:
234         (WebCore::TextFieldInputType::attributeChanged): Add a nullptr check here, since
235         this is called directly by code that causes the old InputType to be removed,
236         which could leave us with a nullptr element().
237         (WebCore::TextFieldInputType::isKeyboardFocusable const):
238         (WebCore::TextFieldInputType::isMouseFocusable const):
239         (WebCore::TextFieldInputType::valueMissing const):
240         (WebCore::TextFieldInputType::setValue):
241         (WebCore::TextFieldInputType::handleKeydownEvent):
242         (WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
243         (WebCore::TextFieldInputType::forwardEvent):
244         (WebCore::TextFieldInputType::elementDidBlur):
245         (WebCore::TextFieldInputType::handleFocusEvent):
246         (WebCore::TextFieldInputType::handleBlurEvent):
247         (WebCore::TextFieldInputType::createInputRenderer):
248         (WebCore::TextFieldInputType::shouldHaveSpinButton const):
249         (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator const):
250         (WebCore::TextFieldInputType::createShadowSubtree):
251         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
252         (WebCore::TextFieldInputType::updatePlaceholderText):
253         (WebCore::TextFieldInputType::appendFormData const):
254         (WebCore::TextFieldInputType::subtreeHasChanged):
255         (WebCore::TextFieldInputType::didSetValueByUserEdit):
256         (WebCore::TextFieldInputType::updateInnerTextValue):
257         (WebCore::TextFieldInputType::focusAndSelectSpinButtonOwner):
258         (WebCore::TextFieldInputType::shouldSpinButtonRespondToMouseEvents):
259         (WebCore::TextFieldInputType::shouldSpinButtonRespondToWheelEvents):
260         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
261         (WebCore::TextFieldInputType::shouldDrawAutoFillButton const):
262         (WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
263         (WebCore::TextFieldInputType::createContainer):
264         (WebCore::TextFieldInputType::createAutoFillButton):
265         (WebCore::TextFieldInputType::updateAutoFillButton):
266         * html/URLInputType.cpp:
267         (WebCore::URLInputType::typeMismatch const):
268
269 2018-06-04  Chris Dumez  <cdumez@apple.com>
270
271         Unreviewed iOS build fix with recent SDKs.
272
273         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
274         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
275
276 2018-06-04  Dean Jackson  <dino@apple.com>
277
278         AR Badging on transparent thumbnail images makes the glyph look really dark
279         https://bugs.webkit.org/show_bug.cgi?id=186289
280         <rdar://problem/40627111>
281
282         Reviewed by Anders Carlsson.
283
284         Clip out the shape for the drop shadow, so that it isn't visible if
285         there is transparent pixel data on top of it.
286
287         * rendering/RenderThemeIOS.mm:
288         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
289
290 2018-06-04  Timothy Hatcher  <timothy@apple.com>
291
292         Selection color is dark when using Safari in dark mode.
293
294         https://bugs.webkit.org/show_bug.cgi?id=186288
295         rdar://problem/38438625
296
297         Reviewed by Simon Fraser.
298
299         Pass StyleColor::Options to all of the selection color functions.
300         Removed supportsSelectionForegroundColors() from RenderThemeMac,
301         to get the default of true, since the forground colors in dark mode
302         can be different now. Use new semantic color methods on NSColor.
303
304         * rendering/RenderElement.cpp:
305         (WebCore::RenderElement::selectionColor const):
306         (WebCore::RenderElement::selectionBackgroundColor const):
307         * rendering/RenderListBox.cpp:
308         (WebCore::RenderListBox::paintItemForeground):
309         (WebCore::RenderListBox::paintItemBackground):
310         * rendering/RenderTheme.cpp:
311         (WebCore::RenderTheme::activeSelectionBackgroundColor const):
312         (WebCore::RenderTheme::inactiveSelectionBackgroundColor const):
313         (WebCore::RenderTheme::activeSelectionForegroundColor const):
314         (WebCore::RenderTheme::inactiveSelectionForegroundColor const):
315         (WebCore::RenderTheme::activeListBoxSelectionBackgroundColor const):
316         (WebCore::RenderTheme::activeListBoxSelectionForegroundColor const):
317         (WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor const):
318         (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const):
319         (WebCore::RenderTheme::platformActiveSelectionForegroundColor const):
320         (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const):
321         (WebCore::RenderTheme::platformInactiveSelectionForegroundColor const):
322         (WebCore::RenderTheme::platformActiveListBoxSelectionBackgroundColor const):
323         (WebCore::RenderTheme::platformActiveListBoxSelectionForegroundColor const):
324         (WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
325         (WebCore::RenderTheme::platformInactiveListBoxSelectionForegroundColor const):
326         * rendering/RenderTheme.h:
327         * rendering/RenderThemeGtk.cpp:
328         (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor const):
329         (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor const):
330         (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor const):
331         (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor const):
332         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor const):
333         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor const):
334         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor const):
335         * rendering/RenderThemeGtk.h:
336         * rendering/RenderThemeIOS.h:
337         * rendering/RenderThemeIOS.mm:
338         (WebCore::RenderThemeIOS::platformActiveSelectionBackgroundColor const):
339         (WebCore::RenderThemeIOS::platformInactiveSelectionBackgroundColor const):
340         * rendering/RenderThemeMac.h:
341         * rendering/RenderThemeMac.mm:
342         (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
343         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
344         (WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
345         (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
346         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
347         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
348         (WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const):
349         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
350         * rendering/RenderThemeWin.cpp:
351         (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const):
352         (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const):
353         (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const):
354         (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):
355         * rendering/RenderThemeWin.h:
356
357 2018-06-04  Chris Dumez  <cdumez@apple.com>
358
359         Update Fetch code to provide more useful exception messages
360         https://bugs.webkit.org/show_bug.cgi?id=186156
361
362         Reviewed by Youenn Fablet.
363
364         Provide more useful error messages in our Loading / Fetch code.
365
366         * Modules/fetch/FetchBodyOwner.cpp:
367         (WebCore::FetchBodyOwner::arrayBuffer):
368         (WebCore::FetchBodyOwner::blob):
369         (WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
370         (WebCore::FetchBodyOwner::formData):
371         (WebCore::FetchBodyOwner::json):
372         (WebCore::FetchBodyOwner::text):
373         * Modules/fetch/FetchHeaders.cpp:
374         (WebCore::canWriteHeader):
375         (WebCore::FetchHeaders::get const):
376         (WebCore::FetchHeaders::has const):
377         * Modules/fetch/FetchRequest.cpp:
378         (WebCore::FetchRequest::setBody):
379         (WebCore::FetchRequest::clone):
380         * Modules/fetch/FetchResponse.cpp:
381         (WebCore::FetchResponse::redirect):
382         (WebCore::FetchResponse::clone):
383         * workers/service/context/ServiceWorkerFetch.cpp:
384         (WebCore::ServiceWorkerFetch::processResponse):
385         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
386         * workers/service/context/ServiceWorkerFetch.h:
387
388 2018-06-04  Daniel Bates  <dabates@apple.com>
389
390         Update Strong Password appearance
391         https://bugs.webkit.org/show_bug.cgi?id=186239
392         <rdar://problem/38183795>
393
394         Reviewed by Brent Fulgham.
395
396         Fix up the gradient mask to start half-way through the visible text and size it to the
397         width of the visible text. Also change the color of the Strong Password label to 80% black.
398
399         We achieve sizing of the gradient to the width of the visible text by changing the CSS display
400         of the inner text element to be an inline-block and specifying "max-width: 100%" so that
401         its maximum width is less than or equal to the width of its containing block. Additionally,
402         only apply strong password-specific inner text element styles when the field is not disabled
403         or read-only and has a strong password appearance. Otherwise these styles, specifically the
404         display type, will adversely effect rendering of the text when the field is disabled or readonly.
405
406         * css/html.css:
407         (input::-webkit-strong-password-auto-fill-button):
408         * html/HTMLInputElement.cpp:
409         (WebCore::autoFillStrongPasswordMaskImage):
410         (WebCore::HTMLInputElement::createInnerTextStyle):
411
412 2018-06-04  Wenson Hsieh  <wenson_hsieh@apple.com>
413
414         [WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
415         https://bugs.webkit.org/show_bug.cgi?id=186279
416
417         Reviewed by Tim Horton.
418
419         Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS). No change in behavior.
420
421         * Modules/mediacontrols/MediaControlsHost.cpp:
422         (WebCore::MediaControlsHost::compactMode const):
423         * html/HTMLMediaElement.cpp:
424         (WebCore::HTMLMediaElement::updatePlayState):
425         * page/Page.cpp:
426         (WebCore::relevantViewRect):
427         * page/SettingsBase.cpp:
428         (WebCore::SettingsBase::defaultMinimumZoomFontSize):
429         (WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled):
430         * page/ViewportConfiguration.cpp:
431         (WebCore::platformDeviceWidthOverride):
432         (WebCore::shouldOverrideShrinkToFitArgument):
433         (WebCore::needsUpdateAfterChangingDisabledAdaptations):
434         * platform/LocalizedStrings.cpp:
435         * platform/LocalizedStrings.h:
436         * platform/audio/ios/MediaSessionManagerIOS.mm:
437         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
438         (-[WebMediaSessionHelper dealloc]):
439         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
440         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
441         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
442         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
443         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
444         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
445         (WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
446         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
447         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
448         (-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
449         (-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
450         (-[WebAVPlayerViewController MY_NO_RETURN]):
451         (-[WebAVPlayerViewController isPictureInPicturePossible]):
452         (-[WebAVPlayerViewController isPictureInPictureActive]):
453         (-[WebAVPlayerViewController pictureInPictureActive]):
454         (-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
455         (-[WebAVPlayerViewController showsPlaybackControls]):
456         (-[WebAVPlayerViewController setShowsPlaybackControls:]):
457         (-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
458         (-[WebAVPlayerViewController setDelegate:]):
459         (VideoFullscreenInterfaceAVKit::setupFullscreen):
460         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
461         (VideoFullscreenInterfaceAVKit::doSetup):
462         (WebCore::supportsPictureInPicture):
463         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
464         (VideoFullscreenControllerContext::willExitFullscreen):
465         * rendering/RenderThemeIOS.h:
466         * rendering/RenderThemeIOS.mm:
467
468 2018-06-04  Youenn Fablet  <youenn@apple.com>
469
470         [WK1] Add an option to restrict communication to localhost sockets
471         https://bugs.webkit.org/show_bug.cgi?id=186249
472
473         Reviewed by Eric Carlson.
474
475         Covered by existing tests.
476         Set explicitly webrtc socket IP address to 127.0.0.1 in testing mode.
477         For that purpose, we need WK1 to create a wrapper around a socket factory,
478         this wrapper being responsible of setting or not the IP address to 127.0.0.1.
479
480         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
481         (WebCore::prepareSocketAddress):
482         (WebCore::BasicPacketSocketFactory::BasicPacketSocketFactory):
483         (WebCore::BasicPacketSocketFactory::setDisableNonLocalhostConnections):
484         (WebCore::BasicPacketSocketFactory::CreateClientTcpSocket):
485         (WebCore::LibWebRTCProvider::createPeerConnection):
486         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
487
488 2018-06-04  Zalan Bujtas  <zalan@apple.com>
489
490         [LFC] Merge width and margin computation for block-level, non-replaced and inline,replaced element in normal flow
491         https://bugs.webkit.org/show_bug.cgi?id=186225
492
493         Reviewed by Antti Koivisto.
494
495         This patch merges the width and horizontal margin computation for
496         https://www.w3.org/TR/CSS22/visudet.html#inline-replaced-width and https://www.w3.org/TR/CSS22/visudet.html#blockwidth
497
498         * layout/FormattingContextGeometry.cpp:
499         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
500         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
501         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
502
503 2018-06-01  Zalan Bujtas  <zalan@apple.com>
504
505         [LFC] Merge width and horizontal margin computation
506         https://bugs.webkit.org/show_bug.cgi?id=186217
507
508         Reviewed by Antti Koivisto.
509
510         We could certainly compute width and maring separately, but to match each steps defined
511         at https://www.w3.org/TR/CSS22/visudet.html, we should just merge width and horizontal margin computations
512         (followed by height and vertical margins).
513         Use 0 computed marings for now.
514
515         * layout/FormattingContext.cpp:
516         (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
517         (WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const):
518         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
519         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
520         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const): Deleted.
521         (WebCore::Layout::FormattingContext::computeFloatingWidth const): Deleted.
522         * layout/FormattingContext.h:
523         * layout/FormattingContextGeometry.cpp:
524         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin):
525         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin):
526         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
527         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
528         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin):
529         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
530         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
531         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
532         (WebCore::Layout::outOfFlowNonReplacedWidth): Deleted.
533         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth): Deleted.
534         (WebCore::Layout::floatingNonReplacedWidth): Deleted.
535         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth): Deleted.
536         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidth): Deleted.
537         (WebCore::Layout::FormattingContext::Geometry::floatingWidth): Deleted.
538         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth): Deleted.
539         * layout/LayoutContext.cpp:
540         (WebCore::Layout::LayoutContext::initializeRoot):
541         * layout/blockformatting/BlockFormattingContext.cpp:
542         (WebCore::Layout::BlockFormattingContext::layout const):
543         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
544         (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
545         (WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
546         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const): Deleted.
547         (WebCore::Layout::BlockFormattingContext::computeMargin const): Deleted.
548         * layout/blockformatting/BlockFormattingContext.h:
549         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
550         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
551         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
552         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth): Deleted.
553         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidth): Deleted.
554         (WebCore::Layout::BlockFormattingContext::Geometry::computedMargin): Deleted.
555         * layout/displaytree/DisplayBox.cpp:
556         (WebCore::Display::Box::marginBox const):
557         * layout/displaytree/DisplayBox.h:
558         (WebCore::Display::Box::setHasValidVerticalMargin):
559         (WebCore::Display::Box::setHasValidHorizontalMargin):
560         (WebCore::Display::Box::invalidateMargin):
561         (WebCore::Display::Box::setHorizontalMargin):
562         (WebCore::Display::Box::setVerticalMargin):
563         (WebCore::Display::Box::marginTop const):
564         (WebCore::Display::Box::marginLeft const):
565         (WebCore::Display::Box::marginBottom const):
566         (WebCore::Display::Box::marginRight const):
567         (WebCore::Display::Box::Edges::Edges): Deleted.
568         (WebCore::Display::Box::setHasValidMargin): Deleted.
569         (WebCore::Display::Box::setMargin): Deleted.
570
571 2018-06-03  Michael Catanzaro  <mcatanzaro@igalia.com>
572
573         REGRESSION(r232338): [GTK] Broke a few layout tests
574         https://bugs.webkit.org/show_bug.cgi?id=186244
575
576         Unreviewed, also rollout r232392.
577
578         * rendering/RenderTheme.cpp:
579         (WebCore::RenderTheme::adjustStyle):
580         * rendering/RenderTheme.h:
581         (WebCore::RenderTheme::adjustListboxStyle const): Deleted.
582         * rendering/RenderThemeGtk.cpp:
583         (WebCore::RenderThemeGtk::adjustListboxStyle const): Deleted.
584         * rendering/RenderThemeGtk.h:
585
586 2018-06-03  Michael Catanzaro  <mcatanzaro@igalia.com>
587
588         REGRESSION(r232338): [GTK] Broke a few layout tests
589         https://bugs.webkit.org/show_bug.cgi?id=186244
590
591         Unreviewed, rollout r232338.
592
593         * platform/gtk/RenderThemeGadget.cpp:
594         (WebCore::RenderThemeGadget::RenderThemeGadget):
595         (WebCore::baseStyleContext): Deleted.
596         * rendering/RenderThemeGtk.cpp:
597         (WebCore::RenderThemeGtk::adjustButtonStyle const):
598         (WebCore::RenderThemeGtk::adjustTextFieldStyle const):
599         (WebCore::RenderThemeGtk::adjustSearchFieldStyle const):
600         (WebCore::styleColor):
601         (WebCore::RenderThemeGtk::adjustTextAreaStyle const): Deleted.
602         * rendering/RenderThemeGtk.h:
603
604 2018-06-03  Eric Carlson  <eric.carlson@apple.com>
605
606         [iOS] MediaPlayer.framework is not always available
607         https://bugs.webkit.org/show_bug.cgi?id=186220
608         <rdar://problem/40571286>
609
610         Reviewed by Tim Horton.
611
612         * platform/ios/RemoteCommandListenerIOS.mm:
613         (WebCore::RemoteCommandListener::create):
614
615 2018-06-02  Darin Adler  <darin@apple.com>
616
617         [Cocoa] Update some code to be more ARC-compatible to prepare for future ARC adoption
618         https://bugs.webkit.org/show_bug.cgi?id=186227
619
620         Reviewed by Dan Bernstein.
621
622         * bridge/objc/objc_instance.mm:
623         (ObjcInstance::~ObjcInstance): Use @autoreleasepool instead of NSAutoreleasePool.
624         * platform/ios/wak/WAKView.mm:
625         (-[WAKView _appendDescriptionToString:atLevel:]): Ditto.
626
627 2018-06-03  Zan Dobersek  <zdobersek@igalia.com>
628
629         [WebGL] GL_EXT_robustness utilization should depend on CONTEXT_ROBUST_ACCESS value
630         https://bugs.webkit.org/show_bug.cgi?id=186187
631
632         Reviewed by Carlos Garcia Campos.
633
634         Don't utilize the GL_EXT_robustness extension for reading pixels from
635         the GPU if the underlying OpenGL context did not enable robust access
636         support upon creation. For EGL contexts, this would be done by passing
637         EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT and EGL_TRUE key-value pair in the
638         attribute list passed to eglCreateContext() (as specified in the
639         EGL_EXT_create_context_robustness extension), but at the moment this
640         capability is not utilized.
641
642         As such, on drivers that implement GL_EXT_robustness support, pixel
643         reads done in WebGLRenderingContextBase end up using glReadnPixels(),
644         but that fails to successfully read anything due to the context
645         rejecting such calls.
646
647         GL_EXT_robustness is specific to OpenGL ES versions, so to fix this,
648         Extensions3DOpenGLES overrides the isEnabled() method. That override
649         returns false immediately if the inherited isEnabled() implementation
650         returns false. Otherwise it returns true, unless the tested extension
651         is GL_EXT_robustness, in which case we now check that the context's
652         CONTEXT_ROBUST_ACCESS state value is true, meaning the context was
653         created with robust access support enabled.
654
655         No new tests are possible because this is optional driver-provided
656         functionality that Web content cannot have effect on.
657
658         * platform/graphics/Extensions3D.h:
659         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
660         (WebCore::Extensions3DOpenGLES::isEnabled):
661         * platform/graphics/opengl/Extensions3DOpenGLES.h:
662
663 2018-06-01  Ryosuke Niwa  <rniwa@webkit.org>
664
665         Editor can hold references to Documents after you navigate away
666         https://bugs.webkit.org/show_bug.cgi?id=186215
667
668         Reviewed by Simon Fraser.
669
670         Clear the various member variables that can hold onto a document in Editor::clear and FrameSelection::prepareForDestruction.
671
672         Test: editing/selection/navigation-clears-editor-state.html
673
674         * editing/Editor.cpp:
675         (WebCore::Editor::clear):
676         * editing/Editor.h:
677         * editing/FrameSelection.cpp:
678         (WebCore::FrameSelection::FrameSelection):
679         (WebCore::FrameSelection::prepareForDestruction):
680         * editing/FrameSelection.h:
681
682 2018-06-01  Ryosuke Niwa  <rniwa@webkit.org>
683
684         ResourceLoader::cancel() shouldn't synchronously fire load event on document
685         https://bugs.webkit.org/show_bug.cgi?id=185284
686
687         Revert the erroneous change to SSFontSelector::beginLoadTimerFired(), which broke CancelLoading.CancelFontSubresource.
688         FrameLoader::loadDone calls checkCompleted, not checkLoadComplete so we still need to call checkLoadComplete here.
689
690         * css/CSSFontSelector.cpp:
691         (WebCore::CSSFontSelector::beginLoadTimerFired): 
692
693 2018-06-01  Jeremy Jones  <jeremyj@apple.com>
694
695         Keyboard focus should exit fullscreen.
696         https://bugs.webkit.org/show_bug.cgi?id=185617
697         rdar://problem/34697938
698
699         Reviewed by Ryosuke Niwa.
700
701         No opensource test because feature is not enabled.
702
703         While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.
704
705         Improve fullscreen testability by exposing isAnimatingFullScreen.
706
707         * dom/Document.h:
708         * testing/Internals.cpp:
709         (WebCore::Internals::isAnimatingFullScreen const):
710         * testing/Internals.h:
711         * testing/Internals.idl:
712
713 2018-06-01  Jeremy Jones  <jeremyj@apple.com>
714
715         Don't continue playing in background when auto-picture-in-picture is disabled.
716         https://bugs.webkit.org/show_bug.cgi?id=186089
717         rdar://problem/40314314
718
719         Reviewed by Eric Carlson.
720
721         No new tests because we don't have a way to test auto-pip.
722
723         With the refactoring work done in VideoFullscreenInterfaceAVKit, HTMLMediaElement no longer has to anticipate 
724         auto-pip when if it should pause on suspend. Instead VideoFullscreenInterfaceAVKit proactively updates 
725         videoFullscreenMode, so checking for PIP is sufficient.
726
727         * html/HTMLMediaElement.cpp:
728         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
729
730 2018-06-01  Chris Dumez  <cdumez@apple.com>
731
732         REGRESSION (r231456): Colloquy is broken
733         https://bugs.webkit.org/show_bug.cgi?id=186197
734         <rdar://problem/40722960>
735
736         Reviewed by Timothy Hatcher.
737
738         Restore pre-r231456 behavior for Colloquy app so that it works again.
739
740         * html/HTMLFrameElementBase.cpp:
741         (WebCore::HTMLFrameElementBase::openURL):
742         * page/Settings.yaml:
743
744 2018-06-01  Chris Dumez  <cdumez@apple.com>
745
746         Regression(r230567): Unable to log into twitter.com in private sessions
747         https://bugs.webkit.org/show_bug.cgi?id=186205
748         <rdar://problem/40670799>
749
750         Reviewed by Youenn Fablet.
751
752         We were using the same SWServer for all private sessions and the SWServer's sessionID would
753         be legacyPrivateSessionID(). As a result, the service worker's sessionID would be legacyPrivateSessionID()
754         as well and would not match the sessionID of its client pages. This sessionID mismatch was
755         causing the breakage.
756
757         Instead of using the same SWServer of all private sessions, we now go back to using a SWServer
758         per private session. However, we now make sure that the SWServer gets destroyed whenever its
759         corresponding session gets destroyed.
760
761         * workers/service/server/SWServer.cpp:
762         (WebCore::SWServer::~SWServer):
763
764 2018-06-01  Youenn Fablet  <youenn@apple.com>
765
766         Add an option to restrict communication to localhost sockets
767         https://bugs.webkit.org/show_bug.cgi?id=186208
768
769         Reviewed by Eric Carlson.
770
771         Covered by existing tests.
772         Add an option in LibWebRTCProvider to restrict to localhost sockets.
773         Use that option when Internals is used.
774
775         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
776         * testing/Internals.cpp:
777         (WebCore::Internals::resetToConsistentState):
778
779 2018-06-01  Ryosuke Niwa  <rniwa@webkit.org>
780
781         ResourceLoader::cancel() shouldn't synchronously fire load event on document
782         https://bugs.webkit.org/show_bug.cgi?id=185284
783
784         Reviewed by Antti Koivisto.
785
786         Because a resource loading can be canceled as a node is removed a document or CachedResource is destructed,
787         it's not safe to synchronously fire load event on document upon cancelation. This patch makes the cancellation
788         of a resource load schedule m_checkTimer in FrameLoader to fire a load event asynchronously instead.
789
790         Specifically, this patch makes FrameLoader::loadDone call FrameLoader::scheduleCheckCompleted when the load
791         had failed or cancled instead of calling FrameLoader::checkCompleted which can synchronously fire load event.
792         To differentiate the two cases, new enum LoadCompletionType has been added to FrameLoader::loadDone and related
793         functions. To avoid calling the navigation delegate too early, the same abstraction for checkLoadComplete()
794         has been added in the form of FrameLoader::subresourceLoadDone.
795
796         Unfortunately, delaying calls to checkCompleted() and checkLoadComplete() by a timer can result in client
797         callbacks such as didFinishLoadForFrame and didFailLoadWithError to never get called when the frame gets
798         detached from the parent after the last resource had stopped loading but before the timer fires. To preserve
799         these deleagte callbacks, this patch expedites the timer in FrameLoader::frameDetached and Page::goToItem by
800         by invoking newly added stopAllLoadersAndCheckCompleteness, which stops all loading and then immediately invokes
801         checkCompleted() and checkLoadComplete() synchronously if m_checkTimer had been started.
802
803         Tests: http/tests/preload/dynamic_removing_preload.html
804
805         * css/CSSFontSelector.cpp:
806         (WebCore::CSSFontSelector::beginLoadTimerFired): Removed superfluous call to checkLoadComplete since
807         cachedResourceLoader's loadDone would call checkLoadComplete anyway.
808         * html/HTMLFrameOwnerElement.cpp:
809         (WebCore::HTMLFrameOwnerElement::disconnectContentFrame): Removed the misleading comment added in r140090.
810         Firefox DOES indeed fire unload event in the content document of a removed frame. While this comment made
811         it sound like this function isn't called when a frame is removed from the tree when in reality we simply
812         remove a frame prior to removing the node via disconnectSubframesIfNeeded.
813         * loader/DocumentLoader.cpp:
814         (WebCore::DocumentLoader::removeSubresourceLoader):
815         * loader/DocumentLoader.h:
816         * loader/FrameLoader.cpp:
817         (WebCore::FrameLoader::FrameLoader):
818         (WebCore::FrameLoader::loadDone):
819         (WebCore::FrameLoader::subresourceLoadDone):
820         (WebCore::FrameLoader::checkCompleted): Added a release assert that this function is only called when it's safe
821         to execute scripts.
822         (WebCore::FrameLoader::checkTimerFired):
823         (WebCore::FrameLoader::checkCompletenessNow):Extracted from checkTimerFired.
824         (WebCore::FrameLoader::stopAllLoaders): Removed the code to stop m_checkTimer introduced in r53655.
825         Stopping the timer here would prevent FrameLoader::frameDetached to detect the case when stopping the loader
826         scheduled a load completion check. Also stopping this timer without clearing the corresponding booleans:
827         m_checkingLoadCompleteForDetachment and m_checkingLoadCompleteForDetachment is problematic. The assertion
828         r53655 addressed is now addressed by explicitly checking & clearing the timer in frameDetached.
829         (WebCore::FrameLoader::stopAllLoadersAndCheckCompleteness): Added.
830         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Avoid an early exit when the newly added boolean
831         m_checkingLoadCompleteForDetachment is set since m_isStopping is no longer set in frameDetached in order
832         to invoke didFailLoadWithError when detaching a frame.
833         (WebCore::FrameLoader::frameDetached): Call checkCompletenessNow in the case the frame had already been
834         completed loading. Also call stopAllLoadersAndCheckCompleteness in the case stopping loading would complete
835         the loading before stopping active DOM objects.
836         * loader/FrameLoader.h:
837         (WebCore::FrameLoader::m_checkingLoadCompleteForDetachment): Added.
838         * loader/FrameLoaderTypes.h:
839         (WebCore::LoadCompletionType): Added.
840         * loader/SubresourceLoader.cpp:
841         (WebCore::SubresourceLoader::didFinishLoading):
842         (WebCore::SubresourceLoader::didFail):
843         (WebCore::SubresourceLoader::didCancel):
844         (WebCore::SubresourceLoader::notifyDone):
845         * loader/SubresourceLoader.h:
846         * loader/cache/CachedResourceLoader.cpp:
847         (WebCore::CachedResourceLoader::loadDone):
848         * loader/cache/CachedResourceLoader.h:
849         * page/Page.cpp:
850         (WebCore::Page::goToItem): Call stopAllLoadersAndCheckCompleteness instead of stopAllLoaders since stopping
851         loading here may complete loading.
852
853 2018-06-01  Sihui Liu  <sihui_liu@apple.com>
854
855         Stop using StorageTracker.db in LocalStorageDatabaseTracker
856         https://bugs.webkit.org/show_bug.cgi?id=186104
857
858         Reviewed by Geoffrey Garen.
859
860         No behavior change.
861
862         * platform/sql/SQLiteFileSystem.h:
863
864 2018-06-01  Zalan Bujtas  <zalan@apple.com>
865
866         [LFC] Simplify the formatting class implementation by pushing down some of the logic to the Geometry class
867         https://bugs.webkit.org/show_bug.cgi?id=186179
868
869         Reviewed by Antti Koivisto.
870
871         * layout/FormattingContext.cpp:
872         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
873         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
874         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
875         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
876         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
877         * layout/FormattingContext.h:
878         * layout/FormattingContextGeometry.cpp:
879         (WebCore::Layout::outOfFlowNonReplacedHeight):
880         (WebCore::Layout::outOfFlowNonReplacedWidth):
881         (WebCore::Layout::outOfFlowReplacedHeight):
882         (WebCore::Layout::outOfFlowReplacedWidth):
883         (WebCore::Layout::floatingNonReplacedHeight):
884         (WebCore::Layout::floatingNonReplacedWidth):
885         (WebCore::Layout::floatingReplacedHeight):
886         (WebCore::Layout::floatingReplacedWidth):
887         (WebCore::Layout::outOfFlowNonReplacedPosition):
888         (WebCore::Layout::outOfFlowReplacedPosition):
889         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeight):
890         (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidth):
891         (WebCore::Layout::FormattingContext::Geometry::floatingHeight):
892         (WebCore::Layout::FormattingContext::Geometry::floatingWidth):
893         (WebCore::Layout::FormattingContext::Geometry::outOfFlowPosition):
894         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight):
895         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth):
896         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeight): Deleted.
897         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidth): Deleted.
898         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight): Deleted.
899         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth): Deleted.
900         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeight): Deleted.
901         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidth): Deleted.
902         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight): Deleted.
903         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth): Deleted.
904         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedPosition): Deleted.
905         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedPosition): Deleted.
906         (WebCore::Layout::FormattingContext::Geometry::replacedHeight): Deleted.
907         (WebCore::Layout::FormattingContext::Geometry::replacedWidth): Deleted.
908         * layout/blockformatting/BlockFormattingContext.cpp:
909         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
910         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
911         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
912         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
913         * layout/blockformatting/BlockFormattingContext.h:
914         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
915         (WebCore::Layout::inFlowNonReplacedHeight):
916         (WebCore::Layout::inFlowNonReplacedWidth):
917         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeight):
918         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidth):
919         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): Deleted.
920         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth): Deleted.
921
922 2018-06-01  Zalan Bujtas  <zalan@apple.com>
923
924         [LFC] Push FormattingContext::computeWidth/computeHeight logic from the base to the subclasses.
925         https://bugs.webkit.org/show_bug.cgi?id=186172
926
927         Reviewed by Antti Koivisto.
928
929         FormattingContext::computeWidth/computeHeight virtual functions have very little benefit and in the long run
930         it's better if we keep the number of virtual functions to the minimum necessary.
931
932         * layout/FormattingContext.cpp:
933         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
934         (WebCore::Layout::FormattingContext::computeStaticPosition const): Deleted.
935         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const): Deleted.
936         (WebCore::Layout::FormattingContext::computeWidth const): Deleted.
937         (WebCore::Layout::FormattingContext::computeHeight const): Deleted.
938         (WebCore::Layout::FormattingContext::computeMargin const): Deleted.
939         * layout/FormattingContext.h:
940         * layout/FormattingContextGeometry.cpp:
941         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight):
942         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidth):
943         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight):
944         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidth):
945         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight):
946         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidth):
947         (WebCore::Layout::FormattingContext::Geometry::replacedHeight): Deleted.
948         (WebCore::Layout::FormattingContext::Geometry::replacedWidth): Deleted.
949         * layout/blockformatting/BlockFormattingContext.cpp:
950         (WebCore::Layout::BlockFormattingContext::computeWidth const):
951         (WebCore::Layout::BlockFormattingContext::computeHeight const):
952         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
953         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
954         * layout/blockformatting/BlockFormattingContext.h:
955         * layout/inlineformatting/InlineFormattingContext.cpp:
956         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
957         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
958         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const): Deleted.
959         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const): Deleted.
960         * layout/inlineformatting/InlineFormattingContext.h:
961
962 2018-06-01  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
963
964         [GTK] Difficult to read combo box text in dark theme
965         https://bugs.webkit.org/show_bug.cgi?id=165072
966
967         Reviewed by Carlos Garcia Campos.
968
969         Set listbox foreground color to theme color to fix hard-to-read
970         text color in combo box while using dark theme.
971
972         No new tests required. ManualTests/gtk/theme.html already covers it.
973         See the "Option Lists" section.
974
975         * rendering/RenderTheme.cpp:
976         (WebCore::RenderTheme::adjustStyle):
977         Adjust style for ListboxPart as well.
978         * rendering/RenderTheme.h: Add adjustListboxStyle()
979         * rendering/RenderThemeGtk.cpp:
980         (WebCore::RenderThemeGtk::adjustListboxStyle const):
981         Set color to the theme foreground color.
982         * rendering/RenderThemeGtk.h: adjustListboxStyle() overriden.
983
984 2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>
985
986         [GTK] Switch to use a popup window with a tree view instead of a menu for option menu default implementation
987         https://bugs.webkit.org/show_bug.cgi?id=186146
988
989         Reviewed by Michael Catanzaro.
990
991         Make it possible to use GUniquePtr with GtkTreePath.
992
993         * platform/gtk/GUniquePtrGtk.h:
994
995 2018-05-31  Per Arne Vollan  <pvollan@apple.com>
996
997         Add OpenGL display mask to WebPage creation parameters.
998         https://bugs.webkit.org/show_bug.cgi?id=186163
999         <rdar://problem/40634504>
1000
1001         Reviewed by Brent Fulgham.
1002
1003         To make sure the OpenGL display mask is always available, include it in the WebPage creation parameters.
1004         The OpenGL display mask is sent to the WebProcess when the platform display ID changes, but that is not
1005         early enough in all cases. If the OpenGL display mask is not set, only OpenGL software rendering is offered
1006         on some hardware configurations.
1007  
1008         No new tests, since it is not trivial to test whether OpenGL rendering is hardware accelerated.
1009
1010         * platform/PlatformScreen.h:
1011         * platform/mac/PlatformScreenMac.mm:
1012         (WebCore::displayID):
1013
1014 2018-05-31  Megan Gardner  <megan_gardner@apple.com>
1015
1016         Add setting to allow override screen size to be disabled.
1017         https://bugs.webkit.org/show_bug.cgi?id=186109
1018
1019         Reviewed by Andy Estes.
1020
1021         Not Testable, and for debug only.
1022
1023         Pipe settings and use them to ignore override screen size if setting is set. 
1024
1025         * page/DeprecatedGlobalSettings.cpp:
1026         * page/DeprecatedGlobalSettings.h:
1027         (WebCore::DeprecatedGlobalSettings::setDisableScreenSizeOverride):
1028         (WebCore::DeprecatedGlobalSettings::disableScreenSizeOverride):
1029         * page/Settings.yaml:
1030         * platform/ios/PlatformScreenIOS.mm:
1031
1032 2018-05-31  Brent Fulgham  <bfulgham@apple.com>
1033
1034         REGRESSION(r216119): DocumentLoader::detachFromFrame still encounters nullptr frame
1035         https://bugs.webkit.org/show_bug.cgi?id=186081
1036         <rdar://problem/34918109>
1037
1038         Reviewed by David Kilzer.
1039
1040         The nullptr check that was removed in r216119 was still needed because when the DocumentLoader
1041         is in 'm_waitingForNavigationPolicy' or in 'm_waitingForContentPolicy', a call to the policy checker
1042         to stopCheck we will clear the frame as part of the cleanup phase.
1043
1044         If m_frame is nullptr after cancelPolicyCheckIfNeeded, our work is already done so just return.
1045
1046         * loader/DocumentLoader.cpp:
1047         (WebCore::DocumentLoader::detachFromFrame):
1048
1049 2018-05-31  Dean Jackson  <dino@apple.com>
1050
1051         Don't paint the System Preview badge if the image isn't fully decoded
1052         https://bugs.webkit.org/show_bug.cgi?id=186158
1053         <rdar://problem/40454866>
1054
1055         Reviewed by Antoine Quint.
1056
1057         Only paint the system preview badge if the image itself said
1058         that it succeeded in drawing.
1059
1060         * rendering/RenderImage.cpp:
1061         (WebCore::RenderImage::paintIntoRect): Check the ImageDrawResult.
1062
1063 2018-05-31  David Kilzer  <ddkilzer@apple.com>
1064
1065         Implement checked cast for DDResultRef once DDResultGetCFTypeID() is available
1066         <https://webkit.org/b/184554>
1067         <rdar://problem/36241894>
1068
1069         Reviewed by Brent Fulgham.
1070
1071         * editing/cocoa/DataDetection.mm:
1072         (WebCore::detectItemAtPositionWithRange): Implement checked cast
1073         for DDResultRef.
1074
1075 2018-05-31  Alex Christensen  <achristensen@webkit.org>
1076
1077         Fix Windows build after r232246.
1078         https://bugs.webkit.org/show_bug.cgi?id=186024
1079
1080         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
1081         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
1082
1083 2018-05-31  Chris Dumez  <cdumez@apple.com>
1084
1085         Fix memory leak under NetworkStateNotifier::updateStateWithoutNotifying()
1086         https://bugs.webkit.org/show_bug.cgi?id=186149
1087         <rdar://problem/40674537>
1088
1089         Reviewed by Geoffrey Garen.
1090
1091         * platform/network/mac/NetworkStateNotifierMac.cpp:
1092         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
1093
1094 2018-05-31  Zalan Bujtas  <zalan@apple.com>
1095
1096         [LFC] Layout code needs to know the type of the Element associated with a Layout::Box
1097         https://bugs.webkit.org/show_bug.cgi?id=186117
1098
1099         Reviewed by Antti Koivisto.
1100
1101         Since these attributes don't change during layout, we could just pass them in to Layout::Box instead
1102         of keep querying the Element.
1103
1104         * layout/layouttree/LayoutBlockContainer.cpp:
1105         (WebCore::Layout::BlockContainer::BlockContainer):
1106         * layout/layouttree/LayoutBlockContainer.h:
1107         * layout/layouttree/LayoutBox.cpp:
1108         (WebCore::Layout::Box::Box):
1109         (WebCore::Layout::Box::isPaddingApplicable const):
1110         (WebCore::Layout::Box::isDocumentBox const): Deleted.
1111         (WebCore::Layout::Box::isBodyBox const): Deleted.
1112         * layout/layouttree/LayoutBox.h:
1113         (WebCore::Layout::Box::isAnonymous const):
1114         (WebCore::Layout::Box::isDocumentBox const):
1115         (WebCore::Layout::Box::isBodyBox const):
1116         (WebCore::Layout::Box::ElementAttributes::ElementAttributes):
1117         (WebCore::Layout::Box::setPreviousSibling):
1118         (WebCore::Layout::Box::setIsAnonymous): Deleted.
1119         * layout/layouttree/LayoutContainer.cpp:
1120         (WebCore::Layout::Container::Container):
1121         * layout/layouttree/LayoutContainer.h:
1122         * layout/layouttree/LayoutInlineBox.cpp:
1123         (WebCore::Layout::InlineBox::InlineBox):
1124         * layout/layouttree/LayoutInlineBox.h:
1125         * layout/layouttree/LayoutInlineContainer.cpp:
1126         (WebCore::Layout::InlineContainer::InlineContainer):
1127         * layout/layouttree/LayoutInlineContainer.h:
1128         * layout/layouttree/LayoutTreeBuilder.cpp:
1129         (WebCore::Layout::TreeBuilder::createLayoutTree):
1130         (WebCore::Layout::TreeBuilder::createSubTree):
1131
1132 2018-05-31  Chris Dumez  <cdumez@apple.com>
1133
1134         Unreviewed iOS build fix after r232335.
1135
1136         * html/BaseChooserOnlyDateAndTimeInputType.h:
1137         * html/BaseDateAndTimeInputType.h:
1138
1139 2018-05-31  Chris Dumez  <cdumez@apple.com>
1140
1141         Unreviewed, apply review comments from Darin after r232310.
1142
1143         * platform/ReferrerPolicy.cpp:
1144         (WebCore::parseReferrerPolicy):
1145
1146 2018-05-31  Zalan Bujtas  <zalan@apple.com>
1147
1148         [LFC] Margin box is border box + margins.
1149         https://bugs.webkit.org/show_bug.cgi?id=186124
1150
1151         Reviewed by Antti Koivisto.
1152
1153         * layout/displaytree/DisplayBox.cpp:
1154         (WebCore::Display::Box::marginBox const):
1155
1156 2018-05-31  Zalan Bujtas  <zalan@apple.com>
1157
1158         [LFC] Add quirks mode setter/getting to LayoutContext
1159         https://bugs.webkit.org/show_bug.cgi?id=186122
1160
1161         Reviewed by Antti Koivisto.
1162
1163         * layout/LayoutContext.h:
1164         (WebCore::Layout::LayoutContext::setInQuirksMode):
1165         (WebCore::Layout::LayoutContext::inQuirksMode const):
1166         * page/FrameViewLayoutContext.cpp:
1167         (WebCore::layoutUsingFormattingContext):
1168
1169 2018-05-30  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
1170
1171         [GTK] Hardcoded text color in input fields
1172         https://bugs.webkit.org/show_bug.cgi?id=126907
1173
1174         Reviewed by Carlos Garcia Campos.
1175
1176         Set text color in input fields to foreground theme color.
1177         Also, set "window.background" as base GtkStyleContext to mimic
1178         GTK applications and fix some theme bugs.
1179
1180         No new tests required. ManualTests/gtk/theme.html already covers it.
1181
1182         * platform/gtk/RenderThemeGadget.cpp:
1183         (WebCore::baseStyleContext): Added.
1184         (WebCore::RenderThemeGadget::RenderThemeGadget):
1185         Use "window.background" GtkStyleContext instead of
1186         null parent for RenderThemeGadgets.
1187         * rendering/RenderThemeGtk.cpp:
1188         (WebCore::RenderThemeGtk::adjustButtonStyle const):
1189         Set color as foreground theme color.
1190         (WebCore::RenderThemeGtk::adjustTextFieldStyle const): Ditto.
1191         (WebCore::RenderThemeGtk::adjustTextAreaStyle const): Ditto.
1192         (WebCore::RenderThemeGtk::adjustSearchFieldStyle const): Ditto.
1193         * rendering/RenderThemeGtk.h: adjustTextAreaStyle() overriden.
1194
1195 2018-05-30  Yusuke Suzuki  <utatane.tea@gmail.com>
1196
1197         [JSC] Pass VM& parameter as much as possible
1198         https://bugs.webkit.org/show_bug.cgi?id=186085
1199
1200         Reviewed by Saam Barati.
1201
1202         No behavior change.
1203
1204         * bindings/js/JSCSSRuleListCustom.cpp:
1205         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
1206         * bindings/js/JSCallbackData.cpp:
1207         (WebCore::JSCallbackData::invokeCallback):
1208         * bindings/js/JSCustomXPathNSResolver.cpp:
1209         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1210         * bindings/js/JSDOMBuiltinConstructorBase.cpp:
1211         (WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
1212         * bindings/js/JSDOMConvertScheduledAction.h:
1213         (WebCore::Converter<IDLScheduledAction>::convert):
1214         * bindings/js/JSDOMIterator.h:
1215         (WebCore::iteratorForEach):
1216         * bindings/js/JSDOMMapLike.cpp:
1217         (WebCore::forwardFunctionCallToBackingMap):
1218         (WebCore::forwardForEachCallToBackingMap):
1219         * bindings/js/JSDOMPromise.cpp:
1220         (WebCore::callFunction):
1221         * bindings/js/JSDOMPromiseDeferred.cpp:
1222         (WebCore::DeferredPromise::callFunction):
1223         (WebCore::createRejectedPromiseWithTypeError):
1224         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
1225         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
1226         * bindings/js/JSEventListener.cpp:
1227         (WebCore::JSEventListener::handleEvent):
1228         * bindings/js/JSNodeListCustom.cpp:
1229         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
1230         * bindings/js/JSPluginElementFunctions.cpp:
1231         (WebCore::pluginElementCustomPut):
1232         (WebCore::callPlugin):
1233         * bindings/js/JSWindowProxy.cpp:
1234         (WebCore::JSWindowProxy::setWindow):
1235         * bindings/js/ReadableStream.cpp:
1236         (WebCore::ReadableStreamInternal::callFunction):
1237         * bindings/js/ReadableStreamDefaultController.cpp:
1238         (WebCore::callFunction):
1239         * bindings/js/ScheduledAction.cpp:
1240         (WebCore::ScheduledAction::executeFunctionInContext):
1241         * bindings/js/SerializedScriptValue.cpp:
1242         (WebCore::CloneSerializer::getProperty):
1243         (WebCore::CloneSerializer::serialize):
1244         * bindings/js/StructuredClone.cpp:
1245         (WebCore::structuredCloneArrayBufferView):
1246         * bindings/js/WorkerScriptController.cpp:
1247         (WebCore::WorkerScriptController::initScript):
1248         * bridge/NP_jsobject.cpp:
1249         * bridge/objc/WebScriptObject.mm:
1250         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1251         * testing/Internals.cpp:
1252         (WebCore::Internals::cloneArrayBuffer):
1253         * testing/js/WebCoreTestSupport.cpp:
1254         (WebCoreTestSupport::injectInternalsObject):
1255
1256 2018-05-28  Darin Adler  <darin@apple.com>
1257
1258         Straighten out HTMLInputElement attribute handling
1259         https://bugs.webkit.org/show_bug.cgi?id=186043
1260
1261         Reviewed by Daniel Bates.
1262
1263         * dom/RadioButtonGroups.cpp:
1264         (WebCore::RadioButtonGroup::requiredStateChanged): Renamed from requiredAttributeChanged,
1265         and changed to take a reference.
1266         (WebCore::RadioButtonGroups::requiredStateChanged): Ditto.
1267         * dom/RadioButtonGroups.h: Updated for changes above.
1268
1269         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1270         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree): Call
1271         updateInnerTextValue by its new name.
1272         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue): Renamed
1273         from updateAppearance.
1274         (WebCore::BaseChooserOnlyDateAndTimeInputType::setValue): Call
1275         updateInnerTextValue by its new name.
1276         (WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Override this
1277         instead of valueAttributeChanged.
1278         * html/BaseChooserOnlyDateAndTimeInputType.h: Tighten up inheritance a bit.
1279         Also use final a bit more and update for changes above.
1280
1281         * html/BaseDateAndTimeInputType.cpp:
1282         (WebCore::BaseDateAndTimeInputType::attributeChanged): Replaced
1283         minOrMaxAttributeChanged with this override, checking for the attribute names.
1284         * html/BaseDateAndTimeInputType.h: Updated for changes above.
1285
1286         * html/FileInputType.cpp:
1287         (WebCore::FileInputType::disabledStateChanged): Renamed from disabledAttributeChanged.
1288         (WebCore::FileInputType::attributeChanged): Replaced
1289         multipleAttributeChanged with this override, checking for the attribute names.
1290         * html/FileInputType.h: Updated for changes above.
1291
1292         * html/HTMLFormControlElement.cpp:
1293         (WebCore::HTMLFormControlElement::parseAttribute): Updated function names to say
1294         "state changed" rather than "attribute changed" if they are called only when the
1295         computed value is changed, not the raw attribute value.
1296         (WebCore::HTMLFormControlElement::readOnlyStateChanged): Updated name.
1297         (WebCore::HTMLFormControlElement::requiredStateChanged): Ditto.
1298         * html/HTMLFormControlElement.h: Updated for changes above.
1299
1300         * html/HTMLInputElement.cpp:
1301         (WebCore::HTMLInputElement::parseAttribute): Removed the code to call lots of specific
1302         attribute changed functions that have now been deleted. Also removed empty code for a
1303         couple of attributes.
1304         (WebCore::HTMLInputElement::disabledStateChanged): Added. Forward call to input type.
1305         (WebCore::HTMLInputElement::readOnlyStateChanged): Ditto.
1306         (WebCore::HTMLInputElement::requiredStateChanged): Renamed from requiredAttributeChanged.
1307         * html/HTMLInputElement.h: Updated for changes above.
1308
1309         * html/HTMLTextFormControlElement.cpp:
1310         (WebCore::HTMLTextFormControlElement::readOnlyStateChanged): Renamed from
1311         readOnlyAttributeChanged. Also fixed incorrect call to base class. This may have
1312         fixed a bug: With some work we could probably create a test case to demonstrate that.
1313         * html/HTMLTextFormControlElement.h: Updated for changes above.
1314
1315         * html/ImageInputType.cpp:
1316         (WebCore::ImageInputType::attributeChanged): Replaced
1317         altAttributeChanged and srcAttributeChanged with this override, checking for the
1318         attribute names.
1319         * html/ImageInputType.h: Updated for changes above.
1320
1321         * html/InputType.cpp:
1322         (WebCore::InputType::altAttributeChanged): Deleted.
1323         (WebCore::InputType::srcAttributeChanged): Deleted.
1324         (WebCore::InputType::maxResultsAttributeChanged): Deleted.
1325         (WebCore::InputType::minOrMaxAttributeChanged): Deleted.
1326         (WebCore::InputType::stepAttributeChanged): Deleted.
1327         (WebCore::InputType::valueAttributeChanged): Deleted.
1328         (WebCore::InputType::attributeChanged): Moved to header as an inline so derived
1329         classes can call through to the base class with the empty function inlined.
1330         (WebCore::InputType::multipleAttributeChanged): Deleted.
1331         (WebCore::InputType::disabledAttributeChanged): Moved to header as an inline.
1332         (WebCore::InputType::readonlyAttributeChanged): Ditto.
1333         (WebCore::InputType::requiredAttributeChanged): Ditto.
1334         * html/InputType.h: Updated for changes above.
1335
1336         * html/NumberInputType.cpp:
1337         (WebCore::NumberInputType::attributeChanged): Replaced
1338         minOrMaxAttributeChanged and stepAttributeChanged with this override, checking
1339         for the attribute names.
1340         * html/NumberInputType.h: Updated for changes above.
1341
1342         * html/RangeInputType.cpp:
1343         (WebCore::RangeInputType::disabledStateChanged): Renamed from
1344         disabledAttributeChanged.
1345         (WebCore::RangeInputType::attributeChanged): Replaced
1346         minOrMaxAttributeChanged with this override, checking for the attribute names.
1347         * html/RangeInputType.h: Updated for changes above.
1348
1349         * html/SearchInputType.cpp:
1350         (WebCore::SearchInputType::SearchInputType): Removed unneeded initialization of
1351         RefPtr data members to nullptr.
1352         (WebCore::updateResultButtonPseudoType): Removed unneeded if statement; the two
1353         cases above cover 0, and less than 0, so there is no need to check for greater
1354         than 0 for the third case.
1355         (WebCore::SearchInputType::attributeChanged): Replaced
1356         maxResultsAttributeChanged with this override, checking for the attribute name.
1357         * html/SearchInputType.h: Updated for changes above and marked more
1358         member functions final.
1359
1360         * html/TextFieldInputType.cpp:
1361         (WebCore::TextFieldInputType::attributeChanged): Added a call through to the
1362         base class to match the style of other overrides of this function.
1363         (WebCore::TextFieldInputType::disabledStateChanged): Renamed from disabledAttributeChanged.
1364         (WebCore::TextFieldInputType::readOnlyStateChanged): Renamed from readonlyAttributeChanged.
1365         * html/TextFieldInputType.h: Updated for changes above. Also made attributeChanged no
1366         longer be marked final since derived classes now override it.
1367
1368         * html/shadow/SliderThumbElement.cpp:
1369         (WebCore::SliderThumbElement::SliderThumbElement): Moved some data member initialization
1370         from this constructor to the class definition.
1371         (WebCore::SliderThumbElement::hostDisabledStateChanged): Renamed from disabledAttributeChanged.
1372         * html/shadow/SliderThumbElement.h: Updated for changes above and marked more
1373         member functions final.
1374
1375 2018-05-30  Nan Wang  <n_wang@apple.com>
1376
1377         AX: VoiceOver on macOS does not announce fieldset description from aria-describedby when focussing inputs
1378         https://bugs.webkit.org/show_bug.cgi?id=185246
1379         <rdar://problem/39939028>
1380
1381         Reviewed by Chris Fleizach.
1382
1383         Exposed the fieldset's description to its form control children.
1384
1385         Test: accessibility/mac/aria-describedby-fieldset.html
1386
1387         * accessibility/AccessibilityNodeObject.cpp:
1388         (WebCore::AccessibilityNodeObject::helpText const):
1389
1390 2018-05-30  Chris Fleizach  <cfleizach@apple.com>
1391
1392         AX: Expose link rel type to voiceover
1393         https://bugs.webkit.org/show_bug.cgi?id=186084
1394         <rdar://problem/40640871>
1395
1396         Reviewed by Sam Weinig.
1397
1398         Make the link rel attribute available to accessibility clients.
1399
1400         Test: accessibility/mac/linkrel.html
1401
1402         * accessibility/AccessibilityObject.cpp:
1403         (WebCore::AccessibilityObject::linkRelValue const):
1404         * accessibility/AccessibilityObject.h:
1405         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1406         (-[WebAccessibilityObjectWrapper accessibilityLinkRelationshipType]):
1407         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1408         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
1409         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1410
1411 2018-05-30  Brady Eidson  <beidson@apple.com>
1412
1413         REGRESSION (r224684): User-agent seen by page does not change when modified by the develop menu options after reloading.
1414         <rdar://problem/34918109> and https://bugs.webkit.org/show_bug.cgi?id=186111
1415
1416         Reviewed by Andy Estes.
1417
1418         Test: http/tests/navigation/useragent-reload.php
1419
1420         * Modules/websockets/WebSocketHandshake.cpp:
1421         (WebCore::WebSocketHandshake::clientHandshakeRequest const): Use setUserAgent() for consistency.
1422
1423         * loader/DocumentLoader.cpp:
1424         (WebCore::DocumentLoader::startLoadingMainResource): Clear the user agent from the original DocumentLoader request
1425           before adding additional fields, as reloads should pick up user agent changes.
1426
1427 2018-05-30  Dean Jackson  <dino@apple.com>
1428
1429         WebContent crashes with system preview content
1430         https://bugs.webkit.org/show_bug.cgi?id=186118
1431
1432         Reviewed by Myles Maxfield.
1433
1434         We were receiving crash reports on iOS devices when getting
1435         platformContext() from a GraphicsContext. This usually
1436         occurred when the page was invisible. Debugging showed that
1437         it was trying to draw with a disabled context.
1438
1439         * rendering/RenderThemeIOS.mm:
1440         (WebCore::RenderThemeIOS::paintSystemPreviewBadge): Early
1441         return if the context has painting disabled.
1442
1443 2018-05-30  Daniel Bates  <dabates@apple.com>
1444
1445         Web Inspector: Annotate Same-Site cookies
1446         https://bugs.webkit.org/show_bug.cgi?id=184897
1447         <rdar://problem/35178209>
1448
1449         Reviewed by Brian Burg.
1450
1451         Store and retrieve the Same-Site cookie policy from CFNetwork.
1452
1453         * inspector/agents/InspectorPageAgent.cpp:
1454         (WebCore::cookieSameSitePolicyJSON): Added.
1455         (WebCore::buildObjectForCookie): Modified to include cookie Same-Site policy. 
1456         * platform/Cookie.h:
1457         (WebCore::Cookie::encode const): Encode Same-Site policy.
1458         (WebCore::Cookie::decode): Decode Same-Site policy.
1459         * platform/network/cocoa/CookieCocoa.mm:
1460         (WebCore::portStringFromVector):
1461         (WebCore::coreSameSitePolicy):
1462         (WebCore::nsSameSitePolicy):
1463         (WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):
1464         (WebCore::Cookie::operator NSHTTPCookie * const): Deleted.
1465
1466 2018-05-30  Daniel Bates  <dabates@apple.com>
1467
1468         NavigationAction does not need to hold initiating DOM Event
1469         https://bugs.webkit.org/show_bug.cgi?id=185958
1470         <rdar://problem/40531539>
1471
1472         Reviewed by Simon Fraser.
1473
1474         Take a similar approach as was done in <https://bugs.webkit.org/show_bug.cgi?id=185712>
1475         and have NavigationAction hold only as many details of the initiating DOM Event as
1476         necessary to support WebKit functionality. Retaining a DOM Event effectively retains
1477         the document that associated with the event. And DocumentLoader always keeps around
1478         the NavigationAction of the last navigation for the "benefit of the various policy handlers".
1479         Therefore, having NavigationAction hold only the relevant details of the DOM Event
1480         instead of the DOM Event itself we avoid keeping the document we navigated from alive
1481         longer than necessary. 
1482
1483         * dom/MouseRelatedEvent.h:
1484         * dom/UIEventWithKeyState.h:
1485         * loader/NavigationAction.cpp:
1486         (WebCore::NavigationAction::UIEventWithKeyStateData::UIEventWithKeyStateData): Added.
1487         (WebCore::NavigationAction::MouseEventData::MouseEventData): Added.
1488         (WebCore::keyStateDataForFirstEventWithKeyState): Added.
1489         (WebCore::mouseEventDataForFirstMouseEvent): Added.
1490         * loader/NavigationAction.h:
1491         (WebCore::NavigationAction::keyStateEventData const): Added.
1492         (WebCore::NavigationAction::mouseEventData const): Added
1493         (WebCore::NavigationAction::event const): Deleted.
1494
1495 2018-05-30  Youenn Fablet  <youenn@apple.com>
1496
1497         Revert changes made to URLWithUserTypedString made in https://trac.webkit.org/changeset/232281
1498         https://bugs.webkit.org/show_bug.cgi?id=186108
1499         <rdar://problem/40663065>
1500
1501         Reviewed by Alex Christensen.
1502
1503         Covered by existing API tests.
1504
1505         * platform/mac/WebCoreNSURLExtras.mm:
1506         (WebCore::URLWithUserTypedString):
1507         Return early if WebCore::URL is not able to create a CFURL.
1508         Use CFURL otherwise to keep the existing behavior as much as possible.
1509
1510 2018-05-30  Youenn Fablet  <youenn@apple.com>
1511
1512         Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
1513         https://bugs.webkit.org/show_bug.cgi?id=186082
1514
1515         Reviewed by Chris Dumez.
1516
1517         No change of behavior.
1518
1519         * page/RuntimeEnabledFeatures.h:
1520         (WebCore::RuntimeEnabledFeatures::setCrossOriginResourcePolicyEnabled):
1521         (WebCore::RuntimeEnabledFeatures::crossOriginResourcePolicyEnabled const):
1522         (WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled): Deleted.
1523         (WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const): Deleted.
1524
1525 2018-05-30  Chris Dumez  <cdumez@apple.com>
1526
1527         Referrer-Policy response header is ignored
1528         https://bugs.webkit.org/show_bug.cgi?id=186037
1529         <rdar://problem/40600335>
1530
1531         Reviewed by Youenn Fablet.
1532
1533         Add support for Referrer-Policy HTTP response header:
1534         - https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-header
1535
1536         Tests: http/tests/security/referrer-policy-header-and-meta-tag-emptyString.html
1537                http/tests/security/referrer-policy-header-and-meta-tag.html
1538                http/tests/security/referrer-policy-header.html
1539
1540         * dom/Document.cpp:
1541         (WebCore::Document::setReferrerPolicy):
1542         (WebCore::Document::processReferrerPolicy):
1543         * dom/Document.h:
1544         (WebCore::Document::referrerPolicy const):
1545         * html/HTMLMetaElement.cpp:
1546         (WebCore::HTMLMetaElement::process):
1547         * loader/FrameLoader.cpp:
1548         (WebCore::FrameLoader::didBeginDocument):
1549         * loader/SubresourceLoader.cpp:
1550         (WebCore::SubresourceLoader::updateReferrerPolicy):
1551         * platform/ReferrerPolicy.cpp:
1552         (WebCore::parseReferrerPolicyToken):
1553         (WebCore::parseReferrerPolicy):
1554         * platform/ReferrerPolicy.h:
1555
1556 2018-05-30  Youenn Fablet  <youenn@apple.com>
1557
1558         Rename CrossOriginResourcePolicy same to same-origin
1559         https://bugs.webkit.org/show_bug.cgi?id=186080
1560
1561         Reviewed by Chris Dumez.
1562
1563         Covered by updated tests.
1564
1565         * platform/network/HTTPParsers.cpp:
1566         (WebCore::parseCrossOriginResourcePolicyHeader):
1567         * platform/network/HTTPParsers.h:
1568
1569 2018-05-30  Aditya Keerthi  <akeerthi@apple.com>
1570
1571         Fix the ENABLE(DATALIST_ELEMENT) build
1572         https://bugs.webkit.org/show_bug.cgi?id=186105
1573
1574         Reviewed by Wenson Hsieh.
1575
1576         * WebCore.xcodeproj/project.pbxproj:
1577         * html/ColorInputType.cpp:
1578         (WebCore::ColorInputType::suggestions const):
1579         * html/HTMLInputElement.h:
1580         * html/HTMLOptionElement.cpp:
1581         (WebCore::HTMLOptionElement::ownerDataListElement const):
1582         * rendering/RenderTheme.cpp:
1583         (WebCore::RenderTheme::paintSliderTicks):
1584
1585 2018-05-30  Alex Christensen  <achristensen@webkit.org>
1586
1587         Reduce String allocations
1588         https://bugs.webkit.org/show_bug.cgi?id=186059
1589
1590         Reviewed by Darin Adler.
1591
1592         Don't allocate Strings just to convert it to another form.
1593         Based mostly on Darin's feedback on bug 185986.
1594
1595         No change in behavior.
1596
1597         * Modules/websockets/WebSocketHandshake.cpp:
1598         (WebCore::hostName):
1599         (WebCore::WebSocketHandshake::host const):
1600         * css/parser/CSSSelectorParser.cpp:
1601         (WebCore::CSSSelectorParser::consumePseudo):
1602         (WebCore::CSSSelectorParser::consumeANPlusB):
1603         * loader/mac/LoaderNSURLExtras.mm:
1604         (suggestedFilenameWithMIMEType):
1605         * page/SecurityOriginData.h:
1606         (WebCore::SecurityOriginData::fromURL):
1607         * page/csp/ContentSecurityPolicySource.cpp:
1608         (WebCore::wildcardMatches):
1609         (WebCore::ContentSecurityPolicySource::hostMatches const):
1610         * platform/URL.cpp:
1611         (WebCore::URL::hostAndPort const):
1612         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1613         (WebCore::SocketStreamHandleImpl::createStreams):
1614
1615 2018-05-30  Jer Noble  <jer.noble@apple.com>
1616
1617         Media elements outside fullscreen should not be considered main content.
1618         https://bugs.webkit.org/show_bug.cgi?id=186063
1619         <rdar://problem/40630437>
1620
1621         Reviewed by Eric Carlson.
1622
1623         Test: platform/mac/media/video-best-element-for-playback-controls-purpose.html
1624
1625         Media elements outside the current fullscreen element are not visible, and thus should not be considered
1626         main content.
1627
1628         Drive-by fix: set the m_hasEverNotifiedAboutPlaying before dispatching the 'playing' event, so that
1629         tests can check bestMediaElementForShowingPlaybackControlsManager() in the 'playing' handler.
1630
1631         * html/HTMLMediaElement.cpp:
1632         (WebCore::HTMLMediaElement::notifyAboutPlaying):
1633         * html/HTMLMediaElement.h:
1634         * html/MediaElementSession.cpp:
1635         (WebCore::MediaElementSession::canShowControlsManager const):
1636         * testing/Internals.cpp:
1637         (WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
1638         * testing/Internals.h:
1639         * testing/Internals.idl:
1640
1641 2018-05-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1642
1643         Unreviewed, silence a -Wreturn-type warning
1644
1645         * css/SVGCSSComputedStyleDeclaration.cpp:
1646         (WebCore::glyphOrientationToCSSPrimitiveValue):
1647
1648 2018-05-30  Alexey Proskuryakov  <ap@apple.com>
1649
1650         Build fix attempt after https://trac.webkit.org/r232198
1651
1652         * platform/network/cf/ResourceHandleCFNet.cpp:
1653         (WebCore::ResourceHandle::createCFURLConnection): Added some toString() calls.
1654
1655 2018-05-30  Zalan Bujtas  <zalan@apple.com>
1656
1657         [LFC] Miscellaneous fixes to get closer to geometry correctness
1658         https://bugs.webkit.org/show_bug.cgi?id=186083
1659
1660         Reviewed by Antti Koivisto.
1661
1662         * layout/FormattingContextGeometry.cpp:
1663         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
1664         * layout/LayoutContext.cpp:
1665         (WebCore::Layout::LayoutContext::initializeRoot):
1666         * layout/Verification.cpp:
1667         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
1668         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1669         (WebCore::Layout::isStretchedToViewport):
1670         (WebCore::Layout::initialContainingBlock):
1671         (WebCore::Layout::computedInFlowNonReplacedComputedHeight):
1672         (WebCore::Layout::inFlowNonReplacedComputedWidth):
1673         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): lambda should capture the specification part. 
1674         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidth):
1675         * layout/displaytree/DisplayBox.cpp:
1676         (WebCore::Display::Box::marginBox const):
1677         (WebCore::Display::Box::paddingBox const):
1678         (WebCore::Display::Box::contentBox const):
1679         * layout/layouttree/LayoutBox.cpp:
1680         (WebCore::Layout::Box::isDocumentBox const):
1681         (WebCore::Layout::Box::isBodyBox const):
1682         * layout/layouttree/LayoutBox.h:
1683         * rendering/style/BorderValue.h: ignore border-width when type is hidden or none. 
1684         (WebCore::BorderValue::boxModelWidth const):
1685
1686 2018-05-30  Stephen McGruer  <smcgruer@chromium.org>
1687
1688         iOS: setting 'defaultValue' of input type=date from script should cause a UI update
1689         https://bugs.webkit.org/show_bug.cgi?id=185982
1690
1691         Reviewed by Darin Adler.
1692
1693         Test: fast/forms/date/date-appearance-defaultValue.html
1694
1695         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1696         (WebCore::BaseChooserOnlyDateAndTimeInputType::valueAttributeChanged):
1697         * html/BaseChooserOnlyDateAndTimeInputType.h:
1698         * html/HTMLInputElement.cpp:
1699         (WebCore::HTMLInputElement::parseAttribute):
1700         * html/InputType.cpp:
1701         (WebCore::InputType::valueAttributeChanged):
1702         * html/InputType.h:
1703
1704 2018-05-29  Nan Wang  <n_wang@apple.com>
1705
1706         Unreviewed, follow-up after r232285
1707         https://bugs.webkit.org/show_bug.cgi?id=180871
1708
1709         Removed redundant null check.
1710
1711         * accessibility/AccessibilityObject.cpp:
1712         (WebCore::AccessibilityObject::isExpanded const):
1713
1714 2018-05-29  Nan Wang  <n_wang@apple.com>
1715
1716         AX: macOS VoiceOver doesn't announce when details element is expanded when using role group
1717         https://bugs.webkit.org/show_bug.cgi?id=180866
1718         <rdar://problem/36074338>
1719
1720         Reviewed by Chris Fleizach.
1721
1722         We should use is<HTMLDetailsElement> to check for the details parent instead
1723         of using the role.
1724
1725         Added test cases to the existing test.
1726
1727         * accessibility/AccessibilityObject.cpp:
1728         (WebCore::AccessibilityObject::isExpanded const):
1729
1730 2018-05-29  Youenn Fablet  <youenn@apple.com>
1731
1732         Add a consistency check between URL and CFURL
1733         https://bugs.webkit.org/show_bug.cgi?id=186057
1734         <rdar://problem/40258457>
1735
1736         Reviewed by Geoff Garen.
1737
1738         It is important that WebCore::URL used in WebCore and CFURL that gets serialized in the network pipe remain consistent.
1739         Otherwise, we will end-up with odd bugs.
1740
1741         We add such a check when creating a CFURL from an URL.
1742         To make things more consistent, we also rely now more on WebCore::URL instead of directly creating a CFURL.
1743
1744         * platform/URL.h:
1745         * platform/cf/CFURLExtras.cpp:
1746         (WebCore::isCFURLSameOrigin):
1747         * platform/cf/CFURLExtras.h:
1748         * platform/cf/URLCF.cpp:
1749         (WebCore::URL::createCFURL const):
1750         * platform/mac/URLMac.mm:
1751         (WebCore::URL::createCFURL const):
1752         * platform/mac/WebCoreNSURLExtras.mm:
1753         (WebCore::URLWithUserTypedString):
1754
1755 2018-05-29  Timothy Hatcher  <timothy@apple.com>
1756
1757         Printing does not apply the right colors in all cases.
1758
1759         https://bugs.webkit.org/show_bug.cgi?id=186066
1760         rdar://problem/40274975
1761
1762         Reviewed by Tim Horton.
1763
1764         * inspector/agents/InspectorPageAgent.cpp:
1765         (WebCore::InspectorPageAgent::setEmulatedMedia): Call RenderTheme::platformColorsDidChange
1766         to invalidate the color cache.
1767         * page/FrameView.cpp:
1768         (WebCore::FrameView::adjustMediaTypeForPrinting): Ditto.
1769         * page/Page.cpp:
1770         (WebCore::Page::defaultAppearance const): Added. Use default when not screen.
1771         * page/Page.h:
1772         (WebCore::Page::defaultAppearance const): Deleted.
1773
1774 2018-05-29  Per Arne Vollan  <pvollan@apple.com>
1775
1776         Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
1777         https://bugs.webkit.org/show_bug.cgi?id=186056
1778
1779         Reviewed by Brent Fulgham.
1780
1781         No new tests, no change in behavior.
1782
1783         * platform/PlatformScreen.h:
1784         * platform/mac/PlatformScreenMac.mm:
1785         (WebCore::screenProperties):
1786         (WebCore::getScreenProperties):
1787         (WebCore::setScreenProperties):
1788
1789 2018-05-29  Ryosuke Niwa  <rniwa@webkit.org>
1790
1791         iOS WK1: Occasional crash in sanitizedMarkupForFragmentInDocument
1792         https://bugs.webkit.org/show_bug.cgi?id=186011
1793
1794         Reviewed by David Kilzer.
1795
1796         The crash was caused by the HTML parser in sanitizedMarkupForFragmentInDocument yielding in the web thread
1797         when _WebThreadLock() sets webThreadShouldYield to true in the main thread.
1798
1799         No new tests. This is occasionally caught by existing tests.
1800
1801         * editing/markup.cpp:
1802         (WebCore::createPageForSanitizingWebContent): Fixed the bug by making the HTML parser never yield.
1803         Also release-assert that the body is never null here.
1804         (WebCore::sanitizedMarkupForFragmentInDocument): Removed superflous call to WTFMove since appendChild
1805         takes a reference, not a Ref.
1806         * inspector/InspectorOverlay.cpp:
1807         (WebCore::InspectorOverlay::overlayPage): Deployed the same fix.
1808         * loader/DocumentWriter.cpp:
1809         (WebCore::DocumentWriter::insertDataSynchronously): Added.
1810         * loader/DocumentWriter.h:
1811
1812 2018-05-29  Chris Dumez  <cdumez@apple.com>
1813
1814         Avoid unnecessary String allocation in isPublicSuffix(const String&)
1815         https://bugs.webkit.org/show_bug.cgi?id=186054
1816
1817         Reviewed by Sam Weinig.
1818
1819         Avoid unnecessary String allocation in isPublicSuffix(const String&) by calling directly
1820         the decodeHostName() overload taking in a NSString*. This overload returns a NSString*,
1821         which is what we need. We would previously call the overloading taking in a String, which
1822         would return a String, which we would have to convert back to a NSString*.
1823
1824         * platform/mac/PublicSuffixMac.mm:
1825         (WebCore::isPublicSuffix):
1826
1827 2018-05-29  Alex Christensen  <achristensen@webkit.org>
1828
1829         Do even fewer allocations in URL host operations
1830         https://bugs.webkit.org/show_bug.cgi?id=186003
1831
1832         Reviewed by Geoffrey Garen.
1833
1834         * loader/ResourceLoadStatistics.cpp:
1835         (WebCore::ResourceLoadStatistics::primaryDomain):
1836         * loader/ResourceLoadStatistics.h:
1837         * platform/URL.cpp:
1838         (WebCore::URL::hostIsIPAddress):
1839         * platform/URL.h:
1840         * platform/mac/URLMac.mm:
1841         (WebCore::URL::hostIsIPAddress):
1842         * platform/soup/URLSoup.cpp:
1843         (WebCore::URL::hostIsIPAddress):
1844
1845 2018-05-29  Tadeu Zagallo  <tzagallo@apple.com>
1846
1847         Don't assert on m_actionsStart when setting actions on DFA nodes
1848         https://bugs.webkit.org/show_bug.cgi?id=185979
1849         <rdar://problem/39669458>
1850
1851         Reviewed by Geoffrey Garen.
1852
1853         DFANode::setActions is called immediately after the node is created, and once again to set
1854         the actions of catch-all regular expressions (.*) on the root node. That works because
1855         m_actionsStart is initially 0, since the root was the first node to be created, but may fail
1856         after minimizing the DFA, when the root may no longer be the first node, and therefore
1857         m_actionsStart would not be 0, even if there are no actions attached to that node.
1858
1859         Test: http/tests/contentextensions/root-actions.html
1860
1861         * contentextensions/DFANode.h:
1862
1863 2018-05-29  Nan Wang  <n_wang@apple.com>
1864
1865         AX: setValue on contenteditable should preserve whitespace
1866         https://bugs.webkit.org/show_bug.cgi?id=185897
1867
1868         Reviewed by Ryosuke Niwa.
1869
1870         We should mimic typing when setting value to a contenteditable from accessibility
1871         instead of mutating the DOM by using setInnerText.
1872
1873         Updated tests to cover this change.
1874
1875         * accessibility/AccessibilityRenderObject.cpp:
1876         (WebCore::AccessibilityRenderObject::setValue):
1877
1878 2018-05-29  Zalan Bujtas  <zalan@apple.com>
1879
1880         [LFC] Miscellaneous fixes to ensure no assertion in LayoutContext::layout
1881         https://bugs.webkit.org/show_bug.cgi?id=186052
1882
1883         Reviewed by Antti Koivisto.
1884
1885         With this patch, LayoutContext::layout() does not assert on <html><body><div></div></body></html> anymore.
1886
1887         * layout/LayoutContext.cpp:
1888         (WebCore::Layout::LayoutContext::initializeRoot): New context root is always a layout root.
1889         * layout/LayoutContext.h:
1890         * layout/Verification.cpp:
1891         (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
1892         * layout/blockformatting/BlockFormattingContext.cpp:
1893         (WebCore::Layout::BlockFormattingContext::layout const): we need computed margin/border/padding for width computation  
1894         * layout/displaytree/DisplayBox.cpp: Add clone() method to be able to carry over the 'hasValid*' bits.
1895         (WebCore::Display::Box::Style::Style):
1896         (WebCore::Display::Box::borderBox const):
1897         (WebCore::Display::Box::contentBox const):
1898         * layout/displaytree/DisplayBox.h:
1899         (WebCore::Display::Box::Rect::operator LayoutRect const):
1900         (WebCore::Display::Box::setSize):
1901         (WebCore::Display::Box::setHasValidMargin):
1902         (WebCore::Display::Box::setHasValidBorder):
1903         (WebCore::Display::Box::setHasValidPadding):
1904         (WebCore::Display::Box::Rect::setHasValidPosition):
1905         (WebCore::Display::Box::Rect::setHasValidSize):
1906         (WebCore::Display::Box::Rect::setSize):
1907         (WebCore::Display::Box::Rect::clone const):
1908         (WebCore::Display::Box::setMargin):
1909         (WebCore::Display::Box::setBorder):
1910         (WebCore::Display::Box::setPadding):
1911         (WebCore::Display::Box::Rect::Rect): Deleted.
1912
1913 2018-05-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1914
1915         [Extra zoom mode] "Significant area painted" rendering progress event is rarely fired
1916         https://bugs.webkit.org/show_bug.cgi?id=186042
1917         <rdar://problem/40604182>
1918
1919         Reviewed by Tim Horton.
1920
1921         Makes a minor tweak to the size of the relevant view rect in extra zoom mode, such that it's no wider than the
1922         visible content rect. Previously, the width of this rect has hard-coded to a value optimized for macOS (980),
1923         which makes it difficult for content laid out at device width in extra zoom mode to cover a significant portion
1924         of the relevant view rect.
1925
1926         Test: RenderingProgressTests.FirstPaintWithSignificantArea
1927
1928         * page/Page.cpp:
1929         (WebCore::relevantViewRect):
1930
1931 2018-05-29  Antoine Quint  <graouts@apple.com>
1932
1933         [Web Animations] Handle relative length units
1934         https://bugs.webkit.org/show_bug.cgi?id=186047
1935
1936         Reviewed by Dean Jackson.
1937
1938         In order to correctly handle relative units, such as "em", "vw" and "vh", we need to do two things.
1939
1940         First, because we need to apply the cascade to correctly compute relative lengths, we need to delay the computation of
1941         "blending keyframes" to when we have both keyframes data and a valid target. This also means that we need to reset blending
1942         keyframes when the target changes. As a result, old call sites of updateBlendingKeyframes() have been replaced by a call to
1943         m_blendingKeyframes.clear() and the method now gets called as part of apply() with the RenderStyle of the targeted element
1944         as a parameter.
1945
1946         Second, and as a result of the first change, we need to update the accelerated animation state based on animation
1947         progress rather than when calling specific methods, such as Animation.play() and Animation.pause(), since blending
1948         keyframes may not be available at those more specific call sites. We now have a new updateAcceleratedAnimationState()
1949         method that gets called as part of apply(). We also rename animationPlayStateDidChange() to animationSuspensionStateDidChange()
1950         since this method was specific to suspension and had a confusing name.
1951
1952         * animation/AnimationEffectReadOnly.h: Rename animationPlayStateDidChange() to animationSuspensionStateDidChange().
1953         * animation/KeyframeEffectReadOnly.cpp:
1954         (WebCore::KeyframeEffectReadOnly::getKeyframes): Fix a crash that revealed itself after other changes in this patch. We would later
1955         call into ComputedStyleExtractor::animationSuspensionStateDidChange() and this would yield an assertion because we'd call potentially
1956         call it with a custom CSS property.
1957         (WebCore::KeyframeEffectReadOnly::processKeyframes): Reset blending keyframes instead of calling updateBlendingKeyframes() since
1958         blending keyframes is now performed asynchronously upon style resolution.
1959         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes): Take the target's RenderStyle as a parameter and use it to reset the
1960         associated StyleResolver's state, just like we do in StyleResolver::keyframeStylesForAnimation(), so that the CSS cascade is correctly
1961         accounted for when computing values using relative length units. Since blending keyframes can now be computed several times for a
1962         given set of keyframes, since the effect's target may change, we also need to create a copy of the MutableStyleProperties to pass
1963         to StyleRuleKeyframe::create().
1964         (WebCore::KeyframeEffectReadOnly::setTarget): Reset blending keyframes instead of calling updateBlendingKeyframes() since
1965         blending keyframes is now performed asynchronously upon style resolution.
1966         (WebCore::KeyframeEffectReadOnly::apply): Update blending keyframes and the accelerated animation state.
1967         (WebCore::KeyframeEffectReadOnly::getAnimatedStyle): Make sure we have blending keyframes with a call to updateBlendingKeyframes()
1968         in case the animation hasn't naturally progressed when this method is called.
1969         (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): Make sure we have blending keyframes with a call to
1970         updateBlendingKeyframes() in case the animation hasn't naturally progressed when this method is called.
1971         (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState): Account for the animation's local time and play state to update
1972         the accelerated animation state.
1973         (WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): Record the last accelerated action in a member variable which we can
1974         use to determine if we're running accelerated accounting for uncommited changes.
1975         (WebCore::KeyframeEffectReadOnly::animationDidSeek): Only record an AcceleratedAction::Seek action if we're already running accelerated.
1976         (WebCore::KeyframeEffectReadOnly::animationSuspensionStateDidChange): Only record an AcceleratedAction::Pause or AcceleratedAction::Play
1977         action if we're already running accelerated.
1978         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Ensure we clone and clear the list of accelerated actions and check that
1979         we have any cloned actions before proceeding any further. Then we can stop accounting for m_startedAccelerated since the list of accelerated
1980         actions already account for animation state changes.
1981         (WebCore::KeyframeEffectReadOnly::animationPlayStateDidChange): Deleted.
1982         * animation/KeyframeEffectReadOnly.h:
1983         (WebCore::KeyframeEffectReadOnly::isRunningAccelerated const): Account for the m_lastRecordedAcceleratedAction to identify whether we're running.
1984         * animation/WebAnimation.cpp:
1985         (WebCore::WebAnimation::play): Stop calling animationPlayStateDidChange() directly since the accelerated animation state is now updated when
1986         the animation's effect is applied.
1987         (WebCore::WebAnimation::pause): Stop calling animationPlayStateDidChange() directly since the accelerated animation state is now updated when
1988         the animation's effect is applied.
1989         (WebCore::WebAnimation::resolve): Make sure we update the finished state prior to applying the animation's effect since the play state can
1990         change when updating the finished state and KeyframeEffectReadOnly::updateAcceleratedAnimationState(), which is called when calling into
1991         KeyframeEffectReadOnly::apply(), relies on it to correctly update the accelerated animation state.
1992         (WebCore::WebAnimation::setSuspended): Rename animationPlayStateDidChange() to animationSuspensionStateDidChange().
1993         * css/StyleResolver.cpp:
1994         (WebCore::StyleResolver::setNewStateWithElement): Add a new public method to reset a StyleResolver's state such that we can call it when creating
1995         blending keyframes for JS-originated animations just like we do when creating blending keyframes for CSS Animations in keyframeStylesForAnimation().
1996         (WebCore::StyleResolver::keyframeStylesForAnimation): Use the new setNewStateWithElement() method.
1997         * css/StyleResolver.h:
1998
1999 2018-05-29  Thibault Saunier  <tsaunier@igalia.com>
2000
2001         [GStreamer] Update "qtdemux: Clarify field name about stream-encryption-system" patch
2002         https://bugs.webkit.org/show_bug.cgi?id=186040
2003
2004         Reviewed by Xabier Rodriguez-Calvar.
2005
2006         s/avalaible-stream-encryption-systems/available-stream-encryption-systems/g
2007
2008         Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
2009
2010         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2011         (WebCore::extractEventsAndSystemsFromMessage):
2012
2013 2018-05-28  Zalan Bujtas  <zalan@apple.com>
2014
2015         Unreviewed build fix.
2016
2017         * layout/displaytree/DisplayBox.h:
2018         (WebCore::Display::Box::Rect::operator LayoutRect const):
2019
2020 2018-05-28  Zalan Bujtas  <zalan@apple.com>
2021
2022         [LFC] Add Rect interface to Display::Box
2023         https://bugs.webkit.org/show_bug.cgi?id=186019
2024
2025         Reviewed by Antti Koivisto.
2026
2027         Having a dedicated Rect class and moving the geometry invalidation to it enables us to call
2028         displayBox.contentBox().left() even when the widht/height are not computed yet.
2029         Also having Rect with top/left/bottom/right interface is more aligned with the rest of the layout code than x/y/maxX/maxY.
2030
2031         * layout/FormattingContextGeometry.cpp:
2032         (WebCore::Layout::contentHeightForFormattingContextRoot):
2033         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2034         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
2035         * layout/displaytree/DisplayBox.cpp:
2036         (WebCore::Display::Box::marginBox const):
2037         (WebCore::Display::Box::borderBox const):
2038         (WebCore::Display::Box::paddingBox const):
2039         (WebCore::Display::Box::contentBox const):
2040         * layout/displaytree/DisplayBox.h:
2041         (WebCore::Display::Box::Rect::invalidateTop):
2042         (WebCore::Display::Box::Rect::invalidateLeft):
2043         (WebCore::Display::Box::Rect::invalidateWidth):
2044         (WebCore::Display::Box::Rect::invalidateHeight):
2045         (WebCore::Display::Box::Rect::hasValidPosition const):
2046         (WebCore::Display::Box::Rect::hasValidSize const):
2047         (WebCore::Display::Box::Rect::hasValidGeometry const):
2048         (WebCore::Display::Box::rect const):
2049         (WebCore::Display::Box::top const):
2050         (WebCore::Display::Box::left const):
2051         (WebCore::Display::Box::bottom const):
2052         (WebCore::Display::Box::right const):
2053         (WebCore::Display::Box::topLeft const):
2054         (WebCore::Display::Box::bottomRight const):
2055         (WebCore::Display::Box::size const):
2056         (WebCore::Display::Box::width const):
2057         (WebCore::Display::Box::height const):
2058         (WebCore::Display::Box::setTopLeft):
2059         (WebCore::Display::Box::setTop):
2060         (WebCore::Display::Box::setLeft):
2061         (WebCore::Display::Box::setWidth):
2062         (WebCore::Display::Box::setHeight):
2063         (WebCore::Display::Box::Rect::invalidatePosition):
2064         (WebCore::Display::Box::Rect::setHasValidPosition):
2065         (WebCore::Display::Box::Rect::Rect):
2066         (WebCore::Display::Box::Rect::top const):
2067         (WebCore::Display::Box::Rect::left const):
2068         (WebCore::Display::Box::Rect::bottom const):
2069         (WebCore::Display::Box::Rect::right const):
2070         (WebCore::Display::Box::Rect::topLeft const):
2071         (WebCore::Display::Box::Rect::bottomRight const):
2072         (WebCore::Display::Box::Rect::size const):
2073         (WebCore::Display::Box::Rect::width const):
2074         (WebCore::Display::Box::Rect::height const):
2075         (WebCore::Display::Box::Rect::setTopLeft):
2076         (WebCore::Display::Box::Rect::setTop):
2077         (WebCore::Display::Box::Rect::setLeft):
2078         (WebCore::Display::Box::Rect::setWidth):
2079         (WebCore::Display::Box::Rect::setHeight):
2080         (WebCore::Display::Box::Rect::shiftLeftTo):
2081         (WebCore::Display::Box::Rect::shiftRightTo):
2082         (WebCore::Display::Box::Rect::shiftTopTo):
2083         (WebCore::Display::Box::Rect::shiftBottomTo):
2084         (WebCore::Display::Box::Rect::expand):
2085         (WebCore::Display::Box::invalidateTop): Deleted.
2086         (WebCore::Display::Box::invalidateLeft): Deleted.
2087         (WebCore::Display::Box::invalidateWidth): Deleted.
2088         (WebCore::Display::Box::invalidateHeight): Deleted.
2089         (WebCore::Display::Box::hasValidPosition const): Deleted.
2090         (WebCore::Display::Box::hasValidSize const): Deleted.
2091         (WebCore::Display::Box::hasValidGeometry const): Deleted.
2092         (WebCore::Display::Box::invalidatePosition): Deleted.
2093         (WebCore::Display::Box::setHasValidPosition): Deleted.
2094
2095 2018-05-28  Zalan Bujtas  <zalan@apple.com>
2096
2097         [LFC] Add formatting context testing codepath in FrameViewLayoutContext
2098         https://bugs.webkit.org/show_bug.cgi?id=186036
2099
2100         Reviewed by Antti Koivisto.
2101
2102         This is to verify the formatting context layout correctness.
2103
2104         * layout/LayoutContext.cpp:
2105         (WebCore::Layout::LayoutContext::LayoutContext):
2106         (WebCore::Layout::LayoutContext::initializeRoot):
2107         * layout/LayoutContext.h:
2108         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
2109         * page/FrameViewLayoutContext.cpp:
2110         (WebCore::layoutUsingFormattingContext):
2111         (WebCore::FrameViewLayoutContext::layout):
2112
2113 2018-05-28  Zalan Bujtas  <zalan@apple.com>
2114
2115         [LFC] Add layout tree verification.
2116         https://bugs.webkit.org/show_bug.cgi?id=186018
2117
2118         Reviewed by Antti Koivisto.
2119
2120         Compare layout and render tree geometry and output the mismtaching rectangles.
2121
2122         * Sources.txt:
2123         * WebCore.xcodeproj/project.pbxproj: Add missing headers and make then private.
2124         * layout/LayoutContext.h:
2125         * layout/Verification.cpp: Added.
2126         (WebCore::Layout::outputMismatchedBoxInformationIfNeeded):
2127         (WebCore::Layout::verifySubtree):
2128         (WebCore::Layout::LayoutContext::verifyAndOutputLayoutTree const):
2129
2130 2018-05-28  Sam Weinig  <sam@webkit.org>
2131
2132         Modernize SVGRenderStyleDefs.h
2133         https://bugs.webkit.org/show_bug.cgi?id=186024
2134
2135         Reviewed by Daniel Bates.
2136
2137         Modernized the set of enums in SVGRenderStyleDefs.h and WindRule.h by:
2138             - Converting them to enum classes
2139             - Renaming them to remove unnecessary prefix 'E's
2140             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
2141             - Renaming to match modern conventions (e.g BNONE -> None)
2142
2143         Modernizes the following enums:
2144             SVGPaintType
2145             BaselineShift (renamed from EBaselineShift)
2146             TextAnchor (renamed from ETextAnchor)
2147             ColorInterpolation (renamed from EColorInterpolation)
2148             ColorRendering (renamed from EColorRendering)
2149             ShapeRendering (renamed from EShapeRendering)
2150             GlyphOrientation (renamed from EGlyphOrientation)
2151             AlignmentBaseline (renamed from EAlignmentBaseline)
2152             DominantBaseline (renamed from EDominantBaseline)
2153             VectorEffect (renamed from EVectorEffect)
2154             BufferedRendering (renamed from EBufferedRendering)
2155             MaskType (renamed from EMaskType)
2156             WindRule
2157
2158         * css/CSSBasicShapes.cpp:
2159         (WebCore::buildPathString):
2160         (WebCore::buildPolygonString):
2161         * css/CSSBasicShapes.h:
2162         * css/CSSPrimitiveValueMappings.h:
2163         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2164         (WebCore::CSSPrimitiveValue::operator WindRule const):
2165         (WebCore::CSSPrimitiveValue::operator AlignmentBaseline const):
2166         (WebCore::CSSPrimitiveValue::operator BufferedRendering const):
2167         (WebCore::CSSPrimitiveValue::operator ColorInterpolation const):
2168         (WebCore::CSSPrimitiveValue::operator ColorRendering const):
2169         (WebCore::CSSPrimitiveValue::operator DominantBaseline const):
2170         (WebCore::CSSPrimitiveValue::operator ShapeRendering const):
2171         (WebCore::CSSPrimitiveValue::operator TextAnchor const):
2172         (WebCore::CSSPrimitiveValue::operator VectorEffect const):
2173         (WebCore::CSSPrimitiveValue::operator MaskType const):
2174         (WebCore::CSSPrimitiveValue::operator EAlignmentBaseline const): Deleted.
2175         (WebCore::CSSPrimitiveValue::operator EBufferedRendering const): Deleted.
2176         (WebCore::CSSPrimitiveValue::operator EColorInterpolation const): Deleted.
2177         (WebCore::CSSPrimitiveValue::operator EColorRendering const): Deleted.
2178         (WebCore::CSSPrimitiveValue::operator EDominantBaseline const): Deleted.
2179         (WebCore::CSSPrimitiveValue::operator EShapeRendering const): Deleted.
2180         (WebCore::CSSPrimitiveValue::operator ETextAnchor const): Deleted.
2181         (WebCore::CSSPrimitiveValue::operator EVectorEffect const): Deleted.
2182         (WebCore::CSSPrimitiveValue::operator EMaskType const): Deleted.
2183         * css/SVGCSSComputedStyleDeclaration.cpp:
2184         (WebCore::glyphOrientationToCSSPrimitiveValue):
2185         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
2186         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2187         * css/StyleBuilderConverter.h:
2188         (WebCore::StyleBuilderConverter::convertGlyphOrientation):
2189         (WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
2190         * css/StyleBuilderCustom.h:
2191         (WebCore::StyleBuilderCustom::applyValueBaselineShift):
2192         (WebCore::StyleBuilderCustom::applyValueFill):
2193         (WebCore::StyleBuilderCustom::applyValueStroke):
2194         * css/parser/CSSPropertyParser.cpp:
2195         (WebCore::consumeBasicShapePolygon):
2196         (WebCore::consumeBasicShapePath):
2197         * html/canvas/CanvasRenderingContext2DBase.cpp:
2198         (WebCore::toWindRule):
2199         * page/animation/CSSPropertyAnimation.cpp:
2200         (WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
2201         * platform/graphics/FloatPolygon.cpp:
2202         (WebCore::FloatPolygon::contains const):
2203         * platform/graphics/GraphicsContext.cpp:
2204         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2205         * platform/graphics/GraphicsContext.h:
2206         * platform/graphics/GraphicsLayer.cpp:
2207         (WebCore::GraphicsLayer::shapeLayerWindRule const):
2208         * platform/graphics/GraphicsLayer.h:
2209         * platform/graphics/GraphicsTypes.cpp:
2210         (WebCore::operator<<):
2211         * platform/graphics/Path.h:
2212         * platform/graphics/ShadowBlur.cpp:
2213         (WebCore::ShadowBlur::drawInsetShadow):
2214         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
2215         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
2216         * platform/graphics/WindRule.h:
2217         (): Deleted.
2218         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2219         (PlatformCALayerCocoa::shapeWindRule const):
2220         (PlatformCALayerCocoa::setShapeWindRule):
2221         * platform/graphics/cg/GraphicsContextCG.cpp:
2222         (WebCore::calculateDrawingMode):
2223         (WebCore::GraphicsContext::fillPath):
2224         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2225         (WebCore::GraphicsContext::clipPath):
2226         * platform/graphics/cg/PathCG.cpp:
2227         (WebCore::Path::contains const):
2228         * platform/mock/MockRealtimeVideoSource.cpp:
2229         (WebCore::MockRealtimeVideoSource::drawAnimation):
2230         * rendering/FilterEffectRenderer.cpp:
2231         (WebCore::FilterEffectRenderer::buildReferenceFilter):
2232         * rendering/RenderBoxModelObject.cpp:
2233         (WebCore::RenderBoxModelObject::paintBorder):
2234         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
2235         * rendering/RenderElement.cpp:
2236         (WebCore::RenderElement::paintOutline):
2237         * rendering/RenderLayer.cpp:
2238         (WebCore::RenderLayer::computeClipPath const):
2239         * rendering/style/BasicShapes.h:
2240         (WebCore::BasicShape::windRule const):
2241         * rendering/style/RenderStyle.h:
2242         (WebCore::RenderStyle::fillPaintType const):
2243         (WebCore::RenderStyle::setFillPaintColor):
2244         (WebCore::RenderStyle::strokePaintType const):
2245         (WebCore::RenderStyle::setStrokePaintColor):
2246         * rendering/style/SVGRenderStyle.h:
2247         (WebCore::SVGRenderStyle::initialAlignmentBaseline):
2248         (WebCore::SVGRenderStyle::initialDominantBaseline):
2249         (WebCore::SVGRenderStyle::initialBaselineShift):
2250         (WebCore::SVGRenderStyle::initialVectorEffect):
2251         (WebCore::SVGRenderStyle::initialBufferedRendering):
2252         (WebCore::SVGRenderStyle::initialClipRule):
2253         (WebCore::SVGRenderStyle::initialColorInterpolation):
2254         (WebCore::SVGRenderStyle::initialColorInterpolationFilters):
2255         (WebCore::SVGRenderStyle::initialColorRendering):
2256         (WebCore::SVGRenderStyle::initialFillRule):
2257         (WebCore::SVGRenderStyle::initialShapeRendering):
2258         (WebCore::SVGRenderStyle::initialTextAnchor):
2259         (WebCore::SVGRenderStyle::initialGlyphOrientationHorizontal):
2260         (WebCore::SVGRenderStyle::initialGlyphOrientationVertical):
2261         (WebCore::SVGRenderStyle::initialFillPaintType):
2262         (WebCore::SVGRenderStyle::initialStrokePaintType):
2263         (WebCore::SVGRenderStyle::initialMaskType):
2264         (WebCore::SVGRenderStyle::setAlignmentBaseline):
2265         (WebCore::SVGRenderStyle::setDominantBaseline):
2266         (WebCore::SVGRenderStyle::setBaselineShift):
2267         (WebCore::SVGRenderStyle::setVectorEffect):
2268         (WebCore::SVGRenderStyle::setBufferedRendering):
2269         (WebCore::SVGRenderStyle::setClipRule):
2270         (WebCore::SVGRenderStyle::setColorInterpolation):
2271         (WebCore::SVGRenderStyle::setColorInterpolationFilters):
2272         (WebCore::SVGRenderStyle::setColorRendering):
2273         (WebCore::SVGRenderStyle::setFillRule):
2274         (WebCore::SVGRenderStyle::setShapeRendering):
2275         (WebCore::SVGRenderStyle::setTextAnchor):
2276         (WebCore::SVGRenderStyle::setGlyphOrientationHorizontal):
2277         (WebCore::SVGRenderStyle::setGlyphOrientationVertical):
2278         (WebCore::SVGRenderStyle::setMaskType):
2279         (WebCore::SVGRenderStyle::alignmentBaseline const):
2280         (WebCore::SVGRenderStyle::dominantBaseline const):
2281         (WebCore::SVGRenderStyle::baselineShift const):
2282         (WebCore::SVGRenderStyle::vectorEffect const):
2283         (WebCore::SVGRenderStyle::bufferedRendering const):
2284         (WebCore::SVGRenderStyle::clipRule const):
2285         (WebCore::SVGRenderStyle::colorInterpolation const):
2286         (WebCore::SVGRenderStyle::colorInterpolationFilters const):
2287         (WebCore::SVGRenderStyle::colorRendering const):
2288         (WebCore::SVGRenderStyle::fillRule const):
2289         (WebCore::SVGRenderStyle::shapeRendering const):
2290         (WebCore::SVGRenderStyle::textAnchor const):
2291         (WebCore::SVGRenderStyle::glyphOrientationHorizontal const):
2292         (WebCore::SVGRenderStyle::glyphOrientationVertical const):
2293         (WebCore::SVGRenderStyle::fillPaintType const):
2294         (WebCore::SVGRenderStyle::strokePaintType const):
2295         (WebCore::SVGRenderStyle::maskType const):
2296         (WebCore::SVGRenderStyle::visitedLinkFillPaintType const):
2297         (WebCore::SVGRenderStyle::visitedLinkStrokePaintType const):
2298         (WebCore::SVGRenderStyle::hasStroke const):
2299         (WebCore::SVGRenderStyle::hasFill const):
2300         (WebCore::SVGRenderStyle::setBitDefaults):
2301         * rendering/style/SVGRenderStyleDefs.h:
2302         (WebCore::StyleFillData::create):
2303         (WebCore::StyleFillData::operator!= const):
2304         (WebCore::StyleStrokeData::create):
2305         (WebCore::StyleStrokeData::operator!= const):
2306         (WebCore::StyleStopData::create):
2307         (WebCore::StyleStopData::operator!= const):
2308         (WebCore::StyleTextData::create):
2309         (WebCore::StyleTextData::operator!= const):
2310         (WebCore::StyleMiscData::create):
2311         (WebCore::StyleMiscData::operator!= const):
2312         (WebCore::StyleShadowSVGData::create):
2313         (WebCore::StyleShadowSVGData::operator!= const):
2314         (WebCore::StyleResourceData::create):
2315         (WebCore::StyleResourceData::operator!= const):
2316         (WebCore::StyleInheritedResourceData::create):
2317         (WebCore::StyleInheritedResourceData::operator!= const):
2318         (WebCore::StyleLayoutData::create):
2319         (WebCore::StyleLayoutData::operator!= const):
2320         (): Deleted.
2321         * rendering/svg/RenderSVGImage.cpp:
2322         (WebCore::RenderSVGImage::paint):
2323         * rendering/svg/RenderSVGRect.cpp:
2324         (WebCore::RenderSVGRect::updateShapeFromElement):
2325         * rendering/svg/RenderSVGResource.cpp:
2326         (WebCore::requestPaintingResource):
2327         * rendering/svg/RenderSVGResourceClipper.cpp:
2328         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
2329         * rendering/svg/RenderSVGResourceFilter.cpp:
2330         (WebCore::RenderSVGResourceFilter::buildPrimitives const):
2331         * rendering/svg/RenderSVGResourceGradient.cpp:
2332         (WebCore::RenderSVGResourceGradient::applyResource):
2333         * rendering/svg/RenderSVGResourceMasker.cpp:
2334         (WebCore::RenderSVGResourceMasker::applyResource):
2335         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
2336         * rendering/svg/RenderSVGResourcePattern.cpp:
2337         (WebCore::RenderSVGResourcePattern::applyResource):
2338         * rendering/svg/RenderSVGShape.cpp:
2339         (WebCore::RenderSVGShape::paint):
2340         * rendering/svg/RenderSVGShape.h:
2341         (WebCore::RenderSVGShape::hasNonScalingStroke const):
2342         * rendering/svg/SVGRenderTreeAsText.cpp:
2343         (WebCore::writeStyle):
2344         (WebCore::writeSVGInlineTextBox):
2345         * rendering/svg/SVGResources.cpp:
2346         (WebCore::paintingResourceFromSVGPaint):
2347         * rendering/svg/SVGTextChunk.cpp:
2348         (WebCore::SVGTextChunk::SVGTextChunk):
2349         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
2350         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
2351         (WebCore::SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline const):
2352         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
2353         (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
2354         * rendering/svg/SVGTextLayoutEngineBaseline.h:
2355
2356 2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2357
2358         [Web Animations] Test webanimations/css-animations.html is crashing
2359         https://bugs.webkit.org/show_bug.cgi?id=186031
2360
2361         Reviewed by Antoine Quint.
2362
2363         This is another case of std::optional value being used while it's nullopt, I guess this started to fail when we
2364         stopped using the WTF implementation of std::optional. The problem is that we try to get the current iteration
2365         of a declarative animation when the active time is unresolved.
2366
2367         * animation/DeclarativeAnimation.cpp:
2368         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Use value_or(0) instead of value() to get the current
2369         iteration of the effect.
2370
2371 2018-05-28  Thibault Saunier  <tsaunier@igalia.com>
2372
2373         [GStreamer] Handle changes in the "drm-preferred-decryption-system-id" NEED_CONTEXT message.
2374         https://bugs.webkit.org/show_bug.cgi?id=185948
2375
2376         Reviewed by Xabier Rodriguez-Calvar.
2377
2378         - The "stream-encryption-systems" field of the "drm-preferred-decryption-system-id" query was renamed to
2379           "avalaible-stream-encryption-systems"
2380         - It can now be NULL, meaning there is no decryptor avalaible.
2381
2382         Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-*
2383
2384         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2385         (WebCore::extractEventsAndSystemsFromMessage): Handle NULL value for "avalaible-stream-encryption-systems",
2386         moved some code to make the order of the Arrays in the pair clearer.
2387
2388 2018-05-27  Dan Bernstein  <mitz@apple.com>
2389
2390         Reverted the changes made for https://webkit.org/b/186016
2391
2392         They broke the USE(APPLE_INTERNAL_SDK) Sierra build.
2393
2394 2018-05-27  David Kilzer  <ddkilzer@apple.com>
2395
2396         [iOS] Fix warnings about leaks found by clang static analyzer
2397         <https://webkit.org/b/186009>
2398         <rdar://problem/40574267>
2399
2400         Reviewed by Daniel Bates.
2401
2402         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
2403         (WebCore::LocalAuthenticator::makeCredential):
2404         (WebCore::LocalAuthenticator::getAssertion):
2405         (WebCore::LocalAuthenticator::issueClientCertificate const):
2406         - Don't leak CF objects in early return paths, and get rid of
2407           `retained*` variables, by making original variables use
2408           RetainPtr<>.
2409         * bridge/objc/WebScriptObject.mm:
2410         (+[WebUndefined allocWithZone:]): Modernize WebUndefined by
2411         using NeverDestroyed<RetainPr<WebUndefined>> type.  Explicitly
2412         retain the object returned on each call.
2413         (+[WebUndefined undefined]): Explicitly autorelease the object
2414         returned.  Note that neither of these changes fixes the static
2415         analyzer warnings in this source file.
2416         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2417         (WebCore::exernalDeviceDisplayNameForPlayer): Use RetainPtr<> to
2418         stop leaking NSString objects in a loop.
2419         * platform/ios/wak/WAKWindow.h:
2420         (-[WAKWindow _newFirstResponderAfterResigning]): Mark as
2421         NS_RETURNS_NOT_RETAINED like the corresponding AppKit method
2422         since this doesn't return a new object.  This fixes some
2423         false-positive leaks warnings.
2424
2425 2018-05-27  Dan Bernstein  <mitz@apple.com>
2426
2427         [Cocoa] Avoid importing directly from subumbrella frameworks
2428         https://bugs.webkit.org/show_bug.cgi?id=186016
2429
2430         Reviewed by Sam Weinig.
2431
2432         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
2433           OTHER_CPLUSPLUSFLAGS.
2434         * editing/mac/DictionaryLookup.mm: Import Quartz.h instead of a PDFKit header.
2435         * html/HTMLKeygenElement.cpp: Removed "using namespace WebCore" from this WebCore
2436           implementation file.
2437         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
2438         * platform/mac/PlatformScreenMac.mm: Import ApplicationServices.h instead of ColorSync.h
2439           when using SDKs earlier than 10.13.
2440         * platform/mediastream/CaptureDeviceManager.cpp: Enclosed the definitions in the WebCore
2441           namespace and removed "using namespace WebCore" from this WebCore implementation file.
2442         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
2443
2444 2018-05-27  Fujii Hironori  <Hironori.Fujii@sony.com>
2445
2446         REGRESSION(r232198) [WinCairo] cannot convert from 'WTF::StringView' to 'const WTF::String'
2447         https://bugs.webkit.org/show_bug.cgi?id=186027
2448
2449         Unreviewed build fix
2450
2451         No new tests (No behavior change).
2452
2453         * platform/network/curl/AuthenticationChallengeCurl.cpp:
2454         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
2455         * platform/network/curl/CurlRequest.cpp:
2456         (WebCore::CurlRequest::setupTransfer):
2457         (WebCore::CurlRequest::willSetupSslCtx):
2458
2459 2018-05-27  Sam Weinig  <sam@webkit.org>
2460
2461         Modernize RenderStyleConstants.h - Part 3
2462         https://bugs.webkit.org/show_bug.cgi?id=186015
2463
2464         Reviewed by Yusuke Suzuki.
2465
2466         Modernized the third and final set of enums in RenderStyleConstants.h by:
2467             - Converting them to enum classes
2468             - Renaming them to remove unnecessary prefix 'E's
2469             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
2470
2471         Modernizes the following enums:
2472             TextDecoration
2473             TextDecorationSkip (renamed from TextDecorationSkipItems)
2474             TextUnderlinePosition
2475             HangingPunctuation
2476             SpeakAs (renamed from ESpeakAs)
2477             TextEmphasisPosition (renamed from TextEmphasisPositions)
2478
2479         This final set of enums are mostly (TextUnderlinePosition isn't really) used as bitmasks,
2480         so this change also converts their uses to use OptionSet. 
2481
2482         * accessibility/AccessibilityObject.h:
2483         (WebCore::AccessibilityObject::speakAsProperty const):
2484         * accessibility/AccessibilityRenderObject.cpp:
2485         (WebCore::AccessibilityRenderObject::speakAsProperty const):
2486         (WebCore::AccessibilityRenderObject::hasPlainText const):
2487         (WebCore::AccessibilityRenderObject::hasUnderline const):
2488         * accessibility/AccessibilityRenderObject.h:
2489         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2490         (AXAttributeStringSetStyle):
2491         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2492         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
2493         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2494         (AXAttributeStringSetStyle):
2495         * css/CSSComputedStyleDeclaration.cpp:
2496         (WebCore::renderTextDecorationFlagsToCSSValue):
2497         (WebCore::renderTextDecorationSkipFlagsToCSSValue):
2498         (WebCore::renderEmphasisPositionFlagsToCSSValue):
2499         (WebCore::speakAsToCSSValue):
2500         (WebCore::hangingPunctuationToCSSValue):
2501         * css/CSSLineBoxContainValue.h:
2502         * css/CSSPrimitiveValueMappings.h:
2503         (WebCore::CSSPrimitiveValue::operator HangingPunctuation const):
2504         (WebCore::CSSPrimitiveValue::operator TextDecoration const):
2505         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2506         (WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
2507         (WebCore::CSSPrimitiveValue::operator SpeakAs const):
2508         (WebCore::CSSPrimitiveValue::operator ESpeakAs const): Deleted.
2509         * css/StyleBuilderConverter.h:
2510         (WebCore::StyleBuilderConverter::convertTextDecoration):
2511         (WebCore::StyleBuilderConverter::valueToEmphasisPosition):
2512         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
2513         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
2514         (WebCore::StyleBuilderConverter::valueToDecorationSkip):
2515         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
2516         (WebCore::StyleBuilderConverter::convertSpeakAs):
2517         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
2518         * editing/cocoa/EditorCocoa.mm:
2519         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const):
2520         * editing/cocoa/HTMLConverter.mm:
2521         (WebCore::editingAttributedStringFromRange):
2522         * rendering/InlineFlowBox.cpp:
2523         (WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine const):
2524         (WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine const):
2525         * rendering/InlineFlowBox.h:
2526         * rendering/InlineTextBox.cpp:
2527         (WebCore::emphasisPositionHasNeitherLeftNorRight):
2528         (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
2529         (WebCore::InlineTextBox::paint):
2530         (WebCore::InlineTextBox::paintMarkedTextDecoration):
2531         * rendering/RenderBlockFlow.cpp:
2532         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
2533         * rendering/RenderBlockLineLayout.cpp:
2534         (WebCore::setLogicalWidthForTextRun):
2535         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
2536         * rendering/RenderElement.cpp:
2537         (WebCore::RenderElement::enclosingRendererWithTextDecoration const):
2538         * rendering/RenderElement.h:
2539         * rendering/RenderTableSection.cpp:
2540         (WebCore::RenderTableSection::addCell):
2541         * rendering/SimpleLineLayout.cpp:
2542         (WebCore::SimpleLineLayout::canUseForStyle):
2543         (WebCore::SimpleLineLayout::canUseForWithReason):
2544         * rendering/SimpleLineLayoutFunctions.cpp:
2545         (WebCore::SimpleLineLayout::paintFlow):
2546         * rendering/TextDecorationPainter.cpp:
2547         (WebCore::TextDecorationPainter::TextDecorationPainter):
2548         (WebCore::TextDecorationPainter::paintTextDecoration):
2549         (WebCore::collectStylesForRenderer):
2550         (WebCore::TextDecorationPainter::stylesForRenderer):
2551         * rendering/TextDecorationPainter.h:
2552         * rendering/TextPaintStyle.cpp:
2553         (WebCore::computeTextPaintStyle):
2554         * rendering/line/BreakingContext.h:
2555         (WebCore::BreakingContext::handleText):
2556         * rendering/style/RenderStyle.cpp:
2557         (WebCore::RenderStyle::RenderStyle):
2558         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
2559         * rendering/style/RenderStyle.h:
2560         (WebCore::RenderStyle::textDecorationsInEffect const):
2561         (WebCore::RenderStyle::textDecoration const):
2562         (WebCore::RenderStyle::textDecorationSkip const):
2563         (WebCore::RenderStyle::hangingPunctuation const):
2564         (WebCore::RenderStyle::textEmphasisPosition const):
2565         (WebCore::RenderStyle::speakAs const):
2566         (WebCore::RenderStyle::addToTextDecorationsInEffect):
2567         (WebCore::RenderStyle::setTextDecorationsInEffect):
2568         (WebCore::RenderStyle::setTextDecoration):
2569         (WebCore::RenderStyle::setTextDecorationSkip):
2570         (WebCore::RenderStyle::setSpeakAs):
2571         (WebCore::RenderStyle::setTextEmphasisPosition):
2572         (WebCore::RenderStyle::setHangingPunctuation):
2573         (WebCore::RenderStyle::initialHangingPunctuation):
2574         (WebCore::RenderStyle::initialTextDecoration):
2575         (WebCore::RenderStyle::initialTextDecorationSkip):
2576         (WebCore::RenderStyle::initialTextUnderlinePosition):
2577         (WebCore::RenderStyle::initialSpeakAs):
2578         (WebCore::RenderStyle::initialTextEmphasisPosition):
2579         * rendering/style/RenderStyleConstants.h:
2580         (WebCore::operator|): Deleted.
2581         (WebCore::operator|=): Deleted.
2582         * rendering/style/StyleRareInheritedData.cpp:
2583         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2584         * rendering/style/StyleVisualData.cpp:
2585         (WebCore::StyleVisualData::StyleVisualData):
2586         * rendering/svg/SVGInlineTextBox.cpp:
2587         (WebCore::SVGInlineTextBox::paint):
2588         (WebCore::positionOffsetForDecoration):
2589         (WebCore::thicknessForDecoration):
2590         (WebCore::findRendererDefininingTextDecoration):
2591         (WebCore::SVGInlineTextBox::paintDecoration):
2592         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
2593         * rendering/svg/SVGInlineTextBox.h:
2594         * style/InlineTextBoxStyle.cpp:
2595         (WebCore::computeUnderlineOffset):
2596         (WebCore::visualOverflowForDecorations):
2597
2598 2018-05-26  Zalan Bujtas  <zalan@apple.com>
2599
2600         [LFC] Implement margin computation
2601         https://bugs.webkit.org/show_bug.cgi?id=186008
2602
2603         Reviewed by Antti Koivisto.
2604
2605         * WebCore.xcodeproj/project.pbxproj:
2606         * layout/FormattingContext.cpp:
2607         (WebCore::Layout::FormattingContext::computeMargin const):
2608         (WebCore::Layout::FormattingContext::marginTop const): Deleted.
2609         (WebCore::Layout::FormattingContext::marginLeft const): Deleted.
2610         (WebCore::Layout::FormattingContext::marginBottom const): Deleted.
2611         (WebCore::Layout::FormattingContext::marginRight const): Deleted.
2612         * layout/FormattingContext.h:
2613         * layout/blockformatting/BlockFormattingContext.cpp:
2614         (WebCore::Layout::BlockFormattingContext::layout const):
2615         (WebCore::Layout::BlockFormattingContext::computeMargin const):
2616         (WebCore::Layout::BlockFormattingContext::marginTop const): Deleted.
2617         (WebCore::Layout::BlockFormattingContext::marginBottom const): Deleted.
2618         * layout/blockformatting/BlockFormattingContext.h:
2619         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2620         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight):
2621         (WebCore::Layout::BlockFormattingContext::Geometry::computedMargin):
2622         * layout/blockformatting/BlockMarginCollapse.cpp:
2623         (WebCore::Layout::_isMarginBottomCollapsedWithParent):
2624         (WebCore::Layout::collapsedMarginBottomFromLastChild):
2625         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
2626         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
2627         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
2628         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
2629         (WebCore::Layout::BlockMarginCollapse::marginTop): Deleted.
2630         (WebCore::Layout::BlockMarginCollapse::marginBottom): Deleted.
2631         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
2632         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
2633         * layout/blockformatting/BlockMarginCollapse.h: Removed.
2634
2635 2018-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
2636
2637         [Cocoa] Delete unnecessary WebCascadeList in ComplexTextController
2638         https://bugs.webkit.org/show_bug.cgi?id=186007
2639
2640         Reviewed by Zalan Bujtas.
2641
2642         Inside ComplexTextController::collectComplexTextRuns(), we chop up text based on which fonts should be
2643         used to render which grapheme clusters. For each grapheme cluster, we run through the font-family list
2644         in FontCascade::fontForCombiningCharacterSequence() and find the first font that can render the cluster.
2645         If no items can render the cluster, we construct a WebCascadeList and let CoreText try to figure out
2646         which fonts can render which clusters.
2647
2648         Except there's no point, because we just determined that no font in the list can be used to render the
2649         cluster. CoreText isn't magic; it isn't going to somehow disagree with us. WebCascadeList is just
2650         useless code.
2651
2652         No new tests because there is no behavior change.
2653
2654         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2655         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2656         (-[WebCascadeList initWithFont:character:]): Deleted.
2657         (-[WebCascadeList count]): Deleted.
2658         (-[WebCascadeList objectAtIndex:]): Deleted.
2659
2660 2018-05-25  Myles C. Maxfield  <mmaxfield@apple.com>
2661
2662         Improve the performance of Font::canRenderCombiningCharacterSequence()
2663         https://bugs.webkit.org/show_bug.cgi?id=185933
2664
2665         Reviewed by Ryosuke Niwa.
2666
2667         We don't need to create a whole CTLine just to determine whether or not a font supports rendering a grapheme cluster.
2668         Instead, the right way to do it is just see if the font's cmap table supports every code point in the cluster.
2669
2670         This patch reports a 2% progression on the attached PerformanceTest.
2671
2672         Test: Layout/ComplexLongUnique.html
2673
2674         * platform/graphics/Font.cpp:
2675         (WebCore::Font::canRenderCombiningCharacterSequence const):
2676         * platform/graphics/Font.h:
2677         * platform/graphics/cocoa/FontCocoa.mm:
2678         (WebCore::provideStringAndAttributes): Deleted.
2679         (WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
2680         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2681         (WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
2682
2683 2018-05-25  Eric Carlson  <eric.carlson@apple.com>
2684
2685         Captions are sized incorrectly in PiP mode
2686         https://bugs.webkit.org/show_bug.cgi?id=186005
2687         <rdar://problem/39729718>
2688
2689         Reviewed by Dean Jackson.
2690
2691         * html/shadow/MediaControlElements.cpp:
2692         (WebCore::MediaControlTextTrackContainerElement::updateSizes): Only sync text track bounds 
2693         when the size actually changes.
2694
2695         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
2696         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame): Call syncTextTrackBounds.
2697         (WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds): Set the text track layer size
2698         to m_videoFullscreenFrame, it is always set the size of the PiP/Fullscreen layer.
2699
2700 2018-05-25  Timothy Hatcher  <timothy@apple.com>
2701
2702         Setting drawsBackground to YES on a WKView doesn't take effect immediately
2703         https://bugs.webkit.org/show_bug.cgi?id=185885
2704         rdar://problem/39706506
2705
2706         Reviewed by Simon Fraser.
2707
2708         * page/Frame.cpp:
2709         (WebCore::Frame::createView): Always call updateBackgroundRecursively, it handles
2710         invalid colors correctly already.
2711         * page/FrameView.cpp:
2712         (WebCore::FrameView::setTransparent): Call setNeedsLayout() since base background color
2713         and transparent is used to update layers.
2714         (WebCore::FrameView::setBaseBackgroundColor): Ditto.
2715         (WebCore::FrameView::updateBackgroundRecursively): Schedule layout if needed.
2716         * page/FrameView.h:
2717         * rendering/RenderLayerCompositor.cpp:
2718         (WebCore::RenderLayerCompositor::viewHasTransparentBackground const): Use baseBackgroundColor
2719         instead of hardcoding white.
2720         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): Fixed incorrect changed logging.
2721
2722 2018-05-25  Youenn Fablet  <youenn@apple.com>
2723
2724         Migrate From-Origin to Cross-Origin-Resource-Policy
2725         https://bugs.webkit.org/show_bug.cgi?id=185840
2726
2727         Reviewed by Chris Dumez.
2728
2729         Tests: http/wpt/cross-origin-resource-policy/fetch-in-iframe.html
2730                http/wpt/cross-origin-resource-policy/fetch.html
2731                http/wpt/cross-origin-resource-policy/iframe-loads.html
2732                http/wpt/cross-origin-resource-policy/image-loads.html
2733                http/wpt/cross-origin-resource-policy/script-loads.html
2734
2735         * platform/network/HTTPHeaderNames.in:
2736         * platform/network/HTTPParsers.cpp:
2737         (WebCore::parseCrossOriginResourcePolicyHeader):
2738         * platform/network/HTTPParsers.h:
2739
2740 2018-05-25  Daniel Bates  <dabates@apple.com>
2741
2742         NavigationAction should not hold a strong reference to a Document
2743         https://bugs.webkit.org/show_bug.cgi?id=185712
2744         <rdar://problem/40320916>
2745
2746         Reviewed by Brent Fulgham.
2747
2748         Have NavigationAction store all the relevant details callers need to know about the document
2749         that initiated the navigation in an independent data structure, called NavigationAction::Requester,
2750         as opposed to holding a RefPtr to the document itself. The benefit of this approach is that it
2751         is a step towards ensuring that NavigationAction does not keep the document alive after navigating
2752         to a new document given that DocumentLoader stores the NavigationAction for the last navigation.
2753
2754         * loader/NavigationAction.cpp:
2755         (WebCore::NavigationAction::Requester::Requester): Track all relevant details of the document that
2756         requested this navigation that are needed to support WebKit API/SPI. We hold the SecurityOrigin in
2757         a RefPtr to avoid the need to explicitly define a copy constructor and copy-assignment constructor
2758         because Requester needs to be copyable as NavigationAction, which owns a Requester, is copyable.
2759         (WebCore::shouldTreatAsSameOriginNavigation): Fix some style nits.
2760         (WebCore::NavigationAction::NavigationAction): Instantiate a Requester from the specified document.
2761         * loader/NavigationAction.h:
2762         (WebCore::NavigationAction::Requester::url const): Added.
2763         (WebCore::NavigationAction::Requester::securityOrigin const): Added.
2764         (WebCore::NavigationAction::Requester::pageID const): Added.
2765         (WebCore::NavigationAction::Requester::frameID const): Added.
2766         (WebCore::NavigationAction::requester const): Returns details about the document that requested
2767         this navigation, if applicable.
2768         (WebCore::NavigationAction::isEmpty const): Update criterion for being empty to consider the
2769         requester.
2770         (WebCore::NavigationAction::setOpener): Extracted out the datatype of the parameter into a
2771         type alias to avoid duplication and updated this code to use the alias.
2772         (WebCore::NavigationAction::opener const): Ditto.
2773         (WebCore::NavigationAction::sourceDocument const): Deleted.
2774
2775 2018-05-25  Jeremy Jones  <jeremyj@apple.com>
2776
2777         Fullscreen element can be clipped by ancestor.
2778         https://bugs.webkit.org/show_bug.cgi?id=185980
2779         rdar://problem/40320006
2780
2781         Reviewed by Jer Noble.
2782
2783         Adds style to fullscreen css to prevent the fullscreen element from being clipped by an ancestor element.
2784
2785         * css/fullscreen.css:
2786         (:-webkit-full-screen-ancestor:not(iframe)):
2787
2788 2018-05-25  Jeremy Jones  <jeremyj@apple.com>
2789
2790         Use correct AVKit delegate for picture in picture failure.
2791         https://bugs.webkit.org/show_bug.cgi?id=185981
2792         rdar://problem/40549652
2793
2794         Reviewed by Eric Carlson.
2795
2796         No new tests since we don't have a way to simulate picture-in-picture failure.
2797
2798         Use the new name for this delegate callback.
2799
2800         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2801         (-[WebAVPlayerViewControllerDelegate playerViewController:failedToStartPictureInPictureWithError:]):
2802         (-[WebAVPlayerViewControllerDelegate playerViewControllerFailedToStartPictureInPicture:withError:]): Deleted.
2803
2804 2018-05-25  Zalan Bujtas  <zalan@apple.com>
2805
2806         iBooks: text can disappear/flash during finger drag highlight
2807         https://bugs.webkit.org/show_bug.cgi?id=185993
2808         <rdar://problem/34026943>
2809
2810         Reviewed by Simon Fraser.
2811
2812         Reuse existing tiles when override rect is fully covered by the active grid.
2813         Also, recover dropped tiles if override rect forces us to create new ones. 
2814
2815         Unable to create a reproducible test case.
2816
2817         * platform/ios/LegacyTileCache.h:
2818         * platform/ios/LegacyTileCache.mm:
2819         (WebCore::LegacyTileCache::setOverrideVisibleRect):
2820         * platform/ios/LegacyTileLayer.mm:
2821         (-[LegacyTileHostLayer renderInContext:]):
2822
2823 2018-05-25  Eric Carlson  <eric.carlson@apple.com>
2824
2825         Encode ISOWebVTTCue "strings" when logging
2826         https://bugs.webkit.org/show_bug.cgi?id=185991
2827         <rdar://problem/40563902>
2828
2829         Reviewed by Jer Noble.
2830
2831         * platform/graphics/iso/ISOVTTCue.cpp:
2832         (WebCore::ISOWebVTTCue::toJSONString const): Use encodeWithURLEscapeSequences for all Strings
2833         taken from ISO boxes.
2834
2835 2018-05-25  Alex Christensen  <achristensen@webkit.org>
2836
2837         URL::host should return a StringView to reduce allocations
2838         https://bugs.webkit.org/show_bug.cgi?id=185986
2839
2840         Reviewed by Geoff Garen.
2841
2842         No change in behaviour.  Just fewer allocations.
2843
2844         * Modules/plugins/YouTubePluginReplacement.cpp:
2845         (WebCore::isYouTubeURL):
2846         (WebCore::processAndCreateYouTubeURL):
2847         * Modules/websockets/WebSocketHandshake.cpp:
2848         (WebCore::hostName):
2849         (WebCore::WebSocketHandshake::host const):
2850         * contentextensions/ContentExtension.cpp:
2851         (WebCore::ContentExtensions::ContentExtension::populateConditionCacheIfNeeded):
2852         * html/HTMLAnchorElement.cpp:
2853         (WebCore::HTMLAnchorElement::parseAttribute):
2854         * html/HTMLMediaElement.cpp:
2855         (WebCore::HTMLMediaElement::mediaSessionTitle const):
2856         (WebCore::needsSeekingSupportQuirk):
2857         * html/HTMLPlugInImageElement.cpp:
2858         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
2859         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
2860         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
2861         * html/ImageDocument.cpp:
2862         (WebCore::ImageDocument::finishedParsing):
2863         * html/URLUtils.h:
2864         (WebCore::URLUtils<T>::hostname const):
2865         * loader/FrameLoader.cpp:
2866         (WebCore::FrameLoader::setFirstPartyForCookies):
2867         * loader/LinkLoader.cpp:
2868         (WebCore::LinkLoader::loadLink):
2869         * loader/ResourceLoadStatistics.cpp:
2870         (WebCore::ResourceLoadStatistics::primaryDomain):
2871         * loader/mac/LoaderNSURLExtras.mm:
2872         (suggestedFilenameWithMIMEType):
2873         * page/Chrome.cpp:
2874         (WebCore::Chrome::mouseDidMoveOverElement):
2875         * page/Location.cpp:
2876         (WebCore::Location::hostname const):
2877         * page/Page.cpp:
2878         (WebCore::Page::mainFrameLoadStarted):
2879         * page/PerformanceMonitor.cpp:
2880         (WebCore::reportPageOverPostLoadResourceThreshold):
2881         * page/SecurityOrigin.cpp:
2882         (WebCore::isLoopbackIPAddress):
2883         (WebCore::shouldTreatAsPotentiallyTrustworthy):
2884         (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
2885         * page/SecurityOrigin.h:
2886         * page/SecurityOriginData.h:
2887         (WebCore::SecurityOriginData::fromURL):
2888         * page/UserContentURLPattern.cpp:
2889         (WebCore::UserContentURLPattern::matchesHost const):
2890         * page/csp/ContentSecurityPolicySource.cpp:
2891         (WebCore::ContentSecurityPolicySource::hostMatches const):
2892         * platform/PublicSuffix.h:
2893         * platform/URL.cpp:
2894         (WebCore::URL::host const):
2895         (WebCore::URL::hostAndPort const):
2896         (WebCore::URL::isMatchingDomain const):
2897         * platform/URL.h:
2898         * platform/mac/SSLKeyGeneratorMac.mm:
2899         (WebCore::signedPublicKeyAndChallengeString):
2900         * platform/network/ResourceRequestBase.h:
2901         (WebCore::registrableDomainsAreEqual):
2902         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2903         (WebCore::getPartitioningDomain):
2904         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2905         (WebCore::SocketStreamHandleImpl::createStreams):
2906         * workers/WorkerLocation.cpp:
2907         (WebCore::WorkerLocation::hostname const):
2908         * workers/service/server/SWServer.cpp:
2909         (WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):
2910
2911 2018-05-24  Dean Jackson  <dino@apple.com>
2912
2913         Need to provide a way to feature detect support for system preview
2914         https://bugs.webkit.org/show_bug.cgi?id=185970
2915         <rdar://problem/40538321>
2916
2917         Reviewed by Sam Weinig.
2918
2919         Update the supports function in the DOMTokenList that HTMLAnchorElement
2920         produces for relList to return true for the system preview token.
2921
2922         Tested internally.
2923
2924         * html/HTMLAnchorElement.cpp:
2925         (WebCore::HTMLAnchorElement::relList const):
2926
2927 2018-05-25  Chris Dumez  <cdumez@apple.com>
2928
2929         Minor ApplicationCacheStorage clean up
2930         https://bugs.webkit.org/show_bug.cgi?id=185984
2931
2932         Reviewed by Youenn Fablet.
2933
2934         * loader/appcache/ApplicationCacheStorage.cpp:
2935         (WebCore::ApplicationCacheStorage::getManifestURLs):
2936         (WebCore::ApplicationCacheStorage::deleteCacheGroup):
2937         (WebCore::ApplicationCacheStorage::originsWithCache):
2938         (WebCore::ApplicationCacheStorage::deleteAllCaches):
2939         (WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
2940         (WebCore::ApplicationCacheStorage::ApplicationCacheStorage):
2941         (WebCore::ApplicationCacheStorage::cacheDirectory const): Deleted.
2942         (WebCore::ApplicationCacheStorage::cacheGroupSize): Deleted.
2943         (WebCore::ApplicationCacheStorage::getOriginsWithCache): Deleted.
2944         (WebCore::ApplicationCacheStorage::create): Deleted.
2945         * loader/appcache/ApplicationCacheStorage.h:
2946         (WebCore::ApplicationCacheStorage::create):
2947
2948 2018-05-25  Sihui Liu  <sihui_liu@apple.com>
2949
2950         [WKHTTPCookieStore getAllCookies] returns inconsistent creation time
2951         https://bugs.webkit.org/show_bug.cgi?id=185041
2952         <rdar://problem/34684214>
2953
2954         Reviewed by Geoffrey Garen.
2955
2956         Set creationtime property when creating Cookie object to keep consistency after conversion.
2957
2958         New API test: WebKit.WKHTTPCookieStoreCreationTime.
2959
2960         * platform/network/cocoa/CookieCocoa.mm:
2961         (WebCore::Cookie::operator NSHTTPCookie * const):
2962
2963 2018-05-25  Zalan Bujtas  <zalan@apple.com>
2964
2965         [LFC] Implement border and padding computation
2966         https://bugs.webkit.org/show_bug.cgi?id=185972
2967
2968         Reviewed by Antti Koivisto.
2969
2970         This patch also removes redundant Display::Box methods and adds a lightweight Edge struct.
2971         (Since padding is optional, if during layout we mistakenly try to access paddingTop/Left/Bottom/Right, Display::Box will assert!)
2972
2973         * layout/FormattingContext.cpp:
2974         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
2975         * layout/FormattingContext.h:
2976         * layout/FormattingContextGeometry.cpp:
2977         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
2978         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
2979         * layout/blockformatting/BlockFormattingContext.cpp:
2980         (WebCore::Layout::BlockFormattingContext::layout const):
2981         * layout/displaytree/DisplayBox.cpp:
2982         (WebCore::Display::Box::marginBox const):
2983         (WebCore::Display::Box::paddingBox const):
2984         (WebCore::Display::Box::contentBox const):
2985         * layout/displaytree/DisplayBox.h:
2986         (WebCore::Display::Box::Edges::Edges):
2987         (WebCore::Display::Box::setHasValidPosition):
2988         (WebCore::Display::Box::setWidth):
2989         (WebCore::Display::Box::setHeight):
2990         (WebCore::Display::Box::setMargin):
2991         (WebCore::Display::Box::setBorder):
2992         (WebCore::Display::Box::setPadding):
2993         (WebCore::Display::Box::marginTop const):
2994         (WebCore::Display::Box::marginLeft const):
2995         (WebCore::Display::Box::marginBottom const):
2996         (WebCore::Display::Box::marginRight const):
2997         (WebCore::Display::Box::paddingTop const):
2998         (WebCore::Display::Box::paddingLeft const):
2999         (WebCore::Display::Box::paddingBottom const):
3000         (WebCore::Display::Box::paddingRight const):
3001         (WebCore::Display::Box::borderTop const):
3002         (WebCore::Display::Box::borderLeft const):
3003         (WebCore::Display::Box::borderBottom const):
3004         (WebCore::Display::Box::borderRight const):
3005         (WebCore::Display::Box::invalidateSize): Deleted.
3006         (WebCore::Display::Box::setHasValidSize): Deleted.
3007         (WebCore::Display::Box::setHasValidGeometry): Deleted.
3008         (WebCore::Display::Box::setRect): Deleted.
3009         (WebCore::Display::Box::setSize): Deleted.
3010         * layout/layouttree/LayoutBox.cpp:
3011         (WebCore::Layout::Box::isPaddingEnabled const):
3012         * layout/layouttree/LayoutBox.h:
3013
3014 2018-05-25  David Kilzer  <ddkilzer@apple.com>
3015
3016         Fix issues with -dealloc methods found by clang static analyzer
3017         <https://webkit.org/b/185887>
3018
3019         Reviewed by Joseph Pecoraro.
3020
3021         * platform/ios/WebAVPlayerController.mm:
3022         (-[WebAVPlayerController dealloc]): Release `_minTiming` and
3023         `_maxTiming` to fix leaks.
3024         * platform/ios/WebBackgroundTaskController.mm:
3025         (-[WebBackgroundTaskController dealloc]): Release
3026         `_backgroundTaskStartBlock` and `_backgroundTaskEndBlock` to fix
3027         leaks.
3028         * platform/ios/WebItemProviderPasteboard.mm:
3029         (-[WebItemProviderRegistrationInfoList dealloc]): Release
3030         `_teamData` to fix leak.
3031
3032 2018-05-25  Antoine Quint  <graouts@apple.com>
3033
3034         [Web Animations] WebAnimation objects never get destroyed
3035         https://bugs.webkit.org/show_bug.cgi?id=185917
3036         <rdar://problem/39539371>
3037
3038         Reviewed by Dean Jackson and Antti Koivisto.
3039
3040         The AnimationTimeline class keeps references to WebAnimation objects organized in various ways. First, there
3041         are three main maps across which all animations are stored, one for non-subclass WebAnimation objects
3042         (m_elementToAnimationsMap), one for CSSSAnimation objects (m_elementToCSSAnimationsMap) and one for CSSTranstion
3043         objects (m_elementToCSSTransitionsMap). On top of that, we also keep a map to access CSSAnimation objects for
3044         a given element by CSS animation name (m_elementToCSSAnimationByName) and another map to access CSSTransition 
3045         objects for a given element by CSS property (m_elementToCSSTransitionByCSSPropertyID).
3046
3047         None of the RefPtr<WebAnimation> stored in these maps would get cleared when the document would get torn down,
3048         which would also prevent the AnimationTimeline (and its DocumentTimeline subclass) from being destroyed.
3049
3050         We now ensure that element and document tear-down correctly removes animations and clears those maps, which
3051         in turn allows the DocumentTimeline to be destroyed, fixing the significant memory leak introduced by Web Animations
3052         so far.
3053
3054         Finally, we change the collection type for those maps to be ListHashRef instead of Vector to guarantee we only
3055         add an animation once per collection due to changes in how setEffect() and setTimeline() operate.
3056
3057         Test: animations/leak-document-with-css-animation.html
3058
3059         * animation/AnimationTimeline.cpp:
3060         (WebCore::AnimationTimeline::~AnimationTimeline): There is no need to clear those tables as they'll need to be empty
3061         for the AnimationTimeline to even be destroyed.
3062         (WebCore::AnimationTimeline::relevantMapForAnimation): Change to use ListHashRef instead of Vector.
3063         (WebCore::AnimationTimeline::animationWasAddedToElement): Change to use ListHashRef instead of Vector.
3064         (WebCore::AnimationTimeline::animationWasRemovedFromElement): When an animation is removed from an element, ensure that
3065         references to this animation stored in the m_elementToCSSAnimationByName and m_elementToCSSTransitionByCSSPropertyID maps
3066         are cleared.
3067         (WebCore::AnimationTimeline::animationsForElement const): Change to use ListHashRef instead of Vector.
3068         (WebCore::AnimationTimeline::removeAnimationsForElement): Instead of just calling cancel() on all known declarative animations
3069         (this method used to be called cancelDeclarativeAnimationsForElement()), we now set the effect of known animations, declarative
3070         or not, for the provided element which will in turn call animationWasRemovedFromElement() and remove the animation from all
3071         maps that might keep a reference to it.
3072         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Replace call to removeDeclarativeAnimation() with a simple call
3073         to removeAnimation() which will remove references for this animation from the relevant maps.
3074         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Ditto.
3075         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement): Deleted.
3076         (WebCore::AnimationTimeline::removeDeclarativeAnimation): Deleted.
3077         * animation/AnimationTimeline.h:
3078         (WebCore::AnimationTimeline::elementToAnimationsMap): Change to use ListHashRef instead of Vector.
3079         (WebCore::AnimationTimeline::elementToCSSAnimationsMap): Change to use ListHashRef instead of Vector.
3080         (WebCore::AnimationTimeline::elementToCSSTransitionsMap): Change to use ListHashRef instead of Vector.
3081         * animation/WebAnimation.cpp:
3082         (WebCore::WebAnimation::setEffect): In the case of a declarative animation, we don't want to remove the animation from the relevant
3083         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
3084         timeline-to-animation relationship.
3085         (WebCore::WebAnimation::setEffectInternal): Factor parts of setEffect() out into a new method that can be called from
3086         AnimationTimeline::removeAnimationsForElement() to reset the m_effect member and correctly call animationWasRemovedFromElement()
3087         without all the Web Animations machinery of setEffect(), which is a public API that has unwanted side effects (such as rejecting
3088         promises).
3089         (WebCore::WebAnimation::setTimeline): In the case of a declarative animation, we don't want to remove the animation from the
3090         relevant maps because, while the timeline was set via the API, the element still has a transition or animation set up and we must
3091         not break the relationship.
3092         * animation/DocumentTimeline.cpp:
3093         (WebCore::DocumentTimeline::~DocumentTimeline):
3094         (WebCore::DocumentTimeline::detachFromDocument): Close the GenericTaskQueues when detaching from the document as it's too late to
3095         perform this work in the destructor. We also cancel the schedule timer which we had forgotten to do before.
3096         * animation/WebAnimation.h:
3097         * dom/Document.cpp:
3098         (WebCore::Document::prepareForDestruction):
3099         * dom/Element.cpp:
3100         (WebCore::Element::removedFromAncestor):
3101         * dom/PseudoElement.cpp:
3102         (WebCore::PseudoElement::clearHostElement):
3103         * rendering/updating/RenderTreeUpdater.cpp:
3104         (WebCore::RenderTreeUpdater::tearDownRenderers):
3105
3106 2018-05-24  Chris Dumez  <cdumez@apple.com>
3107
3108         Avoid doing unnecessary work in Document::shouldEnforceContentDispositionAttachmentSandbox() when setting is disabled
3109         https://bugs.webkit.org/show_bug.cgi?id=185964
3110
3111         Reviewed by Geoffrey Garen.
3112
3113         * dom/Document.cpp:
3114         (WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox const):
3115
3116 2018-05-24  Chris Dumez  <cdumez@apple.com>
3117
3118         [iOS] Avoid dlopening QuickLooks in the common case where the main resource is HTML or plain text
3119         https://bugs.webkit.org/show_bug.cgi?id=185966
3120
3121         Reviewed by Geoffrey Garen.
3122
3123         Avoid dlopening QuickLooks in the common case where the main resource is HTML or plain text
3124         for performance reasons.
3125
3126         * loader/ios/PreviewLoader.mm:
3127         (WebCore::PreviewLoader::shouldCreateForMIMEType):
3128
3129 2018-05-24  Sam Weinig  <sam@webkit.org>
3130
3131         Modernize RenderStyleConstants.h - Part 2
3132         https://bugs.webkit.org/show_bug.cgi?id=185901
3133
3134         Reviewed by Simon Fraser.
3135
3136         Modernized the second set of enums in RenderStyleConstants.h by:
3137             - Converting them to enum classes
3138             - Renaming them to remove unnecessary prefix 'E's
3139             - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
3140             - Renaming to match modern conventions (e.g BNONE -> None)
3141             - Reformatting them so that each value is on its own line.
3142
3143         Modernizes the following enums:
3144             PseudoId
3145             ListStyleType (renamed from EListStyleType)
3146             BorderFit (renamed from EBorderFit)
3147             AnimationFillMode (renamed from EAnimationFillMode)
3148             AnimationPlayState (renamed from EAnimPlayState)
3149             WhiteSpace (renamed from EWhiteSpace)
3150             TextAlignMode (renamed from ETextAlign)
3151             TextTransform (renamed from ETextTransform)
3152             TextDecorationStyle
3153             TextAlignLast
3154             TextJustify
3155             TextZoom
3156             BreakBetween
3157             BreakInside
3158             EmptyCell (renamed from EEmptyCell)
3159             CaptionSide (renamed from ECaptionSide)
3160             ListStylePosition (renamed from EListStylePosition)
3161             Visibility (renamed from EVisibility)
3162             CursorType (renamed from ECursor)
3163             CursorVisibility
3164             DisplayType (renamed from EDisplay)
3165             InsideLink (renamed from EInsideLink)
3166             PointerEvents (renamed from EPointerEvents)
3167             Hyphens
3168             TextEmphasisFill
3169             TextEmphasisMark
3170             ImageResolutionSource
3171             ImageResolutionSnap
3172             Order
3173             ColumnAxis
3174             ColumnProgression
3175             LineSnap
3176             LineAlign
3177             RubyPosition
3178             AutoRepeatType
3179             CSSBoxType
3180
3181         * accessibility/AXObjectCache.cpp:
3182         (WebCore::AXObjectCache::isNodeVisible const):
3183         * accessibility/AccessibilityList.cpp:
3184         (WebCore::AccessibilityList::determineAccessibilityRole):
3185         * accessibility/AccessibilityMediaControls.cpp:
3186         (WebCore::AccessibilityMediaControl::computeAccessibilityIsIgnored const):
3187         (WebCore::AccessibilityMediaTimeDisplay::computeAccessibilityIsIgnored const):
3188         * accessibility/AccessibilityObject.cpp:
3189         (WebCore::AccessibilityObject::isDOMHidden const):
3190         * accessibility/AccessibilityRenderObject.cpp:
3191         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
3192         (WebCore::AccessibilityRenderObject::isUnvisited const):
3193         (WebCore::AccessibilityRenderObject::isVisited const):
3194         (WebCore::AccessibilityRenderObject::setValue):
3195         * accessibility/AccessibilityTable.cpp:
3196         (WebCore::AccessibilityTable::isDataTable const):
3197         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3198         (getAttributeSetForAccessibilityObject):
3199         * animation/AnimationTimeline.cpp:
3200         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
3201         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
3202         * animation/CSSAnimation.cpp:
3203         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
3204         * animation/DeclarativeAnimation.cpp:
3205         (WebCore::DeclarativeAnimation::initialize):
3206         * animation/KeyframeEffectReadOnly.cpp:
3207         (WebCore::KeyframeEffectReadOnly::backingAnimationForCompositedRenderer const):
3208         * css/CSSComputedStyleDeclaration.cpp:
3209         (WebCore::renderTextDecorationStyleFlagsToCSSValue):
3210         (WebCore::convertToPageBreak):
3211         (WebCore::convertToColumnBreak):
3212         (WebCore::ComputedStyleExtractor::styledElement const):
3213         (WebCore::ComputedStyleExtractor::styledRenderer const):
3214         (WebCore::computeRenderStyleForProperty):
3215         (WebCore::shapePropertyValue):
3216         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3217         * css/CSSComputedStyleDeclaration.h:
3218         * css/CSSPrimitiveValueMappings.h:
3219         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3220         (WebCore::CSSPrimitiveValue::operator CaptionSide const):
3221         (WebCore::CSSPrimitiveValue::operator CursorType const):
3222         (WebCore::CSSPrimitiveValue::operator CursorVisibility const):
3223         (WebCore::CSSPrimitiveValue::operator DisplayType const):
3224         (WebCore::CSSPrimitiveValue::operator EmptyCell const):
3225         (WebCore::CSSPrimitiveValue::operator ListStylePosition const):
3226         (WebCore::CSSPrimitiveValue::operator ListStyleType const):
3227         (WebCore::CSSPrimitiveValue::operator BreakBetween const):
3228         (WebCore::CSSPrimitiveValue::operator BreakInside const):
3229         (WebCore::CSSPrimitiveValue::operator TextAlignMode const):
3230         (WebCore::CSSPrimitiveValue::operator TextAlignLast const):
3231         (WebCore::CSSPrimitiveValue::operator TextJustify const):
3232         (WebCore::CSSPrimitiveValue::operator TextDecorationStyle const):
3233         (WebCore::CSSPrimitiveValue::operator TextTransform const):
3234         (WebCore::CSSPrimitiveValue::operator Visibility const):
3235         (WebCore::CSSPrimitiveValue::operator WhiteSpace const):
3236         (WebCore::CSSPrimitiveValue::operator RubyPosition const):
3237         (WebCore::CSSPrimitiveValue::operator TextEmphasisFill const):
3238         (WebCore::CSSPrimitiveValue::operator TextEmphasisMark const):
3239         (WebCore::CSSPrimitiveValue::operator PointerEvents const):
3240         (WebCore::CSSPrimitiveValue::operator Hyphens const):
3241         (WebCore::CSSPrimitiveValue::operator LineSnap const):
3242         (WebCore::CSSPrimitiveValue::operator LineAlign const):
3243         (WebCore::CSSPrimitiveValue::operator Order const):
3244         (WebCore::CSSPrimitiveValue::operator BorderFit const):
3245         (WebCore::CSSPrimitiveValue::operator ColumnAxis const):
3246         (WebCore::CSSPrimitiveValue::operator ColumnProgression const):
3247         (WebCore::CSSPrimitiveValue::operator CSSBoxType const):
3248         (WebCore::CSSPrimitiveValue::operator TextZoom const):
3249         (WebCore::CSSPrimitiveValue::operator ECaptionSide const): Deleted.
3250         (WebCore::CSSPrimitiveValue::operator ECursor const): Deleted.
3251         (WebCore::CSSPrimitiveValue::operator EDisplay const): Deleted.
3252         (WebCore::CSSPrimitiveValue::operator EEmptyCell const): Deleted.
3253         (WebCore::CSSPrimitiveValue::operator EListStylePosition const): Deleted.
3254         (WebCore::CSSPrimitiveValue::operator EListStyleType const): Deleted.
3255         (WebCore::CSSPrimitiveValue::operator ETextAlign const): Deleted.
3256         (WebCore::CSSPrimitiveValue::operator ETextTransform const): Deleted.
3257         (WebCore::CSSPrimitiveValue::operator EVisibility const): Deleted.
3258         (WebCore::CSSPrimitiveValue::operator EWhiteSpace const): Deleted.
3259         (WebCore::CSSPrimitiveValue::operator EPointerEvents const): Deleted.
3260         (WebCore::CSSPrimitiveValue::operator EBorderFit const): Deleted.
3261         * css/CSSSelector.cpp:
3262         (WebCore::CSSSelector::pseudoId):
3263         * css/CSSToStyleMap.cpp:
3264         (WebCore::CSSToStyleMap::mapAnimationFillMode):
3265         (WebCore::CSSToStyleMap::mapAnimationPlayState):
3266         * css/CSSValueKeywords.in:
3267         * css/ElementRuleCollector.cpp:
3268         (WebCore::ElementRuleCollector::collectMatchingRules):
3269         (WebCore::ElementRuleCollector::ruleMatches):
3270         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
3271         * css/ElementRuleCollector.h:
3272         * css/SelectorChecker.cpp:
3273         (WebCore::SelectorChecker::match const):
3274         (WebCore::SelectorChecker::matchHostPseudoClass const):
3275         (WebCore::hasScrollbarPseudoElement):
3276         (WebCore::SelectorChecker::matchRecursively const):
3277         * css/SelectorChecker.h:
3278         * css/StyleBuilderConverter.h:
3279         (WebCore::StyleBuilderConverter::convertTextAlign):
3280         (WebCore::StyleBuilderConverter::convertClipPath):
3281         (WebCore::StyleBuilderConverter::convertShapeValue):
3282         (WebCore::StyleBuilderConverter::createGridTrackList):
3283         (WebCore::StyleBuilderConverter::csstoLengthConversionDataWithTextZoomFactor):
3284         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
3285         (WebCore::StyleBuilderConverter::convertPageBreakInside):
3286         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
3287         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
3288         * css/StyleBuilderCustom.h:
3289         (WebCore::StyleBuilderCustom::applyValueImageResolution):
3290         (WebCore::computeBaseSpecifiedFontSize):
3291         (WebCore::StyleBuilderCustom::applyValueWebkitTextZoom):
3292         (WebCore::StyleBuilderCustom::isValidDisplayValue):
3293         (WebCore::StyleBuilderCustom::applyInheritDisplay):
3294         (WebCore::StyleBuilderCustom::applyValueDisplay):
3295         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
3296         (WebCore::StyleBuilderCustom::applyValueCursor):
3297         (WebCore::StyleBuilderCustom::applyValueContent):
3298         (WebCore::StyleBuilderCustom::determineRubyTextSizeMultiplier):
3299         (WebCore::StyleBuilderCustom::applyValueAlt):
3300         * css/StyleResolver.cpp:
3301         (WebCore::StyleResolver::styleForElement):
3302         (WebCore::equivalentBlockDisplay):
3303         (WebCore::doesNotInheritTextDecoration):
3304         (WebCore::StyleResolver::adjustStyleForInterCharacterRuby):
3305         (WebCore::adjustDisplayContentsStyle):
3306         (WebCore::StyleResolver::adjustSVGElementStyle):
3307         (WebCore::StyleResolver::adjustRenderStyle):
3308         (WebCore::StyleResolver::styleRulesForElement):
3309         (WebCore::isCacheableInMatchedPropertiesCache):
3310         (WebCore::StyleResolver::applyMatchedProperties):
3311         (WebCore::StyleResolver::CascadedProperties::Property::apply):
3312         * css/StyleResolver.h:
3313         (WebCore::StyleResolver::State::elementLinkState const):
3314         * cssjit/SelectorCompiler.cpp:
3315         (WebCore::SelectorCompiler::constructFragmentsInternal):
3316         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
3317         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateMarkPseudoStyleForPseudoElement):
3318         * dom/Document.cpp:
3319         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
3320         (WebCore::Document::isPageBoxVisible):
3321         (WebCore::Document::setVisuallyOrdered):
3322         * dom/Document.h:
3323         * dom/Element.cpp:
3324         (WebCore::Element::isFocusable const):
3325         (WebCore::Element::hasDisplayContents const):
3326         (WebCore::Element::storeDisplayContentsStyle):
3327         (WebCore::Element::rendererIsNeeded):
3328         (WebCore::beforeOrAfterPseudoElement):
3329         (WebCore::Element::computedStyle):
3330         * dom/Element.h:
3331         * dom/Node.cpp:
3332         (WebCore::computeEditabilityFromComputedStyle):
3333         * dom/Node.h:
3334         (WebCore::Node::isPseudoElement const):
3335         (WebCore::Node::isBeforePseudoElement const):
3336         (WebCore::Node::isAfterPseudoElement const):
3337         (WebCore::Node::pseudoId const):
3338         (WebCore::Node::customPseudoId const):
3339         * dom/Position.cpp:
3340         (WebCore::Position::upstream const):
3341         (WebCore::Position::downstream const):
3342         (WebCore::Position::isCandidate const):
3343         (WebCore::Position::rendersInDifferentPosition const):
3344         * dom/PositionIterator.cpp:
3345         (WebCore::PositionIterator::isCandidate const):
3346         * dom/PseudoElement.cpp:
3347         (WebCore::PseudoElement::pseudoElementNameForEvents):
3348         (WebCore::PseudoElement::PseudoElement):
3349         * dom/VisitedLinkState.cpp:
3350         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
3351         * dom/VisitedLinkState.h:
3352         (WebCore::VisitedLinkState::determineLinkState):
3353         * editing/Editing.cpp:
3354         (WebCore::isSpecialHTMLElement):
3355         (WebCore::isNodeRendered):
3356         * editing/TextIterator.cpp:
3357         (WebCore::hasVisibleTextNode):
3358         (WebCore::TextIterator::handleTextNode):
3359         (WebCore::TextIterator::handleTextBox):
3360         (WebCore::TextIterator::handleTextNodeFirstLetter):
3361         (WebCore::TextIterator::handleReplacedElement):
3362         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
3363         (WebCore::SimplifiedBackwardsTextIterator::advance):
3364         * editing/VisibleUnits.cpp:
3365         (WebCore::findStartOfParagraph):
3366         (WebCore::findEndOfParagraph):
3367         * editing/ios/EditorIOS.mm:
3368         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
3369         * html/HTMLAreaElement.cpp:
3370         (WebCore::HTMLAreaElement::isFocusable const):
3371         * html/HTMLFormElement.cpp:
3372         (WebCore::