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