3771800f7226fcba1d359de59a318328a3ded16f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-08-16  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC] Add showLayoutTree() that does not require LayoutContext.
4         https://bugs.webkit.org/show_bug.cgi?id=188631
5
6         Reviewed by Antti Koivisto.
7
8         * layout/layouttree/LayoutBox.cpp:
9         (WebCore::Layout::Box::formattingContextRoot const):
10         (WebCore::Layout::Box::initialContainingBlock const):
11         * layout/layouttree/LayoutBox.h:
12         * layout/layouttree/LayoutTreeBuilder.cpp:
13         (WebCore::Layout::outputLayoutTree):
14         (WebCore::Layout::showLayoutTree):
15         (WebCore::Layout::TreeBuilder::showLayoutTree): Deleted.
16         * layout/layouttree/LayoutTreeBuilder.h:
17
18 2018-08-16  Zalan Bujtas  <zalan@apple.com>
19
20         [LFC] Tree builder should construct block and inline containers based on the display type.
21         https://bugs.webkit.org/show_bug.cgi?id=188632
22
23         Reviewed by Antti Koivisto.
24
25         Inline elements can also construct RenderBlock renderers (inline-bloc etc), so use the display type instead when deciding what type of container to construct.   
26
27         * layout/layouttree/LayoutTreeBuilder.cpp:
28         (WebCore::Layout::TreeBuilder::createSubTree):
29
30 2018-08-16  Zalan Bujtas  <zalan@apple.com>
31
32         [LFC] Bail out of subtree verification when trees are out of sync.
33         https://bugs.webkit.org/show_bug.cgi?id=188633
34
35         Reviewed by Antti Koivisto.
36
37         There's no point of trying to match geometry when subtrees are out of sync.
38         They get out of sync when the render tree has unsupported boxes (see LayoutTreeBuilder).
39
40         * layout/Verification.cpp:
41         (WebCore::Layout::verifyAndOutputSubtree):
42
43 2018-08-16  Antti Koivisto  <antti@apple.com>
44
45         Use OptionSet for ActivityState::Flags
46         https://bugs.webkit.org/show_bug.cgi?id=188554
47
48         Reviewed by Brent Fulgham.
49
50         More typesafe flags.
51
52         * Modules/geolocation/GeolocationController.cpp:
53         (WebCore::GeolocationController::activityStateDidChange):
54         * Modules/geolocation/GeolocationController.h:
55         * html/canvas/WebGLRenderingContextBase.cpp:
56         (WebCore::WebGLRenderingContextBase::activityStateDidChange):
57         * html/canvas/WebGLRenderingContextBase.h:
58         * page/ActivityState.cpp:
59         (WebCore::operator<<):
60         (WebCore::activityStateFlagsToString): Deleted.
61         * page/ActivityState.h:
62         (WebCore::ActivityState::allFlags):
63         * page/ActivityStateChangeObserver.h:
64         * page/FocusController.cpp:
65         (WebCore::FocusController::FocusController):
66         (WebCore::FocusController::setFocused):
67         (WebCore::FocusController::setActivityState):
68         (WebCore::FocusController::setActive):
69         * page/FocusController.h:
70         (WebCore::FocusController::isActive const):
71         (WebCore::FocusController::isFocused const):
72         (WebCore::FocusController::contentIsVisible const):
73         * page/Page.cpp:
74         (WebCore::pageInitialActivityState):
75         (WebCore::Page::Page):
76         (WebCore::Page::setIsInWindow):
77         (WebCore::Page::updateTimerThrottlingState):
78         (WebCore::Page::setActivityState):
79         (WebCore::Page::isVisibleAndActive const):
80         (WebCore::Page::isWindowActive const):
81         (WebCore::Page::setIsVisible):
82         * page/Page.h:
83         (WebCore::Page::activityState const):
84         (WebCore::Page::isVisible const):
85         (WebCore::Page::isInWindow const):
86         * page/PerformanceMonitor.cpp:
87         (WebCore::activityStateForCPUSampling):
88         (WebCore::PerformanceMonitor::activityStateChanged):
89         * page/PerformanceMonitor.h:
90         * platform/text/cocoa: Added.
91
92 2018-08-15  Ansh Shukla  <ansh_shukla@apple.com>
93
94         NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
95         https://bugs.webkit.org/show_bug.cgi?id=186870
96         <rdar://problem/41314410>
97
98         Reviewed by Alex Christensen.
99
100         Add the ProtectionSpaceAuthenticationSchemeOAuth type.
101
102         * platform/network/ProtectionSpaceBase.cpp:
103         (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
104         expects a token in return.
105         * platform/network/ProtectionSpaceBase.h:
106         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
107         (WebCore::scheme):
108         (WebCore::ProtectionSpace::nsSpace const):
109
110 2018-08-15  Ben Richards  <benton_richards@apple.com>
111
112         We should cache the compiled sandbox profile in a data vault
113         https://bugs.webkit.org/show_bug.cgi?id=184991
114
115         Reviewed by Ryosuke Niwa.
116
117         Added functionality to FileHandle so that it can lock a file while open.
118         Added a function to FileSystem to delete non empty directories.
119
120         * platform/FileHandle.cpp:
121         (WebCore::FileHandle::FileHandle):
122         (WebCore::FileHandle::open):
123         (WebCore::FileHandle::close):
124         * platform/FileHandle.h:
125         * platform/FileSystem.h:
126         * platform/cocoa/FileSystemCocoa.mm:
127         (WebCore::FileSystem::deleteNonEmptyDirectory):
128
129 2018-08-15  Ryosuke Niwa  <rniwa@webkit.org>
130
131         Can't share an app on AppStore to WeChat due to a release assert
132         https://bugs.webkit.org/show_bug.cgi?id=188621
133         <rdar://problem/43343976>
134
135         Reviewed by Geoffrey Garen.
136
137         Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert
138         is getting hit by third party applications on iOS in UI process.
139
140         * platform/Timer.cpp:
141         (WebCore::shouldSuppressThreadSafetyCheck): Added a SDK check.
142
143 2018-08-15  Christopher Reid  <chris.reid@sony.com>
144
145         [Curl] Implement default cookie path handling correctly as outlined in RFC6265.
146         https://bugs.webkit.org/show_bug.cgi?id=188609
147
148         Reviewed by Alex Christensen.
149
150         Curl implementation of default cookie path was wrong so that some cookies cannot be accessible.
151         It should be generated as outlined in: https://tools.ietf.org/html/rfc6265#section-5.1.4
152
153         Tests: http/tests/cookies/http-get-cookie-set-in-js.html
154
155         * platform/network/curl/CookieJarDB.cpp:
156         (WebCore::CookieJarDB::setCookie):
157         * platform/network/curl/CookieUtil.cpp:
158         (WebCore::CookieUtil::defaultPathForURL):
159         * platform/network/curl/CookieUtil.h:
160
161 2018-08-15  Aditya Keerthi  <akeerthi@apple.com>
162
163         [Datalist] Add button to TextFieldInputs with a datalist
164         https://bugs.webkit.org/show_bug.cgi?id=187741
165
166         Reviewed by Tim Horton.
167
168         TextFieldInputs that have an associated datalist element should be drawn as
169         combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
170         is not height-resizable. Furthermore, the input should also be able to contain
171         additional elements, such as the stepper for type=number and the cancel button
172         for type=search. For these reasons, we draw a button at the end of the input,
173         mimicking appearance of a combo box.
174
175         The list-button -webkit-appearance value was added to display the new button.
176
177         Tests: fast/forms/datalist/datalist-searchinput-appearance.html
178                fast/forms/datalist/datalist-textinput-appearance.html
179
180         * Resources/ListButtonArrow.png: Added.
181         * Resources/ListButtonArrow@2x.png: Added.
182         * WebCore.xcodeproj/project.pbxproj:
183         * css/CSSPrimitiveValueMappings.h:
184         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
185         * css/CSSProperties.json:
186         * css/CSSValueKeywords.in:
187         * css/html.css:
188         (input::-webkit-list-button):
189         * html/HTMLInputElement.cpp:
190         (WebCore::HTMLInputElement::dataListButtonElement const):
191         * html/HTMLInputElement.h:
192         * html/InputType.h:
193         (WebCore::InputType::dataListButtonElement const):
194         * html/TextFieldInputType.cpp:
195         (WebCore::TextFieldInputType::needsContainer const):
196         (WebCore::TextFieldInputType::createShadowSubtree):
197         (WebCore::TextFieldInputType::destroyShadowSubtree):
198         (WebCore::TextFieldInputType::listAttributeTargetChanged):
199         (WebCore::TextFieldInputType::dataListButtonElement const):
200         (WebCore::TextFieldInputType::dataListButtonElementWasClicked):
201         (WebCore::TextFieldInputType::didCloseSuggestions):
202         * html/TextFieldInputType.h:
203         * html/shadow/DataListButtonElement.cpp: Added.
204         (WebCore::DataListButtonElement::create):
205         (WebCore::DataListButtonElement::DataListButtonElement):
206         (WebCore::DataListButtonElement::~DataListButtonElement):
207         (WebCore::DataListButtonElement::defaultEventHandler):
208         * html/shadow/DataListButtonElement.h: Added.
209         * platform/ThemeTypes.h:
210         * rendering/RenderTheme.cpp:
211         (WebCore::RenderTheme::adjustStyle):
212         (WebCore::RenderTheme::adjustListButtonStyle const):
213         * rendering/RenderTheme.h:
214         * rendering/RenderThemeMac.h:
215         * rendering/RenderThemeMac.mm:
216         (-[WebListButtonCell drawWithFrame:inView:]):
217         (WebCore::RenderThemeMac::paintListButtonForInput):
218         (WebCore::RenderThemeMac::adjustListButtonStyle const):
219         (WebCore::RenderThemeMac::paintTextField):
220         (WebCore::RenderThemeMac::paintSearchField):
221         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
222         (WebCore::RenderThemeMac::listButton const):
223
224 2018-08-15  Ryan Haddad  <ryanhaddad@apple.com>
225
226         Unreviewed, rolling out r234870.
227
228         The test introduced with this change is a flaky failure.
229
230         Reverted changeset:
231
232         "NSURLAuthenticationMethodOAuth challenges are surfaced to
233         clients in -didReceiveAuthenticationChallenge as
234         NSURLAuthenticationMethodDefault"
235         https://bugs.webkit.org/show_bug.cgi?id=186870
236         https://trac.webkit.org/changeset/234870
237
238 2018-08-14  Ryosuke Niwa  <rniwa@webkit.org>
239
240         connectedCallback is invoked by the HTML parser after child nodes had been inserted
241         https://bugs.webkit.org/show_bug.cgi?id=183931
242         <rdar://problem/38843548>
243
244         Reviewed by Alex Christensen.
245
246         Invoke the custom element reactions after constructing and inserting a custom element as specifed in step 3.3 of:
247         https://html.spec.whatwg.org/multipage/parsing.html#insert-a-foreign-element
248
249         The bug here was that HTMLConstructionSite::insertCustomElement uses attachLater so that even though the task
250         to insert the custom element was created, it didn't get executed until after CustomElementReactionStack in
251         HTMLDocumentParser::runScriptsForPausedTreeBuilder had been popped off of the stack.
252
253         Test: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html
254
255         * html/parser/HTMLConstructionSite.cpp:
256         (WebCore::HTMLConstructionSite::insertCustomElement): Fixed the bug by manually executing the scheduled tasks.
257         This will enqueue any custom element reactions while CustomElementReactionStack in runScriptsForPausedTreeBuilder
258         is still in the stack.
259
260 2018-08-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>
261
262         [Curl] Don't send Content-Type header for POST request when body is null.
263         https://bugs.webkit.org/show_bug.cgi?id=188588
264
265         Reviewed by Youenn Fablet.
266
267         The Content-Type header was sent by libcurl automatically. Suppress that behavior
268         when body is null.
269
270         Tests: http/tests/xmlhttprequest/methods.html
271
272         * platform/network/curl/CurlRequest.cpp:
273         (WebCore::CurlRequest::setupPOST):
274
275 2018-08-15  Alex Christensen  <achristensen@webkit.org>
276
277         Remove failing assertion introduced in r234873
278         https://bugs.webkit.org/show_bug.cgi?id=188581
279
280         * contentextensions/ContentExtensionCompiler.cpp:
281         (WebCore::ContentExtensions::compileRuleList):
282         The assertion is correct but failing because VectorTraits<String> is incorrect.
283         I'll re-add it and fix VectorTraits<String> in a separate patch.
284
285 2018-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>
286
287         [Attachment SPI] Remove attachment display mode options
288         https://bugs.webkit.org/show_bug.cgi?id=188596
289
290         Reviewed by Dan Bernstein.
291
292         Remove the ability to specify an "in-place" or "icon" representation for attachment elements, as well as logic
293         needed to allow an attachment element to render image or video elements in a shadow root. The requirements that
294         initially drove this effort are obviated by r227068, which allows Mail to intercept and provide a custom scheme
295         for images inserted into the document via rich editing operations.
296
297         Removed some existing API tests in _WKAttachmentTests that exercised this functionality.
298
299         * editing/Editor.cpp:
300         (WebCore::Editor::insertAttachmentFromFile):
301         * editing/cocoa/WebContentReaderCocoa.mm:
302         (WebCore::createFragmentForImageAttachment):
303         (WebCore::replaceRichContentWithAttachments):
304         * html/AttachmentTypes.h:
305         (WebCore::AttachmentDisplayOptions::encode const):
306         (WebCore::AttachmentDisplayOptions::decode):
307
308         Remove logic for encoding the attachment display mode. While this leaves AttachmentDisplayOptions completely
309         empty, I haven't removed AttachmentDisplayOptions as well in this patch, since it's not clear that we won't be
310         needing any mechanism for influencing the display of attachment elements inserted via native SPI.
311
312         (): Deleted.
313         * html/HTMLAttachmentElement.cpp:
314         (WebCore::HTMLAttachmentElement::createElementRenderer):
315         (WebCore::HTMLAttachmentElement::setFile):
316         (WebCore::HTMLAttachmentElement::parseAttribute):
317         (WebCore::HTMLAttachmentElement::invalidateShadowRootChildrenIfNecessary): Deleted.
318         (WebCore::HTMLAttachmentElement::attachmentRenderer const): Deleted.
319         (WebCore::HTMLAttachmentElement::updateDisplayMode): Deleted.
320         (WebCore::HTMLAttachmentElement::ensureInnerImage): Deleted.
321         (WebCore::HTMLAttachmentElement::ensureInnerVideo): Deleted.
322         (WebCore::HTMLAttachmentElement::innerImage const): Deleted.
323         (WebCore::HTMLAttachmentElement::innerVideo const): Deleted.
324         (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary): Deleted.
325
326         Remove logic for building the shadow root to house inline media elements.
327
328         * html/HTMLAttachmentElement.h:
329
330         The renderer of the attachment element is once again always a `RenderAttachment`, so we can remove
331         `attachmentRenderer()` altogether and revert to overriding `renderer()` to return a `RenderAttachment*`.
332
333         * page/DragController.cpp:
334         (WebCore::DragController::startDrag):
335         * rendering/RenderAttachment.h:
336         (WebCore::HTMLAttachmentElement::renderer const):
337
338 2018-08-15  Ali Juma  <ajuma@chromium.org>
339
340         [IntersectionObserver] Do not hold a strong reference to the root element
341         https://bugs.webkit.org/show_bug.cgi?id=188575
342
343         Reviewed by Simon Fraser.
344
345         Make IntersectionObserver have only a raw pointer to its root element rather than
346         a reference, so that an otherwise-unreachable root isn't kept alive. Add logic to
347         to clear this pointer when the root element gets deleted.
348
349         Test: intersection-observer/root-element-deleted.html
350
351         * dom/Element.cpp:
352         (WebCore::Element::~Element):
353         (WebCore::Element::disconnectFromIntersectionObservers):
354         (WebCore::Element::ensureIntersectionObserverData):
355         (WebCore::Element::intersectionObserverData):
356         * dom/Element.h:
357         * dom/ElementRareData.cpp:
358         * dom/ElementRareData.h:
359         (WebCore::ElementRareData::intersectionObserverData):
360         (WebCore::ElementRareData::setIntersectionObserverData):
361         * page/IntersectionObserver.cpp:
362         (WebCore::IntersectionObserver::create):
363         (WebCore::IntersectionObserver::IntersectionObserver):
364         (WebCore::IntersectionObserver::~IntersectionObserver):
365         (WebCore::IntersectionObserver::rootDestroyed):
366         * page/IntersectionObserver.h:
367         (WebCore::IntersectionObserver::root const):
368
369 2018-08-14  Zan Dobersek  <zdobersek@igalia.com>
370
371         [Nicosia] Add Nicosia::BackingStoreTextureMapperImpl
372         https://bugs.webkit.org/show_bug.cgi?id=188548
373
374         Reviewed by Carlos Garcia Campos.
375
376         Add the Nicosia::BackingStoreTextureMapperImpl class, the
377         TextureMapper-specific implementation that will extend the BackingStore
378         class.
379
380         Purpose of this class is to manage content of painted layers. In the
381         LayerState object that will be exposed to the CoordinatedGraphicsLayer
382         owner we keep the current and previous TiledBackingStore objects that
383         will be used for painting. A TileUpdate object is used to store all tile
384         creation, removal and update changes that happen during the painting
385         that's performed during the CoordinatedGraphicsLayer flush.
386
387         At the point of synchronization under the Nicosia::Scene object, these
388         updates will be moved over to the pending TileUpdate object that will
389         then be accessed during the composition step. For that purpose we keep
390         in the CompositionState member object a reference to the
391         CoordinatedBackingStore object that will get updated with the tile
392         creation, removal and update changes (if there are any). The composition
393         step will use the takeUpdate() method to retrieve all these changes and
394         apply them outside of the point of synchronization (avoiding this sync
395         step to take too long).
396
397         This will be integrated into the CoordinatedGraphicsLayer class at a
398         later point, when the switch to the new infrastructure can be made in
399         one go.
400
401         * platform/TextureMapper.cmake:
402         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: Added.
403         (Nicosia::BackingStoreTextureMapperImpl::createFactory):
404         (Nicosia::BackingStoreTextureMapperImpl::tiledBackingStoreHasPendingTileCreation):
405         (Nicosia::BackingStoreTextureMapperImpl::createTile):
406         (Nicosia::BackingStoreTextureMapperImpl::updateTile):
407         (Nicosia::BackingStoreTextureMapperImpl::removeTile):
408         (Nicosia::BackingStoreTextureMapperImpl::flushUpdate):
409         (Nicosia::BackingStoreTextureMapperImpl::takeUpdate):
410         * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h: Added.
411
412 2018-08-14  Fujii Hironori  <Hironori.Fujii@sony.com>
413
414         Unreviewed, rolling out r234874 and r234876.
415
416         WinCairo port can't compile
417
418         Reverted changesets:
419
420         "[JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg"
421         https://bugs.webkit.org/show_bug.cgi?id=188589
422         https://trac.webkit.org/changeset/234874
423
424         "Unreviewed, attempt to fix CLoop build"
425         https://bugs.webkit.org/show_bug.cgi?id=188589
426         https://trac.webkit.org/changeset/234876
427
428 2018-08-14  Zalan Bujtas  <zalan@apple.com>
429
430         [LFC][Floating] Add support for negative clearance.
431         https://bugs.webkit.org/show_bug.cgi?id=188555
432
433         Reviewed by Simon Fraser.
434
435         1. Compute clearance to avoid float(s) (border box needs to avoid floats)
436         2. Reset vertical margins to non-collapsed values.
437         4. Adjust clearance with the new margins.
438         5. Take the adjusted clearance and move the box vertically if needed.
439
440         Test: fast/block/block-only/margin-collapse-with-clearance.html
441
442         * layout/FloatingContext.cpp:
443         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
444         * layout/FloatingState.cpp:
445         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
446         * layout/FormattingContext.cpp:
447         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
448         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
449         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
450         (WebCore::Layout::FormattingContext::mapToAncestor): Deleted.
451         * layout/FormattingContext.h:
452         * layout/LayoutUnits.h:
453         (WebCore::Layout::Position::Position):
454         (WebCore::Layout::Position::moveBy):
455         * layout/displaytree/DisplayBox.h:
456
457 2018-08-14  Fujii Hironori  <Hironori.Fujii@sony.com>
458
459         Unreviewed, rolling out r234859.
460
461         Windows ports can't compile
462
463         Reverted changeset:
464
465         "Use a Variant instead of a union in CSSSelector"
466         https://bugs.webkit.org/show_bug.cgi?id=188559
467         https://trac.webkit.org/changeset/234859
468
469 2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
470
471         [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
472         https://bugs.webkit.org/show_bug.cgi?id=188589
473
474         Reviewed by Mark Lam.
475
476         No behavior change.
477
478         * cssjit/FunctionCall.h:
479         (WebCore::FunctionCall::FunctionCall):
480         * cssjit/SelectorCompiler.cpp:
481         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
482
483 2018-08-14  Alex Christensen  <achristensen@webkit.org>
484
485         isValidCSSSelector is unsafe to be called from a non-main thread
486         https://bugs.webkit.org/show_bug.cgi?id=188581
487         <rdar://problem/40517358>
488
489         Reviewed by Sam Weinig.
490
491         Parsing and determining whether the css selectors are valid is fast enough to do before
492         hopping to the background thread for the slow NFA/DFA operations and writing to disk.
493         Doing it on the main thread avoids the thread safety issues in the CSSParser's use of strings.
494
495         * contentextensions/ContentExtensionCompiler.cpp:
496         (WebCore::ContentExtensions::compileRuleList):
497         * contentextensions/ContentExtensionCompiler.h:
498         * contentextensions/ContentExtensionParser.cpp:
499         (WebCore::ContentExtensions::isValidCSSSelector):
500         (WebCore::ContentExtensions::loadEncodedRules):
501         (WebCore::ContentExtensions::parseRuleList):
502         * contentextensions/ContentExtensionParser.h:
503         * contentextensions/ContentExtensionRule.cpp:
504         (WebCore::ContentExtensions::Trigger::isolatedCopy const):
505         (WebCore::ContentExtensions::Action::isolatedCopy const):
506         * contentextensions/ContentExtensionRule.h:
507         (WebCore::ContentExtensions::Trigger::isEmpty const):
508         (WebCore::ContentExtensions::Trigger::operator== const):
509         (WebCore::ContentExtensions::Action::Action):
510         (WebCore::ContentExtensions::ContentExtensionRule::isolatedCopy const):
511         (WebCore::ContentExtensions::ContentExtensionRule::operator== const):
512         (WebCore::ContentExtensions::vectorIsolatedCopy):
513
514 2018-08-14  Ansh Shukla  <ansh_shukla@apple.com>
515
516         NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
517         https://bugs.webkit.org/show_bug.cgi?id=186870
518         <rdar://problem/41314410>
519
520         Reviewed by Alex Christensen.
521
522         Add the ProtectionSpaceAuthenticationSchemeOAuth type.
523
524         * platform/network/ProtectionSpaceBase.cpp:
525         (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
526         expects a token in return.
527         * platform/network/ProtectionSpaceBase.h:
528         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
529         (WebCore::scheme):
530         (WebCore::ProtectionSpace::nsSpace const):
531
532 2018-08-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
533
534         [Curl] Implement platform default timeout interval.
535         https://bugs.webkit.org/show_bug.cgi?id=188565
536
537         Reviewed by Alex Christensen.
538
539         Curl port didn't implement platform default timeout interval. It treated
540         zero value for timeout interval as no timeout.
541
542         Add platform dependent timeout interval into CurlContext and use that if
543         timeout and default timeout aren't supplied.
544
545         Tests: http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html
546
547         * platform/network/curl/CurlContext.cpp:
548         (WebCore::CurlHandle::setTimeout):
549         * platform/network/curl/CurlContext.h:
550         (WebCore::CurlContext::defaultTimeoutInterval const):
551         * platform/network/curl/CurlRequest.cpp:
552         (WebCore::CurlRequest::setupTransfer):
553         (WebCore::CurlRequest::timeoutInterval const):
554         (WebCore::CurlRequest::didCompleteTransfer):
555         * platform/network/curl/CurlRequest.h:
556
557 2018-08-14  Alex Christensen  <achristensen@webkit.org>
558
559         Use a Variant instead of a union in CSSSelector
560         https://bugs.webkit.org/show_bug.cgi?id=188559
561
562         Reviewed by Antti Koivisto.
563
564         No change in behavior. This just makes some of the existing problems more obvious and easy to fix.
565
566         I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
567         I only have m_isForPage when assertions are enabled because it's only used for an assertion.
568         The rest is pretty straightforward translating union syntax to Variant syntax.
569         I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.
570
571         * css/CSSSelector.cpp:
572         (WebCore::CSSSelector::CSSSelector):
573         (WebCore::CSSSelector::createRareData):
574         (WebCore::CSSSelector::setAttribute):
575         (WebCore::CSSSelector::setArgument):
576         (WebCore::CSSSelector::setLangArgumentList):
577         (WebCore::CSSSelector::setSelectorList):
578         (WebCore::CSSSelector::setNth):
579         (WebCore::CSSSelector::matchNth const):
580         (WebCore::CSSSelector::nthA const):
581         (WebCore::CSSSelector::nthB const):
582         (WebCore::CSSSelector::RareData::RareData):
583         * css/CSSSelector.h:
584         (WebCore::CSSSelector::argument const):
585         (WebCore::CSSSelector::langArgumentList const):
586         (WebCore::CSSSelector::selectorList const):
587         (WebCore::CSSSelector::attribute const):
588         (WebCore::CSSSelector::attributeCanonicalLocalName const):
589         (WebCore::CSSSelector::setValue):
590         (WebCore::CSSSelector::CSSSelector):
591         (WebCore::CSSSelector::~CSSSelector):
592         (WebCore::CSSSelector::tagQName const):
593         (WebCore::CSSSelector::tagLowercaseLocalName const):
594         (WebCore::CSSSelector::value const):
595         (WebCore::CSSSelector::serializingValue const):
596         (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
597         (WebCore::CSSSelector::RareData::create): Deleted.
598         * css/parser/CSSParserImpl.cpp:
599         (WebCore::CSSParserImpl::parsePageSelector):
600         * css/parser/CSSParserSelector.h:
601
602 2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
603
604         Unhandled Promise Rejection logging in workers should not emit ErrorEvent to host Worker object
605         https://bugs.webkit.org/show_bug.cgi?id=188551
606
607         Reviewed by Youenn Fablet.
608
609         Previously we dispatched ErrorEvent on the Worker object of the host side when the unhandled promise
610         rejection happens in the worker. But that was wrong. We should not dispatch such an event and we
611         should just log the error message.
612
613         * dom/ScriptExecutionContext.cpp:
614         (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection):
615
616 2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
617
618         Unreviewed, follow-up patch for comments
619         https://bugs.webkit.org/show_bug.cgi?id=188265
620
621         * bindings/js/JSExecState.cpp:
622         (WebCore::JSExecState::didLeaveScriptContext):
623         Do nothing if `context` is nullptr. It is OK since we do not need to drain microtasks / rejected
624         promise events after ScriptExecutionContext is gone.
625
626         * dom/Microtasks.cpp:
627         (WebCore::MicrotaskQueue::contextQueue):
628         Drop unnecessary assertion since it is subsumed by downcast<>.
629
630 2018-08-14  Ali Juma  <ajuma@chromium.org>
631
632         Follow-up: [IntersectionObserver] Implement rootMargin parsing
633         https://bugs.webkit.org/show_bug.cgi?id=188469
634
635         Address review feedback from Darin Adler.
636
637         * page/IntersectionObserver.cpp:
638         (WebCore::IntersectionObserver::rootMargin const):
639         Use StringBuilder::appendLiteral instead of ::append to append a literal.
640
641 2018-08-14  Antoine Quint  <graouts@apple.com>
642
643         [Web Animations] Crash under AnimationTimeline::cancelOrRemoveDeclarativeAnimation()
644         https://bugs.webkit.org/show_bug.cgi?id=188519
645         <rdar://problem/43237889>
646
647         Reviewed by Eric Carlson.
648
649         Test: webanimations/css-animation-effect-target-change-and-animation-removal-crash.html
650
651         We would crash because we blindly assumed an animation that was found in the previous style must be in the list of running animations
652         but in fact it could have been removed already due to the element being removed from the DOM or its effect target changing, etc. So when
653         we iterate over names of animations that were found in the previous style but not in the new style, we must make a null check to ensure
654         that there is an animation to remove. Adding an ASSERT() in AnimationTimeline::cancelOrRemoveDeclarativeAnimation() will also clarify the
655         expectation here.
656
657         * animation/AnimationTimeline.cpp:
658         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
659         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
660
661 2018-08-14  Zalan Bujtas  <zalan@apple.com>
662
663         [LFC][Floating] Adjust vertical position with non-collapsed previous sibling margin.
664         https://bugs.webkit.org/show_bug.cgi?id=188543
665
666         Reviewed by Antti Koivisto.
667
668         This patch ensures that the inital vertical position for a float is adjusted with the non-collapsed sibling margin.
669
670         <div id=A style="margin-bottom: 20px;"></div>
671         <div id=B style='float: left'></div>
672         <div id=C style="margin-top: 10px;"></div>
673
674         While computing the static position for element "B", we simply call marginBottom() on A.
675         In the case above, A's margin bottom is collapsed with C's margin top and the value is 0 (C.marginTop() is 20px).
676         However CSS spec says that in block formatting context, the non-collapsed margin should be used instead to offset the float box.
677         (The reason why this should not be part of the BlockMarginCollapse::marginBottom() logic is because it can not differentiate the context of
678         sibling float/sibling inflow. When we margin collapse, we always do it in the context of inflow boxes.)
679
680         Test: fast/block/block-only/float-and-siblings-with-margins.html
681
682         * layout/blockformatting/BlockFormattingContext.cpp:
683         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
684         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
685         * layout/blockformatting/BlockFormattingContext.h:
686
687 2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
688
689         Worker should support unhandled promise rejections
690         https://bugs.webkit.org/show_bug.cgi?id=188265
691
692         Reviewed by Darin Adler.
693
694         This patch adds PromiseRejectionEvent support in workers.
695
696         * Sources.txt:
697         * WebCore.xcodeproj/project.pbxproj:
698         * bindings/js/JSDOMGlobalObject.cpp:
699         (WebCore::JSDOMGlobalObject::promiseRejectionTracker):
700         Move promiseRejectionTracker handler from JSDOMWindowBase to JSDOMGlobalObject
701         to share it with WorkerGlobalScope.
702
703         * bindings/js/JSDOMGlobalObject.h:
704         * bindings/js/JSDOMWindowBase.cpp:
705         (WebCore::JSDOMWindowBase::promiseRejectionTracker): Deleted.
706         Moved to JSDOMGlobalObject.
707
708         * bindings/js/JSDOMWindowBase.h:
709         * bindings/js/JSExecState.cpp:
710         (WebCore::JSExecState::didLeaveScriptContext):
711         PromiseRejectionTracker is driven in workers too.
712
713         * bindings/js/JSPromiseRejectionEventCustom.cpp: Added.
714         (WebCore::JSPromiseRejectionEvent::visitAdditionalChildren):
715         Marking PromiseRejectionEvent::m_reason.
716
717         * bindings/js/JSWorkerGlobalScopeBase.cpp:
718         Configure promiseRejectionTracker.
719
720         * dom/Microtasks.cpp:
721         (WebCore::MicrotaskQueue::contextQueue):
722         * dom/Microtasks.h:
723         * dom/PromiseRejectionEvent.cpp:
724         (WebCore::PromiseRejectionEvent::PromiseRejectionEvent):
725         * dom/PromiseRejectionEvent.h:
726         * dom/PromiseRejectionEvent.idl:
727         Expose it to worker scope. The custom mark function is required since we start
728         using JSValueInWrappedObject. And the constructor no longer requires ExecState.
729
730         * dom/RejectedPromiseTracker.cpp:
731         (WebCore::RejectedPromiseTracker::reportUnhandledRejections):
732         (WebCore::RejectedPromiseTracker::reportRejectionHandled):
733         Remove state argument for PromiseRejectionEvent::create.
734
735         * dom/ScriptExecutionContext.cpp:
736         (WebCore::ScriptExecutionContext::removeRejectedPromiseTracker):
737         * dom/ScriptExecutionContext.h:
738         In worker thread, we should delete PromiseRejectionTracker before destroying VM
739         because PromiseRejectionTracker's destruction requires VM. If we destroy VM first,
740         PromiseRejectionTracker's destruction causes crashing. In main thread, we do not
741         need to handle this case since we never destroy VM.
742
743         * workers/WorkerGlobalScope.cpp:
744         (WebCore::WorkerGlobalScope::prepareForTermination):
745         (WebCore::WorkerGlobalScope::removeMicrotaskQueue): Deleted.
746         * workers/WorkerGlobalScope.h:
747         * workers/WorkerGlobalScope.idl:
748         Add onunhandledrejection and onrejectionhandled event handler attributes.
749
750         * workers/WorkerThread.cpp:
751         (WebCore::WorkerThread::stop):
752         We call WorkerGlobalScope::prepareForTermination, which cleans up Worker's objects touching VM.
753
754 2018-08-14  Rob Buis  <rbuis@igalia.com>
755
756         Fetch: content-length header is being added to the safe-list
757         https://bugs.webkit.org/show_bug.cgi?id=185473
758
759         Reviewed by Youenn Fablet.
760
761         Content-Length is a CORS-safelisted reponse header:
762         https://fetch.spec.whatwg.org/#cors-safelisted-response-header-name
763
764         Tests: web-platform-tests/fetch/api/cors/cors-filtering.html
765                web-platform-tests/fetch/api/cors/cors-filtering-worker.html
766
767         * platform/network/HTTPParsers.cpp:
768         (WebCore::isCrossOriginSafeHeader):
769
770 2018-08-13  Zalan Bujtas  <zalan@apple.com>
771
772         [LFC][Floating] Do not confuse clear with clearance.
773         https://bugs.webkit.org/show_bug.cgi?id=188541
774
775         Reviewed by Simon Fraser.
776
777         clear -> CSS property.
778         clearance -> the offset required to avoid floats when clear is present.
779
780         * layout/FloatingContext.cpp:
781         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
782         * layout/blockformatting/BlockFormattingContext.cpp:
783         (WebCore::Layout::BlockFormattingContext::layout const):
784         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForClear const):
785         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const): Deleted.
786         * layout/blockformatting/BlockFormattingContext.h:
787         * layout/layouttree/LayoutBox.cpp:
788         (WebCore::Layout::Box::hasClear const):
789         (WebCore::Layout::Box::hasClearance const): Deleted.
790         * layout/layouttree/LayoutBox.h:
791
792 2018-08-13  James Savage  <james.savage@apple.com>
793
794         [iOS] Crash at -[UIViewController _presentViewController:withAnimationController:completion:]
795         https://bugs.webkit.org/show_bug.cgi?id=188537
796         <rdar://problem/41400259>
797
798         Reviewed by Tim Horton.
799
800         * platform/ios/ValidationBubbleIOS.mm:
801         (WebCore::ValidationBubble::show): Avoid hitting a UIKit exception for
802         presenting an already presented view controller by turning the scenario
803         into an early return.
804
805 2018-08-13  Alex Christensen  <achristensen@webkit.org>
806
807         Make CSSSelectorList a little more sane
808         https://bugs.webkit.org/show_bug.cgi?id=188539
809
810         Reviewed by Simon Fraser.
811
812         This patch does four things:
813         1. Use a UniqueArray<CSSSelector> instead of a raw pointer and manually calling destructors.
814         2. Use move semantics a little bit better.
815         3. Add a CSSSelectorList&& to the StyleRule and StyleRulePage because every time we create either
816         one of those objects we call a setter to give it a CSSSelectorList.  That's what constructor arguments are for.
817         4. Don't use CSSSelectorList.componentCount(), which iterates all components, to determine if it's empty.
818         Use first() instead.
819
820         * css/CSSPageRule.cpp:
821         (WebCore::CSSPageRule::setSelectorText):
822         * css/CSSSelectorList.cpp:
823         (WebCore::CSSSelectorList::CSSSelectorList):
824         (WebCore::CSSSelectorList::componentCount const):
825         (WebCore::CSSSelectorList::listSize const):
826         (WebCore::CSSSelectorList::operator=):
827         (WebCore::CSSSelectorList::deleteSelectors): Deleted.
828         * css/CSSSelectorList.h:
829         (WebCore::CSSSelectorList::CSSSelectorList):
830         (WebCore::CSSSelectorList::first const):
831         (WebCore::CSSSelectorList::indexOfNextSelectorAfter const):
832         (WebCore::CSSSelectorList::~CSSSelectorList): Deleted.
833         (WebCore::CSSSelectorList::adoptSelectorArray): Deleted.
834         (WebCore::CSSSelectorList::hasOneSelector const): Deleted.
835         * css/CSSStyleRule.cpp:
836         (WebCore::CSSStyleRule::setSelectorText):
837         * css/StyleRule.cpp:
838         (WebCore::StyleRule::StyleRule):
839         (WebCore::StyleRule::createForSplitting):
840         (WebCore::StyleRulePage::StyleRulePage):
841         * css/StyleRule.h:
842         * css/parser/CSSParserImpl.cpp:
843         (WebCore::CSSParserImpl::consumePageRule):
844         (WebCore::CSSParserImpl::consumeStyleRule):
845         * css/parser/CSSSelectorParser.cpp:
846         (WebCore::CSSSelectorParser::consumePseudo):
847
848 2018-08-13  Ali Juma  <ajuma@chromium.org>
849
850         [IntersectionObserver] Validate threshold values
851         https://bugs.webkit.org/show_bug.cgi?id=188475
852
853         Reviewed by Simon Fraser.
854
855         Throw an exception if any of an IntersectionObserver's thresholds are outside
856         the range [0, 1].
857
858         Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html
859                    intersection-observer/intersection-observer-interface.html
860
861         * page/IntersectionObserver.cpp:
862         (WebCore::IntersectionObserver::create):
863         (WebCore::IntersectionObserver::IntersectionObserver):
864         * page/IntersectionObserver.h:
865
866 2018-08-13  Alex Christensen  <achristensen@webkit.org>
867
868         Remove unused CSSSelector::parseNth
869         https://bugs.webkit.org/show_bug.cgi?id=188529
870
871         Reviewed by Simon Fraser.
872
873         This was conceptually replaced by the call to setNth in CSSSelectorParser::consumePseudo.
874
875         * css/CSSSelector.cpp:
876         (WebCore::CSSSelector::CSSSelector):
877         (WebCore::CSSSelector::setNth):
878         (WebCore::CSSSelector::nthA const):
879         (WebCore::CSSSelector::nthB const):
880         (WebCore::CSSSelector::parseNth const): Deleted.
881         (WebCore::CSSSelector::RareData::parseNth): Deleted.
882         * css/CSSSelector.h:
883         (WebCore::CSSSelector::CSSSelector):
884         * css/SelectorChecker.cpp:
885         (WebCore::SelectorChecker::checkOne const):
886         * cssjit/SelectorCompiler.cpp:
887         (WebCore::SelectorCompiler::addNthChildType):
888
889 2018-08-13  Alex Christensen  <achristensen@webkit.org>
890
891         Remove unused code in CSSParserSelector/CSSSelector
892         https://bugs.webkit.org/show_bug.cgi?id=188528
893
894         Reviewed by Simon Fraser.
895
896         * css/CSSSelector.cpp:
897         * css/CSSSelector.h:
898         (WebCore::CSSSelector::serializingValue const):
899         (WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive): Deleted.
900         * css/parser/CSSParserSelector.h:
901         (WebCore::CSSParserSelector::setAttributeValueMatchingIsCaseInsensitive): Deleted.
902
903 2018-08-13  Alex Christensen  <achristensen@webkit.org>
904
905         Modernize CSSSelectorList a little
906         https://bugs.webkit.org/show_bug.cgi?id=188527
907
908         Reviewed by Simon Fraser.
909
910         No change in behavior.  Just use make_unique and move semantics a little more.
911
912         * css/CSSSelectorList.cpp:
913         (WebCore::CSSSelectorList::CSSSelectorList):
914         (WebCore::CSSSelectorList::adoptSelectorVector): Deleted.
915         * css/CSSSelectorList.h:
916         * css/StyleRule.h:
917         * css/parser/CSSParserImpl.cpp:
918         (WebCore::CSSParserImpl::parsePageSelector):
919         * css/parser/CSSParserSelector.cpp:
920         (WebCore::CSSParserSelector::adoptSelectorVector):
921         * css/parser/CSSParserSelector.h:
922         * css/parser/CSSSelectorParser.cpp:
923         (WebCore::CSSSelectorParser::consumeComplexSelectorList):
924         (WebCore::CSSSelectorParser::consumeCompoundSelectorList):
925         (WebCore::CSSSelectorParser::consumePseudo):
926
927 2018-08-13  Antti Koivisto  <antti@apple.com>
928
929         Meaning of OptionSet::contains is unclear when used with OptionSet argument
930         https://bugs.webkit.org/show_bug.cgi?id=188501
931
932         Reviewed by Anders Carlsson.
933
934         * dom/DocumentMarkerController.cpp:
935         (WebCore::DocumentMarkerController::possiblyHasMarkers):
936         * dom/DocumentMarkerController.h:
937         (WebCore::DocumentMarkerController::hasMarkers const):
938         * platform/FileSystem.h:
939         (WebCore::FileSystem::openAndLockFile):
940         * rendering/RenderElement.cpp:
941         (WebCore::RenderElement::selectionColor const):
942         * rendering/RenderLayer.cpp:
943         (WebCore::RenderLayer::paintForegroundForFragments):
944
945 2018-08-13  Commit Queue  <commit-queue@webkit.org>
946
947         Unreviewed, rolling out r234747.
948         https://bugs.webkit.org/show_bug.cgi?id=188524
949
950         plugin processes crash on launch (Requested by smfr on
951         #webkit).
952
953         Reverted changeset:
954
955         "We should cache the compiled sandbox profile in a data vault"
956         https://bugs.webkit.org/show_bug.cgi?id=184991
957         https://trac.webkit.org/changeset/234747
958
959 2018-08-13  Wenson Hsieh  <wenson_hsieh@apple.com>
960
961         [iOS] Dragging a non-editable text selection into a plain text input inserts HTML markup
962         https://bugs.webkit.org/show_bug.cgi?id=188485
963         <rdar://problem/43168784>
964
965         Reviewed by Tim Horton.
966
967         Before r223678, -typeIdentifiersToLoadForRegisteredTypeIdentifiers:, which is responsible for determining which
968         type identifiers to load upon performing a drop, returned the following when dropping a rich text selection onto
969         a textarea:
970
971             "public.plain-text",
972             "public.html"
973
974         After r223678, we now propagate a custom pasteboard data type when dragging, and the same list now looks like:
975
976             "com.apple.WebKit.custom-pasteboard-data",
977             "public.html",
978             "public.plain-text"
979
980         Subsequently, logic in `-_preLoadedDataConformingToType:…` (responsible for mapping a requested type identifier
981         to data that has been loaded from an item provider) iterates through the aforementioned list of type identifiers
982         and selects the data of the first type identifier in the list that conforms to the requested type identifier.
983         However, this list of type identifiers is currently the result of `-[NSSet allObjects]`, which means that the
984         type identifiers in the list are in no particular order!
985
986         As such, this particular use case only worked by accident prior to r223678, and after that change, this latent
987         bug was surfaced. The patch here makes two adjustments to pasteboard handling on iOS to fix the bug.
988
989         Test: DragAndDropTests.NonEditableTextSelectionToTextarea
990
991         * platform/ios/PasteboardIOS.mm:
992         (WebCore::Pasteboard::read):
993
994         When reading plain text from the pasteboard, give "public.plain-text" priority over "public.text". This ensures
995         that we don't end up reading markup as "plain text" when there's already more relevant plain text data present
996         in the pasteboard.
997
998         * platform/ios/WebItemProviderPasteboard.mm:
999         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]):
1000
1001         Refactor existing logic to enforce a consistent ordering of type identifiers to load. First, we use
1002         NSMutableOrderedSet instead of just an NSMutableSet to store type identifiers we've added. Secondly, move all
1003         logic to insert type identifiers into this set to the end of the method, where we iterate over all of the type
1004         identifiers in order and add each type identifier to the set if needed. This ensures that the order of resulting
1005         types is from highest to lowest fidelity.
1006
1007         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
1008         (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]): Deleted.
1009
1010         Fix a typo in the method name.
1011
1012 2018-08-13  Alex Christensen  <achristensen@webkit.org>
1013
1014         Use a 1-byte enum class for TextDirection
1015         https://bugs.webkit.org/show_bug.cgi?id=188350
1016
1017         Reviewed by Simon Fraser.
1018
1019         * Modules/notifications/Notification.h:
1020         * css/CSSPrimitiveValueMappings.h:
1021         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1022         (WebCore::CSSPrimitiveValue::operator TextDirection const):
1023         * css/ElementRuleCollector.cpp:
1024         (WebCore::ElementRuleCollector::matchAllRules):
1025         * dom/Document.cpp:
1026         (WebCore::Document::updateTitleFromTitleElement):
1027         (WebCore::Document::setTitle):
1028         * dom/Position.cpp:
1029         (WebCore::Position::primaryDirection const):
1030         * dom/Range.cpp:
1031         (WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const):
1032         * editing/Editing.cpp:
1033         (WebCore::directionOfEnclosingBlock):
1034         * editing/Editor.cpp:
1035         (WebCore::Editor::baseWritingDirectionForSelectionStart const):
1036         * editing/FrameSelection.cpp:
1037         (WebCore::FrameSelection::willBeModified):
1038         (WebCore::FrameSelection::modifyExtendingRight):
1039         (WebCore::FrameSelection::modifyExtendingForward):
1040         (WebCore::FrameSelection::modifyMovingRight):
1041         (WebCore::FrameSelection::modifyExtendingLeft):
1042         (WebCore::FrameSelection::modifyExtendingBackward):
1043         (WebCore::FrameSelection::modifyMovingLeft):
1044         (WebCore::FrameSelection::textSelectionIntent):
1045         (WebCore::FrameSelection::modify):
1046         * editing/VisiblePosition.cpp:
1047         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
1048         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
1049         * editing/VisibleUnits.cpp:
1050         (WebCore::visualWordPosition):
1051         (WebCore::leftWordPosition):
1052         (WebCore::rightWordPosition):
1053         (WebCore::leftBoundaryOfLine):
1054         (WebCore::rightBoundaryOfLine):
1055         * html/HTMLElement.cpp:
1056         (WebCore::HTMLElement::directionalityIfhasDirAutoAttribute const):
1057         (WebCore::HTMLElement::directionality const):
1058         * html/HTMLInputElement.cpp:
1059         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
1060         * html/HTMLTextFormControlElement.cpp:
1061         (WebCore::HTMLTextFormControlElement::directionForFormData const):
1062         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
1063         * html/HTMLTitleElement.cpp:
1064         (WebCore::HTMLTitleElement::computedTextWithDirection):
1065         * html/canvas/CanvasRenderingContext2D.cpp:
1066         (WebCore::CanvasRenderingContext2D::toTextDirection const):
1067         (WebCore::CanvasRenderingContext2D::direction const):
1068         (WebCore::CanvasRenderingContext2D::textOffset):
1069         * html/shadow/SliderThumbElement.cpp:
1070         (WebCore::RenderSliderContainer::layout):
1071         * html/shadow/TextControlInnerElements.cpp:
1072         (WebCore::TextControlInnerElement::resolveCustomStyle):
1073         * page/Chrome.cpp:
1074         (WebCore::Chrome::setToolTip):
1075         * page/FrameView.cpp:
1076         (WebCore::paginationModeForRenderStyle):
1077         * page/Settings.yaml:
1078         * platform/RectEdges.h:
1079         (WebCore::RectEdges::start):
1080         (WebCore::RectEdges::end):
1081         (WebCore::RectEdges::start const):
1082         (WebCore::RectEdges::end const):
1083         (WebCore::RectEdges::setStart):
1084         (WebCore::RectEdges::setEnd):
1085         * platform/UserInterfaceLayoutDirection.h:
1086         * platform/graphics/ComplexTextController.cpp:
1087         (WebCore::ComplexTextController::computeExpansionOpportunity):
1088         * platform/graphics/FontCascade.cpp:
1089         (WebCore::FontCascade::expansionOpportunityCountInternal):
1090         (WebCore::FontCascade::leadingExpansionOpportunity):
1091         (WebCore::FontCascade::trailingExpansionOpportunity):
1092         * platform/graphics/GraphicsContext.cpp:
1093         (WebCore::GraphicsContext::drawBidiText):
1094         * platform/graphics/TextRun.h:
1095         (WebCore::TextRun::TextRun):
1096         (WebCore::TextRun::rtl const):
1097         (WebCore::TextRun::ltr const):
1098         (WebCore::TextRun::setDirection):
1099         * platform/graphics/WidthIterator.cpp:
1100         (WebCore::WidthIterator::WidthIterator):
1101         * platform/ios/SelectionRect.cpp:
1102         (WebCore::SelectionRect::SelectionRect):
1103         * platform/text/BidiResolver.h:
1104         (WebCore::BidiStatus::BidiStatus):
1105         * platform/text/StringWithDirection.h:
1106         * platform/text/WritingMode.h:
1107         (WebCore::isLeftToRightDirection):
1108         (WebCore::isVerticalWritingMode):
1109         (WebCore::isFlippedWritingMode):
1110         (WebCore::mapLogicalSideToPhysicalSide):
1111         * rendering/HitTestResult.cpp:
1112         (WebCore::HitTestResult::spellingToolTip const):
1113         (WebCore::HitTestResult::title const):
1114         (WebCore::HitTestResult::innerTextIfTruncated const):
1115         * rendering/InlineBox.h:
1116         (WebCore::InlineBox::direction const):
1117         (WebCore::InlineBox::isLeftToRightDirection const):
1118         * rendering/InlineFlowBox.cpp:
1119         (WebCore::InlineFlowBox::paintFillLayer):
1120         * rendering/InlineIterator.h:
1121         (WebCore::embedCharFromDirection):
1122         * rendering/InlineTextBox.cpp:
1123         (WebCore::InlineTextBox::paint):
1124         (WebCore::mirrorRTLSegment):
1125         * rendering/RenderBlock.cpp:
1126         (WebCore::RenderBlock::constructTextRun):
1127         * rendering/RenderBlockLineLayout.cpp:
1128         (WebCore::determineDirectionality):
1129         (WebCore::RenderBlockFlow::textAlignmentForLine const):
1130         (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
1131         (WebCore::RenderBlockFlow::handleTrailingSpaces):
1132         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1133         * rendering/RenderBox.cpp:
1134         (WebCore::computeInlineStaticDistance):
1135         (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
1136         (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
1137         * rendering/RenderDeprecatedFlexibleBox.cpp:
1138         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
1139         * rendering/RenderFragmentedFlow.cpp:
1140         (WebCore::RenderFragmentedFlow::updateLogicalWidth):
1141         (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
1142         * rendering/RenderLayerModelObject.cpp:
1143         (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const):
1144         * rendering/RenderMarquee.cpp:
1145         (WebCore::RenderMarquee::direction const):
1146         * rendering/RenderMenuList.cpp:
1147         (WebCore::RenderMenuList::adjustInnerStyle):
1148         (RenderMenuList::clientPaddingLeft const):
1149         (RenderMenuList::clientPaddingRight const):
1150         * rendering/RenderThemeIOS.mm:
1151         (WebCore::RenderThemeIOS::popupInternalPaddingBox const):
1152         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
1153         * rendering/RenderThemeMac.mm:
1154         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
1155         (WebCore::RenderThemeMac::popupInternalPaddingBox const):
1156         (WebCore::RenderThemeMac::setPopupButtonCellState):
1157         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1158         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
1159         * rendering/mathml/RenderMathMLBlock.cpp:
1160         (WebCore::RenderMathMLBlock::mirrorIfNeeded const):
1161         * rendering/mathml/RenderMathMLOperator.cpp:
1162         (WebCore::RenderMathMLOperator::layoutBlock):
1163         * rendering/style/RenderStyle.cpp:
1164         (WebCore::RenderStyle::RenderStyle):
1165         * rendering/style/RenderStyle.h:
1166         (WebCore::RenderStyle::isLeftToRightDirection const):
1167         (WebCore::RenderStyle::initialDirection):
1168         * testing/InternalSettings.cpp:
1169         (WebCore::InternalSettings::systemLayoutDirection):
1170         (WebCore::InternalSettings::setSystemLayoutDirection):
1171         * testing/Internals.h:
1172
1173 2018-08-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
1174
1175         Followup (r234683): Element::getAttribute() should return the first non-null attribute value
1176         https://bugs.webkit.org/show_bug.cgi?id=188419
1177
1178         Reviewed by Darin Adler.
1179
1180         Element::getAttribute() should return the first non-null attribute value
1181         since an empty string is a legitimate attribute value.
1182
1183         Test: svg/custom/href-svg-namespace-empty.html
1184
1185         * dom/Element.h:
1186         (WebCore::Element::getAttribute const):
1187
1188 2018-08-13  Michael Catanzaro  <mcatanzaro@igalia.com>
1189
1190         Unreviewed, since -Wsign-compare warnings in URL.cpp
1191
1192         This regressed in r233798 when m_schemeEnd changed to a bitfield. The code looks safe to
1193         me, so just silence the warnings with casts.
1194
1195         * platform/URL.cpp:
1196         (WebCore::URL::setHost):
1197         (WebCore::URL::setHostAndPort):
1198         (WebCore::URL::setUser):
1199         (WebCore::URL::setPass):
1200
1201 2018-08-13  Antti Koivisto  <antti@apple.com>
1202
1203         Use OptionSet more in editing code
1204         https://bugs.webkit.org/show_bug.cgi?id=188500
1205
1206         Reviewed by Wenson Hsieh.
1207
1208         Typesafe flags.
1209
1210         * editing/CompositeEditCommand.cpp:
1211         (WebCore::CompositeEditCommand::moveParagraphs):
1212         * editing/Editor.cpp:
1213         (WebCore::TemporarySelectionChange::TemporarySelectionChange):
1214         (WebCore::Editor::replaceSelectionWithFragment):
1215         (WebCore::Editor::appliedEditing):
1216         (WebCore::Editor::selectComposition):
1217         (WebCore::Editor::changeSelectionAfterCommand):
1218         (WebCore::Editor::respondToChangedSelection):
1219         * editing/Editor.h:
1220         (WebCore::TemporarySelectionChange::TemporarySelectionChange):
1221         * editing/FrameSelection.cpp:
1222         (WebCore::FrameSelection::moveWithoutValidationTo):
1223         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
1224         (WebCore::FrameSelection::setSelection):
1225         (WebCore::FrameSelection::setSelectedRange):
1226         * editing/FrameSelection.h:
1227         (WebCore::FrameSelection::defaultSetSelectionOptions):
1228         * editing/MoveSelectionCommand.cpp:
1229         (WebCore::MoveSelectionCommand::doApply):
1230         * editing/ReplaceSelectionCommand.cpp:
1231         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
1232         * editing/ReplaceSelectionCommand.h:
1233         (WebCore::ReplaceSelectionCommand::create):
1234         * editing/SetSelectionCommand.cpp:
1235         (WebCore::SetSelectionCommand::SetSelectionCommand):
1236         * editing/SetSelectionCommand.h:
1237         (WebCore::SetSelectionCommand::create):
1238         * page/ContextMenuController.cpp:
1239         (WebCore::ContextMenuController::contextMenuItemSelected):
1240         * page/DragController.cpp:
1241         (WebCore::DragController::concludeEditDrag):
1242         * page/TextIndicator.cpp:
1243         (WebCore::TextIndicator::createWithRange):
1244
1245 2018-08-13  Zalan Bujtas  <zalan@apple.com>
1246
1247         [LFC][Floating] Add basic clearance support
1248         https://bugs.webkit.org/show_bug.cgi?id=188492
1249
1250         Reviewed by Antti Koivisto.
1251
1252         Adjust final position of a block level box with clearance when float is present.
1253
1254         Test: fast/block/block-only/floating-left-and-right-with-clearance.html
1255
1256         * layout/FloatingContext.cpp:
1257         (WebCore::Layout::FloatingContext::positionForFloat const):
1258         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1259         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
1260         (WebCore::Layout::FloatingContext::toContainingBlock const):
1261         (WebCore::Layout::FloatingContext::computePosition const): Deleted.
1262         * layout/FloatingContext.h:
1263         * layout/FloatingState.cpp:
1264         (WebCore::Layout::FloatingState::bottom const):
1265         * layout/FloatingState.h:
1266         (WebCore::Layout::FloatingState::leftBottom const):
1267         (WebCore::Layout::FloatingState::rightBottom const):
1268         (WebCore::Layout::FloatingState::bottom const):
1269         * layout/Verification.cpp:
1270         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
1271         * layout/blockformatting/BlockFormattingContext.cpp:
1272         (WebCore::Layout::BlockFormattingContext::layout const):
1273         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1274         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const):
1275         * layout/blockformatting/BlockFormattingContext.h:
1276         * layout/layouttree/LayoutBox.cpp:
1277         (WebCore::Layout::Box::hasClearance const):
1278         * layout/layouttree/LayoutBox.h:
1279
1280 2018-08-13  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1281
1282         Expose CloseEvent and CustomEvent to workers
1283         https://bugs.webkit.org/show_bug.cgi?id=188493
1284
1285         Reviewed by Sam Weinig.
1286
1287         This patch exposes CloseEvent and CustomEvent to workers.
1288         It is OK since they do not depend on things in the main thread.
1289         For example, we cannot expose FormData right now since it depends
1290         on Page.
1291
1292         We do not expose PromiseRejectionEvent in this patch since it will
1293         be done in [1].
1294
1295         [1]: https://bugs.webkit.org/show_bug.cgi?id=188265
1296
1297         * Modules/websockets/CloseEvent.idl:
1298         * dom/CustomEvent.idl:
1299
1300 2018-08-13  Oriol Brufau  <obrufau@igalia.com>
1301
1302         [css-logical] Implement flow-relative margin, padding, border and sizing properties
1303         https://bugs.webkit.org/show_bug.cgi?id=188386
1304
1305         Reviewed by Manuel Rego Casasnovas.
1306
1307         These properties provide the author with the ability to control margins
1308         through logical, rather than physical, direction and dimension mappings.
1309
1310         Only longhand properties and border shorthands for specific sides are
1311         implemented as part of this patch.
1312
1313         The existing prefixed properties become aliases of the new ones.
1314
1315         The change in WebCore::isLayoutDependent fixes an existing issue that
1316         made getComputedStyle provide an old value for -webkit-logical-height
1317         and -webkit-logical-height (see https://crbug.com/849855).
1318
1319         Tests: imported/w3c/web-platform-tests/css/css-logical/animation-001.html
1320                imported/w3c/web-platform-tests/css/css-logical/animation-002.html
1321                imported/w3c/web-platform-tests/css/css-logical/animation-003.tentative.html
1322                imported/w3c/web-platform-tests/css/css-logical/cascading-001.html
1323                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
1324                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
1325                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
1326                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
1327                imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
1328                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
1329                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
1330                imported/w3c/web-platform-tests/css/css-logical/logical-box-size.html
1331                imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size-vlr.html
1332                imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size.html
1333                imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size-vlr.html
1334                imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size.html
1335                imported/w3c/web-platform-tests/css/css-logical/logicalprops-quirklength.html
1336
1337         * css/CSSComputedStyleDeclaration.cpp:
1338         (WebCore::isLayoutDependent):
1339         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1340         * css/CSSProperties.json:
1341         * css/CSSProperty.cpp:
1342         (WebCore::CSSProperty::resolveDirectionAwareProperty):
1343         (WebCore::CSSProperty::isDirectionAwareProperty):
1344         * css/StyleProperties.cpp:
1345         (WebCore::StyleProperties::getPropertyValue const):
1346         * css/parser/CSSParserFastPaths.cpp:
1347         (WebCore::isSimpleLengthPropertyID):
1348         (WebCore::isColorPropertyID):
1349         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1350         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1351         * css/parser/CSSPropertyParser.cpp:
1352         (WebCore::CSSPropertyParser::parseSingleValue):
1353         (WebCore::CSSPropertyParser::parseShorthand):
1354         * html/HTMLTableElement.cpp:
1355         (WebCore::HTMLTableElement::collectStyleForPresentationAttribute):
1356         * rendering/RenderTableCell.cpp:
1357         (WebCore::RenderTableCell::computeCollapsedStartBorder const):
1358         (WebCore::RenderTableCell::computeCollapsedEndBorder const):
1359         (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
1360         (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
1361
1362 2018-08-12  Sihui Liu  <sihui_liu@apple.com>
1363
1364         CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient(WebCore::IDBServer::UniqueIDBDatabaseConnection&)
1365         https://bugs.webkit.org/show_bug.cgi?id=188474
1366
1367         Reviewed by Chris Dumez.
1368
1369         UniqueIDBDatabaseConnection is refcounted by UniqueIDBDatabaseTransaction and it refcounts
1370         UniqueIDBDatabaseTransaction. This cycle could make UniqueIDBDatabaseConnection outlives
1371         UniqueIDBDatabase, so its reference to UniqueIDBDatabase may be stale. Calling a function
1372         on a stale object is probably the reason of recent various storage process crashes in
1373         indexedDB.
1374
1375         This patch makes m_database a WeakPtr and adds assertions that could help us debug the
1376         crashes.
1377
1378         * Modules/indexeddb/server/IDBServer.cpp:
1379         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
1380         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
1381         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1382         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
1383         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
1384         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1385         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1386         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
1387         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
1388         (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
1389         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
1390         (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer):
1391         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
1392         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
1393         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
1394         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
1395         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
1396         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
1397         (WebCore::IDBServer::UniqueIDBDatabaseConnection::database):
1398         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1399         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
1400         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
1401         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
1402         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
1403         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
1404         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
1405         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
1406         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
1407         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
1408         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
1409         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
1410         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
1411         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
1412         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
1413         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
1414         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
1415         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
1416         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
1417         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
1418         * Modules/indexeddb/shared/IDBResultData.cpp:
1419         (WebCore::IDBResultData::openDatabaseSuccess):
1420         (WebCore::IDBResultData::openDatabaseUpgradeNeeded):
1421
1422 2018-08-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1423
1424         Break reference cycle in ErrorEvent by using JSValueInWrappedObject
1425         https://bugs.webkit.org/show_bug.cgi?id=188491
1426
1427         Reviewed by Darin Adler.
1428
1429         ErrorEvent should not use Strong<Unkonwn> to hold error JSValue. This patch integrates
1430         JSValueInWrappedObject into ErrorEvent.
1431
1432         * Modules/webvr/VRDisplayEvent.h:
1433         Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build.
1434
1435         * Sources.txt:
1436         * WebCore.xcodeproj/project.pbxproj:
1437         * bindings/js/JSErrorEventCustom.cpp: Copied from Source/WebCore/Modules/webvr/VRDisplayEvent.h.
1438         (WebCore::JSErrorEvent::visitAdditionalChildren):
1439         Add custom mark function for JSValueInWrappedObject.
1440
1441         * bindings/js/JSEventListener.h:
1442         * bindings/js/WindowProxy.cpp:
1443         Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build.
1444
1445         * dom/ErrorEvent.cpp:
1446         (WebCore::ErrorEvent::ErrorEvent):
1447         (WebCore::ErrorEvent::error):
1448         (WebCore::ErrorEvent::trySerializeError):
1449         Align the implementation to PushStateEvent::trySerializeState.
1450
1451         * dom/ErrorEvent.h:
1452         * dom/ErrorEvent.idl:
1453
1454 2018-08-12  Aditya Keerthi  <akeerthi@apple.com>
1455
1456         [macOS] Color wells should appear pressed when presenting a color picker
1457         https://bugs.webkit.org/show_bug.cgi?id=188477
1458
1459         Reviewed by Tim Horton.
1460
1461         Currently, when clicking on a color well, the color well loses its pressed
1462         appearance once the mouse is lifted. Because of this behavior, the color well
1463         does not appear to be active when the color picker is displayed.
1464
1465         Added the color-well -webkit-appearance value to control the drawing of the color
1466         well separate from other buttons. Also added a new ControlState, named
1467         PresentingState. A control can be in this state whenever it is presenting some
1468         attached view. In the case of the color well this is the color picker. The
1469         Information as to whether a form control is in the presenting state comes from
1470         isPresentingAttachedView() in HTMLInputElement.
1471
1472         * css/CSSPrimitiveValueMappings.h:
1473         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1474         * css/CSSProperties.json:
1475         * css/CSSValueKeywords.in:
1476         * css/html.css:
1477         (input[type="color"]::-webkit-color-swatch):
1478         * html/ColorInputType.cpp:
1479         (WebCore::ColorInputType::isPresentingAttachedView const):
1480         (WebCore::ColorInputType::elementDidBlur):
1481         (WebCore::ColorInputType::didEndChooser):
1482         * html/ColorInputType.h:
1483         * html/HTMLInputElement.cpp:
1484         (WebCore::HTMLInputElement::isPresentingAttachedView const):
1485         * html/HTMLInputElement.h:
1486         * html/InputType.cpp:
1487         (WebCore::InputType::isPresentingAttachedView const):
1488         * html/InputType.h:
1489         * platform/ControlStates.h:
1490         * platform/ThemeTypes.h:
1491         * platform/mac/ThemeMac.mm:
1492         (WebCore::updateStates):
1493         (WebCore::setUpButtonCell):
1494         (WebCore::paintColorWell):
1495         (WebCore::ThemeMac::minimumControlSize const):
1496         (WebCore::ThemeMac::controlBorder const):
1497         (WebCore::ThemeMac::paint):
1498         * rendering/RenderTheme.cpp:
1499         (WebCore::RenderTheme::adjustStyle):
1500         (WebCore::RenderTheme::paint):
1501         (WebCore::RenderTheme::paintBorderOnly):
1502         (WebCore::RenderTheme::paintDecorations):
1503         (WebCore::RenderTheme::isControlStyled const):
1504         (WebCore::RenderTheme::extractControlStatesForRenderer const):
1505         (WebCore::RenderTheme::isPresenting const):
1506         * rendering/RenderTheme.h:
1507         * rendering/RenderThemeMac.mm:
1508         (WebCore::RenderThemeMac::adjustRepaintRect):
1509
1510 2018-08-12  Zalan Bujtas  <zalan@apple.com>
1511
1512         [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent.
1513         https://bugs.webkit.org/show_bug.cgi?id=188487
1514
1515         Reviewed by Antti Koivisto.
1516
1517         Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin.html
1518
1519         * layout/blockformatting/BlockMarginCollapse.cpp:
1520         (WebCore::Layout::isMarginTopCollapsedWithParent):
1521         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
1522
1523 2018-08-10  Antti Koivisto  <antti@apple.com>
1524
1525         Use OptionSet for various RenderLayer flags
1526         https://bugs.webkit.org/show_bug.cgi?id=188472
1527         <rdar://problem/43153059>
1528
1529         Followup, fix some mistakes.
1530
1531         * rendering/RenderLayer.cpp:
1532         (WebCore::RenderLayer::calculateClipRects const):
1533         * rendering/RenderLayerBacking.cpp:
1534         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1535
1536 2018-08-10  Ryosuke Niwa  <rniwa@webkit.org>
1537
1538         [macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime
1539         https://bugs.webkit.org/show_bug.cgi?id=188480
1540
1541         Reviewed by Simon Fraser.
1542
1543         Suppress the release assert in WebKit1 on macOS (isInWebProcess is always true in non-Cocoa platforms).
1544
1545         In the future, we should consider throwing Objective-C exceptions when third party apps call WebKit1
1546         or WebKit2 APIs in non-main threads.
1547
1548         * platform/Timer.cpp:
1549         (WebCore::shouldSuppressThreadSafetyCheck): Extracted out of ~TimerBase and setNextFireTime.
1550         (WebCore::TimerBase::~TimerBase):
1551         (WebCore::TimerBase::setNextFireTime):
1552
1553 2018-08-10  Daniel Bates  <dabates@apple.com>
1554
1555         Cleanup: Remove unnecessary code to resume animations from CachedFrameBase::restore()
1556         https://bugs.webkit.org/show_bug.cgi?id=188459
1557
1558         Reviewed by Chris Dumez.
1559
1560         It is unnessary for CachedFrameBase::restore() to explicitly resume animations on the
1561         document as it calls Document::resume(), which already does this.
1562
1563         No functionality changed. So, no new tests.
1564
1565         * history/CachedFrame.cpp:
1566         (WebCore::CachedFrameBase::restore):
1567
1568 2018-08-10  Antti Koivisto  <antti@apple.com>
1569
1570         Use OptionSet for various RenderLayer flags
1571         https://bugs.webkit.org/show_bug.cgi?id=188472
1572
1573         Reviewed by Simon Fraser.
1574
1575         Typesafe flags.
1576
1577         * html/shadow/MediaControlElements.cpp:
1578         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
1579         * page/FrameView.cpp:
1580         (WebCore::updateLayerPositionFlags):
1581         (WebCore::FrameView::paintContents):
1582         * rendering/RenderLayer.cpp:
1583         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
1584         (WebCore::RenderLayer::updateLayerPositions):
1585         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
1586         (WebCore::RenderLayer::paint):
1587         (WebCore::paintForFixedRootBackground):
1588         (WebCore::RenderLayer::paintLayer):
1589         (WebCore::RenderLayer::paintLayerContentsAndReflection):
1590         (WebCore::RenderLayer::filterPainter const):
1591         (WebCore::RenderLayer::hasFilterThatIsPainting const):
1592         (WebCore::RenderLayer::setupFilters):
1593         (WebCore::RenderLayer::paintLayerContents):
1594         (RenderLayer::paintLayerByApplyingTransform):
1595         (RenderLayer::paintList):
1596         (RenderLayer::updatePaintingInfoForFragments):
1597         (RenderLayer::paintTransformedLayerIntoFragments):
1598         (RenderLayer::calculateClipRects const):
1599         (WebCore::RenderLayer::paintLayerByApplyingTransform): Deleted.
1600         (WebCore::RenderLayer::paintList): Deleted.
1601         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree const): Deleted.
1602         (WebCore::RenderLayer::collectFragments): Deleted.
1603         (WebCore::RenderLayer::updatePaintingInfoForFragments): Deleted.
1604         (WebCore::RenderLayer::paintTransformedLayerIntoFragments): Deleted.
1605         (WebCore::RenderLayer::paintBackgroundForFragments): Deleted.
1606         (WebCore::RenderLayer::paintForegroundForFragments): Deleted.
1607         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): Deleted.
1608         (WebCore::RenderLayer::paintOutlineForFragments): Deleted.
1609         (WebCore::RenderLayer::paintMaskForFragments): Deleted.
1610         (WebCore::RenderLayer::paintChildClippingMaskForFragments): Deleted.
1611         (WebCore::RenderLayer::paintOverflowControlsForFragments): Deleted.
1612         (WebCore::RenderLayer::hitTest): Deleted.
1613         (WebCore::RenderLayer::enclosingElement const): Deleted.
1614         (WebCore::RenderLayer::enclosingFragmentedFlowAncestor const): Deleted.
1615         (WebCore::computeZOffset): Deleted.
1616         (WebCore::RenderLayer::createLocalTransformState const): Deleted.
1617         (WebCore::isHitCandidate): Deleted.
1618         (WebCore::RenderLayer::hitTestLayer): Deleted.
1619         (WebCore::RenderLayer::hitTestContentsForFragments const): Deleted.
1620         (WebCore::RenderLayer::hitTestResizerInFragments const): Deleted.
1621         (WebCore::RenderLayer::hitTestTransformedLayerInFragments): Deleted.
1622         (WebCore::RenderLayer::hitTestLayerByApplyingTransform): Deleted.
1623         (WebCore::RenderLayer::hitTestContents const): Deleted.
1624         (WebCore::RenderLayer::hitTestList): Deleted.
1625         (WebCore::RenderLayer::updateClipRects): Deleted.
1626         (WebCore::RenderLayer::clipRects const): Deleted.
1627         (WebCore::RenderLayer::calculateClipRects const): Deleted.
1628         (WebCore::showLayerTree): Deleted.
1629         * rendering/RenderLayer.h:
1630         * rendering/RenderLayerBacking.cpp:
1631         (WebCore::RenderLayerBacking::updateCompositedBounds):
1632         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1633         (WebCore::RenderLayerBacking::paintIntoLayer):
1634         * rendering/RenderLayerBacking.h:
1635         * rendering/RenderLayerCompositor.cpp:
1636         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
1637         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
1638         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1639         * rendering/RenderLayerCompositor.h:
1640         * rendering/RenderReplica.cpp:
1641         (WebCore::RenderReplica::paint):
1642
1643 2018-08-10  Sihui Liu  <sihui_liu@apple.com>
1644
1645         CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose
1646         https://bugs.webkit.org/show_bug.cgi?id=188461
1647         <rdar://problem/33555052>
1648
1649         Reviewed by Chris Dumez.
1650
1651         When we try to schedule shutdown for database, we should cancel the timer so no 
1652         scheduleShutdownForClose will be running after this.
1653
1654         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1655         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
1656
1657 2018-08-10  Daniel Bates  <dabates@apple.com>
1658
1659         Once <object> is hidden, its content won't be displayed again if its URL has fragment identifier ("#").
1660         https://bugs.webkit.org/show_bug.cgi?id=187990
1661
1662         Reviewed by Simon Fraser.
1663
1664         Fixes an issue where an HTML object element that behaves like an iframe and references a resource
1665         whose URL contains a fragment would not be repainted when its CSS display property changes. 
1666
1667         Rendering of an <object> that behaves like an iframe is handled by a widget (FrameView). When
1668         the CSS display property for an <object> is set to "none" we detach the widget from its renderer
1669         as part of destroying the render tree for the <object>. Subsequently changing the CSS display
1670         to a non-"none"/"contents" value will create a new renderer for <object> R. For an <object> that
1671         behaves like an iframe, we navigate to the resource associated with the <object> reusing the
1672         existing Frame F object created when we first displayed the <object>. Unlike the case where
1673         the URL of the resource does not contain a fragment, navigating to a fragment in the same document
1674         uses a different code path that does not re-associate the FrameView of F with R before it scrolls
1675         the view; => the FrameView of F is not in the view hierarchy. Therefore we do not paint anything
1676         for the content of the <object> and hence the scroll is not observable. Instead we need to ensure
1677         that the FrameView of F installed in the view hierarchy when navigating to an anchor in the same
1678         document.
1679
1680         As a side benefit of this fix we now also repaint an <object> that is programmatically navigated
1681         to a different anchor in the same document.
1682
1683         Tests: fast/repaint/object-as-iframe-hide-and-show-document-at-anchor.html
1684                fast/repaint/object-as-iframe-navigate-to-same-document-anchor-repaint.html
1685
1686         * loader/FrameLoader.cpp:
1687         (WebCore::FrameLoader::loadInSameDocument):
1688
1689 2018-08-10  Ali Juma  <ajuma@chromium.org>
1690
1691         [IntersectionObserver] Implement rootMargin parsing
1692         https://bugs.webkit.org/show_bug.cgi?id=188469
1693
1694         Reviewed by Darin Adler.
1695
1696         Parse IntersectionObserver's rootMargin argument and throw an exception if it's invalid.
1697         Change the stored rootMargin from a String to a LengthBox so that future patches can
1698         use this value in intersection logic.
1699
1700         Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-attributes.html
1701                    imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html
1702                    intersection-observer/intersection-observer-interface.html
1703
1704         * page/IntersectionObserver.cpp:
1705         (WebCore::parseRootMargin):
1706         (WebCore::IntersectionObserver::create):
1707         (WebCore::IntersectionObserver::IntersectionObserver):
1708         (WebCore::IntersectionObserver::rootMargin const):
1709         * page/IntersectionObserver.h:
1710         (WebCore::IntersectionObserver::create): Deleted.
1711         (WebCore::IntersectionObserver::rootMargin const): Deleted.
1712         * page/IntersectionObserver.idl:
1713
1714 2018-08-09  Ben Richards  <benton_richards@apple.com>
1715
1716         We should cache the compiled sandbox profile in a data vault
1717         https://bugs.webkit.org/show_bug.cgi?id=184991
1718
1719         Reviewed by Ryosuke Niwa.
1720
1721         Added functionality to FileHandle so that it can lock a file while open.
1722         Added a function to FileSystem to delete non empty directories.
1723
1724         * platform/FileHandle.cpp:
1725         (WebCore::FileHandle::FileHandle):
1726         (WebCore::FileHandle::open):
1727         (WebCore::FileHandle::close):
1728         * platform/FileHandle.h:
1729         * platform/FileSystem.h:
1730         * platform/cocoa/FileSystemCocoa.mm:
1731         (WebCore::FileSystem::deleteNonEmptyDirectory):
1732
1733 2018-08-09  Chris Dumez  <cdumez@apple.com>
1734
1735         InputType should not interact with an HTMLInputElement is no longer associated with
1736         https://bugs.webkit.org/show_bug.cgi?id=188410
1737
1738         Reviewed by Ryosuke Niwa.
1739
1740         Clear InputType::m_element when the InputType is no longer associated with the HTMLInputElement
1741         because the element changed type. We were already dealing with the InputType no longer being
1742         associated with an element because the element died by using a WeakPtr. However, it is conceptually
1743         better (more correct) to also clear this pointer if the element is still alive but associated with
1744         another InputType.
1745
1746         * html/HTMLInputElement.cpp:
1747         (WebCore::HTMLInputElement::updateType):
1748         * html/InputType.h:
1749         (WebCore::InputType::detachFromElement):
1750
1751 2018-08-09  Jer Noble  <jer.noble@apple.com>
1752
1753         Video playback is using more power
1754         https://bugs.webkit.org/show_bug.cgi?id=188452
1755         <rdar://problem/42298937>
1756
1757         Reviewed by Eric Carlson.
1758
1759         Test: TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm
1760
1761         When the meaning of PlatformMediaSession::Video changed to "video-only", we failed to update
1762         MediaSessionManagerCocoa::updateSessionState() to use the new PlatformMediaSession::VideoAudio
1763         enum, so Video-only sessions were getting the higher audio buffer size (where it's not needed)
1764         and Video-and-Audio sessions were getting the default value.
1765
1766         To enable testing, add a preferredAudioBufferSize property to Internals. Also, the getter for
1767         AudioSession::preferredBufferSize was using the wrong CoreAudio property address, and was
1768         always returning 0.
1769
1770         * platform/audio/AudioSession.h:
1771         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
1772         (MediaSessionManagerCocoa::updateSessionState):
1773         * platform/audio/mac/AudioSessionMac.cpp:
1774         (WebCore::AudioSession::preferredBufferSize const):
1775         * testing/Internals.cpp:
1776         (WebCore::Internals::preferredAudioBufferSize const):
1777         * testing/Internals.h:
1778         * testing/Internals.idl:
1779
1780 2018-08-09  Saam Barati  <sbarati@apple.com>
1781
1782         memoryFootprint should return size_t not optional<size_t>
1783         https://bugs.webkit.org/show_bug.cgi?id=188444
1784
1785         Reviewed by Simon Fraser.
1786
1787         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1788         (WebCore::ResourceUsageOverlay::platformDraw):
1789
1790 2018-08-09  Ali Juma  <ajuma@chromium.org>
1791
1792         Update IDL for IntersectionObserverEntry and IntersectionObserverEntryInit
1793         https://bugs.webkit.org/show_bug.cgi?id=188445
1794
1795         Reviewed by Simon Fraser.
1796
1797         Update IntersectionObserverEntry by making rootBounds nullable, and adding an
1798         isIntersecting attribute. Make the same changes to IntersectionObserverEntryInit,
1799         and also add an intersectionRatio attribute.
1800
1801         Tested by intersection-observer/intersection-observer-entry-interface.html
1802
1803         * page/IntersectionObserverEntry.cpp:
1804         (WebCore::IntersectionObserverEntry::IntersectionObserverEntry):
1805         * page/IntersectionObserverEntry.h:
1806         (WebCore::IntersectionObserverEntry::isIntersecting const):
1807         * page/IntersectionObserverEntry.idl:
1808
1809 2018-08-09  Charlie Turner  <cturner@igalia.com>
1810
1811         Fix copyright headers on new ISO parsing class
1812         https://bugs.webkit.org/show_bug.cgi?id=188432
1813
1814         Unreviewed fix.
1815
1816         This was left off from a previous bug by mistake, retrospectively
1817         adding the correct copyright headers.
1818
1819         No tests required.
1820
1821         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
1822         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
1823
1824 2018-08-08  Ross Kirsling  <ross.kirsling@sony.com>
1825
1826         run-bindings-tests is not Win32-compatible
1827         https://bugs.webkit.org/show_bug.cgi?id=188424
1828
1829         Reviewed by Fujii Hironori.
1830
1831         * bindings/scripts/preprocessor.pm:
1832         (applyPreprocessor):
1833         Ensure that we fall back to cl.exe if CC env var is not set on Windows.
1834
1835 2018-08-08  Ryosuke Niwa  <rniwa@webkit.org>
1836
1837         REGRESSION (r228260): Events handled by input method invoke default event handler
1838         https://bugs.webkit.org/show_bug.cgi?id=188370
1839
1840         Reviewed by Wenson Hsieh.
1841
1842         The bug was caused by the default event handler being invoked for the "virtual" keydown events
1843         generated for input methods. Namely, when Japanese or Chinese input methods swallows TAB key,
1844         WebKit should not invoke the default event handler and move the focus during input composition.
1845
1846         Fixed the bug by adding a new boolean on Event indicating whether the default event handler
1847         should be invoked, and restoring the behavior prior to r228260 for these virtual keydown events.
1848
1849         Test: editing/input/press-tab-during-ime-composition.html
1850
1851         * dom/Event.h:
1852         (WebCore::Event::isDefaultEventHandlerIgnored const): Added.
1853         (WebCore::Event::setIsDefaultEventHandlerIgnored): Added.
1854         * dom/EventDispatcher.cpp:
1855         (WebCore::EventDispatcher::dispatchEvent): Don't invoke the default event handler if
1856         isDefaultEventHandlerIgnored is set.
1857         * page/EventHandler.cpp:
1858         (WebCore::EventHandler::internalKeyEvent): Set isDefaultEventHandlerIgnored. This restores WebKit's
1859         behavior prior to r228260.
1860
1861 2018-08-08  Justin Fan  <justin_fan@apple.com>
1862
1863         Prevent collectScreenProperties from crashing Base System
1864         https://bugs.webkit.org/show_bug.cgi?id=188429
1865         <rdar://problem/43075662>
1866
1867         Reviewed by Simon Fraser.
1868
1869         Adding some error-checking and early returns to further prevent calling CGLDescribeRenderer with invalid parameters.
1870
1871         Existing WebGL tests should cover; no expected change in behavior. Crash happened primarily on Base System.
1872
1873         * platform/mac/PlatformScreenMac.mm:
1874         (WebCore::gpuIDForDisplayMask):
1875
1876 2018-08-08  Don Olmstead  <don.olmstead@sony.com>
1877
1878         [Curl] Surface additional NetworkLoadMetrics
1879         https://bugs.webkit.org/show_bug.cgi?id=188391
1880
1881         Reviewed by Joseph Pecoraro.
1882
1883         * platform/network/curl/CurlContext.cpp:
1884         (WebCore::CurlHandle::getNetworkLoadMetrics):
1885
1886 2018-08-08  Don Olmstead  <don.olmstead@sony.com>
1887
1888         [Nicosia] Add the Nicosia-specific PlatformLayer type alias
1889         https://bugs.webkit.org/show_bug.cgi?id=188405
1890         <rdar://problem/43039520>
1891
1892         Unreviewed build fix.
1893
1894         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
1895
1896 2018-08-08  Simon Fraser  <simon.fraser@apple.com>
1897
1898         Add a WebKit2 logging channel for ActivityState
1899         https://bugs.webkit.org/show_bug.cgi?id=188411
1900
1901         Reviewed by Tim Horton.
1902
1903         Add logging for ActivityState changes and the entrypoints that affect ActivityState.
1904         
1905         * Sources.txt:
1906         * WebCore.xcodeproj/project.pbxproj:
1907         * page/ActivityState.cpp: Added.
1908         (WebCore::activityStateFlagsToString):
1909         * page/ActivityState.h:
1910
1911 2018-08-08  Eric Carlson  <eric.carlson@apple.com>
1912
1913         Add LogArgument template for PlatformMediaSession::RemoteControlCommandType
1914         https://bugs.webkit.org/show_bug.cgi?id=188314
1915
1916         Reviewed by Alex Christensen.
1917
1918         * html/HTMLMediaElement.cpp:
1919         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Don't coerce to int for logging.
1920
1921         * platform/audio/PlatformMediaSession.cpp:
1922         (WebCore::convertEnumerationToString): New.
1923         (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Log command.
1924         * platform/audio/PlatformMediaSession.h:
1925         (WTF::LogArgument<WebCore::PlatformMediaSession::RemoteControlCommandType>::toString):
1926
1927 2018-08-08  Joseph Pecoraro  <pecoraro@apple.com>
1928
1929         Web Inspector: XHR content sometimes shows as error even though load succeeded
1930         https://bugs.webkit.org/show_bug.cgi?id=188385
1931         <rdar://problem/42646160>
1932
1933         Reviewed by Devin Rousso.
1934
1935         * inspector/agents/InspectorNetworkAgent.cpp:
1936         (WebCore::InspectorNetworkAgent::didReceiveData):
1937         Avoid a double hash lookup in the common case.
1938         Allow synchronous XHR to have text data appended in the normal case.
1939         Allow synchronous XHR to set base64 encoded data right here for non-text data.
1940
1941         * inspector/NetworkResourcesData.h:
1942         (WebCore::NetworkResourcesData::ResourceData::hasBufferedData const):
1943         Getter to see if data is buffered or not for this resource.
1944
1945         * inspector/NetworkResourcesData.cpp:
1946         (WebCore::NetworkResourcesData::maybeAddResourceData):
1947         Return the updated ResourceData to avoid clients having to do a lookup.
1948
1949 2018-08-08  Sihui Liu  <sihui_liu@apple.com>
1950
1951         Assertion failed in Webcore::Process::setIdentifier()
1952         https://bugs.webkit.org/show_bug.cgi?id=188404
1953         <rdar://problem/43029137>
1954
1955         Reviewed by Chris Dumez.
1956
1957         App using both WebKit1 and WebKit may crash in WebKit initialization.
1958
1959         * platform/Process.cpp:
1960         (WebCore::Process::setIdentifier):
1961
1962 2018-08-08  Charlie Turner  <cturner@igalia.com>
1963
1964         Add CENC sanitization
1965         https://bugs.webkit.org/show_bug.cgi?id=188376
1966
1967         Reviewed by Xabier Rodriguez-Calvar.
1968
1969         This patch adds support for sanitizing the CENC initialization
1970         data, to ensure there are no obviously bogus values in the
1971         untrusted input from generateRequest, see
1972         https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest
1973         for more details on sanitization.
1974
1975         Tested by imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
1976
1977         * Modules/encryptedmedia/InitDataRegistry.cpp: The diff looks a
1978         bit wonky because I had to reorder extractKeyIDsCenc to come
1979         before sanitizeCenc.
1980         (WebCore::extractKeyIDsCenc): Added implementation, a nullopt
1981         return value here indicates the parsing found an error in the box
1982         values.
1983         (WebCore::sanitizeCenc): Added implementation, if the box can be
1984         parsed, return a copy of the buffer as before, otherwise an error
1985         value.
1986         * Sources.txt: Add the new PSSH box type.
1987         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
1988         Added, parsing methods come from ISO/IEC 23001-7-2016 Section
1989         8.1.1.
1990         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse): Ditto.
1991         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h: Ditto.
1992         (WebCore::ISOProtectionSystemSpecificHeaderBox::boxTypeName): Ditto.
1993         (WebCore::ISOProtectionSystemSpecificHeaderBox::systemID const): Ditto.
1994         (WebCore::ISOProtectionSystemSpecificHeaderBox::keyIDs const):
1995         Ditto.
1996         (WebCore::ISOProtectionSystemSpecificHeaderBox::data const): Ditto.
1997
1998 2018-08-08  Zan Dobersek  <zdobersek@igalia.com>
1999
2000         [Nicosia] Add the Nicosia-specific PlatformLayer type alias
2001         https://bugs.webkit.org/show_bug.cgi?id=188405
2002
2003         Reviewed by Carlos Garcia Campos.
2004
2005         Add a Nicosia-specific PlatformLayer type alias that points to the
2006         Nicosia::PlatformLayer type. This is guarded by the USE(NICOSIA) macro,
2007         which guards additional code in this patch but will be added to other
2008         Nicosia-specific classes later.
2009
2010         To keep things buildable when USE(NICOSIA) is defined, additional
2011         changes are made to classes that operate with platform layers.
2012         Cairo-specific ImageBuffer implementation and the related
2013         ImageBufferData class are modified to work with a Nicosia::ContentLayer
2014         object. This object is using the TextureMapper-specific Impl class which
2015         internally keeps a TextureMapperPlatformLayerProxy object. This way
2016         we can reuse existing code that also works with an object of this type,
2017         only difference is where the proxy object is kept. Main difference is in
2018         the ImageBuffer::platformLayer() method, where pointer to the
2019         Nicosia::ContentLayer object is returned when USE(NICOSIA) is enabled.
2020
2021         Similar approach is taked for the MediaPlayerPrivateGStreamerBase class.
2022         When USE(NICOSIA) is enabled, a Nicosia::ContentLayer object is
2023         constructed, and with the TextureMapper-specific Impl we again operate
2024         on the TextureMapperPlatformLayerProxy object like before, so all of
2025         the proxy-specific code is bundled into helper lambdas that operate on
2026         the given proxy object. In the platformLayer() method, we again return
2027         pointer to the Nicosia::ContentLayer object when USE(NICOSIA) is on.
2028
2029         For the GraphicsContext3D integration, we have to provide a separate
2030         class that replicates most of the functionality currently present in the
2031         TextureMapperGC3DPlatformLayer class. Main difference is that in the new
2032         Nicosia::GC3DLayer class, a Nicosia::ContentLayer object is spawned with
2033         the TextureMapper-specific Impl. The proxy object held by that Impl is
2034         then again used to push new buffers into the rendering pipeline. As
2035         before, pointer to the Nicosia::ContentLayer is returned in the
2036         GraphicsContext3D::platformLayer() object.
2037
2038         Integration of the GraphicsContext3D class into Nicosia layering needs
2039         further work in the future. Target should be providing a class that is
2040         not specific to the TextureMapper layer. Additionally, when USE(NICOSIA)
2041         is enabled, we remove the TextureMapperGC3DPlatformLayer class from
2042         compilation since it depends on a PlatformLayer type alias to the
2043         TextureMapperPlatformLayerProxyProvider class.
2044
2045         This patch also doesn't address the abundance of macros that this code
2046         now uses. While USE(NICOSIA) is introduced, we have to work around
2047         four additional macros in this code: USE(TEXTURE_MAPPER),
2048         USE(TEXTURE_MAPPER_GL), USE(COORDINATED_GRAPHICS) and
2049         USE(COORDINATED_GRAPHICS_THREADED). In a lot of places these are used
2050         interchangeably, but they should be merged and simplified in use. I hope
2051         to approach this once the USE(NICOSIA) functionality lands and is turned
2052         on for ports that currently build with USE(COORDINATED_GRAPHICS).
2053
2054         * platform/TextureMapper.cmake:
2055         * platform/graphics/GraphicsContext3D.h:
2056         * platform/graphics/PlatformLayer.h:
2057         * platform/graphics/cairo/ImageBufferCairo.cpp:
2058         (WebCore::ImageBufferData::ImageBufferData):
2059         (WebCore::ImageBufferData::~ImageBufferData):
2060         (WebCore::ImageBufferData::swapBuffersIfNeeded):
2061         (WebCore::ImageBuffer::platformLayer const):
2062         * platform/graphics/cairo/ImageBufferDataCairo.h:
2063         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2064         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2065         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2066         (WebCore::MediaPlayerPrivateGStreamerBase::platformLayer const):
2067         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
2068         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2069         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2070         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2071         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2072         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp: Added.
2073         (Nicosia::GC3DLayer::GC3DLayer):
2074         (Nicosia::GC3DLayer::~GC3DLayer):
2075         (Nicosia::GC3DLayer::makeContextCurrent):
2076         (Nicosia::GC3DLayer::platformContext):
2077         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
2078         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.h: Added.
2079         (Nicosia::GC3DLayer::contentLayer const):
2080         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
2081         (WebCore::GraphicsContext3D::GraphicsContext3D):
2082         (WebCore::GraphicsContext3D::makeContextCurrent):
2083         (WebCore::GraphicsContext3D::platformGraphicsContext3D):
2084         (WebCore::GraphicsContext3D::platformLayer const):
2085         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
2086         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
2087         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2088         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
2089         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
2090         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
2091
2092 2018-08-08  Manuel Rego Casasnovas  <rego@igalia.com>
2093
2094         [css-grid] Update behavior of percentage row tracks and gutters
2095         https://bugs.webkit.org/show_bug.cgi?id=188403
2096
2097         Reviewed by Sergio Villar Senin.
2098
2099         The CSSWG decided to change how percentage row tracks and gutters
2100         in a grid container with indefinite height are resolved.
2101
2102         The CSSWG issues are:
2103         - https://github.com/w3c/csswg-drafts/issues/1921
2104         - https://github.com/w3c/csswg-drafts/issues/509
2105
2106         So far they were resolved as "auto", like it happens with
2107         percentage heights in regular blocks. But now they're going to behave
2108         similar to what happens in the columns axis, they would be ignored
2109         to compute the intrinsic height.
2110         This causes that we need to repeat the track sizing algorithm
2111         when we have a grid container with indefinite height
2112         that has some percentage rows using the intrinsic height
2113         calculated on the first pass. Then the percentages will be resolved
2114         against the intrinsic height.
2115
2116         Tests: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-second-pass-001.html
2117                imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-second-pass-002.html
2118                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-percentage-rows-indefinite-height-001.html
2119                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-percentage-rows-indefinite-height-002.html
2120
2121         * rendering/GridTrackSizingAlgorithm.cpp:
2122         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
2123         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
2124         (WebCore::GridTrackSizingAlgorithm::setup):
2125         (WebCore::GridTrackSizingAlgorithm::reset):
2126         * rendering/GridTrackSizingAlgorithm.h:
2127         * rendering/RenderGrid.cpp:
2128         (WebCore::RenderGrid::availableSpaceForGutters const):
2129         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
2130         (WebCore::RenderGrid::layoutBlock):
2131
2132 2018-08-07  Saam Barati  <sbarati@apple.com>
2133
2134         ResourceUsageOverlay should use physical footprint for its "Footprint" label
2135         https://bugs.webkit.org/show_bug.cgi?id=188395
2136
2137         Reviewed by Simon Fraser.
2138
2139         Let's use physical footprint on Cocoa for the number we say is "footprint".
2140         Before, we were just using the number of dirty pages multiplies by
2141         page size. This number was an upper bound on footprint since it
2142         doesn't take into account compressed memory.
2143
2144         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2145         (WebCore::ResourceUsageOverlay::platformDraw):
2146
2147 2018-08-05  Darin Adler  <darin@apple.com>
2148
2149         [Cocoa] More tweaks and refactoring to prepare for ARC
2150         https://bugs.webkit.org/show_bug.cgi?id=188245
2151
2152         Reviewed by Dan Bernstein.
2153
2154         * bridge/objc/objc_instance.mm: Updated include for rename: FoundationSPI.h -> objcSPI.h.
2155         * platform/ios/wak/WebCoreThread.mm: Ditto.
2156
2157 2018-08-07  Chris Dumez  <cdumez@apple.com>
2158
2159         navigator.sendBeacon does not work in pagehide callbacks
2160         https://bugs.webkit.org/show_bug.cgi?id=188329
2161
2162         Reviewed by Alex Christensen.
2163
2164         Add support for sending beacons from pagehide event handlers. We normally do not allow loads because we're
2165         about to enter PageCache. However, in case of Beacon, this is fine since it uses PingLoad and does not
2166         WebCore to do the load.
2167
2168         Test: http/wpt/beacon/sendBeacon-in-pagehide.html
2169
2170         * loader/cache/CachedResource.cpp:
2171         (WebCore::CachedResource::load):
2172         - Allow Beacon loads to go through even if the document's pageCacheState is AboutToEnterPageCache (i.e.
2173         we're firing the 'pagehide' event)
2174         - Allow Becon loads to go though even if the FrameLoader's state is provisional (i.e. a load is pending)
2175
2176 2018-08-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
2177
2178         Allow href attribute without xlink on SVG elements
2179         https://bugs.webkit.org/show_bug.cgi?id=153854
2180
2181         Reviewed by Dean Jackson.
2182
2183         SVG 2 has moved the href attribute from xlink namespace to svg namespace.
2184         Instead of using xlink:href, svg:href should be used or simply use href 
2185         if the svg namespace is defined.
2186
2187         See https://www.w3.org/TR/SVG2/linking.html#XLinkRefAttrs.
2188
2189         For backward compatibility, xlink:href will be treated as an alias to href
2190         till it is acceptable to completely remove the support for the deprecated 
2191         xlink:href.
2192
2193         Tests: svg/custom/href-svg-namespace-animate.svg
2194                svg/custom/href-svg-namespace-dynamic.svg
2195                svg/custom/href-svg-namespace-elements.html
2196                svg/custom/href-svg-namespace-expected.svg
2197                svg/custom/href-svg-namespace-static.svg
2198
2199         * dom/Element.cpp:
2200         (WebCore::Element::absoluteLinkURL const):
2201         * dom/Element.h:
2202         (WebCore::Element::getAttribute const): This new template function with
2203         template pack parameter QualifiedNames is added to return the first none
2204         empty attribute value given a set of attributes' names. This should be
2205         useful for deprecated attributes. When we decide to remove the support 
2206         for the deprecated attribute, all we need is to remove it as a parameter
2207         to getAttribute(). In this case, the none template function will be called.
2208         * dom/VisitedLinkState.cpp:
2209         (WebCore::linkAttribute):
2210         * html/parser/XSSAuditor.cpp:
2211         (WebCore::XSSAuditor::filterScriptToken):
2212         * svg/SVGAElement.cpp:
2213         (WebCore::SVGAElement::isURLAttribute const):
2214         * svg/SVGAltGlyphElement.cpp:
2215         (WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
2216         * svg/SVGCursorElement.cpp:
2217         * svg/SVGDocumentExtensions.cpp:
2218         (WebCore::SVGDocumentExtensions::rebuildElements):
2219         (WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget):
2220         * svg/SVGElement.cpp:
2221         (WebCore::SVGElement::animatableAttributeForName):
2222         * svg/SVGFEImageElement.cpp:
2223         * svg/SVGFilterElement.cpp:
2224         * svg/SVGFontFaceUriElement.cpp:
2225         (WebCore::SVGFontFaceUriElement::srcValue const):
2226         (WebCore::SVGFontFaceUriElement::parseAttribute):
2227         (WebCore::SVGFontFaceUriElement::loadFont):
2228         * svg/SVGForeignObjectElement.cpp:
2229         * svg/SVGGlyphRefElement.cpp:
2230         (WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
2231         * svg/SVGGradientElement.cpp:
2232         * svg/SVGImageElement.cpp:
2233         (WebCore::SVGImageElement::imageSourceURL const):
2234         * svg/SVGMPathElement.cpp:
2235         * svg/SVGPatternElement.cpp:
2236         * svg/SVGScriptElement.h:
2237         * svg/SVGTRefElement.cpp:
2238         * svg/SVGTextPathElement.cpp:
2239         * svg/SVGURIReference.cpp:
2240         (WebCore::SVGURIReference::registerAttributes):
2241         (WebCore::SVGURIReference::parseAttribute):
2242         * svg/SVGUseElement.cpp:
2243         (WebCore::SVGUseElement::expandUseElementsInShadowTree const):
2244         * svg/animation/SVGSMILElement.cpp:
2245         (WebCore::SVGSMILElement::isSupportedAttribute):
2246         (WebCore::SVGSMILElement::svgAttributeChanged):
2247         * svg/svgattrs.in:
2248
2249 2018-08-07  Ryosuke Niwa  <rniwa@webkit.org>
2250
2251         document.open and document.write must throw while the HTML parser is synchronously constructing a custom element
2252         https://bugs.webkit.org/show_bug.cgi?id=187319
2253         <rdar://problem/42843012>
2254
2255         Reviewed by Frédéric Wang.
2256
2257         Make document.open, document.write, document.writeln, and document.close throw InvalidStateError during
2258         a synchronous custom element construction as specified:
2259         https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
2260         https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter
2261
2262         Tests: fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html
2263                fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html
2264
2265         * WebCore.xcodeproj/project.pbxproj:
2266         * dom/Document.cpp:
2267         (WebCore::Document::openForBindings): Throw InvalidStateError when m_throwOnDynamicMarkupInsertionCount is non-zero.
2268         (WebCore::Document::closeForBindings): Ditto.
2269         (WebCore::Document::write): Ditto.
2270         (WebCore::Document::writeln): Ditto.
2271         * dom/Document.h: Re-ordered the related instance variables in the order they appear in the spec, and updated spec URLs.
2272         * dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h: Added.
2273         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer): Added.
2274         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::ThrowOnDynamicMarkupInsertionCountIncrementer):
2275         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::~ThrowOnDynamicMarkupInsertionCountIncrementer):
2276         * html/parser/HTMLDocumentParser.cpp:
2277         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate ThrowOnDynamicMarkupInsertionCountIncrementer.
2278
2279 2018-08-07  Alex Christensen  <achristensen@webkit.org>
2280
2281         Use 1-byte enum class for Document::StandaloneStatus
2282         https://bugs.webkit.org/show_bug.cgi?id=188352
2283
2284         Reviewed by Chris Dumez.
2285
2286         * dom/Document.cpp:
2287         (WebCore::Document::setXMLStandalone):
2288         * dom/Document.h:
2289         (WebCore::Document::xmlStandalone const):
2290         * editing/MarkupAccumulator.cpp:
2291         (WebCore::MarkupAccumulator::appendXMLDeclaration):
2292
2293 2018-08-07  Rob Buis  <rbuis@igalia.com>
2294
2295         fetch() with subresource integrity crashes on zero length body
2296         https://bugs.webkit.org/show_bug.cgi?id=184325
2297
2298         Reviewed by Alex Christensen.
2299
2300         Check that resourceBuffer() is non null before dereferencing.
2301
2302         Tests: http/tests/subresource-integrity/sri-fetch.js
2303                http/tests/subresource-integrity/sri-fetch-worker.js
2304
2305         * loader/DocumentThreadableLoader.cpp:
2306         (WebCore::DocumentThreadableLoader::didFinishLoading):
2307
2308 2018-08-07  Justin Fan  <justin_fan@apple.com>
2309
2310         Prevent querying for renderer info for disconnected or uninitialized displays
2311         https://bugs.webkit.org/show_bug.cgi?id=188387
2312         <rdar://problem/42588769>
2313
2314         Reviewed by Simon Fraser.
2315
2316         Calling CGL functions with a NULL displayMask crashes the process.
2317
2318         No tests; requires multiple displays.
2319
2320         * platform/mac/PlatformScreenMac.mm:
2321         (WebCore::collectScreenProperties):
2322
2323 2018-08-06  Ryosuke Niwa  <rniwa@webkit.org>
2324
2325         document.open and document.write must throw while the HTML parser is synchronously constructing a custom element
2326         https://bugs.webkit.org/show_bug.cgi?id=187319
2327         <rdar://problem/42843012>
2328
2329         Reviewed by Frédéric Wang.
2330
2331         Make document.open, document.write, document.writeln, and document.close throw InvalidStateError during
2332         a synchronous custom element construction as specified:
2333         https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
2334         https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter
2335
2336         Tests: fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html
2337                fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html
2338
2339         * WebCore.xcodeproj/project.pbxproj:
2340         * dom/Document.cpp:
2341         (WebCore::Document::openForBindings): Throw InvalidStateError when m_throwOnDynamicMarkupInsertionCount is non-zero.
2342         (WebCore::Document::closeForBindings): Ditto.
2343         (WebCore::Document::write): Ditto.
2344         (WebCore::Document::writeln): Ditto.
2345         * dom/Document.h: Re-ordered the related instance variables in the order they appear in the spec, and updated spec URLs.
2346         * dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h: Added.
2347         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer): Added.
2348         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::ThrowOnDynamicMarkupInsertionCountIncrementer):
2349         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::~ThrowOnDynamicMarkupInsertionCountIncrementer):
2350         * html/parser/HTMLDocumentParser.cpp:
2351         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate ThrowOnDynamicMarkupInsertionCountIncrementer.
2352
2353 2018-08-07  Ryan Haddad  <ryanhaddad@apple.com>
2354
2355         Unreviewed, suppress warnings to fix the build.
2356
2357         * crypto/CommonCryptoUtilities.cpp:
2358         (WebCore::getCommonCryptoDigestAlgorithm):
2359
2360 2018-08-07  Alex Christensen  <achristensen@webkit.org>
2361
2362         Removed unused *AllInOne.cpp
2363         https://bugs.webkit.org/show_bug.cgi?id=188369
2364
2365         Reviewed by Yusuke Suzuki.
2366
2367         * accessibility/AccessibilityAllInOne.cpp: Removed.
2368         * bindings/js/JSBindingsAllInOne.cpp: Removed.
2369         * css/CSSAllInOne.cpp: Removed.
2370         * dom/DOMAllInOne.cpp: Removed.
2371         * editing/EditingAllInOne.cpp: Removed.
2372         * html/HTMLElementsAllInOne.cpp: Removed.
2373         * inspector/InspectorAllInOne.cpp: Removed.
2374         * loader/appcache/ApplicationCacheAllInOne.cpp: Removed.
2375         * mathml/MathMLAllInOne.cpp: Removed.
2376         * platform/text/TextAllInOne.cpp: Removed.
2377         * rendering/RenderingAllInOne.cpp: Removed.
2378         * rendering/style/StyleAllInOne.cpp: Removed.
2379         * rendering/svg/RenderSVGAllInOne.cpp: Removed.
2380         * svg/SVGAllInOne.cpp: Removed.
2381
2382 2018-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2383
2384         [WPE][GTK] Handle some virtual keys commonly used on TVs
2385         https://bugs.webkit.org/show_bug.cgi?id=188375
2386
2387         Reviewed by Žan Doberšek.
2388
2389         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2390         (WebCore::PlatformKeyboardEvent::keyValueForGdkKeyCode):
2391         (WebCore::PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode):
2392         * platform/wpe/PlatformKeyboardEventWPE.cpp:
2393         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
2394         (WebCore::PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode):
2395
2396 2018-08-07  Zan Dobersek  <zdobersek@igalia.com>
2397
2398         [Nicosia] Add Nicosia::CompositionLayerTextureMapperImpl
2399         https://bugs.webkit.org/show_bug.cgi?id=188348
2400
2401         Reviewed by Carlos Garcia Campos.
2402
2403         Add the Nicosia::CompositionLayerTextureMapperImpl class, the
2404         TextureMapper-specific implementation that will extend the
2405         CompositionLayer class.
2406
2407         The important deatil of this implementation is the TextureMapperLayer
2408         object that's expected to be managed by the composition controller. As
2409         such, it is placed inside the CompositionState struct to clearly
2410         indicate its utility and expected place of management. In the current
2411         setup, this place would be the CoordinatedGraphicsScene class.
2412
2413         The Nicosia::CompositionLayer object that's spawned for each
2414         CoordinatedGraphicsLayer instance is now switched to using the
2415         CompositionLayerTextureMapperImpl object, with the local temporary no-op
2416         CompositionLayer::Impl class removed.
2417
2418         * platform/TextureMapper.cmake:
2419         * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp: Added.
2420         (Nicosia::CompositionLayerTextureMapperImpl::createFactory):
2421         * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h: Added.
2422         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2423         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
2424         (): Deleted.
2425
2426 2018-08-07  Zan Dobersek  <zdobersek@igalia.com>
2427
2428         [Nicosia] Add the TextureMapper-specific ContentLayer::Impl derivative
2429         https://bugs.webkit.org/show_bug.cgi?id=188344
2430
2431         Reviewed by Carlos Garcia Campos.
2432
2433         Add Nicosia::ContentLayerTextureMapperImpl class, providing the
2434         TextureMapper-specific implementation that derives from the
2435         ContentLayer::Impl class and which can be used by the
2436         Nicosia::ContentLayer instances.
2437
2438         Internally a TextureMapperPlatformLayerProxy is created, and is
2439         accessible to others through a getter. This way the content producers
2440         can push new buffers into this proxy object, and the scene compositor
2441         can take these buffers for display purposes.
2442
2443         Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded() will be
2444         called during layer flushes, and the call will cause the content layer
2445         clients to take their texture, wrap it into a buffer, and push it into
2446         the TextureMapperPlatformLayerProxy object. At the moment this operation
2447         is required by the ImageBuffer and GraphicsContext3D producers.
2448
2449         The Client object is managed under its own lock. While the producers
2450         will only live on the main thread, the thread-safe check in the
2451         destructor is necessary in case the ContentLayerTextureMapperImpl object
2452         ends up being destroyed on some other thread.
2453
2454         The patch only adds the class implementation. It will be integrated into
2455         the layer tree later, once all the other pieces of the puzzle land.
2456
2457         * platform/TextureMapper.cmake:
2458         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: Added.
2459         (Nicosia::ContentLayerTextureMapperImpl::createFactory):
2460         (Nicosia::ContentLayerTextureMapperImpl::ContentLayerTextureMapperImpl):
2461         (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl):
2462         (Nicosia::ContentLayerTextureMapperImpl::invalidateClient):
2463         (Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded):
2464         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h: Added.
2465
2466 2018-08-07  Frederic Wang  <fwang@igalia.com>
2467
2468         Make DOMWindow::scrollBy rely on DOMWindow::scrollTo
2469         https://bugs.webkit.org/show_bug.cgi?id=188343
2470
2471         Reviewed by Darin Adler.
2472
2473         This patch makes DOMWindow::scrollBy rely on DOMWindow::scrollTo in order to perform actual
2474         scrolling of the view. In particular, this reduces the number of code path to modify in order
2475         to implement the ScrollBehavior option (bug 188043). The only change is an optimization when
2476         scrolling to position (0, 0) but it is not observable.
2477
2478         No new tests, behavior unchanged and already tested.
2479
2480         * page/DOMWindow.cpp:
2481         (WebCore::DOMWindow::scrollBy const): Add the current view position to the scrollBy offset in
2482         order to obtain the scrollTo offset.
2483
2484 2018-08-04  Ryosuke Niwa  <rniwa@webkit.org>
2485
2486         Add CEReactions=NotNeeded for reactions only needed for customized builtins
2487         https://bugs.webkit.org/show_bug.cgi?id=187851
2488
2489         Reviewed by Chris Dumez.
2490
2491         Because WebKit doesn't and will not support customized builtin elements, there are many DOM APIs marked with
2492         [CEReactions] which don't actually need CustomElementReactionStack.
2493
2494         To clarify and document this difference, this patch introduces WebKit extention: [CEReactions=NotNeeded].
2495         When this IDL attribute is specified, we generate CustomElementReactionDisallowedScope in the bindings code
2496         to assert that there are no custom elements reactions being enqueued within the DOM API.
2497
2498         We suppress this assertion in CustomElementReactionStack since a DOM API with [CEReactions=NotNeeded] can
2499         synchronously fire an event and otherwise execute arbirary scripts, which in turn could invoke a DOM API
2500         with [CEReactions].
2501
2502         This patch deployes this change to HTMLIFrameElement since "src" IDL attribute triggers this second scenario.
2503
2504         Test: fast/custom-elements/custom-element-reaction-within-disallowed-scope.html
2505
2506         * bindings/scripts/CodeGeneratorJS.pm:
2507         (GeneratePut):
2508         (GeneratePutByIndex):
2509         (GenerateDefineOwnProperty):
2510         (GenerateDeletePropertyCommon):
2511         (GenerateAttributeSetterBodyDefinition):
2512         (GenerateCustomElementReactionsStackIfNeeded): Added. Generate CustomElementReactionStack for [CEReactions]
2513         and CustomElementReactionDisallowedScope for [CEReactions=NotNeeded].
2514         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2515         * bindings/scripts/test/TestCEReactions.idl: Added test cases for [CEReactions=NotNeeded].
2516         * bindings/scripts/test/TestCEReactionsStringifier.idl: Ditto.
2517         * dom/CustomElementReactionQueue.cpp:
2518         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Added an assertion to catch cases where
2519         a DOM API with [CEReactions=NotNeeded] enqueues a custom element reaction; i.e. cases where [CEReactions]
2520         should have been used.
2521         (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Ditto.
2522         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Ditto.
2523         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto.
2524         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Ditto.
2525         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto.
2526         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Ditto.
2527         * dom/CustomElementReactionQueue.h:
2528         (WebCore::CustomElementReactionDisallowedScope): Added. Enables the assertion in enqueue* functions above.
2529         (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): Added.
2530         (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): Added.
2531         (WebCore::CustomElementReactionDisallowedScope::isReactionAllowed): Added.
2532         (WebCore::CustomElementReactionDisallowedScope::AllowedScope): Added.
2533         (WebCore::CustomElementReactionDisallowedScope::AllowedScope::AllowedScope): Added.
2534         (WebCore::CustomElementReactionDisallowedScope::AllowedScope::~AllowedScope): Added.
2535         (WebCore::CustomElementReactionStack): Suppress the assertion. See above for why this is needed.
2536         * html/HTMLIFrameElement.idl:
2537
2538 2018-08-06  Simon Fraser  <simon.fraser@apple.com>
2539
2540         Clean up initialization of some RenderLayer members
2541         https://bugs.webkit.org/show_bug.cgi?id=188330
2542
2543         Reviewed by Dean Jackson.
2544
2545         Use initializers for the pointers. No need to initialize LayoutUnits, which initialize to zero.
2546
2547         * rendering/RenderLayer.cpp:
2548         (WebCore::RenderLayer::RenderLayer):
2549         * rendering/RenderLayer.h:
2550
2551 2018-08-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2552
2553         Remove the SVG elements' attributes macros
2554         https://bugs.webkit.org/show_bug.cgi?id=186751
2555
2556         Reviewed by Simon Fraser.
2557
2558         This is how the SVG attributes are implemented after removing the SVG macros:
2559
2560         1) The SVG attribute is defined as a super class of SVGAttribute. The super
2561            classes of SVGAttribute are template classes. The type of these template
2562            are the property type or the TearOff type.
2563
2564         2) To unify accessing attributes of the SVGElements and its super classes
2565            an SVGAttributeAccessor template class is added. It is inherited by other
2566            template classes. The types of these templates are the owner and the
2567            attributes types. The main functions of these classes is to synchronize 
2568            the new property value with the document attributes pool and to create
2569            and cache the TearOff objects.
2570
2571         3) To make code shorter and more readable, attribute types and attribute
2572            accessors are defined for every SVG TearOff type, e.g. 
2573            -- SVGLength: 
2574                 SVGAnimatedLengthAttribute and SVGAnimatedLengthAttributeAccessor
2575            -- SVGAnimatedNumber: 
2576                 SVGAnimatedNumberAttribute and SVGAnimatedNumberAttributeAccessor
2577
2578         4) A special accessor is defined for animated pair and optional attributes:
2579            SVGAnimatedPairAttributeAccessor, e.g.
2580            -- SVGMarkerElement:
2581                 orient attribute: "angle" or "type"
2582            -- SVGFEGaussianBlurElement:
2583                 stdDeviation attribute: "x" and "y"
2584
2585         5) The SVG attributes have to be registered into an singleton SVGAttributeRegistry.
2586            The SVGAttributeRegistry is a template class. The types of this template
2587            class are the the type of the owner and the base classes of this owner.
2588            This registry holds a map from "attribute name" to  "attribute accessor".
2589
2590         6) To make the code easier to read, the SVGAttributeRegistry implements
2591            registerAttribute() for different attribute types. The owner needs only
2592            to provide the attribute name and a pointer to the class member of this
2593            attribute to the same function "registerAttribute()". The compiler will
2594            pick the right function to call based on the type of the attribute.
2595
2596         7) Given a reference to the owner element, SVGAttributeRegistry can loop
2597            through the attributes of this owner and through the attributes of its
2598            base classes as well to do operations like synchronizing all the attributes
2599            or creating the TearOff object of a certain attribute.
2600
2601         8) To make the base class SVGElement have the ability to access the attributes
2602            of any of its super classes, SVGAttributeOwnerProxy will be used.
2603            SVGAttributeOwnerProxy is a base class which have all the functions that
2604            SVGElement needs as pure virtual functions.
2605
2606         9) SVGAttributeOwnerProxyImpl is a template class which implements 
2607            SVGAttributeOwnerProxy and whose types are the owner and its base classes.
2608            SVGAttributeOwnerProxyImpl keeps a reference to the owner and the context
2609            SVGElement.
2610
2611         10) All the SVG attribute owners have to implement the virtual function
2612             attributeOwnerProxy() which returns a reference to SVGAttributeOwnerProxy.
2613             The local attributeOwnerProxy() returns a reference to a local
2614             SVGAttributeOwnerProxyImpl. Its type and base types are the class
2615             hierarchy of this element.
2616
2617         All the attributes of the non-SVGElement-based classes are moved as members
2618         of these classes instead of adding them to all the super classes. These
2619         classes are:
2620            -- SVGExternalResourcesRequired
2621            -- SVGURIReference
2622            -- SVGFitToViewBox
2623            -- SVGZoomAndPan
2624            -- SVGLangSpace
2625
2626         The svgAttributeChanged() of all the SVGElement-based classes are now 
2627         simplified by distributing the responsibilities of changing an attribute
2628         to the base classes. One exception is the SVGURIReference since the action
2629         to be taken when changing the "href" is different for every super class.
2630
2631         Other work will be done in separate patches.
2632            -- Shrinking the memory of the SVGElements.
2633            -- Making all the attributes RefCounted objects.
2634
2635         * Sources.txt:
2636         * WebCore.xcodeproj/project.pbxproj:
2637         * rendering/svg/RenderSVGResourceMarker.cpp:
2638         (WebCore::RenderSVGResourceMarker::draw):
2639         * svg/SVGAElement.cpp:
2640         (WebCore::SVGAElement::SVGAElement):
2641         (WebCore::SVGAElement::registerAttributes):
2642         (WebCore::SVGAElement::parseAttribute):
2643         (WebCore::SVGAElement::svgAttributeChanged):
2644         * svg/SVGAElement.h:
2645         * svg/SVGAElement.idl:
2646         * svg/SVGAltGlyphElement.cpp:
2647         (WebCore::SVGAltGlyphElement::SVGAltGlyphElement):
2648         * svg/SVGAltGlyphElement.h:
2649         * svg/SVGAnimatedAngle.h:
2650         * svg/SVGAnimatedBoolean.h:
2651         * svg/SVGAnimatedEnumeration.h:
2652         * svg/SVGAnimatedInteger.h:
2653         * svg/SVGAnimatedLength.h:
2654         * svg/SVGAnimatedLengthList.h:
2655         * svg/SVGAnimatedNumber.h:
2656         * svg/SVGAnimatedNumberList.h:
2657         * svg/SVGAnimatedPath.h:
2658         * svg/SVGAnimatedPointList.h:
2659         * svg/SVGAnimatedPreserveAspectRatio.h:
2660         * svg/SVGAnimatedRect.h:
2661         * svg/SVGAnimatedString.h:
2662         * svg/SVGAnimatedTransformList.h:
2663         * svg/SVGAnimatedTypeAnimator.cpp:
2664         (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
2665         * svg/SVGAnimationElement.cpp:
2666         (WebCore::SVGAnimationElement::SVGAnimationElement):
2667         (WebCore::SVGAnimationElement::requiredFeatures): Deleted.
2668         (WebCore::SVGAnimationElement::requiredExtensions): Deleted.
2669         (WebCore::SVGAnimationElement::systemLanguage): Deleted.
2670         * svg/SVGAnimationElement.h:
2671         (WebCore::SVGAnimationElement::attributeRegistry):
2672         * svg/SVGCircleElement.cpp:
2673         (WebCore::SVGCircleElement::SVGCircleElement):
2674         (WebCore::SVGCircleElement::registerAttributes):
2675         (WebCore::SVGCircleElement::parseAttribute):
2676         (WebCore::SVGCircleElement::svgAttributeChanged):
2677         * svg/SVGCircleElement.h:
2678         * svg/SVGClipPathElement.cpp:
2679         (WebCore::SVGClipPathElement::SVGClipPathElement):
2680         (WebCore::SVGClipPathElement::registerAttributes):
2681         (WebCore::SVGClipPathElement::parseAttribute):
2682         (WebCore::SVGClipPathElement::svgAttributeChanged):
2683         (WebCore::SVGClipPathElement::isSupportedAttribute): Deleted.
2684         * svg/SVGClipPathElement.h:
2685         * svg/SVGComponentTransferFunctionElement.cpp:
2686         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
2687         (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
2688         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
2689         (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged):
2690         (WebCore::SVGComponentTransferFunctionElement::transferFunction const):
2691         (WebCore::SVGComponentTransferFunctionElement::isSupportedAttribute): Deleted.
2692         * svg/SVGComponentTransferFunctionElement.h:
2693         (WebCore::SVGComponentTransferFunctionElement::type const):
2694         (WebCore::SVGComponentTransferFunctionElement::tableValues const):
2695         (WebCore::SVGComponentTransferFunctionElement::slope const):
2696         (WebCore::SVGComponentTransferFunctionElement::intercept const):
2697         (WebCore::SVGComponentTransferFunctionElement::amplitude const):
2698         (WebCore::SVGComponentTransferFunctionElement::exponent const):
2699         (WebCore::SVGComponentTransferFunctionElement::offset const):
2700         (WebCore::SVGComponentTransferFunctionElement::typeAnimated):
2701         (WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated):
2702         (WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
2703         (WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
2704         (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
2705         (WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
2706         (WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
2707         (WebCore::SVGComponentTransferFunctionElement::attributeRegistry):
2708         (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute):
2709         * svg/SVGCursorElement.cpp:
2710         (WebCore::SVGCursorElement::SVGCursorElement):
2711         (WebCore::SVGCursorElement::registerAttributes):
2712         (WebCore::SVGCursorElement::parseAttribute):
2713         (WebCore::SVGCursorElement::svgAttributeChanged):
2714         (WebCore::SVGCursorElement::isSupportedAttribute): Deleted.
2715         (WebCore::SVGCursorElement::requiredFeatures): Deleted.
2716         (WebCore::SVGCursorElement::requiredExtensions): Deleted.
2717         (WebCore::SVGCursorElement::systemLanguage): Deleted.
2718         * svg/SVGCursorElement.h:
2719         * svg/SVGDefsElement.cpp:
2720         (WebCore::SVGDefsElement::SVGDefsElement):
2721         * svg/SVGDefsElement.h:
2722         * svg/SVGElement.cpp:
2723         (WebCore::SVGElement::SVGElement):
2724         (WebCore::SVGElement::registerAttributes):
2725         (WebCore::SVGElement::parseAttribute):
2726         (WebCore::SVGElement::animatedPropertyTypesForAttribute):
2727         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
2728         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
2729         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM):
2730         (WebCore::SVGElement::svgAttributeChanged):
2731         (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted.
2732         (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted.
2733         (WebCore::SVGElement::synchronizeSystemLanguage): Deleted.
2734         (WebCore::SVGElement::isKnownAttribute): Deleted.
2735         * svg/SVGElement.h:
2736         (WebCore::SVGElement::attributeRegistry):
2737         (WebCore::SVGElement::isKnownAttribute):
2738         (WebCore::SVGElement::attributeOwnerProxy const):
2739         (WebCore::SVGElement::synchronizeAttribute):
2740         (WebCore::SVGElement::synchronizeAttributes):
2741         (WebCore::SVGElement::animatedTypes const):
2742         (WebCore::SVGElement::lookupAnimatedProperty const):
2743         (WebCore::SVGElement::lookupOrCreateAnimatedProperty):
2744         (WebCore::SVGElement::lookupOrCreateAnimatedProperties):
2745         (WebCore::SVGElement::className const):
2746         (WebCore::SVGElement::classNameAnimated):
2747         (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted.
2748         (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted.
2749         (WebCore::SVGElement::synchronizeSystemLanguage): Deleted.
2750         * svg/SVGEllipseElement.cpp:
2751         (WebCore::SVGEllipseElement::SVGEllipseElement):
2752         (WebCore::SVGEllipseElement::registerAttributes):
2753         (WebCore::SVGEllipseElement::parseAttribute):
2754         (WebCore::SVGEllipseElement::svgAttributeChanged):
2755         * svg/SVGEllipseElement.h:
2756         * svg/SVGExternalResourcesRequired.cpp:
2757         (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired):
2758         (WebCore::SVGExternalResourcesRequired::registerAttributes):
2759         (WebCore::SVGExternalResourcesRequired::parseAttribute):
2760         (WebCore::SVGExternalResourcesRequired::svgAttributeChanged):
2761         (WebCore::SVGExternalResourcesRequired::addSupportedAttributes):
2762         (WebCore::SVGExternalResourcesRequired::dispatchLoadEvent):
2763         (WebCore::SVGExternalResourcesRequired::insertedIntoDocument):
2764         (WebCore::SVGExternalResourcesRequired::finishParsingChildren):
2765         (WebCore::SVGExternalResourcesRequired::haveLoadedRequiredResources const):
2766         (WebCore::SVGExternalResourcesRequired::isKnownAttribute): Deleted.
2767         (WebCore::SVGExternalResourcesRequired::handleAttributeChange): Deleted.
2768         * svg/SVGExternalResourcesRequired.h:
2769         (WebCore::SVGExternalResourcesRequired::attributeRegistry):
2770         (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated):
2771         (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const):
2772         (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired):
2773         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
2774         (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy):
2775         * svg/SVGFEBlendElement.cpp:
2776         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
2777         (WebCore::SVGFEBlendElement::registerAttributes):
2778         (WebCore::SVGFEBlendElement::parseAttribute):
2779         * svg/SVGFEBlendElement.h:
2780         * svg/SVGFEColorMatrixElement.cpp:
2781         (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
2782         (WebCore::SVGFEColorMatrixElement::registerAttributes):
2783         (WebCore::SVGFEColorMatrixElement::parseAttribute):
2784         * svg/SVGFEColorMatrixElement.h:
2785         * svg/SVGFEComponentTransferElement.cpp:
2786         (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
2787         (WebCore::SVGFEComponentTransferElement::registerAttributes):
2788         (WebCore::SVGFEComponentTransferElement::parseAttribute):
2789         * svg/SVGFEComponentTransferElement.h:
2790         * svg/SVGFECompositeElement.cpp:
2791         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
2792         (WebCore::SVGFECompositeElement::registerAttributes):
2793         (WebCore::SVGFECompositeElement::parseAttribute):
2794         * svg/SVGFECompositeElement.h:
2795         * svg/SVGFEConvolveMatrixElement.cpp:
2796         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
2797         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
2798         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
2799         (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute):
2800         (WebCore::SVGFEConvolveMatrixElement::setOrder):
2801         (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
2802         * svg/SVGFEConvolveMatrixElement.h:
2803         (WebCore::SVGPropertyTraits<EdgeModeType>::initialValue):
2804         * svg/SVGFEDiffuseLightingElement.cpp:
2805         (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
2806         (WebCore::SVGFEDiffuseLightingElement::registerAttributes):
2807         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
2808         * svg/SVGFEDiffuseLightingElement.h:
2809         * svg/SVGFEDisplacementMapElement.cpp:
2810         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
2811         (WebCore::SVGFEDisplacementMapElement::registerAttributes):
2812         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
2813         * svg/SVGFEDisplacementMapElement.h:
2814         * svg/SVGFEDropShadowElement.cpp:
2815         (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
2816         (WebCore::SVGFEDropShadowElement::setStdDeviation):
2817         (WebCore::SVGFEDropShadowElement::registerAttributes):
2818         (WebCore::SVGFEDropShadowElement::parseAttribute):
2819         (WebCore::SVGFEDropShadowElement::svgAttributeChanged):
2820         * svg/SVGFEDropShadowElement.h:
2821         * svg/SVGFEGaussianBlurElement.cpp:
2822         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
2823         (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
2824         (WebCore::SVGFEGaussianBlurElement::registerAttributes):
2825         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
2826         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
2827         * svg/SVGFEGaussianBlurElement.h:
2828         * svg/SVGFEImageElement.cpp:
2829         (WebCore::SVGFEImageElement::SVGFEImageElement):
2830         (WebCore::SVGFEImageElement::registerAttributes):
2831         (WebCore::SVGFEImageElement::parseAttribute):
2832         * svg/SVGFEImageElement.h:
2833         * svg/SVGFELightElement.cpp:
2834         (WebCore::SVGFELightElement::SVGFELightElement):
2835         (WebCore::SVGFELightElement::registerAttributes):
2836         (WebCore::SVGFELightElement::parseAttribute):
2837         (WebCore::SVGFELightElement::svgAttributeChanged):
2838         * svg/SVGFELightElement.h:
2839         (WebCore::SVGFELightElement::azimuth const):
2840         (WebCore::SVGFELightElement::elevation const):
2841         (WebCore::SVGFELightElement::x const):
2842         (WebCore::SVGFELightElement::y const):
2843         (WebCore::SVGFELightElement::z const):
2844         (WebCore::SVGFELightElement::pointsAtX const):
2845         (WebCore::SVGFELightElement::pointsAtY const):
2846         (WebCore::SVGFELightElement::pointsAtZ const):
2847         (WebCore::SVGFELightElement::specularExponent const):
2848         (WebCore::SVGFELightElement::limitingConeAngle const):
2849         (WebCore::SVGFELightElement::azimuthAnimated):
2850         (WebCore::SVGFELightElement::elevationAnimated):
2851         (WebCore::SVGFELightElement::xAnimated):
2852         (WebCore::SVGFELightElement::yAnimated):
2853         (WebCore::SVGFELightElement::zAnimated):
2854         (WebCore::SVGFELightElement::pointsAtXAnimated):
2855         (WebCore::SVGFELightElement::pointsAtYAnimated):
2856         (WebCore::SVGFELightElement::pointsAtZAnimated):
2857         (WebCore::SVGFELightElement::specularExponentAnimated):
2858         (WebCore::SVGFELightElement::limitingConeAngleAnimated):
2859         (WebCore::SVGFELightElement::attributeRegistry):
2860         (WebCore::SVGFELightElement::isKnownAttribute):
2861         * svg/SVGFEMergeNodeElement.cpp:
2862         (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
2863         (WebCore::SVGFEMergeNodeElement::registerAttributes):
2864         (WebCore::SVGFEMergeNodeElement::parseAttribute):
2865         * svg/SVGFEMergeNodeElement.h:
2866         * svg/SVGFEMorphologyElement.cpp:
2867         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
2868         (WebCore::SVGFEMorphologyElement::setRadius):
2869         (WebCore::SVGFEMorphologyElement::registerAttributes):
2870         (WebCore::SVGFEMorphologyElement::parseAttribute):
2871         * svg/SVGFEMorphologyElement.h:
2872         * svg/SVGFEOffsetElement.cpp:
2873         (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
2874         (WebCore::SVGFEOffsetElement::registerAttributes):
2875         (WebCore::SVGFEOffsetElement::parseAttribute):
2876         (WebCore::SVGFEOffsetElement::svgAttributeChanged):
2877         * svg/SVGFEOffsetElement.h:
2878         * svg/SVGFESpecularLightingElement.cpp:
2879         (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
2880         (WebCore::SVGFESpecularLightingElement::registerAttributes):
2881         (WebCore::SVGFESpecularLightingElement::parseAttribute):
2882         * svg/SVGFESpecularLightingElement.h:
2883         * svg/SVGFETileElement.cpp:
2884         (WebCore::SVGFETileElement::SVGFETileElement):
2885         (WebCore::SVGFETileElement::registerAttributes):
2886         (WebCore::SVGFETileElement::parseAttribute):
2887         * svg/SVGFETileElement.h:
2888         * svg/SVGFETurbulenceElement.cpp:
2889         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
2890         (WebCore::SVGFETurbulenceElement::registerAttributes):
2891         (WebCore::SVGFETurbulenceElement::parseAttribute):
2892         (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute):
2893         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
2894         * svg/SVGFETurbulenceElement.h:
2895         * svg/SVGFilterElement.cpp:
2896         (WebCore::SVGFilterElement::SVGFilterElement):
2897         (WebCore::SVGFilterElement::setFilterRes):
2898         (WebCore::SVGFilterElement::registerAttributes):
2899         (WebCore::SVGFilterElement::parseAttribute):
2900         (WebCore::SVGFilterElement::svgAttributeChanged):
2901         (WebCore::SVGFilterElement::isSupportedAttribute): Deleted.
2902         * svg/SVGFilterElement.h:
2903         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
2904         (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
2905         (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes):
2906         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
2907         (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
2908         (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute): Deleted.
2909         * svg/SVGFilterPrimitiveStandardAttributes.h:
2910         (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry):
2911         (WebCore::SVGFilterPrimitiveStandardAttributes::x const):
2912         (WebCore::SVGFilterPrimitiveStandardAttributes::y const):
2913         (WebCore::SVGFilterPrimitiveStandardAttributes::width const):
2914         (WebCore::SVGFilterPrimitiveStandardAttributes::height const):
2915         (WebCore::SVGFilterPrimitiveStandardAttributes::result const):
2916         (WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated):
2917         (WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated):
2918         (WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated):
2919         (WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated):
2920         (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated):
2921         (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute):
2922         * svg/SVGFitToViewBox.cpp:
2923         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
2924         (WebCore::SVGFitToViewBox::registerAttributes):
2925         (WebCore::SVGFitToViewBox::setViewBox):
2926         (WebCore::SVGFitToViewBox::resetViewBox):
2927         (WebCore::SVGFitToViewBox::reset):
2928         (WebCore::SVGFitToViewBox::parseAttribute):
2929         (WebCore::SVGFitToViewBox::parseViewBox):
2930         (WebCore::SVGFitToViewBox::isKnownAttribute): Deleted.
2931         (WebCore::SVGFitToViewBox::addSupportedAttributes): Deleted.
2932         * svg/SVGFitToViewBox.h:
2933         (WebCore::SVGFitToViewBox::attributeRegistry):
2934         (WebCore::SVGFitToViewBox::viewBox const):
2935         (WebCore::SVGFitToViewBox::preserveAspectRatio const):
2936         (WebCore::SVGFitToViewBox::viewBoxAnimated):
2937         (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
2938         (WebCore::SVGFitToViewBox::setPreserveAspectRatio):
2939         (WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
2940         (WebCore::SVGFitToViewBox::viewBoxString const):
2941         (WebCore::SVGFitToViewBox::preserveAspectRatioString const):
2942         (WebCore::SVGFitToViewBox::hasValidViewBox const):
2943         (WebCore::SVGFitToViewBox::hasEmptyViewBox const):
2944         (WebCore::SVGFitToViewBox::isKnownAttribute):
2945         (WebCore::SVGFitToViewBox::parseAttribute): Deleted.
2946         * svg/SVGFontElement.cpp:
2947         (WebCore::SVGFontElement::SVGFontElement):
2948         * svg/SVGFontElement.h:
2949         * svg/SVGForeignObjectElement.cpp:
2950         (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
2951         (WebCore::SVGForeignObjectElement::registerAttributes):
2952         (WebCore::SVGForeignObjectElement::parseAttribute):
2953         (WebCore::SVGForeignObjectElement::svgAttributeChanged):
2954         (WebCore::SVGForeignObjectElement::isSupportedAttribute): Deleted.
2955         * svg/SVGForeignObjectElement.h:
2956         * svg/SVGGElement.cpp:
2957         (WebCore::SVGGElement::SVGGElement):
2958         (WebCore::SVGGElement::svgAttributeChanged):
2959         (WebCore::SVGGElement::isSupportedAttribute): Deleted.
2960         * svg/SVGGElement.h:
2961         * svg/SVGGeometryElement.cpp:
2962         (WebCore::SVGGeometryElement::SVGGeometryElement):
2963         (WebCore::SVGGeometryElement::registerAttributes):
2964         (WebCore::SVGGeometryElement::parseAttribute):
2965         (WebCore::SVGGeometryElement::svgAttributeChanged):
2966         (WebCore::SVGGeometryElement::isSupportedAttribute): Deleted.
2967         * svg/SVGGeometryElement.h:
2968         (WebCore::SVGGeometryElement::attributeRegistry):
2969         (WebCore::SVGGeometryElement::pathLengthAnimated):
2970         (WebCore::SVGGeometryElement::isKnownAttribute):
2971         * svg/SVGGlyphRefElement.cpp:
2972         (WebCore::SVGGlyphRefElement::SVGGlyphRefElement):
2973         * svg/SVGGlyphRefElement.h:
2974         * svg/SVGGradientElement.cpp:
2975         (WebCore::SVGGradientElement::SVGGradientElement):
2976         (WebCore::SVGGradientElement::registerAttributes):
2977         (WebCore::SVGGradientElement::parseAttribute):
2978         (WebCore::SVGGradientElement::svgAttributeChanged):
2979         (WebCore::SVGGradientElement::isSupportedAttribute): Deleted.
2980         * svg/SVGGradientElement.h:
2981         (WebCore::SVGGradientElement::attributeRegistry):
2982         (WebCore::SVGGradientElement::spreadMethod const):
2983         (WebCore::SVGGradientElement::gradientUnits const):
2984         (WebCore::SVGGradientElement::gradientTransform const):
2985         (WebCore::SVGGradientElement::spreadMethodAnimated):
2986         (WebCore::SVGGradientElement::gradientUnitsAnimated):
2987         (WebCore::SVGGradientElement::gradientTransformAnimated):
2988         (WebCore::SVGGradientElement::isKnownAttribute):
2989         * svg/SVGGraphicsElement.cpp:
2990         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
2991         (WebCore::SVGGraphicsElement::registerAttributes):
2992         (WebCore::SVGGraphicsElement::parseAttribute):
2993         (WebCore::SVGGraphicsElement::svgAttributeChanged):
2994         (WebCore::SVGGraphicsElement::isSupportedAttribute): Deleted.
2995         (WebCore::SVGGraphicsElement::requiredFeatures): Deleted.
2996         (WebCore::SVGGraphicsElement::requiredExtensions): Deleted.
2997         (WebCore::SVGGraphicsElement::systemLanguage): Deleted.
2998         * svg/SVGGraphicsElement.h:
2999         (WebCore::SVGGraphicsElement::attributeRegistry):
3000         (WebCore::SVGGraphicsElement::transform const):
3001         (WebCore::SVGGraphicsElement::transformAnimated):
3002         (WebCore::SVGGraphicsElement::isKnownAttribute):
3003         * svg/SVGImageElement.cpp:
3004         (WebCore::SVGImageElement::SVGImageElement):
3005         (WebCore::SVGImageElement::registerAttributes):
3006         (WebCore::SVGImageElement::parseAttribute):
3007         (WebCore::SVGImageElement::svgAttributeChanged):
3008         (WebCore::SVGImageElement::haveLoadedRequiredResources):
3009         (WebCore::SVGImageElement::isSupportedAttribute): Deleted.
3010         * svg/SVGImageElement.h:
3011         * svg/SVGImageLoader.cpp:
3012         (WebCore::SVGImageLoader::dispatchLoadEvent):
3013         * svg/SVGLangSpace.cpp:
3014         (WebCore::SVGLangSpace::SVGLangSpace):
3015         (WebCore::SVGLangSpace::registerAttributes):
3016         (WebCore::SVGLangSpace::xmlspace const):
3017         (WebCore::SVGLangSpace::svgAttributeChanged):
3018         (WebCore::SVGLangSpace::setXmllang): Deleted.
3019         (WebCore::SVGLangSpace::setXmlspace): Deleted.
3020         (WebCore::SVGLangSpace::isKnownAttribute): Deleted.
3021         (WebCore::addWithAndWithoutXMLPrefix): Deleted.
3022         (WebCore::SVGLangSpace::addSupportedAttributes): Deleted.
3023         * svg/SVGLangSpace.h:
3024         (WebCore::SVGLangSpace::xmllang const):
3025         (WebCore::SVGLangSpace::setXmllang):
3026         (WebCore::SVGLangSpace::setXmlspace):
3027         (WebCore::SVGLangSpace::attributeRegistry):
3028         (WebCore::SVGLangSpace::isKnownAttribute):
3029         * svg/SVGLineElement.cpp:
3030         (WebCore::SVGLineElement::SVGLineElement):
3031         (WebCore::SVGLineElement::registerAttributes):
3032         (WebCore::SVGLineElement::parseAttribute):
3033         (WebCore::SVGLineElement::svgAttributeChanged):
3034         (WebCore::SVGLineElement::isSupportedAttribute): Deleted.
3035         * svg/SVGLineElement.h:
3036         * svg/SVGLinearGradientElement.cpp:
3037         (WebCore::SVGLinearGradientElement::SVGLinearGradientElement):
3038         (WebCore::SVGLinearGradientElement::registerAttributes):
3039         (WebCore::SVGLinearGradientElement::parseAttribute):
3040         (WebCore::SVGLinearGradientElement::svgAttributeChanged):
3041         (WebCore::SVGLinearGradientElement::isSupportedAttribute): Deleted.
3042         * svg/SVGLinearGradientElement.h:
3043         * svg/SVGMPathElement.cpp:
3044         (WebCore::SVGMPathElement::SVGMPathElement):
3045         (WebCore::SVGMPathElement::svgAttributeChanged):
3046         * svg/SVGMPathElement.h:
3047         * svg/SVGMarkerElement.cpp:
3048         (WebCore::SVGMarkerElement::SVGMarkerElement):
3049         (WebCore::SVGMarkerElement::registerAttributes):
3050         (WebCore::SVGMarkerElement::parseAttribute):
3051         (WebCore::SVGMarkerElement::svgAttributeChanged):
3052         (WebCore::SVGMarkerElement::setOrient):
3053         (WebCore::SVGMarkerElement::orientTypePropertyInfo): Deleted.
3054         (WebCore::SVGMarkerElement::isSupportedAttribute): Deleted.
3055         (WebCore::SVGMarkerElement::synchronizeOrientType): Deleted.
3056         (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper): Deleted.
3057         (WebCore::SVGMarkerElement::orientType const): Deleted.
3058         (WebCore::SVGMarkerElement::orientTypeAnimated): Deleted.
3059         * svg/SVGMarkerElement.h:
3060         * svg/SVGMaskElement.cpp:
3061         (WebCore::SVGMaskElement::SVGMaskElement):
3062         (WebCore::SVGMaskElement::registerAttributes):
3063         (WebCore::SVGMaskElement::parseAttribute):
3064         (WebCore::SVGMaskElement::svgAttributeChanged):
3065         (WebCore::SVGMaskElement::isSupportedAttribute): Deleted.
3066         (WebCore::SVGMaskElement::requiredFeatures): Deleted.
3067         (WebCore::SVGMaskElement::requiredExtensions): Deleted.
3068         (WebCore::SVGMaskElement::systemLanguage): Deleted.
3069         * svg/SVGMaskElement.h:
3070         * svg/SVGPathElement.cpp:
3071         (WebCore::SVGPathElement::SVGPathElement):
3072         (WebCore::SVGPathElement::registerAttributes):
3073         (WebCore::SVGPathElement::parseAttribute):
3074         (WebCore::SVGPathElement::svgAttributeChanged):
3075         (WebCore::SVGPathElement::pathByteStream const):
3076         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
3077         (WebCore::SVGPathElement::animatedPropertyWillBeDeleted):
3078         (WebCore::SVGPathElement::pathSegList):
3079         (WebCore::SVGPathElement::animatedPathSegList):
3080         (WebCore::SVGPathElement::pathSegListChanged):
3081         (WebCore::SVGPathElement::dPropertyInfo): Deleted.
3082         (WebCore::SVGPathElement::isSupportedAttribute): Deleted.
3083         (WebCore::SVGPathElement::synchronizeD): Deleted.
3084         * svg/SVGPathElement.h:
3085         * svg/SVGPathSegListValues.h:
3086         (WebCore::SVGPropertyTraits<SVGPathSegListValues>::toString):
3087         * svg/SVGPathSegWithContext.h:
3088         (WebCore::SVGPathSegWithContext::animatedProperty const):
3089         * svg/SVGPatternElement.cpp:
3090         (WebCore::SVGPatternElement::SVGPatternElement):
3091         (WebCore::SVGPatternElement::registerAttributes):
3092         (WebCore::SVGPatternElement::parseAttribute):
3093         (WebCore::SVGPatternElement::svgAttributeChanged):
3094         (WebCore::SVGPatternElement::collectPatternAttributes const):
3095         (WebCore::SVGPatternElement::isSupportedAttribute): Deleted.
3096         (WebCore::SVGPatternElement::requiredFeatures): Deleted.
3097         (WebCore::SVGPatternElement::requiredExtensions): Deleted.
3098         (WebCore::SVGPatternElement::systemLanguage): Deleted.
3099         * svg/SVGPatternElement.h:
3100         * svg/SVGPointListValues.h:
3101         (WebCore::SVGPropertyTraits<SVGPointListValues>::toString):
3102         * svg/SVGPolyElement.cpp:
3103         (WebCore::SVGPolyElement::SVGPolyElement):
3104         (WebCore::SVGPolyElement::registerAttributes):
3105         (WebCore::SVGPolyElement::parseAttribute):
3106         (WebCore::SVGPolyElement::svgAttributeChanged):
3107         (WebCore::SVGPolyElement::points):
3108         (WebCore::SVGPolyElement::animatedPoints):
3109         (WebCore::SVGPolyElement::pointsPropertyInfo): Deleted.
3110         (WebCore::SVGPolyElement::synchronizePoints): Deleted.
3111         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper): Deleted.
3112         * svg/SVGPolyElement.h:
3113         (WebCore::SVGPolyElement::pointList const):
3114         (WebCore::SVGPolyElement::attributeRegistry):
3115         (WebCore::SVGPolyElement::isKnownAttribute):
3116         * svg/SVGPreserveAspectRatioValue.cpp:
3117         (WebCore::SVGPreserveAspectRatioValue::transformRect const):
3118         (WebCore::SVGPreserveAspectRatioValue::transformRect): Deleted.
3119         * svg/SVGPreserveAspectRatioValue.h:
3120         * svg/SVGRadialGradientElement.cpp:
3121         (WebCore::SVGRadialGradientElement::SVGRadialGradientElement):
3122         (WebCore::SVGRadialGradientElement::registerAttributes):
3123         (WebCore::SVGRadialGradientElement::parseAttribute):
3124         (WebCore::SVGRadialGradientElement::svgAttributeChanged):
3125         (WebCore::SVGRadialGradientElement::isSupportedAttribute): Deleted.
3126         * svg/SVGRadialGradientElement.h:
3127         * svg/SVGRectElement.cpp:
3128         (WebCore::SVGRectElement::SVGRectElement):
3129         (WebCore::SVGRectElement::registerAttributes):
3130         (WebCore::SVGRectElement::parseAttribute):
3131         (WebCore::SVGRectElement::svgAttributeChanged):
3132         * svg/SVGRectElement.h:
3133         * svg/SVGSVGElement.cpp:
3134         (WebCore::SVGSVGElement::SVGSVGElement):
3135         (WebCore::SVGSVGElement::registerAttributes):
3136         (WebCore::SVGSVGElement::parseAttribute):
3137         (WebCore::SVGSVGElement::svgAttributeChanged):
3138         (WebCore::SVGSVGElement::viewBoxToViewTransform const):
3139         (WebCore::SVGSVGElement::resetScrollAnchor):
3140         (WebCore::SVGSVGElement::inheritViewAttributes):
3141         * svg/SVGSVGElement.h:
3142         (WebCore::SVGSVGElement::useCurrentView const): Deleted.
3143         (WebCore::SVGSVGElement::currentTranslateValue): Deleted.
3144         (WebCore::SVGSVGElement::zoomAndPan const): Deleted.
3145         (WebCore::SVGSVGElement::setZoomAndPan): Deleted.
3146         (WebCore::SVGSVGElement::timeContainer): Deleted.
3147         (WebCore::SVGSVGElement::hasEmptyViewBox const): Deleted.
3148         * svg/SVGScriptElement.cpp:
3149         (WebCore::SVGScriptElement::SVGScriptElement):
3150         (WebCore::SVGScriptElement::svgAttributeChanged):
3151         (WebCore::SVGScriptElement::insertedIntoAncestor):
3152         (WebCore::SVGScriptElement::addSubresourceAttributeURLs const):
3153         (WebCore::SVGScriptElement::isURLAttribute const): Deleted.
3154         (WebCore::SVGScriptElement::sourceAttributeValue const): Deleted.
3155         (WebCore::SVGScriptElement::charsetAttributeValue const): Deleted.
3156         (WebCore::SVGScriptElement::typeAttributeValue const): Deleted.
3157         (WebCore::SVGScriptElement::languageAttributeValue const): Deleted.
3158         (WebCore::SVGScriptElement::forAttributeValue const): Deleted.
3159         (WebCore::SVGScriptElement::eventAttributeValue const): Deleted.
3160         (WebCore::SVGScriptElement::hasAsyncAttribute const): Deleted.
3161         (WebCore::SVGScriptElement::hasDeferAttribute const): Deleted.
3162         (WebCore::SVGScriptElement::hasNoModuleAttribute const): Deleted.
3163         (WebCore::SVGScriptElement::hasSourceAttribute const): Deleted.
3164         (WebCore::SVGScriptElement::filterOutAnimatableAttribute const): Deleted.
3165         * svg/SVGScriptElement.h:
3166         * svg/SVGStopElement.cpp:
3167         (WebCore::SVGStopElement::SVGStopElement):
3168         (WebCore::SVGStopElement::registerAttributes):
3169         (WebCore::SVGStopElement::parseAttribute):
3170         * svg/SVGStopElement.h:
3171         * svg/SVGStringListValues.h:
3172         (WebCore::SVGPropertyTraits<SVGStringListValues>::toString):
3173         * svg/SVGSwitchElement.cpp:
3174         (WebCore::SVGSwitchElement::SVGSwitchElement):
3175         * svg/SVGSwitchElement.h:
3176         * svg/SVGSymbolElement.cpp:
3177         (WebCore::SVGSymbolElement::SVGSymbolElement):
3178         (WebCore::SVGSymbolElement::parseAttribute):
3179         (WebCore::SVGSymbolElement::svgAttributeChanged):
3180         * svg/SVGSymbolElement.h:
3181         * svg/SVGTRefElement.cpp:
3182         (WebCore::SVGTRefElement::SVGTRefElement):
3183         * svg/SVGTRefElement.h:
3184         * svg/SVGTests.cpp:
3185         (WebCore::SVGTests::SVGTests):
3186         (WebCore::SVGTests::registerAttributes):
3187         (WebCore::SVGTests::attributeRegistry):
3188         (WebCore::SVGTests::isKnownAttribute):
3189         (WebCore::SVGTests::isValid const):
3190         (WebCore::SVGTests::parseAttribute):
3191         (WebCore::SVGTests::svgAttributeChanged):
3192         (WebCore::SVGTests::requiredFeatures):
3193         (WebCore::SVGTests::requiredExtensions):
3194         (WebCore::SVGTests::systemLanguage):
3195         (WebCore::createSVGTestPropertyInfo): Deleted.
3196         (WebCore::createSVGTextAttributeToPropertyMap): Deleted.
3197         (WebCore::SVGTests::attributeToPropertyMap): Deleted.
3198         (WebCore::SVGTests::handleAttributeChange): Deleted.
3199         (WebCore::SVGTests::synchronizeAttribute): Deleted.
3200         (WebCore::SVGTests::synchronizeRequiredFeatures): Deleted.
3201         (WebCore::SVGTests::synchronizeRequiredExtensions): Deleted.
3202         (WebCore::SVGTests::synchronizeSystemLanguage): Deleted.
3203         * svg/SVGTests.h:
3204         * svg/SVGTextContentElement.cpp:
3205         (WebCore::SVGTextContentElement::SVGTextContentElement):
3206         (WebCore::SVGTextContentElement::registerAttributes):
3207         (WebCore::SVGTextContentElement::parseAttribute):
3208         (WebCore::SVGTextContentElement::svgAttributeChanged):
3209         (WebCore::SVGTextContentElement::textLengthPropertyInfo): Deleted.
3210         (WebCore::SVGTextContentElement::synchronizeTextLength): Deleted.
3211         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper): Deleted.
3212         (WebCore::SVGTextContentElement::textLengthAnimated): Deleted.
3213         (WebCore::SVGTextContentElement::isSupportedAttribute): Deleted.
3214         * svg/SVGTextContentElement.h:
3215         (WebCore::SVGTextContentElement::specifiedTextLength):
3216         (WebCore::SVGTextContentElement::attributeRegistry):
3217         (WebCore::SVGTextContentElement::textLength const):
3218         (WebCore::SVGTextContentElement::lengthAdjust const):
3219         (WebCore::SVGTextContentElement::textLengthAnimated):
3220         (WebCore::SVGTextContentElement::lengthAdjustAnimated):
3221         (WebCore::SVGTextContentElement::isKnownAttribute):
3222         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::SVGAnimatedCustomLengthAttribute):
3223         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::synchronize):
3224         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::animatedProperty):
3225         * svg/SVGTextPathElement.cpp:
3226         (WebCore::SVGTextPathElement::SVGTextPathElement):
3227         (WebCore::SVGTextPathElement::registerAttributes):
3228         (WebCore::SVGTextPathElement::parseAttribute):
3229         (WebCore::SVGTextPathElement::svgAttributeChanged):
3230         (WebCore::SVGTextPathElement::isSupportedAttribute): Deleted.
3231         * svg/SVGTextPathElement.h:
3232         * svg/SVGTextPositioningElement.cpp:
3233         (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
3234         (WebCore::SVGTextPositioningElement::registerAttributes):
3235         (WebCore::SVGTextPositioningElement::parseAttribute):
3236         (WebCore::SVGTextPositioningElement::svgAttributeChanged):
3237         * svg/SVGTextPositioningElement.h:
3238         (WebCore::SVGTextPositioningElement::attributeRegistry):
3239         (WebCore::SVGTextPositioningElement::x const):
3240         (WebCore::SVGTextPositioningElement::y const):
3241         (WebCore::SVGTextPositioningElement::dx const):
3242         (WebCore::SVGTextPositioningElement::dy const):
3243         (WebCore::SVGTextPositioningElement::rotate const):
3244         (WebCore::SVGTextPositioningElement::xAnimated):
3245         (WebCore::SVGTextPositioningElement::yAnimated):
3246         (WebCore::SVGTextPositioningElement::dxAnimated):
3247         (WebCore::SVGTextPositioningElement::dyAnimated):
3248         (WebCore::SVGTextPositioningElement::rotateAnimated):
3249         (WebCore::SVGTextPositioningElement::isKnownAttribute):
3250         * svg/SVGURIReference.cpp:
3251         (WebCore::SVGURIReference::SVGURIReference):
3252         (WebCore::SVGURIReference::registerAttributes):
3253         (WebCore::SVGURIReference::attributeRegistry):
3254         (WebCore::SVGURIReference::isKnownAttribute):
3255         (WebCore::SVGURIReference::parseAttribute):
3256         (WebCore::SVGURIReference::href const):
3257         (WebCore::SVGURIReference::hrefAnimated):
3258         (WebCore::SVGURIReference::addSupportedAttributes): Deleted.
3259         * svg/SVGURIReference.h:
3260         * svg/SVGUseElement.cpp:
3261         (WebCore::SVGUseElement::SVGUseElement):
3262         (WebCore::SVGUseElement::registerAttributes):
3263         (WebCore::SVGUseElement::parseAttribute):
3264         (WebCore::SVGUseElement::insertedIntoAncestor):
3265         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone const):
3266         (WebCore::SVGUseElement::svgAttributeChanged):
3267         (WebCore::SVGUseElement::notifyFinished):
3268         * svg/SVGUseElement.h:
3269         * svg/SVGValue.h:
3270         * svg/SVGViewElement.cpp:
3271         (WebCore::SVGViewElement::SVGViewElement):
3272         (WebCore::SVGViewElement::parseAttribute):
3273         * svg/SVGViewElement.h:
3274         * svg/SVGViewSpec.cpp:
3275         (WebCore::SVGViewSpec::SVGViewSpec):
3276         (WebCore::SVGViewSpec::registerAttributes):
3277         (WebCore::SVGViewSpec::transform):
3278         (WebCore::SVGViewSpec::reset):
3279         (WebCore::SVGViewSpec::parseViewSpec):
3280         (WebCore::SVGViewSpec::viewBoxPropertyInfo): Deleted.
3281         (WebCore::SVGViewSpec::preserveAspectRatioPropertyInfo): Deleted.
3282         (WebCore::SVGViewSpec::transformPropertyInfo): Deleted.
3283         (WebCore::SVGViewSpec::viewBoxIdentifier): Deleted.
3284         (WebCore::SVGViewSpec::preserveAspectRatioIdentifier): Deleted.
3285         (WebCore::SVGViewSpec::transformIdentifier): Deleted.
3286         (WebCore::SVGViewSpec::setZoomAndPan): Deleted.
3287         (WebCore::SVGViewSpec::transformString const): Deleted.
3288         (WebCore::SVGViewSpec::viewBoxString const): Deleted.
3289         (WebCore::SVGViewSpec::preserveAspectRatioString const): Deleted.
3290         (WebCore::SVGViewSpec::viewBoxAnimated): Deleted.
3291         (WebCore::SVGViewSpec::preserveAspectRatioAnimated): Deleted.
3292         (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Deleted.
3293         (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper): Deleted.
3294         (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Deleted.
3295         * svg/SVGViewSpec.h:
3296         * svg/SVGViewSpec.idl:
3297         * svg/SVGZoomAndPan.cpp:
3298         (WebCore::SVGZoomAndPan::SVGZoomAndPan):
3299         (WebCore::SVGZoomAndPan::registerAttributes):
3300         (WebCore::SVGZoomAndPan::parseZoomAndPan):
3301         (WebCore::SVGZoomAndPan::parseAttribute):
3302         (WebCore::SVGZoomAndPan::parse): Deleted.
3303         (WebCore::SVGZoomAndPan::parseAttributeValue): Deleted.
3304         * svg/SVGZoomAndPan.h:
3305         (WebCore::SVGZoomAndPan::zoomAndPan const):
3306         (WebCore::SVGZoomAndPan::setZoomAndPan):
3307         (WebCore::SVGZoomAndPan::reset):
3308         (WebCore::SVGZoomAndPan::attributeRegistry):
3309         (WebCore::SVGZoomAndPan::isKnownAttribute):
3310         (WebCore::SVGZoomAndPan::parseFromNumber): Deleted.
3311         (WebCore::SVGZoomAndPan::parseAttribute): Deleted.
3312         * svg/SVGZoomAndPanType.h: Copied from Source/WebCore/svg/SVGValue.h.
3313         (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::initialValue):
3314         (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::toString):
3315         (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::fromString):
3316         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
3317         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Copied from Source/WebCore/svg/SVGValue.h.
3318         (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff):
3319         (WebCore::SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff):
3320         (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange):
3321         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
3322         * svg/properties/SVGAnimatedProperty.cpp:
3323         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
3324         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty):
3325         (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted.
3326         * svg/properties/SVGAnimatedProperty.h:
3327         (WebCore::SVGAnimatedProperty::isAnimating const):
3328         (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const):
3329         (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty):
3330         (WebCore::SVGAnimatedProperty::lookupAnimatedProperty):
3331         (WebCore::SVGAnimatedProperty::animatedPropertyCache):
3332         (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper): Deleted.
3333         (WebCore::SVGAnimatedProperty::lookupWrapper): Deleted.
3334         * svg/properties/SVGAnimatedPropertyMacros.h: Removed.
3335         * svg/properties/SVGAnimatedPropertyType.h: Copied from Source/WebCore/svg/SVGAElement.idl.
3336         * svg/properties/SVGAttribute.h: Added.
3337         (WebCore::SVGPropertyAttribute::SVGPropertyAttribute):
3338         (WebCore::SVGPropertyAttribute::value):
3339         (WebCore::SVGPropertyAttribute::value const):
3340         (WebCore::SVGPropertyAttribute::setValue):
3341         (WebCore::SVGPropertyAttribute::resetValue):
3342         (WebCore::SVGPropertyAttribute::toString const):
3343         (WebCore::SVGPropertyAttribute::setShouldSynchronize):
3344         (WebCore::SVGPropertyAttribute::shouldSynchronize const):
3345         (WebCore::SVGPropertyAttribute::synchronize):
3346         (WebCore::SVGAnimatedAttribute::SVGAnimatedAttribute):
3347         (WebCore::SVGAnimatedAttribute::currentValue const):
3348         (WebCore::SVGAnimatedAttribute::animatedProperty):
3349         (WebCore::SVGAnimatedAttributeList::SVGAnimatedAttributeList):
3350         (WebCore::SVGAnimatedAttributeList::detachAnimatedListWrappers):
3351         * svg/properties/SVGAttributeAccessor.h: Added.
3352         (WebCore::SVGAttributeAccessor::SVGAttributeAccessor):
3353         (WebCore::SVGAttributeAccessor::attributeName const):
3354         (WebCore::SVGAttributeAccessor::isAnimatedLengthAttribute const):
3355         (WebCore::SVGAttributeAccessor::animatedType const):
3356         (WebCore::SVGAttributeAccessor::animatedTypes const):
3357         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const):
3358         (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const):
3359         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const):
3360         (WebCore::SVGPropertyAttributeAccessor::singleton):
3361         (WebCore::SVGPropertyAttributeAccessor::SVGPropertyAttributeAccessor):
3362         (WebCore::SVGPropertyAttributeAccessor::attribute const):
3363         (WebCore::SVGAnimatedAttributeAccessor::singleton):
3364         (WebCore::SVGAnimatedAttributeAccessor::SVGAnimatedAttributeAccessor):
3365         (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty):
3366         (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty):
3367         (WebCore::SVGAnimatedPairAttributeAccessor::SVGAnimatedPairAttributeAccessor):
3368         (WebCore::SVGAnimatedPairAttributeAccessor::secondAttribute const):
3369         * svg/properties/SVGAttributeOwnerProxy.h: Copied from Source/WebCore/svg/SVGValue.h.
3370         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy):
3371         (WebCore::SVGAttributeOwnerProxy::element const):
3372         * svg/properties/SVGAttributeOwnerProxyImpl.h: Added.
3373         (WebCore::SVGAttributeOwnerProxyImpl::SVGAttributeOwnerProxyImpl):
3374         (WebCore::SVGAttributeOwnerProxyImpl::attributeRegistry):
3375         (WebCore::SVGAttributeOwnerProxyImpl::isKnownAttribute):
3376         (WebCore::SVGAttributeOwnerProxyImpl::isAnimatedLengthAttribute):
3377         * svg/properties/SVGAttributeRegistry.h: Added.
3378         (WebCore::SVGAttributeRegistry::registerAttribute):
3379         (WebCore::SVGAttributeRegistry::isEmpty const):
3380         (WebCore::SVGAttributeRegistry::isKnownAttribute const):
3381         (WebCore::SVGAttributeRegistry::isAnimatedLengthAttribute const):
3382         (WebCore::SVGAttributeRegistry::animatedTypes const):
3383         (WebCore::SVGAttributeRegistry::synchronizeAttributes const):
3384         (WebCore::SVGAttributeRegistry::synchronizeAttribute const):
3385         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const):
3386         (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const):
3387         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const):
3388         (WebCore::SVGAttributeRegistry::animatedTypesBaseTypes):
3389         (WebCore::SVGAttributeRegistry::synchronizeAttributesBaseTypes):
3390         (WebCore::SVGAttributeRegistry::synchronizeAttributeBaseTypes):
3391         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes):
3392         (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes):
3393         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes):
3394         (WebCore::SVGAttributeRegistry::findAttributeAccessor const):
3395         * svg/properties/SVGAttributeToPropertyMap.cpp: Removed.
3396         * svg/properties/SVGAttributeToPropertyMap.h: Removed.
3397         * svg/properties/SVGPropertyInfo.cpp: Removed.
3398         * svg/properties/SVGPropertyInfo.h: Removed.
3399
3400 2018-08-06  Alex Christensen  <achristensen@webkit.org>
3401
3402         Use enum classes and OptionSets for PaintPhase and PaintBehavior
3403         https://bugs.webkit.org/show_bug.cgi?id=188323
3404
3405         Reviewed by Simon Fraser.
3406
3407         No change in behaviour.
3408
3409         * html/shadow/MediaControlElements.cpp:
3410         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
3411         * page/FrameSnapshotting.cpp:
3412         (WebCore::snapshotFrameRectWithClip):
3413         * page/FrameView.cpp:
3414         (WebCore::FrameView::reset):
3415         (WebCore::FrameView::willPaintContents):
3416         (WebCore::FrameView::paintContents):
3417         (WebCore::FrameView::setPaintBehavior):
3418         (WebCore::FrameView::paintBehavior const):
3419         (WebCore::FrameView::paintContentsForSnapshot):
3420         * page/FrameView.h:
3421         * rendering/InlineElementBox.cpp:
3422         (WebCore::InlineElementBox::paint):
3423         * rendering/InlineFlowBox.cpp:
3424         (WebCore::InlineFlowBox::paint):
3425         (WebCore::InlineFlowBox::paintBoxDecorations):
3426         (WebCore::InlineFlowBox::paintMask):
3427         * rendering/InlineTextBox.cpp:
3428         (WebCore::InlineTextBox::paint):
3429         * rendering/PaintInfo.h:
3430         (WebCore::PaintInfo::PaintInfo):
3431         (WebCore::PaintInfo::forceBlackText const):
3432         (WebCore::PaintInfo::forceWhiteText const):
3433         (WebCore::PaintInfo::skipRootBackground const):
3434         (WebCore::PaintInfo::paintRootBackgroundOnly const):
3435         * rendering/PaintPhase.h:
3436         (): Deleted.
3437         * rendering/RenderBlock.cpp:
3438         (WebCore::RenderBlock::paint):
3439         (WebCore::RenderBlock::paintContents):
3440         (WebCore::RenderBlock::paintObject):
3441         (WebCore::RenderBlock::paintSelection):
3442         * rendering/RenderBlockFlow.cpp:
3443         (WebCore::RenderBlockFlow::paintFloats):
3444         * rendering/RenderBox.cpp:
3445         (WebCore::RenderBox::paintMask):
3446         (WebCore::RenderBox::paintClippingMask):
3447         (WebCore::RenderBox::paintMaskImages):
3448         (WebCore::RenderBox::pushContentsClip):
3449         (WebCore::RenderBox::popContentsClip):
3450         * rendering/RenderBox.h:
3451         * rendering/RenderBoxModelObject.cpp:
3452         (WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
3453         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
3454         (WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates const):
3455         * rendering/RenderDetailsMarker.cpp:
3456         (WebCore::RenderDetailsMarker::paint):
3457         * rendering/RenderElement.cpp:
3458         (WebCore::RenderElement::paintAsInlineBlock):
3459         (WebCore::RenderElement::selectionColor const):
3460         * rendering/RenderEmbeddedObject.cpp:
3461         (WebCore::RenderEmbeddedObject::paint):
3462         (WebCore::RenderEmbeddedObject::paintReplaced):
3463         * rendering/RenderFileUploadControl.cpp:
3464         (WebCore::RenderFileUploadControl::paintObject):
3465         * rendering/RenderFrameSet.cpp:
3466         (WebCore::RenderFrameSet::paint):
3467         * rendering/RenderHTMLCanvas.cpp:
3468         (WebCore::RenderHTMLCanvas::paintReplaced):
3469         * rendering/RenderImage.cpp:
3470         (WebCore::RenderImage::paintReplaced):
3471         (WebCore::RenderImage::paint):
3472         * rendering/RenderLayer.cpp:
3473         (WebCore::RenderLayer::renderableTransform const):
3474         (WebCore::transparencyClipBox):
3475         (WebCore::expandClipRectForDescendantsAndReflection):
3476         (WebCore::paintingExtent):
3477         (WebCore::RenderLayer::paint):
3478         (WebCore::RenderLayer::paintOverlayScrollbars):
3479         (WebCore::RenderLayer::paintLayer):
3480         (WebCore::RenderLayer::paintLayerContents):
3481         (WebCore::RenderLayer::paintBackgroundForFragments):
3482         (WebCore::RenderLayer::paintForegroundForFragments):
3483         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
3484         (WebCore::RenderLayer::paintOutlineForFragments):
3485         (WebCore::RenderLayer::paintMaskForFragments):
3486         (WebCore::RenderLayer::paintChildClippingMaskForFragments):
3487         (WebCore::RenderLayer::calculateClipRects const):
3488         * rendering/RenderLayer.h:
3489         * rendering/RenderLayerBacking.cpp:
3490         (WebCore::RenderLayerBacking::paintIntoLayer):
3491         (WebCore::RenderLayerBacking::paintContents):
3492         * rendering/RenderLayerBacking.h:
3493         * rendering/RenderLineBoxList.cpp:
3494         (WebCore::RenderLineBoxList::paint const):
3495         * rendering/RenderListBox.cpp:
3496         (WebCore::RenderListBox::paintObject):
3497         * rendering/RenderListMarker.cpp:
3498         (WebCore::RenderListMarker::paint):
3499         * rendering/RenderReplaced.cpp:
3500         (WebCore::RenderReplaced::paint):
3501         (WebCore::RenderReplaced::shouldPaint):
3502         * rendering/RenderReplica.cpp:
3503         (WebCore::RenderReplica::paint):
3504         * rendering/RenderScrollbarPart.cpp:
3505         (WebCore::RenderScrollbarPart::paintIntoRect):
3506         * rendering/RenderSnapshottedPlugIn.cpp:
3507         (WebCore::RenderSnapshottedPlugIn::paint):
3508         * rendering/RenderTable.cpp:
3509         (WebCore::RenderTable::paintObject):
3510         (WebCore::RenderTable::paintMask):
3511         (WebCore::RenderTable::overflowClipRect):
3512         * rendering/RenderTable.h:
3513         * rendering/RenderTableCell.cpp:
3514         (WebCore::RenderTableCell::paint):
3515         (WebCore::RenderTableCell::paintCollapsedBorders):
3516         (WebCore::RenderTableCell::paintMask):
3517         * rendering/RenderTableRow.cpp:
3518         (WebCore::RenderTableRow::paintOutlineForRowIfNeeded):
3519         (WebCore::RenderTableRow::paint):
3520         * rendering/RenderTableSection.cpp:
3521         (WebCore::RenderTableSection::paint):
3522         (WebCore::RenderTableSection::paintCell):
3523         (WebCore::RenderTableSection::paintObject):
3524         * rendering/RenderThemeMac.mm:
3525         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
3526         (WebCore::RenderThemeMac::paintImageControlsButton):
3527         * rendering/RenderVideo.cpp:
3528         (WebCore::RenderVideo::paintReplaced):
3529         * rendering/RenderWidget.cpp:
3530         (WebCore::RenderWidget::paintContents):
3531         (WebCore::RenderWidget::paint):
3532         * rendering/RootInlineBox.cpp:
3533         (WebCore::RootInlineBox::paintEllipsisBox const):
3534         * rendering/SimpleLineLayoutFunctions.cpp:
3535         (WebCore::SimpleLineLayout::paintFlow):
3536         * rendering/mathml/MathOperator.cpp:
3537         (WebCore::MathOperator::paint):
3538         * rendering/mathml/RenderMathMLBlock.cpp:
3539         (WebCore::RenderMathMLBlock::paint):
3540         * rendering/mathml/RenderMathMLFraction.cpp:
3541         (WebCore::RenderMathMLFraction::paint):
3542         * rendering/mathml/RenderMathMLMenclose.cpp:
3543         (WebCore::RenderMathMLMenclose::paint):
3544         * rendering/mathml/RenderMathMLToken.cpp:
3545         (WebCore::RenderMathMLToken::paint):
3546         * rendering/svg/RenderSVGContainer.cpp:
3547         (WebCore::RenderSVGContainer::paint):
3548         * rendering/svg/RenderSVGForeignObject.cpp:
3549         (WebCore::RenderSVGForeignObject::paint):
3550         * rendering/svg/RenderSVGImage.cpp:
3551         (WebCore::RenderSVGImage::paint):
3552         * rendering/svg/RenderSVGResource.cpp:
3553         (WebCore::requestPaintingResource):
3554         * rendering/svg/RenderSVGResourceClipper.cpp:
3555         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
3556         * rendering/svg/RenderSVGResourceSolidColor.cpp:
3557         (WebCore::RenderSVGResourceSolidColor::applyResource):
3558         * rendering/svg/RenderSVGRoot.cpp:
3559         (WebCore::RenderSVGRoot::paintReplaced):
3560         * rendering/svg/RenderSVGShape.cpp:
3561         (WebCore::RenderSVGShape::paint):
3562         * rendering/svg/RenderSVGText.cpp:
3563         (WebCore::RenderSVGText::paint):
3564         * rendering/svg/SVGInlineFlowBox.cpp:
3565         (WebCore::SVGInlineFlowBox::paintSelectionBackground):
3566         (WebCore::SVGInlineFlowBox::paint):
3567         * rendering/svg/SVGInlineTextBox.cpp:
3568         (WebCore::SVGInlineTextBox::paintSelectionBackground):
3569         (WebCore::SVGInlineTextBox::paint):
3570         * rendering/svg/SVGRenderingContext.cpp:
3571         (WebCore::isRenderingMaskImage):
3572         (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer):
3573         * rendering/svg/SVGRootInlineBox.cpp:
3574         (WebCore::SVGRootInlineBox::paint):
3575
3576 2018-08-06  Ryan Haddad  <ryanhaddad@apple.com>
3577
3578         Unreviewed, rolling out r234569.
3579
3580         Breaks internal builds.
3581
3582         Reverted changeset:
3583
3584         "We should cache the compiled sandbox profile in a data vault"
3585         https://bugs.webkit.org/show_bug.cgi?id=184991
3586         https://trac.webkit.org/changeset/234569
3587
3588 2018-08-06  Alex Christensen  <achristensen@webkit.org>
3589
3590         Make BlendMode an enum class
3591         https://bugs.webkit.org/show_bug.cgi?id=188325
3592
3593         Reviewed by Darin Adler.
3594
3595         No change in behavior.
3596
3597         * css/CSSPrimitiveValueMappings.h:
3598         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3599         (WebCore::CSSPrimitiveValue::operator BlendMode const):
3600         * html/HTMLImageElement.cpp:
3601         (WebCore::HTMLImageElement::parseAttribute):
3602         * html/canvas/CanvasRenderingContext2DBase.cpp:
3603         (WebCore::CanvasRenderingContext2DBase::State::State):
3604         (WebCore::CanvasRenderingContext2DBase::setGlobalCompositeOperation):
3605         (WebCore::CanvasRenderingContext2DBase::drawImageFromRect):
3606         * platform/graphics/BitmapImage.h:
3607         * platform/graphics/GraphicsContext.h:
3608         (WebCore::ImagePaintingOptions::ImagePaintingOptions):
3609         * platform/graphics/GraphicsContextImpl.h:
3610         * platform/graphics/GraphicsLayer.cpp:
3611         (WebCore::GraphicsLayer::dumpProperties const):
3612         * platform/graphics/GraphicsLayer.h:
3613         * platform/graphics/GraphicsTypes.cpp:
3614         (WebCore::parseBlendMode):
3615         (WebCore::parseCompositeAndBlendOperator):
3616         (WebCore::compositeOperatorName):
3617         (WebCore::blendModeName):
3618         (WebCore::operator<<):
3619         * platform/graphics/GraphicsTypes.h:
3620         * platform/graphics/Image.cpp:
3621         (WebCore::Image::drawTiled):
3622         * platform/graphics/Image.h:
3623         * platform/graphics/ImageBuffer.h:
3624         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
3625         (PlatformCAFilters::setBlendingFiltersOnLayer):
3626         * platform/graphics/cg/GraphicsContextCG.cpp:
3627         (WebCore::selectCGBlendMode):
3628         * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
3629         (WebCore::FEBlend::platformApplyNEON):
3630         * platform/graphics/displaylists/DisplayListItems.h:
3631         * platform/graphics/displaylists/DisplayListRecorder.h:
3632         * platform/graphics/filters/FEBlend.cpp:
3633         (WebCore::FEBlend::externalRepresentation const):
3634         * rendering/RenderBox.cpp:
3635         (WebCore::RenderBox::paintFillLayers):
3636         * rendering/RenderImage.cpp:
3637         (WebCore::RenderImage::paintIntoRect):
3638         * rendering/RenderLayer.cpp:
3639         (WebCore::RenderLayer::RenderLayer):
3640         (WebCore::RenderLayer::updateBlendMode):
3641         (WebCore::RenderLayer::beginTransparencyLayers):
3642         * rendering/RenderLayerBacking.cpp:
3643         (WebCore::RenderLayerBacking::updateBlendMode):
3644         * rendering/style/FillLayer.cpp:
3645         (WebCore::FillLayer::FillLayer):
3646         (WebCore::FillLayer::hasOpaqueImage const):
3647         * rendering/style/FillLayer.h:
3648         (WebCore::FillLayer::initialFillBlendMode):
3649         * rendering/style/RenderStyle.h:
3650         (WebCore::RenderStyle::setBlendMode):
3651         (WebCore::RenderStyle::hasBlendMode const):
3652         (WebCore::RenderStyle::blendMode const):
3653         (WebCore::RenderStyle::initialBlendMode):
3654         * rendering/style/StyleRareNonInheritedData.cpp:
3655         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3656         * rendering/svg/SVGRenderingContext.cpp:
3657         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
3658         * svg/SVGAnimatedEnumeration.cpp:
3659         (WebCore::enumerationValueForTargetAttribute):
3660         * svg/SVGFEBlendElement.cpp:
3661         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
3662         (WebCore::SVGFEBlendElement::parseAttribute):
3663         * svg/SVGFEBlendElement.h:
3664         (WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
3665         (WebCore::SVGPropertyTraits<BlendMode>::toString):
3666         * svg/graphics/SVGImage.cpp:
3667         (WebCore::SVGImage::nativeImageForCurrentFrame):
3668         (WebCore::SVGImage::nativeImage):
3669         (WebCore::SVGImage::drawPatternForContainer):
3670         (WebCore::SVGImage::draw):
3671
3672 2018-08-06  Aditya Keerthi  <akeerthi@apple.com>
3673
3674         [iOS] Indeterminate checkboxes appear unchecked
3675         https://bugs.webkit.org/show_bug.cgi?id=160484
3676         <rdar://problem/31143185>
3677
3678         Reviewed by Wenson Hsieh.
3679
3680         Add support for rendering indeterminate checkboxes on iOS.
3681
3682         We now paint the unchecked appearance only if the checkbox is not checked and is
3683         not indeterminate. Otherwise, we draw a checkmark if the checkbox is in the
3684         checked state and a dash if the checkbox is in the indeterminate state. Both of
3685         these states share the same dark background.
3686
3687         Test: fast/forms/ios/render-indeterminate-checkbox.html
3688
3689         * css/html.css:
3690         (input[type="checkbox"]:indeterminate):
3691         (input[type="checkbox"]:indeterminate:disabled):
3692         * rendering/RenderThemeIOS.mm:
3693         (WebCore::drawJoinedLines):
3694         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
3695
3696 2018-08-06  Ryosuke Niwa  <rniwa@webkit.org>
3697
3698         HTML parser should execute custom element reactions for setting attributes immediately after creating a custom element
3699         https://bugs.webkit.org/show_bug.cgi?id=188336
3700
3701         Reviewed by Frédéric Wang.
3702
3703         Push and pop an element queue from the custom element reactions stack when constructing a custom element:
3704         https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
3705
3706         To do this, we instantiate CustomElementReactionStack in HTMLDocumentParser::runScriptsForPausedTreeBuilder
3707         where we synchronously construct a custom element. We don't have to worry about whether *will execute script*
3708         is set or not since the presence of an element queue should not be observable in the case where we're constructing
3709         a fallback element (since it would not enqueue any new custom element reaction).
3710
3711         Tests: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html
3712
3713         * html/parser/HTMLDocumentParser.cpp:
3714         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate CustomElementReactionStack. Note that we
3715         don't insert the custom element into the parser until we finish processing the custom element reactions.
3716
3717 2018-08-06  Charlie Turner  <cturner@igalia.com>
3718
3719         Return extracted key ids as an optional
3720         https://bugs.webkit.org/show_bug.cgi?id=188303
3721
3722         Reviewed by Darin Adler.
3723
3724         An empty list of extracted key ids was being considered a failure
3725         case before this patch. In the PSSH boxes from the CENC standard,
3726         it's not uncommon for the box to be version 0, meaning it has no
3727         embedded key ids, so the case when there's an empty list should
3728         not be treated as an error. Given this, the interface should be
3729         more general and allow for a sentinel value indicating a parsing
3730         error rather than an absence of key ids.
3731
3732         Covered by existing tests.
3733
3734         * Modules/encryptedmedia/InitDataRegistry.cpp:
3735         (WebCore::extractKeyIDsKeyids): Change return type to be wrapped
3736         in an optional, and make parsing errors return a nullopt rather
3737         than an empty vector.
3738         (WebCore::sanitizeKeyids): Use the new optional interface, return
3739         a null RefPtr in the case of a parsing error, this method may now
3740         return an empty vector.
3741         (WebCore::extractKeyIDsCenc): Not implemented, so return an error
3742         value rather than an empty vector.
3743         (WebCore::extractKeyIDsWebM): Ditto.
3744         (WebCore::InitDataRegistry::extractKeyIDs): Ditto.
3745         * Modules/encryptedmedia/InitDataRegistry.h: Update the interface
3746         to use an optional return type.
3747         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
3748         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSinf): Update
3749         to use the new interface.
3750         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSkd): Ditto.
3751         * platform/graphics/avfoundation/CDMFairPlayStreaming.h: Ditto.
3752         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3753         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs): Convert
3754         the optional value into a vector, since it is assumed you can not
3755         have an empty vector of key ids in the init datas FPS supports.
3756         * testing/MockCDMFactory.cpp:
3757         (WebCore::MockCDMInstance::requestLicense): Only return an error
3758         if there really was a parsing error, rather than the case of there
3759         being zero key ids in the init data payload.
3760
3761 2018-08-06  Frederic Wang  <fwang@igalia.com>
3762
3763         Make two-arguments versions of scrollBy/scrollTo depend on the one-argument versions
3764         https://bugs.webkit.org/show_bug.cgi?id=188300
3765
3766         Reviewed by Darin Adler.
3767
3768         This patch refactors a bit the scrollBy/scrollTo code, so that the two-arguments versions
3769         share the same code path as the more generic one-argument versions. In particular, this
3770         helps to implement the ScrollBehavior option (bug 188043) since the one-argument versions
3771         will require to distinguish between smooth and instant scrolling. The logic to normalize
3772         non finite left/right values or to use a fallback when they are absent is also factored out
3773         into ScrollToOptions.
3774
3775         References:
3776         https://drafts.csswg.org/cssom-view/#dom-element-scroll
3777         https://drafts.csswg.org/cssom-view/#dom-element-scrollby
3778         https://drafts.csswg.org/cssom-view/#dom-window-scroll
3779         https://drafts.csswg.org/cssom-view/#dom-window-scrollby
3780
3781         No new tests, behavior is unchanged.
3782
3783         * dom/Element.cpp:
3784         (WebCore::Element::scrollBy): Make two-parameter version depends on one-parameter version
3785         and rewrite the normalize / fallback logic.
3786         (WebCore::Element::scrollTo): Rewrite the normalize / fallback logic.
3787         (WebCore::normalizeNonFiniteValue): Deleted. The logic is moved to ScrollToOptions.
3788         * page/DOMWindow.cpp:
3789         (WebCore::DOMWindow::scrollBy const): Make two-parameter version depends on one-parameter
3790         version and rewrite the normalize / fallback logic.
3791         (WebCore::DOMWindow::scrollTo const): Make two-parameter version depends on one-parameter
3792         version and rewrite the normalize / fallback logic.
3793         * page/ScrollToOptions.h: Add <cmath> to use std::isfinite
3794         (WebCore::ScrollToOptions::normalizeNonFiniteCoordinatesOrFallBackTo): New function to
3795         normalize left/right values or fallback to the specified value if it is missing.
3796
3797 2018-08-06  Zan Dobersek  <zdobersek@igalia.com>
3798
3799         Unreviewed follow-up to r234594.
3800
3801         Add missing constructor and destructor definitions for the bunch of new
3802         classes that were added in that revision.
3803
3804         * platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
3805         (Nicosia::ContentLayer::ContentLayer):
3806         (Nicosia::BackingStore::BackingStore):
3807         (Nicosia::ImageBacking::ImageBacking):
3808
3809 2018-08-06  Zan Dobersek  <zdobersek@igalia.com>
3810
3811         [Nicosia] Add additional layer state classes, use impl-based approach to make them extendable
3812         https://bugs.webkit.org/show_bug.cgi?id=188341
3813
3814         Reviewed by Carlos Garcia Campos.
3815
3816         Add the ContentLayer, BackingStore and ImageBacking classes in the
3817         Nicosia namespace. State objects of CompositionLayer instances keep
3818         references to objects of these classes depending on the content that's
3819         presented in the associated GraphicsLayer.
3820
3821         ContentLayer derives from the PlatformLayer class. It's used for layers
3822         that display things like WebGL and HTML5 canvas and media content in a
3823         platform-specific way. In case of TextureMapper the hardware-accelerated
3824         content is piped into that rendering pipeline.
3825
3826         BackingStore is meant to represent the painted contents of a layer. The
3827         equivalent current functionality is using a tiled backing store that
3828         has its contents copied into the CoordinatedBackingStore instance.
3829
3830         ImageBacking is used for a layer whose content is a simple Image object.
3831         Image's pixel data is rasterized and again managed through
3832         CoordinatedBackingStore for rendering.
3833
3834         All these classes, along with the CompositionLayer class, should now be
3835         constructed with a factory function that returns an object that derives
3836         the class-specific Impl interface. This will allow for simpler
3837         implementation of different approaches in parallel. The TextureMapper
3838         variants will be the first ones, replicating the current behavior as it
3839         is implemented across classes in the CoordinatedGraphics and
3840         TextureMapper layers.
3841
3842         * platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
3843         (Nicosia::CompositionLayer::CompositionLayer):
3844         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
3845         (Nicosia::PlatformLayer::isContentLayer const):
3846         (Nicosia::CompositionLayer::Impl::isTextureMapperImpl const):
3847         (Nicosia::CompositionLayer::create):
3848         (Nicosia::CompositionLayer::impl const):
3849         (Nicosia::ContentLayer::Impl::isTextureMapperImpl const):
3850         (Nicosia::ContentLayer::create):
3851         (Nicosia::ContentLayer::impl const):
3852         (Nicosia::BackingStore::Impl::isTextureMapperImpl const):
3853         (Nicosia::BackingStore::create):
3854         (Nicosia::BackingStore::impl const):
3855         (Nicosia::ImageBacking::Impl::isTextureMapperImpl const):
3856         (Nicosia::ImageBacking::create):
3857         (Nicosia::ImageBacking::impl const):
3858         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3859         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
3860
3861 2018-08-06  Zan Dobersek  <zdobersek@igalia.com>
3862
3863         [Nicosia] Add Nicosia::Scene
3864         https://bugs.webkit.org/show_bug.cgi?id=188340
3865
3866         Reviewed by Carlos Garcia Campos.
3867
3868         Add the Nicosia::Scene class that controls the scene's state and enables
3869         thread-safe updates to that state.
3870
3871         The State struct itself holds a set of all the layers in the scene, and
3872         separates out the root layer specifically. An ID counter is also present
3873         there, allowing consumers of this state to easily check for any updates.
3874
3875         A reference to the Nicosia::Scene object now replaces the
3876         HashSet-and-root-layer pair in the CoordinatedGraphicsState struct.
3877
3878         * platform/TextureMapper.cmake:
3879         * platform/graphics/nicosia/NicosiaScene.cpp: Added.
3880         * platform/graphics/nicosia/NicosiaScene.h: Added.
3881         (Nicosia::Scene::create):
3882         (Nicosia::Scene::accessState):
3883         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3884
3885 2018-08-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
3886
3887         [GTK] Buttons are drawn too large, text not centered
3888         https://bugs.webkit.org/show_bug.cgi?id=185854
3889
3890         Reviewed by Carlos Garcia Campos.
3891
3892         Some pages require small buttons and the GTK theme was
3893         drawing only down to a minimum size.
3894
3895         No new tests required. Current layout tests and ManualTests/gtk/theme.html
3896         already cover it.
3897
3898         * platform/gtk/RenderThemeGadget.cpp:
3899         (WebCore::RenderThemeGadget::create):
3900         (WebCore::RenderThemeButtonGadget::RenderThemeButtonGadget): Added
3901         (WebCore::RenderThemeButtonGadget::minimumSize const):
3902         Allow sizes smaller than the minimum size.
3903         * platform/gtk/RenderThemeGadget.h:
3904         * platform/gtk/RenderThemeWidget.cpp:
3905         (WebCore::RenderThemeButton::RenderThemeButton):
3906
3907 2018-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3908
3909         Implement self.queueMicrotask in Workers
3910         https://bugs.webkit.org/show_bug.cgi?id=188247
3911
3912         Reviewed by Ryosuke Niwa.
3913
3914         This patch adds support for self.queueMicrotask to workers.
3915
3916         Tests: http/wpt/workers/queue-microtask.any.html
3917                http/wpt/workers/queue-microtask.any.worker.html
3918
3919         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
3920         (WebCore::JSWorkerGlobalScope::queueMicrotask):
3921         * page/DOMWindow.idl:
3922         Move queueMicrotask declaration to WindowOrWorkerGlobalScope.idl.
3923         * page/WindowOrWorkerGlobalScope.idl:
3924
3925 2018-08-05  Rob Buis  <rbuis@igalia.com>
3926
3927         [GTK][WPE] Fetch tests assert in SubresourceLoader::didReceiveResponse()
3928         https://bugs.webkit.org/show_bug.cgi?id=188163
3929
3930         Reviewed by Frédéric Wang.
3931
3932         Fetch in manual redirect mode uses didReceiveResponse instead of
3933         willSendRequestInternal, so update the ASSERT.
3934
3935         * loader/SubresourceLoader.cpp:
3936         (WebCore::SubresourceLoader::didReceiveResponse):
3937
3938 2018-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3939
3940         Add support for microtasks in workers
3941         https://bugs.webkit.org/show_bug.cgi?id=188246
3942
3943         Reviewed by Darin Adler.
3944
3945         This patch adds the microtask mechanism to workers. To adopt the existing microtask mechanism from the main thread,
3946         we extend JSMainThreadExecState for non-main-threads. We rename it to JSExecState, and store stacked
3947         ExecState* data in thread local storage in ThreadGlobalData instead of a static variable s_mainThreadState.
3948
3949         We add MicrotaskQueue to WorkerGlobalScope since each worker has its own thread and it should have its
3950         own microtask queue.
3951
3952         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
3953         * Sources.txt:
3954         * WebCore.xcodeproj/project.pbxproj:
3955         * bindings/js/JSBindingsAllInOne.cpp: