Unreviewed, silence "enumeral and non-enumeral type in conditional expression" warning
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-08-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2
3         Followup (r234683): Element::getAttribute() should return the first non-null attribute value
4         https://bugs.webkit.org/show_bug.cgi?id=188419
5
6         Reviewed by Darin Adler.
7
8         Element::getAttribute() should return the first non-null attribute value
9         since an empty string is a legitimate attribute value.
10
11         Test: svg/custom/href-svg-namespace-empty.html
12
13         * dom/Element.h:
14         (WebCore::Element::getAttribute const):
15
16 2018-08-13  Michael Catanzaro  <mcatanzaro@igalia.com>
17
18         Unreviewed, since -Wsign-compare warnings in URL.cpp
19
20         This regressed in r233798 when m_schemeEnd changed to a bitfield. The code looks safe to
21         me, so just silence the warnings with casts.
22
23         * platform/URL.cpp:
24         (WebCore::URL::setHost):
25         (WebCore::URL::setHostAndPort):
26         (WebCore::URL::setUser):
27         (WebCore::URL::setPass):
28
29 2018-08-13  Antti Koivisto  <antti@apple.com>
30
31         Use OptionSet more in editing code
32         https://bugs.webkit.org/show_bug.cgi?id=188500
33
34         Reviewed by Wenson Hsieh.
35
36         Typesafe flags.
37
38         * editing/CompositeEditCommand.cpp:
39         (WebCore::CompositeEditCommand::moveParagraphs):
40         * editing/Editor.cpp:
41         (WebCore::TemporarySelectionChange::TemporarySelectionChange):
42         (WebCore::Editor::replaceSelectionWithFragment):
43         (WebCore::Editor::appliedEditing):
44         (WebCore::Editor::selectComposition):
45         (WebCore::Editor::changeSelectionAfterCommand):
46         (WebCore::Editor::respondToChangedSelection):
47         * editing/Editor.h:
48         (WebCore::TemporarySelectionChange::TemporarySelectionChange):
49         * editing/FrameSelection.cpp:
50         (WebCore::FrameSelection::moveWithoutValidationTo):
51         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
52         (WebCore::FrameSelection::setSelection):
53         (WebCore::FrameSelection::setSelectedRange):
54         * editing/FrameSelection.h:
55         (WebCore::FrameSelection::defaultSetSelectionOptions):
56         * editing/MoveSelectionCommand.cpp:
57         (WebCore::MoveSelectionCommand::doApply):
58         * editing/ReplaceSelectionCommand.cpp:
59         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
60         * editing/ReplaceSelectionCommand.h:
61         (WebCore::ReplaceSelectionCommand::create):
62         * editing/SetSelectionCommand.cpp:
63         (WebCore::SetSelectionCommand::SetSelectionCommand):
64         * editing/SetSelectionCommand.h:
65         (WebCore::SetSelectionCommand::create):
66         * page/ContextMenuController.cpp:
67         (WebCore::ContextMenuController::contextMenuItemSelected):
68         * page/DragController.cpp:
69         (WebCore::DragController::concludeEditDrag):
70         * page/TextIndicator.cpp:
71         (WebCore::TextIndicator::createWithRange):
72
73 2018-08-13  Zalan Bujtas  <zalan@apple.com>
74
75         [LFC][Floating] Add basic clearance support
76         https://bugs.webkit.org/show_bug.cgi?id=188492
77
78         Reviewed by Antti Koivisto.
79
80         Adjust final position of a block level box with clearance when float is present.
81
82         Test: fast/block/block-only/floating-left-and-right-with-clearance.html
83
84         * layout/FloatingContext.cpp:
85         (WebCore::Layout::FloatingContext::positionForFloat const):
86         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
87         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
88         (WebCore::Layout::FloatingContext::toContainingBlock const):
89         (WebCore::Layout::FloatingContext::computePosition const): Deleted.
90         * layout/FloatingContext.h:
91         * layout/FloatingState.cpp:
92         (WebCore::Layout::FloatingState::bottom const):
93         * layout/FloatingState.h:
94         (WebCore::Layout::FloatingState::leftBottom const):
95         (WebCore::Layout::FloatingState::rightBottom const):
96         (WebCore::Layout::FloatingState::bottom const):
97         * layout/Verification.cpp:
98         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
99         * layout/blockformatting/BlockFormattingContext.cpp:
100         (WebCore::Layout::BlockFormattingContext::layout const):
101         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
102         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const):
103         * layout/blockformatting/BlockFormattingContext.h:
104         * layout/layouttree/LayoutBox.cpp:
105         (WebCore::Layout::Box::hasClearance const):
106         * layout/layouttree/LayoutBox.h:
107
108 2018-08-13  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
109
110         Expose CloseEvent and CustomEvent to workers
111         https://bugs.webkit.org/show_bug.cgi?id=188493
112
113         Reviewed by Sam Weinig.
114
115         This patch exposes CloseEvent and CustomEvent to workers.
116         It is OK since they do not depend on things in the main thread.
117         For example, we cannot expose FormData right now since it depends
118         on Page.
119
120         We do not expose PromiseRejectionEvent in this patch since it will
121         be done in [1].
122
123         [1]: https://bugs.webkit.org/show_bug.cgi?id=188265
124
125         * Modules/websockets/CloseEvent.idl:
126         * dom/CustomEvent.idl:
127
128 2018-08-13  Oriol Brufau  <obrufau@igalia.com>
129
130         [css-logical] Implement flow-relative margin, padding, border and sizing properties
131         https://bugs.webkit.org/show_bug.cgi?id=188386
132
133         Reviewed by Manuel Rego Casasnovas.
134
135         These properties provide the author with the ability to control margins
136         through logical, rather than physical, direction and dimension mappings.
137
138         Only longhand properties and border shorthands for specific sides are
139         implemented as part of this patch.
140
141         The existing prefixed properties become aliases of the new ones.
142
143         The change in WebCore::isLayoutDependent fixes an existing issue that
144         made getComputedStyle provide an old value for -webkit-logical-height
145         and -webkit-logical-height (see https://crbug.com/849855).
146
147         Tests: imported/w3c/web-platform-tests/css/css-logical/animation-001.html
148                imported/w3c/web-platform-tests/css/css-logical/animation-002.html
149                imported/w3c/web-platform-tests/css/css-logical/animation-003.tentative.html
150                imported/w3c/web-platform-tests/css/css-logical/cascading-001.html
151                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
152                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
153                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
154                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
155                imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
156                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
157                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
158                imported/w3c/web-platform-tests/css/css-logical/logical-box-size.html
159                imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size-vlr.html
160                imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size.html
161                imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size-vlr.html
162                imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size.html
163                imported/w3c/web-platform-tests/css/css-logical/logicalprops-quirklength.html
164
165         * css/CSSComputedStyleDeclaration.cpp:
166         (WebCore::isLayoutDependent):
167         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
168         * css/CSSProperties.json:
169         * css/CSSProperty.cpp:
170         (WebCore::CSSProperty::resolveDirectionAwareProperty):
171         (WebCore::CSSProperty::isDirectionAwareProperty):
172         * css/StyleProperties.cpp:
173         (WebCore::StyleProperties::getPropertyValue const):
174         * css/parser/CSSParserFastPaths.cpp:
175         (WebCore::isSimpleLengthPropertyID):
176         (WebCore::isColorPropertyID):
177         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
178         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
179         * css/parser/CSSPropertyParser.cpp:
180         (WebCore::CSSPropertyParser::parseSingleValue):
181         (WebCore::CSSPropertyParser::parseShorthand):
182         * html/HTMLTableElement.cpp:
183         (WebCore::HTMLTableElement::collectStyleForPresentationAttribute):
184         * rendering/RenderTableCell.cpp:
185         (WebCore::RenderTableCell::computeCollapsedStartBorder const):
186         (WebCore::RenderTableCell::computeCollapsedEndBorder const):
187         (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
188         (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
189
190 2018-08-12  Sihui Liu  <sihui_liu@apple.com>
191
192         CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient(WebCore::IDBServer::UniqueIDBDatabaseConnection&)
193         https://bugs.webkit.org/show_bug.cgi?id=188474
194
195         Reviewed by Chris Dumez.
196
197         UniqueIDBDatabaseConnection is refcounted by UniqueIDBDatabaseTransaction and it refcounts
198         UniqueIDBDatabaseTransaction. This cycle could make UniqueIDBDatabaseConnection outlives
199         UniqueIDBDatabase, so its reference to UniqueIDBDatabase may be stale. Calling a function
200         on a stale object is probably the reason of recent various storage process crashes in
201         indexedDB.
202
203         This patch makes m_database a WeakPtr and adds assertions that could help us debug the
204         crashes.
205
206         * Modules/indexeddb/server/IDBServer.cpp:
207         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
208         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
209         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
210         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
211         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
212         * Modules/indexeddb/server/UniqueIDBDatabase.h:
213         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
214         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
215         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
216         (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
217         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
218         (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer):
219         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
220         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
221         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
222         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
223         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
224         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
225         (WebCore::IDBServer::UniqueIDBDatabaseConnection::database):
226         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
227         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
228         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
229         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
230         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
231         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
232         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
233         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
234         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
235         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
236         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
237         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
238         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
239         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
240         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
241         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
242         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
243         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
244         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
245         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
246         * Modules/indexeddb/shared/IDBResultData.cpp:
247         (WebCore::IDBResultData::openDatabaseSuccess):
248         (WebCore::IDBResultData::openDatabaseUpgradeNeeded):
249
250 2018-08-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
251
252         Break reference cycle in ErrorEvent by using JSValueInWrappedObject
253         https://bugs.webkit.org/show_bug.cgi?id=188491
254
255         Reviewed by Darin Adler.
256
257         ErrorEvent should not use Strong<Unkonwn> to hold error JSValue. This patch integrates
258         JSValueInWrappedObject into ErrorEvent.
259
260         * Modules/webvr/VRDisplayEvent.h:
261         Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build.
262
263         * Sources.txt:
264         * WebCore.xcodeproj/project.pbxproj:
265         * bindings/js/JSErrorEventCustom.cpp: Copied from Source/WebCore/Modules/webvr/VRDisplayEvent.h.
266         (WebCore::JSErrorEvent::visitAdditionalChildren):
267         Add custom mark function for JSValueInWrappedObject.
268
269         * bindings/js/JSEventListener.h:
270         * bindings/js/WindowProxy.cpp:
271         Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build.
272
273         * dom/ErrorEvent.cpp:
274         (WebCore::ErrorEvent::ErrorEvent):
275         (WebCore::ErrorEvent::error):
276         (WebCore::ErrorEvent::trySerializeError):
277         Align the implementation to PushStateEvent::trySerializeState.
278
279         * dom/ErrorEvent.h:
280         * dom/ErrorEvent.idl:
281
282 2018-08-12  Aditya Keerthi  <akeerthi@apple.com>
283
284         [macOS] Color wells should appear pressed when presenting a color picker
285         https://bugs.webkit.org/show_bug.cgi?id=188477
286
287         Reviewed by Tim Horton.
288
289         Currently, when clicking on a color well, the color well loses its pressed
290         appearance once the mouse is lifted. Because of this behavior, the color well
291         does not appear to be active when the color picker is displayed.
292
293         Added the color-well -webkit-appearance value to control the drawing of the color
294         well separate from other buttons. Also added a new ControlState, named
295         PresentingState. A control can be in this state whenever it is presenting some
296         attached view. In the case of the color well this is the color picker. The
297         Information as to whether a form control is in the presenting state comes from
298         isPresentingAttachedView() in HTMLInputElement.
299
300         * css/CSSPrimitiveValueMappings.h:
301         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
302         * css/CSSProperties.json:
303         * css/CSSValueKeywords.in:
304         * css/html.css:
305         (input[type="color"]::-webkit-color-swatch):
306         * html/ColorInputType.cpp:
307         (WebCore::ColorInputType::isPresentingAttachedView const):
308         (WebCore::ColorInputType::elementDidBlur):
309         (WebCore::ColorInputType::didEndChooser):
310         * html/ColorInputType.h:
311         * html/HTMLInputElement.cpp:
312         (WebCore::HTMLInputElement::isPresentingAttachedView const):
313         * html/HTMLInputElement.h:
314         * html/InputType.cpp:
315         (WebCore::InputType::isPresentingAttachedView const):
316         * html/InputType.h:
317         * platform/ControlStates.h:
318         * platform/ThemeTypes.h:
319         * platform/mac/ThemeMac.mm:
320         (WebCore::updateStates):
321         (WebCore::setUpButtonCell):
322         (WebCore::paintColorWell):
323         (WebCore::ThemeMac::minimumControlSize const):
324         (WebCore::ThemeMac::controlBorder const):
325         (WebCore::ThemeMac::paint):
326         * rendering/RenderTheme.cpp:
327         (WebCore::RenderTheme::adjustStyle):
328         (WebCore::RenderTheme::paint):
329         (WebCore::RenderTheme::paintBorderOnly):
330         (WebCore::RenderTheme::paintDecorations):
331         (WebCore::RenderTheme::isControlStyled const):
332         (WebCore::RenderTheme::extractControlStatesForRenderer const):
333         (WebCore::RenderTheme::isPresenting const):
334         * rendering/RenderTheme.h:
335         * rendering/RenderThemeMac.mm:
336         (WebCore::RenderThemeMac::adjustRepaintRect):
337
338 2018-08-12  Zalan Bujtas  <zalan@apple.com>
339
340         [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent.
341         https://bugs.webkit.org/show_bug.cgi?id=188487
342
343         Reviewed by Antti Koivisto.
344
345         Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin.html
346
347         * layout/blockformatting/BlockMarginCollapse.cpp:
348         (WebCore::Layout::isMarginTopCollapsedWithParent):
349         (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
350
351 2018-08-10  Antti Koivisto  <antti@apple.com>
352
353         Use OptionSet for various RenderLayer flags
354         https://bugs.webkit.org/show_bug.cgi?id=188472
355         <rdar://problem/43153059>
356
357         Followup, fix some mistakes.
358
359         * rendering/RenderLayer.cpp:
360         (WebCore::RenderLayer::calculateClipRects const):
361         * rendering/RenderLayerBacking.cpp:
362         (WebCore::RenderLayerBacking::~RenderLayerBacking):
363
364 2018-08-10  Ryosuke Niwa  <rniwa@webkit.org>
365
366         [macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime
367         https://bugs.webkit.org/show_bug.cgi?id=188480
368
369         Reviewed by Simon Fraser.
370
371         Suppress the release assert in WebKit1 on macOS (isInWebProcess is always true in non-Cocoa platforms).
372
373         In the future, we should consider throwing Objective-C exceptions when third party apps call WebKit1
374         or WebKit2 APIs in non-main threads.
375
376         * platform/Timer.cpp:
377         (WebCore::shouldSuppressThreadSafetyCheck): Extracted out of ~TimerBase and setNextFireTime.
378         (WebCore::TimerBase::~TimerBase):
379         (WebCore::TimerBase::setNextFireTime):
380
381 2018-08-10  Daniel Bates  <dabates@apple.com>
382
383         Cleanup: Remove unnecessary code to resume animations from CachedFrameBase::restore()
384         https://bugs.webkit.org/show_bug.cgi?id=188459
385
386         Reviewed by Chris Dumez.
387
388         It is unnessary for CachedFrameBase::restore() to explicitly resume animations on the
389         document as it calls Document::resume(), which already does this.
390
391         No functionality changed. So, no new tests.
392
393         * history/CachedFrame.cpp:
394         (WebCore::CachedFrameBase::restore):
395
396 2018-08-10  Antti Koivisto  <antti@apple.com>
397
398         Use OptionSet for various RenderLayer flags
399         https://bugs.webkit.org/show_bug.cgi?id=188472
400
401         Reviewed by Simon Fraser.
402
403         Typesafe flags.
404
405         * html/shadow/MediaControlElements.cpp:
406         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
407         * page/FrameView.cpp:
408         (WebCore::updateLayerPositionFlags):
409         (WebCore::FrameView::paintContents):
410         * rendering/RenderLayer.cpp:
411         (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
412         (WebCore::RenderLayer::updateLayerPositions):
413         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
414         (WebCore::RenderLayer::paint):
415         (WebCore::paintForFixedRootBackground):
416         (WebCore::RenderLayer::paintLayer):
417         (WebCore::RenderLayer::paintLayerContentsAndReflection):
418         (WebCore::RenderLayer::filterPainter const):
419         (WebCore::RenderLayer::hasFilterThatIsPainting const):
420         (WebCore::RenderLayer::setupFilters):
421         (WebCore::RenderLayer::paintLayerContents):
422         (RenderLayer::paintLayerByApplyingTransform):
423         (RenderLayer::paintList):
424         (RenderLayer::updatePaintingInfoForFragments):
425         (RenderLayer::paintTransformedLayerIntoFragments):
426         (RenderLayer::calculateClipRects const):
427         (WebCore::RenderLayer::paintLayerByApplyingTransform): Deleted.
428         (WebCore::RenderLayer::paintList): Deleted.
429         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree const): Deleted.
430         (WebCore::RenderLayer::collectFragments): Deleted.
431         (WebCore::RenderLayer::updatePaintingInfoForFragments): Deleted.
432         (WebCore::RenderLayer::paintTransformedLayerIntoFragments): Deleted.
433         (WebCore::RenderLayer::paintBackgroundForFragments): Deleted.
434         (WebCore::RenderLayer::paintForegroundForFragments): Deleted.
435         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): Deleted.
436         (WebCore::RenderLayer::paintOutlineForFragments): Deleted.
437         (WebCore::RenderLayer::paintMaskForFragments): Deleted.
438         (WebCore::RenderLayer::paintChildClippingMaskForFragments): Deleted.
439         (WebCore::RenderLayer::paintOverflowControlsForFragments): Deleted.
440         (WebCore::RenderLayer::hitTest): Deleted.
441         (WebCore::RenderLayer::enclosingElement const): Deleted.
442         (WebCore::RenderLayer::enclosingFragmentedFlowAncestor const): Deleted.
443         (WebCore::computeZOffset): Deleted.
444         (WebCore::RenderLayer::createLocalTransformState const): Deleted.
445         (WebCore::isHitCandidate): Deleted.
446         (WebCore::RenderLayer::hitTestLayer): Deleted.
447         (WebCore::RenderLayer::hitTestContentsForFragments const): Deleted.
448         (WebCore::RenderLayer::hitTestResizerInFragments const): Deleted.
449         (WebCore::RenderLayer::hitTestTransformedLayerInFragments): Deleted.
450         (WebCore::RenderLayer::hitTestLayerByApplyingTransform): Deleted.
451         (WebCore::RenderLayer::hitTestContents const): Deleted.
452         (WebCore::RenderLayer::hitTestList): Deleted.
453         (WebCore::RenderLayer::updateClipRects): Deleted.
454         (WebCore::RenderLayer::clipRects const): Deleted.
455         (WebCore::RenderLayer::calculateClipRects const): Deleted.
456         (WebCore::showLayerTree): Deleted.
457         * rendering/RenderLayer.h:
458         * rendering/RenderLayerBacking.cpp:
459         (WebCore::RenderLayerBacking::updateCompositedBounds):
460         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
461         (WebCore::RenderLayerBacking::paintIntoLayer):
462         * rendering/RenderLayerBacking.h:
463         * rendering/RenderLayerCompositor.cpp:
464         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
465         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
466         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
467         * rendering/RenderLayerCompositor.h:
468         * rendering/RenderReplica.cpp:
469         (WebCore::RenderReplica::paint):
470
471 2018-08-10  Sihui Liu  <sihui_liu@apple.com>
472
473         CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose
474         https://bugs.webkit.org/show_bug.cgi?id=188461
475         <rdar://problem/33555052>
476
477         Reviewed by Chris Dumez.
478
479         When we try to schedule shutdown for database, we should cancel the timer so no 
480         scheduleShutdownForClose will be running after this.
481
482         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
483         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
484
485 2018-08-10  Daniel Bates  <dabates@apple.com>
486
487         Once <object> is hidden, its content won't be displayed again if its URL has fragment identifier ("#").
488         https://bugs.webkit.org/show_bug.cgi?id=187990
489
490         Reviewed by Simon Fraser.
491
492         Fixes an issue where an HTML object element that behaves like an iframe and references a resource
493         whose URL contains a fragment would not be repainted when its CSS display property changes. 
494
495         Rendering of an <object> that behaves like an iframe is handled by a widget (FrameView). When
496         the CSS display property for an <object> is set to "none" we detach the widget from its renderer
497         as part of destroying the render tree for the <object>. Subsequently changing the CSS display
498         to a non-"none"/"contents" value will create a new renderer for <object> R. For an <object> that
499         behaves like an iframe, we navigate to the resource associated with the <object> reusing the
500         existing Frame F object created when we first displayed the <object>. Unlike the case where
501         the URL of the resource does not contain a fragment, navigating to a fragment in the same document
502         uses a different code path that does not re-associate the FrameView of F with R before it scrolls
503         the view; => the FrameView of F is not in the view hierarchy. Therefore we do not paint anything
504         for the content of the <object> and hence the scroll is not observable. Instead we need to ensure
505         that the FrameView of F installed in the view hierarchy when navigating to an anchor in the same
506         document.
507
508         As a side benefit of this fix we now also repaint an <object> that is programmatically navigated
509         to a different anchor in the same document.
510
511         Tests: fast/repaint/object-as-iframe-hide-and-show-document-at-anchor.html
512                fast/repaint/object-as-iframe-navigate-to-same-document-anchor-repaint.html
513
514         * loader/FrameLoader.cpp:
515         (WebCore::FrameLoader::loadInSameDocument):
516
517 2018-08-10  Ali Juma  <ajuma@chromium.org>
518
519         [IntersectionObserver] Implement rootMargin parsing
520         https://bugs.webkit.org/show_bug.cgi?id=188469
521
522         Reviewed by Darin Adler.
523
524         Parse IntersectionObserver's rootMargin argument and throw an exception if it's invalid.
525         Change the stored rootMargin from a String to a LengthBox so that future patches can
526         use this value in intersection logic.
527
528         Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-attributes.html
529                    imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html
530                    intersection-observer/intersection-observer-interface.html
531
532         * page/IntersectionObserver.cpp:
533         (WebCore::parseRootMargin):
534         (WebCore::IntersectionObserver::create):
535         (WebCore::IntersectionObserver::IntersectionObserver):
536         (WebCore::IntersectionObserver::rootMargin const):
537         * page/IntersectionObserver.h:
538         (WebCore::IntersectionObserver::create): Deleted.
539         (WebCore::IntersectionObserver::rootMargin const): Deleted.
540         * page/IntersectionObserver.idl:
541
542 2018-08-09  Ben Richards  <benton_richards@apple.com>
543
544         We should cache the compiled sandbox profile in a data vault
545         https://bugs.webkit.org/show_bug.cgi?id=184991
546
547         Reviewed by Ryosuke Niwa.
548
549         Added functionality to FileHandle so that it can lock a file while open.
550         Added a function to FileSystem to delete non empty directories.
551
552         * platform/FileHandle.cpp:
553         (WebCore::FileHandle::FileHandle):
554         (WebCore::FileHandle::open):
555         (WebCore::FileHandle::close):
556         * platform/FileHandle.h:
557         * platform/FileSystem.h:
558         * platform/cocoa/FileSystemCocoa.mm:
559         (WebCore::FileSystem::deleteNonEmptyDirectory):
560
561 2018-08-09  Chris Dumez  <cdumez@apple.com>
562
563         InputType should not interact with an HTMLInputElement is no longer associated with
564         https://bugs.webkit.org/show_bug.cgi?id=188410
565
566         Reviewed by Ryosuke Niwa.
567
568         Clear InputType::m_element when the InputType is no longer associated with the HTMLInputElement
569         because the element changed type. We were already dealing with the InputType no longer being
570         associated with an element because the element died by using a WeakPtr. However, it is conceptually
571         better (more correct) to also clear this pointer if the element is still alive but associated with
572         another InputType.
573
574         * html/HTMLInputElement.cpp:
575         (WebCore::HTMLInputElement::updateType):
576         * html/InputType.h:
577         (WebCore::InputType::detachFromElement):
578
579 2018-08-09  Jer Noble  <jer.noble@apple.com>
580
581         Video playback is using more power
582         https://bugs.webkit.org/show_bug.cgi?id=188452
583         <rdar://problem/42298937>
584
585         Reviewed by Eric Carlson.
586
587         Test: TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm
588
589         When the meaning of PlatformMediaSession::Video changed to "video-only", we failed to update
590         MediaSessionManagerCocoa::updateSessionState() to use the new PlatformMediaSession::VideoAudio
591         enum, so Video-only sessions were getting the higher audio buffer size (where it's not needed)
592         and Video-and-Audio sessions were getting the default value.
593
594         To enable testing, add a preferredAudioBufferSize property to Internals. Also, the getter for
595         AudioSession::preferredBufferSize was using the wrong CoreAudio property address, and was
596         always returning 0.
597
598         * platform/audio/AudioSession.h:
599         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
600         (MediaSessionManagerCocoa::updateSessionState):
601         * platform/audio/mac/AudioSessionMac.cpp:
602         (WebCore::AudioSession::preferredBufferSize const):
603         * testing/Internals.cpp:
604         (WebCore::Internals::preferredAudioBufferSize const):
605         * testing/Internals.h:
606         * testing/Internals.idl:
607
608 2018-08-09  Saam Barati  <sbarati@apple.com>
609
610         memoryFootprint should return size_t not optional<size_t>
611         https://bugs.webkit.org/show_bug.cgi?id=188444
612
613         Reviewed by Simon Fraser.
614
615         * page/cocoa/ResourceUsageOverlayCocoa.mm:
616         (WebCore::ResourceUsageOverlay::platformDraw):
617
618 2018-08-09  Ali Juma  <ajuma@chromium.org>
619
620         Update IDL for IntersectionObserverEntry and IntersectionObserverEntryInit
621         https://bugs.webkit.org/show_bug.cgi?id=188445
622
623         Reviewed by Simon Fraser.
624
625         Update IntersectionObserverEntry by making rootBounds nullable, and adding an
626         isIntersecting attribute. Make the same changes to IntersectionObserverEntryInit,
627         and also add an intersectionRatio attribute.
628
629         Tested by intersection-observer/intersection-observer-entry-interface.html
630
631         * page/IntersectionObserverEntry.cpp:
632         (WebCore::IntersectionObserverEntry::IntersectionObserverEntry):
633         * page/IntersectionObserverEntry.h:
634         (WebCore::IntersectionObserverEntry::isIntersecting const):
635         * page/IntersectionObserverEntry.idl:
636
637 2018-08-09  Charlie Turner  <cturner@igalia.com>
638
639         Fix copyright headers on new ISO parsing class
640         https://bugs.webkit.org/show_bug.cgi?id=188432
641
642         Unreviewed fix.
643
644         This was left off from a previous bug by mistake, retrospectively
645         adding the correct copyright headers.
646
647         No tests required.
648
649         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
650         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
651
652 2018-08-08  Ross Kirsling  <ross.kirsling@sony.com>
653
654         run-bindings-tests is not Win32-compatible
655         https://bugs.webkit.org/show_bug.cgi?id=188424
656
657         Reviewed by Fujii Hironori.
658
659         * bindings/scripts/preprocessor.pm:
660         (applyPreprocessor):
661         Ensure that we fall back to cl.exe if CC env var is not set on Windows.
662
663 2018-08-08  Ryosuke Niwa  <rniwa@webkit.org>
664
665         REGRESSION (r228260): Events handled by input method invoke default event handler
666         https://bugs.webkit.org/show_bug.cgi?id=188370
667
668         Reviewed by Wenson Hsieh.
669
670         The bug was caused by the default event handler being invoked for the "virtual" keydown events
671         generated for input methods. Namely, when Japanese or Chinese input methods swallows TAB key,
672         WebKit should not invoke the default event handler and move the focus during input composition.
673
674         Fixed the bug by adding a new boolean on Event indicating whether the default event handler
675         should be invoked, and restoring the behavior prior to r228260 for these virtual keydown events.
676
677         Test: editing/input/press-tab-during-ime-composition.html
678
679         * dom/Event.h:
680         (WebCore::Event::isDefaultEventHandlerIgnored const): Added.
681         (WebCore::Event::setIsDefaultEventHandlerIgnored): Added.
682         * dom/EventDispatcher.cpp:
683         (WebCore::EventDispatcher::dispatchEvent): Don't invoke the default event handler if
684         isDefaultEventHandlerIgnored is set.
685         * page/EventHandler.cpp:
686         (WebCore::EventHandler::internalKeyEvent): Set isDefaultEventHandlerIgnored. This restores WebKit's
687         behavior prior to r228260.
688
689 2018-08-08  Justin Fan  <justin_fan@apple.com>
690
691         Prevent collectScreenProperties from crashing Base System
692         https://bugs.webkit.org/show_bug.cgi?id=188429
693         <rdar://problem/43075662>
694
695         Reviewed by Simon Fraser.
696
697         Adding some error-checking and early returns to further prevent calling CGLDescribeRenderer with invalid parameters.
698
699         Existing WebGL tests should cover; no expected change in behavior. Crash happened primarily on Base System.
700
701         * platform/mac/PlatformScreenMac.mm:
702         (WebCore::gpuIDForDisplayMask):
703
704 2018-08-08  Don Olmstead  <don.olmstead@sony.com>
705
706         [Curl] Surface additional NetworkLoadMetrics
707         https://bugs.webkit.org/show_bug.cgi?id=188391
708
709         Reviewed by Joseph Pecoraro.
710
711         * platform/network/curl/CurlContext.cpp:
712         (WebCore::CurlHandle::getNetworkLoadMetrics):
713
714 2018-08-08  Don Olmstead  <don.olmstead@sony.com>
715
716         [Nicosia] Add the Nicosia-specific PlatformLayer type alias
717         https://bugs.webkit.org/show_bug.cgi?id=188405
718         <rdar://problem/43039520>
719
720         Unreviewed build fix.
721
722         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
723
724 2018-08-08  Simon Fraser  <simon.fraser@apple.com>
725
726         Add a WebKit2 logging channel for ActivityState
727         https://bugs.webkit.org/show_bug.cgi?id=188411
728
729         Reviewed by Tim Horton.
730
731         Add logging for ActivityState changes and the entrypoints that affect ActivityState.
732         
733         * Sources.txt:
734         * WebCore.xcodeproj/project.pbxproj:
735         * page/ActivityState.cpp: Added.
736         (WebCore::activityStateFlagsToString):
737         * page/ActivityState.h:
738
739 2018-08-08  Eric Carlson  <eric.carlson@apple.com>
740
741         Add LogArgument template for PlatformMediaSession::RemoteControlCommandType
742         https://bugs.webkit.org/show_bug.cgi?id=188314
743
744         Reviewed by Alex Christensen.
745
746         * html/HTMLMediaElement.cpp:
747         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Don't coerce to int for logging.
748
749         * platform/audio/PlatformMediaSession.cpp:
750         (WebCore::convertEnumerationToString): New.
751         (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Log command.
752         * platform/audio/PlatformMediaSession.h:
753         (WTF::LogArgument<WebCore::PlatformMediaSession::RemoteControlCommandType>::toString):
754
755 2018-08-08  Joseph Pecoraro  <pecoraro@apple.com>
756
757         Web Inspector: XHR content sometimes shows as error even though load succeeded
758         https://bugs.webkit.org/show_bug.cgi?id=188385
759         <rdar://problem/42646160>
760
761         Reviewed by Devin Rousso.
762
763         * inspector/agents/InspectorNetworkAgent.cpp:
764         (WebCore::InspectorNetworkAgent::didReceiveData):
765         Avoid a double hash lookup in the common case.
766         Allow synchronous XHR to have text data appended in the normal case.
767         Allow synchronous XHR to set base64 encoded data right here for non-text data.
768
769         * inspector/NetworkResourcesData.h:
770         (WebCore::NetworkResourcesData::ResourceData::hasBufferedData const):
771         Getter to see if data is buffered or not for this resource.
772
773         * inspector/NetworkResourcesData.cpp:
774         (WebCore::NetworkResourcesData::maybeAddResourceData):
775         Return the updated ResourceData to avoid clients having to do a lookup.
776
777 2018-08-08  Sihui Liu  <sihui_liu@apple.com>
778
779         Assertion failed in Webcore::Process::setIdentifier()
780         https://bugs.webkit.org/show_bug.cgi?id=188404
781         <rdar://problem/43029137>
782
783         Reviewed by Chris Dumez.
784
785         App using both WebKit1 and WebKit may crash in WebKit initialization.
786
787         * platform/Process.cpp:
788         (WebCore::Process::setIdentifier):
789
790 2018-08-08  Charlie Turner  <cturner@igalia.com>
791
792         Add CENC sanitization
793         https://bugs.webkit.org/show_bug.cgi?id=188376
794
795         Reviewed by Xabier Rodriguez-Calvar.
796
797         This patch adds support for sanitizing the CENC initialization
798         data, to ensure there are no obviously bogus values in the
799         untrusted input from generateRequest, see
800         https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest
801         for more details on sanitization.
802
803         Tested by imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
804
805         * Modules/encryptedmedia/InitDataRegistry.cpp: The diff looks a
806         bit wonky because I had to reorder extractKeyIDsCenc to come
807         before sanitizeCenc.
808         (WebCore::extractKeyIDsCenc): Added implementation, a nullopt
809         return value here indicates the parsing found an error in the box
810         values.
811         (WebCore::sanitizeCenc): Added implementation, if the box can be
812         parsed, return a copy of the buffer as before, otherwise an error
813         value.
814         * Sources.txt: Add the new PSSH box type.
815         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
816         Added, parsing methods come from ISO/IEC 23001-7-2016 Section
817         8.1.1.
818         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse): Ditto.
819         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h: Ditto.
820         (WebCore::ISOProtectionSystemSpecificHeaderBox::boxTypeName): Ditto.
821         (WebCore::ISOProtectionSystemSpecificHeaderBox::systemID const): Ditto.
822         (WebCore::ISOProtectionSystemSpecificHeaderBox::keyIDs const):
823         Ditto.
824         (WebCore::ISOProtectionSystemSpecificHeaderBox::data const): Ditto.
825
826 2018-08-08  Zan Dobersek  <zdobersek@igalia.com>
827
828         [Nicosia] Add the Nicosia-specific PlatformLayer type alias
829         https://bugs.webkit.org/show_bug.cgi?id=188405
830
831         Reviewed by Carlos Garcia Campos.
832
833         Add a Nicosia-specific PlatformLayer type alias that points to the
834         Nicosia::PlatformLayer type. This is guarded by the USE(NICOSIA) macro,
835         which guards additional code in this patch but will be added to other
836         Nicosia-specific classes later.
837
838         To keep things buildable when USE(NICOSIA) is defined, additional
839         changes are made to classes that operate with platform layers.
840         Cairo-specific ImageBuffer implementation and the related
841         ImageBufferData class are modified to work with a Nicosia::ContentLayer
842         object. This object is using the TextureMapper-specific Impl class which
843         internally keeps a TextureMapperPlatformLayerProxy object. This way
844         we can reuse existing code that also works with an object of this type,
845         only difference is where the proxy object is kept. Main difference is in
846         the ImageBuffer::platformLayer() method, where pointer to the
847         Nicosia::ContentLayer object is returned when USE(NICOSIA) is enabled.
848
849         Similar approach is taked for the MediaPlayerPrivateGStreamerBase class.
850         When USE(NICOSIA) is enabled, a Nicosia::ContentLayer object is
851         constructed, and with the TextureMapper-specific Impl we again operate
852         on the TextureMapperPlatformLayerProxy object like before, so all of
853         the proxy-specific code is bundled into helper lambdas that operate on
854         the given proxy object. In the platformLayer() method, we again return
855         pointer to the Nicosia::ContentLayer object when USE(NICOSIA) is on.
856
857         For the GraphicsContext3D integration, we have to provide a separate
858         class that replicates most of the functionality currently present in the
859         TextureMapperGC3DPlatformLayer class. Main difference is that in the new
860         Nicosia::GC3DLayer class, a Nicosia::ContentLayer object is spawned with
861         the TextureMapper-specific Impl. The proxy object held by that Impl is
862         then again used to push new buffers into the rendering pipeline. As
863         before, pointer to the Nicosia::ContentLayer is returned in the
864         GraphicsContext3D::platformLayer() object.
865
866         Integration of the GraphicsContext3D class into Nicosia layering needs
867         further work in the future. Target should be providing a class that is
868         not specific to the TextureMapper layer. Additionally, when USE(NICOSIA)
869         is enabled, we remove the TextureMapperGC3DPlatformLayer class from
870         compilation since it depends on a PlatformLayer type alias to the
871         TextureMapperPlatformLayerProxyProvider class.
872
873         This patch also doesn't address the abundance of macros that this code
874         now uses. While USE(NICOSIA) is introduced, we have to work around
875         four additional macros in this code: USE(TEXTURE_MAPPER),
876         USE(TEXTURE_MAPPER_GL), USE(COORDINATED_GRAPHICS) and
877         USE(COORDINATED_GRAPHICS_THREADED). In a lot of places these are used
878         interchangeably, but they should be merged and simplified in use. I hope
879         to approach this once the USE(NICOSIA) functionality lands and is turned
880         on for ports that currently build with USE(COORDINATED_GRAPHICS).
881
882         * platform/TextureMapper.cmake:
883         * platform/graphics/GraphicsContext3D.h:
884         * platform/graphics/PlatformLayer.h:
885         * platform/graphics/cairo/ImageBufferCairo.cpp:
886         (WebCore::ImageBufferData::ImageBufferData):
887         (WebCore::ImageBufferData::~ImageBufferData):
888         (WebCore::ImageBufferData::swapBuffersIfNeeded):
889         (WebCore::ImageBuffer::platformLayer const):
890         * platform/graphics/cairo/ImageBufferDataCairo.h:
891         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
892         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
893         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
894         (WebCore::MediaPlayerPrivateGStreamerBase::platformLayer const):
895         (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
896         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
897         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
898         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
899         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
900         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp: Added.
901         (Nicosia::GC3DLayer::GC3DLayer):
902         (Nicosia::GC3DLayer::~GC3DLayer):
903         (Nicosia::GC3DLayer::makeContextCurrent):
904         (Nicosia::GC3DLayer::platformContext):
905         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
906         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.h: Added.
907         (Nicosia::GC3DLayer::contentLayer const):
908         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
909         (WebCore::GraphicsContext3D::GraphicsContext3D):
910         (WebCore::GraphicsContext3D::makeContextCurrent):
911         (WebCore::GraphicsContext3D::platformGraphicsContext3D):
912         (WebCore::GraphicsContext3D::platformLayer const):
913         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
914         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
915         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
916         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
917         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
918         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
919
920 2018-08-08  Manuel Rego Casasnovas  <rego@igalia.com>
921
922         [css-grid] Update behavior of percentage row tracks and gutters
923         https://bugs.webkit.org/show_bug.cgi?id=188403
924
925         Reviewed by Sergio Villar Senin.
926
927         The CSSWG decided to change how percentage row tracks and gutters
928         in a grid container with indefinite height are resolved.
929
930         The CSSWG issues are:
931         - https://github.com/w3c/csswg-drafts/issues/1921
932         - https://github.com/w3c/csswg-drafts/issues/509
933
934         So far they were resolved as "auto", like it happens with
935         percentage heights in regular blocks. But now they're going to behave
936         similar to what happens in the columns axis, they would be ignored
937         to compute the intrinsic height.
938         This causes that we need to repeat the track sizing algorithm
939         when we have a grid container with indefinite height
940         that has some percentage rows using the intrinsic height
941         calculated on the first pass. Then the percentages will be resolved
942         against the intrinsic height.
943
944         Tests: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-second-pass-001.html
945                imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-second-pass-002.html
946                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-percentage-rows-indefinite-height-001.html
947                imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-percentage-rows-indefinite-height-002.html
948
949         * rendering/GridTrackSizingAlgorithm.cpp:
950         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
951         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
952         (WebCore::GridTrackSizingAlgorithm::setup):
953         (WebCore::GridTrackSizingAlgorithm::reset):
954         * rendering/GridTrackSizingAlgorithm.h:
955         * rendering/RenderGrid.cpp:
956         (WebCore::RenderGrid::availableSpaceForGutters const):
957         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
958         (WebCore::RenderGrid::layoutBlock):
959
960 2018-08-07  Saam Barati  <sbarati@apple.com>
961
962         ResourceUsageOverlay should use physical footprint for its "Footprint" label
963         https://bugs.webkit.org/show_bug.cgi?id=188395
964
965         Reviewed by Simon Fraser.
966
967         Let's use physical footprint on Cocoa for the number we say is "footprint".
968         Before, we were just using the number of dirty pages multiplies by
969         page size. This number was an upper bound on footprint since it
970         doesn't take into account compressed memory.
971
972         * page/cocoa/ResourceUsageOverlayCocoa.mm:
973         (WebCore::ResourceUsageOverlay::platformDraw):
974
975 2018-08-05  Darin Adler  <darin@apple.com>
976
977         [Cocoa] More tweaks and refactoring to prepare for ARC
978         https://bugs.webkit.org/show_bug.cgi?id=188245
979
980         Reviewed by Dan Bernstein.
981
982         * bridge/objc/objc_instance.mm: Updated include for rename: FoundationSPI.h -> objcSPI.h.
983         * platform/ios/wak/WebCoreThread.mm: Ditto.
984
985 2018-08-07  Chris Dumez  <cdumez@apple.com>
986
987         navigator.sendBeacon does not work in pagehide callbacks
988         https://bugs.webkit.org/show_bug.cgi?id=188329
989
990         Reviewed by Alex Christensen.
991
992         Add support for sending beacons from pagehide event handlers. We normally do not allow loads because we're
993         about to enter PageCache. However, in case of Beacon, this is fine since it uses PingLoad and does not
994         WebCore to do the load.
995
996         Test: http/wpt/beacon/sendBeacon-in-pagehide.html
997
998         * loader/cache/CachedResource.cpp:
999         (WebCore::CachedResource::load):
1000         - Allow Beacon loads to go through even if the document's pageCacheState is AboutToEnterPageCache (i.e.
1001         we're firing the 'pagehide' event)
1002         - Allow Becon loads to go though even if the FrameLoader's state is provisional (i.e. a load is pending)
1003
1004 2018-08-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
1005
1006         Allow href attribute without xlink on SVG elements
1007         https://bugs.webkit.org/show_bug.cgi?id=153854
1008
1009         Reviewed by Dean Jackson.
1010
1011         SVG 2 has moved the href attribute from xlink namespace to svg namespace.
1012         Instead of using xlink:href, svg:href should be used or simply use href 
1013         if the svg namespace is defined.
1014
1015         See https://www.w3.org/TR/SVG2/linking.html#XLinkRefAttrs.
1016
1017         For backward compatibility, xlink:href will be treated as an alias to href
1018         till it is acceptable to completely remove the support for the deprecated 
1019         xlink:href.
1020
1021         Tests: svg/custom/href-svg-namespace-animate.svg
1022                svg/custom/href-svg-namespace-dynamic.svg
1023                svg/custom/href-svg-namespace-elements.html
1024                svg/custom/href-svg-namespace-expected.svg
1025                svg/custom/href-svg-namespace-static.svg
1026
1027         * dom/Element.cpp:
1028         (WebCore::Element::absoluteLinkURL const):
1029         * dom/Element.h:
1030         (WebCore::Element::getAttribute const): This new template function with
1031         template pack parameter QualifiedNames is added to return the first none
1032         empty attribute value given a set of attributes' names. This should be
1033         useful for deprecated attributes. When we decide to remove the support 
1034         for the deprecated attribute, all we need is to remove it as a parameter
1035         to getAttribute(). In this case, the none template function will be called.
1036         * dom/VisitedLinkState.cpp:
1037         (WebCore::linkAttribute):
1038         * html/parser/XSSAuditor.cpp:
1039         (WebCore::XSSAuditor::filterScriptToken):
1040         * svg/SVGAElement.cpp:
1041         (WebCore::SVGAElement::isURLAttribute const):
1042         * svg/SVGAltGlyphElement.cpp:
1043         (WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
1044         * svg/SVGCursorElement.cpp:
1045         * svg/SVGDocumentExtensions.cpp:
1046         (WebCore::SVGDocumentExtensions::rebuildElements):
1047         (WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget):
1048         * svg/SVGElement.cpp:
1049         (WebCore::SVGElement::animatableAttributeForName):
1050         * svg/SVGFEImageElement.cpp:
1051         * svg/SVGFilterElement.cpp:
1052         * svg/SVGFontFaceUriElement.cpp:
1053         (WebCore::SVGFontFaceUriElement::srcValue const):
1054         (WebCore::SVGFontFaceUriElement::parseAttribute):
1055         (WebCore::SVGFontFaceUriElement::loadFont):
1056         * svg/SVGForeignObjectElement.cpp:
1057         * svg/SVGGlyphRefElement.cpp:
1058         (WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
1059         * svg/SVGGradientElement.cpp:
1060         * svg/SVGImageElement.cpp:
1061         (WebCore::SVGImageElement::imageSourceURL const):
1062         * svg/SVGMPathElement.cpp:
1063         * svg/SVGPatternElement.cpp:
1064         * svg/SVGScriptElement.h:
1065         * svg/SVGTRefElement.cpp:
1066         * svg/SVGTextPathElement.cpp:
1067         * svg/SVGURIReference.cpp:
1068         (WebCore::SVGURIReference::registerAttributes):
1069         (WebCore::SVGURIReference::parseAttribute):
1070         * svg/SVGUseElement.cpp:
1071         (WebCore::SVGUseElement::expandUseElementsInShadowTree const):
1072         * svg/animation/SVGSMILElement.cpp:
1073         (WebCore::SVGSMILElement::isSupportedAttribute):
1074         (WebCore::SVGSMILElement::svgAttributeChanged):
1075         * svg/svgattrs.in:
1076
1077 2018-08-07  Ryosuke Niwa  <rniwa@webkit.org>
1078
1079         document.open and document.write must throw while the HTML parser is synchronously constructing a custom element
1080         https://bugs.webkit.org/show_bug.cgi?id=187319
1081         <rdar://problem/42843012>
1082
1083         Reviewed by Frédéric Wang.
1084
1085         Make document.open, document.write, document.writeln, and document.close throw InvalidStateError during
1086         a synchronous custom element construction as specified:
1087         https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
1088         https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter
1089
1090         Tests: fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html
1091                fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html
1092
1093         * WebCore.xcodeproj/project.pbxproj:
1094         * dom/Document.cpp:
1095         (WebCore::Document::openForBindings): Throw InvalidStateError when m_throwOnDynamicMarkupInsertionCount is non-zero.
1096         (WebCore::Document::closeForBindings): Ditto.
1097         (WebCore::Document::write): Ditto.
1098         (WebCore::Document::writeln): Ditto.
1099         * dom/Document.h: Re-ordered the related instance variables in the order they appear in the spec, and updated spec URLs.
1100         * dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h: Added.
1101         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer): Added.
1102         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::ThrowOnDynamicMarkupInsertionCountIncrementer):
1103         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::~ThrowOnDynamicMarkupInsertionCountIncrementer):
1104         * html/parser/HTMLDocumentParser.cpp:
1105         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate ThrowOnDynamicMarkupInsertionCountIncrementer.
1106
1107 2018-08-07  Alex Christensen  <achristensen@webkit.org>
1108
1109         Use 1-byte enum class for Document::StandaloneStatus
1110         https://bugs.webkit.org/show_bug.cgi?id=188352
1111
1112         Reviewed by Chris Dumez.
1113
1114         * dom/Document.cpp:
1115         (WebCore::Document::setXMLStandalone):
1116         * dom/Document.h:
1117         (WebCore::Document::xmlStandalone const):
1118         * editing/MarkupAccumulator.cpp:
1119         (WebCore::MarkupAccumulator::appendXMLDeclaration):
1120
1121 2018-08-07  Rob Buis  <rbuis@igalia.com>
1122
1123         fetch() with subresource integrity crashes on zero length body
1124         https://bugs.webkit.org/show_bug.cgi?id=184325
1125
1126         Reviewed by Alex Christensen.
1127
1128         Check that resourceBuffer() is non null before dereferencing.
1129
1130         Tests: http/tests/subresource-integrity/sri-fetch.js
1131                http/tests/subresource-integrity/sri-fetch-worker.js
1132
1133         * loader/DocumentThreadableLoader.cpp:
1134         (WebCore::DocumentThreadableLoader::didFinishLoading):
1135
1136 2018-08-07  Justin Fan  <justin_fan@apple.com>
1137
1138         Prevent querying for renderer info for disconnected or uninitialized displays
1139         https://bugs.webkit.org/show_bug.cgi?id=188387
1140         <rdar://problem/42588769>
1141
1142         Reviewed by Simon Fraser.
1143
1144         Calling CGL functions with a NULL displayMask crashes the process.
1145
1146         No tests; requires multiple displays.
1147
1148         * platform/mac/PlatformScreenMac.mm:
1149         (WebCore::collectScreenProperties):
1150
1151 2018-08-06  Ryosuke Niwa  <rniwa@webkit.org>
1152
1153         document.open and document.write must throw while the HTML parser is synchronously constructing a custom element
1154         https://bugs.webkit.org/show_bug.cgi?id=187319
1155         <rdar://problem/42843012>
1156
1157         Reviewed by Frédéric Wang.
1158
1159         Make document.open, document.write, document.writeln, and document.close throw InvalidStateError during
1160         a synchronous custom element construction as specified:
1161         https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
1162         https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter
1163
1164         Tests: fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html
1165                fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html
1166
1167         * WebCore.xcodeproj/project.pbxproj:
1168         * dom/Document.cpp:
1169         (WebCore::Document::openForBindings): Throw InvalidStateError when m_throwOnDynamicMarkupInsertionCount is non-zero.
1170         (WebCore::Document::closeForBindings): Ditto.
1171         (WebCore::Document::write): Ditto.
1172         (WebCore::Document::writeln): Ditto.
1173         * dom/Document.h: Re-ordered the related instance variables in the order they appear in the spec, and updated spec URLs.
1174         * dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h: Added.
1175         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer): Added.
1176         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::ThrowOnDynamicMarkupInsertionCountIncrementer):
1177         (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::~ThrowOnDynamicMarkupInsertionCountIncrementer):
1178         * html/parser/HTMLDocumentParser.cpp:
1179         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate ThrowOnDynamicMarkupInsertionCountIncrementer.
1180
1181 2018-08-07  Ryan Haddad  <ryanhaddad@apple.com>
1182
1183         Unreviewed, suppress warnings to fix the build.
1184
1185         * crypto/CommonCryptoUtilities.cpp:
1186         (WebCore::getCommonCryptoDigestAlgorithm):
1187
1188 2018-08-07  Alex Christensen  <achristensen@webkit.org>
1189
1190         Removed unused *AllInOne.cpp
1191         https://bugs.webkit.org/show_bug.cgi?id=188369
1192
1193         Reviewed by Yusuke Suzuki.
1194
1195         * accessibility/AccessibilityAllInOne.cpp: Removed.
1196         * bindings/js/JSBindingsAllInOne.cpp: Removed.
1197         * css/CSSAllInOne.cpp: Removed.
1198         * dom/DOMAllInOne.cpp: Removed.
1199         * editing/EditingAllInOne.cpp: Removed.
1200         * html/HTMLElementsAllInOne.cpp: Removed.
1201         * inspector/InspectorAllInOne.cpp: Removed.
1202         * loader/appcache/ApplicationCacheAllInOne.cpp: Removed.
1203         * mathml/MathMLAllInOne.cpp: Removed.
1204         * platform/text/TextAllInOne.cpp: Removed.
1205         * rendering/RenderingAllInOne.cpp: Removed.
1206         * rendering/style/StyleAllInOne.cpp: Removed.
1207         * rendering/svg/RenderSVGAllInOne.cpp: Removed.
1208         * svg/SVGAllInOne.cpp: Removed.
1209
1210 2018-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1211
1212         [WPE][GTK] Handle some virtual keys commonly used on TVs
1213         https://bugs.webkit.org/show_bug.cgi?id=188375
1214
1215         Reviewed by Žan Doberšek.
1216
1217         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1218         (WebCore::PlatformKeyboardEvent::keyValueForGdkKeyCode):
1219         (WebCore::PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode):
1220         * platform/wpe/PlatformKeyboardEventWPE.cpp:
1221         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
1222         (WebCore::PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode):
1223
1224 2018-08-07  Zan Dobersek  <zdobersek@igalia.com>
1225
1226         [Nicosia] Add Nicosia::CompositionLayerTextureMapperImpl
1227         https://bugs.webkit.org/show_bug.cgi?id=188348
1228
1229         Reviewed by Carlos Garcia Campos.
1230
1231         Add the Nicosia::CompositionLayerTextureMapperImpl class, the
1232         TextureMapper-specific implementation that will extend the
1233         CompositionLayer class.
1234
1235         The important deatil of this implementation is the TextureMapperLayer
1236         object that's expected to be managed by the composition controller. As
1237         such, it is placed inside the CompositionState struct to clearly
1238         indicate its utility and expected place of management. In the current
1239         setup, this place would be the CoordinatedGraphicsScene class.
1240
1241         The Nicosia::CompositionLayer object that's spawned for each
1242         CoordinatedGraphicsLayer instance is now switched to using the
1243         CompositionLayerTextureMapperImpl object, with the local temporary no-op
1244         CompositionLayer::Impl class removed.
1245
1246         * platform/TextureMapper.cmake:
1247         * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp: Added.
1248         (Nicosia::CompositionLayerTextureMapperImpl::createFactory):
1249         * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h: Added.
1250         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1251         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
1252         (): Deleted.
1253
1254 2018-08-07  Zan Dobersek  <zdobersek@igalia.com>
1255
1256         [Nicosia] Add the TextureMapper-specific ContentLayer::Impl derivative
1257         https://bugs.webkit.org/show_bug.cgi?id=188344
1258
1259         Reviewed by Carlos Garcia Campos.
1260
1261         Add Nicosia::ContentLayerTextureMapperImpl class, providing the
1262         TextureMapper-specific implementation that derives from the
1263         ContentLayer::Impl class and which can be used by the
1264         Nicosia::ContentLayer instances.
1265
1266         Internally a TextureMapperPlatformLayerProxy is created, and is
1267         accessible to others through a getter. This way the content producers
1268         can push new buffers into this proxy object, and the scene compositor
1269         can take these buffers for display purposes.
1270
1271         Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded() will be
1272         called during layer flushes, and the call will cause the content layer
1273         clients to take their texture, wrap it into a buffer, and push it into
1274         the TextureMapperPlatformLayerProxy object. At the moment this operation
1275         is required by the ImageBuffer and GraphicsContext3D producers.
1276
1277         The Client object is managed under its own lock. While the producers
1278         will only live on the main thread, the thread-safe check in the
1279         destructor is necessary in case the ContentLayerTextureMapperImpl object
1280         ends up being destroyed on some other thread.
1281
1282         The patch only adds the class implementation. It will be integrated into
1283         the layer tree later, once all the other pieces of the puzzle land.
1284
1285         * platform/TextureMapper.cmake:
1286         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: Added.
1287         (Nicosia::ContentLayerTextureMapperImpl::createFactory):
1288         (Nicosia::ContentLayerTextureMapperImpl::ContentLayerTextureMapperImpl):
1289         (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl):
1290         (Nicosia::ContentLayerTextureMapperImpl::invalidateClient):
1291         (Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded):
1292         * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h: Added.
1293
1294 2018-08-07  Frederic Wang  <fwang@igalia.com>
1295
1296         Make DOMWindow::scrollBy rely on DOMWindow::scrollTo
1297         https://bugs.webkit.org/show_bug.cgi?id=188343
1298
1299         Reviewed by Darin Adler.
1300
1301         This patch makes DOMWindow::scrollBy rely on DOMWindow::scrollTo in order to perform actual
1302         scrolling of the view. In particular, this reduces the number of code path to modify in order
1303         to implement the ScrollBehavior option (bug 188043). The only change is an optimization when
1304         scrolling to position (0, 0) but it is not observable.
1305
1306         No new tests, behavior unchanged and already tested.
1307
1308         * page/DOMWindow.cpp:
1309         (WebCore::DOMWindow::scrollBy const): Add the current view position to the scrollBy offset in
1310         order to obtain the scrollTo offset.
1311
1312 2018-08-04  Ryosuke Niwa  <rniwa@webkit.org>
1313
1314         Add CEReactions=NotNeeded for reactions only needed for customized builtins
1315         https://bugs.webkit.org/show_bug.cgi?id=187851
1316
1317         Reviewed by Chris Dumez.
1318
1319         Because WebKit doesn't and will not support customized builtin elements, there are many DOM APIs marked with
1320         [CEReactions] which don't actually need CustomElementReactionStack.
1321
1322         To clarify and document this difference, this patch introduces WebKit extention: [CEReactions=NotNeeded].
1323         When this IDL attribute is specified, we generate CustomElementReactionDisallowedScope in the bindings code
1324         to assert that there are no custom elements reactions being enqueued within the DOM API.
1325
1326         We suppress this assertion in CustomElementReactionStack since a DOM API with [CEReactions=NotNeeded] can
1327         synchronously fire an event and otherwise execute arbirary scripts, which in turn could invoke a DOM API
1328         with [CEReactions].
1329
1330         This patch deployes this change to HTMLIFrameElement since "src" IDL attribute triggers this second scenario.
1331
1332         Test: fast/custom-elements/custom-element-reaction-within-disallowed-scope.html
1333
1334         * bindings/scripts/CodeGeneratorJS.pm:
1335         (GeneratePut):
1336         (GeneratePutByIndex):
1337         (GenerateDefineOwnProperty):
1338         (GenerateDeletePropertyCommon):
1339         (GenerateAttributeSetterBodyDefinition):
1340         (GenerateCustomElementReactionsStackIfNeeded): Added. Generate CustomElementReactionStack for [CEReactions]
1341         and CustomElementReactionDisallowedScope for [CEReactions=NotNeeded].
1342         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1343         * bindings/scripts/test/TestCEReactions.idl: Added test cases for [CEReactions=NotNeeded].
1344         * bindings/scripts/test/TestCEReactionsStringifier.idl: Ditto.
1345         * dom/CustomElementReactionQueue.cpp:
1346         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Added an assertion to catch cases where
1347         a DOM API with [CEReactions=NotNeeded] enqueues a custom element reaction; i.e. cases where [CEReactions]
1348         should have been used.
1349         (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Ditto.
1350         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Ditto.
1351         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto.
1352         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Ditto.
1353         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto.
1354         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Ditto.
1355         * dom/CustomElementReactionQueue.h:
1356         (WebCore::CustomElementReactionDisallowedScope): Added. Enables the assertion in enqueue* functions above.
1357         (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): Added.
1358         (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): Added.
1359         (WebCore::CustomElementReactionDisallowedScope::isReactionAllowed): Added.
1360         (WebCore::CustomElementReactionDisallowedScope::AllowedScope): Added.
1361         (WebCore::CustomElementReactionDisallowedScope::AllowedScope::AllowedScope): Added.
1362         (WebCore::CustomElementReactionDisallowedScope::AllowedScope::~AllowedScope): Added.
1363         (WebCore::CustomElementReactionStack): Suppress the assertion. See above for why this is needed.
1364         * html/HTMLIFrameElement.idl:
1365
1366 2018-08-06  Simon Fraser  <simon.fraser@apple.com>
1367
1368         Clean up initialization of some RenderLayer members
1369         https://bugs.webkit.org/show_bug.cgi?id=188330
1370
1371         Reviewed by Dean Jackson.
1372
1373         Use initializers for the pointers. No need to initialize LayoutUnits, which initialize to zero.
1374
1375         * rendering/RenderLayer.cpp:
1376         (WebCore::RenderLayer::RenderLayer):
1377         * rendering/RenderLayer.h:
1378
1379 2018-08-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
1380
1381         Remove the SVG elements' attributes macros
1382         https://bugs.webkit.org/show_bug.cgi?id=186751
1383
1384         Reviewed by Simon Fraser.
1385
1386         This is how the SVG attributes are implemented after removing the SVG macros:
1387
1388         1) The SVG attribute is defined as a super class of SVGAttribute. The super
1389            classes of SVGAttribute are template classes. The type of these template
1390            are the property type or the TearOff type.
1391
1392         2) To unify accessing attributes of the SVGElements and its super classes
1393            an SVGAttributeAccessor template class is added. It is inherited by other
1394            template classes. The types of these templates are the owner and the
1395            attributes types. The main functions of these classes is to synchronize 
1396            the new property value with the document attributes pool and to create
1397            and cache the TearOff objects.
1398
1399         3) To make code shorter and more readable, attribute types and attribute
1400            accessors are defined for every SVG TearOff type, e.g. 
1401            -- SVGLength: 
1402                 SVGAnimatedLengthAttribute and SVGAnimatedLengthAttributeAccessor
1403            -- SVGAnimatedNumber: 
1404                 SVGAnimatedNumberAttribute and SVGAnimatedNumberAttributeAccessor
1405
1406         4) A special accessor is defined for animated pair and optional attributes:
1407            SVGAnimatedPairAttributeAccessor, e.g.
1408            -- SVGMarkerElement:
1409                 orient attribute: "angle" or "type"
1410            -- SVGFEGaussianBlurElement:
1411                 stdDeviation attribute: "x" and "y"
1412
1413         5) The SVG attributes have to be registered into an singleton SVGAttributeRegistry.
1414            The SVGAttributeRegistry is a template class. The types of this template
1415            class are the the type of the owner and the base classes of this owner.
1416            This registry holds a map from "attribute name" to  "attribute accessor".
1417
1418         6) To make the code easier to read, the SVGAttributeRegistry implements
1419            registerAttribute() for different attribute types. The owner needs only
1420            to provide the attribute name and a pointer to the class member of this
1421            attribute to the same function "registerAttribute()". The compiler will
1422            pick the right function to call based on the type of the attribute.
1423
1424         7) Given a reference to the owner element, SVGAttributeRegistry can loop
1425            through the attributes of this owner and through the attributes of its
1426            base classes as well to do operations like synchronizing all the attributes
1427            or creating the TearOff object of a certain attribute.
1428
1429         8) To make the base class SVGElement have the ability to access the attributes
1430            of any of its super classes, SVGAttributeOwnerProxy will be used.
1431            SVGAttributeOwnerProxy is a base class which have all the functions that
1432            SVGElement needs as pure virtual functions.
1433
1434         9) SVGAttributeOwnerProxyImpl is a template class which implements 
1435            SVGAttributeOwnerProxy and whose types are the owner and its base classes.
1436            SVGAttributeOwnerProxyImpl keeps a reference to the owner and the context
1437            SVGElement.
1438
1439         10) All the SVG attribute owners have to implement the virtual function
1440             attributeOwnerProxy() which returns a reference to SVGAttributeOwnerProxy.
1441             The local attributeOwnerProxy() returns a reference to a local
1442             SVGAttributeOwnerProxyImpl. Its type and base types are the class
1443             hierarchy of this element.
1444
1445         All the attributes of the non-SVGElement-based classes are moved as members
1446         of these classes instead of adding them to all the super classes. These
1447         classes are:
1448            -- SVGExternalResourcesRequired
1449            -- SVGURIReference
1450            -- SVGFitToViewBox
1451            -- SVGZoomAndPan
1452            -- SVGLangSpace
1453
1454         The svgAttributeChanged() of all the SVGElement-based classes are now 
1455         simplified by distributing the responsibilities of changing an attribute
1456         to the base classes. One exception is the SVGURIReference since the action
1457         to be taken when changing the "href" is different for every super class.
1458
1459         Other work will be done in separate patches.
1460            -- Shrinking the memory of the SVGElements.
1461            -- Making all the attributes RefCounted objects.
1462
1463         * Sources.txt:
1464         * WebCore.xcodeproj/project.pbxproj:
1465         * rendering/svg/RenderSVGResourceMarker.cpp:
1466         (WebCore::RenderSVGResourceMarker::draw):
1467         * svg/SVGAElement.cpp:
1468         (WebCore::SVGAElement::SVGAElement):
1469         (WebCore::SVGAElement::registerAttributes):
1470         (WebCore::SVGAElement::parseAttribute):
1471         (WebCore::SVGAElement::svgAttributeChanged):
1472         * svg/SVGAElement.h:
1473         * svg/SVGAElement.idl:
1474         * svg/SVGAltGlyphElement.cpp:
1475         (WebCore::SVGAltGlyphElement::SVGAltGlyphElement):
1476         * svg/SVGAltGlyphElement.h:
1477         * svg/SVGAnimatedAngle.h:
1478         * svg/SVGAnimatedBoolean.h:
1479         * svg/SVGAnimatedEnumeration.h:
1480         * svg/SVGAnimatedInteger.h:
1481         * svg/SVGAnimatedLength.h:
1482         * svg/SVGAnimatedLengthList.h:
1483         * svg/SVGAnimatedNumber.h:
1484         * svg/SVGAnimatedNumberList.h:
1485         * svg/SVGAnimatedPath.h:
1486         * svg/SVGAnimatedPointList.h:
1487         * svg/SVGAnimatedPreserveAspectRatio.h:
1488         * svg/SVGAnimatedRect.h:
1489         * svg/SVGAnimatedString.h:
1490         * svg/SVGAnimatedTransformList.h:
1491         * svg/SVGAnimatedTypeAnimator.cpp:
1492         (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
1493         * svg/SVGAnimationElement.cpp:
1494         (WebCore::SVGAnimationElement::SVGAnimationElement):
1495         (WebCore::SVGAnimationElement::requiredFeatures): Deleted.
1496         (WebCore::SVGAnimationElement::requiredExtensions): Deleted.
1497         (WebCore::SVGAnimationElement::systemLanguage): Deleted.
1498         * svg/SVGAnimationElement.h:
1499         (WebCore::SVGAnimationElement::attributeRegistry):
1500         * svg/SVGCircleElement.cpp:
1501         (WebCore::SVGCircleElement::SVGCircleElement):
1502         (WebCore::SVGCircleElement::registerAttributes):
1503         (WebCore::SVGCircleElement::parseAttribute):
1504         (WebCore::SVGCircleElement::svgAttributeChanged):
1505         * svg/SVGCircleElement.h:
1506         * svg/SVGClipPathElement.cpp:
1507         (WebCore::SVGClipPathElement::SVGClipPathElement):
1508         (WebCore::SVGClipPathElement::registerAttributes):
1509         (WebCore::SVGClipPathElement::parseAttribute):
1510         (WebCore::SVGClipPathElement::svgAttributeChanged):
1511         (WebCore::SVGClipPathElement::isSupportedAttribute): Deleted.
1512         * svg/SVGClipPathElement.h:
1513         * svg/SVGComponentTransferFunctionElement.cpp:
1514         (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
1515         (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
1516         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
1517         (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged):
1518         (WebCore::SVGComponentTransferFunctionElement::transferFunction const):
1519         (WebCore::SVGComponentTransferFunctionElement::isSupportedAttribute): Deleted.
1520         * svg/SVGComponentTransferFunctionElement.h:
1521         (WebCore::SVGComponentTransferFunctionElement::type const):
1522         (WebCore::SVGComponentTransferFunctionElement::tableValues const):
1523         (WebCore::SVGComponentTransferFunctionElement::slope const):
1524         (WebCore::SVGComponentTransferFunctionElement::intercept const):
1525         (WebCore::SVGComponentTransferFunctionElement::amplitude const):
1526         (WebCore::SVGComponentTransferFunctionElement::exponent const):
1527         (WebCore::SVGComponentTransferFunctionElement::offset const):
1528         (WebCore::SVGComponentTransferFunctionElement::typeAnimated):
1529         (WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated):
1530         (WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
1531         (WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
1532         (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
1533         (WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
1534         (WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
1535         (WebCore::SVGComponentTransferFunctionElement::attributeRegistry):
1536         (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute):
1537         * svg/SVGCursorElement.cpp:
1538         (WebCore::SVGCursorElement::SVGCursorElement):
1539         (WebCore::SVGCursorElement::registerAttributes):
1540         (WebCore::SVGCursorElement::parseAttribute):
1541         (WebCore::SVGCursorElement::svgAttributeChanged):
1542         (WebCore::SVGCursorElement::isSupportedAttribute): Deleted.
1543         (WebCore::SVGCursorElement::requiredFeatures): Deleted.
1544         (WebCore::SVGCursorElement::requiredExtensions): Deleted.
1545         (WebCore::SVGCursorElement::systemLanguage): Deleted.
1546         * svg/SVGCursorElement.h:
1547         * svg/SVGDefsElement.cpp:
1548         (WebCore::SVGDefsElement::SVGDefsElement):
1549         * svg/SVGDefsElement.h:
1550         * svg/SVGElement.cpp:
1551         (WebCore::SVGElement::SVGElement):
1552         (WebCore::SVGElement::registerAttributes):
1553         (WebCore::SVGElement::parseAttribute):
1554         (WebCore::SVGElement::animatedPropertyTypesForAttribute):
1555         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
1556         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
1557         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM):
1558         (WebCore::SVGElement::svgAttributeChanged):
1559         (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted.
1560         (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted.
1561         (WebCore::SVGElement::synchronizeSystemLanguage): Deleted.
1562         (WebCore::SVGElement::isKnownAttribute): Deleted.
1563         * svg/SVGElement.h:
1564         (WebCore::SVGElement::attributeRegistry):
1565         (WebCore::SVGElement::isKnownAttribute):
1566         (WebCore::SVGElement::attributeOwnerProxy const):
1567         (WebCore::SVGElement::synchronizeAttribute):
1568         (WebCore::SVGElement::synchronizeAttributes):
1569         (WebCore::SVGElement::animatedTypes const):
1570         (WebCore::SVGElement::lookupAnimatedProperty const):
1571         (WebCore::SVGElement::lookupOrCreateAnimatedProperty):
1572         (WebCore::SVGElement::lookupOrCreateAnimatedProperties):
1573         (WebCore::SVGElement::className const):
1574         (WebCore::SVGElement::classNameAnimated):
1575         (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted.
1576         (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted.
1577         (WebCore::SVGElement::synchronizeSystemLanguage): Deleted.
1578         * svg/SVGEllipseElement.cpp:
1579         (WebCore::SVGEllipseElement::SVGEllipseElement):
1580         (WebCore::SVGEllipseElement::registerAttributes):
1581         (WebCore::SVGEllipseElement::parseAttribute):
1582         (WebCore::SVGEllipseElement::svgAttributeChanged):
1583         * svg/SVGEllipseElement.h:
1584         * svg/SVGExternalResourcesRequired.cpp:
1585         (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired):
1586         (WebCore::SVGExternalResourcesRequired::registerAttributes):
1587         (WebCore::SVGExternalResourcesRequired::parseAttribute):
1588         (WebCore::SVGExternalResourcesRequired::svgAttributeChanged):
1589         (WebCore::SVGExternalResourcesRequired::addSupportedAttributes):
1590         (WebCore::SVGExternalResourcesRequired::dispatchLoadEvent):
1591         (WebCore::SVGExternalResourcesRequired::insertedIntoDocument):
1592         (WebCore::SVGExternalResourcesRequired::finishParsingChildren):
1593         (WebCore::SVGExternalResourcesRequired::haveLoadedRequiredResources const):
1594         (WebCore::SVGExternalResourcesRequired::isKnownAttribute): Deleted.
1595         (WebCore::SVGExternalResourcesRequired::handleAttributeChange): Deleted.
1596         * svg/SVGExternalResourcesRequired.h:
1597         (WebCore::SVGExternalResourcesRequired::attributeRegistry):
1598         (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated):
1599         (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const):
1600         (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired):
1601         (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
1602         (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy):
1603         * svg/SVGFEBlendElement.cpp:
1604         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
1605         (WebCore::SVGFEBlendElement::registerAttributes):
1606         (WebCore::SVGFEBlendElement::parseAttribute):
1607         * svg/SVGFEBlendElement.h:
1608         * svg/SVGFEColorMatrixElement.cpp:
1609         (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
1610         (WebCore::SVGFEColorMatrixElement::registerAttributes):
1611         (WebCore::SVGFEColorMatrixElement::parseAttribute):
1612         * svg/SVGFEColorMatrixElement.h:
1613         * svg/SVGFEComponentTransferElement.cpp:
1614         (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
1615         (WebCore::SVGFEComponentTransferElement::registerAttributes):
1616         (WebCore::SVGFEComponentTransferElement::parseAttribute):
1617         * svg/SVGFEComponentTransferElement.h:
1618         * svg/SVGFECompositeElement.cpp:
1619         (WebCore::SVGFECompositeElement::SVGFECompositeElement):
1620         (WebCore::SVGFECompositeElement::registerAttributes):
1621         (WebCore::SVGFECompositeElement::parseAttribute):
1622         * svg/SVGFECompositeElement.h:
1623         * svg/SVGFEConvolveMatrixElement.cpp:
1624         (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
1625         (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
1626         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
1627         (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute):
1628         (WebCore::SVGFEConvolveMatrixElement::setOrder):
1629         (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
1630         * svg/SVGFEConvolveMatrixElement.h:
1631         (WebCore::SVGPropertyTraits<EdgeModeType>::initialValue):
1632         * svg/SVGFEDiffuseLightingElement.cpp:
1633         (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
1634         (WebCore::SVGFEDiffuseLightingElement::registerAttributes):
1635         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
1636         * svg/SVGFEDiffuseLightingElement.h:
1637         * svg/SVGFEDisplacementMapElement.cpp:
1638         (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
1639         (WebCore::SVGFEDisplacementMapElement::registerAttributes):
1640         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
1641         * svg/SVGFEDisplacementMapElement.h:
1642         * svg/SVGFEDropShadowElement.cpp:
1643         (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
1644         (WebCore::SVGFEDropShadowElement::setStdDeviation):
1645         (WebCore::SVGFEDropShadowElement::registerAttributes):
1646         (WebCore::SVGFEDropShadowElement::parseAttribute):
1647         (WebCore::SVGFEDropShadowElement::svgAttributeChanged):
1648         * svg/SVGFEDropShadowElement.h:
1649         * svg/SVGFEGaussianBlurElement.cpp:
1650         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
1651         (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
1652         (WebCore::SVGFEGaussianBlurElement::registerAttributes):
1653         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
1654         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
1655         * svg/SVGFEGaussianBlurElement.h:
1656         * svg/SVGFEImageElement.cpp:
1657         (WebCore::SVGFEImageElement::SVGFEImageElement):
1658         (WebCore::SVGFEImageElement::registerAttributes):
1659         (WebCore::SVGFEImageElement::parseAttribute):
1660         * svg/SVGFEImageElement.h:
1661         * svg/SVGFELightElement.cpp:
1662         (WebCore::SVGFELightElement::SVGFELightElement):
1663         (WebCore::SVGFELightElement::registerAttributes):
1664         (WebCore::SVGFELightElement::parseAttribute):
1665         (WebCore::SVGFELightElement::svgAttributeChanged):
1666         * svg/SVGFELightElement.h:
1667         (WebCore::SVGFELightElement::azimuth const):
1668         (WebCore::SVGFELightElement::elevation const):
1669         (WebCore::SVGFELightElement::x const):
1670         (WebCore::SVGFELightElement::y const):
1671         (WebCore::SVGFELightElement::z const):
1672         (WebCore::SVGFELightElement::pointsAtX const):
1673         (WebCore::SVGFELightElement::pointsAtY const):
1674         (WebCore::SVGFELightElement::pointsAtZ const):
1675         (WebCore::SVGFELightElement::specularExponent const):
1676         (WebCore::SVGFELightElement::limitingConeAngle const):
1677         (WebCore::SVGFELightElement::azimuthAnimated):
1678         (WebCore::SVGFELightElement::elevationAnimated):
1679         (WebCore::SVGFELightElement::xAnimated):
1680         (WebCore::SVGFELightElement::yAnimated):
1681         (WebCore::SVGFELightElement::zAnimated):
1682         (WebCore::SVGFELightElement::pointsAtXAnimated):
1683         (WebCore::SVGFELightElement::pointsAtYAnimated):
1684         (WebCore::SVGFELightElement::pointsAtZAnimated):
1685         (WebCore::SVGFELightElement::specularExponentAnimated):
1686         (WebCore::SVGFELightElement::limitingConeAngleAnimated):
1687         (WebCore::SVGFELightElement::attributeRegistry):
1688         (WebCore::SVGFELightElement::isKnownAttribute):
1689         * svg/SVGFEMergeNodeElement.cpp:
1690         (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
1691         (WebCore::SVGFEMergeNodeElement::registerAttributes):
1692         (WebCore::SVGFEMergeNodeElement::parseAttribute):
1693         * svg/SVGFEMergeNodeElement.h:
1694         * svg/SVGFEMorphologyElement.cpp:
1695         (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
1696         (WebCore::SVGFEMorphologyElement::setRadius):
1697         (WebCore::SVGFEMorphologyElement::registerAttributes):
1698         (WebCore::SVGFEMorphologyElement::parseAttribute):
1699         * svg/SVGFEMorphologyElement.h:
1700         * svg/SVGFEOffsetElement.cpp:
1701         (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
1702         (WebCore::SVGFEOffsetElement::registerAttributes):
1703         (WebCore::SVGFEOffsetElement::parseAttribute):
1704         (WebCore::SVGFEOffsetElement::svgAttributeChanged):
1705         * svg/SVGFEOffsetElement.h:
1706         * svg/SVGFESpecularLightingElement.cpp:
1707         (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
1708         (WebCore::SVGFESpecularLightingElement::registerAttributes):
1709         (WebCore::SVGFESpecularLightingElement::parseAttribute):
1710         * svg/SVGFESpecularLightingElement.h:
1711         * svg/SVGFETileElement.cpp:
1712         (WebCore::SVGFETileElement::SVGFETileElement):
1713         (WebCore::SVGFETileElement::registerAttributes):
1714         (WebCore::SVGFETileElement::parseAttribute):
1715         * svg/SVGFETileElement.h:
1716         * svg/SVGFETurbulenceElement.cpp:
1717         (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
1718         (WebCore::SVGFETurbulenceElement::registerAttributes):
1719         (WebCore::SVGFETurbulenceElement::parseAttribute):
1720         (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute):
1721         (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
1722         * svg/SVGFETurbulenceElement.h:
1723         * svg/SVGFilterElement.cpp:
1724         (WebCore::SVGFilterElement::SVGFilterElement):
1725         (WebCore::SVGFilterElement::setFilterRes):
1726         (WebCore::SVGFilterElement::registerAttributes):
1727         (WebCore::SVGFilterElement::parseAttribute):
1728         (WebCore::SVGFilterElement::svgAttributeChanged):
1729         (WebCore::SVGFilterElement::isSupportedAttribute): Deleted.
1730         * svg/SVGFilterElement.h:
1731         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1732         (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
1733         (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes):
1734         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
1735         (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
1736         (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute): Deleted.
1737         * svg/SVGFilterPrimitiveStandardAttributes.h:
1738         (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry):
1739         (WebCore::SVGFilterPrimitiveStandardAttributes::x const):
1740         (WebCore::SVGFilterPrimitiveStandardAttributes::y const):
1741         (WebCore::SVGFilterPrimitiveStandardAttributes::width const):
1742         (WebCore::SVGFilterPrimitiveStandardAttributes::height const):
1743         (WebCore::SVGFilterPrimitiveStandardAttributes::result const):
1744         (WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated):
1745         (WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated):
1746         (WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated):
1747         (WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated):
1748         (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated):
1749         (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute):
1750         * svg/SVGFitToViewBox.cpp:
1751         (WebCore::SVGFitToViewBox::SVGFitToViewBox):
1752         (WebCore::SVGFitToViewBox::registerAttributes):
1753         (WebCore::SVGFitToViewBox::setViewBox):
1754         (WebCore::SVGFitToViewBox::resetViewBox):
1755         (WebCore::SVGFitToViewBox::reset):
1756         (WebCore::SVGFitToViewBox::parseAttribute):
1757         (WebCore::SVGFitToViewBox::parseViewBox):
1758         (WebCore::SVGFitToViewBox::isKnownAttribute): Deleted.
1759         (WebCore::SVGFitToViewBox::addSupportedAttributes): Deleted.
1760         * svg/SVGFitToViewBox.h:
1761         (WebCore::SVGFitToViewBox::attributeRegistry):
1762         (WebCore::SVGFitToViewBox::viewBox const):
1763         (WebCore::SVGFitToViewBox::preserveAspectRatio const):
1764         (WebCore::SVGFitToViewBox::viewBoxAnimated):
1765         (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
1766         (WebCore::SVGFitToViewBox::setPreserveAspectRatio):
1767         (WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
1768         (WebCore::SVGFitToViewBox::viewBoxString const):
1769         (WebCore::SVGFitToViewBox::preserveAspectRatioString const):
1770         (WebCore::SVGFitToViewBox::hasValidViewBox const):
1771         (WebCore::SVGFitToViewBox::hasEmptyViewBox const):
1772         (WebCore::SVGFitToViewBox::isKnownAttribute):
1773         (WebCore::SVGFitToViewBox::parseAttribute): Deleted.
1774         * svg/SVGFontElement.cpp:
1775         (WebCore::SVGFontElement::SVGFontElement):
1776         * svg/SVGFontElement.h:
1777         * svg/SVGForeignObjectElement.cpp:
1778         (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
1779         (WebCore::SVGForeignObjectElement::registerAttributes):
1780         (WebCore::SVGForeignObjectElement::parseAttribute):
1781         (WebCore::SVGForeignObjectElement::svgAttributeChanged):
1782         (WebCore::SVGForeignObjectElement::isSupportedAttribute): Deleted.
1783         * svg/SVGForeignObjectElement.h:
1784         * svg/SVGGElement.cpp:
1785         (WebCore::SVGGElement::SVGGElement):
1786         (WebCore::SVGGElement::svgAttributeChanged):
1787         (WebCore::SVGGElement::isSupportedAttribute): Deleted.
1788         * svg/SVGGElement.h:
1789         * svg/SVGGeometryElement.cpp:
1790         (WebCore::SVGGeometryElement::SVGGeometryElement):
1791         (WebCore::SVGGeometryElement::registerAttributes):
1792         (WebCore::SVGGeometryElement::parseAttribute):
1793         (WebCore::SVGGeometryElement::svgAttributeChanged):
1794         (WebCore::SVGGeometryElement::isSupportedAttribute): Deleted.
1795         * svg/SVGGeometryElement.h:
1796         (WebCore::SVGGeometryElement::attributeRegistry):
1797         (WebCore::SVGGeometryElement::pathLengthAnimated):
1798         (WebCore::SVGGeometryElement::isKnownAttribute):
1799         * svg/SVGGlyphRefElement.cpp:
1800         (WebCore::SVGGlyphRefElement::SVGGlyphRefElement):
1801         * svg/SVGGlyphRefElement.h:
1802         * svg/SVGGradientElement.cpp:
1803         (WebCore::SVGGradientElement::SVGGradientElement):
1804         (WebCore::SVGGradientElement::registerAttributes):
1805         (WebCore::SVGGradientElement::parseAttribute):
1806         (WebCore::SVGGradientElement::svgAttributeChanged):
1807         (WebCore::SVGGradientElement::isSupportedAttribute): Deleted.
1808         * svg/SVGGradientElement.h:
1809         (WebCore::SVGGradientElement::attributeRegistry):
1810         (WebCore::SVGGradientElement::spreadMethod const):
1811         (WebCore::SVGGradientElement::gradientUnits const):
1812         (WebCore::SVGGradientElement::gradientTransform const):
1813         (WebCore::SVGGradientElement::spreadMethodAnimated):
1814         (WebCore::SVGGradientElement::gradientUnitsAnimated):
1815         (WebCore::SVGGradientElement::gradientTransformAnimated):
1816         (WebCore::SVGGradientElement::isKnownAttribute):
1817         * svg/SVGGraphicsElement.cpp:
1818         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
1819         (WebCore::SVGGraphicsElement::registerAttributes):
1820         (WebCore::SVGGraphicsElement::parseAttribute):
1821         (WebCore::SVGGraphicsElement::svgAttributeChanged):
1822         (WebCore::SVGGraphicsElement::isSupportedAttribute): Deleted.
1823         (WebCore::SVGGraphicsElement::requiredFeatures): Deleted.
1824         (WebCore::SVGGraphicsElement::requiredExtensions): Deleted.
1825         (WebCore::SVGGraphicsElement::systemLanguage): Deleted.
1826         * svg/SVGGraphicsElement.h:
1827         (WebCore::SVGGraphicsElement::attributeRegistry):
1828         (WebCore::SVGGraphicsElement::transform const):
1829         (WebCore::SVGGraphicsElement::transformAnimated):
1830         (WebCore::SVGGraphicsElement::isKnownAttribute):
1831         * svg/SVGImageElement.cpp:
1832         (WebCore::SVGImageElement::SVGImageElement):
1833         (WebCore::SVGImageElement::registerAttributes):
1834         (WebCore::SVGImageElement::parseAttribute):
1835         (WebCore::SVGImageElement::svgAttributeChanged):
1836         (WebCore::SVGImageElement::haveLoadedRequiredResources):
1837         (WebCore::SVGImageElement::isSupportedAttribute): Deleted.
1838         * svg/SVGImageElement.h:
1839         * svg/SVGImageLoader.cpp:
1840         (WebCore::SVGImageLoader::dispatchLoadEvent):
1841         * svg/SVGLangSpace.cpp:
1842         (WebCore::SVGLangSpace::SVGLangSpace):
1843         (WebCore::SVGLangSpace::registerAttributes):
1844         (WebCore::SVGLangSpace::xmlspace const):
1845         (WebCore::SVGLangSpace::svgAttributeChanged):
1846         (WebCore::SVGLangSpace::setXmllang): Deleted.
1847         (WebCore::SVGLangSpace::setXmlspace): Deleted.
1848         (WebCore::SVGLangSpace::isKnownAttribute): Deleted.
1849         (WebCore::addWithAndWithoutXMLPrefix): Deleted.
1850         (WebCore::SVGLangSpace::addSupportedAttributes): Deleted.
1851         * svg/SVGLangSpace.h:
1852         (WebCore::SVGLangSpace::xmllang const):
1853         (WebCore::SVGLangSpace::setXmllang):
1854         (WebCore::SVGLangSpace::setXmlspace):
1855         (WebCore::SVGLangSpace::attributeRegistry):
1856         (WebCore::SVGLangSpace::isKnownAttribute):
1857         * svg/SVGLineElement.cpp:
1858         (WebCore::SVGLineElement::SVGLineElement):
1859         (WebCore::SVGLineElement::registerAttributes):
1860         (WebCore::SVGLineElement::parseAttribute):
1861         (WebCore::SVGLineElement::svgAttributeChanged):
1862         (WebCore::SVGLineElement::isSupportedAttribute): Deleted.
1863         * svg/SVGLineElement.h:
1864         * svg/SVGLinearGradientElement.cpp:
1865         (WebCore::SVGLinearGradientElement::SVGLinearGradientElement):
1866         (WebCore::SVGLinearGradientElement::registerAttributes):
1867         (WebCore::SVGLinearGradientElement::parseAttribute):
1868         (WebCore::SVGLinearGradientElement::svgAttributeChanged):
1869         (WebCore::SVGLinearGradientElement::isSupportedAttribute): Deleted.
1870         * svg/SVGLinearGradientElement.h:
1871         * svg/SVGMPathElement.cpp:
1872         (WebCore::SVGMPathElement::SVGMPathElement):
1873         (WebCore::SVGMPathElement::svgAttributeChanged):
1874         * svg/SVGMPathElement.h:
1875         * svg/SVGMarkerElement.cpp:
1876         (WebCore::SVGMarkerElement::SVGMarkerElement):
1877         (WebCore::SVGMarkerElement::registerAttributes):
1878         (WebCore::SVGMarkerElement::parseAttribute):
1879         (WebCore::SVGMarkerElement::svgAttributeChanged):
1880         (WebCore::SVGMarkerElement::setOrient):
1881         (WebCore::SVGMarkerElement::orientTypePropertyInfo): Deleted.
1882         (WebCore::SVGMarkerElement::isSupportedAttribute): Deleted.
1883         (WebCore::SVGMarkerElement::synchronizeOrientType): Deleted.
1884         (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper): Deleted.
1885         (WebCore::SVGMarkerElement::orientType const): Deleted.
1886         (WebCore::SVGMarkerElement::orientTypeAnimated): Deleted.
1887         * svg/SVGMarkerElement.h:
1888         * svg/SVGMaskElement.cpp:
1889         (WebCore::SVGMaskElement::SVGMaskElement):
1890         (WebCore::SVGMaskElement::registerAttributes):
1891         (WebCore::SVGMaskElement::parseAttribute):
1892         (WebCore::SVGMaskElement::svgAttributeChanged):
1893         (WebCore::SVGMaskElement::isSupportedAttribute): Deleted.
1894         (WebCore::SVGMaskElement::requiredFeatures): Deleted.
1895         (WebCore::SVGMaskElement::requiredExtensions): Deleted.
1896         (WebCore::SVGMaskElement::systemLanguage): Deleted.
1897         * svg/SVGMaskElement.h:
1898         * svg/SVGPathElement.cpp:
1899         (WebCore::SVGPathElement::SVGPathElement):
1900         (WebCore::SVGPathElement::registerAttributes):
1901         (WebCore::SVGPathElement::parseAttribute):
1902         (WebCore::SVGPathElement::svgAttributeChanged):
1903         (WebCore::SVGPathElement::pathByteStream const):
1904         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
1905         (WebCore::SVGPathElement::animatedPropertyWillBeDeleted):
1906         (WebCore::SVGPathElement::pathSegList):
1907         (WebCore::SVGPathElement::animatedPathSegList):
1908         (WebCore::SVGPathElement::pathSegListChanged):
1909         (WebCore::SVGPathElement::dPropertyInfo): Deleted.
1910         (WebCore::SVGPathElement::isSupportedAttribute): Deleted.
1911         (WebCore::SVGPathElement::synchronizeD): Deleted.
1912         * svg/SVGPathElement.h:
1913         * svg/SVGPathSegListValues.h:
1914         (WebCore::SVGPropertyTraits<SVGPathSegListValues>::toString):
1915         * svg/SVGPathSegWithContext.h:
1916         (WebCore::SVGPathSegWithContext::animatedProperty const):
1917         * svg/SVGPatternElement.cpp:
1918         (WebCore::SVGPatternElement::SVGPatternElement):
1919         (WebCore::SVGPatternElement::registerAttributes):
1920         (WebCore::SVGPatternElement::parseAttribute):
1921         (WebCore::SVGPatternElement::svgAttributeChanged):
1922         (WebCore::SVGPatternElement::collectPatternAttributes const):
1923         (WebCore::SVGPatternElement::isSupportedAttribute): Deleted.
1924         (WebCore::SVGPatternElement::requiredFeatures): Deleted.
1925         (WebCore::SVGPatternElement::requiredExtensions): Deleted.
1926         (WebCore::SVGPatternElement::systemLanguage): Deleted.
1927         * svg/SVGPatternElement.h:
1928         * svg/SVGPointListValues.h:
1929         (WebCore::SVGPropertyTraits<SVGPointListValues>::toString):
1930         * svg/SVGPolyElement.cpp:
1931         (WebCore::SVGPolyElement::SVGPolyElement):
1932         (WebCore::SVGPolyElement::registerAttributes):
1933         (WebCore::SVGPolyElement::parseAttribute):
1934         (WebCore::SVGPolyElement::svgAttributeChanged):
1935         (WebCore::SVGPolyElement::points):
1936         (WebCore::SVGPolyElement::animatedPoints):
1937         (WebCore::SVGPolyElement::pointsPropertyInfo): Deleted.
1938         (WebCore::SVGPolyElement::synchronizePoints): Deleted.
1939         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper): Deleted.
1940         * svg/SVGPolyElement.h:
1941         (WebCore::SVGPolyElement::pointList const):
1942         (WebCore::SVGPolyElement::attributeRegistry):
1943         (WebCore::SVGPolyElement::isKnownAttribute):
1944         * svg/SVGPreserveAspectRatioValue.cpp:
1945         (WebCore::SVGPreserveAspectRatioValue::transformRect const):
1946         (WebCore::SVGPreserveAspectRatioValue::transformRect): Deleted.
1947         * svg/SVGPreserveAspectRatioValue.h:
1948         * svg/SVGRadialGradientElement.cpp:
1949         (WebCore::SVGRadialGradientElement::SVGRadialGradientElement):
1950         (WebCore::SVGRadialGradientElement::registerAttributes):
1951         (WebCore::SVGRadialGradientElement::parseAttribute):
1952         (WebCore::SVGRadialGradientElement::svgAttributeChanged):
1953         (WebCore::SVGRadialGradientElement::isSupportedAttribute): Deleted.
1954         * svg/SVGRadialGradientElement.h:
1955         * svg/SVGRectElement.cpp:
1956         (WebCore::SVGRectElement::SVGRectElement):
1957         (WebCore::SVGRectElement::registerAttributes):
1958         (WebCore::SVGRectElement::parseAttribute):
1959         (WebCore::SVGRectElement::svgAttributeChanged):
1960         * svg/SVGRectElement.h:
1961         * svg/SVGSVGElement.cpp:
1962         (WebCore::SVGSVGElement::SVGSVGElement):
1963         (WebCore::SVGSVGElement::registerAttributes):
1964         (WebCore::SVGSVGElement::parseAttribute):
1965         (WebCore::SVGSVGElement::svgAttributeChanged):
1966         (WebCore::SVGSVGElement::viewBoxToViewTransform const):
1967         (WebCore::SVGSVGElement::resetScrollAnchor):
1968         (WebCore::SVGSVGElement::inheritViewAttributes):
1969         * svg/SVGSVGElement.h:
1970         (WebCore::SVGSVGElement::useCurrentView const): Deleted.
1971         (WebCore::SVGSVGElement::currentTranslateValue): Deleted.
1972         (WebCore::SVGSVGElement::zoomAndPan const): Deleted.
1973         (WebCore::SVGSVGElement::setZoomAndPan): Deleted.
1974         (WebCore::SVGSVGElement::timeContainer): Deleted.
1975         (WebCore::SVGSVGElement::hasEmptyViewBox const): Deleted.
1976         * svg/SVGScriptElement.cpp:
1977         (WebCore::SVGScriptElement::SVGScriptElement):
1978         (WebCore::SVGScriptElement::svgAttributeChanged):
1979         (WebCore::SVGScriptElement::insertedIntoAncestor):
1980         (WebCore::SVGScriptElement::addSubresourceAttributeURLs const):
1981         (WebCore::SVGScriptElement::isURLAttribute const): Deleted.
1982         (WebCore::SVGScriptElement::sourceAttributeValue const): Deleted.
1983         (WebCore::SVGScriptElement::charsetAttributeValue const): Deleted.
1984         (WebCore::SVGScriptElement::typeAttributeValue const): Deleted.
1985         (WebCore::SVGScriptElement::languageAttributeValue const): Deleted.
1986         (WebCore::SVGScriptElement::forAttributeValue const): Deleted.
1987         (WebCore::SVGScriptElement::eventAttributeValue const): Deleted.
1988         (WebCore::SVGScriptElement::hasAsyncAttribute const): Deleted.
1989         (WebCore::SVGScriptElement::hasDeferAttribute const): Deleted.
1990         (WebCore::SVGScriptElement::hasNoModuleAttribute const): Deleted.
1991         (WebCore::SVGScriptElement::hasSourceAttribute const): Deleted.
1992         (WebCore::SVGScriptElement::filterOutAnimatableAttribute const): Deleted.
1993         * svg/SVGScriptElement.h:
1994         * svg/SVGStopElement.cpp:
1995         (WebCore::SVGStopElement::SVGStopElement):
1996         (WebCore::SVGStopElement::registerAttributes):
1997         (WebCore::SVGStopElement::parseAttribute):
1998         * svg/SVGStopElement.h:
1999         * svg/SVGStringListValues.h:
2000         (WebCore::SVGPropertyTraits<SVGStringListValues>::toString):
2001         * svg/SVGSwitchElement.cpp:
2002         (WebCore::SVGSwitchElement::SVGSwitchElement):
2003         * svg/SVGSwitchElement.h:
2004         * svg/SVGSymbolElement.cpp:
2005         (WebCore::SVGSymbolElement::SVGSymbolElement):
2006         (WebCore::SVGSymbolElement::parseAttribute):
2007         (WebCore::SVGSymbolElement::svgAttributeChanged):
2008         * svg/SVGSymbolElement.h:
2009         * svg/SVGTRefElement.cpp:
2010         (WebCore::SVGTRefElement::SVGTRefElement):
2011         * svg/SVGTRefElement.h:
2012         * svg/SVGTests.cpp:
2013         (WebCore::SVGTests::SVGTests):
2014         (WebCore::SVGTests::registerAttributes):
2015         (WebCore::SVGTests::attributeRegistry):
2016         (WebCore::SVGTests::isKnownAttribute):
2017         (WebCore::SVGTests::isValid const):
2018         (WebCore::SVGTests::parseAttribute):
2019         (WebCore::SVGTests::svgAttributeChanged):
2020         (WebCore::SVGTests::requiredFeatures):
2021         (WebCore::SVGTests::requiredExtensions):
2022         (WebCore::SVGTests::systemLanguage):
2023         (WebCore::createSVGTestPropertyInfo): Deleted.
2024         (WebCore::createSVGTextAttributeToPropertyMap): Deleted.
2025         (WebCore::SVGTests::attributeToPropertyMap): Deleted.
2026         (WebCore::SVGTests::handleAttributeChange): Deleted.
2027         (WebCore::SVGTests::synchronizeAttribute): Deleted.
2028         (WebCore::SVGTests::synchronizeRequiredFeatures): Deleted.
2029         (WebCore::SVGTests::synchronizeRequiredExtensions): Deleted.
2030         (WebCore::SVGTests::synchronizeSystemLanguage): Deleted.
2031         * svg/SVGTests.h:
2032         * svg/SVGTextContentElement.cpp:
2033         (WebCore::SVGTextContentElement::SVGTextContentElement):
2034         (WebCore::SVGTextContentElement::registerAttributes):
2035         (WebCore::SVGTextContentElement::parseAttribute):
2036         (WebCore::SVGTextContentElement::svgAttributeChanged):
2037         (WebCore::SVGTextContentElement::textLengthPropertyInfo): Deleted.
2038         (WebCore::SVGTextContentElement::synchronizeTextLength): Deleted.
2039         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper): Deleted.
2040         (WebCore::SVGTextContentElement::textLengthAnimated): Deleted.
2041         (WebCore::SVGTextContentElement::isSupportedAttribute): Deleted.
2042         * svg/SVGTextContentElement.h:
2043         (WebCore::SVGTextContentElement::specifiedTextLength):
2044         (WebCore::SVGTextContentElement::attributeRegistry):
2045         (WebCore::SVGTextContentElement::textLength const):
2046         (WebCore::SVGTextContentElement::lengthAdjust const):
2047         (WebCore::SVGTextContentElement::textLengthAnimated):
2048         (WebCore::SVGTextContentElement::lengthAdjustAnimated):
2049         (WebCore::SVGTextContentElement::isKnownAttribute):
2050         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::SVGAnimatedCustomLengthAttribute):
2051         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::synchronize):
2052         (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::animatedProperty):
2053         * svg/SVGTextPathElement.cpp:
2054         (WebCore::SVGTextPathElement::SVGTextPathElement):
2055         (WebCore::SVGTextPathElement::registerAttributes):
2056         (WebCore::SVGTextPathElement::parseAttribute):
2057         (WebCore::SVGTextPathElement::svgAttributeChanged):
2058         (WebCore::SVGTextPathElement::isSupportedAttribute): Deleted.
2059         * svg/SVGTextPathElement.h:
2060         * svg/SVGTextPositioningElement.cpp:
2061         (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
2062         (WebCore::SVGTextPositioningElement::registerAttributes):
2063         (WebCore::SVGTextPositioningElement::parseAttribute):
2064         (WebCore::SVGTextPositioningElement::svgAttributeChanged):
2065         * svg/SVGTextPositioningElement.h:
2066         (WebCore::SVGTextPositioningElement::attributeRegistry):
2067         (WebCore::SVGTextPositioningElement::x const):
2068         (WebCore::SVGTextPositioningElement::y const):
2069         (WebCore::SVGTextPositioningElement::dx const):
2070         (WebCore::SVGTextPositioningElement::dy const):
2071         (WebCore::SVGTextPositioningElement::rotate const):
2072         (WebCore::SVGTextPositioningElement::xAnimated):
2073         (WebCore::SVGTextPositioningElement::yAnimated):
2074         (WebCore::SVGTextPositioningElement::dxAnimated):
2075         (WebCore::SVGTextPositioningElement::dyAnimated):
2076         (WebCore::SVGTextPositioningElement::rotateAnimated):
2077         (WebCore::SVGTextPositioningElement::isKnownAttribute):
2078         * svg/SVGURIReference.cpp:
2079         (WebCore::SVGURIReference::SVGURIReference):
2080         (WebCore::SVGURIReference::registerAttributes):
2081         (WebCore::SVGURIReference::attributeRegistry):
2082         (WebCore::SVGURIReference::isKnownAttribute):
2083         (WebCore::SVGURIReference::parseAttribute):
2084         (WebCore::SVGURIReference::href const):
2085         (WebCore::SVGURIReference::hrefAnimated):
2086         (WebCore::SVGURIReference::addSupportedAttributes): Deleted.
2087         * svg/SVGURIReference.h:
2088         * svg/SVGUseElement.cpp:
2089         (WebCore::SVGUseElement::SVGUseElement):
2090         (WebCore::SVGUseElement::registerAttributes):
2091         (WebCore::SVGUseElement::parseAttribute):
2092         (WebCore::SVGUseElement::insertedIntoAncestor):
2093         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone const):
2094         (WebCore::SVGUseElement::svgAttributeChanged):
2095         (WebCore::SVGUseElement::notifyFinished):
2096         * svg/SVGUseElement.h:
2097         * svg/SVGValue.h:
2098         * svg/SVGViewElement.cpp:
2099         (WebCore::SVGViewElement::SVGViewElement):
2100         (WebCore::SVGViewElement::parseAttribute):
2101         * svg/SVGViewElement.h:
2102         * svg/SVGViewSpec.cpp:
2103         (WebCore::SVGViewSpec::SVGViewSpec):
2104         (WebCore::SVGViewSpec::registerAttributes):
2105         (WebCore::SVGViewSpec::transform):
2106         (WebCore::SVGViewSpec::reset):
2107         (WebCore::SVGViewSpec::parseViewSpec):
2108         (WebCore::SVGViewSpec::viewBoxPropertyInfo): Deleted.
2109         (WebCore::SVGViewSpec::preserveAspectRatioPropertyInfo): Deleted.
2110         (WebCore::SVGViewSpec::transformPropertyInfo): Deleted.
2111         (WebCore::SVGViewSpec::viewBoxIdentifier): Deleted.
2112         (WebCore::SVGViewSpec::preserveAspectRatioIdentifier): Deleted.
2113         (WebCore::SVGViewSpec::transformIdentifier): Deleted.
2114         (WebCore::SVGViewSpec::setZoomAndPan): Deleted.
2115         (WebCore::SVGViewSpec::transformString const): Deleted.
2116         (WebCore::SVGViewSpec::viewBoxString const): Deleted.
2117         (WebCore::SVGViewSpec::preserveAspectRatioString const): Deleted.
2118         (WebCore::SVGViewSpec::viewBoxAnimated): Deleted.
2119         (WebCore::SVGViewSpec::preserveAspectRatioAnimated): Deleted.
2120         (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Deleted.
2121         (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper): Deleted.
2122         (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Deleted.
2123         * svg/SVGViewSpec.h:
2124         * svg/SVGViewSpec.idl:
2125         * svg/SVGZoomAndPan.cpp:
2126         (WebCore::SVGZoomAndPan::SVGZoomAndPan):
2127         (WebCore::SVGZoomAndPan::registerAttributes):
2128         (WebCore::SVGZoomAndPan::parseZoomAndPan):
2129         (WebCore::SVGZoomAndPan::parseAttribute):
2130         (WebCore::SVGZoomAndPan::parse): Deleted.
2131         (WebCore::SVGZoomAndPan::parseAttributeValue): Deleted.
2132         * svg/SVGZoomAndPan.h:
2133         (WebCore::SVGZoomAndPan::zoomAndPan const):
2134         (WebCore::SVGZoomAndPan::setZoomAndPan):
2135         (WebCore::SVGZoomAndPan::reset):
2136         (WebCore::SVGZoomAndPan::attributeRegistry):
2137         (WebCore::SVGZoomAndPan::isKnownAttribute):
2138         (WebCore::SVGZoomAndPan::parseFromNumber): Deleted.
2139         (WebCore::SVGZoomAndPan::parseAttribute): Deleted.
2140         * svg/SVGZoomAndPanType.h: Copied from Source/WebCore/svg/SVGValue.h.
2141         (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::initialValue):
2142         (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::toString):
2143         (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::fromString):
2144         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
2145         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Copied from Source/WebCore/svg/SVGValue.h.
2146         (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff):
2147         (WebCore::SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff):
2148         (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange):
2149         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
2150         * svg/properties/SVGAnimatedProperty.cpp:
2151         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
2152         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty):
2153         (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted.
2154         * svg/properties/SVGAnimatedProperty.h:
2155         (WebCore::SVGAnimatedProperty::isAnimating const):
2156         (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const):
2157         (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty):
2158         (WebCore::SVGAnimatedProperty::lookupAnimatedProperty):
2159         (WebCore::SVGAnimatedProperty::animatedPropertyCache):
2160         (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper): Deleted.
2161         (WebCore::SVGAnimatedProperty::lookupWrapper): Deleted.
2162         * svg/properties/SVGAnimatedPropertyMacros.h: Removed.
2163         * svg/properties/SVGAnimatedPropertyType.h: Copied from Source/WebCore/svg/SVGAElement.idl.
2164         * svg/properties/SVGAttribute.h: Added.
2165         (WebCore::SVGPropertyAttribute::SVGPropertyAttribute):
2166         (WebCore::SVGPropertyAttribute::value):
2167         (WebCore::SVGPropertyAttribute::value const):
2168         (WebCore::SVGPropertyAttribute::setValue):
2169         (WebCore::SVGPropertyAttribute::resetValue):
2170         (WebCore::SVGPropertyAttribute::toString const):
2171         (WebCore::SVGPropertyAttribute::setShouldSynchronize):
2172         (WebCore::SVGPropertyAttribute::shouldSynchronize const):
2173         (WebCore::SVGPropertyAttribute::synchronize):
2174         (WebCore::SVGAnimatedAttribute::SVGAnimatedAttribute):
2175         (WebCore::SVGAnimatedAttribute::currentValue const):
2176         (WebCore::SVGAnimatedAttribute::animatedProperty):
2177         (WebCore::SVGAnimatedAttributeList::SVGAnimatedAttributeList):
2178         (WebCore::SVGAnimatedAttributeList::detachAnimatedListWrappers):
2179         * svg/properties/SVGAttributeAccessor.h: Added.
2180         (WebCore::SVGAttributeAccessor::SVGAttributeAccessor):
2181         (WebCore::SVGAttributeAccessor::attributeName const):
2182         (WebCore::SVGAttributeAccessor::isAnimatedLengthAttribute const):
2183         (WebCore::SVGAttributeAccessor::animatedType const):
2184         (WebCore::SVGAttributeAccessor::animatedTypes const):
2185         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const):
2186         (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const):
2187         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const):
2188         (WebCore::SVGPropertyAttributeAccessor::singleton):
2189         (WebCore::SVGPropertyAttributeAccessor::SVGPropertyAttributeAccessor):
2190         (WebCore::SVGPropertyAttributeAccessor::attribute const):
2191         (WebCore::SVGAnimatedAttributeAccessor::singleton):
2192         (WebCore::SVGAnimatedAttributeAccessor::SVGAnimatedAttributeAccessor):
2193         (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty):
2194         (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty):
2195         (WebCore::SVGAnimatedPairAttributeAccessor::SVGAnimatedPairAttributeAccessor):
2196         (WebCore::SVGAnimatedPairAttributeAccessor::secondAttribute const):
2197         * svg/properties/SVGAttributeOwnerProxy.h: Copied from Source/WebCore/svg/SVGValue.h.
2198         (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy):
2199         (WebCore::SVGAttributeOwnerProxy::element const):
2200         * svg/properties/SVGAttributeOwnerProxyImpl.h: Added.
2201         (WebCore::SVGAttributeOwnerProxyImpl::SVGAttributeOwnerProxyImpl):
2202         (WebCore::SVGAttributeOwnerProxyImpl::attributeRegistry):
2203         (WebCore::SVGAttributeOwnerProxyImpl::isKnownAttribute):
2204         (WebCore::SVGAttributeOwnerProxyImpl::isAnimatedLengthAttribute):
2205         * svg/properties/SVGAttributeRegistry.h: Added.
2206         (WebCore::SVGAttributeRegistry::registerAttribute):
2207         (WebCore::SVGAttributeRegistry::isEmpty const):
2208         (WebCore::SVGAttributeRegistry::isKnownAttribute const):
2209         (WebCore::SVGAttributeRegistry::isAnimatedLengthAttribute const):
2210         (WebCore::SVGAttributeRegistry::animatedTypes const):
2211         (WebCore::SVGAttributeRegistry::synchronizeAttributes const):
2212         (WebCore::SVGAttributeRegistry::synchronizeAttribute const):
2213         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const):
2214         (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const):
2215         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const):
2216         (WebCore::SVGAttributeRegistry::animatedTypesBaseTypes):
2217         (WebCore::SVGAttributeRegistry::synchronizeAttributesBaseTypes):
2218         (WebCore::SVGAttributeRegistry::synchronizeAttributeBaseTypes):
2219         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes):
2220         (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes):
2221         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes):
2222         (WebCore::SVGAttributeRegistry::findAttributeAccessor const):
2223         * svg/properties/SVGAttributeToPropertyMap.cpp: Removed.
2224         * svg/properties/SVGAttributeToPropertyMap.h: Removed.
2225         * svg/properties/SVGPropertyInfo.cpp: Removed.
2226         * svg/properties/SVGPropertyInfo.h: Removed.
2227
2228 2018-08-06  Alex Christensen  <achristensen@webkit.org>
2229
2230         Use enum classes and OptionSets for PaintPhase and PaintBehavior
2231         https://bugs.webkit.org/show_bug.cgi?id=188323
2232
2233         Reviewed by Simon Fraser.
2234
2235         No change in behaviour.
2236
2237         * html/shadow/MediaControlElements.cpp:
2238         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
2239         * page/FrameSnapshotting.cpp:
2240         (WebCore::snapshotFrameRectWithClip):
2241         * page/FrameView.cpp:
2242         (WebCore::FrameView::reset):
2243         (WebCore::FrameView::willPaintContents):
2244         (WebCore::FrameView::paintContents):
2245         (WebCore::FrameView::setPaintBehavior):
2246         (WebCore::FrameView::paintBehavior const):
2247         (WebCore::FrameView::paintContentsForSnapshot):
2248         * page/FrameView.h:
2249         * rendering/InlineElementBox.cpp:
2250         (WebCore::InlineElementBox::paint):
2251         * rendering/InlineFlowBox.cpp:
2252         (WebCore::InlineFlowBox::paint):
2253         (WebCore::InlineFlowBox::paintBoxDecorations):
2254         (WebCore::InlineFlowBox::paintMask):
2255         * rendering/InlineTextBox.cpp:
2256         (WebCore::InlineTextBox::paint):
2257         * rendering/PaintInfo.h:
2258         (WebCore::PaintInfo::PaintInfo):
2259         (WebCore::PaintInfo::forceBlackText const):
2260         (WebCore::PaintInfo::forceWhiteText const):
2261         (WebCore::PaintInfo::skipRootBackground const):
2262         (WebCore::PaintInfo::paintRootBackgroundOnly const):
2263         * rendering/PaintPhase.h:
2264         (): Deleted.
2265         * rendering/RenderBlock.cpp:
2266         (WebCore::RenderBlock::paint):
2267         (WebCore::RenderBlock::paintContents):
2268         (WebCore::RenderBlock::paintObject):
2269         (WebCore::RenderBlock::paintSelection):
2270         * rendering/RenderBlockFlow.cpp:
2271         (WebCore::RenderBlockFlow::paintFloats):
2272         * rendering/RenderBox.cpp:
2273         (WebCore::RenderBox::paintMask):
2274         (WebCore::RenderBox::paintClippingMask):
2275         (WebCore::RenderBox::paintMaskImages):
2276         (WebCore::RenderBox::pushContentsClip):
2277         (WebCore::RenderBox::popContentsClip):
2278         * rendering/RenderBox.h:
2279         * rendering/RenderBoxModelObject.cpp:
2280         (WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
2281         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
2282         (WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates const):
2283         * rendering/RenderDetailsMarker.cpp:
2284         (WebCore::RenderDetailsMarker::paint):
2285         * rendering/RenderElement.cpp:
2286         (WebCore::RenderElement::paintAsInlineBlock):
2287         (WebCore::RenderElement::selectionColor const):
2288         * rendering/RenderEmbeddedObject.cpp:
2289         (WebCore::RenderEmbeddedObject::paint):
2290         (WebCore::RenderEmbeddedObject::paintReplaced):
2291         * rendering/RenderFileUploadControl.cpp:
2292         (WebCore::RenderFileUploadControl::paintObject):
2293         * rendering/RenderFrameSet.cpp:
2294         (WebCore::RenderFrameSet::paint):
2295         * rendering/RenderHTMLCanvas.cpp:
2296         (WebCore::RenderHTMLCanvas::paintReplaced):
2297         * rendering/RenderImage.cpp:
2298         (WebCore::RenderImage::paintReplaced):
2299         (WebCore::RenderImage::paint):
2300         * rendering/RenderLayer.cpp:
2301         (WebCore::RenderLayer::renderableTransform const):
2302         (WebCore::transparencyClipBox):
2303         (WebCore::expandClipRectForDescendantsAndReflection):
2304         (WebCore::paintingExtent):
2305         (WebCore::RenderLayer::paint):
2306         (WebCore::RenderLayer::paintOverlayScrollbars):
2307         (WebCore::RenderLayer::paintLayer):
2308         (WebCore::RenderLayer::paintLayerContents):
2309         (WebCore::RenderLayer::paintBackgroundForFragments):
2310         (WebCore::RenderLayer::paintForegroundForFragments):
2311         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
2312         (WebCore::RenderLayer::paintOutlineForFragments):
2313         (WebCore::RenderLayer::paintMaskForFragments):
2314         (WebCore::RenderLayer::paintChildClippingMaskForFragments):
2315         (WebCore::RenderLayer::calculateClipRects const):
2316         * rendering/RenderLayer.h:
2317         * rendering/RenderLayerBacking.cpp:
2318         (WebCore::RenderLayerBacking::paintIntoLayer):
2319         (WebCore::RenderLayerBacking::paintContents):
2320         * rendering/RenderLayerBacking.h:
2321         * rendering/RenderLineBoxList.cpp:
2322         (WebCore::RenderLineBoxList::paint const):
2323         * rendering/RenderListBox.cpp:
2324         (WebCore::RenderListBox::paintObject):
2325         * rendering/RenderListMarker.cpp:
2326         (WebCore::RenderListMarker::paint):
2327         * rendering/RenderReplaced.cpp:
2328         (WebCore::RenderReplaced::paint):
2329         (WebCore::RenderReplaced::shouldPaint):
2330         * rendering/RenderReplica.cpp:
2331         (WebCore::RenderReplica::paint):
2332         * rendering/RenderScrollbarPart.cpp:
2333         (WebCore::RenderScrollbarPart::paintIntoRect):
2334         * rendering/RenderSnapshottedPlugIn.cpp:
2335         (WebCore::RenderSnapshottedPlugIn::paint):
2336         * rendering/RenderTable.cpp:
2337         (WebCore::RenderTable::paintObject):
2338         (WebCore::RenderTable::paintMask):
2339         (WebCore::RenderTable::overflowClipRect):
2340         * rendering/RenderTable.h:
2341         * rendering/RenderTableCell.cpp:
2342         (WebCore::RenderTableCell::paint):
2343         (WebCore::RenderTableCell::paintCollapsedBorders):
2344         (WebCore::RenderTableCell::paintMask):
2345         * rendering/RenderTableRow.cpp:
2346         (WebCore::RenderTableRow::paintOutlineForRowIfNeeded):
2347         (WebCore::RenderTableRow::paint):
2348         * rendering/RenderTableSection.cpp:
2349         (WebCore::RenderTableSection::paint):
2350         (WebCore::RenderTableSection::paintCell):
2351         (WebCore::RenderTableSection::paintObject):
2352         * rendering/RenderThemeMac.mm:
2353         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
2354         (WebCore::RenderThemeMac::paintImageControlsButton):
2355         * rendering/RenderVideo.cpp:
2356         (WebCore::RenderVideo::paintReplaced):
2357         * rendering/RenderWidget.cpp:
2358         (WebCore::RenderWidget::paintContents):
2359         (WebCore::RenderWidget::paint):
2360         * rendering/RootInlineBox.cpp:
2361         (WebCore::RootInlineBox::paintEllipsisBox const):
2362         * rendering/SimpleLineLayoutFunctions.cpp:
2363         (WebCore::SimpleLineLayout::paintFlow):
2364         * rendering/mathml/MathOperator.cpp:
2365         (WebCore::MathOperator::paint):
2366         * rendering/mathml/RenderMathMLBlock.cpp:
2367         (WebCore::RenderMathMLBlock::paint):
2368         * rendering/mathml/RenderMathMLFraction.cpp:
2369         (WebCore::RenderMathMLFraction::paint):
2370         * rendering/mathml/RenderMathMLMenclose.cpp:
2371         (WebCore::RenderMathMLMenclose::paint):
2372         * rendering/mathml/RenderMathMLToken.cpp:
2373         (WebCore::RenderMathMLToken::paint):
2374         * rendering/svg/RenderSVGContainer.cpp:
2375         (WebCore::RenderSVGContainer::paint):
2376         * rendering/svg/RenderSVGForeignObject.cpp:
2377         (WebCore::RenderSVGForeignObject::paint):
2378         * rendering/svg/RenderSVGImage.cpp:
2379         (WebCore::RenderSVGImage::paint):
2380         * rendering/svg/RenderSVGResource.cpp:
2381         (WebCore::requestPaintingResource):
2382         * rendering/svg/RenderSVGResourceClipper.cpp:
2383         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
2384         * rendering/svg/RenderSVGResourceSolidColor.cpp:
2385         (WebCore::RenderSVGResourceSolidColor::applyResource):
2386         * rendering/svg/RenderSVGRoot.cpp:
2387         (WebCore::RenderSVGRoot::paintReplaced):
2388         * rendering/svg/RenderSVGShape.cpp:
2389         (WebCore::RenderSVGShape::paint):
2390         * rendering/svg/RenderSVGText.cpp:
2391         (WebCore::RenderSVGText::paint):
2392         * rendering/svg/SVGInlineFlowBox.cpp:
2393         (WebCore::SVGInlineFlowBox::paintSelectionBackground):
2394         (WebCore::SVGInlineFlowBox::paint):
2395         * rendering/svg/SVGInlineTextBox.cpp:
2396         (WebCore::SVGInlineTextBox::paintSelectionBackground):
2397         (WebCore::SVGInlineTextBox::paint):
2398         * rendering/svg/SVGRenderingContext.cpp:
2399         (WebCore::isRenderingMaskImage):
2400         (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer):
2401         * rendering/svg/SVGRootInlineBox.cpp:
2402         (WebCore::SVGRootInlineBox::paint):
2403
2404 2018-08-06  Ryan Haddad  <ryanhaddad@apple.com>
2405
2406         Unreviewed, rolling out r234569.
2407
2408         Breaks internal builds.
2409
2410         Reverted changeset:
2411
2412         "We should cache the compiled sandbox profile in a data vault"
2413         https://bugs.webkit.org/show_bug.cgi?id=184991
2414         https://trac.webkit.org/changeset/234569
2415
2416 2018-08-06  Alex Christensen  <achristensen@webkit.org>
2417
2418         Make BlendMode an enum class
2419         https://bugs.webkit.org/show_bug.cgi?id=188325
2420
2421         Reviewed by Darin Adler.
2422
2423         No change in behavior.
2424
2425         * css/CSSPrimitiveValueMappings.h:
2426         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2427         (WebCore::CSSPrimitiveValue::operator BlendMode const):
2428         * html/HTMLImageElement.cpp:
2429         (WebCore::HTMLImageElement::parseAttribute):
2430         * html/canvas/CanvasRenderingContext2DBase.cpp:
2431         (WebCore::CanvasRenderingContext2DBase::State::State):
2432         (WebCore::CanvasRenderingContext2DBase::setGlobalCompositeOperation):
2433         (WebCore::CanvasRenderingContext2DBase::drawImageFromRect):
2434         * platform/graphics/BitmapImage.h:
2435         * platform/graphics/GraphicsContext.h:
2436         (WebCore::ImagePaintingOptions::ImagePaintingOptions):
2437         * platform/graphics/GraphicsContextImpl.h:
2438         * platform/graphics/GraphicsLayer.cpp:
2439         (WebCore::GraphicsLayer::dumpProperties const):
2440         * platform/graphics/GraphicsLayer.h:
2441         * platform/graphics/GraphicsTypes.cpp:
2442         (WebCore::parseBlendMode):
2443         (WebCore::parseCompositeAndBlendOperator):
2444         (WebCore::compositeOperatorName):
2445         (WebCore::blendModeName):
2446         (WebCore::operator<<):
2447         * platform/graphics/GraphicsTypes.h:
2448         * platform/graphics/Image.cpp:
2449         (WebCore::Image::drawTiled):
2450         * platform/graphics/Image.h:
2451         * platform/graphics/ImageBuffer.h:
2452         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
2453         (PlatformCAFilters::setBlendingFiltersOnLayer):
2454         * platform/graphics/cg/GraphicsContextCG.cpp:
2455         (WebCore::selectCGBlendMode):
2456         * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
2457         (WebCore::FEBlend::platformApplyNEON):
2458         * platform/graphics/displaylists/DisplayListItems.h:
2459         * platform/graphics/displaylists/DisplayListRecorder.h:
2460         * platform/graphics/filters/FEBlend.cpp:
2461         (WebCore::FEBlend::externalRepresentation const):
2462         * rendering/RenderBox.cpp:
2463         (WebCore::RenderBox::paintFillLayers):
2464         * rendering/RenderImage.cpp:
2465         (WebCore::RenderImage::paintIntoRect):
2466         * rendering/RenderLayer.cpp:
2467         (WebCore::RenderLayer::RenderLayer):
2468         (WebCore::RenderLayer::updateBlendMode):
2469         (WebCore::RenderLayer::beginTransparencyLayers):
2470         * rendering/RenderLayerBacking.cpp:
2471         (WebCore::RenderLayerBacking::updateBlendMode):
2472         * rendering/style/FillLayer.cpp:
2473         (WebCore::FillLayer::FillLayer):
2474         (WebCore::FillLayer::hasOpaqueImage const):
2475         * rendering/style/FillLayer.h:
2476         (WebCore::FillLayer::initialFillBlendMode):
2477         * rendering/style/RenderStyle.h:
2478         (WebCore::RenderStyle::setBlendMode):
2479         (WebCore::RenderStyle::hasBlendMode const):
2480         (WebCore::RenderStyle::blendMode const):
2481         (WebCore::RenderStyle::initialBlendMode):
2482         * rendering/style/StyleRareNonInheritedData.cpp:
2483         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2484         * rendering/svg/SVGRenderingContext.cpp:
2485         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2486         * svg/SVGAnimatedEnumeration.cpp:
2487         (WebCore::enumerationValueForTargetAttribute):
2488         * svg/SVGFEBlendElement.cpp:
2489         (WebCore::SVGFEBlendElement::SVGFEBlendElement):
2490         (WebCore::SVGFEBlendElement::parseAttribute):
2491         * svg/SVGFEBlendElement.h:
2492         (WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
2493         (WebCore::SVGPropertyTraits<BlendMode>::toString):
2494         * svg/graphics/SVGImage.cpp:
2495         (WebCore::SVGImage::nativeImageForCurrentFrame):
2496         (WebCore::SVGImage::nativeImage):
2497         (WebCore::SVGImage::drawPatternForContainer):
2498         (WebCore::SVGImage::draw):
2499
2500 2018-08-06  Aditya Keerthi  <akeerthi@apple.com>
2501
2502         [iOS] Indeterminate checkboxes appear unchecked
2503         https://bugs.webkit.org/show_bug.cgi?id=160484
2504         <rdar://problem/31143185>
2505
2506         Reviewed by Wenson Hsieh.
2507
2508         Add support for rendering indeterminate checkboxes on iOS.
2509
2510         We now paint the unchecked appearance only if the checkbox is not checked and is
2511         not indeterminate. Otherwise, we draw a checkmark if the checkbox is in the
2512         checked state and a dash if the checkbox is in the indeterminate state. Both of
2513         these states share the same dark background.
2514
2515         Test: fast/forms/ios/render-indeterminate-checkbox.html
2516
2517         * css/html.css:
2518         (input[type="checkbox"]:indeterminate):
2519         (input[type="checkbox"]:indeterminate:disabled):
2520         * rendering/RenderThemeIOS.mm:
2521         (WebCore::drawJoinedLines):
2522         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
2523
2524 2018-08-06  Ryosuke Niwa  <rniwa@webkit.org>
2525
2526         HTML parser should execute custom element reactions for setting attributes immediately after creating a custom element
2527         https://bugs.webkit.org/show_bug.cgi?id=188336
2528
2529         Reviewed by Frédéric Wang.
2530
2531         Push and pop an element queue from the custom element reactions stack when constructing a custom element:
2532         https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
2533
2534         To do this, we instantiate CustomElementReactionStack in HTMLDocumentParser::runScriptsForPausedTreeBuilder
2535         where we synchronously construct a custom element. We don't have to worry about whether *will execute script*
2536         is set or not since the presence of an element queue should not be observable in the case where we're constructing
2537         a fallback element (since it would not enqueue any new custom element reaction).
2538
2539         Tests: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html
2540
2541         * html/parser/HTMLDocumentParser.cpp:
2542         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate CustomElementReactionStack. Note that we
2543         don't insert the custom element into the parser until we finish processing the custom element reactions.
2544
2545 2018-08-06  Charlie Turner  <cturner@igalia.com>
2546
2547         Return extracted key ids as an optional
2548         https://bugs.webkit.org/show_bug.cgi?id=188303
2549
2550         Reviewed by Darin Adler.
2551
2552         An empty list of extracted key ids was being considered a failure
2553         case before this patch. In the PSSH boxes from the CENC standard,
2554         it's not uncommon for the box to be version 0, meaning it has no
2555         embedded key ids, so the case when there's an empty list should
2556         not be treated as an error. Given this, the interface should be
2557         more general and allow for a sentinel value indicating a parsing
2558         error rather than an absence of key ids.
2559
2560         Covered by existing tests.
2561
2562         * Modules/encryptedmedia/InitDataRegistry.cpp:
2563         (WebCore::extractKeyIDsKeyids): Change return type to be wrapped
2564         in an optional, and make parsing errors return a nullopt rather
2565         than an empty vector.
2566         (WebCore::sanitizeKeyids): Use the new optional interface, return
2567         a null RefPtr in the case of a parsing error, this method may now
2568         return an empty vector.
2569         (WebCore::extractKeyIDsCenc): Not implemented, so return an error
2570         value rather than an empty vector.
2571         (WebCore::extractKeyIDsWebM): Ditto.
2572         (WebCore::InitDataRegistry::extractKeyIDs): Ditto.
2573         * Modules/encryptedmedia/InitDataRegistry.h: Update the interface
2574         to use an optional return type.
2575         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
2576         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSinf): Update
2577         to use the new interface.
2578         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSkd): Ditto.
2579         * platform/graphics/avfoundation/CDMFairPlayStreaming.h: Ditto.
2580         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2581         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs): Convert
2582         the optional value into a vector, since it is assumed you can not
2583         have an empty vector of key ids in the init datas FPS supports.
2584         * testing/MockCDMFactory.cpp:
2585         (WebCore::MockCDMInstance::requestLicense): Only return an error
2586         if there really was a parsing error, rather than the case of there
2587         being zero key ids in the init data payload.
2588
2589 2018-08-06  Frederic Wang  <fwang@igalia.com>
2590
2591         Make two-arguments versions of scrollBy/scrollTo depend on the one-argument versions
2592         https://bugs.webkit.org/show_bug.cgi?id=188300
2593
2594         Reviewed by Darin Adler.
2595
2596         This patch refactors a bit the scrollBy/scrollTo code, so that the two-arguments versions
2597         share the same code path as the more generic one-argument versions. In particular, this
2598         helps to implement the ScrollBehavior option (bug 188043) since the one-argument versions
2599         will require to distinguish between smooth and instant scrolling. The logic to normalize
2600         non finite left/right values or to use a fallback when they are absent is also factored out
2601         into ScrollToOptions.
2602
2603         References:
2604         https://drafts.csswg.org/cssom-view/#dom-element-scroll
2605         https://drafts.csswg.org/cssom-view/#dom-element-scrollby
2606         https://drafts.csswg.org/cssom-view/#dom-window-scroll
2607         https://drafts.csswg.org/cssom-view/#dom-window-scrollby
2608
2609         No new tests, behavior is unchanged.
2610
2611         * dom/Element.cpp:
2612         (WebCore::Element::scrollBy): Make two-parameter version depends on one-parameter version
2613         and rewrite the normalize / fallback logic.
2614         (WebCore::Element::scrollTo): Rewrite the normalize / fallback logic.
2615         (WebCore::normalizeNonFiniteValue): Deleted. The logic is moved to ScrollToOptions.
2616         * page/DOMWindow.cpp:
2617         (WebCore::DOMWindow::scrollBy const): Make two-parameter version depends on one-parameter
2618         version and rewrite the normalize / fallback logic.
2619         (WebCore::DOMWindow::scrollTo const): Make two-parameter version depends on one-parameter
2620         version and rewrite the normalize / fallback logic.
2621         * page/ScrollToOptions.h: Add <cmath> to use std::isfinite
2622         (WebCore::ScrollToOptions::normalizeNonFiniteCoordinatesOrFallBackTo): New function to
2623         normalize left/right values or fallback to the specified value if it is missing.
2624
2625 2018-08-06  Zan Dobersek  <zdobersek@igalia.com>
2626
2627         Unreviewed follow-up to r234594.
2628
2629         Add missing constructor and destructor definitions for the bunch of new
2630         classes that were added in that revision.
2631
2632         * platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
2633         (Nicosia::ContentLayer::ContentLayer):
2634         (Nicosia::BackingStore::BackingStore):
2635         (Nicosia::ImageBacking::ImageBacking):
2636
2637 2018-08-06  Zan Dobersek  <zdobersek@igalia.com>
2638
2639         [Nicosia] Add additional layer state classes, use impl-based approach to make them extendable
2640         https://bugs.webkit.org/show_bug.cgi?id=188341
2641
2642         Reviewed by Carlos Garcia Campos.
2643
2644         Add the ContentLayer, BackingStore and ImageBacking classes in the
2645         Nicosia namespace. State objects of CompositionLayer instances keep
2646         references to objects of these classes depending on the content that's
2647         presented in the associated GraphicsLayer.
2648
2649         ContentLayer derives from the PlatformLayer class. It's used for layers
2650         that display things like WebGL and HTML5 canvas and media content in a
2651         platform-specific way. In case of TextureMapper the hardware-accelerated
2652         content is piped into that rendering pipeline.
2653
2654         BackingStore is meant to represent the painted contents of a layer. The
2655         equivalent current functionality is using a tiled backing store that
2656         has its contents copied into the CoordinatedBackingStore instance.
2657
2658         ImageBacking is used for a layer whose content is a simple Image object.
2659         Image's pixel data is rasterized and again managed through
2660         CoordinatedBackingStore for rendering.
2661
2662         All these classes, along with the CompositionLayer class, should now be
2663         constructed with a factory function that returns an object that derives
2664         the class-specific Impl interface. This will allow for simpler
2665         implementation of different approaches in parallel. The TextureMapper
2666         variants will be the first ones, replicating the current behavior as it
2667         is implemented across classes in the CoordinatedGraphics and
2668         TextureMapper layers.
2669
2670         * platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
2671         (Nicosia::CompositionLayer::CompositionLayer):
2672         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
2673         (Nicosia::PlatformLayer::isContentLayer const):
2674         (Nicosia::CompositionLayer::Impl::isTextureMapperImpl const):
2675         (Nicosia::CompositionLayer::create):
2676         (Nicosia::CompositionLayer::impl const):
2677         (Nicosia::ContentLayer::Impl::isTextureMapperImpl const):
2678         (Nicosia::ContentLayer::create):
2679         (Nicosia::ContentLayer::impl const):
2680         (Nicosia::BackingStore::Impl::isTextureMapperImpl const):
2681         (Nicosia::BackingStore::create):
2682         (Nicosia::BackingStore::impl const):
2683         (Nicosia::ImageBacking::Impl::isTextureMapperImpl const):
2684         (Nicosia::ImageBacking::create):
2685         (Nicosia::ImageBacking::impl const):
2686         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2687         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
2688
2689 2018-08-06  Zan Dobersek  <zdobersek@igalia.com>
2690
2691         [Nicosia] Add Nicosia::Scene
2692         https://bugs.webkit.org/show_bug.cgi?id=188340
2693
2694         Reviewed by Carlos Garcia Campos.
2695
2696         Add the Nicosia::Scene class that controls the scene's state and enables
2697         thread-safe updates to that state.
2698
2699         The State struct itself holds a set of all the layers in the scene, and
2700         separates out the root layer specifically. An ID counter is also present
2701         there, allowing consumers of this state to easily check for any updates.
2702
2703         A reference to the Nicosia::Scene object now replaces the
2704         HashSet-and-root-layer pair in the CoordinatedGraphicsState struct.
2705
2706         * platform/TextureMapper.cmake:
2707         * platform/graphics/nicosia/NicosiaScene.cpp: Added.
2708         * platform/graphics/nicosia/NicosiaScene.h: Added.
2709         (Nicosia::Scene::create):
2710         (Nicosia::Scene::accessState):
2711         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2712
2713 2018-08-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
2714
2715         [GTK] Buttons are drawn too large, text not centered
2716         https://bugs.webkit.org/show_bug.cgi?id=185854
2717
2718         Reviewed by Carlos Garcia Campos.
2719
2720         Some pages require small buttons and the GTK theme was
2721         drawing only down to a minimum size.
2722
2723         No new tests required. Current layout tests and ManualTests/gtk/theme.html
2724         already cover it.
2725
2726         * platform/gtk/RenderThemeGadget.cpp:
2727         (WebCore::RenderThemeGadget::create):
2728         (WebCore::RenderThemeButtonGadget::RenderThemeButtonGadget): Added
2729         (WebCore::RenderThemeButtonGadget::minimumSize const):
2730         Allow sizes smaller than the minimum size.
2731         * platform/gtk/RenderThemeGadget.h:
2732         * platform/gtk/RenderThemeWidget.cpp:
2733         (WebCore::RenderThemeButton::RenderThemeButton):
2734
2735 2018-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2736
2737         Implement self.queueMicrotask in Workers
2738         https://bugs.webkit.org/show_bug.cgi?id=188247
2739
2740         Reviewed by Ryosuke Niwa.
2741
2742         This patch adds support for self.queueMicrotask to workers.
2743
2744         Tests: http/wpt/workers/queue-microtask.any.html
2745                http/wpt/workers/queue-microtask.any.worker.html
2746
2747         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2748         (WebCore::JSWorkerGlobalScope::queueMicrotask):
2749         * page/DOMWindow.idl:
2750         Move queueMicrotask declaration to WindowOrWorkerGlobalScope.idl.
2751         * page/WindowOrWorkerGlobalScope.idl:
2752
2753 2018-08-05  Rob Buis  <rbuis@igalia.com>
2754
2755         [GTK][WPE] Fetch tests assert in SubresourceLoader::didReceiveResponse()
2756         https://bugs.webkit.org/show_bug.cgi?id=188163
2757
2758         Reviewed by Frédéric Wang.
2759
2760         Fetch in manual redirect mode uses didReceiveResponse instead of
2761         willSendRequestInternal, so update the ASSERT.
2762
2763         * loader/SubresourceLoader.cpp:
2764         (WebCore::SubresourceLoader::didReceiveResponse):
2765
2766 2018-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2767
2768         Add support for microtasks in workers
2769         https://bugs.webkit.org/show_bug.cgi?id=188246
2770
2771         Reviewed by Darin Adler.
2772
2773         This patch adds the microtask mechanism to workers. To adopt the existing microtask mechanism from the main thread,
2774         we extend JSMainThreadExecState for non-main-threads. We rename it to JSExecState, and store stacked
2775         ExecState* data in thread local storage in ThreadGlobalData instead of a static variable s_mainThreadState.
2776
2777         We add MicrotaskQueue to WorkerGlobalScope since each worker has its own thread and it should have its
2778         own microtask queue.
2779
2780         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
2781         * Sources.txt:
2782         * WebCore.xcodeproj/project.pbxproj:
2783         * bindings/js/JSBindingsAllInOne.cpp:
2784         * bindings/js/JSCallbackData.cpp:
2785         (WebCore::JSCallbackData::invokeCallback):
2786         * bindings/js/JSCustomElementInterface.cpp:
2787         (WebCore::constructCustomElementSynchronously):
2788         (WebCore::JSCustomElementInterface::upgradeElement):
2789         (WebCore::JSCustomElementInterface::invokeCallback):
2790         * bindings/js/JSCustomXPathNSResolver.cpp:
2791         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
2792         * bindings/js/JSDOMGlobalObjectTask.cpp:
2793         * bindings/js/JSDOMWindowBase.cpp:
2794         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
2795         Queue a microtask to MicrotaskQueue instead of posting a macrotask.
2796
2797         (WebCore::JSDOMWindowMicrotaskCallback::create): Deleted.
2798         (WebCore::JSDOMWindowMicrotaskCallback::call): Deleted.
2799         (WebCore::JSDOMWindowMicrotaskCallback::JSDOMWindowMicrotaskCallback): Deleted.
2800         (): Deleted.
2801         Extract JSDOMWindowMicrotaskCallback as JSMicrotaskCallback and create a new file for it.
2802
2803         * bindings/js/JSErrorHandler.cpp:
2804         (WebCore::JSErrorHandler::handleEvent):
2805         * bindings/js/JSEventListener.cpp:
2806         (WebCore::JSEventListener::handleEvent):
2807         * bindings/js/JSExecState.cpp: Renamed from Source/WebCore/bindings/js/JSMainThreadExecState.cpp.
2808         (WebCore::JSExecState::didLeaveScriptContext):
2809         If we are in a main thread, we consume main thread microtask queue. If we are in worker thread,
2810         we consume a microtask queue per worker.
2811
2812         (WebCore::functionCallHandlerFromAnyThread):
2813         (WebCore::evaluateHandlerFromAnyThread):
2814         * bindings/js/JSExecState.h: Renamed from Source/WebCore/bindings/js/JSMainThreadExecState.h.
2815         (WebCore::JSExecState::currentState):
2816         (WebCore::JSExecState::call):
2817         (WebCore::JSExecState::evaluate):
2818         (WebCore::JSExecState::profiledCall):
2819         (WebCore::JSExecState::profiledEvaluate):
2820         (WebCore::JSExecState::runTask):
2821         (WebCore::JSExecState::loadModule):
2822         (WebCore::JSExecState::linkAndEvaluateModule):
2823         (WebCore::JSExecState::JSExecState):
2824         (WebCore::JSExecState::~JSExecState):
2825         (WebCore::JSExecState::setCurrentState):
2826         Store and load ExecState in thread local storage, ThreadGlobalData. This allows us to use it for workers.
2827
2828         (WebCore::JSMainThreadNullState::JSMainThreadNullState):
2829         (WebCore::JSMainThreadNullState::~JSMainThreadNullState):
2830         We keep this name "JSMainThreadNullState" since CustomElementReactionStack should be stick to the main thread.
2831         And this class is only used in the main thread.
2832
2833         * bindings/js/JSExecStateInstrumentation.h: Renamed from Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h.
2834         (WebCore::JSExecState::instrumentFunctionInternal):
2835         (WebCore::JSExecState::instrumentFunctionCall):
2836         (WebCore::JSExecState::instrumentFunctionConstruct):
2837         * bindings/js/JSMicrotaskCallback.h: Copied from Source/WebKitLegacy/mac/DOM/DOMHTMLBaseElement.mm.
2838         (WebCore::JSMicrotaskCallback::create):
2839         (WebCore::JSMicrotaskCallback::call):
2840         (WebCore::JSMicrotaskCallback::JSMicrotaskCallback):
2841         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2842         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
2843         * bindings/js/ScheduledAction.cpp:
2844         (WebCore::ScheduledAction::executeFunctionInContext):
2845         * bindings/js/ScriptController.cpp:
2846         (WebCore::ScriptController::evaluateInWorld):
2847         (WebCore::ScriptController::loadModuleScriptInWorld):
2848         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
2849         (WebCore::ScriptController::canAccessFromCurrentOrigin):
2850         * bindings/js/WorkerScriptController.cpp:
2851         (WebCore::WorkerScriptController::evaluate):
2852         * bridge/objc/WebScriptObject.mm:
2853         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2854         (-[WebScriptObject evaluateWebScript:]):
2855         * html/canvas/WebGLRenderingContextBase.cpp:
2856         (WebCore::WebGLRenderingContextBase::compileShader):
2857         (WebCore::WebGLRenderingContextBase::printToConsole):
2858         * inspector/InspectorCanvas.cpp:
2859         (WebCore::InspectorCanvas::buildObjectForCanvas):
2860         (WebCore::InspectorCanvas::buildAction):
2861         * inspector/InspectorController.cpp:
2862         * inspector/InspectorFrontendHost.cpp:
2863         * inspector/TimelineRecordFactory.cpp:
2864         (WebCore::TimelineRecordFactory::createGenericRecord):
2865         * inspector/WorkerInspectorController.cpp:
2866         * inspector/agents/InspectorCanvasAgent.cpp:
2867         * inspector/agents/InspectorNetworkAgent.cpp:
2868         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
2869         * page/DOMWindow.cpp:
2870         (WebCore::DOMWindow::postMessage):
2871         * page/PageConsoleClient.cpp:
2872         (WebCore::PageConsoleClient::addMessage):
2873         * page/csp/ContentSecurityPolicy.cpp:
2874         (WebCore::ContentSecurityPolicy::reportViolation const):
2875         * platform/ThreadGlobalData.h:
2876         (WebCore::ThreadGlobalData::ThreadGlobalData::currentState const):
2877         (WebCore::ThreadGlobalData::ThreadGlobalData::setCurrentState):
2878         * workers/WorkerGlobalScope.cpp:
2879         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2880         (WebCore::WorkerGlobalScope::removeMicrotaskQueue):
2881         * workers/WorkerGlobalScope.h:
2882         (WebCore::WorkerGlobalScope::microtaskQueue const):
2883         * workers/WorkerThread.cpp:
2884         (WebCore::WorkerThread::stop):
2885         * workers/service/ExtendableEvent.cpp:
2886         (WebCore::ExtendableEvent::addExtendLifetimePromise):
2887         When dispatching an "install" event from service worker, we first create an event,
2888         dispatch it, and set a handler which is called when a pending promise count becomes zero.
2889         However, the old code checked pending promise count in a queued microtask. It worked
2890         previously because microtask is actually a macrotask in the service worker. So this check
2891         is done after a handler is set. But this patch introduces real microtask, and this check
2892         happens before a handler is set because dispatching an event can exhaust microtask queue.
2893         According to the spec, this check should not be done in microtask[1]. We make this checking
2894         part as a macrotask. We note that algorithm noted as FIXMEs should be done in this
2895         microtask while the checking part should not be done.
2896
2897         [1]: https://w3c.github.io/ServiceWorker/#installation-algorithm
2898
2899 2018-08-05  Ryosuke Niwa  <rniwa@webkit.org>
2900
2901         Properties set on window.customElements can disappear due to GC
2902         https://bugs.webkit.org/show_bug.cgi?id=172575
2903
2904         Lexicologically sort the IDL attributes per Darin's comment.
2905
2906         * dom/CustomElementRegistry.idl:
2907
2908 2018-08-05  Zalan Bujtas  <zalan@apple.com>
2909
2910         [LFC][BFC] contentHeightForFormattingContextRoot uses the wrong coordinate system to compute the height.
2911         https://bugs.webkit.org/show_bug.cgi?id=188319
2912
2913         Reviewed by Antti Koivisto.
2914
2915         Display::Box::marginBox() is in the coordinate system of the box itself (8px top margin translates to y = -8px).
2916         What we need instead to compute the content height is the top/bottom position in the containing block's coordinate system (rect and rectWithMargin).
2917
2918         * layout/FormattingContextGeometry.cpp:
2919         (WebCore::Layout::contentHeightForFormattingContextRoot):
2920
2921 2018-08-05  Ms2ger  <Ms2ger@igalia.com>
2922
2923         [GStreamer] Remove unsound assertions in MediaPlayerPrivateGStreamerBase.
2924         https://bugs.webkit.org/show_bug.cgi?id=188162
2925
2926         Reviewed by Philippe Normand.
2927
2928         These assertions sometimes fail, and there's a runtime check right
2929         after them anyway.
2930
2931         Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
2932                fast/canvas/webgl/texImage2D-video-flipY-true.html
2933
2934         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2935         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
2936         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
2937
2938 2018-08-05  Philippe Normand  <pnormand@igalia.com>
2939
2940         [MediaCapabilities] Platform integration
2941         https://bugs.webkit.org/show_bug.cgi?id=187850
2942
2943         Reviewed by Eric Carlson.
2944
2945         Mock platform support for the MediaCapabilities specification.
2946
2947         Test: media/mediacapabilities/mock-decodingInfo.html
2948               media/mediacapabilities/mock-encodingInfo.html
2949
2950         * Modules/mediacapabilities/MediaCapabilities.cpp:
2951         (WebCore::MediaCapabilities::decodingInfo):
2952         (WebCore::MediaCapabilities::encodingInfo):
2953         * Modules/mediacapabilities/MediaCapabilitiesInfo.h:
2954         (WebCore::MediaCapabilitiesInfo::create):
2955         * PlatformGTK.cmake:
2956         * PlatformMac.cmake:
2957         * PlatformWPE.cmake:
2958         * Sources.txt:
2959         * WebCore.xcodeproj/project.pbxproj:
2960         * platform/mediacapabilities/MediaEngineConfiguration.cpp: Added.
2961         (WebCore::MediaEngineVideoConfiguration::MediaEngineVideoConfiguration):
2962         (WebCore::MediaEngineAudioConfiguration::MediaEngineAudioConfiguration):
2963         (WebCore::MediaEngineConfiguration::MediaEngineConfiguration):
2964         * platform/mediacapabilities/MediaEngineConfiguration.h: Added.
2965         (WebCore::MediaEngineVideoConfiguration::create):
2966         (WebCore::MediaEngineVideoConfiguration::contentType const):
2967         (WebCore::MediaEngineVideoConfiguration::size const):
2968         (WebCore::MediaEngineVideoConfiguration::bitrate const):
2969         (WebCore::MediaEngineVideoConfiguration::framerate const):
2970         (WebCore::MediaEngineAudioConfiguration::create):
2971         (WebCore::MediaEngineAudioConfiguration::contentType const):
2972         (WebCore::MediaEngineAudioConfiguration::channels const):
2973         (WebCore::MediaEngineAudioConfiguration::bitrate const):
2974         (WebCore::MediaEngineAudioConfiguration::samplerate const):
2975         (WebCore::MediaEngineConfiguration::audioConfiguration const):
2976         (WebCore::MediaEngineConfiguration::videoConfiguration const):
2977         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: Added.
2978         (WebCore::mockEnabled):
2979         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
2980         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
2981         (WebCore::MediaEngineConfigurationFactory::enableMock):
2982         (WebCore::MediaEngineConfigurationFactory::disableMock):
2983         * platform/mediacapabilities/MediaEngineConfigurationFactory.h: Added.
2984         * platform/mediacapabilities/MediaEngineDecodingConfiguration.h: Added.
2985         (WebCore::MediaEngineDecodingConfiguration::MediaEngineDecodingConfiguration):
2986         (WebCore::MediaEngineDecodingConfiguration::canDecodeMedia):
2987         (WebCore::MediaEngineDecodingConfiguration::canSmoothlyDecodeMedia):
2988         (WebCore::MediaEngineDecodingConfiguration::canPowerEfficientlyDecodeMedia):
2989         (WebCore::MediaEngineDecodingConfiguration::decodingType const):
2990         * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Added.
2991         (WebCore::MediaEngineEncodingConfiguration::MediaEngineEncodingConfiguration):
2992         (WebCore::MediaEngineEncodingConfiguration::canEncodeMedia):
2993         (WebCore::MediaEngineEncodingConfiguration::canSmoothlyEncodeMedia):
2994         (WebCore::MediaEngineEncodingConfiguration::canPowerEfficientlyEncodeMedia):
2995         (WebCore::MediaEngineEncodingConfiguration::encodingType const):
2996         * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Added.
2997         (WebCore::MediaEngineDecodingConfigurationMock::canDecodeMedia):
2998         (WebCore::MediaEngineDecodingConfigurationMock::canSmoothlyDecodeMedia):
2999         (WebCore::MediaEngineDecodingConfigurationMock::canPowerEfficientlyDecodeMedia):
3000         * platform/mock/MediaEngineDecodingConfigurationMock.h: Added.
3001         * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Added.
3002         (WebCore::MediaEngineEncodingConfigurationMock::canEncodeMedia):
3003         (WebCore::MediaEngineEncodingConfigurationMock::canSmoothlyEncodeMedia):
3004         (WebCore::MediaEngineEncodingConfigurationMock::canPowerEfficientlyEncodeMedia):
3005         * platform/mock/MediaEngineEncodingConfigurationMock.h: Added.
3006         * testing/Internals.cpp:
3007         (WebCore::Internals::resetToConsistentState):
3008         (WebCore::Internals::enableMockMediaCapabilities):
3009         * testing/Internals.h:
3010         * testing/Internals.idl:
3011
3012 2018-08-04  Simon Fraser  <simon.fraser@apple.com>
3013
3014         Make WebCore::Timer more space-efficient
3015         https://bugs.webkit.org/show_bug.cgi?id=187455
3016
3017         Reviewed by Brent Fulgham.
3018
3019         Steal a bit from m_heapIndex for m_wasDeleted to eliminate padding in Timer.
3020         This reduces the size of Document, which has 8 Timers, from 3360 to 3296 bytes (saving 64 bytes).
3021
3022         * platform/Timer.cpp:
3023         (WebCore::TimerBase::TimerBase):
3024         * platform/Timer.h:
3025
3026 2018-08-04  Ryosuke Niwa  <rniwa@webkit.org>
3027
3028         Properties set on window.customElements can disappear due to GC
3029         https://bugs.webkit.org/show_bug.cgi?id=172575
3030         <rdar://problem/32440668>
3031
3032         Reviewed by Saam Barati.
3033
3034         Fixed the bug that JS wrapper of CustomElementsRegistry can erroneously get collected during GC
3035         by keeping it alive as long as the global object is alive.
3036
3037         Test: fast/custom-elements/custom-element-registry-wrapper-should-stay-alive.html
3038
3039         * dom/CustomElementRegistry.cpp:
3040         (WebCore::CustomElementRegistry::create):
3041         (WebCore::CustomElementRegistry::CustomElementRegistry):
3042         * dom/CustomElementRegistry.h:
3043         (WebCore::CustomElementRegistry): Make this inherited from ContextDestructionObserver.
3044         * dom/CustomElementRegistry.idl: Set GenerateIsReachable=ImplScriptExecutionContext in IDL. This will
3045         make CustomElementRegistry reachable from the global object.
3046         * page/DOMWindow.cpp:
3047         (WebCore::DOMWindow::ensureCustomElementRegistry):
3048
3049 2018-08-03  Ryosuke Niwa  <rniwa@webkit.org>
3050
3051         innerHTML should not synchronously create a custom element
3052         https://bugs.webkit.org/show_bug.cgi?id=188327
3053         <rdar://problem/42923114>
3054
3055         Reviewed by Daniel Bates.
3056
3057         Fixed the bug that the fragment parsing algorithm was synchronously constructing a custom element instead of
3058         enqueuing an element to upgrade.
3059
3060         The fragment parsing algorithm creates an element for a token with *will execute script* flag set to false:
3061         https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
3062         which results in creating an element with synchronous custom elements flag *not* set:
3063         https://dom.spec.whatwg.org/#concept-create-element
3064
3065         When synchronous custom elements flag is false, we're supposed to create an element and enqueue a custom element
3066         upgrade reaction. createHTMLElementOrFindCustomElementInterface was missing this last logic. 
3067
3068         Also fixed a bug that Element::enqueueToUpgrade would hit a debug assertion when a custom element which has been
3069         enqueued to upgrade is enqueued to upgrade for the second time. In this case, we need to put the element into the
3070         current element queue (https://html.spec.whatwg.org/multipage/custom-elements.html#current-element-queue) again.
3071
3072         While the specification simply enqueues another upgrade reaction and bails out immediately in the first step of
3073         the upgrade, WebKit's implementation simply avoids this redundancy in the first place:
3074         https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element
3075
3076         Existing tests such as imported/w3c/web-platform-tests/custom-elements/reactions/Document.html exercises this
3077         code path after the fragment parsing algorithm fix.
3078
3079         Tests: imported/w3c/web-platform-tests/custom-elements/connected-callbacks-html-fragment-parsing.html
3080
3081         * dom/CustomElementReactionQueue.cpp:
3082         (WebCore::CustomElementReactionQueueItem::type const): Added for an assertion.
3083         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Enqueue this element to the current element queue
3084         by calling ensureCurrentQueue and avoid inserting a redundant upgrade reaction.
3085         * dom/CustomElementReactionQueue.h:
3086         * dom/Element.cpp:
3087         (WebCore::Element::enqueueToUpgrade): Handle the case when a custom element is enqueued to upgrade for the second
3088         time while it had been waiting in some element queue. In this case, the reaction queue for this element has
3089         already been created and we simply need to put this element back into the current element queue (i.e. this element
3090         now belongs to both element queues).
3091         * html/parser/HTMLConstructionSite.cpp:
3092         (WebCore::findCustomElementInterface): Extracted out of createHTMLElementOrFindCustomElementInterface.
3093         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Fixed the bug that the HTML parser
3094         was synchronously constructing a custom element even for the fragment parsing algorithm.
3095
3096 2018-08-03  Ben Richards  <benton_richards@apple.com>
3097
3098         We should cache the compiled sandbox profile in a data vault
3099         https://bugs.webkit.org/show_bug.cgi?id=184991
3100
3101         Reviewed by Ryosuke Niwa.
3102
3103         Added functionality to FileHandle so that it can lock a file while open.
3104         Added a function to FileSystem to delete non empty directories.
3105
3106         * platform/FileHandle.cpp:
3107         (WebCore::FileHandle::FileHandle):
3108         (WebCore::FileHandle::open):
3109         (WebCore::FileHandle::close):
3110         * platform/FileHandle.h:
3111         * platform/FileSystem.h:
3112         * platform/cocoa/FileSystemCocoa.mm:
3113         (WebCore::FileSystem::deleteNonEmptyDirectory):
3114
3115 2018-08-03  Justin Fan  <justin_fan@apple.com>
3116
3117         WebGL 2 conformance: vertex_arrays/vertex_array_object.html
3118         https://bugs.webkit.org/show_bug.cgi?id=188291
3119         <rdar://problem/42792709>
3120
3121         Reviewed by Dean Jackson.
3122
3123         Get https://www.khronos.org/registry/webgl/conformance-suites/2.0.0/conformance2/vertex_arrays/vertex-array-object.html 
3124         working on Mac OS and iOS, and check in the new test expectations.
3125
3126         Existing test: webgl/2.0.0/conformance2/vertex_arrays/vertex-array-object.html
3127
3128         * html/canvas/WebGL2RenderingContext.cpp:
3129         (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
3130         (WebCore::WebGL2RenderingContext::deleteVertexArray):
3131         * html/canvas/WebGLRenderingContextBase.cpp:
3132         (WebCore::WebGLRenderingContextBase::deleteObject):
3133         * html/canvas/WebGLVertexArrayObject.cpp:
3134         (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject):
3135         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3136         (WebCore::GraphicsContext3D::checkVaryingsPacking const):
3137         (WebCore::GraphicsContext3D::createVertexArray):
3138         (WebCore::GraphicsContext3D::deleteVertexArray):
3139         (WebCore::GraphicsContext3D::isVertexArray):
3140         (WebCore::GraphicsContext3D::bindVertexArray):
3141
3142 2018-08-03  Sam Weinig  <sam@webkit.org>
3143
3144         Remove WebGPUObject
3145         https://bugs.webkit.org/show_bug.cgi?id=188114
3146
3147         Reviewed by Darin Adler.
3148
3149         This removes the unecessary WebGPUObject base class and updates the classes
3150         that were inheriting from it to instead inherit directly from RefCounted. This
3151         shrinks the size of all the classes that were inheriting from it, as they no
3152         longer store a RefPtr<WebGPURenderingContext> member, which is unused. Most
3153         of the classes also shrink because they can be devirtualized.
3154
3155         This also updates most of the create functions and constructors for the classes
3156         that were inheriting from WebGPUObject to no longer require the WebGPURenderingContext
3157         to be passed in. 
3158         - For WebGPUBuffer, WebGPUCommandQueue, WebGPUComputeCommandEncoder, WebGPUComputePipelineState, 
3159         WebGPUDepthStencilState, WebGPUDrawable, WebGPUFunction, WebGPULibrary, WebGPURenderCommandEncoder, 
3160         WebGPURenderPassDepthAttachmentDescriptor, WebGPURenderPipelineColorAttachmentDescriptor, 
3161         WebGPURenderPipelineState, and WebGPUTexture the WebGPURenderingContext and any other additional 
3162         parameters needed for initialization were replaced with the underlying type (e.g. WebGPUBuffer 
3163         now gets passed a GPUBuffer).
3164         - WebGPUCommandBuffer is passed a GPUCommandQueue, since it needs to construct the underlying
3165         GPUCommandBuffer itself so it can pass in the completion handler.
3166         - For WebGPUDepthStencilDescriptor, WebGPURenderPassAttachmentDescriptor, 
3167         WebGPURenderPassColorAttachmentDescriptor, WebGPURenderPassDescriptor and WebGPURenderPipelineDescriptor
3168         the create and constructor functions are empty.        
3169
3170         * Sources.txt:
3171         * WebCore.xcodeproj/project.pbxproj:
3172         Remove WebGPUObject.h/cpp
3173
3174         * html/canvas/WebGPUBuffer.cpp:
3175         (WebCore::WebGPUBuffer::WebGPUBuffer):
3176         * html/canvas/WebGPUBuffer.h:
3177         * html/canvas/WebGPUBuffer.idl:
3178         Switch from inheriting from WebGPUObject to directly inheriting from 
3179         RefCounted<WebGPUBuffer>. Since this de-virtualizes it, also add 
3180         ImplementationLacksVTable to the IDL file. Also update create 
3181         and constructor to take a GPUBuffer directly, rather than the context.
3182
3183         * html/canvas/WebGPUCommandBuffer.cpp:
3184         (WebCore::WebGPUCommandBuffer::create):
3185         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
3186         Update create and constructor to no longer require a context, as it would
3187         now be unused, as it no longer inherits from WebGPUObject nor needs to hold
3188         onto the context for any reason.
3189
3190         (WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor):
3191         Update to call the new WebGPURenderCommandEncoder::create, which no longer
3192         requires a context.
3193
3194         (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder):
3195         Update to call the new WebGPUComputeCommandEncoder::create, which no longer
3196         requires a context.
3197
3198         * html/canvas/WebGPUCommandBuffer.h:
3199         * html/canvas/WebGPUCommandBuffer.idl:
3200         Switch from inheriting from GPUObject to directly inheriting from 
3201         RefCounted<WebGPUCommandBuffer>. Since this de-virtualizes it, also add 
3202         ImplementationLacksVTable to the IDL file. Also update create and constructor 
3203         to no longer take a context, and just take a GPUCommandQueue. We can't directly
3204         pass a GPUCommandBuffer as WebGPUCommandBuffer needs to pass in a completion handler
3205         on construction of the underlying GPUCommandBuffer.
3206         
3207         * html/canvas/WebGPUCommandQueue.cpp:
3208         (WebCore::WebGPUCommandQueue::WebGPUCommandQueue):
3209         (WebCore::WebGPUCommandQueue::createCommandBuffer):
3210         Update to call the new WebGPUCommandBuffer::create, which no longer
3211         requires a context.
3212     
3213         * html/canvas/WebGPUCommandQueue.h:
3214         * html/canvas/WebGPUCommandQueue.idl:
3215         Switch from inheriting from GPUObject to directly inheriting from 
3216         RefCounted<WebGPUCommandQueue>. Since this de-virtualizes it, also add 
3217         ImplementationLacksVTable to the IDL file. Also update create and
3218         constructor to take a GPUCommandQueue directly.
3219
3220         * html/canvas/WebGPUComputeCommandEncoder.cpp:
3221         (WebCore::WebGPUComputeCommandEncoder::create):
3222         (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder):
3223         * html/canvas/WebGPUComputeCommandEncoder.h:
3224         * html/canvas/WebGPUComputeCommandEncoder.idl:
3225         Switch from inheriting from GPUObject to directly inheriting from 
3226         RefCounted<WebGPUComputeCommandEncoder>. Since this de-virtualizes it, 
3227         also add ImplementationLacksVTable to the IDL file. Also update create and
3228         constructor to take a GPUComputeCommandEncoder directly
3229
3230         * html/canvas/WebGPUComputePipelineState.cpp:
3231         (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState):
3232         * html/canvas/WebGPUComputePipelineState.h:
3233         * html/canvas/WebGPUComputePipelineState.idl:
3234         Switch from inheriting from WebGPUObject to directly inheriting from 
3235         RefCounted<WebGPUComputePipelineState>. Since this de-virtualizes it, also add 
3236         ImplementationLacksVTable to the IDL file. Also update create and
3237         constructor to take a GPUComputePipelineState directly.
3238
3239         * html/canvas/WebGPUDepthStencilDescriptor.cpp:
3240         Remove unneeded include of include "WebGPURenderingContext.h".
3241
3242         * html/canvas/WebGPUDepthStencilDescriptor.h:
3243         * html/canvas/WebGPUDepthStencilDescriptor.idl:
3244         Switch from inheriting from WebGPUObject to directly inheriting from 
3245         RefCounted<WebGPUDepthStencilDescriptor>. Since this de-virtualizes it, also add 
3246         ImplementationLacksVTable to the IDL file.
3247
3248         * html/canvas/WebGPUDepthStencilState.cpp:
3249         (WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState):
3250         * html/canvas/WebGPUDepthStencilState.h:
3251         * html/canvas/WebGPUDepthStencilState.idl:
3252         Switch from inheriting from WebGPUObject to directly inheriting from 
3253         RefCounted<WebGPUDepthStencilState>. Since this de-virtualizes it, also add 
3254         ImplementationLacksVTable to the IDL file. Also update create and
3255         constructor to take a GPUDepthStencilState directly.
3256
3257         * html/canvas/WebGPUDrawable.cpp:
3258         (WebCore::WebGPUDrawable::WebGPUDrawable):
3259         * html/canvas/WebGPUDrawable.h:
3260         * html/canvas/WebGPUDrawable.idl:
3261         Switch from inheriting from WebGPUObject to directly inheriting from 
3262         RefCounted<WebGPUDrawable>. Since this de-virtualizes it, also add 
3263         ImplementationLacksVTable to the IDL file. Also update create and
3264         constructor to take a GPUDrawable directly.
3265
3266         * html/canvas/WebGPUFunction.cpp:
3267         (WebCore::WebGPUFunction::create):
3268         (WebCore::WebGPUFunction::WebGPUFunction):
3269         * html/canvas/WebGPUFunction.h:
3270         * html/canvas/WebGPUFunction.idl:
3271         Switch from inheriting from GPUObject to directly inheriting from 
3272         RefCounted<WebGPUFunction>. Since this de-virtualizes it, also add 
3273         ImplementationLacksVTable to the IDL file. Also update create and
3274         constructor to take a GPUFunction directly.
3275
3276         * html/canvas/WebGPULibrary.cpp:
3277         (WebCore::WebGPULibrary::WebGPULibrary):
3278         (WebCore::WebGPULibrary::functionWithName const):
3279         Update for new WebGPUFunction::create, which no longer requires a
3280         context.
3281
3282         * html/canvas/WebGPULibrary.h:
3283         * html/canvas/WebGPULibrary.idl:
3284         Switch from inheriting from WebGPUObject to directly inheriting from 
3285         RefCounted<WebGPULibrary>. Since this de-virtualizes it, also add 
3286         ImplementationLacksVTable to the IDL file. Also update create and
3287         constructor to take a GPULibrary directly, rather than the context.
3288         Unlike the other create functions that take their underlying type, this
3289         one also continues to need the sourceCode String to be passed, as that
3290         is not available from the underlying GPULibrary and must be stored
3291         seperately.
3292
3293         * html/canvas/WebGPUObject.cpp: Removed.
3294         * html/canvas/WebGPUObject.h: Removed.
3295         Deleted.
3296
3297         * html/canvas/WebGPURenderCommandEncoder.cpp:
3298         (WebCore::WebGPURenderCommandEncoder::create):
3299         (WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder):
3300         * html/canvas/WebGPURenderCommandEncoder.h:
3301         * html/canvas/WebGPURenderCommandEncoder.idl:
3302         Switch from inheriting from GPUObject to directly inheriting from
3303         RefCounted<WebGPURenderCommandEncoder>. Since this de-virtualizes it, also add
3304         ImplementationLacksVTable to the IDL file. Also update create and
3305         constructor to take a GPURenderCommandEncoder directly.
3306
3307         * html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
3308         (WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor):
3309         * html/canvas/WebGPURenderPassAttachmentDescriptor.h:
3310         Switch from inheriting from GPUObject to directly inheriting from 
3311         RefCounted<WebGPURenderPassAttachmentDescriptor>. Also update create and 
3312         constructor to no longer take a context, as it is now not used. This remains virtual
3313         as it is inherited from by WebGPURenderPassColorAttachmentDescriptor and WebGPURenderPassDepthAttachmentDescriptor.
3314
3315         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
3316         (WebCore::WebGPURenderPassColorAttachmentDescriptor::create):
3317         (WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor):
3318         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.h:
3319         Update create and constructor to no longer take a context, as it is now not used. Declare final
3320         as this is not inherited by anything.
3321
3322         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
3323         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::create):
3324         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor):
3325         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h:
3326         Update create and constructor to no longer take a context, as it is now not used. Declare final
3327         as this is not inherited by anything.
3328
3329         * html/canvas/WebGPURenderPassDescriptor.cpp:
3330         (WebCore::WebGPURenderPassDescriptor::depthAttachment):
3331         Update for new WebGPURenderPassDepthAttachmentDescriptor::create function which no longer requires
3332         a context. 
3333         
3334         Semi-interesting note: This function was previously calling "*context()" to pass a WebGPURenderingContext&
3335         to WebGPURenderPassDepthAttachmentDescriptor::create. However, "context()" was always returning null, as
3336         the constructor of WebGPURenderPassDescriptor was not initializing the WebGPUObject with a WebGPURenderingContext.
3337         Now, one might think that this would cause a null-deref, but, because it was being assigned into a 
3338         WebGPURenderingContext&, no dereference happens right away (it essentially just passes a pointer) and since
3339         the function it is being passed to does not use it, it never actually gets dereferenced.
3340
3341         (WebCore::WebGPURenderPassDescriptor::colorAttachments):
3342         Update for new WebGPURenderPassColorAttachmentDescriptor::create function which no longer requires
3343         a context. 
3344
3345         * html/canvas/WebGPURenderPassDescriptor.h:
3346         * html/canvas/WebGPURenderPassDescriptor.idl:
3347         Switch from inheriting from GPUObject to directly inheriting from