Source/WebCore:
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-12-14  Sam Weinig  <sam@webkit.org>
2
3         REGRESSION (204679): Google notifications never load (expecting DOMStringList rather than JS array for Location.ancestorOrigins)
4         <rdar://problem/29573563>
5         https://bugs.webkit.org/show_bug.cgi?id=165872
6
7         Reviewed by Chris Dumez.
8
9         Revert the Location.ancestorOrigins part of r204679 because google.com is relying on
10         it returning a DOMStringList (or at least something with a .item() function), rather
11         than a frozen javascript array.
12         
13         Spec changes are tracked with https://github.com/whatwg/html/issues/2179.
14
15         * page/Location.cpp:
16         (WebCore::Location::ancestorOrigins):
17         * page/Location.h:
18         * page/Location.idl:
19         Change Location.ancestorOrigins back to returning a DOMStringList.
20
21 2016-12-14  Dave Hyatt  <hyatt@apple.com>
22
23         [CSS Parser] Rename StyleKeyframe to StyleRuleKeyframe
24         https://bugs.webkit.org/show_bug.cgi?id=165876
25
26         Reviewed by Simon Fraser.
27
28         * css/CSSKeyframeRule.cpp:
29         (WebCore::StyleRuleKeyframe::StyleRuleKeyframe):
30         (WebCore::StyleRuleKeyframe::~StyleRuleKeyframe):
31         (WebCore::StyleRuleKeyframe::mutableProperties):
32         (WebCore::StyleRuleKeyframe::keyText):
33         (WebCore::StyleRuleKeyframe::setKeyText):
34         (WebCore::StyleRuleKeyframe::cssText):
35         (WebCore::CSSKeyframeRule::CSSKeyframeRule):
36         (WebCore::StyleKeyframe::StyleKeyframe): Deleted.
37         (WebCore::StyleKeyframe::~StyleKeyframe): Deleted.
38         (WebCore::StyleKeyframe::mutableProperties): Deleted.
39         (WebCore::StyleKeyframe::keyText): Deleted.
40         (WebCore::StyleKeyframe::setKeyText): Deleted.
41         (WebCore::StyleKeyframe::cssText): Deleted.
42         * css/CSSKeyframeRule.h:
43         * css/CSSKeyframesRule.cpp:
44         (WebCore::StyleRuleKeyframes::keyframes):
45         (WebCore::StyleRuleKeyframes::parserAppendKeyframe):
46         (WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
47         (WebCore::CSSKeyframesRule::appendRule):
48         (WebCore::CSSKeyframesRule::item):
49         * css/CSSKeyframesRule.h:
50         * css/StyleResolver.cpp:
51         (WebCore::StyleResolver::styleForKeyframe):
52         (WebCore::StyleResolver::keyframeStylesForAnimation):
53         * css/StyleResolver.h:
54         * css/StyleRule.cpp:
55         (WebCore::StyleRuleBase::destroy):
56         * css/StyleRule.h:
57         * css/parser/CSSParser.cpp:
58         (WebCore::CSSParser::parseKeyframeRule):
59         * css/parser/CSSParser.h:
60         * css/parser/CSSParserImpl.cpp:
61         (WebCore::CSSParserImpl::parseDeferredKeyframeList):
62         (WebCore::CSSParserImpl::consumeKeyframesRule):
63         (WebCore::CSSParserImpl::consumeKeyframeStyleRule):
64         * css/parser/CSSParserImpl.h:
65
66 2016-12-14  Dave Hyatt  <hyatt@apple.com>
67
68         [CSS Parser] Make deferred parsing retain the sheet text. Fix invalidation to avoid deferred parsing.
69         https://bugs.webkit.org/show_bug.cgi?id=165868
70
71         Reviewed by Simon Fraser.
72
73         With this new model of token copying, the sheet text needs to be retained. The tokenizer did this,
74         but we're no longer keeping it around.
75
76         StyleInvalidation is also aggressively crawling media rules, even unsupported ones, so fix it
77         to avoid deferred parsing.
78
79         * css/StyleInvalidationAnalysis.cpp:
80         (WebCore::shouldDirtyAllStyle):
81         * css/parser/CSSDeferredParser.cpp:
82         (WebCore::CSSDeferredParser::CSSDeferredParser):
83         * css/parser/CSSDeferredParser.h:
84         (WebCore::CSSDeferredParser::create):
85         * css/parser/CSSParserImpl.cpp:
86         (WebCore::CSSParserImpl::CSSParserImpl):
87
88 2016-12-14  Ryosuke Niwa  <rniwa@webkit.org>
89
90         iOS: An element with tabindex is not focusable unless there is no mouse event handler
91         https://bugs.webkit.org/show_bug.cgi?id=165843
92
93         Reviewed by Antti Koivisto.
94
95         The bug was caused by ancestorRespondingToClickEvents not checking the precense of tabindex attribute.
96         Check that condition along with event listeners.
97
98         Test: fast/events/focusing-element-with-tabindex-by-tap-or-click.html
99
100         * page/ios/FrameIOS.mm:
101         (WebCore::ancestorRespondingToClickEvents):
102
103 2016-12-14  Alex Christensen  <achristensen@webkit.org>
104
105         Progress towards using ANGLE to do WebGL rendering
106         https://bugs.webkit.org/show_bug.cgi?id=165864
107
108         Reviewed by Dean Jackson.
109
110         No new tests, no change in behavior.
111         Just compile fixes for a configuration that will soon be standard
112         that can be landed now without breaking anything.
113
114         * platform/graphics/PlatformDisplay.cpp:
115         (WebCore::PlatformDisplay::sharedDisplay):
116         Ignore some clang warnings that will cause problems when this is compiled on Mac.
117
118 2016-12-14  Dean Jackson  <dino@apple.com>
119
120         [iOS] MediaDocuments have controls on the bottom of the page
121         https://bugs.webkit.org/show_bug.cgi?id=165865
122         <rdar://problem/28757268>
123
124         Reviewed by Jon Lee.
125
126         MediaDocuments on iOS are incorrectly placing the controls at
127         the bottom of the page. This is due to the <video> element
128         getting a height of 100%. It should be "auto" instead.
129
130         * html/MediaDocument.cpp:
131         (WebCore::MediaDocumentParser::createDocumentStructure):
132
133 2016-12-14  Dave Hyatt  <hyatt@apple.com>
134
135         [CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
136         https://bugs.webkit.org/show_bug.cgi?id=165743
137
138         Reviewed by Dean Jackson.
139
140         Added new tests in fast/css/deferred-parsing.
141
142         This patch implements deferred parsing in CSS. By default, when parsing
143         author stylesheets, the parser goes into a deferred mode where it leaves
144         the declaration block of all style rules unparsed initially. Instead of
145         creating and setting an ImmutableStyleProperties object on the StyleRule,
146         the parser creates a DeferredStyleProperties object instead that is
147         capable of calling into CSSDeferredParser to parse the properties and values
148         only when the properties are finally asked for.
149
150         In addition, this patch defers the parsing of the interior of @media,
151         @supports, and @keyframes rules. @media blocks that are never matched will
152         never parse any of the rules inside. @supports conditions for unsupported
153         features will also not be parsed. For @keyframes, if the animation is never
154         referenced/used, then the @keyframes child rules will never be parsed.
155
156         * CMakeLists.txt:
157         * WebCore.xcodeproj/project.pbxproj:
158         Add CSSDeferredParser to the build.
159
160         * css/CSSFontFaceSet.cpp:
161         (WebCore::CSSFontFaceSet::matchingFaces):
162         Patched to drop the StyleSheetContents* argument from parseValue, since it
163         is no longer needed.
164
165         * css/CSSKeyframesRule.cpp:
166         (WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
167         (WebCore::StyleRuleKeyframes::parseDeferredRulesIfNeeded):
168         (WebCore::StyleRuleKeyframes::keyframes):
169         (WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
170         (WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
171         (WebCore::StyleRuleKeyframes::findKeyframeIndex):
172         * css/CSSKeyframesRule.h:
173         Keyframes now hold both a keyframes Vector and a DeferredStyleGroupRuleList
174         object. The keyframes vector won't be populated until it is needed, and the
175         population is done by DeferredStyleGroupRuleList, which holds both the original
176         tokens of the keyframes rule interior, and a references to the
177         CSSDeferredParser that will do the parsing.
178
179         * css/DOMCSSNamespace.cpp:
180         (WebCore::DOMCSSNamespace::supports):
181         Patched to drop the StyleSheetContents* argument from parseValue, since it
182         is no longer needed.
183
184         * css/ElementRuleCollector.cpp:
185         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
186         ElementRuleCollector tests to see if a rule is empty by counting properties(),
187         but we don't want to initiate deferred parsing just to check this. Instead we
188         invoke propertiesWithoutDeferredParsing, which will hand back a nullptr if
189         the properties haven't been parsed yet. In order to ensure this optimization
190         continues to work, any rules whose interiors consist of only whitespace do
191         not get deferred.
192
193         * css/FontFace.cpp:
194         (WebCore::FontFace::setVariant):
195         * css/PropertySetCSSStyleDeclaration.cpp:
196         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
197         (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
198         Patched to drop the StyleSheetContents* argument from parseValue, since it
199         is no longer needed.
200
201         * css/StyleProperties.cpp:
202         (WebCore::MutableStyleProperties::MutableStyleProperties):
203         (WebCore::MutableStyleProperties::setProperty):
204         (WebCore::DeferredStyleProperties::create):
205         (WebCore::DeferredStyleProperties::DeferredStyleProperties):
206         (WebCore::DeferredStyleProperties::~DeferredStyleProperties):
207         (WebCore::DeferredStyleProperties::parseDeferredProperties):
208         * css/StyleProperties.h:
209         (WebCore::StylePropertiesBase::type):
210         (WebCore::StylePropertiesBase::cssParserMode):
211         (WebCore::StylePropertiesBase::StylePropertiesBase):
212         (WebCore::StyleProperties::isMutable):
213         (WebCore::StyleProperties::StyleProperties):
214         (WebCore::StylePropertiesBase::deref):
215         (isType):
216         (WebCore::StyleProperties::cssParserMode): Deleted.
217         (WebCore::StyleProperties::deref): Deleted.
218         Right now StyleProperties has two subclasses, ImmutableStyleProperties (which
219         is created by the parser when not deferring), and MutableStyleProperties (used
220         when making changes and doing DOM Manipulations).
221
222         This patch adds a new base class called StylePropertiesBase, and StyleProperties
223         now derives from it. DeferredStyleProperties derives from this base. The members
224         of StyleProperties have been moved up into StylePropertiesBase.
225
226         The m_isMutable bit, used to determine the type for downcasting has been enhanced
227         to m_type (2 bits), since there are now three possible subclasses.
228
229         * css/StyleRule.cpp:
230         (WebCore::StyleRule::StyleRule):
231         (WebCore::StyleRule::properties):
232         (WebCore::StyleRule::mutableProperties):
233         (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
234         Patched to ensure that when properties() are accessed, that if the current
235         stored StylePropertyBase in the rule is a DeferredStyleProperties, we then
236         parse and replace DeferredStyleProperties with ImmutableStyleProperties on the
237         rule. By using a common base class, we avoid increasing memory usage in
238         StyleRule.
239
240         (WebCore::DeferredStyleGroupRuleList::create):
241         (WebCore::DeferredStyleGroupRuleList::DeferredStyleGroupRuleList):
242         (WebCore::DeferredStyleGroupRuleList::parseDeferredRules):
243         (WebCore::DeferredStyleGroupRuleList::parseDeferredKeyframes):
244         DeferredStyleGroupList is used to handle deferred parsing of objects with
245         child rules. These include @media, @supports and @keyframes.
246
247         (WebCore::StyleRuleGroup::StyleRuleGroup):
248         (WebCore::StyleRuleGroup::childRules):
249         (WebCore::StyleRuleGroup::wrapperInsertRule):
250         (WebCore::StyleRuleGroup::wrapperRemoveRule):
251         (WebCore::StyleRuleGroup::parseDeferredRulesIfNeeded):
252         (WebCore::StyleRuleMedia::StyleRuleMedia):
253         (WebCore::StyleRuleSupports::StyleRuleSupports):
254         StyleRuleGroup now holds both a child rules Vector and a
255         DeferredStyleGroupRuleList. If DeferredStyleGroupRuleList is set, then
256         when the childRules are finally accessed, we will populate the childRules
257         Vector and then null out the DeferredStyleGroupRuleList.
258
259         * css/StyleRule.h:
260         (WebCore::StyleRule::propertiesWithoutDeferredParsing):
261         (WebCore::StyleRuleGroup::childRulesWithoutDeferredParsing):
262         (WebCore::StyleRuleGroup::childRules): Deleted.
263         Add new accesors for fetching properties and child rules without causing
264         deferred parsing to happen.
265
266         * css/StyleSheetContents.cpp:
267         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
268         (WebCore::StyleSheetContents::parseString):
269         Patched to turn on deferred parsing for author sheets and for all
270         non-UA stylesheets parsed from a string (e.g., <style>).
271
272         (WebCore::traverseSubresourcesInRules):
273         The broken resource check was aggressively accessing properties(). Patch
274         it to call propertiesWithoutDeferredParsing() instead so that it doesn't
275         defeat the new optimization.
276
277         * css/WebKitCSSMatrix.cpp:
278         (WebCore::WebKitCSSMatrix::setMatrixValue):
279         Patched to drop the StyleSheetContents* argument from parseValue, since it
280         is no longer needed.
281
282         * css/parser/CSSDeferredParser.cpp: Added.
283         (WebCore::CSSDeferredParser::CSSDeferredParser):
284         (WebCore::CSSDeferredParser::parseDeclaration):
285         (WebCore::CSSDeferredParser::parseRuleList):
286         (WebCore::CSSDeferredParser::parseKeyframeList):
287         * css/parser/CSSDeferredParser.h: Added.
288         (WebCore::CSSDeferredParser::create):
289         (WebCore::CSSDeferredParser::tokenizer):
290         (WebCore::CSSDeferredParser::mode):
291         (WebCore::CSSDeferredParser::context):
292         (WebCore::CSSDeferredParser::styleSheet):
293         The CSSDeferredParser. It caches the original tokenizer's' escaped strings. Because
294         the CSSDeferredParser is referenced by all the rules that have yet to parse,
295         it will stay alive until all rules in the stylesheet has been fully parsed.
296
297         The parser receives CSSParserTokenRanges from DeferredStyleProperties or
298         DeferredStyleGroupRuleList and feeds them to CSSParserImpl, which then
299         is able to do the parsing as it would have occurred originally had the
300         range not been deferred.
301
302         * css/parser/CSSParser.cpp:
303         (WebCore::CSSParser::parseSheet):
304         (WebCore::CSSParser::parseSupportsCondition):
305         (WebCore::CSSParser::parseSingleValue):
306         (WebCore::CSSParser::parseValue):
307         * css/parser/CSSParser.h:
308         * css/parser/CSSParserFastPaths.cpp:
309         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
310         (WebCore::parseKeywordValue):
311         (WebCore::CSSParserFastPaths::maybeParseValue):
312         * css/parser/CSSParserFastPaths.h:
313         Drop the StyleSheetContents* argument from the methods that no longer need
314         them.
315
316         * css/parser/CSSParserImpl.cpp:
317         (WebCore::CSSParserImpl::CSSParserImpl):
318         (WebCore::CSSParserImpl::tokenizer):
319         (WebCore::CSSParserImpl::parseValue):
320         (WebCore::CSSParserImpl::parseCustomPropertyValue):
321         (WebCore::CSSParserImpl::parseDeclarationList):
322         (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
323         (WebCore::CSSParserImpl::parseRule):
324         (WebCore::CSSParserImpl::parseStyleSheet):
325         (WebCore::CSSParserImpl::parseDeclarationListForInspector):
326         (WebCore::CSSParserImpl::parseStyleSheetForInspector):
327         (WebCore::CSSParserImpl::consumeQualifiedRule):
328         (WebCore::CSSParserImpl::consumeMediaRule):
329         (WebCore::CSSParserImpl::consumeSupportsRule):
330         (WebCore::CSSParserImpl::consumeKeyframesRule):
331         (WebCore::CSSParserImpl::consumeStyleRule):
332         Drop the StyleSheetContents* argument from the methods that no longer need
333         them.
334
335         (WebCore::CSSParserImpl::createDeferredStyleProperties):
336         (WebCore::CSSParserImpl::parseDeferredDeclaration):
337         (WebCore::CSSParserImpl::parseDeferredRuleList):
338         (WebCore::CSSParserImpl::parseDeferredKeyframeList):
339         The methods that handle deferred parsing. They make sure to initialize
340         new CSSParserImpls with the original deferred parser, and then call existing
341         methods to do the parsing.
342
343         * css/parser/CSSParserImpl.h:
344         Patched to remove StyleSheetContents* arguments from some methods and
345         to add the new deferred parsing methods.
346
347         * css/parser/CSSParserTokenRange.cpp:
348         (WebCore::CSSParserTokenRange::consumeBlockCheckingForEditability):
349         * css/parser/CSSParserTokenRange.h:
350         In order to preserve the editability optimization from r180867, when
351         a style rule's block is consumed, we use a special method that looks
352         for -webkit-user-modify tokens. If one is seen, then the editability
353         optimization is turned off. Because we do this at the token level,
354         the optimization keeps working even if properties don't get parsed.
355
356         * css/parser/CSSPropertyParser.cpp:
357         (WebCore::CSSPropertyParser::parseSingleValue):
358         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
359         (WebCore::CSSPropertyParser::consumeFont):
360         (WebCore::CSSPropertyParser::parseShorthand):
361         Patched to remove StyleSheetContents* arguments now that the editability
362         check is in CSSTokenizer instead.
363
364         * css/parser/CSSTokenizer.cpp:
365         (WebCore::CSSTokenizer::tokenRange):
366         * css/parser/CSSTokenizer.h:
367         Make tokenRange() const.
368
369         * html/canvas/CanvasRenderingContext2D.cpp:
370         (WebCore::CanvasRenderingContext2D::setFont):
371         Patched to drop the StyleSheetContents* argument.
372
373         * testing/Internals.cpp:
374         (WebCore::deferredStyleRulesCountForList):
375         (WebCore::Internals::deferredStyleRulesCount):
376         (WebCore::deferredGroupRulesCountForList):
377         (WebCore::Internals::deferredGroupRulesCount):
378         (WebCore::deferredKeyframesRulesCountForList):
379         (WebCore::Internals::deferredKeyframesRulesCount):
380         * testing/Internals.h:
381         * testing/Internals.idl:
382         Add new testing methods that can count the deferred style rules and
383         group child rule lists. These methods are used by the new layout tests.
384
385 2016-12-14  Brady Eidson  <beidson@apple.com>
386
387         IndexedDB 2.0: Massively speedup IDBIndex.get().
388         https://bugs.webkit.org/show_bug.cgi?id=165802
389
390         Reviewed by Alex Christensen.
391
392         No new tests (No behavior change to Javascript, table upgrade change covered by API test).
393
394         This change upgrades the IndexRecords schema to include the ObjectStore record ID for the referenced record.
395         It also adds a SQLite Index-by-key on IndexRecords.
396
397         This speeds up PerformanceTests/IndexedDB/index-get.html by 15-20x.
398
399         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
400         (WebCore::IDBServer::v3IndexRecordsTableSchema):
401         (WebCore::IDBServer::v3IndexRecordsTableSchemaAlternate):
402         (WebCore::IDBServer::v1IndexRecordsIndexSchema):
403         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
404         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsIndex):
405         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
406         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
407         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
408         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
409         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
410         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
411         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
412         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
413         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
414         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
415
416         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
417         (WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
418         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
419         * Modules/indexeddb/server/SQLiteIDBCursor.h:
420         (WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):
421
422 2016-12-14  Sam Weinig  <sam@webkit.org>
423
424         Actually set the shipping contact when validating the payment request
425
426         Reviewed by Anders Carlsson.
427
428         * Modules/applepay/ApplePaySession.cpp:
429         (WebCore::convertAndValidate):
430         Fix typo.
431
432 2016-12-14  John Wilander  <wilander@apple.com>
433
434         Handle key generation with empty challenge string
435         https://bugs.webkit.org/show_bug.cgi?id=165835
436         <rdar://problem/29128710>
437
438         Reviewed by Anders Carlsson.
439
440         https://bugs.webkit.org/show_bug.cgi?id=160945 didn't set the challenge length to
441         1 for empty challenge strings. Thus the null terminator was not included. Empty
442         challenge strings are allowed:
443         "If the element has a challenge attribute, then let challenge be that attribute's
444         value. Otherwise, let challenge be the empty string."
445         https://www.w3.org/TR/html5/forms.html#the-keygen-element (fetched 2016-12-13)
446
447         Email certificate generation at
448         https://www.comodo.com/home/email-security/free-email-certificate.php broke
449         because of https://bugs.webkit.org/show_bug.cgi?id=160945.
450
451         No new tests. The original patch did not have tests and the breakage was in the
452         produced key material so a test would have to validate the crypto output.
453
454         * platform/mac/SSLKeyGeneratorMac.mm:
455         (WebCore::signedPublicKeyAndChallengeString):
456             Now adds 1 to the length of the challenge to account for its null terminator.
457             This matches the old behavior.
458
459 2016-12-14  Daniel Bates  <dabates@apple.com>
460
461         CSP: Allow HTTPS URL to match HTTP source expression
462         https://bugs.webkit.org/show_bug.cgi?id=159520
463         <rdar://problem/27287177>
464
465         Reviewed by Brent Fulgham.
466
467         Test: http/tests/security/contentSecurityPolicy/script-src-parsing-implicit-and-explicit-port-number.html
468
469         * page/csp/ContentSecurityPolicySource.cpp:
470         (WebCore::ContentSecurityPolicySource::schemeMatches):
471         (WebCore::ContentSecurityPolicySource::portMatches):
472
473 2016-12-14  Alex Christensen  <achristensen@webkit.org>
474
475         REGRESSION (r209776): [ios-simulator] LayoutTest http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html is timing out
476         https://bugs.webkit.org/show_bug.cgi?id=165836
477
478         Reviewed by Brady Eidson.
479
480         * loader/CrossOriginAccessControl.cpp:
481         (WebCore::createAccessControlPreflightRequest):
482         Use the platform default timeout for CORS preflight requests.
483
484 2016-12-14  Antti Koivisto  <antti@apple.com>
485
486         WebContent crash under WebCore::CachedResource::load in WebCore::FrameLoader::outgoingReferrer const
487         https://bugs.webkit.org/show_bug.cgi?id=165852
488         <rdar://problem/27297153>
489
490         Reviewed by Chris Dumez.
491
492         There appears to be some path where we get here with a null frame.
493         No test, don't know how exactly this happens.
494
495         * loader/FrameLoader.cpp:
496         (WebCore::FrameLoader::outgoingReferrer):
497
498             Null check the frame.
499
500 2016-12-14  Chris Dumez  <cdumez@apple.com>
501
502         Unreviewed, rolling out r209766.
503
504         Regressed Dromaeo JSLib by ~50%
505
506         Reverted changeset:
507
508         "Make opaque root scanning truly constraint-based"
509         https://bugs.webkit.org/show_bug.cgi?id=165760
510         http://trac.webkit.org/changeset/209766
511
512 2016-12-14  Andy Estes  <aestes@apple.com>
513
514         EventDispatcher::dispatchEvent() should take its Node by reference
515         https://bugs.webkit.org/show_bug.cgi?id=165840
516
517         Reviewed by Andreas Kling.
518
519         No new tests. No change in behavior.
520
521         * dom/Element.cpp:
522         (WebCore::Element::dispatchWheelEvent): Dereferenced |this| when calling
523         EventDispatcher::dispatchEvent().
524         (WebCore::Element::dispatchKeyEvent): Ditto.
525         (WebCore::Element::dispatchFocusEvent): Ditto.
526         (WebCore::Element::dispatchBlurEvent): Ditto.
527         * dom/EventDispatcher.cpp:
528         (WebCore::EventDispatcher::dispatchEvent): Changed |origin| from a Node* to a Node&, renamed
529         it to |node|, and protected it with a Ref called |protectedNode| to match our preferred
530         style.
531         * dom/EventDispatcher.h: Changed dispatchEvent's first parameter type from Node* to Node&.
532         * dom/Node.cpp:
533         (WebCore::Node::dispatchEvent): Dereferenced |this| when calling
534         EventDispatcher::dispatchEvent().
535         (WebCore::Node::dispatchTouchEvent): Ditto.
536         (WebCore::Node::dispatchUIRequestEvent): Ditto.
537         * dom/ScopedEventQueue.cpp:
538         (WebCore::ScopedEventQueue::dispatchEvent): Dereferenced |node| when calling
539         EventDispatcher::dispatchEvent().
540         * dom/SimulatedClick.cpp:
541         (WebCore::simulateMouseEvent): Passed |element| as a reference to
542         EventDispatcher::dispatchEvent().
543
544 2016-12-14  Chris Dumez  <cdumez@apple.com>
545
546         Remove Unicode case-insensitive matching for usemap=""
547         https://bugs.webkit.org/show_bug.cgi?id=163894
548
549         Reviewed by Antti Koivisto.
550
551         Remove Unicode case-insensitive matching for usemap="" as this no longer
552         matches the specification [1] or Firefox. Also align our parsing logic for
553         the usemap attribute to match the specification [2].
554
555         This simplifies the code a bit, is more efficient and the compatibility
556         risk should be low based on Firefox's behavior and Chome's usage data.
557
558         [1] https://github.com/whatwg/html/commit/6acdb2122298d2bb7bb839c0a61b4e1f9b0f9bc9
559         [2] https://html.spec.whatwg.org/#rules-for-parsing-a-hash-name-reference
560
561         Test: fast/images/image-usemap-parsing.html
562
563         * dom/Document.cpp:
564         (WebCore::Document::addImageElementByUsemap):
565         (WebCore::Document::removeImageElementByUsemap):
566         (WebCore::Document::imageElementByUsemap):
567         * dom/Document.h:
568         * dom/DocumentOrderedMap.cpp:
569         (WebCore::DocumentOrderedMap::getElementByUsemap):
570         * dom/DocumentOrderedMap.h:
571         * dom/TreeScope.cpp:
572         (WebCore::TreeScope::getImageMap):
573         * html/HTMLImageElement.cpp:
574         (WebCore::HTMLImageElement::parseAttribute):
575         (WebCore::HTMLImageElement::insertedInto):
576         (WebCore::HTMLImageElement::removedFrom):
577         (WebCore::HTMLImageElement::matchesUsemap):
578         * html/HTMLImageElement.h:
579         * html/HTMLMapElement.cpp:
580         (WebCore::HTMLMapElement::imageElement):
581         (WebCore::HTMLMapElement::parseAttribute):
582         * html/parser/HTMLParserIdioms.cpp:
583         (WebCore::parseHTMLHashNameReference):
584         * html/parser/HTMLParserIdioms.h:
585
586 2016-12-14  Ryan Haddad  <ryanhaddad@apple.com>
587
588         Attempt to fix the Windows build after r209805.
589
590         Unreviewed build fix.
591
592         * css/CSSAllInOne.cpp:
593
594 2016-12-14  Dave Hyatt  <hyatt@apple.com>
595
596         [CSS Parser] Remove WebkitCSSTransformValue
597         https://bugs.webkit.org/show_bug.cgi?id=165844
598
599         Reviewed by Zalan Bujtas.
600
601         Remove WebkitCSSTransformValue and just use a CSSFunctionValue instead. No other
602         browsers support it, and the information it provides is easily obtainable from cssText.
603
604         * CMakeLists.txt:
605         * DerivedSources.cpp:
606         * DerivedSources.make:
607         * WebCore.xcodeproj/project.pbxproj:
608         * bindings/js/JSCSSValueCustom.cpp:
609         (WebCore::toJSNewlyCreated):
610         * css/CSSComputedStyleDeclaration.cpp:
611         (WebCore::matrixTransformValue):
612         * css/CSSValue.cpp:
613         (WebCore::CSSValue::equals):
614         (WebCore::CSSValue::cssText):
615         (WebCore::CSSValue::destroy):
616         (WebCore::CSSValue::cloneForCSSOM):
617         * css/CSSValue.h:
618         (WebCore::CSSValue::isSpringTimingFunctionValue):
619         (WebCore::CSSValue::isWebKitCSSTransformValue): Deleted.
620         * css/StyleResolver.cpp:
621         * css/TransformFunctions.cpp:
622         (WebCore::transformOperationType):
623         (WebCore::transformsForValue):
624         * css/TransformFunctions.h:
625         * css/WebKitCSSTransformValue.cpp: Removed.
626         * css/WebKitCSSTransformValue.h: Removed.
627         * css/WebKitCSSTransformValue.idl: Removed.
628         * css/parser/CSSParserFastPaths.cpp:
629         (WebCore::parseTransformTranslateArguments):
630         (WebCore::parseTransformNumberArguments):
631         (WebCore::parseSimpleTransformValue):
632         (WebCore::parseSimpleTransformList):
633         * css/parser/CSSPropertyParser.cpp:
634         (WebCore::consumeTranslate3d):
635         (WebCore::consumeNumbers):
636         (WebCore::consumePerspective):
637         (WebCore::consumeTransformValue):
638         (WebCore::transformOperationForCSSValueID): Deleted.
639
640 2016-12-14  Antti Koivisto  <antti@apple.com>
641
642         Make Style::Update const in RenderTreeUpdater
643         https://bugs.webkit.org/show_bug.cgi?id=165845
644
645         Reviewed by Andreas Kling.
646
647         Moving style away from unique_ptrs leaves them in weird state.
648
649         * style/RenderTreeUpdater.cpp:
650         (WebCore::findRenderingRoots):
651         (WebCore::RenderTreeUpdater::commit):
652         (WebCore::RenderTreeUpdater::updateElementRenderer):
653
654             Clone the style instead of moving it. This is not meaningfully more expensive.
655             Remove null checks, style is never null.
656
657         * style/RenderTreeUpdater.h:
658
659 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
660
661         Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
662         https://bugs.webkit.org/show_bug.cgi?id=165795
663
664         Reviewed by Saam Barati.
665
666         * bindings/js/IDBBindingUtilities.cpp:
667         (WebCore::createIDBKeyFromValue):
668         * bindings/js/JSAudioTrackCustom.cpp:
669         (WebCore::JSAudioTrack::setKind):
670         (WebCore::JSAudioTrack::setLanguage):
671         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
672         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
673         * bindings/js/JSCustomXPathNSResolver.cpp:
674         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
675         * bindings/js/JSDOMWindowCustom.cpp:
676         (WebCore::JSDOMWindow::setLocation):
677         * bindings/js/JSDeviceMotionEventCustom.cpp:
678         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
679         * bindings/js/JSDeviceOrientationEventCustom.cpp:
680         (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
681         * bindings/js/JSEventListener.cpp:
682         (WebCore::JSEventListener::handleEvent):
683         * bindings/js/JSHTMLAllCollectionCustom.cpp:
684         (WebCore::callHTMLAllCollection):
685         (WebCore::JSHTMLAllCollection::namedItem):
686         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
687         (WebCore::JSHTMLFormControlsCollection::namedItem):
688         * bindings/js/JSHTMLInputElementCustom.cpp:
689         (WebCore::JSHTMLInputElement::setSelectionDirection):
690         * bindings/js/JSInspectorFrontendHostCustom.cpp:
691         (WebCore::populateContextMenuItems):
692         * bindings/js/JSMessageEventCustom.cpp:
693         (WebCore::handleInitMessageEvent):
694         * bindings/js/JSSQLTransactionCustom.cpp:
695         (WebCore::JSSQLTransaction::executeSql):
696         * bindings/js/JSTextTrackCustom.cpp:
697         (WebCore::JSTextTrack::setLanguage):
698         * bindings/js/JSVideoTrackCustom.cpp:
699         (WebCore::JSVideoTrack::setKind):
700         (WebCore::JSVideoTrack::setLanguage):
701         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
702         (WebCore::cryptoKeyFormatFromJSValue):
703         (WebCore::cryptoKeyUsagesFromJSValue):
704         * bindings/js/JSXMLHttpRequestCustom.cpp:
705         (WebCore::JSXMLHttpRequest::send):
706         * bindings/js/JSXSLTProcessorCustom.cpp:
707         (WebCore::JSXSLTProcessor::setParameter):
708         (WebCore::JSXSLTProcessor::getParameter):
709         (WebCore::JSXSLTProcessor::removeParameter):
710         * bindings/js/ScheduledAction.cpp:
711         (WebCore::ScheduledAction::create):
712         * bridge/c/c_utility.cpp:
713         (JSC::Bindings::convertValueToNPVariant):
714         * bridge/testbindings.cpp:
715         (main):
716
717 2016-12-14  Joonghun Park  <jh718.park@samsung.com>
718
719         [EFL] Fix debug build break since r207192. Unreviewed.
720         https://bugs.webkit.org/show_bug.cgi?id=165847
721
722         No new tests, no new behaviours.
723
724         In JSDOMBinding.h, JSClass::info() returns each js class's
725         "static const JSC::ClassInfo s_info"'s address.
726         It's static variable's address, so always non-null.
727
728         * bindings/js/JSDOMBinding.h:
729         (WebCore::BindingCaller::callPromiseOperation):
730         (WebCore::BindingCaller::callOperation):
731         (WebCore::BindingCaller::setAttribute):
732         (WebCore::BindingCaller::attribute):
733
734 2016-12-14  Enrique Ocaña González  <eocanha@igalia.com>
735
736         REGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and crashes, bots exiting early
737         https://bugs.webkit.org/show_bug.cgi?id=164022
738
739         Reviewed by Xabier Rodriguez-Calvar.
740
741         Covered by existing tests.
742
743         * page/Settings.cpp:
744         Added new setting to disable GStreamer players, so the selection of
745         MockMediaPlayerMediaSource can be forced for some tests, just like
746         it's already being done for the AVFoundation player in Mac.
747         (WebCore::Settings::setGStreamerEnabled):
748         * page/Settings.h:
749         (WebCore::Settings::isGStreamerEnabled):
750         * platform/graphics/MediaPlayer.cpp:
751         (WebCore::buildMediaEnginesVector):
752         Don't register GStreamer players when they're disabled.
753         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
754         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime):
755         Use doubles instead of floats.
756         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
757         Use doubles instead of floats for m_durationAtEOS.
758         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
759         Don't reset m_sample on videoSink drain, it causes too many problems.
760         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
761         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
762         Removed unused methods.
763         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
764         Keep releasing m_sample on drain, but don't report the event
765         externally via signal anymore. The base player private isn't
766         listening to it anymore.
767         (webkitVideoSinkEvent):
768         (webkit_video_sink_class_init):
769         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
770         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
771         Check if the demuxer caps correspond to a supported codec.
772         (WebCore::AppendPipeline::didReceiveInitializationSegment):
773         Empty m_track is now legal and means unsupported codec.
774         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
775         Warn about more than one stream, but "support" it by ignoring it using
776         a black hole probe.
777         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
778         Also report the duration when it's detected for the first time. Invalid
779         stream types now mean that unsupported codecs have been detected.
780         Complete init segment processing in that case.
781         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
782         Disconnect black hole probe.
783         (WebCore::appendPipelineDemuxerBlackHolePadProbe): Ignore buffers.
784         (WebCore::appendPipelineDemuxerPadRemoved): New parameter used.
785         * platform/graphics/gstreamer/mse/AppendPipeline.h:
786         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
787         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs):
788         Check supported codecs by matching against wildcard expressions.
789         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
790         Check for supported codecs.
791         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
792         New supportsCodecs() method.
793         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
794         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
795         Implemented parser resetting by aborting the AppendPipeline.
796         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
797         Added resetParserState().
798         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
799         (WebCore::SourceBufferPrivateGStreamer::resetParserState):
800         Implemented it.
801         * testing/Internals.cpp:
802         (WebCore::Internals::initializeMockMediaSource):
803         Disable the GStreamer players when initializing the mock media source,
804         like it's already done for the AVFoundation player to force the
805         selection of MockMediaPlayerMediaSource.
806
807 2016-12-14  Enrique Ocaña González  <eocanha@igalia.com>
808
809         [GStreamer][MSE] Fix player private selection when MSE is enabled
810         https://bugs.webkit.org/show_bug.cgi?id=164116
811
812         Reviewed by Philippe Normand.
813
814         Covered by existing tests.
815
816         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
817         (WebCore::MediaPlayerPrivateGStreamer::load):
818         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
819         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
820
821 2016-12-13  Commit Queue  <commit-queue@webkit.org>
822
823         Unreviewed, rolling out r209792.
824         https://bugs.webkit.org/show_bug.cgi?id=165841
825
826         Cause build failures (Requested by yusukesuzuki on #webkit).
827
828         Reverted changeset:
829
830         "Use JSValue::toWTFString instead of calling toString(exec)
831         and value(exec)"
832         https://bugs.webkit.org/show_bug.cgi?id=165795
833         http://trac.webkit.org/changeset/209792
834
835 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
836
837         Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
838         https://bugs.webkit.org/show_bug.cgi?id=165795
839
840         Reviewed by Saam Barati.
841
842         * bindings/js/IDBBindingUtilities.cpp:
843         (WebCore::createIDBKeyFromValue):
844         (WebCore::getNthValueOnKeyPath): Deleted.
845         (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
846         (WebCore::ensureNthValueOnKeyPath): Deleted.
847         (WebCore::canInjectNthValueOnKeyPath): Deleted.
848         (WebCore::injectIDBKeyIntoScriptValue): Deleted.
849         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
850         (WebCore::canInjectIDBKeyIntoScriptValue): Deleted.
851         (WebCore::deserializeIDBValueToJSValue): Deleted.
852         (WebCore::scriptValueToIDBKey): Deleted.
853         (WebCore::idbKeyDataToScriptValue): Deleted.
854         (WebCore::createKeyPathArray): Deleted.
855         (WebCore::generateIndexKeyForValue): Deleted.
856         * bindings/js/JSAudioTrackCustom.cpp:
857         (WebCore::JSAudioTrack::setKind):
858         (WebCore::JSAudioTrack::setLanguage):
859         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
860         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
861         * bindings/js/JSCustomXPathNSResolver.cpp:
862         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
863         * bindings/js/JSDOMWindowCustom.cpp:
864         (WebCore::JSDOMWindow::setLocation):
865         * bindings/js/JSDeviceMotionEventCustom.cpp:
866         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
867         * bindings/js/JSDeviceOrientationEventCustom.cpp:
868         (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
869         * bindings/js/JSEventListener.cpp:
870         (WebCore::JSEventListener::handleEvent):
871         (WebCore::JSEventListener::virtualisAttribute): Deleted.
872         (WebCore::JSEventListener::operator==): Deleted.
873         (WebCore::eventHandlerAttribute): Deleted.
874         (WebCore::createEventListenerForEventHandlerAttribute): Deleted.
875         (WebCore::setEventHandlerAttribute): Deleted.
876         (WebCore::windowEventHandlerAttribute): Deleted.
877         (WebCore::setWindowEventHandlerAttribute): Deleted.
878         (WebCore::documentEventHandlerAttribute): Deleted.
879         (WebCore::setDocumentEventHandlerAttribute): Deleted.
880         * bindings/js/JSHTMLAllCollectionCustom.cpp:
881         (WebCore::callHTMLAllCollection):
882         (WebCore::JSHTMLAllCollection::namedItem):
883         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
884         (WebCore::JSHTMLFormControlsCollection::namedItem):
885         * bindings/js/JSHTMLInputElementCustom.cpp:
886         (WebCore::JSHTMLInputElement::setSelectionDirection):
887         (WebCore::JSHTMLInputElement::setSelectionRange): Deleted.
888         * bindings/js/JSInspectorFrontendHostCustom.cpp:
889         (WebCore::populateContextMenuItems):
890         (WebCore::JSInspectorFrontendHost::showContextMenu): Deleted.
891         * bindings/js/JSMessageEventCustom.cpp:
892         (WebCore::handleInitMessageEvent):
893         * bindings/js/JSSQLTransactionCustom.cpp:
894         (WebCore::JSSQLTransaction::executeSql):
895         * bindings/js/JSTextTrackCustom.cpp:
896         (WebCore::JSTextTrack::setLanguage):
897         * bindings/js/JSVideoTrackCustom.cpp:
898         (WebCore::JSVideoTrack::setKind):
899         (WebCore::JSVideoTrack::setLanguage):
900         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
901         (WebCore::cryptoKeyFormatFromJSValue):
902         (WebCore::cryptoKeyUsagesFromJSValue):
903         * bindings/js/JSXMLHttpRequestCustom.cpp:
904         (WebCore::JSXMLHttpRequest::send):
905         (WebCore::JSXMLHttpRequest::responseText): Deleted.
906         (WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.
907         * bindings/js/JSXSLTProcessorCustom.cpp:
908         (WebCore::JSXSLTProcessor::setParameter):
909         (WebCore::JSXSLTProcessor::getParameter):
910         (WebCore::JSXSLTProcessor::removeParameter):
911         * bindings/js/ScheduledAction.cpp:
912         (WebCore::ScheduledAction::create):
913         * bridge/c/c_utility.cpp:
914         (JSC::Bindings::convertValueToNPVariant):
915         * bridge/testbindings.cpp:
916         (main):
917         * inspector/InspectorDOMAgent.cpp:
918         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
919
920 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
921
922         ASSERTION FAILED: hasParserBlockingScript() seen with js/dom/modules/module-will-fire-beforeload.html
923         https://bugs.webkit.org/show_bug.cgi?id=164883
924
925         Reviewed by Ryosuke Niwa.
926
927         This is *attempt to fix* patch since I cannot reproduce the crash reported in this issue.
928         One possible scenario of this crash is the following.
929
930         1. There is pending deferred scripts, that is not fetched yet.
931         2. Then, we start watching on the script. And stop document parser.
932         3. The document parser is stopped/detached by calling finishJSTest in beforeload.
933         4. At this critical timing, (2)'s script is fetched, and notifyFinished is called since it is watched.
934
935         In this patch, we ignore the script execution if the document parser is stopped / detached.
936         Previously, it goes into the wrong path. And it causes assertion failure.
937
938         * html/parser/HTMLDocumentParser.cpp:
939         (WebCore::HTMLDocumentParser::notifyFinished):
940
941 2016-12-13  Keith Rollin  <krollin@apple.com>
942
943         Memory warning logging appears to capture resident footprint, missing compress/swap.
944         https://bugs.webkit.org/show_bug.cgi?id=165533
945         <rdar://problem/29318410>
946
947         Reviewed by Daniel Bates.
948
949         Fix GTK build by adding an explicit constructor.
950
951         * platform/MemoryPressureHandler.h:
952         (WebCore::MemoryPressureHandler::ReliefLogger::MemoryUsage::MemoryUsage):
953
954 2016-12-13  Daniel Bates  <dabates@apple.com>
955
956         CSP: ws: and wss: blocked with connect-src *
957         https://bugs.webkit.org/show_bug.cgi?id=165804
958         <rdar://problem/28563643>
959
960         Reviewed by David Kilzer.
961
962         Allow * to match ws: and wss:. This will make our behavior of * more closely conform
963         the behavior of * in the Content Security Policy Level 3 spec.,
964         <https://w3c.github.io/webappsec-csp/#match-url-to-source-expression> (Editor's Draft, 2 December 2016).
965
966         Tests: http/tests/security/contentSecurityPolicy/connect-src-star-secure-websocket-allowed.html
967                http/tests/security/contentSecurityPolicy/connect-src-star-websocket-allowed.html
968                http/tests/security/contentSecurityPolicy/default-src-star-secure-websocket-allowed.html
969                http/tests/security/contentSecurityPolicy/default-src-star-websocket-allowed.html
970
971         * page/csp/ContentSecurityPolicySourceList.cpp:
972         (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar):
973
974 2016-12-13  Dave Hyatt  <hyatt@apple.com>
975
976         [CSS Parser] Make CSSFunctionValue derive from CSSValueList
977         https://bugs.webkit.org/show_bug.cgi?id=165832
978
979         Reviewed by Dean Jackson.
980
981         With the old parser gone, we can now shrink CSSFunctionValue a bit by
982         having it derive from CSSValueList instead of having an extra member
983         that holds a value list of arguments. This is similar to the trick
984         already employed by WebkitCSSTransformValue.
985
986         * css/CSSComputedStyleDeclaration.cpp:
987         (WebCore::specifiedValueForGridTrackSize):
988         * css/CSSFunctionValue.cpp:
989         (WebCore::CSSFunctionValue::customCSSText):
990         (WebCore::CSSFunctionValue::CSSFunctionValue): Deleted.
991         (WebCore::CSSFunctionValue::equals): Deleted.
992         (WebCore::CSSFunctionValue::append): Deleted.
993         * css/CSSFunctionValue.h:
994         * css/StyleBuilderConverter.h:
995         (WebCore::StyleBuilderConverter::convertScrollSnapPoints):
996         (WebCore::StyleBuilderConverter::createGridTrackSize):
997         * css/StyleResolver.cpp:
998         (WebCore::StyleResolver::createFilterOperations):
999         * css/parser/CSSPropertyParser.cpp:
1000         (WebCore::isGridTrackFixedSized):
1001
1002 2016-12-13  Chris Dumez  <cdumez@apple.com>
1003
1004         Make Document a FrameDestructionObserver
1005         https://bugs.webkit.org/show_bug.cgi?id=165810
1006         <rdar://problem/29157645>
1007
1008         Reviewed by Ryosuke Niwa.
1009
1010         Make Document a FrameDestructionObserver to make sure Document::m_frame
1011         is properly nulled out when a Frame gets destroyed.
1012         Document::disconnectFromFrame() is supposed to be called before the Frame
1013         gets destroyed so this also adds an assertion to try and identify places
1014         where we fail to call it.
1015
1016         No new tests, no known reproduction case.
1017
1018         * dom/Document.cpp:
1019         (WebCore::Document::Document):
1020         (WebCore::Document::disconnectFromFrame):
1021         (WebCore::Document::frameDestroyed):
1022         * dom/Document.h:
1023         (WebCore::Document::frame): Deleted.
1024
1025 2016-12-13  Joseph Pecoraro  <pecoraro@apple.com>
1026
1027         REGRESSION(r204163): Web Inspector: Page crashes when Inspector tries to load insecure SourceMap
1028         https://bugs.webkit.org/show_bug.cgi?id=165806
1029         <rdar://problem/28169025>
1030
1031         Reviewed by Alex Christensen.
1032
1033         Test: http/tests/inspector/network/loadResource-insecure-resource.html
1034
1035         * inspector/InspectorNetworkAgent.cpp:
1036         (WebCore::InspectorNetworkAgent::loadResource):
1037         DocumentThreadableLoader now triggers the ThreadableLoaderClient's didFail
1038         callback, so this didFailLoaderCreation is now redundent and incorrect.
1039
1040 2016-12-13  Dave Hyatt  <hyatt@apple.com>
1041
1042         [CSS Parser] Enhance fast path translate transforms to allow percentages
1043         https://bugs.webkit.org/show_bug.cgi?id=165822
1044
1045         Reviewed by Simon Fraser.
1046
1047         * css/parser/CSSParserFastPaths.cpp:
1048         (WebCore::parseTransformTranslateArguments):
1049
1050 2016-12-13  Ryosuke Niwa  <rniwa@webkit.org>
1051
1052         :hover rule causes a single tap to not activate a slotted anchor element
1053         https://bugs.webkit.org/show_bug.cgi?id=165551
1054
1055         Reviewed by Antti Koivisto.
1056
1057         Fixed a bug in ancestorRespondingToClickEvents that we were traversing the ancestor nodes without taking
1058         shadow roots and slots into account. This prevented tapping on a text node assigned to a slot inside
1059         an anchor element to activate the hyperlink on iOS.
1060
1061         This bug was supposed to be fixed in r206605, and it was still broken on iOS due to the bug in
1062         ancestorRespondingToClickEvents. It is now tested by click-text-inside-linked-slot.html.
1063
1064         Tests: fast/shadow-dom/click-on-slotted-anchor-with-hover.html
1065                fast/shadow-dom/click-text-inside-linked-slot.html
1066
1067         * page/ios/FrameIOS.mm:
1068         (WebCore::ancestorRespondingToClickEvents):
1069         (WebCore::Frame::qualifyingNodeAtViewportLocation):
1070
1071 2016-12-13  Dave Hyatt  <hyatt@apple.com>
1072
1073         [CSS Parser] Eliminate SVGPaint and SVGColor
1074         https://bugs.webkit.org/show_bug.cgi?id=165819
1075
1076         Reviewed by Dean Jackson.
1077
1078         Remove SVGColor and SVGPaint CSS values from the tree. The new parser
1079         already stopped making these values when parsing, so all that's left
1080         is to make sure computed style doesn't use these values either.
1081
1082         We are the only browser engine to support these CSS values, they see no use
1083         on the Web, and they're already gone at the parsing level, so it's time
1084         to remove these interfaces from our tree.
1085
1086         * CMakeLists.txt:
1087         * DerivedSources.make:
1088         * WebCore.xcodeproj/project.pbxproj:
1089         * bindings/js/JSCSSValueCustom.cpp:
1090         (WebCore::toJSNewlyCreated):
1091         * css/CSSComputedStyleDeclaration.h:
1092         * css/CSSValue.cpp:
1093         (WebCore::CSSValue::equals):
1094         (WebCore::CSSValue::cssText):
1095         (WebCore::CSSValue::destroy):
1096         (WebCore::CSSValue::cloneForCSSOM):
1097         * css/CSSValue.h:
1098         (WebCore::CSSValue::isSubtypeExposedToCSSOM):
1099         (WebCore::CSSValue::isSVGColor): Deleted.
1100         (WebCore::CSSValue::isSVGPaint): Deleted.
1101         * css/SVGCSSComputedStyleDeclaration.cpp:
1102         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
1103         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1104         * css/StyleBuilderConverter.h:
1105         (WebCore::StyleBuilderConverter::convertSVGColor):
1106         * css/StyleBuilderCustom.h:
1107         (WebCore::StyleBuilderCustom::applyValueFill):
1108         (WebCore::StyleBuilderCustom::applyValueStroke):
1109         * page/animation/CSSPropertyAnimation.cpp:
1110         (WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
1111         * rendering/style/RenderStyle.h:
1112         (WebCore::RenderStyle::fillPaintType):
1113         (WebCore::RenderStyle::setFillPaintColor):
1114         (WebCore::RenderStyle::strokePaintType):
1115         (WebCore::RenderStyle::setStrokePaintColor):
1116         * rendering/style/SVGRenderStyle.h:
1117         (WebCore::SVGRenderStyle::initialFillPaintType):
1118         (WebCore::SVGRenderStyle::initialStrokePaintType):
1119         (WebCore::SVGRenderStyle::setFillPaint):
1120         (WebCore::SVGRenderStyle::setStrokePaint):
1121         (WebCore::SVGRenderStyle::fillPaintType):
1122         (WebCore::SVGRenderStyle::strokePaintType):
1123         (WebCore::SVGRenderStyle::visitedLinkFillPaintType):
1124         (WebCore::SVGRenderStyle::visitedLinkStrokePaintType):
1125         (WebCore::SVGRenderStyle::hasStroke):
1126         (WebCore::SVGRenderStyle::hasFill):
1127         * rendering/style/SVGRenderStyleDefs.h:
1128         * rendering/svg/RenderSVGResource.cpp:
1129         (WebCore::requestPaintingResource):
1130         * rendering/svg/SVGResources.cpp:
1131         (WebCore::paintingResourceFromSVGPaint):
1132         * svg/SVGAllInOne.cpp:
1133         * svg/SVGAnimatedColor.cpp:
1134         (WebCore::SVGAnimatedColorAnimator::constructFromString):
1135         (WebCore::parseColorFromString):
1136         (WebCore::SVGAnimatedColorAnimator::calculateDistance):
1137         * svg/SVGAnimatedType.cpp:
1138         (WebCore::SVGAnimatedType::setValueAsString):
1139         * svg/SVGAnimatedType.h:
1140         * svg/SVGColor.cpp: Removed.
1141         * svg/SVGColor.h: Removed.
1142         * svg/SVGColor.idl: Removed.
1143         * svg/SVGFEDiffuseLightingElement.cpp:
1144         * svg/SVGFESpecularLightingElement.cpp:
1145         * svg/SVGPaint.cpp: Removed.
1146         * svg/SVGPaint.h: Removed.
1147         * svg/SVGPaint.idl: Removed.
1148
1149 2016-12-13  Alex Christensen  <achristensen@webkit.org>
1150
1151         Restore NSURLRequest's default time interval to match behavior before NSURLSession adoption
1152         https://bugs.webkit.org/show_bug.cgi?id=165821
1153         <rdar://problem/28492939>
1154
1155         Reviewed by Brady Eidson.
1156
1157         Before adopting NSURLSession, iOS used CFURLConnection, not NSURLConnection.
1158         iOS used to have a default timeout of INT_MAX and it now has a default timeout of 0, which means use the 
1159         default NSURLRequest timeout, which is 60 seconds.  This is not enough for some slow mobile networks,
1160         so we want to match behavior of our CFURLConnection code here.
1161
1162         * platform/network/ResourceRequestBase.cpp:
1163         Use INT_MAX as the default timeout of requests on iOS.
1164
1165 2016-12-13  Filip Pizlo  <fpizlo@apple.com>
1166
1167         Make opaque root scanning truly constraint-based
1168         https://bugs.webkit.org/show_bug.cgi?id=165760
1169
1170         Reviewed by Saam Barati.
1171
1172         No new tests yet. I think that writing tests for this is a big investigation:
1173         https://bugs.webkit.org/show_bug.cgi?id=165808
1174         
1175         Remove the previous advancing wavefront DOM write barrier. I don't think this will scale
1176         very well. It's super confusing.
1177         
1178         This change makes it so that visitChildren can become a GC constraint that executes as
1179         part of the fixpoint. This changes all WebCore visitChildren methods that do opaque
1180         roots into constraints.
1181
1182         * bindings/js/CommonVM.cpp:
1183         (WebCore::commonVMSlow):
1184         (WebCore::writeBarrierOpaqueRootSlow): Deleted.
1185         * bindings/js/CommonVM.h:
1186         (WebCore::writeBarrierOpaqueRoot): Deleted.
1187         * bindings/js/JSAttrCustom.cpp:
1188         (WebCore::JSAttr::visitAdditionalChildren):
1189         * bindings/js/JSDOMWindowCustom.cpp:
1190         (WebCore::JSDOMWindow::visitAdditionalChildren):
1191         * bindings/js/JSIDBCursorCustom.cpp:
1192         (WebCore::JSIDBCursor::visitAdditionalChildren):
1193         * bindings/js/JSMessageChannelCustom.cpp:
1194         (WebCore::JSMessageChannel::visitAdditionalChildren):
1195         * bindings/js/JSMessagePortCustom.cpp:
1196         (WebCore::JSMessagePort::visitAdditionalChildren):
1197         * bindings/js/JSNodeIteratorCustom.cpp:
1198         (WebCore::JSNodeIterator::visitAdditionalChildren):
1199         * bindings/js/JSTextTrackCueCustom.cpp:
1200         (WebCore::JSTextTrackCue::visitAdditionalChildren):
1201         * bindings/js/JSTreeWalkerCustom.cpp:
1202         (WebCore::JSTreeWalker::visitAdditionalChildren):
1203         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1204         (WebCore::JSWorkerGlobalScope::visitAdditionalChildren):
1205         * bindings/js/JSXMLHttpRequestCustom.cpp:
1206         (WebCore::JSXMLHttpRequest::visitAdditionalChildren):
1207         * bindings/js/JSXPathResultCustom.cpp:
1208         (WebCore::JSXPathResult::visitAdditionalChildren):
1209         * dom/ContainerNodeAlgorithms.cpp:
1210         (WebCore::notifyChildNodeInserted):
1211         (WebCore::notifyChildNodeRemoved):
1212
1213 2016-12-12  Sam Weinig  <sam@webkit.org>
1214
1215         [WebIDL] Remove use of Dictionary in ApplePaySession
1216         https://bugs.webkit.org/show_bug.cgi?id=165787
1217
1218         Reviewed by Anders Carlsson.
1219
1220         First take at generating the bindings for ApplePaySession and removing
1221         all use of Dictionary.
1222         
1223         - Removes all use of Dictionary!
1224         - Removes use of logging errors to the console with improved Exception messages.
1225         - Use ExceptionOr extensively to pass exception state.
1226         
1227         Still to do:
1228             - Reconcile / merge ApplePaySession::PaymentRequest with WebCore::PaymentRequest
1229               and all the sub-objects held within.
1230             - Remove PaymentRequestValidator entirely, merging validation into the validation
1231               we already do in ApplePaySession.cpp
1232             - Make ApplePayEvents use generated dictionary creation code.
1233
1234         Test: http/tests/ssl/applepay/ApplePaySession.html
1235
1236         * Modules/applepay/ApplePaySession.cpp:
1237         (WebCore::convertAndValidate):
1238         (WebCore::canCallApplePaySessionAPIs):
1239         (WebCore::ApplePaySession::create):
1240         (WebCore::ApplePaySession::ApplePaySession):
1241         (WebCore::ApplePaySession::supportsVersion):
1242         (WebCore::ApplePaySession::canMakePayments):
1243         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
1244         (WebCore::ApplePaySession::openPaymentSetup):
1245         (WebCore::ApplePaySession::begin):
1246         (WebCore::ApplePaySession::completeMerchantValidation):
1247         (WebCore::ApplePaySession::completeShippingMethodSelection):
1248         (WebCore::ApplePaySession::completeShippingContactSelection):
1249         (WebCore::ApplePaySession::completePaymentMethodSelection):
1250         (WebCore::ApplePaySession::didSelectShippingMethod):
1251         (WebCore::createContactFields): Deleted.
1252         (WebCore::toLineItemType): Deleted.
1253         (WebCore::isValidLineItemPropertyName): Deleted.
1254         (WebCore::createLineItem): Deleted.
1255         (WebCore::createLineItems): Deleted.
1256         (WebCore::createMerchantCapabilities): Deleted.
1257         (WebCore::createSupportedNetworks): Deleted.
1258         (WebCore::toShippingType): Deleted.
1259         (WebCore::isValidShippingMethodPropertyName): Deleted.
1260         (WebCore::createShippingMethod): Deleted.
1261         (WebCore::createShippingMethods): Deleted.
1262         (WebCore::isValidPaymentRequestPropertyName): Deleted.
1263         (WebCore::createPaymentRequest): Deleted.
1264         * Modules/applepay/ApplePaySession.h:
1265         Replace hand written dictionary extraction code with autogenerated code
1266         and hand written additional validation.
1267
1268         * Modules/applepay/ApplePaySession.idl:
1269         Add helper dictionaries and enums.
1270
1271         * Modules/applepay/PaymentRequestValidator.cpp:
1272         (WebCore::PaymentRequestValidator::validate):
1273         (WebCore::PaymentRequestValidator::validateTotal):
1274         (WebCore::validateCountryCode):
1275         (WebCore::validateCurrencyCode):
1276         (WebCore::validateMerchantCapabilities):
1277         (WebCore::validateSupportedNetworks):
1278         (WebCore::validateShippingMethod):
1279         (WebCore::validateShippingMethods):
1280         (WebCore::PaymentRequestValidator::PaymentRequestValidator): Deleted.
1281         (WebCore::PaymentRequestValidator::~PaymentRequestValidator): Deleted.
1282         (WebCore::PaymentRequestValidator::validateCountryCode): Deleted.
1283         (WebCore::PaymentRequestValidator::validateCurrencyCode): Deleted.
1284         (WebCore::PaymentRequestValidator::validateMerchantCapabilities): Deleted.
1285         (WebCore::PaymentRequestValidator::validateShippingMethod): Deleted.
1286         (WebCore::PaymentRequestValidator::validateSupportedNetworks): Deleted.
1287         (WebCore::PaymentRequestValidator::validateShippingMethods): Deleted.
1288         * Modules/applepay/PaymentRequestValidator.h:
1289         Instead of reporting the validation errors to the console, pass them in the exception.
1290         This allows us to remove the window member, and move the helpers to the implementation
1291         file as statics.
1292
1293         * WebCore.xcodeproj/project.pbxproj:
1294         Remove file.
1295
1296         * bindings/generic/IDLTypes.h:
1297         (WebCore::IDLObject::nullValue):
1298         (WebCore::IDLObject::isNullValue):
1299         (WebCore::IDLObject::extractValueFromNullable):
1300         Add nullability traits for IDLObject.
1301         
1302         * bindings/js/JSApplePaySessionCustom.cpp:
1303         Removed.
1304
1305 2016-12-13  Daniel Bates  <dabates@apple.com>
1306
1307         CSP: Teach the preload scanner about the 'nonce' attribute
1308         https://bugs.webkit.org/show_bug.cgi?id=161192
1309         <rdar://problem/28010354>
1310
1311         Reviewed by Darin Adler.
1312
1313         This patch was inspired by a similar Blink change:
1314         <https://chromium.googlesource.com/chromium/src/+/dde5487f380cf774e4c0e96ba7f88ea68e723907>
1315
1316         Preload external scripts and stylesheets whose HTML script and link elements have a nonce
1317         attribute that is listed in the Content Security Policy (CSP) of the page.
1318
1319         Currently the preload scanner ignores the nonce attribute on HTML script and link elements.
1320         So, WebKit does not preload their associated subresources unless the value of the src
1321         attribute or href attribute is whitelisted in the CSP of the page for script and link
1322         elements, respectively. Instead the preload scanner should recognize the nonce attribute on
1323         script and link elements and query the CSP of the page with it. If the nonce attribute is
1324         whitelisted then the request should be preloaded.
1325
1326         Tests: http/tests/loading/do-not-preload-css-blocked-by-csp.html
1327                http/tests/loading/do-not-preload-script-src-blocked-by-csp.html
1328                http/tests/loading/preload-css-with-csp-nonce.html
1329                http/tests/loading/preload-script-src-with-csp-nonce.html
1330
1331         * html/parser/HTMLPreloadScanner.cpp:
1332         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Set the nonce on the
1333         PreloadRequest to the nonce that we found during the scan.
1334         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): For script and link tag names,
1335         save the value of the nonce attribute (if it has one).
1336         * html/parser/HTMLResourcePreloader.cpp:
1337         (WebCore::PreloadRequest::resourceRequest): Skip CSP policy check if the nonce is listed in
1338         the CSP of the page.
1339         * html/parser/HTMLResourcePreloader.h:
1340         (WebCore::PreloadRequest::setNonce): Added.
1341
1342 2016-12-13  Dave Hyatt  <hyatt@apple.com>
1343
1344         [CSS Parser] Rename CSSPrimitiveValue::UnitTypes to CSSPrimitiveValue::UnitType
1345         https://bugs.webkit.org/show_bug.cgi?id=165776
1346
1347         Reviewed by Zalan Bujtas.
1348
1349         * css/CSSCalculationValue.cpp:
1350         (WebCore::unitCategory):
1351         (WebCore::hasDoubleValue):
1352         (WebCore::determineCategory):
1353         (WebCore::CSSCalcExpressionNodeParser::parseValue):
1354         * css/CSSCalculationValue.h:
1355         * css/CSSPrimitiveValue.cpp:
1356         (WebCore::isValidCSSUnitTypeForDoubleConversion):
1357         (WebCore::isStringType):
1358         (WebCore::CSSPrimitiveValue::unitCategory):
1359         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1360         (WebCore::CSSPrimitiveValue::cleanup):
1361         (WebCore::CSSPrimitiveValue::computeLengthDouble):
1362         (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
1363         (WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor):
1364         (WebCore::CSSPrimitiveValue::getFloatValue):
1365         (WebCore::CSSPrimitiveValue::doubleValue):
1366         (WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory):
1367         (WebCore::CSSPrimitiveValue::doubleValueInternal):
1368         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
1369         * css/CSSPrimitiveValue.h:
1370         (WebCore::CSSPrimitiveValue::isFontRelativeLength):
1371         (WebCore::CSSPrimitiveValue::isLength):
1372         (WebCore::CSSPrimitiveValue::isResolution):
1373         (WebCore::CSSPrimitiveValue::createAllowingMarginQuirk):
1374         * css/CSSValue.h:
1375         * css/CSSValuePool.cpp:
1376         (WebCore::CSSValuePool::createValue):
1377         * css/CSSValuePool.h:
1378         (WebCore::CSSValuePool::createValue):
1379         * css/MediaQueryExp.cpp:
1380         (WebCore::featureWithValidDensity):
1381         (WebCore::MediaQueryExpression::MediaQueryExpression):
1382         * css/parser/CSSParserFastPaths.cpp:
1383         (WebCore::parseSimpleLength):
1384         (WebCore::parseSimpleLengthValue):
1385         (WebCore::parseColorIntOrPercentage):
1386         (WebCore::fastParseColorInternal):
1387         (WebCore::parseTransformTranslateArguments):
1388         (WebCore::parseTransformNumberArguments):
1389         * css/parser/CSSParserToken.cpp:
1390         (WebCore::cssPrimitiveValueUnitFromTrie):
1391         (WebCore::stringToUnitType):
1392         (WebCore::CSSParserToken::CSSParserToken):
1393         (WebCore::CSSParserToken::convertToPercentage):
1394         * css/parser/CSSParserToken.h:
1395         (WebCore::CSSParserToken::unitType):
1396         * css/parser/CSSPropertyParser.cpp:
1397         (WebCore::CSSPropertyParser::consumeTransformOrigin):
1398         (WebCore::consumeCounter):
1399         (WebCore::consumeAnimationName):
1400         (WebCore::consumePerspective):
1401         (WebCore::consumePositionLonghand):
1402         (WebCore::consumeCounterContent):
1403         (WebCore::consumeReflect):
1404         (WebCore::consumeGridBreadth):
1405         (WebCore::CSSPropertyParser::consumeFlex):
1406         * css/parser/CSSPropertyParserHelpers.cpp:
1407         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
1408         (WebCore::CSSPropertyParserHelpers::consumeInteger):
1409         (WebCore::CSSPropertyParserHelpers::consumeLength):
1410         (WebCore::CSSPropertyParserHelpers::consumePercent):
1411         (WebCore::CSSPropertyParserHelpers::consumeAngle):
1412         (WebCore::CSSPropertyParserHelpers::consumeTime):
1413         (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
1414         (WebCore::CSSPropertyParserHelpers::consumeString):
1415         (WebCore::CSSPropertyParserHelpers::consumeUrl):
1416         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
1417         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
1418         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
1419         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
1420         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
1421         * css/parser/MediaQueryParser.cpp:
1422         (WebCore::MediaQueryParser::readFeatureValue):
1423         * css/parser/SizesAttributeParser.cpp:
1424         (WebCore::SizesAttributeParser::computeLength):
1425         * css/parser/SizesAttributeParser.h:
1426         * dom/StyledElement.cpp:
1427         (WebCore::StyledElement::setInlineStyleProperty):
1428         (WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
1429         * dom/StyledElement.h:
1430         * svg/SVGLengthValue.cpp:
1431         (WebCore::SVGLengthValue::toCSSPrimitiveValue):
1432
1433 2016-12-13  Eric Carlson  <eric.carlson@apple.com>
1434
1435         Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
1436         https://bugs.webkit.org/show_bug.cgi?id=165251
1437
1438         Reviewed by Youenn Fablet.
1439
1440         No new tests, fixes an API test.
1441
1442         * page/Settings.in: Delete mediaStreamEnabled and peerConnectionEnabled, we don't need a
1443         setting and a runtime feature.
1444
1445 2016-12-13  Antti Koivisto  <antti@apple.com>
1446
1447         REGRESSION (r198990): Cannot edit content inside <details> in wysiwyg editor
1448         https://bugs.webkit.org/show_bug.cgi?id=165757
1449
1450         Reviewed by Andreas Kling.
1451
1452         Test: fast/html/details-edit.html
1453
1454         -webkit-user-modify is reset on shadow boundary so it doesn't go through <details> shadow tree.
1455
1456         * css/StyleResolver.cpp:
1457         (WebCore::StyleResolver::styleForElement):
1458         (WebCore::StyleResolver::pseudoStyleForElement):
1459         (WebCore::StyleResolver::styleForPage):
1460         (WebCore::StyleResolver::applyMatchedProperties):
1461         * dom/Node.cpp:
1462         (WebCore::computeEditabilityFromComputedStyle):
1463         (WebCore::Node::computeEditability):
1464
1465             Make -webkit-user-modify (which we would want to get rid of completely eventually) have no effect in shadow trees.
1466             Check for contenteditable directly instead.
1467
1468         * html/HTMLInputElement.cpp:
1469         (WebCore::HTMLInputElement::createInnerTextStyle):
1470         * html/HTMLTextAreaElement.cpp:
1471         (WebCore::HTMLTextAreaElement::createInnerTextStyle):
1472         * html/shadow/TextControlInnerElements.cpp:
1473         * rendering/RenderFlowThread.cpp:
1474         (WebCore::RenderFlowThread::createFlowThreadStyle):
1475         * rendering/RenderLayer.cpp:
1476         (WebCore::RenderLayer::calculateClipRects):
1477         * rendering/RenderListItem.cpp:
1478         (WebCore::RenderListItem::styleDidChange):
1479         * rendering/style/RenderStyle.cpp:
1480         (WebCore::RenderStyle::createAnonymousStyleWithDisplay):
1481         (WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
1482         (WebCore::RenderStyle::inheritFrom):
1483
1484             Let -webkit-user-modify inherit through shadow boundary as normal.
1485
1486         * rendering/style/RenderStyle.h:
1487
1488 2016-12-12  Darin Adler  <darin@apple.com>
1489
1490         Remove bindings generation support for legacy WebCore::Dictionary
1491         https://bugs.webkit.org/show_bug.cgi?id=165762
1492
1493         Reviewed by Sam Weinig.
1494
1495         After this patch, all use of legacy WebCore::Dictionary is within custom bindings or
1496         inside the DOM code itself. Bindings generation machinery no longer has a special
1497         type named "Dictionary" but has increasingly good support for IDL-defined dictionaries.
1498
1499         * Modules/applepay/ApplePaySession.cpp:
1500         (WebCore::ApplePaySession::create): Take ExecState and a JSValue rather than a Dictionary.
1501         (WebCore::ApplePaySession::completeMerchantValidation): Ditto.
1502         * Modules/applepay/ApplePaySession.h: Updated for the above changes.
1503         * Modules/applepay/ApplePaySession.idl: For this last file using Dictionary in IDL, move
1504         to "[CallWith=ScriptState]" and "any" as a stopgap. Later we can return and use IDL
1505         dictionaries or other more modern solutions.
1506
1507         * Modules/mediastream/MediaDevices.idl: For the custom binding written in JavaScript,
1508         use the type mentioned in the specification rather than Dictionary. The bindings generator
1509         ignores the type, so this is more like changing a comment rather than changing source code.
1510
1511         * Modules/mediastream/RTCPeerConnection.js:
1512         (initializeRTCPeerConnection): Refer to a non-object as not a valid "dictionary", lowercase
1513         rather than "Dictionary".
1514         * Modules/mediastream/RTCPeerConnectionInternals.js:
1515         (callbacksAndDictionaryOverload): Ditto.
1516
1517         * bindings/generic/IDLTypes.h: Removed IDLLegacyDictionary.
1518
1519         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1520         (WebCore::getHashAlgorithm): Fixed a comment.
1521
1522         * bindings/js/JSDOMConvert.h:
1523         (WebCore::Converter<IDLLegacyDictionary<T>>::convert): Deleted.
1524
1525         * bindings/scripts/CodeGenerator.pm:
1526         (IsBuiltinType): Removed special case for "Dictionary".
1527         * bindings/scripts/CodeGeneratorJS.pm:
1528         (AddToIncludesForIDLType): Ditto.
1529         (AreTypesDistinguishableForOverloadResolution): Ditto.
1530         (GenerateOverloadedFunctionOrConstructor): Ditto.
1531         (GenerateParametersCheck): Ditto.
1532         (GetBaseIDLType): Ditto.
1533
1534         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated results.
1535         * bindings/scripts/test/TestObj.idl: Removed test case for Dictionary.
1536
1537 2016-12-12  Chris Dumez  <cdumez@apple.com>
1538
1539         Drop unnecessary null check in removeDetachedChildrenInContainer()
1540         https://bugs.webkit.org/show_bug.cgi?id=165778
1541
1542         Reviewed by Alex Christensen.
1543
1544         Drop unnecessary null check in removeDetachedChildrenInContainer().
1545         Node cannot be null but we do an implicit null check.
1546
1547         No new tests, no Web-exposed behavior change.
1548
1549         * dom/ContainerNodeAlgorithms.cpp:
1550         (WebCore::removeDetachedChildrenInContainer):
1551
1552 2016-12-12  Chris Dumez  <cdumez@apple.com>
1553
1554         Add Document.onvisibilitychange event handler attribute
1555         https://bugs.webkit.org/show_bug.cgi?id=165784
1556
1557         Reviewed by Daniel Bates.
1558
1559         Add Document.onvisibilitychange event handler attribute as per Page
1560         Visibility Level 2 API:
1561         - http://w3c.github.io/page-visibility/#onvisiblitychange-event-handler
1562
1563         Test: fast/events/page-visibility-onvisibilitychange.html
1564
1565         * dom/Document.idl:
1566
1567 2016-12-12  Dean Jackson  <dino@apple.com>
1568
1569         [iOS] MediaDocument "Done" button should navigate the page back
1570         https://bugs.webkit.org/show_bug.cgi?id=165779
1571
1572         Reviewed by Sam Weinig.
1573
1574         Detect if the exit from fullscreen was caused by the Done button,
1575         and if so, tell the page to navigate back.
1576
1577         Unfortunately this is not yet testable. It's waiting on the
1578         UI-based device testing in development by the media team.
1579
1580         * platform/cocoa/WebVideoFullscreenModel.h: Add a finishedWithMedia parameter to
1581         requestFullscreenMode, to indicate if the change in mode is associated with
1582         the closing of the media document.
1583         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
1584         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
1585         (WebVideoFullscreenModelVideoElement::requestFullscreenMode): If we're a media
1586         document, and we say we're finished with the media, tell the document
1587         to navigate back a page.
1588         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1589         (WebVideoFullscreenControllerContext::requestFullscreenMode):
1590         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1591         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1592
1593 2016-12-12  Zalan Bujtas  <zalan@apple.com>
1594
1595         Infinite recursion when viewport is set to the size of the content but the content overflows the viewport.
1596         https://bugs.webkit.org/show_bug.cgi?id=165775
1597         rdar://problem/29366628
1598
1599         Reviewed by Simon Fraser.
1600
1601         In certain cases when the viewport is sized to accomodate the content and
1602         the content always overflows the viewport, we might end up in recursive FrameView::layout calls.
1603         This is specific to content with viewport units, because we always invalidate elements with vw/vh units on
1604         viewport size change. However if this viewport size change is in response to content size change (layout), 
1605         invalidating elements could trigger synchronous layout, while we are still inside this current layout.
1606         This is very similar to the m_setNeedsLayoutWasDeferred case and they should eventually be merged.
1607         It also means that we might be behind by one layout on elements with vw/vh units (fixed layout only though).
1608
1609         Currently not testable.
1610
1611         * page/FrameView.cpp:
1612         (WebCore::FrameView::availableContentSizeChanged):
1613
1614 2016-12-12  Keith Rollin  <krollin@apple.com>
1615
1616         Memory warning logging appears to capture resident footprint, missing compress/swap.
1617         https://bugs.webkit.org/show_bug.cgi?id=165533
1618         <rdar://problem/29318410>
1619
1620         Reviewed by Andreas Kling.
1621
1622         Have platformMemoryUsage return both resident and resident + swapped
1623         values. This is now returned as a struct in a std::optional to better
1624         support cases where values cannot or are not returned. Report these
1625         values in logMemoryUsageChange.
1626
1627         Remove most of the ReliefLogger instances and their messages. We no
1628         longer free up fastMalloc memory after each memory-release operation,
1629         so there are no memory regions returned to the OS. Instead, we now
1630         free up fastMalloc memory regions at the end of all memory-releasing
1631         operations in one fell swoop and report a grand total of memory
1632         returned.
1633
1634         No new tests -- no changes to user accessible functionality.
1635
1636         * page/MemoryRelease.cpp:
1637         (WebCore::releaseNoncriticalMemory):
1638         (WebCore::releaseCriticalMemory):
1639         (WebCore::releaseMemory):
1640         * page/cocoa/MemoryReleaseCocoa.mm:
1641         (WebCore::platformReleaseMemory):
1642         * platform/MemoryPressureHandler.cpp:
1643         (WebCore::MemoryPressureHandler::releaseMemory):
1644         (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
1645         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
1646         * platform/MemoryPressureHandler.h:
1647         (WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
1648         (WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
1649         (WebCore::MemoryPressureHandler::ReliefLogger::loggingEnabled):
1650         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1651         (WebCore::MemoryPressureHandler::platformReleaseMemory):
1652         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
1653         * platform/linux/MemoryPressureHandlerLinux.cpp:
1654         * platform/win/MemoryPressureHandlerWin.cpp:
1655         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
1656
1657 2016-12-12  Chris Dumez  <cdumez@apple.com>
1658
1659         Document.visibilityState should use an IDL string enumeration
1660         https://bugs.webkit.org/show_bug.cgi?id=165774
1661
1662         Reviewed by Daniel Bates.
1663
1664         Document.visibilityState should use an IDL string enumeration:
1665         - http://w3c.github.io/page-visibility/#extensions-to-the-document-interface
1666
1667         No new tests, there should be no Web-exposed behavior change.
1668
1669         * CMakeLists.txt:
1670         * Modules/vibration/NavigatorVibration.cpp:
1671         (WebCore::NavigatorVibration::vibrate):
1672         * WebCore.xcodeproj/project.pbxproj:
1673         * dom/Document.cpp:
1674         (WebCore::Document::hidden):
1675         (WebCore::Document::pageVisibilityState): Deleted.
1676         (WebCore::Document::visibilityState): Deleted.
1677         * dom/Document.h:
1678         * dom/Document.idl:
1679         * page/Page.cpp:
1680         (WebCore::Page::visibilityState):
1681         * page/PageVisibilityState.cpp: Removed.
1682         * page/PageVisibilityState.h:
1683         (): Deleted.
1684
1685 2016-12-12  Jer Noble  <jer.noble@apple.com>
1686
1687         Remove implementation of legacy Mozilla-based Fullscreen API.
1688         https://bugs.webkit.org/show_bug.cgi?id=165689
1689
1690         Reviewed by Eric Carlson.
1691
1692         Alias the legacy webkitRequestFull_S_creen() function on Element to webkitRequestFull_s_creen().
1693         Remove the custom behavior in Document::requestFullScreenForElement() to handle the legacy path.
1694
1695         * dom/Document.cpp:
1696         (WebCore::Document::requestFullScreenForElement):
1697         * dom/Document.h:
1698         * dom/Element.cpp:
1699         (WebCore::Element::webkitRequestFullscreen):
1700         (WebCore::Element::webkitRequestFullScreen): Deleted.
1701         * dom/Element.h:
1702         * dom/Element.idl:
1703         * html/HTMLMediaElement.cpp:
1704         (WebCore::HTMLMediaElement::enterFullscreen):
1705         * html/shadow/MediaControlElements.cpp:
1706         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
1707
1708 2016-12-12  Zalan Bujtas  <zalan@apple.com>
1709
1710         The CSS 'columns' property when set on the <body> element makes short columns
1711         https://bugs.webkit.org/show_bug.cgi?id=164891
1712
1713         Reviewed by Darin Adler and David Hyatt.
1714
1715         Currently when the body has auto height, we use the height of the viewport as
1716         the available height for the columns defined on the body element.
1717         This is the desired behaviour for paginated content.
1718         However in case of a simple, non-paginated multicolumn context, we should let the columns grow beyond
1719         the viewport vertically. This is also what other browsers do.
1720         This patch sets the available height on columns (in non-paginated context) only if the logical height
1721         is defined (we are right before layout, so applying non-defined values does not make much sense anyway).
1722         The reason why it is only broken on the <body> is because it stretches to the viewport by
1723         default (see stretchesToViewport()) while other block renderers do not.
1724
1725         Test: fast/multicol/columns-on-body.html
1726
1727         * rendering/RenderBlockFlow.cpp:
1728         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
1729
1730 2016-12-09  Dean Jackson  <dino@apple.com>
1731
1732         Autoplay isn't working in iPhone MediaDocuments
1733         https://bugs.webkit.org/show_bug.cgi?id=165710
1734         <rdar://problems/29606761>
1735
1736         Reviewed by Darin Adler.
1737
1738         Our silent video autoplay detection disabled autoplay
1739         of videos in MediaDocuments.
1740
1741         Test: media/ios/autoplay-only-in-main-document.html
1742
1743         * html/MediaElementSession.cpp:
1744         (WebCore::MediaElementSession::playbackPermitted):
1745         Return true if we're in a top-level media document.
1746
1747 2016-12-12  Zan Dobersek  <zdobersek@igalia.com>
1748
1749         Unreviewed. Fixing build breakage in GStreamer's WebKitCommonEncryptionDecryptorGStreamer.
1750
1751         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1752         (webkitMediaCommonEncryptionDecryptTransformInPlace):
1753         WTF::Seconds should be used instead of std::chrono::seconds.
1754
1755 2016-12-11  Simon Fraser  <simon.fraser@apple.com>
1756
1757         REGRESSION (r200283): Transform, overflow hidden and filter combination completely hides the element
1758         https://bugs.webkit.org/show_bug.cgi?id=161509
1759
1760         Reviewed by David Hyatt.
1761         
1762         When the filter painting code needs to recompute a paintDirtyRect, it was using selfClipRect() 
1763         which is obviously wrong because it returns a rect in absolute coordinates. Use code factored
1764         out of localClipRect() instead, which returns a rect relative to the painting root.
1765
1766         Test: css3/filters/filter-on-overflow-hidden.html
1767
1768         * rendering/RenderLayer.cpp:
1769         (WebCore::RenderLayer::paintLayerContents):
1770
1771 2016-12-11  Saam Barati  <sbarati@apple.com>
1772
1773         We should be able to throw exceptions from Wasm code and when Wasm frames are on the stack
1774         https://bugs.webkit.org/show_bug.cgi?id=165429
1775
1776         Reviewed by Keith Miller.
1777
1778         * bindings/js/JSDOMBinding.cpp:
1779         (WebCore::GetCallerGlobalObjectFunctor::operator()):
1780
1781 2016-12-11  Darin Adler  <darin@apple.com>
1782
1783         Remove uses of Dictionary in WebRTC IDL files
1784         https://bugs.webkit.org/show_bug.cgi?id=165736
1785
1786         Reviewed by Sam Weinig.
1787
1788         Also removed quite a bit of unused code. There were some mocks that were out of date and
1789         no longer matched the types used in the real code, that also were no longer hooked up,
1790         and other types of dead code. We will have to implement anew when we want to restore tests
1791         like the ones these were intended to enable.
1792
1793         * CMakeLists.txt: Updated for all the removed files.
1794
1795         * Modules/mediastream/MediaEndpointPeerConnection.cpp: Moved some types in here
1796         that don't need to be in the header.
1797         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): Use make_unique.
1798         (WebCore::MediaEndpointPeerConnection::setConfiguration): Changed argument type,
1799         obviating the need for most of the code that was here.
1800         * Modules/mediastream/MediaEndpointPeerConnection.h: Updated for the above. Made more
1801         things private and final. Marked the constructor explicit. Removed unneeded includes.
1802
1803         * Modules/mediastream/PeerConnectionBackend.h: Removed unneeded includes and forward
1804         declarations. Changed the argument type for setConfiguration (see above).
1805
1806         * Modules/mediastream/RTCConfiguration.cpp: Removed.
1807         None of the code here was needed except for the ICE server validation, and that was
1808         moved into RTCPeerConnection::setConfiguration.
1809         * Modules/mediastream/RTCConfiguration.h: Changed this from a class to a struct since
1810         this is now a dictionary rather than an interface.
1811         * Modules/mediastream/RTCConfiguration.idl: Changed this from an interface to a dictionary.
1812
1813         * Modules/mediastream/RTCDTMFSender.cpp: Removed some of the code from this file. This
1814         class currently isn't implemented, but was depending on RTCPeerConnectionHandler. I removed
1815         some of the dead code. Someone will have to straighten this out so we can turn it back on.
1816         * Modules/mediastream/RTCDTMFSender.h: Ditto.
1817
1818         * Modules/mediastream/RTCDataChannel.cpp: Updated includes.
1819
1820         * Modules/mediastream/RTCIceCandidate.cpp:
1821         (WebCore::RTCIceCandidate::create): Removed most of the code, since this now takes
1822         a structure rather than a WebCore::Dictionary, and so the bindings take care of the work.
1823         * Modules/mediastream/RTCIceCandidate.h: Updated for the above.
1824         * Modules/mediastream/RTCIceCandidate.idl: Changed the constructor to take a
1825         RTCIceCandidateInit instead of a Dictionary.
1826
1827         * Modules/mediastream/RTCIceServer.h: Changed this from a class to a struct since
1828         this is now a dictionary rather than an interface.
1829         * Modules/mediastream/RTCIceServer.idl: Changed this from an interface to a dictionary.
1830
1831         * Modules/mediastream/RTCPeerConnection.cpp:
1832         (WebCore::RTCPeerConnection::initializeWith): Take an RTCConfiguration rather than
1833         a Dictionary.
1834         (WebCore::RTCPeerConnection::getConfiguration): Moved to header, now an inline.
1835         (WebCore::RTCPeerConnection::setConfiguration): Use the configuration dictionary now instead
1836         of the configuration class. Also moved validation of server URLs here, formerly in the
1837         RTCConfiguration RTCConfiguration::initialize function. Also moved code to convert from
1838         RTCConfiguration to MediaEndpointConfiguration here, formerly in
1839         MediaEndpointPeerConnection::setConfiguration.
1840         * Modules/mediastream/RTCPeerConnection.h: Updated for the above.
1841         * Modules/mediastream/RTCPeerConnection.idl: Changed argument to initializeWith and
1842         setConfiguration from Dictionary to RTCConfiguration.
1843
1844         * Modules/mediastream/RTCSessionDescription.cpp:
1845         (WebCore::parseTypeString): Deleted.
1846         (WebCore::RTCSessionDescription::create): Changed to take struct instead of Dictionary.
1847         * Modules/mediastream/RTCSessionDescription.h: Added Init struct and changed create to
1848         take it.
1849         * Modules/mediastream/RTCSessionDescription.idl: Changed constructor argument to take
1850         RTCSessionDescriptionInit dictionary instead of Dictionary.
1851
1852         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: Updated includes.
1853
1854         * WebCore.xcodeproj/project.pbxproj: Updated for all the removed files.
1855
1856         * bindings/scripts/CodeGeneratorJS.pm:
1857         (GenerateDictionaryImplementationContent): Fixed convertDictionaryToJS to work with other
1858         nullable types besides RefPtr.
1859         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
1860
1861         * platform/mediastream/RTCConfigurationPrivate.h: Removed.
1862         * platform/mediastream/RTCIceServerPrivate.h: Removed.
1863         * platform/mediastream/RTCPeerConnectionHandler.cpp: Removed.
1864         * platform/mediastream/RTCPeerConnectionHandler.h: Removed.
1865         * platform/mock/RTCDTMFSenderHandlerMock.cpp: Removed.
1866         * platform/mock/RTCDTMFSenderHandlerMock.h: Removed.
1867
1868         * platform/mock/RTCDataChannelHandlerMock.h: Updated includes, made more things private and final.
1869
1870         * platform/mock/RTCPeerConnectionHandlerMock.cpp: Removed.
1871         * platform/mock/RTCPeerConnectionHandlerMock.h: Removed.
1872
1873         * testing/Internals.cpp:
1874         (WebCore::Internals::Internals): Removed call to enableMockRTCPeerConnectionHandler.
1875         (WebCore::Internals::enableMockRTCPeerConnectionHandler): Deleted.
1876
1877 2016-12-11  Darin Adler  <darin@apple.com>
1878
1879         Use std::vsnprintf instead of vasprintf
1880         https://bugs.webkit.org/show_bug.cgi?id=165740
1881
1882         Reviewed by Sam Weinig.
1883
1884         * platform/FileHandle.cpp:
1885         (WebCore::FileHandle::printf): Use vsnprintf, including StringExtras.h to
1886         ensure compatibility with older versions of the Visual Studio library,
1887         and Vector for the buffer. Use inline capacity in the vector so we normally
1888         don't need to allocate any memory on the heap.
1889         * xml/XSLTUnicodeSort.cpp:
1890         (xsltTransformErrorTrampoline): Ditto.
1891         * xml/parser/XMLDocumentParserLibxml2.cpp:
1892         (WebCore::XMLDocumentParser::error): Ditto.
1893
1894 2016-12-11  Darin Adler  <darin@apple.com>
1895
1896         Make some refinements to HTMLPlugInImageElement
1897         https://bugs.webkit.org/show_bug.cgi?id=165742
1898
1899         Reviewed by Sam Weinig.
1900
1901         * html/HTMLPlugInImageElement.cpp: Removed many unneeded includes.
1902         (WebCore::titleText): Use HashMap::ensure, correct argument types.
1903         (WebCore::subtitleText): Ditto.
1904         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Moved
1905         initialization of most scalars to the class definition.
1906         (WebCore::HTMLPlugInImageElement::isImageType): Use auto.
1907         (WebCore::HTMLPlugInImageElement::wouldLoadAsPlugIn): Removed
1908         unneeded local variable and if statement.
1909         (WebCore::HTMLPlugInImageElement::willDetachRenderers): Use auto.
1910         (WebCore::HTMLPlugInImageElement::updateSnapshot): Do not call
1911         renderer twice unnecessarily.
1912         (WebCore::plugInImageElementIsolatedWorld): Use auto.
1913         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Use auto.
1914         (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay): Use auto.
1915         (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns): Got rid of
1916         unnecessary typedef.
1917         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Take a
1918         reference rather than PassRefPtr.
1919         (WebCore::documentHadRecentUserGesture): Removed unneeded if.
1920         (WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting): Use auto.
1921         (WebCore::isSmallerThanTinySizingThreshold): Use auto.
1922         (WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin): Use auto.
1923         (WebCore::HTMLPlugInImageElement::checkSnapshotStatus): Use auto.
1924         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Got rid
1925         of unnecessary local variable. Use auto.
1926         (WebCore::HTMLPlugInImageElement::requestObject): Got rid of unnecessary
1927         local variable.
1928         * html/HTMLPlugInImageElement.h: Updated for the above. Removed incorrect
1929         use of const. Initialized all scalars. Made function private and final.
1930
1931         * rendering/RenderSnapshottedPlugIn.cpp:
1932         (WebCore::RenderSnapshottedPlugIn::handleEvent): Pass reference instead
1933         of pointer.
1934
1935 2016-12-11  Joseph Pecoraro  <pecoraro@apple.com>
1936
1937         Web Inspector: Cleanup some InspectorInstrumentation network loading notifications
1938         https://bugs.webkit.org/show_bug.cgi?id=165688
1939
1940         Reviewed by Brian Burg.
1941
1942         Eliminate InspectorInstrumentation::willReceiveResourceResponse by folding
1943         it into InspectorInstrumentation::didReceiveResourceResponse. Simplify other
1944         related InspectorInstrumentation calls by using references and using more
1945         consistent InspectorInstrumentation patterns.
1946
1947         * inspector/InspectorInstrumentation.cpp:
1948         (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
1949         (WebCore::InspectorInstrumentation::willReceiveResourceResponseImpl): Deleted.
1950         (WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl): Deleted.
1951         (WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl): Deleted.
1952         (WebCore::InspectorInstrumentation::continueWithPolicyDownloadImpl): Deleted.
1953         (WebCore::InspectorInstrumentation::continueWithPolicyIgnoreImpl): Deleted.
1954         * inspector/InspectorInstrumentation.h:
1955         (WebCore::InspectorInstrumentation::didReceiveResourceResponse):
1956         (WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDenied):
1957         (WebCore::InspectorInstrumentation::continueWithPolicyDownload):
1958         (WebCore::InspectorInstrumentation::continueWithPolicyIgnore):
1959         (WebCore::InspectorInstrumentation::willReceiveResourceResponse): Deleted.
1960         * loader/CrossOriginPreflightChecker.cpp:
1961         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
1962         * loader/DocumentLoader.cpp:
1963         (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
1964         (WebCore::DocumentLoader::continueAfterContentPolicy):
1965         * loader/ResourceLoadNotifier.cpp:
1966         (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
1967         * loader/appcache/ApplicationCacheGroup.cpp:
1968         (WebCore::ApplicationCacheGroup::didReceiveResponse):
1969
1970 2016-12-11  Eric Carlson  <eric.carlson@apple.com>
1971
1972         [MediaStream] Protect MediaDevicesRequest during callback
1973         https://bugs.webkit.org/show_bug.cgi?id=165711
1974         <rdar://problem/28400468>
1975
1976         Reviewed by Sam Weinig.
1977
1978         No new tests, I was unable to create a reproducible test but this fix avoids
1979         an occasional crash in existing tests.
1980
1981         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
1982         (WebCore::MediaDevicesEnumerationRequest::start): Take a reference to the object
1983         before calling the controller in case the completion handler is called synchronously.
1984
1985 2016-12-09  Filip Pizlo  <fpizlo@apple.com>
1986
1987         The DOM should have an advancing wavefront opaque root barrier
1988         https://bugs.webkit.org/show_bug.cgi?id=165712
1989
1990         Reviewed by Yusuke Suzuki.
1991
1992         No new tests because this was covered by crashing tests.
1993         
1994         Consider these two cases:
1995         
1996            Removal:
1997            1) DOM at start: D->X->Y
1998            2) Mark X, X->visitChildren, addOpaqueRoot(D)
1999            3) remove X
2000            4) Y thinks it's not reachable (its opaque root, X, is not in the set).
2001            
2002            Insertion:
2003            1) DOM at start: D, X->Y
2004            2) Mark X, X->visitChildren, addOpaqueRoot(X)
2005            3) insert X into D
2006            4) Y thinks it's not reachable (its opaque root, D, is not in the set).
2007         
2008         We can fix this with two barriers:
2009         
2010            Removal: add X (the removed child) to the opaque root set.
2011            Insertion: add D (the insertion point) to the opaque root set.
2012         
2013         Thanks Rysosuke for coming up with this idea!
2014         
2015         Both barriers advance the wavefront. We could consider retreating wavefront barriers in
2016         the future (where we cause visitChildren to be called again on wrappers that belonged to
2017         roots that got affected by insertion/removal) but those would probably require more
2018         bookkeeping.
2019         
2020         To make this barrier very fast, the WebCore caches the JSC VM's barrier state in
2021         its own global variable for very fast access. This variable will be false most of the
2022         time. It's false when there is no VM, so triggering the barrier won't cause the VM to be
2023         created. It's only true when GC is running, which is rare by design.
2024         
2025         To make that caching more sensible, I finally gave WebCore a central header for
2026         the common VM (CommonVM.h).
2027
2028         * CMakeLists.txt:
2029         * Modules/mediastream/SDPProcessor.cpp:
2030         (WebCore::SDPProcessor::callScript):
2031         * WebCore.xcodeproj/project.pbxproj:
2032         * bindings/js/CommonVM.cpp: Added.
2033         (WebCore::commonVMSlow):
2034         (WebCore::writeBarrierOpaqueRootSlow):
2035         * bindings/js/CommonVM.h: Added.
2036         (WebCore::commonVM):
2037         (WebCore::writeBarrierOpaqueRoot):
2038         * bindings/js/DOMWrapperWorld.cpp:
2039         (WebCore::mainThreadNormalWorld):
2040         * bindings/js/GCController.cpp:
2041         (WebCore::collect):
2042         (WebCore::GCController::garbageCollectSoon):
2043         (WebCore::GCController::garbageCollectNow):
2044         (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
2045         (WebCore::GCController::setJavaScriptGarbageCollectorTimerEnabled):
2046         (WebCore::GCController::deleteAllCode):
2047         (WebCore::GCController::deleteAllLinkedCode):
2048         * bindings/js/JSCustomXPathNSResolver.cpp:
2049         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
2050         * bindings/js/JSDOMBinding.cpp:
2051         (WebCore::addImpureProperty):
2052         * bindings/js/JSDOMWindowBase.cpp:
2053         (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
2054         (WebCore::JSDOMWindowBase::commonVM): Deleted.
2055         * bindings/js/JSDOMWindowBase.h:
2056         * bindings/js/JSDOMWindowShell.cpp:
2057         (WebCore::JSDOMWindowShell::setWindow):
2058         * bindings/js/JSNodeCustom.h:
2059         (WebCore::root):
2060         * bindings/js/ScriptCachedFrameData.cpp:
2061         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
2062         (WebCore::ScriptCachedFrameData::restore):
2063         (WebCore::ScriptCachedFrameData::clear):
2064         * bindings/js/ScriptController.cpp:
2065         (WebCore::ScriptController::~ScriptController):
2066         (WebCore::ScriptController::createWorld):
2067         (WebCore::ScriptController::getAllWorlds):
2068         (WebCore::ScriptController::clearWindowShell):
2069         (WebCore::ScriptController::cacheableBindingRootObject):
2070         (WebCore::ScriptController::bindingRootObject):
2071         (WebCore::ScriptController::windowScriptNPObject):
2072         (WebCore::ScriptController::jsObjectForPluginElement):
2073         (WebCore::ScriptController::clearScriptObjects):
2074         * dom/CollectionIndexCache.cpp:
2075         (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
2076         * dom/ContainerNode.cpp:
2077         * dom/ContainerNodeAlgorithms.cpp:
2078         (WebCore::notifyChildNodeInserted):
2079         (WebCore::notifyChildNodeRemoved):
2080         * dom/Document.cpp:
2081         (WebCore::Document::shouldBypassMainWorldContentSecurityPolicy):
2082         * dom/Node.h:
2083         (WebCore::Node::opaqueRoot):
2084         * dom/ScriptExecutionContext.cpp:
2085         (WebCore::ScriptExecutionContext::vm):
2086         * html/HTMLImageLoader.cpp:
2087         (WebCore::HTMLImageLoader::notifyFinished):
2088         * html/HTMLMediaElement.cpp:
2089         (WebCore::HTMLMediaElement::pauseAfterDetachedTask):
2090         (WebCore::HTMLMediaElement::ensureIsolatedWorld):
2091         * html/HTMLPlugInImageElement.cpp:
2092         (WebCore::plugInImageElementIsolatedWorld):
2093         * inspector/InspectorController.cpp:
2094         (WebCore::InspectorController::vm):
2095         * inspector/PageScriptDebugServer.cpp:
2096         (WebCore::PageScriptDebugServer::PageScriptDebugServer):
2097         * page/PerformanceLogging.cpp:
2098         (WebCore::PerformanceLogging::memoryUsageStatistics):
2099         (WebCore::PerformanceLogging::javaScriptObjectCounts):
2100         * page/ResourceUsageThread.cpp:
2101         (WebCore::ResourceUsageThread::createThreadIfNeeded):
2102         * svg/graphics/SVGImage.cpp:
2103         (WebCore::SVGImage::reportApproximateMemoryCost):
2104         * testing/MemoryInfo.h:
2105         (WebCore::MemoryInfo::MemoryInfo):
2106
2107 2016-12-11  Dan Bernstein  <mitz@apple.com>
2108
2109         [Cocoa] NSAttributedString representation of text copied from -webkit-nbsp-mode:space element contains non-breaking space characters, but shouldn’t
2110         https://bugs.webkit.org/show_bug.cgi?id=165515
2111         <rdar://problem/4108460>
2112
2113         Reviewed by Darin Adler.
2114
2115         Test: platform/mac/fast/text/attributed-substring-from-range.html
2116
2117         * editing/cocoa/HTMLConverter.mm:
2118         (HTMLConverter::_processText): Emit a space instead of a non-breaking space if the text node
2119           is styled with -webkit-nbsp-mode:space.
2120         (WebCore::editingAttributedStringFromRange): Replace all non-breaking spaces with spaces if
2121           they come from a text node with -webkit-nbsp-mode:space.
2122
2123 2016-12-11  Konstantin Tokarev  <annulen@yandex.ru>
2124
2125         Unreviewed, add KHR include dir to fix ANGLE build after r209665
2126         https://bugs.webkit.org/show_bug.cgi?id=165686
2127
2128         * CMakeLists.txt:
2129
2130 2016-12-10  Dave Hyatt  <hyatt@apple.com>
2131
2132         Rolling out 165737, since it broke layout tests. I need to find a 
2133         different place to put the init.
2134
2135         * contentextensions/ContentExtensionParser.cpp:
2136         (WebCore::ContentExtensions::isValidSelector):
2137
2138 2016-12-10  Simon Fraser  <simon.fraser@apple.com>
2139
2140         Support the deprecated dictionary constructor for DOMPointReadOnly and DOMPoint
2141         https://bugs.webkit.org/show_bug.cgi?id=165732
2142
2143         Reviewed by Sam Weinig.
2144         
2145         For compatibility with other browsers, support the DOMPointInit constructor to
2146         DOMPoint and DOMPointReadOnly per <https://www.w3.org/TR/geometry-1/#DOMPoint>
2147
2148         Extended geometry/DOMPoint-001.html to test.
2149
2150         * dom/DOMPoint.h:
2151         * dom/DOMPoint.idl:
2152         * dom/DOMPointReadOnly.h:
2153         (WebCore::DOMPointReadOnly::create):
2154         * dom/DOMPointReadOnly.idl:
2155
2156 2016-12-10  Dave Hyatt  <hyatt@apple.com>
2157
2158         [CSS Parser] Make sure content extensions initialize AtomicString
2159         https://bugs.webkit.org/show_bug.cgi?id=165737
2160
2161         Reviewed by Simon Fraser.
2162
2163         Fixes two broken tests in TestWebkitAPI.
2164
2165         * contentextensions/ContentExtensionParser.cpp:
2166         (WebCore::ContentExtensions::isValidSelector):
2167
2168 2016-12-10  Simon Fraser  <simon.fraser@apple.com>
2169
2170         Animation followed by transition doesn't always fire transitionend event
2171         https://bugs.webkit.org/show_bug.cgi?id=165731
2172         rdar://problem/28471240
2173
2174         Reviewed by Zalan Bujtas.
2175         
2176         After r200047, a keyframe animation of an accelerated property followed by a
2177         transition didn't always fire a transitionend event.
2178         
2179         This happened if CompositeAnimation::timeToNextService() happend to be called
2180         when the transitions's timeToNextService() returned a positive value, but the
2181         keyframe animation still existed, but its timeToNextService() returned -1. In
2182         this case that -1 would clobber the positing minT.
2183
2184         Fix by just continuing in each loop when the timeToNextService() returns -1.
2185
2186         This code should probably be rewritten to use std::optional<double> rather than
2187         magic values.
2188
2189         Test: animations/animation-followed-by-transition.html
2190
2191         * page/animation/CompositeAnimation.cpp:
2192         (WebCore::CompositeAnimation::timeToNextService):
2193         * platform/graphics/ca/GraphicsLayerCA.cpp:
2194         (WebCore::GraphicsLayerCA::addAnimation):
2195         (WebCore::GraphicsLayerCA::pauseAnimation):
2196         (WebCore::GraphicsLayerCA::removeAnimation):
2197         (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
2198         (WebCore::GraphicsLayerCA::platformCALayerAnimationEnded):
2199
2200 2016-12-10  Sam Weinig  <sam@webkit.org>
2201
2202         [WebIDL] Merge JSDictionary into Dictionary, and remove unused bits
2203         https://bugs.webkit.org/show_bug.cgi?id=165641
2204
2205         Reviewed by Dan Bernstein.
2206
2207         * CMakeLists.txt:
2208         * WebCore.xcodeproj/project.pbxproj:
2209         * bindings/js/JSBindingsAllInOne.cpp:
2210         Remove JSDictionary.h/cpp
2211
2212         * Modules/mediastream/RTCDataChannel.cpp:
2213         Remove unused #include of Dictionary.h
2214
2215         * Modules/mediastream/RTCPeerConnection.cpp:
2216         * Modules/mediastream/RTCPeerConnection.h:
2217         Replace unnecessary #include of Dictionary in a header with forward declaration.
2218
2219         * bindings/js/Dictionary.cpp:
2220         (WebCore::Dictionary::Dictionary):
2221         (WebCore::Dictionary::tryGetProperty):
2222         (WebCore::Dictionary::getOwnPropertyNames):
2223         (WebCore::Dictionary::convertValue):
2224         (WebCore::Dictionary::asJSObject<Notification>): Deleted.
2225         (WebCore::Dictionary::getOwnPropertiesAsStringHashMap): Deleted.
2226         (WebCore::Dictionary::getWithUndefinedOrNullCheck): Deleted.
2227         * bindings/js/Dictionary.h:
2228         (WebCore::Dictionary::isObject):
2229         (WebCore::Dictionary::isUndefinedOrNull):
2230         (WebCore::Dictionary::execState):
2231         (WebCore::Dictionary::initializerObject):
2232         (WebCore::Dictionary::isValid):
2233         (WebCore::Dictionary::convertValue):
2234         (WebCore::Dictionary::get):
2235         (WebCore::Dictionary::tryGetPropertyAndResult):
2236         (WebCore::Dictionary::getEventListener): Deleted.
2237         Merge JSDictionary into Dictionary. Remove all unused functions (some getters, lots
2238         of convertValue overrides). Modernize to taste.
2239
2240         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2241         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
2242         (WebCore::getHashAlgorithm):
2243         (WebCore::createHmacParams):
2244         (WebCore::createHmacKeyParams):
2245         (WebCore::createRsaKeyGenParams):
2246         (WebCore::createRsaOaepParams):
2247         (WebCore::createRsaSsaParams):
2248         Update for rename. JSDictionary is now Dictionary.
2249
2250         * bindings/js/JSDictionary.cpp: Removed.
2251         * bindings/js/JSDictionary.h: Removed.
2252
2253         * dom/MutationObserver.cpp:
2254         Remove unused #include of Dictionary.h
2255
2256 2016-12-10  Dave Hyatt  <hyatt@apple.com>
2257
2258         [CSS Parser] Move CSSParserValues.h/.cpp to CSSParserSelector.h/.cpp
2259         https://bugs.webkit.org/show_bug.cgi?id=165730
2260
2261         Reviewed by Simon Fraser.
2262
2263         * WebCore.xcodeproj/project.pbxproj:
2264         * css/CSSCustomPropertyValue.cpp:
2265         * css/CSSPrimitiveValue.cpp:
2266         * css/CSSSelectorList.cpp:
2267         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
2268         * css/parser/CSSParserImpl.cpp:
2269         * css/parser/CSSParserSelector.cpp: Copied from Source/WebCore/css/parser/CSSParserValues.cpp.
2270         * css/parser/CSSParserSelector.h: Copied from Source/WebCore/css/parser/CSSParserValues.h.
2271         * css/parser/CSSParserValues.cpp: Removed.
2272         * css/parser/CSSParserValues.h: Removed.
2273         * css/parser/CSSSelectorParser.h:
2274
2275 2016-12-10  Dave Hyatt  <hyatt@apple.com>
2276
2277         [CSS Parser] Remove the pseudoclass/element hacks
2278         https://bugs.webkit.org/show_bug.cgi?id=165729
2279
2280         Reviewed by Sam Weinig.
2281
2282         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
2283         * css/SelectorPseudoElementTypeMap.in:
2284         * css/parser/CSSSelectorParser.cpp:
2285         (WebCore::CSSSelectorParser::consumePseudo):
2286
2287 2016-12-09  Sam Weinig  <sam@webkit.org>
2288
2289         [WebIDL] Remove custom bindings for Geolocation
2290         https://bugs.webkit.org/show_bug.cgi?id=165625
2291
2292         Reviewed by Alex Christensen.
2293
2294         * CMakeLists.txt:
2295         * DerivedSources.cpp:
2296         * DerivedSources.make:
2297         * WebCore.xcodeproj/project.pbxproj:
2298         * bindings/js/JSBindingsAllInOne.cpp:
2299         Add/remove files.
2300
2301         * Modules/geolocation/GeoNotifier.cpp:
2302         (WebCore::GeoNotifier::GeoNotifier):
2303         (WebCore::GeoNotifier::hasZeroTimeout):
2304         (WebCore::GeoNotifier::startTimerIfNeeded):
2305         * Modules/geolocation/GeoNotifier.h:
2306         (WebCore::GeoNotifier::create):
2307         (WebCore::GeoNotifier::options):
2308         Update to store PositionOptions as a value, and pass the PositionCallback
2309         as a Ref, rather than a RefPtr, since it is not optional.
2310
2311         * Modules/geolocation/Geolocation.cpp:
2312         (WebCore::createGeoposition):
2313         Use auto, to get the good type for Coordinates (Ref).
2314
2315         (WebCore::Geolocation::getCurrentPosition):
2316         (WebCore::Geolocation::watchPosition):
2317         (WebCore::Geolocation::haveSuitableCachedPosition):
2318         (WebCore::Geolocation::startUpdating):
2319         * Modules/geolocation/Geolocation.h:
2320         Update to pass PositionOptions itself now that it is a plain struct.
2321
2322         * Modules/geolocation/Geolocation.idl:
2323         Remove [Custom] extended attribute and add FIXME about nullable annotation. 
2324
2325         * Modules/geolocation/Geoposition.h:
2326         Pass/store Coordinates as a Ref.
2327  
2328         * Modules/geolocation/PositionOptions.h:
2329         Convert to be a simple struct.
2330
2331         * Modules/geolocation/PositionOptions.idl:
2332         Added.
2333         
2334         * bindings/js/JSGeolocationCustom.cpp:
2335         Removed.
2336
2337 2016-12-09  Dave Hyatt  <hyatt@apple.com>
2338
2339         [CSS Parser] Remove the old CSS Parser
2340         https://bugs.webkit.org/show_bug.cgi?id=165645
2341
2342         Reviewed by Daniel Bates.
2343
2344         Remove the old CSS parser code. In doing so, code that used documentless
2345         CSSParserContexts is now going through the new parser. This resulted in
2346         some additional changes. These include:
2347
2348         (1) Canvas color parsing switched to new parser's code. This resulted in
2349         progressions on canvas tests.
2350
2351         (2) Support for CSSNamespaceRule in the CSS OM, since the Inspector's
2352         creation of CSS OM wrappers made it necessary to add this in. The old parser
2353         did not create style rules for namespaces, but the new one (and other browsers)
2354         did.
2355
2356         (3) <font face="X"> now uses the new parser's font-family parsing code. This
2357         change was made in createFontFaceValue in CSSValuePool.
2358
2359         (4) FontFace now uses a new function on the new parser called
2360         parseFontFaceDescriptor. This function sets things up so that parsing occurs
2361         as though you are inside a @font-face. The old parser let you call parseValue
2362         to parse "properties", but descriptors need to be handled differently in the
2363         new parser.
2364
2365         (5) Illegal CSS rules in mediaControlsApple/ios.css forced me to add a quirk
2366         to handle chained shadow DOM pseudo-elements. This should not be allowed, but
2367         for now it is.
2368
2369         * CMakeLists.txt:
2370         * DerivedSources.make:
2371         * WebCore.xcodeproj/project.pbxproj:
2372         * bindings/js/JSCSSRuleCustom.cpp:
2373         (WebCore::toJSNewlyCreated):
2374         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2375         * css/CSSCalculationValue.cpp:
2376         (WebCore::unitCategory):
2377         (WebCore::hasDoubleValue):
2378         (WebCore::checkDepthAndIndexDeprecated): Deleted.
2379         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseCalc): Deleted.
2380         (WebCore::CSSCalcExpressionNodeParserDeprecated::operatorValue): Deleted.
2381         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValue): Deleted.
2382         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueTerm): Deleted.
2383         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueMultiplicativeExpression): Deleted.
2384         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseAdditiveValueExpression): Deleted.
2385         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueExpression): Deleted.
2386         * css/CSSCalculationValue.h:
2387         * css/CSSComputedStyleDeclaration.cpp:
2388         (WebCore::specifiedValueForGridTrackSize):
2389         * css/CSSCustomPropertyValue.cpp:
2390         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
2391         (WebCore::CSSCustomPropertyValue::resolveVariableReferences):
2392         * css/CSSCustomPropertyValue.h:
2393         * css/CSSFunctionValue.cpp:
2394         (WebCore::CSSFunctionValue::CSSFunctionValue):
2395         (WebCore::CSSFunctionValue::customCSSText):
2396         (WebCore::CSSFunctionValue::append):
2397         (WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables): Deleted.
2398         * css/CSSFunctionValue.h:
2399         * css/CSSGrammar.y.in: Removed.
2400         * css/CSSGrammar.y.includes: Removed.
2401         * css/CSSGroupingRule.cpp:
2402         (WebCore::CSSGroupingRule::insertRule):
2403         * css/CSSKeyframeRule.h:
2404         * css/CSSKeyframesRule.cpp:
2405         (WebCore::CSSKeyframesRule::appendRule):
2406         * css/CSSNamespaceRule.cpp: Added.
2407         (WebCore::CSSNamespaceRule::CSSNamespaceRule):
2408         (WebCore::CSSNamespaceRule::~CSSNamespaceRule):
2409         (WebCore::CSSNamespaceRule::namespaceURI):
2410         (WebCore::CSSNamespaceRule::prefix):
2411         (WebCore::CSSNamespaceRule::cssText):
2412         (WebCore::CSSNamespaceRule::reattach):
2413         * css/CSSNamespaceRule.h: Added.
2414         * css/CSSNamespaceRule.idl: Added.
2415         * css/CSSPrimitiveValue.cpp:
2416         (WebCore::isValidCSSUnitTypeForDoubleConversion):
2417         (WebCore::isStringType):
2418         (WebCore::CSSPrimitiveValue::cleanup):
2419         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
2420         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
2421         (WebCore::CSSPrimitiveValue::equals):
2422         (WebCore::CSSPrimitiveValue::buildParserValue): Deleted.
2423         * css/CSSPrimitiveValue.h:
2424         * css/CSSRule.h:
2425         * css/CSSRule.idl:
2426         * css/CSSStyleSheet.cpp:
2427         (WebCore::CSSStyleSheet::insertRule):
2428         * css/CSSValue.cpp:
2429         (WebCore::CSSValue::equals):
2430         (WebCore::CSSValue::cssText):
2431         (WebCore::CSSValue::destroy):
2432         * css/CSSValue.h:
2433         (WebCore::CSSValue::isCustomPropertyValue):
2434         (WebCore::CSSValue::hasVariableReferences):
2435         (WebCore::CSSValue::isVariableDependentValue): Deleted.
2436         (WebCore::CSSValue::isVariableValue): Deleted.
2437         * css/CSSValueList.cpp:
2438         (WebCore::CSSValueList::customCSSText):
2439         (WebCore::CSSValueList::containsVariables): Deleted.
2440         (WebCore::CSSValueList::checkVariablesForCycles): Deleted.
2441         (WebCore::CSSValueList::buildParserValueSubstitutingVariables): Deleted.
2442         (WebCore::CSSValueList::buildParserValueListSubstitutingVariables): Deleted.
2443         * css/CSSValueList.h:
2444         (WebCore::CSSValueList::createSlashSeparated):
2445         (WebCore::CSSValueList::createFromParserValueList): Deleted.
2446         * css/CSSValuePool.cpp:
2447         (WebCore::CSSValuePool::createFontFaceValue):
2448         * css/CSSVariableData.cpp:
2449         * css/CSSVariableDependentValue.cpp: Removed.
2450         * css/CSSVariableDependentValue.h: Removed.
2451         * css/CSSVariableValue.cpp: Removed.
2452         * css/CSSVariableValue.h: Removed.
2453         * css/DOMCSSNamespace.cpp:
2454         * css/FontFace.cpp:
2455         (WebCore::FontFace::parseString):
2456         * css/InspectorCSSOMWrappers.cpp:
2457         * css/MediaQueryExp.cpp:
2458         (WebCore::isFeatureValidWithIdentifier): Deleted.
2459         (WebCore::isFeatureValidWithNonNegativeLengthOrNumber): Deleted.
2460         (WebCore::isFeatureValidWithDensity): Deleted.
2461         (WebCore::isFeatureValidWithNonNegativeInteger): Deleted.
2462         (WebCore::isFeatureValidWithNonNegativeNumber): Deleted.
2463         (WebCore::isFeatureValidWithZeroOrOne): Deleted.
2464         (WebCore::isFeatureValidWithNumberWithUnit): Deleted.
2465         (WebCore::isFeatureValidWithNumber): Deleted.
2466         (WebCore::isSlash): Deleted.
2467         (WebCore::isPositiveIntegerValue): Deleted.
2468         * css/MediaQueryExp.h:
2469         * css/PropertySetCSSStyleDeclaration.cpp:
2470         (WebCore::PropertySetCSSStyleDeclaration::setCssText):
2471         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
2472         * css/SelectorPseudoTypeMap.h:
2473         * css/StyleProperties.cpp:
2474         (WebCore::StyleProperties::getPropertyValue):
2475         (WebCore::StyleProperties::getPropertyCSSValue):
2476         (WebCore::MutableStyleProperties::setCustomProperty):
2477         (WebCore::MutableStyleProperties::parseDeclaration):
2478         (WebCore::StyleProperties::asText):
2479         * css/StyleProperties.h:
2480         * css/StyleResolver.cpp:
2481         (WebCore::StyleResolver::applyProperty):
2482         * css/StyleResolver.h:
2483         * css/StyleRule.cpp:
2484         (WebCore::StyleRuleBase::createCSSOMWrapper):
2485         * css/StyleSheetContents.cpp:
2486         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2487         (WebCore::StyleSheetContents::parseString):
2488         (WebCore::StyleSheetContents::completeURL):
2489         (WebCore::StyleSheetContents::parseStringAtPosition): Deleted.
2490         * css/StyleSheetContents.h:
2491         * css/WebKitCSSMatrix.cpp:
2492         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
2493         * css/parser/CSSParser.cpp:
2494         (WebCore::CSSParserContext::CSSParserContext):
2495         (WebCore::CSSParser::CSSParser):
2496         (WebCore::CSSParser::parseSheet):
2497         (WebCore::CSSParser::parseRule):
2498         (WebCore::CSSParser::parseKeyframeRule):
2499         (WebCore::CSSParser::parseSupportsCondition):
2500         (WebCore::CSSParser::parseColor):
2501         (WebCore::CSSParser::parseSystemColor):
2502         (WebCore::CSSParser::parseSingleValue):
2503         (WebCore::CSSParser::parseValue):
2504         (WebCore::CSSParser::parseCustomPropertyValue):
2505         (WebCore::CSSParser::parseSelector):
2506         (WebCore::CSSParser::parseInlineStyleDeclaration):
2507         (WebCore::CSSParser::parseDeclaration):
2508         (WebCore::CSSParser::parseValueWithVariableReferences):
2509         (WebCore::CSSParser::parseKeyframeKeyList):
2510         (WebCore::CSSParser::parseFontFaceDescriptor):
2511         (WebCore::equalLettersIgnoringASCIICase): Deleted.
2512         (WebCore::hasPrefix): Deleted.
2513         (WebCore::createPrimitiveValuePair): Deleted.
2514         (WebCore::AnimationParseContext::commitFirstAnimation): Deleted.
2515         (WebCore::AnimationParseContext::hasCommittedFirstAnimation): Deleted.
2516         (WebCore::AnimationParseContext::commitAnimationPropertyKeyword): Deleted.
2517         (WebCore::AnimationParseContext::animationPropertyKeywordAllowed): Deleted.
2518         (WebCore::AnimationParseContext::hasSeenAnimationPropertyKeyword): Deleted.
2519         (WebCore::AnimationParseContext::sawAnimationPropertyKeyword): Deleted.
2520         (): Deleted.
2521         (WebCore::convertToASCIILowercaseInPlace): Deleted.
2522         (WebCore::CSSParserString::convertToASCIILowercaseInPlace): Deleted.
2523         (WebCore::CSSParser::setupParser): Deleted.
2524         (WebCore::isColorPropertyID): Deleted.
2525         (WebCore::CSSParser::isValidSystemColorValue): Deleted.
2526         (WebCore::validPrimitiveValueColor): Deleted.
2527         (WebCore::parseColorValue): Deleted.
2528         (WebCore::isSimpleLengthPropertyID): Deleted.
2529         (WebCore::parseSimpleLength): Deleted.
2530         (WebCore::parseSimpleLengthValue): Deleted.
2531         (WebCore::isValidKeywordPropertyAndValue): Deleted.
2532         (WebCore::isUniversalKeyword): Deleted.
2533         (WebCore::isKeywordPropertyID): Deleted.
2534         (WebCore::parseKeywordValue): Deleted.
2535         (WebCore::parseTransformTranslateArguments): Deleted.
2536         (WebCore::parseTranslateTransformValue): Deleted.
2537         (WebCore::CSSParser::parseFontFaceValue): Deleted.
2538         (WebCore::CSSParser::parseColorFromString): Deleted.
2539         (WebCore::CSSParser::parseDeclarationDeprecated): Deleted.
2540         (WebCore::filterProperties): Deleted.
2541         (WebCore::CSSParser::createStyleProperties): Deleted.
2542         (WebCore::CSSParser::addProperty): Deleted.
2543         (WebCore::CSSParser::rollbackLastProperties): Deleted.
2544         (WebCore::CSSParser::clearProperties): Deleted.
2545         (WebCore::CSSParser::completeURL): Deleted.
2546         (WebCore::CSSParser::validateCalculationUnit): Deleted.
2547         (WebCore::CSSParser::shouldAcceptUnitLessValues): Deleted.
2548         (WebCore::CSSParser::validateUnit): Deleted.
2549         (WebCore::CSSParser::createPrimitiveNumericValue): Deleted.
2550         (WebCore::CSSParser::createPrimitiveStringValue): Deleted.
2551         (WebCore::isComma): Deleted.
2552         (WebCore::isForwardSlashOperator): Deleted.
2553         (WebCore::CSSParser::isValidSize): Deleted.
2554         (WebCore::CSSParser::parseValidPrimitive): Deleted.
2555         (WebCore::CSSParser::addExpandedPropertyForValue): Deleted.
2556         (WebCore::isImageSetFunctionValue): Deleted.
2557         (WebCore::CSSParser::addFillValue): Deleted.
2558         (WebCore::isContentDistributionKeyword): Deleted.
2559         (WebCore::isContentPositionKeyword): Deleted.
2560         (WebCore::isBaselinePositionKeyword): Deleted.
2561         (WebCore::isAlignmentOverflowKeyword): Deleted.
2562         (WebCore::isItemPositionKeyword): Deleted.
2563         (WebCore::CSSParser::parseLegacyPosition): Deleted.
2564         (WebCore::CSSParser::parseContentDistributionOverflowPosition): Deleted.
2565         (WebCore::CSSParser::parseItemPositionOverflowPosition): Deleted.
2566         (WebCore::parseBackgroundClip): Deleted.
2567         (WebCore::CSSParser::useLegacyBackgroundSizeShorthandBehavior): Deleted.
2568         (WebCore::CSSParser::parseNonElementSnapPoints): Deleted.
2569         (WebCore::CSSParser::parseScrollSnapPositions): Deleted.
2570         (WebCore::CSSParser::parseScrollSnapDestination): Deleted.
2571         (WebCore::CSSParser::parseScrollSnapCoordinate): Deleted.
2572         (WebCore::CSSParser::parseFillShorthand): Deleted.
2573         (WebCore::CSSParser::addAnimationValue): Deleted.
2574         (WebCore::CSSParser::parseAnimationShorthand): Deleted.
2575         (WebCore::CSSParser::parseColumnWidth): Deleted.
2576         (WebCore::CSSParser::parseColumnCount): Deleted.
2577         (WebCore::CSSParser::parseColumnsShorthand): Deleted.
2578         (WebCore::CSSParser::parseTransitionShorthand): Deleted.
2579         (WebCore::CSSParser::parseShorthand): Deleted.
2580         (WebCore::CSSParser::parse4Values): Deleted.
2581         (WebCore::CSSParser::parsePage): Deleted.
2582         (WebCore::CSSParser::parseSize): Deleted.
2583         (WebCore::CSSParser::parseSizeParameter): Deleted.
2584         (WebCore::CSSParser::parseQuotes): Deleted.
2585         (WebCore::CSSParser::parseAlt): Deleted.
2586         (WebCore::CSSParser::parseCustomPropertyDeclaration): Deleted.
2587         (WebCore::CSSParser::parseContent): Deleted.
2588         (WebCore::CSSParser::parseAttr): Deleted.
2589         (WebCore::CSSParser::parseBackgroundColor): Deleted.
2590         (WebCore::CSSParser::parseFillImage): Deleted.
2591         (WebCore::CSSParser::parsePositionX): Deleted.
2592         (WebCore::CSSParser::parsePositionY): Deleted.
2593         (WebCore::CSSParser::parseFillPositionComponent): Deleted.
2594         (WebCore::isValueConflictingWithCurrentEdge): Deleted.
2595         (WebCore::isFillPositionKeyword): Deleted.
2596         (WebCore::CSSParser::parse4ValuesFillPosition): Deleted.
2597         (WebCore::CSSParser::parse3ValuesFillPosition): Deleted.
2598         (WebCore::CSSParser::isPotentialPositionValue): Deleted.
2599         (WebCore::CSSParser::parseFillPosition): Deleted.
2600         (WebCore::CSSParser::parse2ValuesFillPosition): Deleted.
2601         (WebCore::CSSParser::parseFillRepeat): Deleted.
2602         (WebCore::CSSParser::parseFillSize): Deleted.
2603         (WebCore::CSSParser::parseFillProperty): Deleted.
2604         (WebCore::CSSParser::parseAnimationDelay): Deleted.
2605         (WebCore::CSSParser::parseAnimationDirection): Deleted.
2606         (WebCore::CSSParser::parseAnimationDuration): Deleted.
2607         (WebCore::CSSParser::parseAnimationFillMode): Deleted.
2608         (WebCore::CSSParser::parseAnimationIterationCount): Deleted.
2609         (WebCore::CSSParser::parseAnimationName): Deleted.
2610         (WebCore::CSSParser::parseAnimationPlayState): Deleted.
2611         (WebCore::CSSParser::parseAnimationTrigger): Deleted.
2612         (WebCore::CSSParser::parseAnimationProperty): Deleted.
2613         (WebCore::CSSParser::parseTransformOriginShorthand): Deleted.
2614         (WebCore::CSSParser::isSpringTimingFunctionEnabled): Deleted.
2615         (WebCore::CSSParser::parseCubicBezierTimingFunctionValue): Deleted.
2616         (WebCore::CSSParser::parseSpringTimingFunctionValue): Deleted.
2617         (WebCore::CSSParser::parseAnimationTimingFunction): Deleted.
2618         (WebCore::isValidGridPositionCustomIdent): Deleted.
2619         (WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition): Deleted.
2620         (WebCore::CSSParser::parseGridPosition): Deleted.
2621         (WebCore::gridMissingGridPositionValue): Deleted.
2622         (WebCore::CSSParser::parseGridItemPositionShorthand): Deleted.
2623         (WebCore::CSSParser::parseGridGapShorthand): Deleted.
2624         (WebCore::CSSParser::parseGridTemplateColumns): Deleted.
2625         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Deleted.
2626         (WebCore::CSSParser::parseGridTemplateShorthand): Deleted.
2627         (WebCore::parseImplicitAutoFlow): Deleted.
2628         (WebCore::CSSParser::parseGridShorthand): Deleted.
2629         (WebCore::CSSParser::parseGridAreaShorthand): Deleted.
2630         (WebCore::CSSParser::parseSingleGridAreaLonghand): Deleted.
2631         (WebCore::CSSParser::parseGridLineNames): Deleted.
2632         (WebCore::isGridTrackFixedSized): Deleted.
2633         (WebCore::CSSParser::parseGridTrackList): Deleted.
2634         (WebCore::CSSParser::parseGridTrackRepeatFunction): Deleted.
2635         (WebCore::CSSParser::parseGridTrackSize): Deleted.
2636         (WebCore::CSSParser::parseGridBreadth): Deleted.
2637         (WebCore::isValidGridAutoFlowId): Deleted.
2638         (WebCore::CSSParser::parseGridAutoFlow): Deleted.
2639         (WebCore::skipCommaInDashboardRegion): Deleted.
2640         (WebCore::CSSParser::parseDashboardRegions): Deleted.
2641         (WebCore::parseGridTemplateAreasColumnNames): Deleted.
2642         (WebCore::CSSParser::parseGridTemplateAreasRow): Deleted.
2643         (WebCore::CSSParser::parseGridTemplateAreas): Deleted.
2644         (WebCore::CSSParser::parseCounterContent): Deleted.
2645         (WebCore::CSSParser::parseClipShape): Deleted.
2646         (WebCore::completeBorderRadii): Deleted.
2647         (WebCore::CSSParser::parseInsetRoundedCorners): Deleted.
2648         (WebCore::CSSParser::parseBasicShapeInset): Deleted.
2649         (WebCore::CSSParser::parseShapeRadius): Deleted.
2650         (WebCore::CSSParser::parseBasicShapeCircle): Deleted.
2651         (WebCore::CSSParser::parseBasicShapeEllipse): Deleted.
2652         (WebCore::CSSParser::parseBasicShapePolygon): Deleted.
2653         (WebCore::CSSParser::parseBasicShapePath): Deleted.
2654         (WebCore::isBoxValue): Deleted.
2655         (WebCore::CSSParser::parseBasicShapeAndOrBox): Deleted.
2656         (WebCore::CSSParser::parseShapeProperty): Deleted.
2657         (WebCore::CSSParser::parseClipPath): Deleted.
2658         (WebCore::CSSParser::parseBasicShape): Deleted.
2659         (WebCore::CSSParser::parseFont): Deleted.
2660         (WebCore::CSSParser::parseSystemFont): Deleted.
2661         (WebCore::FontFamilyValueBuilder::FontFamilyValueBuilder): Deleted.
2662         (WebCore::FontFamilyValueBuilder::add): Deleted.
2663         (WebCore::FontFamilyValueBuilder::commit): Deleted.
2664         (WebCore::valueIsCSSKeyword): Deleted.
2665         (WebCore::CSSParser::parseFontFamily): Deleted.
2666         (WebCore::CSSParser::parseLineHeight): Deleted.
2667         (WebCore::CSSParser::parseFontSize): Deleted.
2668         (WebCore::createFontWeightValueKeyword): Deleted.
2669         (WebCore::CSSParser::parseFontWeight): Deleted.
2670         (WebCore::CSSParser::parseFontSynthesis): Deleted.
2671         (WebCore::CSSParser::parseFontFaceSrcURI): Deleted.
2672         (WebCore::CSSParser::parseFontFaceSrcLocal): Deleted.
2673         (WebCore::CSSParser::parseFontFaceSrc): Deleted.
2674         (WebCore::CSSParser::parseFontFaceUnicodeRange): Deleted.
2675         (WebCore::checkForValidDouble): Deleted.
2676         (WebCore::parseDouble): Deleted.
2677         (WebCore::parseColorIntOrPercentage): Deleted.
2678         (WebCore::isTenthAlpha): Deleted.
2679         (WebCore::parseAlphaValue): Deleted.
2680         (WebCore::mightBeRGBA): Deleted.
2681         (WebCore::mightBeRGB): Deleted.
2682         (WebCore::fastParseColorInternal): Deleted.
2683         (WebCore::CSSParser::fastParseColor): Deleted.
2684         (WebCore::CSSParser::parsedDouble): Deleted.
2685         (WebCore::CSSParser::isCalculation): Deleted.
2686         (WebCore::isPercent): Deleted.
2687         (WebCore::CSSParser::parseColorInt): Deleted.
2688         (WebCore::CSSParser::parseColorDouble): Deleted.
2689         (WebCore::CSSParser::parseRGBParameters): Deleted.
2690         (WebCore::CSSParser::parseColorFunctionParameters): Deleted.
2691         (WebCore::CSSParser::parseHSLParameters): Deleted.
2692         (WebCore::CSSParser::parseColorFromValue): Deleted.
2693         (WebCore::ShadowParseContext::ShadowParseContext): Deleted.
2694         (WebCore::ShadowParseContext::allowLength): Deleted.
2695         (WebCore::ShadowParseContext::commitValue): Deleted.
2696         (WebCore::ShadowParseContext::commitLength): Deleted.
2697         (WebCore::ShadowParseContext::commitColor): Deleted.
2698         (WebCore::ShadowParseContext::commitStyle): Deleted.
2699         (WebCore::CSSParser::parseShadow): Deleted.
2700         (WebCore::CSSParser::parseReflect): Deleted.
2701         (WebCore::CSSParser::parseFlex): Deleted.
2702         (WebCore::BorderImageParseContext::BorderImageParseContext): Deleted.
2703         (WebCore::BorderImageParseContext::canAdvance): Deleted.
2704         (WebCore::BorderImageParseContext::setCanAdvance): Deleted.
2705         (WebCore::BorderImageParseContext::allowCommit): Deleted.
2706         (WebCore::BorderImageParseContext::allowImage): Deleted.
2707         (WebCore::BorderImageParseContext::allowImageSlice): Deleted.
2708         (WebCore::BorderImageParseContext::allowRepeat): Deleted.
2709         (WebCore::BorderImageParseContext::allowForwardSlashOperator): Deleted.
2710         (WebCore::BorderImageParseContext::requireWidth): Deleted.
2711         (WebCore::BorderImageParseContext::requireOutset): Deleted.
2712         (WebCore::BorderImageParseContext::commitImage): Deleted.
2713         (WebCore::BorderImageParseContext::commitImageSlice): Deleted.
2714         (WebCore::BorderImageParseContext::commitForwardSlashOperator): Deleted.
2715         (WebCore::BorderImageParseContext::commitBorderWidth): Deleted.
2716         (WebCore::BorderImageParseContext::commitBorderOutset): Deleted.
2717         (WebCore::BorderImageParseContext::commitRepeat): Deleted.
2718         (WebCore::BorderImageParseContext::commitWebKitBorderImage): Deleted.
2719         (WebCore::BorderImageParseContext::commitBorderImage): Deleted.
2720         (WebCore::BorderImageParseContext::commitBorderImageProperty): Deleted.
2721         (WebCore::CSSParser::parseBorderImage): Deleted.
2722         (WebCore::isBorderImageRepeatKeyword): Deleted.
2723         (WebCore::CSSParser::parseBorderImageRepeat): Deleted.
2724         (WebCore::BorderImageSliceParseContext::BorderImageSliceParseContext): Deleted.
2725         (WebCore::BorderImageSliceParseContext::allowNumber): Deleted.
2726         (WebCore::BorderImageSliceParseContext::allowFill): Deleted.
2727         (WebCore::BorderImageSliceParseContext::allowFinalCommit): Deleted.
2728         (WebCore::BorderImageSliceParseContext::top): Deleted.
2729         (WebCore::BorderImageSliceParseContext::commitNumber): Deleted.
2730         (WebCore::BorderImageSliceParseContext::commitFill): Deleted.
2731         (WebCore::BorderImageSliceParseContext::commitBorderImageSlice): Deleted.
2732         (WebCore::CSSParser::parseBorderImageSlice): Deleted.
2733         (WebCore::BorderImageQuadParseContext::BorderImageQuadParseContext): Deleted.
2734         (WebCore::BorderImageQuadParseContext::allowNumber): Deleted.
2735         (WebCore::BorderImageQuadParseContext::allowFinalCommit): Deleted.
2736         (WebCore::BorderImageQuadParseContext::top): Deleted.
2737         (WebCore::BorderImageQuadParseContext::commitNumber): Deleted.
2738         (WebCore::BorderImageQuadParseContext::setAllowFinalCommit): Deleted.
2739         (WebCore::BorderImageQuadParseContext::setTop): Deleted.
2740         (WebCore::BorderImageQuadParseContext::commitBorderImageQuad): Deleted.
2741         (WebCore::CSSParser::parseBorderImageQuad): Deleted.
2742         (WebCore::CSSParser::parseBorderImageWidth): Deleted.
2743         (WebCore::CSSParser::parseBorderImageOutset): Deleted.
2744         (WebCore::CSSParser::parseBorderRadius): Deleted.
2745         (WebCore::CSSParser::parseAspectRatio): Deleted.
2746         (WebCore::CSSParser::parseCounter): Deleted.
2747         (WebCore::parseDeprecatedGradientPoint): Deleted.
2748         (WebCore::parseDeprecatedGradientColorStop): Deleted.
2749         (WebCore::CSSParser::parseDeprecatedGradient): Deleted.
2750         (WebCore::valueFromSideKeyword): Deleted.
2751         (WebCore::parseGradientColorOrKeyword): Deleted.
2752         (WebCore::CSSParser::parseDeprecatedLinearGradient): Deleted.
2753         (WebCore::CSSParser::parseDeprecatedRadialGradient): Deleted.
2754         (WebCore::CSSParser::parseLinearGradient): Deleted.
2755         (WebCore::CSSParser::parseRadialGradient): Deleted.
2756         (WebCore::CSSParser::parseGradientColorStops): Deleted.
2757         (WebCore::CSSParser::isGeneratedImageValue): Deleted.
2758         (WebCore::CSSParser::parseGeneratedImage): Deleted.
2759         (WebCore::CSSParser::parseFilterImage): Deleted.
2760         (WebCore::CSSParser::parseCrossfade): Deleted.
2761         (WebCore::CSSParser::parseCanvas): Deleted.
2762         (WebCore::CSSParser::parseNamedImage): Deleted.
2763         (WebCore::CSSParser::parseImageResolution): Deleted.
2764         (WebCore::CSSParser::parseImageSet): Deleted.
2765         (WebCore::TransformOperationInfo::TransformOperationInfo): Deleted.
2766         (WebCore::TransformOperationInfo::type): Deleted.
2767         (WebCore::TransformOperationInfo::argCount): Deleted.
2768         (WebCore::TransformOperationInfo::unit): Deleted.
2769         (WebCore::TransformOperationInfo::unknown): Deleted.
2770         (WebCore::TransformOperationInfo::hasCorrectArgCount): Deleted.
2771         (WebCore::CSSParser::parseTransform): Deleted.
2772         (WebCore::CSSParser::parseTransformValue): Deleted.
2773         (WebCore::CSSParser::isBlendMode): Deleted.
2774         (WebCore::CSSParser::isCompositeOperator): Deleted.
2775         (WebCore::isValidPrimitiveFilterFunction): Deleted.
2776         (WebCore::CSSParser::parseBuiltinFilterArguments): Deleted.
2777         (WebCore::cssValueKeywordIDForFunctionName): Deleted.
2778         (WebCore::CSSParser::parseFilter): Deleted.
2779         (WebCore::validFlowName): Deleted.
2780         (WebCore::CSSParser::isTextAutosizingEnabled): Deleted.
2781         (WebCore::CSSParser::isCSSGridLayoutEnabled): Deleted.
2782         (WebCore::CSSParser::parseFlowThread): Deleted.
2783         (WebCore::CSSParser::parseRegionThread): Deleted.
2784         (WebCore::CSSParser::parseTransformOrigin): Deleted.
2785         (WebCore::CSSParser::parsePerspectiveOrigin): Deleted.
2786         (WebCore::CSSParser::addTextDecorationProperty): Deleted.
2787         (WebCore::CSSParser::parseTextDecoration): Deleted.
2788         (WebCore::CSSParser::parseTextDecorationSkip): Deleted.
2789         (WebCore::CSSParser::parseTextUnderlinePosition): Deleted.
2790         (WebCore::CSSParser::parseTextEmphasisStyle): Deleted.
2791         (WebCore::CSSParser::parseTextEmphasisPosition): Deleted.
2792         (WebCore::CSSParser::parseTextIndent): Deleted.
2793         (WebCore::CSSParser::parseHangingPunctuation): Deleted.
2794         (WebCore::CSSParser::parseLineBoxContain): Deleted.
2795         (WebCore::CSSParser::parseFontFeatureTag): Deleted.
2796         (WebCore::CSSParser::parseFontFeatureSettings): Deleted.
2797         (WebCore::CSSParser::parseFontVariationTag): Deleted.
2798         (WebCore::CSSParser::parseFontVariationSettings): Deleted.
2799         (WebCore::CSSParser::parseFontVariantLigatures): Deleted.
2800         (WebCore::CSSParser::parseFontVariantNumeric): Deleted.
2801         (WebCore::CSSParser::parseFontVariantEastAsian): Deleted.
2802         (WebCore::CSSParser::parseFontVariant): Deleted.
2803         (WebCore::isValidWillChangeAnimatableFeature): Deleted.
2804         (WebCore::CSSParser::parseWillChange): Deleted.
2805         (WebCore::CSSParser::parseCalculation): Deleted.
2806         (WebCore::isCSSLetter): Deleted.
2807         (WebCore::isCSSEscape): Deleted.
2808         (WebCore::isURILetter): Deleted.
2809         (WebCore::isIdentifierStartAfterDash): Deleted.
2810         (WebCore::isCustomPropertyIdentifier): Deleted.
2811         (WebCore::isEqualToCSSIdentifier): Deleted.
2812         (WebCore::isEqualToCSSCaseSensitiveIdentifier): Deleted.
2813         (WebCore::checkAndSkipEscape): Deleted.
2814         (WebCore::skipWhiteSpace): Deleted.
2815         (WebCore::CSSParserString::characters<LChar>): Deleted.
2816         (WebCore::CSSParserString::characters<UChar>): Deleted.
2817         (WebCore::CSSParser::currentCharacter<LChar>): Deleted.
2818         (WebCore::CSSParser::currentCharacter<UChar>): Deleted.
2819         (WebCore::CSSParser::currentCharacter16): Deleted.
2820         (WebCore::CSSParser::tokenStart<LChar>): Deleted.
2821         (WebCore::CSSParser::tokenStart<UChar>): Deleted.
2822         (WebCore::CSSParser::currentLocation): Deleted.
2823         (WebCore::CSSParser::isIdentifierStart): Deleted.
2824         (WebCore::checkAndSkipString): Deleted.
2825         (WebCore::CSSParser::parseEscape): Deleted.
2826         (WebCore::CSSParser::UnicodeToChars<LChar>): Deleted.
2827         (WebCore::CSSParser::UnicodeToChars<UChar>): Deleted.
2828         (WebCore::CSSParser::parseIdentifierInternal): Deleted.
2829         (WebCore::CSSParser::parseIdentifier): Deleted.
2830         (WebCore::CSSParser::parseStringInternal): Deleted.
2831         (WebCore::CSSParser::parseString): Deleted.
2832         (WebCore::CSSParser::findURI): Deleted.
2833         (WebCore::CSSParser::parseURIInternal): Deleted.
2834         (WebCore::CSSParser::parseURI): Deleted.
2835         (WebCore::CSSParser::parseUnicodeRange): Deleted.
2836         (WebCore::CSSParser::parseNthChild): Deleted.
2837         (WebCore::CSSParser::parseNthChildExtra): Deleted.
2838         (WebCore::CSSParser::detectFunctionTypeToken): Deleted.
2839         (WebCore::CSSParser::detectMediaQueryToken): Deleted.
2840         (WebCore::CSSParser::detectNumberToken): Deleted.
2841         (WebCore::CSSParser::detectDashToken): Deleted.
2842         (WebCore::CSSParser::detectAtToken): Deleted.
2843         (WebCore::CSSParser::detectSupportsToken): Deleted.
2844         (WebCore::CSSParser::realLex): Deleted.
2845         (WebCore::CSSParser::createImportRule): Deleted.
2846         (WebCore::CSSParser::createMediaRule): Deleted.
2847         (WebCore::CSSParser::createEmptyMediaRule): Deleted.
2848         (WebCore::CSSParser::createSupportsRule): Deleted.
2849         (WebCore::CSSParser::markSupportsRuleHeaderStart): Deleted.
2850         (WebCore::CSSParser::markSupportsRuleHeaderEnd): Deleted.
2851         (WebCore::CSSParser::popSupportsRuleData): Deleted.
2852         (WebCore::CSSParser::processAndAddNewRuleToSourceTreeIfNeeded): Deleted.
2853         (WebCore::CSSParser::addNewRuleToSourceTree): Deleted.
2854         (WebCore::CSSParser::popRuleData): Deleted.
2855         (WebCore::CSSParser::syntaxError): Deleted.
2856         (WebCore::CSSParser::isLoggingErrors): Deleted.
2857         (WebCore::CSSParser::logError): Deleted.
2858         (WebCore::CSSParser::createKeyframesRule): Deleted.
2859         (WebCore::CSSParser::createStyleRule): Deleted.
2860         (WebCore::CSSParser::createFontFaceRule): Deleted.
2861         (WebCore::CSSParser::addNamespace): Deleted.
2862         (WebCore::CSSParser::determineNameInNamespace): Deleted.
2863         (WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded): Deleted.
2864         (WebCore::CSSParser::rewriteSpecifiersWithElementName): Deleted.
2865         (WebCore::CSSParser::rewriteSpecifiers): Deleted.
2866         (WebCore::CSSParser::createPageRule): Deleted.
2867         (WebCore::CSSParser::createSelectorVector): Deleted.
2868         (WebCore::CSSParser::recycleSelectorVector): Deleted.
2869         (WebCore::CSSParser::createRegionRule): Deleted.
2870         (WebCore::CSSParser::createMarginAtRule): Deleted.
2871         (WebCore::CSSParser::startDeclarationsForMarginBox): Deleted.
2872         (WebCore::CSSParser::endDeclarationsForMarginBox): Deleted.
2873         (WebCore::CSSParser::createKeyframe): Deleted.
2874         (WebCore::CSSParser::invalidBlockHit): Deleted.
2875         (WebCore::CSSParser::updateLastMediaLine): Deleted.
2876         (WebCore::fixUnparsedProperties): Deleted.
2877         (WebCore::CSSParser::fixUnparsedPropertyRanges): Deleted.
2878         (WebCore::CSSParser::markRuleHeaderStart): Deleted.
2879         (WebCore::CSSParser::setRuleHeaderEnd): Deleted.
2880         (WebCore::CSSParser::markRuleHeaderEnd): Deleted.
2881         (WebCore::CSSParser::markSelectorStart): Deleted.
2882         (WebCore::CSSParser::markSelectorEnd): Deleted.
2883         (WebCore::CSSParser::markRuleBodyStart): Deleted.
2884         (WebCore::CSSParser::markRuleBodyEnd): Deleted.
2885         (WebCore::CSSParser::markPropertyStart): Deleted.
2886         (WebCore::CSSParser::markPropertyEnd): Deleted.
2887         (WebCore::CSSParser::createViewportRule): Deleted.
2888         (WebCore::CSSParser::parseViewportProperty): Deleted.
2889         (WebCore::CSSParser::parseViewportShorthand): Deleted.
2890         (WebCore::isAppleLegacyCSSPropertyKeyword): Deleted.
2891         (WebCore::cssPropertyID): Deleted.
2892         (WebCore::cssPropertyNameIOSAliasing): Deleted.
2893         (WebCore::isAppleLegacyCSSValueKeyword): Deleted.
2894         (WebCore::cssValueKeywordID): Deleted.
2895         (WebCore::isValidNthToken): Deleted.
2896         * css/parser/CSSParser.h:
2897         (): Deleted.
2898         (WebCore::CSSParser::ValueWithCalculation::ValueWithCalculation): Deleted.
2899         (WebCore::CSSParser::ValueWithCalculation::value): Deleted.
2900         (WebCore::CSSParser::ValueWithCalculation::operator CSSParserValue&): Deleted.
2901         (WebCore::CSSParser::ValueWithCalculation::calculation): Deleted.
2902         (WebCore::CSSParser::ValueWithCalculation::setCalculation): Deleted.
2903         (WebCore::CSSParser::hasProperties): Deleted.
2904         (WebCore::CSSParser::startNestedSelectorList): Deleted.
2905         (WebCore::CSSParser::endNestedSelectorList): Deleted.
2906         (WebCore::CSSParser::resetPropertyRange): Deleted.
2907         (WebCore::CSSParser::isExtractingSourceData): Deleted.
2908         (WebCore::CSSParser::lex): Deleted.
2909         (WebCore::CSSParser::token): Deleted.
2910         (WebCore::CSSParser::markViewportRuleBodyStart): Deleted.
2911         (WebCore::CSSParser::markViewportRuleBodyEnd): Deleted.
2912         (WebCore::CSSParser::setCustomPropertyName): Deleted.
2913         (WebCore::CSSParser::is8BitSource): Deleted.
2914         (WebCore::CSSParser::setStyleSheet): Deleted.
2915         (WebCore::CSSParser::inStrictMode): Deleted.
2916         (WebCore::CSSParser::inQuirksMode): Deleted.
2917         (WebCore::CSSParser::setupParser): Deleted.
2918         (WebCore::CSSParser::inShorthand): Deleted.
2919         (WebCore::CSSParser::inViewport): Deleted.
2920         (WebCore::CSSParser::operator|): Deleted.
2921         (WebCore::CSSParser::validateUnit): Deleted.
2922         (WebCore::ShorthandScope::ShorthandScope): Deleted.
2923         (WebCore::ShorthandScope::~ShorthandScope): Deleted.
2924         (WebCore::CSSParser::setTokenStart<LChar>): Deleted.
2925         (WebCore::CSSParser::setTokenStart<UChar>): Deleted.
2926         (WebCore::CSSParser::tokenStartOffset): Deleted.
2927         (WebCore::CSSParser::currentCharacterOffset): Deleted.
2928         (WebCore::CSSParser::tokenStartChar): Deleted.
2929         (WebCore::isCustomPropertyName): Deleted.
2930         (WebCore::cssyylex): Deleted.
2931         * css/parser/CSSParserFastPaths.cpp:
2932         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2933         * css/parser/CSSParserMode.h:
2934         (WebCore::CSSParserContextHash::hash):
2935         * css/parser/CSSParserValues.cpp:
2936         (WebCore::CSSParserSelector::setSelectorList):
2937         (WebCore::destroy): Deleted.
2938         (WebCore::CSSParserValueList::~CSSParserValueList): Deleted.
2939         (WebCore::CSSParserValueList::addValue): Deleted.
2940         (WebCore::CSSParserValueList::insertValueAt): Deleted.
2941         (WebCore::CSSParserValueList::extend): Deleted.
2942         (WebCore::CSSParserValueList::containsVariables): Deleted.
2943         (WebCore::CSSParserValue::createCSSValue): Deleted.
2944         (WebCore::CSSParserSelector::parsePseudoElementSelector): Deleted.
2945         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector): Deleted.
2946         (WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector): Deleted.
2947         (WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector): Deleted.
2948         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector): Deleted.
2949         (WebCore::CSSParserSelector::setPseudoClassValue): Deleted.
2950         * css/parser/CSSParserValues.h:
2951         (WebCore::CSSParserString::init): Deleted.
2952         (WebCore::CSSParserString::clear): Deleted.
2953         (WebCore::CSSParserString::is8Bit): Deleted.
2954         (WebCore::CSSParserString::characters8): Deleted.
2955         (WebCore::CSSParserString::characters16): Deleted.
2956         (WebCore::CSSParserString::length): Deleted.
2957         (WebCore::CSSParserString::setLength): Deleted.
2958         (WebCore::CSSParserString::operator[]): Deleted.
2959         (WebCore::CSSParserString::operator String): Deleted.
2960         (WebCore::CSSParserString::operator AtomicString): Deleted.
2961         (WebCore::CSSParserString::toStringView): Deleted.
2962         (): Deleted.
2963         (WebCore::CSSParserValueList::CSSParserValueList): Deleted.
2964         (WebCore::CSSParserValueList::size): Deleted.
2965         (WebCore::CSSParserValueList::currentIndex): Deleted.
2966         (WebCore::CSSParserValueList::current): Deleted.
2967         (WebCore::CSSParserValueList::next): Deleted.
2968         (WebCore::CSSParserValueList::previous): Deleted.
2969         (WebCore::CSSParserValueList::setCurrentIndex): Deleted.
2970         (WebCore::CSSParserValueList::valueAt): Deleted.
2971         (WebCore::CSSParserValueList::clear): Deleted.
2972         (WebCore::CSSParserValue::setFromValueList): Deleted.
2973         (WebCore::equalLettersIgnoringASCIICase): Deleted.
2974         * css/parser/CSSPropertyParser.cpp:
2975         (WebCore::isCustomPropertyName):
2976         (WebCore::cssPropertyNameIOSAliasing):
2977         * css/parser/CSSPropertyParser.h:
2978         * css/parser/SVGCSSParser.cpp: Removed.
2979         * dom/InlineStyleSheetOwner.cpp:
2980         (WebCore::InlineStyleSheetOwner::createSheet):
2981         * inspector/InspectorStyleSheet.cpp:
2982         (WebCore::InspectorStyleSheet::ensureSourceData):
2983         (WebCore::InspectorStyleSheetForInlineStyle::ruleSourceData):
2984         * page/animation/AnimationController.cpp:
2985         * rendering/style/RenderStyle.cpp:
2986         * svg/SVGAnimateElementBase.cpp:
2987         * svg/SVGAnimationElement.cpp:
2988         * svg/SVGElement.cpp:
2989
2990 2016-12-10  Konstantin Tokarev  <annulen@yandex.ru>
2991
2992         [cmake] Include WTF, JSC, and WebCore headers automatically to targers using them
2993         https://bugs.webkit.org/show_bug.cgi?id=165686
2994
2995         Reviewed by Michael Catanzaro.
2996
2997         This change reduces duplication of include path lists between modules,
2998         and reduces future need for fixes like r209605 (broken build because of
2999         WebCore header suddenly becoming used in WebKit2).
3000
3001         No new tests needed.
3002
3003         * CMakeLists.txt:
3004         * PlatformEfl.cmake:
3005         * PlatformGTK.cmake:
3006         * PlatformMac.cmake:
3007         * PlatformWinCairo.cmake:
3008
3009 2016-12-10  Ryosuke Niwa  <rniwa@webkit.org>
3010
3011         Replace isUnclosedNode by isClosedShadowHidden
3012         https://bugs.webkit.org/show_bug.cgi?id=165722
3013
3014         Reviewed by Antti Koivisto.
3015
3016         Replaced Node::isUnclosedNode by Node::isClosedShadowHidden and negated the semantics as done in the spec:
3017         https://dom.spec.whatwg.org/#concept-closed-shadow-hidden
3018         https://github.com/whatwg/dom/pull/306
3019
3020         Also added a version which follows the spec text for a debug assertion.
3021
3022         No new tests since this has no behavioral change.
3023
3024         * dom/EventContext.h:
3025         (WebCore::EventContext::isUnreachableNode):
3026         * dom/EventPath.cpp:
3027         (WebCore::EventPath::computePathUnclosedToTarget):
3028         (WebCore::RelatedNodeRetargeter::checkConsistency):
3029         * dom/Node.cpp:
3030         (WebCore::isClosedShadowHiddenUsingSpecDefinition): Added to assert our implementation matches the spec text.
3031         (WebCore::Node::isClosedShadowHidden): Renamed from Node::isUnclosedNode and negated the return value.
3032         * dom/Node.h:
3033
3034 2016-12-10  Antti Koivisto  <antti@apple.com>
3035
3036         CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: WTF::match_constness<WebCore::CSSValue, WebCore::CSSContentDistributionValue>::type& WTF::downcast<WebCore::CSSContentDistributionValue, WebCore::CSSValue> + 65
3037         https://bugs.webkit.org/show_bug.cgi?id=165652
3038         rdar://problem/28465278
3039
3040         Reviewed by Darin Adler.
3041
3042         No, test don't know how to get here.
3043
3044         * css/StyleBuilderConverter.h:
3045         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
3046
3047         Add type checks.
3048
3049 2016-12-10  Jiewen Tan  <jiewen_tan@apple.com>
3050
3051         [WebCrypto] RSA algorithms should allow importing keys without usages
3052         https://bugs.webkit.org/show_bug.cgi?id=165680
3053         <rdar://problem/29601354>
3054
3055         Reviewed by Brent Fulgham.
3056
3057         Tests: crypto/subtle/rsa-oaep-import-jwk-public-key-empty-usages.html
3058                crypto/subtle/rsa-oaep-import-spki-key-empty-usages.html
3059                crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-empty-usages.html
3060                crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key-empty-usages.html
3061                crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-empty-usages.html
3062                crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key-empty-usages.html
3063
3064         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
3065         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
3066         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
3067         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
3068         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
3069         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
3070
3071 2016-12-10  Frederic Wang  <fred.wang@free.fr>
3072
3073         Add STIX Two Math to the list of math fonts in mathml.css
3074         https://bugs.webkit.org/show_bug.cgi?id=165676
3075
3076         Reviewed by Darin Adler.
3077
3078         No new tests, this is just changing default style.
3079
3080         * css/mathml.css:
3081         (math):
3082
3083 2016-12-09  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3084
3085         [Readable Streams API] Implement ReadableByteStreamController desiredSize
3086         https://bugs.webkit.org/show_bug.cgi?id=165599
3087
3088         Reviewed by Darin Adler.
3089
3090         Implemented ReadableByteStreamController attribute desiredSize.
3091
3092         Added test to check desiredSize value.
3093
3094         * Modules/streams/ReadableByteStreamController.js:
3095         (desiredSize):
3096         * Modules/streams/ReadableByteStreamInternals.js:
3097         (readableByteStreamControllerGetDesiredSize):
3098
3099 2016-12-09  Ryosuke Niwa  <rniwa@webkit.org>
3100
3101         document.pointerLockElement exposes a node inside a shadow tree
3102         https://bugs.webkit.org/show_bug.cgi?id=165702
3103
3104         Reviewed by Simon Fraser.
3105
3106         Expose pointerLockElement on ShadowRoot as spec'ed (DocumentOrShadowRoot):
3107         https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin
3108
3109         Use ancestorElementInThisScope to find the correct node in pointerLockElement.
3110
3111         Tests: fast/shadow-dom/pointerlockelement-in-shadow-tree.html
3112                fast/shadow-dom/pointerlockelement-in-slot.html
3113
3114         * dom/Document.cpp:
3115         (WebCore::Document::pointerLockElement): Moved to TreeScope.
3116         * dom/Document.h:
3117         * dom/Document.idl: Moved ointerLockElement to DocumentOrShadowRoot.idl.
3118         * dom/DocumentOrShadowRoot.idl: Ditto.
3119         * dom/TreeScope.cpp:
3120         (WebCore::TreeScope::focusedElementInScope): Use documentScope instead of acessing it via m_rootNode.
3121         (WebCore::TreeScope::pointerLockElement): Moved from Document.
3122         * dom/TreeScope.h:
3123
3124 2016-12-09  Daniel Bates  <dabates@apple.com>
3125
3126         Add reflected nonce attribute to HTML Link element IDL
3127         https://bugs.webkit.org/show_bug.cgi?id=165709
3128
3129         Reviewed by Ryosuke Niwa.
3130
3131         Add the reflected nonce attribute to the HTML Link element IDL definition
3132         as per the HTML standard <https://html.spec.whatwg.org/multipage/semantics.html#the-link-element> (9 December 2016).
3133
3134         Test: fast/dom/nonce-attribute-reflection.html
3135
3136         * html/HTMLLinkElement.idl:
3137
3138 2016-12-09  Eric Carlson  <eric.carlson@apple.com>
3139
3140         Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
3141         https://bugs.webkit.org/show_bug.cgi?id=165251
3142
3143         Reviewed by Dean Jackson.
3144
3145         Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
3146         No new tests, covered by existing tests.
3147
3148         * Modules/mediastream/MediaStreamEvent.idl: Add "EnabledAtRuntime".
3149         * Modules/mediastream/NavigatorMediaDevices.idl: Ditto.
3150         * Modules/mediastream/NavigatorUserMedia.idl: Ditto.
3151         * Modules/mediastream/RTCDTMFToneChangeEvent.idl: Ditto.
3152         * Modules/mediastream/RTCIceCandidate.idl: Ditto.
3153         * Modules/mediastream/RTCPeerConnection.idl: Ditto.
3154         * Modules/mediastream/RTCRtpReceiver.idl: Ditto.
3155         * Modules/mediastream/RTCRtpSender.idl: Ditto.
3156         * Modules/mediastream/RTCRtpTransceiver.idl: Ditto.
3157         * Modules/mediastream/RTCSessionDescription.idl: Ditto.
3158         * Modules/mediastream/RTCTrackEvent.idl: Ditto.
3159
3160         * bindings/generic/RuntimeEnabledFeatures.cpp:
3161         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): Set m_isMediaStreamEnabled in the
3162           constructor instead of in reset() because the later is called by the Internals constructor,
3163           making it impossible to override the runtime flag from WTR or DRT.
3164         (WebCore::RuntimeEnabledFeatures::reset): Don't set m_isMediaStreamEnabled.
3165         * page/Settings.in: Add peerConnectionEnabled.
3166
3167 2016-12-09  Daniel Bates  <dabates@apple.com>
3168
3169         Remove QuickLook scheme from the list of secure schemes
3170         https://bugs.webkit.org/show_bug.cgi?id=165699
3171
3172         Reviewed by Andy Estes.
3173
3174         Following r207155 we use a unique origin for QuickLook documents. Unique origins are not
3175         subject to mixed content restrictions. Prior to r207155 QuickLook documents used the
3176         origin from which they were served. We added the QuickLook scheme to the list of secure
3177         schemes as a workaround to avoid mixed content errors when loading subresources in a
3178         QuickLook document served over HTTPS. Now that we use a unique origin for QuickLook
3179         documents we no longer need this workaround.
3180
3181         * platform/SchemeRegistry.cpp:
3182         (WebCore::secureSchemes):
3183
3184 2016-12-09  Brady Eidson  <beidson@apple.com>
3185
3186         Re-landing:
3187         Add _WKIconLoadingDelegate SPI.
3188         https://bugs.webkit.org/show_bug.cgi?id=164894
3189
3190         Reviewed by Alex Christensen.
3191
3192         No new tests (Manual testing possible in MiniBrowser now, WKTR tests coming soon in https://bugs.webkit.org/show_bug.cgi?id=164895).
3193
3194         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
3195
3196         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
3197
3198         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
3199
3200         * WebCore.xcodeproj/project.pbxproj:
3201
3202         * dom/Document.cpp:
3203         (WebCore::Document::implicitClose):
3204
3205         * html/LinkIconCollector.cpp:
3206         (WebCore::iconSize):
3207         (WebCore::compareIcons):
3208         * html/LinkIconCollector.h:
3209
3210         * loader/DocumentLoader.cpp:
3211         (WebCore::DocumentLoader::startIconLoading):
3212         (WebCore::DocumentLoader::didGetLoadDecisionForIcon):
3213         (WebCore::DocumentLoader::finishedLoadingIcon):
3214         * loader/DocumentLoader.h:
3215
3216         * loader/FrameLoaderClient.h:
3217
3218         * loader/icon/IconLoader.cpp:
3219         (WebCore::IconLoader::IconLoader):
3220         (WebCore::IconLoader::startLoading):
3221         (WebCore::IconLoader::notifyFinished):
3222         * loader/icon/IconLoader.h:
3223
3224         * platform/LinkIcon.h: Copied from Source/WebCore/html/LinkIconCollector.h.
3225         (WebCore::LinkIcon::encode):
3226         (WebCore::LinkIcon::decode):
3227
3228 2016-12-06  Jiewen Tan  <jiewen_tan@apple.com>
3229
3230         [Part 2 of 2] Add support for PKCS8 format while doing SubtleCrypto.importKey/exportKey
3231         https://bugs.webkit.org/show_bug.cgi?id=129978
3232         <rdar://problem/21799829>
3233
3234         Reviewed by Brent Fulgham.
3235
3236         This is part 2 of Bug 129978. In this patch, it adds the PKCS8 format support for
3237         SubtleCrypto.importKey/exportKey. Currently support algorithms are RSAES-PKCS1-v1_5,
3238         RSASSA-PKCS1-v1_5 and RSA-OAEP.
3239
3240         Tests: crypto/subtle/rsa-import-jwk-key-export-pkcs8-key.html
3241                crypto/subtle/rsa-import-pkcs8-key-export-jwk-key.html
3242                crypto/subtle/rsa-import-pkcs8-key-export-pkcs8-key.html
3243                crypto/subtle/rsa-oaep-generate-export-key-pkcs8.html
3244                crypto/subtle/rsa-oaep-import-pkcs8-key.html
3245                crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-pkcs8.html
3246                crypto/subtle/rsaes-pkcs1-v1_5-import-pkcs8-key.html
3247                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-pkcs8.html
3248                crypto/subtle/rsassa-pkcs1-v1_5-import-pkcs8-key.html
3249                crypto/workers/subtle/rsa-export-pkcs8-key.html
3250                crypto/workers/subtle/rsa-import-pkcs8-key.html
3251
3252         * bindings/js/JSSubtleCryptoCustom.cpp:
3253         (WebCore::toKeyData):
3254         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
3255         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
3256         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
3257         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
3258         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
3259         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
3260         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
3261         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
3262         (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
3263         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
3264         (WebCore::CryptoKeyRSA::importPkcs8):
3265         (WebCore::CryptoKeyRSA::exportPkcs8):
3266         * crypto/keys/CryptoKeyRSA.h:
3267         * crypto/mac/CryptoKeyRSAMac.cpp:
3268         (WebCore::CryptoKeyRSA::importSpki):
3269         (WebCore::CryptoKeyRSA::importPkcs8):
3270         (WebCore::CryptoKeyRSA::exportPkcs8):
3271
3272 2016-12-09  Geoffrey Garen  <ggaren@apple.com>
3273
3274         Deploy OrdinalNumber in JSC::SourceCode
3275         https://bugs.webkit.org/show_bug.cgi?id=165687
3276
3277         Reviewed by Michael Saboff.
3278
3279         Updated for interface changes.
3280
3281         * bindings/js/ScriptController.cpp:
3282         (WebCore::ScriptController::evaluateModule):
3283         * bindings/js/ScriptSourceCode.h:
3284         (WebCore::ScriptSourceCode::startLine):
3285
3286 2016-12-09  Joseph Pecoraro  <pecoraro@apple.com>
3287
3288         Web Inspector: Some resources fetched via Fetch API do not have data
3289         https://bugs.webkit.org/show_bug.cgi?id=165230
3290         <rdar://problem/29449220>
3291
3292         Reviewed by Alex Christensen.
3293
3294         Tests: http/tests/inspector/network/fetch-response-body.html
3295                http/tests/inspector/network/xhr-response-body.html
3296
3297         * platform/network/ResourceRequestBase.h:
3298         Distinguish Fetch requests.
3299
3300         * Modules/fetch/FetchRequest.cpp:
3301         (WebCore::FetchRequest::initializeWith):
3302         Set the requester type as Fetch.
3303
3304         * loader/DocumentThreadableLoader.cpp:
3305         (WebCore::DocumentThreadableLoader::didReceiveResponse):
3306         * loader/DocumentThreadableLoader.h:
3307         * inspector/InspectorInstrumentation.cpp:
3308         (WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponseImpl):
3309         (WebCore::InspectorInstrumentation::didReceiveXHRResponseImpl): Deleted.
3310         * inspector/InspectorInstrumentation.h:
3311         (WebCore::InspectorInstrumentation::didReceiveResourceResponse):
3312         (WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponse):
3313         (WebCore::InspectorInstrumentation::didReceiveXHRResponse): Deleted.
3314         * inspector/InspectorNetworkAgent.cpp:
3315         (WebCore::InspectorNetworkAgent::didReceiveThreadableLoaderResponse):
3316         (WebCore::InspectorNetworkAgent::didFinishXHRLoading):
3317         (WebCore::InspectorNetworkAgent::didReceiveXHRResponse): Deleted.
3318         Add a generic way for a ThreadableLoader load to update the type of a network request.
3319         This will include both XHR and Fetch requests.
3320
3321         * inspector/InspectorPageAgent.cpp:
3322         (WebCore::hasTextContent):
3323         (WebCore::createXHRTextDecoder):
3324         (WebCore::InspectorPageAgent::resourceTypeJson):
3325         (WebCore::InspectorPageAgent::cachedResourceType):
3326         (WebCore::InspectorPageAgent::createTextDecoder):
3327         (WebCore::textContentForCachedResource):
3328         * inspector/InspectorPageAgent.h:
3329         * inspector/NetworkResourcesData.cpp:
3330         (WebCore::createOtherResourceTextDecoder): Deleted.
3331         Share the logic that creates a Text Decoders for XHR with other non-buffered requests
3332         (like Fetch). This moves us to identical behavior for now.
3333
3334         * platform/MIMETypeRegistry.cpp:
3335         (WebCore::MIMETypeRegistry::isSupportedJSONMIMEType):
3336         (WebCore::MIMETypeRegistry::isTextMIMEType):
3337         * platform/MIMETypeRegistry.h:
3338         Better detect different JSON content based on MIME Type.
3339
3340 2016-12-09  Ryosuke Niwa  <rniwa@webkit.org>
3341
3342         document.webkitFullscreenElement leaks elements inside a shadow tree
3343         https://bugs.webkit.org/show_bug.cgi?id=158471
3344
3345         Reviewed by Chris Dumez.
3346
3347         Fixed the bug by calling the newly added ancestorElementInThisScope in webkitCurrentFullScreenElementForBindings
3348         and webkitFullscreenElementForBinding.
3349
3350         The specification (https://fullscreen.spec.whatwg.org/#dom-document-fullscreenelement) uses "the result of
3351         retargeting fullscreen element" and returns null if the result is not in the same tree as the context object.
3352
3353         This is equivalent to the algorithm implemented by ancestorElementInThisScope. Observe that the retargeting
3354         algorithm (https://dom.spec.whatwg.org/#retarget) finds the lowest common tree scope of the retargetee and
3355         the context object. There are two cases to consider.
3356
3357         1. The context object's tree scope is the lowest common tree scope: In this case, an ancestor shadow host or
3358         the retargetee itself is in this tree scope. It's sufficient traverse every shadow host to find the one that
3359         resides in the same tree scope as the context object. This is precisely what ancestorElementInThisScope does.
3360
3361         2. The context object's tree scope is not the lowest common tree scope: In this case, the context object is
3362         inside a shadow tree whose ancestor shadow host is in the lowest common tree scope. In this case, retargeting
3363         algorithm finds a node which is not in the same tree as the context object. Thus, the result is null.
3364         ancestorElementInThisScope traveres ancestor shadow hosts and returns null if no shadow host's tree scope
3365         matches that of the context object's tree scope. Thus, it would return null in this case as desired.
3366
3367         Also renamed TreeScope::focusedElement to focusedElementInScope for clarity since Document which inherits
3368         from TreeScope also has a distinct member function named focusedElement called by TreeScope::focusedElement,
3369         and used ancestorElementInThisScope since it uses the same algorithm.
3370
3371         Tests: fast/shadow-dom/activeElement-for-focused-element-in-another-shadow.html
3372                fast/shadow-dom/blur-on-shadow-host-with-focused-shadow-content.html
3373                fast/shadow-dom/fullscreen-in-shadow-fullscreenElement.html
3374                fast/shadow-dom/fullscreen-in-shadow-webkitCurrentFullScreenElement.html
3375                fast/shadow-dom/fullscreen-in-slot-fullscreenElement.html
3376                fast/shadow-dom/fullscreen-in-slot-webkitCurrentFullScreenElement.html
3377
3378         * dom/Document.cpp:
3379         (WebCore::Document::removeFocusedNodeOfSubtree):
3380         (WebCore::Document::activeElement):
3381         * dom/Document.h:
3382         (WebCore::Document::webkitCurrentFullScreenElementForBindings): Added.
3383         (WebCore::Document::webkitFullscreenElementForBindings): Added.
3384         * dom/Document.idl:
3385         * dom/Element.cpp:
3386         (WebCore::Element::blur):
3387         * dom/ShadowRoot.h:
3388         (WebCore::ShadowRoot::activeElement):
3389         * dom/TreeScope.cpp:
3390         (WebCore::TreeScope::ancestorNodeInThisScope): Renamed from ancestorInThisScope for clarity.
3391         (WebCore::TreeScope::ancestorElementInThisScope):
3392         (WebCore::TreeScope::focusedElementInScope): Renamed from focusedElement to disambiguate it from Document's
3393         focusedElement.
3394         * dom/TreeScope.h:
3395         * editing/VisibleSelection.cpp:
3396         (WebCore::adjustPositionForEnd):
3397         (WebCore::adjustPositionForStart):
3398         * editing/htmlediting.cpp:
3399         (WebCore::comparePositions):