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