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