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