[MediaStream] Protect MediaDevicesRequest during callback
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-12-11  Eric Carlson  <eric.carlson@apple.com>
2
3         [MediaStream] Protect MediaDevicesRequest during callback
4         https://bugs.webkit.org/show_bug.cgi?id=165711
5         <rdar://problem/28400468>
6
7         Reviewed by Sam Weinig.
8
9         No new tests, I was unable to create a reproducible test but this fix avoids
10         an occasional crash in existing tests.
11
12         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
13         (WebCore::MediaDevicesEnumerationRequest::start): Take a reference to the object
14         before calling the controller in case the completion handler is called synchronously.
15
16 2016-12-09  Filip Pizlo  <fpizlo@apple.com>
17
18         The DOM should have an advancing wavefront opaque root barrier
19         https://bugs.webkit.org/show_bug.cgi?id=165712
20
21         Reviewed by Yusuke Suzuki.
22
23         No new tests because this was covered by crashing tests.
24         
25         Consider these two cases:
26         
27            Removal:
28            1) DOM at start: D->X->Y
29            2) Mark X, X->visitChildren, addOpaqueRoot(D)
30            3) remove X
31            4) Y thinks it's not reachable (its opaque root, X, is not in the set).
32            
33            Insertion:
34            1) DOM at start: D, X->Y
35            2) Mark X, X->visitChildren, addOpaqueRoot(X)
36            3) insert X into D
37            4) Y thinks it's not reachable (its opaque root, D, is not in the set).
38         
39         We can fix this with two barriers:
40         
41            Removal: add X (the removed child) to the opaque root set.
42            Insertion: add D (the insertion point) to the opaque root set.
43         
44         Thanks Rysosuke for coming up with this idea!
45         
46         Both barriers advance the wavefront. We could consider retreating wavefront barriers in
47         the future (where we cause visitChildren to be called again on wrappers that belonged to
48         roots that got affected by insertion/removal) but those would probably require more
49         bookkeeping.
50         
51         To make this barrier very fast, the WebCore caches the JSC VM's barrier state in
52         its own global variable for very fast access. This variable will be false most of the
53         time. It's false when there is no VM, so triggering the barrier won't cause the VM to be
54         created. It's only true when GC is running, which is rare by design.
55         
56         To make that caching more sensible, I finally gave WebCore a central header for
57         the common VM (CommonVM.h).
58
59         * CMakeLists.txt:
60         * Modules/mediastream/SDPProcessor.cpp:
61         (WebCore::SDPProcessor::callScript):
62         * WebCore.xcodeproj/project.pbxproj:
63         * bindings/js/CommonVM.cpp: Added.
64         (WebCore::commonVMSlow):
65         (WebCore::writeBarrierOpaqueRootSlow):
66         * bindings/js/CommonVM.h: Added.
67         (WebCore::commonVM):
68         (WebCore::writeBarrierOpaqueRoot):
69         * bindings/js/DOMWrapperWorld.cpp:
70         (WebCore::mainThreadNormalWorld):
71         * bindings/js/GCController.cpp:
72         (WebCore::collect):
73         (WebCore::GCController::garbageCollectSoon):
74         (WebCore::GCController::garbageCollectNow):
75         (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
76         (WebCore::GCController::setJavaScriptGarbageCollectorTimerEnabled):
77         (WebCore::GCController::deleteAllCode):
78         (WebCore::GCController::deleteAllLinkedCode):
79         * bindings/js/JSCustomXPathNSResolver.cpp:
80         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
81         * bindings/js/JSDOMBinding.cpp:
82         (WebCore::addImpureProperty):
83         * bindings/js/JSDOMWindowBase.cpp:
84         (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
85         (WebCore::JSDOMWindowBase::commonVM): Deleted.
86         * bindings/js/JSDOMWindowBase.h:
87         * bindings/js/JSDOMWindowShell.cpp:
88         (WebCore::JSDOMWindowShell::setWindow):
89         * bindings/js/JSNodeCustom.h:
90         (WebCore::root):
91         * bindings/js/ScriptCachedFrameData.cpp:
92         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
93         (WebCore::ScriptCachedFrameData::restore):
94         (WebCore::ScriptCachedFrameData::clear):
95         * bindings/js/ScriptController.cpp:
96         (WebCore::ScriptController::~ScriptController):
97         (WebCore::ScriptController::createWorld):
98         (WebCore::ScriptController::getAllWorlds):
99         (WebCore::ScriptController::clearWindowShell):
100         (WebCore::ScriptController::cacheableBindingRootObject):
101         (WebCore::ScriptController::bindingRootObject):
102         (WebCore::ScriptController::windowScriptNPObject):
103         (WebCore::ScriptController::jsObjectForPluginElement):
104         (WebCore::ScriptController::clearScriptObjects):
105         * dom/CollectionIndexCache.cpp:
106         (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
107         * dom/ContainerNode.cpp:
108         * dom/ContainerNodeAlgorithms.cpp:
109         (WebCore::notifyChildNodeInserted):
110         (WebCore::notifyChildNodeRemoved):
111         * dom/Document.cpp:
112         (WebCore::Document::shouldBypassMainWorldContentSecurityPolicy):
113         * dom/Node.h:
114         (WebCore::Node::opaqueRoot):
115         * dom/ScriptExecutionContext.cpp:
116         (WebCore::ScriptExecutionContext::vm):
117         * html/HTMLImageLoader.cpp:
118         (WebCore::HTMLImageLoader::notifyFinished):
119         * html/HTMLMediaElement.cpp:
120         (WebCore::HTMLMediaElement::pauseAfterDetachedTask):
121         (WebCore::HTMLMediaElement::ensureIsolatedWorld):
122         * html/HTMLPlugInImageElement.cpp:
123         (WebCore::plugInImageElementIsolatedWorld):
124         * inspector/InspectorController.cpp:
125         (WebCore::InspectorController::vm):
126         * inspector/PageScriptDebugServer.cpp:
127         (WebCore::PageScriptDebugServer::PageScriptDebugServer):
128         * page/PerformanceLogging.cpp:
129         (WebCore::PerformanceLogging::memoryUsageStatistics):
130         (WebCore::PerformanceLogging::javaScriptObjectCounts):
131         * page/ResourceUsageThread.cpp:
132         (WebCore::ResourceUsageThread::createThreadIfNeeded):
133         * svg/graphics/SVGImage.cpp:
134         (WebCore::SVGImage::reportApproximateMemoryCost):
135         * testing/MemoryInfo.h:
136         (WebCore::MemoryInfo::MemoryInfo):
137
138 2016-12-11  Dan Bernstein  <mitz@apple.com>
139
140         [Cocoa] NSAttributedString representation of text copied from -webkit-nbsp-mode:space element contains non-breaking space characters, but shouldn’t
141         https://bugs.webkit.org/show_bug.cgi?id=165515
142         <rdar://problem/4108460>
143
144         Reviewed by Darin Adler.
145
146         Test: platform/mac/fast/text/attributed-substring-from-range.html
147
148         * editing/cocoa/HTMLConverter.mm:
149         (HTMLConverter::_processText): Emit a space instead of a non-breaking space if the text node
150           is styled with -webkit-nbsp-mode:space.
151         (WebCore::editingAttributedStringFromRange): Replace all non-breaking spaces with spaces if
152           they come from a text node with -webkit-nbsp-mode:space.
153
154 2016-12-11  Konstantin Tokarev  <annulen@yandex.ru>
155
156         Unreviewed, add KHR include dir to fix ANGLE build after r209665
157         https://bugs.webkit.org/show_bug.cgi?id=165686
158
159         * CMakeLists.txt:
160
161 2016-12-10  Dave Hyatt  <hyatt@apple.com>
162
163         Rolling out 165737, since it broke layout tests. I need to find a 
164         different place to put the init.
165
166         * contentextensions/ContentExtensionParser.cpp:
167         (WebCore::ContentExtensions::isValidSelector):
168
169 2016-12-10  Simon Fraser  <simon.fraser@apple.com>
170
171         Support the deprecated dictionary constructor for DOMPointReadOnly and DOMPoint
172         https://bugs.webkit.org/show_bug.cgi?id=165732
173
174         Reviewed by Sam Weinig.
175         
176         For compatibility with other browsers, support the DOMPointInit constructor to
177         DOMPoint and DOMPointReadOnly per <https://www.w3.org/TR/geometry-1/#DOMPoint>
178
179         Extended geometry/DOMPoint-001.html to test.
180
181         * dom/DOMPoint.h:
182         * dom/DOMPoint.idl:
183         * dom/DOMPointReadOnly.h:
184         (WebCore::DOMPointReadOnly::create):
185         * dom/DOMPointReadOnly.idl:
186
187 2016-12-10  Dave Hyatt  <hyatt@apple.com>
188
189         [CSS Parser] Make sure content extensions initialize AtomicString
190         https://bugs.webkit.org/show_bug.cgi?id=165737
191
192         Reviewed by Simon Fraser.
193
194         Fixes two broken tests in TestWebkitAPI.
195
196         * contentextensions/ContentExtensionParser.cpp:
197         (WebCore::ContentExtensions::isValidSelector):
198
199 2016-12-10  Simon Fraser  <simon.fraser@apple.com>
200
201         Animation followed by transition doesn't always fire transitionend event
202         https://bugs.webkit.org/show_bug.cgi?id=165731
203         rdar://problem/28471240
204
205         Reviewed by Zalan Bujtas.
206         
207         After r200047, a keyframe animation of an accelerated property followed by a
208         transition didn't always fire a transitionend event.
209         
210         This happened if CompositeAnimation::timeToNextService() happend to be called
211         when the transitions's timeToNextService() returned a positive value, but the
212         keyframe animation still existed, but its timeToNextService() returned -1. In
213         this case that -1 would clobber the positing minT.
214
215         Fix by just continuing in each loop when the timeToNextService() returns -1.
216
217         This code should probably be rewritten to use std::optional<double> rather than
218         magic values.
219
220         Test: animations/animation-followed-by-transition.html
221
222         * page/animation/CompositeAnimation.cpp:
223         (WebCore::CompositeAnimation::timeToNextService):
224         * platform/graphics/ca/GraphicsLayerCA.cpp:
225         (WebCore::GraphicsLayerCA::addAnimation):
226         (WebCore::GraphicsLayerCA::pauseAnimation):
227         (WebCore::GraphicsLayerCA::removeAnimation):
228         (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
229         (WebCore::GraphicsLayerCA::platformCALayerAnimationEnded):
230
231 2016-12-10  Sam Weinig  <sam@webkit.org>
232
233         [WebIDL] Merge JSDictionary into Dictionary, and remove unused bits
234         https://bugs.webkit.org/show_bug.cgi?id=165641
235
236         Reviewed by Dan Bernstein.
237
238         * CMakeLists.txt:
239         * WebCore.xcodeproj/project.pbxproj:
240         * bindings/js/JSBindingsAllInOne.cpp:
241         Remove JSDictionary.h/cpp
242
243         * Modules/mediastream/RTCDataChannel.cpp:
244         Remove unused #include of Dictionary.h
245
246         * Modules/mediastream/RTCPeerConnection.cpp:
247         * Modules/mediastream/RTCPeerConnection.h:
248         Replace unnecessary #include of Dictionary in a header with forward declaration.
249
250         * bindings/js/Dictionary.cpp:
251         (WebCore::Dictionary::Dictionary):
252         (WebCore::Dictionary::tryGetProperty):
253         (WebCore::Dictionary::getOwnPropertyNames):
254         (WebCore::Dictionary::convertValue):
255         (WebCore::Dictionary::asJSObject<Notification>): Deleted.
256         (WebCore::Dictionary::getOwnPropertiesAsStringHashMap): Deleted.
257         (WebCore::Dictionary::getWithUndefinedOrNullCheck): Deleted.
258         * bindings/js/Dictionary.h:
259         (WebCore::Dictionary::isObject):
260         (WebCore::Dictionary::isUndefinedOrNull):
261         (WebCore::Dictionary::execState):
262         (WebCore::Dictionary::initializerObject):
263         (WebCore::Dictionary::isValid):
264         (WebCore::Dictionary::convertValue):
265         (WebCore::Dictionary::get):
266         (WebCore::Dictionary::tryGetPropertyAndResult):
267         (WebCore::Dictionary::getEventListener): Deleted.
268         Merge JSDictionary into Dictionary. Remove all unused functions (some getters, lots
269         of convertValue overrides). Modernize to taste.
270
271         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
272         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
273         (WebCore::getHashAlgorithm):
274         (WebCore::createHmacParams):
275         (WebCore::createHmacKeyParams):
276         (WebCore::createRsaKeyGenParams):
277         (WebCore::createRsaOaepParams):
278         (WebCore::createRsaSsaParams):
279         Update for rename. JSDictionary is now Dictionary.
280
281         * bindings/js/JSDictionary.cpp: Removed.
282         * bindings/js/JSDictionary.h: Removed.
283
284         * dom/MutationObserver.cpp:
285         Remove unused #include of Dictionary.h
286
287 2016-12-10  Dave Hyatt  <hyatt@apple.com>
288
289         [CSS Parser] Move CSSParserValues.h/.cpp to CSSParserSelector.h/.cpp
290         https://bugs.webkit.org/show_bug.cgi?id=165730
291
292         Reviewed by Simon Fraser.
293
294         * WebCore.xcodeproj/project.pbxproj:
295         * css/CSSCustomPropertyValue.cpp:
296         * css/CSSPrimitiveValue.cpp:
297         * css/CSSSelectorList.cpp:
298         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
299         * css/parser/CSSParserImpl.cpp:
300         * css/parser/CSSParserSelector.cpp: Copied from Source/WebCore/css/parser/CSSParserValues.cpp.
301         * css/parser/CSSParserSelector.h: Copied from Source/WebCore/css/parser/CSSParserValues.h.
302         * css/parser/CSSParserValues.cpp: Removed.
303         * css/parser/CSSParserValues.h: Removed.
304         * css/parser/CSSSelectorParser.h:
305
306 2016-12-10  Dave Hyatt  <hyatt@apple.com>
307
308         [CSS Parser] Remove the pseudoclass/element hacks
309         https://bugs.webkit.org/show_bug.cgi?id=165729
310
311         Reviewed by Sam Weinig.
312
313         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
314         * css/SelectorPseudoElementTypeMap.in:
315         * css/parser/CSSSelectorParser.cpp:
316         (WebCore::CSSSelectorParser::consumePseudo):
317
318 2016-12-09  Sam Weinig  <sam@webkit.org>
319
320         [WebIDL] Remove custom bindings for Geolocation
321         https://bugs.webkit.org/show_bug.cgi?id=165625
322
323         Reviewed by Alex Christensen.
324
325         * CMakeLists.txt:
326         * DerivedSources.cpp:
327         * DerivedSources.make:
328         * WebCore.xcodeproj/project.pbxproj:
329         * bindings/js/JSBindingsAllInOne.cpp:
330         Add/remove files.
331
332         * Modules/geolocation/GeoNotifier.cpp:
333         (WebCore::GeoNotifier::GeoNotifier):
334         (WebCore::GeoNotifier::hasZeroTimeout):
335         (WebCore::GeoNotifier::startTimerIfNeeded):
336         * Modules/geolocation/GeoNotifier.h:
337         (WebCore::GeoNotifier::create):
338         (WebCore::GeoNotifier::options):
339         Update to store PositionOptions as a value, and pass the PositionCallback
340         as a Ref, rather than a RefPtr, since it is not optional.
341
342         * Modules/geolocation/Geolocation.cpp:
343         (WebCore::createGeoposition):
344         Use auto, to get the good type for Coordinates (Ref).
345
346         (WebCore::Geolocation::getCurrentPosition):
347         (WebCore::Geolocation::watchPosition):
348         (WebCore::Geolocation::haveSuitableCachedPosition):
349         (WebCore::Geolocation::startUpdating):
350         * Modules/geolocation/Geolocation.h:
351         Update to pass PositionOptions itself now that it is a plain struct.
352
353         * Modules/geolocation/Geolocation.idl:
354         Remove [Custom] extended attribute and add FIXME about nullable annotation. 
355
356         * Modules/geolocation/Geoposition.h:
357         Pass/store Coordinates as a Ref.
358  
359         * Modules/geolocation/PositionOptions.h:
360         Convert to be a simple struct.
361
362         * Modules/geolocation/PositionOptions.idl:
363         Added.
364         
365         * bindings/js/JSGeolocationCustom.cpp:
366         Removed.
367
368 2016-12-09  Dave Hyatt  <hyatt@apple.com>
369
370         [CSS Parser] Remove the old CSS Parser
371         https://bugs.webkit.org/show_bug.cgi?id=165645
372
373         Reviewed by Daniel Bates.
374
375         Remove the old CSS parser code. In doing so, code that used documentless
376         CSSParserContexts is now going through the new parser. This resulted in
377         some additional changes. These include:
378
379         (1) Canvas color parsing switched to new parser's code. This resulted in
380         progressions on canvas tests.
381
382         (2) Support for CSSNamespaceRule in the CSS OM, since the Inspector's
383         creation of CSS OM wrappers made it necessary to add this in. The old parser
384         did not create style rules for namespaces, but the new one (and other browsers)
385         did.
386
387         (3) <font face="X"> now uses the new parser's font-family parsing code. This
388         change was made in createFontFaceValue in CSSValuePool.
389
390         (4) FontFace now uses a new function on the new parser called
391         parseFontFaceDescriptor. This function sets things up so that parsing occurs
392         as though you are inside a @font-face. The old parser let you call parseValue
393         to parse "properties", but descriptors need to be handled differently in the
394         new parser.
395
396         (5) Illegal CSS rules in mediaControlsApple/ios.css forced me to add a quirk
397         to handle chained shadow DOM pseudo-elements. This should not be allowed, but
398         for now it is.
399
400         * CMakeLists.txt:
401         * DerivedSources.make:
402         * WebCore.xcodeproj/project.pbxproj:
403         * bindings/js/JSCSSRuleCustom.cpp:
404         (WebCore::toJSNewlyCreated):
405         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
406         * css/CSSCalculationValue.cpp:
407         (WebCore::unitCategory):
408         (WebCore::hasDoubleValue):
409         (WebCore::checkDepthAndIndexDeprecated): Deleted.
410         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseCalc): Deleted.
411         (WebCore::CSSCalcExpressionNodeParserDeprecated::operatorValue): Deleted.
412         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValue): Deleted.
413         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueTerm): Deleted.
414         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueMultiplicativeExpression): Deleted.
415         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseAdditiveValueExpression): Deleted.
416         (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueExpression): Deleted.
417         * css/CSSCalculationValue.h:
418         * css/CSSComputedStyleDeclaration.cpp:
419         (WebCore::specifiedValueForGridTrackSize):
420         * css/CSSCustomPropertyValue.cpp:
421         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
422         (WebCore::CSSCustomPropertyValue::resolveVariableReferences):
423         * css/CSSCustomPropertyValue.h:
424         * css/CSSFunctionValue.cpp:
425         (WebCore::CSSFunctionValue::CSSFunctionValue):
426         (WebCore::CSSFunctionValue::customCSSText):
427         (WebCore::CSSFunctionValue::append):
428         (WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables): Deleted.
429         * css/CSSFunctionValue.h:
430         * css/CSSGrammar.y.in: Removed.
431         * css/CSSGrammar.y.includes: Removed.
432         * css/CSSGroupingRule.cpp:
433         (WebCore::CSSGroupingRule::insertRule):
434         * css/CSSKeyframeRule.h:
435         * css/CSSKeyframesRule.cpp:
436         (WebCore::CSSKeyframesRule::appendRule):
437         * css/CSSNamespaceRule.cpp: Added.
438         (WebCore::CSSNamespaceRule::CSSNamespaceRule):
439         (WebCore::CSSNamespaceRule::~CSSNamespaceRule):
440         (WebCore::CSSNamespaceRule::namespaceURI):
441         (WebCore::CSSNamespaceRule::prefix):
442         (WebCore::CSSNamespaceRule::cssText):
443         (WebCore::CSSNamespaceRule::reattach):
444         * css/CSSNamespaceRule.h: Added.
445         * css/CSSNamespaceRule.idl: Added.
446         * css/CSSPrimitiveValue.cpp:
447         (WebCore::isValidCSSUnitTypeForDoubleConversion):
448         (WebCore::isStringType):
449         (WebCore::CSSPrimitiveValue::cleanup):
450         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
451         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
452         (WebCore::CSSPrimitiveValue::equals):
453         (WebCore::CSSPrimitiveValue::buildParserValue): Deleted.
454         * css/CSSPrimitiveValue.h:
455         * css/CSSRule.h:
456         * css/CSSRule.idl:
457         * css/CSSStyleSheet.cpp:
458         (WebCore::CSSStyleSheet::insertRule):
459         * css/CSSValue.cpp:
460         (WebCore::CSSValue::equals):
461         (WebCore::CSSValue::cssText):
462         (WebCore::CSSValue::destroy):
463         * css/CSSValue.h:
464         (WebCore::CSSValue::isCustomPropertyValue):
465         (WebCore::CSSValue::hasVariableReferences):
466         (WebCore::CSSValue::isVariableDependentValue): Deleted.
467         (WebCore::CSSValue::isVariableValue): Deleted.
468         * css/CSSValueList.cpp:
469         (WebCore::CSSValueList::customCSSText):
470         (WebCore::CSSValueList::containsVariables): Deleted.
471         (WebCore::CSSValueList::checkVariablesForCycles): Deleted.
472         (WebCore::CSSValueList::buildParserValueSubstitutingVariables): Deleted.
473         (WebCore::CSSValueList::buildParserValueListSubstitutingVariables): Deleted.
474         * css/CSSValueList.h:
475         (WebCore::CSSValueList::createSlashSeparated):
476         (WebCore::CSSValueList::createFromParserValueList): Deleted.
477         * css/CSSValuePool.cpp:
478         (WebCore::CSSValuePool::createFontFaceValue):
479         * css/CSSVariableData.cpp:
480         * css/CSSVariableDependentValue.cpp: Removed.
481         * css/CSSVariableDependentValue.h: Removed.
482         * css/CSSVariableValue.cpp: Removed.
483         * css/CSSVariableValue.h: Removed.
484         * css/DOMCSSNamespace.cpp:
485         * css/FontFace.cpp:
486         (WebCore::FontFace::parseString):
487         * css/InspectorCSSOMWrappers.cpp:
488         * css/MediaQueryExp.cpp:
489         (WebCore::isFeatureValidWithIdentifier): Deleted.
490         (WebCore::isFeatureValidWithNonNegativeLengthOrNumber): Deleted.
491         (WebCore::isFeatureValidWithDensity): Deleted.
492         (WebCore::isFeatureValidWithNonNegativeInteger): Deleted.
493         (WebCore::isFeatureValidWithNonNegativeNumber): Deleted.
494         (WebCore::isFeatureValidWithZeroOrOne): Deleted.
495         (WebCore::isFeatureValidWithNumberWithUnit): Deleted.
496         (WebCore::isFeatureValidWithNumber): Deleted.
497         (WebCore::isSlash): Deleted.
498         (WebCore::isPositiveIntegerValue): Deleted.
499         * css/MediaQueryExp.h:
500         * css/PropertySetCSSStyleDeclaration.cpp:
501         (WebCore::PropertySetCSSStyleDeclaration::setCssText):
502         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
503         * css/SelectorPseudoTypeMap.h:
504         * css/StyleProperties.cpp:
505         (WebCore::StyleProperties::getPropertyValue):
506         (WebCore::StyleProperties::getPropertyCSSValue):
507         (WebCore::MutableStyleProperties::setCustomProperty):
508         (WebCore::MutableStyleProperties::parseDeclaration):
509         (WebCore::StyleProperties::asText):
510         * css/StyleProperties.h:
511         * css/StyleResolver.cpp:
512         (WebCore::StyleResolver::applyProperty):
513         * css/StyleResolver.h:
514         * css/StyleRule.cpp:
515         (WebCore::StyleRuleBase::createCSSOMWrapper):
516         * css/StyleSheetContents.cpp:
517         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
518         (WebCore::StyleSheetContents::parseString):
519         (WebCore::StyleSheetContents::completeURL):
520         (WebCore::StyleSheetContents::parseStringAtPosition): Deleted.
521         * css/StyleSheetContents.h:
522         * css/WebKitCSSMatrix.cpp:
523         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
524         * css/parser/CSSParser.cpp:
525         (WebCore::CSSParserContext::CSSParserContext):
526         (WebCore::CSSParser::CSSParser):
527         (WebCore::CSSParser::parseSheet):
528         (WebCore::CSSParser::parseRule):
529         (WebCore::CSSParser::parseKeyframeRule):
530         (WebCore::CSSParser::parseSupportsCondition):
531         (WebCore::CSSParser::parseColor):
532         (WebCore::CSSParser::parseSystemColor):
533         (WebCore::CSSParser::parseSingleValue):
534         (WebCore::CSSParser::parseValue):
535         (WebCore::CSSParser::parseCustomPropertyValue):
536         (WebCore::CSSParser::parseSelector):
537         (WebCore::CSSParser::parseInlineStyleDeclaration):
538         (WebCore::CSSParser::parseDeclaration):
539         (WebCore::CSSParser::parseValueWithVariableReferences):
540         (WebCore::CSSParser::parseKeyframeKeyList):
541         (WebCore::CSSParser::parseFontFaceDescriptor):
542         (WebCore::equalLettersIgnoringASCIICase): Deleted.
543         (WebCore::hasPrefix): Deleted.
544         (WebCore::createPrimitiveValuePair): Deleted.
545         (WebCore::AnimationParseContext::commitFirstAnimation): Deleted.
546         (WebCore::AnimationParseContext::hasCommittedFirstAnimation): Deleted.
547         (WebCore::AnimationParseContext::commitAnimationPropertyKeyword): Deleted.
548         (WebCore::AnimationParseContext::animationPropertyKeywordAllowed): Deleted.
549         (WebCore::AnimationParseContext::hasSeenAnimationPropertyKeyword): Deleted.
550         (WebCore::AnimationParseContext::sawAnimationPropertyKeyword): Deleted.
551         (): Deleted.
552         (WebCore::convertToASCIILowercaseInPlace): Deleted.
553         (WebCore::CSSParserString::convertToASCIILowercaseInPlace): Deleted.
554         (WebCore::CSSParser::setupParser): Deleted.
555         (WebCore::isColorPropertyID): Deleted.
556         (WebCore::CSSParser::isValidSystemColorValue): Deleted.
557         (WebCore::validPrimitiveValueColor): Deleted.
558         (WebCore::parseColorValue): Deleted.
559         (WebCore::isSimpleLengthPropertyID): Deleted.
560         (WebCore::parseSimpleLength): Deleted.
561         (WebCore::parseSimpleLengthValue): Deleted.
562         (WebCore::isValidKeywordPropertyAndValue): Deleted.
563         (WebCore::isUniversalKeyword): Deleted.
564         (WebCore::isKeywordPropertyID): Deleted.
565         (WebCore::parseKeywordValue): Deleted.
566         (WebCore::parseTransformTranslateArguments): Deleted.
567         (WebCore::parseTranslateTransformValue): Deleted.
568         (WebCore::CSSParser::parseFontFaceValue): Deleted.
569         (WebCore::CSSParser::parseColorFromString): Deleted.
570         (WebCore::CSSParser::parseDeclarationDeprecated): Deleted.
571         (WebCore::filterProperties): Deleted.
572         (WebCore::CSSParser::createStyleProperties): Deleted.
573         (WebCore::CSSParser::addProperty): Deleted.
574         (WebCore::CSSParser::rollbackLastProperties): Deleted.
575         (WebCore::CSSParser::clearProperties): Deleted.
576         (WebCore::CSSParser::completeURL): Deleted.
577         (WebCore::CSSParser::validateCalculationUnit): Deleted.
578         (WebCore::CSSParser::shouldAcceptUnitLessValues): Deleted.
579         (WebCore::CSSParser::validateUnit): Deleted.
580         (WebCore::CSSParser::createPrimitiveNumericValue): Deleted.
581         (WebCore::CSSParser::createPrimitiveStringValue): Deleted.
582         (WebCore::isComma): Deleted.
583         (WebCore::isForwardSlashOperator): Deleted.
584         (WebCore::CSSParser::isValidSize): Deleted.
585         (WebCore::CSSParser::parseValidPrimitive): Deleted.
586         (WebCore::CSSParser::addExpandedPropertyForValue): Deleted.
587         (WebCore::isImageSetFunctionValue): Deleted.
588         (WebCore::CSSParser::addFillValue): Deleted.
589         (WebCore::isContentDistributionKeyword): Deleted.
590         (WebCore::isContentPositionKeyword): Deleted.
591         (WebCore::isBaselinePositionKeyword): Deleted.
592         (WebCore::isAlignmentOverflowKeyword): Deleted.
593         (WebCore::isItemPositionKeyword): Deleted.
594         (WebCore::CSSParser::parseLegacyPosition): Deleted.
595         (WebCore::CSSParser::parseContentDistributionOverflowPosition): Deleted.
596         (WebCore::CSSParser::parseItemPositionOverflowPosition): Deleted.
597         (WebCore::parseBackgroundClip): Deleted.
598         (WebCore::CSSParser::useLegacyBackgroundSizeShorthandBehavior): Deleted.
599         (WebCore::CSSParser::parseNonElementSnapPoints): Deleted.
600         (WebCore::CSSParser::parseScrollSnapPositions): Deleted.
601         (WebCore::CSSParser::parseScrollSnapDestination): Deleted.
602         (WebCore::CSSParser::parseScrollSnapCoordinate): Deleted.
603         (WebCore::CSSParser::parseFillShorthand): Deleted.
604         (WebCore::CSSParser::addAnimationValue): Deleted.
605         (WebCore::CSSParser::parseAnimationShorthand): Deleted.
606         (WebCore::CSSParser::parseColumnWidth): Deleted.
607         (WebCore::CSSParser::parseColumnCount): Deleted.
608         (WebCore::CSSParser::parseColumnsShorthand): Deleted.
609         (WebCore::CSSParser::parseTransitionShorthand): Deleted.
610         (WebCore::CSSParser::parseShorthand): Deleted.
611         (WebCore::CSSParser::parse4Values): Deleted.
612         (WebCore::CSSParser::parsePage): Deleted.
613         (WebCore::CSSParser::parseSize): Deleted.
614         (WebCore::CSSParser::parseSizeParameter): Deleted.
615         (WebCore::CSSParser::parseQuotes): Deleted.
616         (WebCore::CSSParser::parseAlt): Deleted.
617         (WebCore::CSSParser::parseCustomPropertyDeclaration): Deleted.
618         (WebCore::CSSParser::parseContent): Deleted.
619         (WebCore::CSSParser::parseAttr): Deleted.
620         (WebCore::CSSParser::parseBackgroundColor): Deleted.
621         (WebCore::CSSParser::parseFillImage): Deleted.
622         (WebCore::CSSParser::parsePositionX): Deleted.
623         (WebCore::CSSParser::parsePositionY): Deleted.
624         (WebCore::CSSParser::parseFillPositionComponent): Deleted.
625         (WebCore::isValueConflictingWithCurrentEdge): Deleted.
626         (WebCore::isFillPositionKeyword): Deleted.
627         (WebCore::CSSParser::parse4ValuesFillPosition): Deleted.
628         (WebCore::CSSParser::parse3ValuesFillPosition): Deleted.
629         (WebCore::CSSParser::isPotentialPositionValue): Deleted.
630         (WebCore::CSSParser::parseFillPosition): Deleted.
631         (WebCore::CSSParser::parse2ValuesFillPosition): Deleted.
632         (WebCore::CSSParser::parseFillRepeat): Deleted.
633         (WebCore::CSSParser::parseFillSize): Deleted.
634         (WebCore::CSSParser::parseFillProperty): Deleted.
635         (WebCore::CSSParser::parseAnimationDelay): Deleted.
636         (WebCore::CSSParser::parseAnimationDirection): Deleted.
637         (WebCore::CSSParser::parseAnimationDuration): Deleted.
638         (WebCore::CSSParser::parseAnimationFillMode): Deleted.
639         (WebCore::CSSParser::parseAnimationIterationCount): Deleted.
640         (WebCore::CSSParser::parseAnimationName): Deleted.
641         (WebCore::CSSParser::parseAnimationPlayState): Deleted.
642         (WebCore::CSSParser::parseAnimationTrigger): Deleted.
643         (WebCore::CSSParser::parseAnimationProperty): Deleted.
644         (WebCore::CSSParser::parseTransformOriginShorthand): Deleted.
645         (WebCore::CSSParser::isSpringTimingFunctionEnabled): Deleted.
646         (WebCore::CSSParser::parseCubicBezierTimingFunctionValue): Deleted.
647         (WebCore::CSSParser::parseSpringTimingFunctionValue): Deleted.
648         (WebCore::CSSParser::parseAnimationTimingFunction): Deleted.
649         (WebCore::isValidGridPositionCustomIdent): Deleted.
650         (WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition): Deleted.
651         (WebCore::CSSParser::parseGridPosition): Deleted.
652         (WebCore::gridMissingGridPositionValue): Deleted.
653         (WebCore::CSSParser::parseGridItemPositionShorthand): Deleted.
654         (WebCore::CSSParser::parseGridGapShorthand): Deleted.
655         (WebCore::CSSParser::parseGridTemplateColumns): Deleted.
656         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Deleted.
657         (WebCore::CSSParser::parseGridTemplateShorthand): Deleted.
658         (WebCore::parseImplicitAutoFlow): Deleted.
659         (WebCore::CSSParser::parseGridShorthand): Deleted.
660         (WebCore::CSSParser::parseGridAreaShorthand): Deleted.
661         (WebCore::CSSParser::parseSingleGridAreaLonghand): Deleted.
662         (WebCore::CSSParser::parseGridLineNames): Deleted.
663         (WebCore::isGridTrackFixedSized): Deleted.
664         (WebCore::CSSParser::parseGridTrackList): Deleted.
665         (WebCore::CSSParser::parseGridTrackRepeatFunction): Deleted.
666         (WebCore::CSSParser::parseGridTrackSize): Deleted.
667         (WebCore::CSSParser::parseGridBreadth): Deleted.
668         (WebCore::isValidGridAutoFlowId): Deleted.
669         (WebCore::CSSParser::parseGridAutoFlow): Deleted.
670         (WebCore::skipCommaInDashboardRegion): Deleted.
671         (WebCore::CSSParser::parseDashboardRegions): Deleted.
672         (WebCore::parseGridTemplateAreasColumnNames): Deleted.
673         (WebCore::CSSParser::parseGridTemplateAreasRow): Deleted.
674         (WebCore::CSSParser::parseGridTemplateAreas): Deleted.
675         (WebCore::CSSParser::parseCounterContent): Deleted.
676         (WebCore::CSSParser::parseClipShape): Deleted.
677         (WebCore::completeBorderRadii): Deleted.
678         (WebCore::CSSParser::parseInsetRoundedCorners): Deleted.
679         (WebCore::CSSParser::parseBasicShapeInset): Deleted.
680         (WebCore::CSSParser::parseShapeRadius): Deleted.
681         (WebCore::CSSParser::parseBasicShapeCircle): Deleted.
682         (WebCore::CSSParser::parseBasicShapeEllipse): Deleted.
683         (WebCore::CSSParser::parseBasicShapePolygon): Deleted.
684         (WebCore::CSSParser::parseBasicShapePath): Deleted.
685         (WebCore::isBoxValue): Deleted.
686         (WebCore::CSSParser::parseBasicShapeAndOrBox): Deleted.
687         (WebCore::CSSParser::parseShapeProperty): Deleted.
688         (WebCore::CSSParser::parseClipPath): Deleted.
689         (WebCore::CSSParser::parseBasicShape): Deleted.
690         (WebCore::CSSParser::parseFont): Deleted.
691         (WebCore::CSSParser::parseSystemFont): Deleted.
692         (WebCore::FontFamilyValueBuilder::FontFamilyValueBuilder): Deleted.
693         (WebCore::FontFamilyValueBuilder::add): Deleted.
694         (WebCore::FontFamilyValueBuilder::commit): Deleted.
695         (WebCore::valueIsCSSKeyword): Deleted.
696         (WebCore::CSSParser::parseFontFamily): Deleted.
697         (WebCore::CSSParser::parseLineHeight): Deleted.
698         (WebCore::CSSParser::parseFontSize): Deleted.
699         (WebCore::createFontWeightValueKeyword): Deleted.
700         (WebCore::CSSParser::parseFontWeight): Deleted.
701         (WebCore::CSSParser::parseFontSynthesis): Deleted.
702         (WebCore::CSSParser::parseFontFaceSrcURI): Deleted.
703         (WebCore::CSSParser::parseFontFaceSrcLocal): Deleted.
704         (WebCore::CSSParser::parseFontFaceSrc): Deleted.
705         (WebCore::CSSParser::parseFontFaceUnicodeRange): Deleted.
706         (WebCore::checkForValidDouble): Deleted.
707         (WebCore::parseDouble): Deleted.
708         (WebCore::parseColorIntOrPercentage): Deleted.
709         (WebCore::isTenthAlpha): Deleted.
710         (WebCore::parseAlphaValue): Deleted.
711         (WebCore::mightBeRGBA): Deleted.
712         (WebCore::mightBeRGB): Deleted.
713         (WebCore::fastParseColorInternal): Deleted.
714         (WebCore::CSSParser::fastParseColor): Deleted.
715         (WebCore::CSSParser::parsedDouble): Deleted.
716         (WebCore::CSSParser::isCalculation): Deleted.
717         (WebCore::isPercent): Deleted.
718         (WebCore::CSSParser::parseColorInt): Deleted.
719         (WebCore::CSSParser::parseColorDouble): Deleted.
720         (WebCore::CSSParser::parseRGBParameters): Deleted.
721         (WebCore::CSSParser::parseColorFunctionParameters): Deleted.
722         (WebCore::CSSParser::parseHSLParameters): Deleted.
723         (WebCore::CSSParser::parseColorFromValue): Deleted.
724         (WebCore::ShadowParseContext::ShadowParseContext): Deleted.
725         (WebCore::ShadowParseContext::allowLength): Deleted.
726         (WebCore::ShadowParseContext::commitValue): Deleted.
727         (WebCore::ShadowParseContext::commitLength): Deleted.
728         (WebCore::ShadowParseContext::commitColor): Deleted.
729         (WebCore::ShadowParseContext::commitStyle): Deleted.
730         (WebCore::CSSParser::parseShadow): Deleted.
731         (WebCore::CSSParser::parseReflect): Deleted.
732         (WebCore::CSSParser::parseFlex): Deleted.
733         (WebCore::BorderImageParseContext::BorderImageParseContext): Deleted.
734         (WebCore::BorderImageParseContext::canAdvance): Deleted.
735         (WebCore::BorderImageParseContext::setCanAdvance): Deleted.
736         (WebCore::BorderImageParseContext::allowCommit): Deleted.
737         (WebCore::BorderImageParseContext::allowImage): Deleted.
738         (WebCore::BorderImageParseContext::allowImageSlice): Deleted.
739         (WebCore::BorderImageParseContext::allowRepeat): Deleted.
740         (WebCore::BorderImageParseContext::allowForwardSlashOperator): Deleted.
741         (WebCore::BorderImageParseContext::requireWidth): Deleted.
742         (WebCore::BorderImageParseContext::requireOutset): Deleted.
743         (WebCore::BorderImageParseContext::commitImage): Deleted.
744         (WebCore::BorderImageParseContext::commitImageSlice): Deleted.
745         (WebCore::BorderImageParseContext::commitForwardSlashOperator): Deleted.
746         (WebCore::BorderImageParseContext::commitBorderWidth): Deleted.
747         (WebCore::BorderImageParseContext::commitBorderOutset): Deleted.
748         (WebCore::BorderImageParseContext::commitRepeat): Deleted.
749         (WebCore::BorderImageParseContext::commitWebKitBorderImage): Deleted.
750         (WebCore::BorderImageParseContext::commitBorderImage): Deleted.
751         (WebCore::BorderImageParseContext::commitBorderImageProperty): Deleted.
752         (WebCore::CSSParser::parseBorderImage): Deleted.
753         (WebCore::isBorderImageRepeatKeyword): Deleted.
754         (WebCore::CSSParser::parseBorderImageRepeat): Deleted.
755         (WebCore::BorderImageSliceParseContext::BorderImageSliceParseContext): Deleted.
756         (WebCore::BorderImageSliceParseContext::allowNumber): Deleted.
757         (WebCore::BorderImageSliceParseContext::allowFill): Deleted.
758         (WebCore::BorderImageSliceParseContext::allowFinalCommit): Deleted.
759         (WebCore::BorderImageSliceParseContext::top): Deleted.
760         (WebCore::BorderImageSliceParseContext::commitNumber): Deleted.
761         (WebCore::BorderImageSliceParseContext::commitFill): Deleted.
762         (WebCore::BorderImageSliceParseContext::commitBorderImageSlice): Deleted.
763         (WebCore::CSSParser::parseBorderImageSlice): Deleted.
764         (WebCore::BorderImageQuadParseContext::BorderImageQuadParseContext): Deleted.
765         (WebCore::BorderImageQuadParseContext::allowNumber): Deleted.
766         (WebCore::BorderImageQuadParseContext::allowFinalCommit): Deleted.
767         (WebCore::BorderImageQuadParseContext::top): Deleted.
768         (WebCore::BorderImageQuadParseContext::commitNumber): Deleted.
769         (WebCore::BorderImageQuadParseContext::setAllowFinalCommit): Deleted.
770         (WebCore::BorderImageQuadParseContext::setTop): Deleted.
771         (WebCore::BorderImageQuadParseContext::commitBorderImageQuad): Deleted.
772         (WebCore::CSSParser::parseBorderImageQuad): Deleted.
773         (WebCore::CSSParser::parseBorderImageWidth): Deleted.
774         (WebCore::CSSParser::parseBorderImageOutset): Deleted.
775         (WebCore::CSSParser::parseBorderRadius): Deleted.
776         (WebCore::CSSParser::parseAspectRatio): Deleted.
777         (WebCore::CSSParser::parseCounter): Deleted.
778         (WebCore::parseDeprecatedGradientPoint): Deleted.
779         (WebCore::parseDeprecatedGradientColorStop): Deleted.
780         (WebCore::CSSParser::parseDeprecatedGradient): Deleted.
781         (WebCore::valueFromSideKeyword): Deleted.
782         (WebCore::parseGradientColorOrKeyword): Deleted.
783         (WebCore::CSSParser::parseDeprecatedLinearGradient): Deleted.
784         (WebCore::CSSParser::parseDeprecatedRadialGradient): Deleted.
785         (WebCore::CSSParser::parseLinearGradient): Deleted.
786         (WebCore::CSSParser::parseRadialGradient): Deleted.
787         (WebCore::CSSParser::parseGradientColorStops): Deleted.
788         (WebCore::CSSParser::isGeneratedImageValue): Deleted.
789         (WebCore::CSSParser::parseGeneratedImage): Deleted.
790         (WebCore::CSSParser::parseFilterImage): Deleted.
791         (WebCore::CSSParser::parseCrossfade): Deleted.
792         (WebCore::CSSParser::parseCanvas): Deleted.
793         (WebCore::CSSParser::parseNamedImage): Deleted.
794         (WebCore::CSSParser::parseImageResolution): Deleted.
795         (WebCore::CSSParser::parseImageSet): Deleted.
796         (WebCore::TransformOperationInfo::TransformOperationInfo): Deleted.
797         (WebCore::TransformOperationInfo::type): Deleted.
798         (WebCore::TransformOperationInfo::argCount): Deleted.
799         (WebCore::TransformOperationInfo::unit): Deleted.
800         (WebCore::TransformOperationInfo::unknown): Deleted.
801         (WebCore::TransformOperationInfo::hasCorrectArgCount): Deleted.
802         (WebCore::CSSParser::parseTransform): Deleted.
803         (WebCore::CSSParser::parseTransformValue): Deleted.
804         (WebCore::CSSParser::isBlendMode): Deleted.
805         (WebCore::CSSParser::isCompositeOperator): Deleted.
806         (WebCore::isValidPrimitiveFilterFunction): Deleted.
807         (WebCore::CSSParser::parseBuiltinFilterArguments): Deleted.
808         (WebCore::cssValueKeywordIDForFunctionName): Deleted.
809         (WebCore::CSSParser::parseFilter): Deleted.
810         (WebCore::validFlowName): Deleted.
811         (WebCore::CSSParser::isTextAutosizingEnabled): Deleted.
812         (WebCore::CSSParser::isCSSGridLayoutEnabled): Deleted.
813         (WebCore::CSSParser::parseFlowThread): Deleted.
814         (WebCore::CSSParser::parseRegionThread): Deleted.
815         (WebCore::CSSParser::parseTransformOrigin): Deleted.
816         (WebCore::CSSParser::parsePerspectiveOrigin): Deleted.
817         (WebCore::CSSParser::addTextDecorationProperty): Deleted.
818         (WebCore::CSSParser::parseTextDecoration): Deleted.
819         (WebCore::CSSParser::parseTextDecorationSkip): Deleted.
820         (WebCore::CSSParser::parseTextUnderlinePosition): Deleted.
821         (WebCore::CSSParser::parseTextEmphasisStyle): Deleted.
822         (WebCore::CSSParser::parseTextEmphasisPosition): Deleted.
823         (WebCore::CSSParser::parseTextIndent): Deleted.
824         (WebCore::CSSParser::parseHangingPunctuation): Deleted.
825         (WebCore::CSSParser::parseLineBoxContain): Deleted.
826         (WebCore::CSSParser::parseFontFeatureTag): Deleted.
827         (WebCore::CSSParser::parseFontFeatureSettings): Deleted.
828         (WebCore::CSSParser::parseFontVariationTag): Deleted.
829         (WebCore::CSSParser::parseFontVariationSettings): Deleted.
830         (WebCore::CSSParser::parseFontVariantLigatures): Deleted.
831         (WebCore::CSSParser::parseFontVariantNumeric): Deleted.
832         (WebCore::CSSParser::parseFontVariantEastAsian): Deleted.
833         (WebCore::CSSParser::parseFontVariant): Deleted.
834         (WebCore::isValidWillChangeAnimatableFeature): Deleted.
835         (WebCore::CSSParser::parseWillChange): Deleted.
836         (WebCore::CSSParser::parseCalculation): Deleted.
837         (WebCore::isCSSLetter): Deleted.
838         (WebCore::isCSSEscape): Deleted.
839         (WebCore::isURILetter): Deleted.
840         (WebCore::isIdentifierStartAfterDash): Deleted.
841         (WebCore::isCustomPropertyIdentifier): Deleted.
842         (WebCore::isEqualToCSSIdentifier): Deleted.
843         (WebCore::isEqualToCSSCaseSensitiveIdentifier): Deleted.
844         (WebCore::checkAndSkipEscape): Deleted.
845         (WebCore::skipWhiteSpace): Deleted.
846         (WebCore::CSSParserString::characters<LChar>): Deleted.
847         (WebCore::CSSParserString::characters<UChar>): Deleted.
848         (WebCore::CSSParser::currentCharacter<LChar>): Deleted.
849         (WebCore::CSSParser::currentCharacter<UChar>): Deleted.
850         (WebCore::CSSParser::currentCharacter16): Deleted.
851         (WebCore::CSSParser::tokenStart<LChar>): Deleted.
852         (WebCore::CSSParser::tokenStart<UChar>): Deleted.
853         (WebCore::CSSParser::currentLocation): Deleted.
854         (WebCore::CSSParser::isIdentifierStart): Deleted.
855         (WebCore::checkAndSkipString): Deleted.
856         (WebCore::CSSParser::parseEscape): Deleted.
857         (WebCore::CSSParser::UnicodeToChars<LChar>): Deleted.
858         (WebCore::CSSParser::UnicodeToChars<UChar>): Deleted.
859         (WebCore::CSSParser::parseIdentifierInternal): Deleted.
860         (WebCore::CSSParser::parseIdentifier): Deleted.
861         (WebCore::CSSParser::parseStringInternal): Deleted.
862         (WebCore::CSSParser::parseString): Deleted.
863         (WebCore::CSSParser::findURI): Deleted.
864         (WebCore::CSSParser::parseURIInternal): Deleted.
865         (WebCore::CSSParser::parseURI): Deleted.
866         (WebCore::CSSParser::parseUnicodeRange): Deleted.
867         (WebCore::CSSParser::parseNthChild): Deleted.
868         (WebCore::CSSParser::parseNthChildExtra): Deleted.
869         (WebCore::CSSParser::detectFunctionTypeToken): Deleted.
870         (WebCore::CSSParser::detectMediaQueryToken): Deleted.
871         (WebCore::CSSParser::detectNumberToken): Deleted.
872         (WebCore::CSSParser::detectDashToken): Deleted.
873         (WebCore::CSSParser::detectAtToken): Deleted.
874         (WebCore::CSSParser::detectSupportsToken): Deleted.
875         (WebCore::CSSParser::realLex): Deleted.
876         (WebCore::CSSParser::createImportRule): Deleted.
877         (WebCore::CSSParser::createMediaRule): Deleted.
878         (WebCore::CSSParser::createEmptyMediaRule): Deleted.
879         (WebCore::CSSParser::createSupportsRule): Deleted.
880         (WebCore::CSSParser::markSupportsRuleHeaderStart): Deleted.
881         (WebCore::CSSParser::markSupportsRuleHeaderEnd): Deleted.
882         (WebCore::CSSParser::popSupportsRuleData): Deleted.
883         (WebCore::CSSParser::processAndAddNewRuleToSourceTreeIfNeeded): Deleted.
884         (WebCore::CSSParser::addNewRuleToSourceTree): Deleted.
885         (WebCore::CSSParser::popRuleData): Deleted.
886         (WebCore::CSSParser::syntaxError): Deleted.
887         (WebCore::CSSParser::isLoggingErrors): Deleted.
888         (WebCore::CSSParser::logError): Deleted.
889         (WebCore::CSSParser::createKeyframesRule): Deleted.
890         (WebCore::CSSParser::createStyleRule): Deleted.
891         (WebCore::CSSParser::createFontFaceRule): Deleted.
892         (WebCore::CSSParser::addNamespace): Deleted.
893         (WebCore::CSSParser::determineNameInNamespace): Deleted.
894         (WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded): Deleted.
895         (WebCore::CSSParser::rewriteSpecifiersWithElementName): Deleted.
896         (WebCore::CSSParser::rewriteSpecifiers): Deleted.
897         (WebCore::CSSParser::createPageRule): Deleted.
898         (WebCore::CSSParser::createSelectorVector): Deleted.
899         (WebCore::CSSParser::recycleSelectorVector): Deleted.
900         (WebCore::CSSParser::createRegionRule): Deleted.
901         (WebCore::CSSParser::createMarginAtRule): Deleted.
902         (WebCore::CSSParser::startDeclarationsForMarginBox): Deleted.
903         (WebCore::CSSParser::endDeclarationsForMarginBox): Deleted.
904         (WebCore::CSSParser::createKeyframe): Deleted.
905         (WebCore::CSSParser::invalidBlockHit): Deleted.
906         (WebCore::CSSParser::updateLastMediaLine): Deleted.
907         (WebCore::fixUnparsedProperties): Deleted.
908         (WebCore::CSSParser::fixUnparsedPropertyRanges): Deleted.
909         (WebCore::CSSParser::markRuleHeaderStart): Deleted.
910         (WebCore::CSSParser::setRuleHeaderEnd): Deleted.
911         (WebCore::CSSParser::markRuleHeaderEnd): Deleted.
912         (WebCore::CSSParser::markSelectorStart): Deleted.
913         (WebCore::CSSParser::markSelectorEnd): Deleted.
914         (WebCore::CSSParser::markRuleBodyStart): Deleted.
915         (WebCore::CSSParser::markRuleBodyEnd): Deleted.
916         (WebCore::CSSParser::markPropertyStart): Deleted.
917         (WebCore::CSSParser::markPropertyEnd): Deleted.
918         (WebCore::CSSParser::createViewportRule): Deleted.
919         (WebCore::CSSParser::parseViewportProperty): Deleted.
920         (WebCore::CSSParser::parseViewportShorthand): Deleted.
921         (WebCore::isAppleLegacyCSSPropertyKeyword): Deleted.
922         (WebCore::cssPropertyID): Deleted.
923         (WebCore::cssPropertyNameIOSAliasing): Deleted.
924         (WebCore::isAppleLegacyCSSValueKeyword): Deleted.
925         (WebCore::cssValueKeywordID): Deleted.
926         (WebCore::isValidNthToken): Deleted.
927         * css/parser/CSSParser.h:
928         (): Deleted.
929         (WebCore::CSSParser::ValueWithCalculation::ValueWithCalculation): Deleted.
930         (WebCore::CSSParser::ValueWithCalculation::value): Deleted.
931         (WebCore::CSSParser::ValueWithCalculation::operator CSSParserValue&): Deleted.
932         (WebCore::CSSParser::ValueWithCalculation::calculation): Deleted.
933         (WebCore::CSSParser::ValueWithCalculation::setCalculation): Deleted.
934         (WebCore::CSSParser::hasProperties): Deleted.
935         (WebCore::CSSParser::startNestedSelectorList): Deleted.
936         (WebCore::CSSParser::endNestedSelectorList): Deleted.
937         (WebCore::CSSParser::resetPropertyRange): Deleted.
938         (WebCore::CSSParser::isExtractingSourceData): Deleted.
939         (WebCore::CSSParser::lex): Deleted.
940         (WebCore::CSSParser::token): Deleted.
941         (WebCore::CSSParser::markViewportRuleBodyStart): Deleted.
942         (WebCore::CSSParser::markViewportRuleBodyEnd): Deleted.
943         (WebCore::CSSParser::setCustomPropertyName): Deleted.
944         (WebCore::CSSParser::is8BitSource): Deleted.
945         (WebCore::CSSParser::setStyleSheet): Deleted.
946         (WebCore::CSSParser::inStrictMode): Deleted.
947         (WebCore::CSSParser::inQuirksMode): Deleted.
948         (WebCore::CSSParser::setupParser): Deleted.
949         (WebCore::CSSParser::inShorthand): Deleted.
950         (WebCore::CSSParser::inViewport): Deleted.
951         (WebCore::CSSParser::operator|): Deleted.
952         (WebCore::CSSParser::validateUnit): Deleted.
953         (WebCore::ShorthandScope::ShorthandScope): Deleted.
954         (WebCore::ShorthandScope::~ShorthandScope): Deleted.
955         (WebCore::CSSParser::setTokenStart<LChar>): Deleted.
956         (WebCore::CSSParser::setTokenStart<UChar>): Deleted.
957         (WebCore::CSSParser::tokenStartOffset): Deleted.
958         (WebCore::CSSParser::currentCharacterOffset): Deleted.
959         (WebCore::CSSParser::tokenStartChar): Deleted.
960         (WebCore::isCustomPropertyName): Deleted.
961         (WebCore::cssyylex): Deleted.
962         * css/parser/CSSParserFastPaths.cpp:
963         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
964         * css/parser/CSSParserMode.h:
965         (WebCore::CSSParserContextHash::hash):
966         * css/parser/CSSParserValues.cpp:
967         (WebCore::CSSParserSelector::setSelectorList):
968         (WebCore::destroy): Deleted.
969         (WebCore::CSSParserValueList::~CSSParserValueList): Deleted.
970         (WebCore::CSSParserValueList::addValue): Deleted.
971         (WebCore::CSSParserValueList::insertValueAt): Deleted.
972         (WebCore::CSSParserValueList::extend): Deleted.
973         (WebCore::CSSParserValueList::containsVariables): Deleted.
974         (WebCore::CSSParserValue::createCSSValue): Deleted.
975         (WebCore::CSSParserSelector::parsePseudoElementSelector): Deleted.
976         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector): Deleted.
977         (WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector): Deleted.
978         (WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector): Deleted.
979         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector): Deleted.
980         (WebCore::CSSParserSelector::setPseudoClassValue): Deleted.
981         * css/parser/CSSParserValues.h:
982         (WebCore::CSSParserString::init): Deleted.
983         (WebCore::CSSParserString::clear): Deleted.
984         (WebCore::CSSParserString::is8Bit): Deleted.
985         (WebCore::CSSParserString::characters8): Deleted.
986         (WebCore::CSSParserString::characters16): Deleted.
987         (WebCore::CSSParserString::length): Deleted.
988         (WebCore::CSSParserString::setLength): Deleted.
989         (WebCore::CSSParserString::operator[]): Deleted.
990         (WebCore::CSSParserString::operator String): Deleted.
991         (WebCore::CSSParserString::operator AtomicString): Deleted.
992         (WebCore::CSSParserString::toStringView): Deleted.
993         (): Deleted.
994         (WebCore::CSSParserValueList::CSSParserValueList): Deleted.
995         (WebCore::CSSParserValueList::size): Deleted.
996         (WebCore::CSSParserValueList::currentIndex): Deleted.
997         (WebCore::CSSParserValueList::current): Deleted.
998         (WebCore::CSSParserValueList::next): Deleted.
999         (WebCore::CSSParserValueList::previous): Deleted.
1000         (WebCore::CSSParserValueList::setCurrentIndex): Deleted.
1001         (WebCore::CSSParserValueList::valueAt): Deleted.
1002         (WebCore::CSSParserValueList::clear): Deleted.
1003         (WebCore::CSSParserValue::setFromValueList): Deleted.
1004         (WebCore::equalLettersIgnoringASCIICase): Deleted.
1005         * css/parser/CSSPropertyParser.cpp:
1006         (WebCore::isCustomPropertyName):
1007         (WebCore::cssPropertyNameIOSAliasing):
1008         * css/parser/CSSPropertyParser.h:
1009         * css/parser/SVGCSSParser.cpp: Removed.
1010         * dom/InlineStyleSheetOwner.cpp:
1011         (WebCore::InlineStyleSheetOwner::createSheet):
1012         * inspector/InspectorStyleSheet.cpp:
1013         (WebCore::InspectorStyleSheet::ensureSourceData):
1014         (WebCore::InspectorStyleSheetForInlineStyle::ruleSourceData):
1015         * page/animation/AnimationController.cpp:
1016         * rendering/style/RenderStyle.cpp:
1017         * svg/SVGAnimateElementBase.cpp:
1018         * svg/SVGAnimationElement.cpp:
1019         * svg/SVGElement.cpp:
1020
1021 2016-12-10  Konstantin Tokarev  <annulen@yandex.ru>
1022
1023         [cmake] Include WTF, JSC, and WebCore headers automatically to targers using them
1024         https://bugs.webkit.org/show_bug.cgi?id=165686
1025
1026         Reviewed by Michael Catanzaro.
1027
1028         This change reduces duplication of include path lists between modules,
1029         and reduces future need for fixes like r209605 (broken build because of
1030         WebCore header suddenly becoming used in WebKit2).
1031
1032         No new tests needed.
1033
1034         * CMakeLists.txt:
1035         * PlatformEfl.cmake:
1036         * PlatformGTK.cmake:
1037         * PlatformMac.cmake:
1038         * PlatformWinCairo.cmake:
1039
1040 2016-12-10  Ryosuke Niwa  <rniwa@webkit.org>
1041
1042         Replace isUnclosedNode by isClosedShadowHidden
1043         https://bugs.webkit.org/show_bug.cgi?id=165722
1044
1045         Reviewed by Antti Koivisto.
1046
1047         Replaced Node::isUnclosedNode by Node::isClosedShadowHidden and negated the semantics as done in the spec:
1048         https://dom.spec.whatwg.org/#concept-closed-shadow-hidden
1049         https://github.com/whatwg/dom/pull/306
1050
1051         Also added a version which follows the spec text for a debug assertion.
1052
1053         No new tests since this has no behavioral change.
1054
1055         * dom/EventContext.h:
1056         (WebCore::EventContext::isUnreachableNode):
1057         * dom/EventPath.cpp:
1058         (WebCore::EventPath::computePathUnclosedToTarget):
1059         (WebCore::RelatedNodeRetargeter::checkConsistency):
1060         * dom/Node.cpp:
1061         (WebCore::isClosedShadowHiddenUsingSpecDefinition): Added to assert our implementation matches the spec text.
1062         (WebCore::Node::isClosedShadowHidden): Renamed from Node::isUnclosedNode and negated the return value.
1063         * dom/Node.h:
1064
1065 2016-12-10  Antti Koivisto  <antti@apple.com>
1066
1067         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
1068         https://bugs.webkit.org/show_bug.cgi?id=165652
1069         rdar://problem/28465278
1070
1071         Reviewed by Darin Adler.
1072
1073         No, test don't know how to get here.
1074
1075         * css/StyleBuilderConverter.h:
1076         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
1077
1078         Add type checks.
1079
1080 2016-12-10  Jiewen Tan  <jiewen_tan@apple.com>
1081
1082         [WebCrypto] RSA algorithms should allow importing keys without usages
1083         https://bugs.webkit.org/show_bug.cgi?id=165680
1084         <rdar://problem/29601354>
1085
1086         Reviewed by Brent Fulgham.
1087
1088         Tests: crypto/subtle/rsa-oaep-import-jwk-public-key-empty-usages.html
1089                crypto/subtle/rsa-oaep-import-spki-key-empty-usages.html
1090                crypto/subtle/rsaes-pkcs1-v1_5-import-jwk-public-key-empty-usages.html
1091                crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key-empty-usages.html
1092                crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-public-key-empty-usages.html
1093                crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key-empty-usages.html
1094
1095         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1096         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
1097         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1098         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
1099         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1100         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
1101
1102 2016-12-10  Frederic Wang  <fred.wang@free.fr>
1103
1104         Add STIX Two Math to the list of math fonts in mathml.css
1105         https://bugs.webkit.org/show_bug.cgi?id=165676
1106
1107         Reviewed by Darin Adler.
1108
1109         No new tests, this is just changing default style.
1110
1111         * css/mathml.css:
1112         (math):
1113
1114 2016-12-09  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1115
1116         [Readable Streams API] Implement ReadableByteStreamController desiredSize
1117         https://bugs.webkit.org/show_bug.cgi?id=165599
1118
1119         Reviewed by Darin Adler.
1120
1121         Implemented ReadableByteStreamController attribute desiredSize.
1122
1123         Added test to check desiredSize value.
1124
1125         * Modules/streams/ReadableByteStreamController.js:
1126         (desiredSize):
1127         * Modules/streams/ReadableByteStreamInternals.js:
1128         (readableByteStreamControllerGetDesiredSize):
1129
1130 2016-12-09  Ryosuke Niwa  <rniwa@webkit.org>
1131
1132         document.pointerLockElement exposes a node inside a shadow tree
1133         https://bugs.webkit.org/show_bug.cgi?id=165702
1134
1135         Reviewed by Simon Fraser.
1136
1137         Expose pointerLockElement on ShadowRoot as spec'ed (DocumentOrShadowRoot):
1138         https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin
1139
1140         Use ancestorElementInThisScope to find the correct node in pointerLockElement.
1141
1142         Tests: fast/shadow-dom/pointerlockelement-in-shadow-tree.html
1143                fast/shadow-dom/pointerlockelement-in-slot.html
1144
1145         * dom/Document.cpp:
1146         (WebCore::Document::pointerLockElement): Moved to TreeScope.
1147         * dom/Document.h:
1148         * dom/Document.idl: Moved ointerLockElement to DocumentOrShadowRoot.idl.
1149         * dom/DocumentOrShadowRoot.idl: Ditto.
1150         * dom/TreeScope.cpp:
1151         (WebCore::TreeScope::focusedElementInScope): Use documentScope instead of acessing it via m_rootNode.
1152         (WebCore::TreeScope::pointerLockElement): Moved from Document.
1153         * dom/TreeScope.h:
1154
1155 2016-12-09  Daniel Bates  <dabates@apple.com>
1156
1157         Add reflected nonce attribute to HTML Link element IDL
1158         https://bugs.webkit.org/show_bug.cgi?id=165709
1159
1160         Reviewed by Ryosuke Niwa.
1161
1162         Add the reflected nonce attribute to the HTML Link element IDL definition
1163         as per the HTML standard <https://html.spec.whatwg.org/multipage/semantics.html#the-link-element> (9 December 2016).
1164
1165         Test: fast/dom/nonce-attribute-reflection.html
1166
1167         * html/HTMLLinkElement.idl:
1168
1169 2016-12-09  Eric Carlson  <eric.carlson@apple.com>
1170
1171         Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
1172         https://bugs.webkit.org/show_bug.cgi?id=165251
1173
1174         Reviewed by Dean Jackson.
1175
1176         Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
1177         No new tests, covered by existing tests.
1178
1179         * Modules/mediastream/MediaStreamEvent.idl: Add "EnabledAtRuntime".
1180         * Modules/mediastream/NavigatorMediaDevices.idl: Ditto.
1181         * Modules/mediastream/NavigatorUserMedia.idl: Ditto.
1182         * Modules/mediastream/RTCDTMFToneChangeEvent.idl: Ditto.
1183         * Modules/mediastream/RTCIceCandidate.idl: Ditto.
1184         * Modules/mediastream/RTCPeerConnection.idl: Ditto.
1185         * Modules/mediastream/RTCRtpReceiver.idl: Ditto.
1186         * Modules/mediastream/RTCRtpSender.idl: Ditto.
1187         * Modules/mediastream/RTCRtpTransceiver.idl: Ditto.
1188         * Modules/mediastream/RTCSessionDescription.idl: Ditto.
1189         * Modules/mediastream/RTCTrackEvent.idl: Ditto.
1190
1191         * bindings/generic/RuntimeEnabledFeatures.cpp:
1192         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): Set m_isMediaStreamEnabled in the
1193           constructor instead of in reset() because the later is called by the Internals constructor,
1194           making it impossible to override the runtime flag from WTR or DRT.
1195         (WebCore::RuntimeEnabledFeatures::reset): Don't set m_isMediaStreamEnabled.
1196         * page/Settings.in: Add peerConnectionEnabled.
1197
1198 2016-12-09  Daniel Bates  <dabates@apple.com>
1199
1200         Remove QuickLook scheme from the list of secure schemes
1201         https://bugs.webkit.org/show_bug.cgi?id=165699
1202
1203         Reviewed by Andy Estes.
1204
1205         Following r207155 we use a unique origin for QuickLook documents. Unique origins are not
1206         subject to mixed content restrictions. Prior to r207155 QuickLook documents used the
1207         origin from which they were served. We added the QuickLook scheme to the list of secure
1208         schemes as a workaround to avoid mixed content errors when loading subresources in a
1209         QuickLook document served over HTTPS. Now that we use a unique origin for QuickLook
1210         documents we no longer need this workaround.
1211
1212         * platform/SchemeRegistry.cpp:
1213         (WebCore::secureSchemes):
1214
1215 2016-12-09  Brady Eidson  <beidson@apple.com>
1216
1217         Re-landing:
1218         Add _WKIconLoadingDelegate SPI.
1219         https://bugs.webkit.org/show_bug.cgi?id=164894
1220
1221         Reviewed by Alex Christensen.
1222
1223         No new tests (Manual testing possible in MiniBrowser now, WKTR tests coming soon in https://bugs.webkit.org/show_bug.cgi?id=164895).
1224
1225         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
1226
1227         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
1228
1229         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
1230
1231         * WebCore.xcodeproj/project.pbxproj:
1232
1233         * dom/Document.cpp:
1234         (WebCore::Document::implicitClose):
1235
1236         * html/LinkIconCollector.cpp:
1237         (WebCore::iconSize):
1238         (WebCore::compareIcons):
1239         * html/LinkIconCollector.h:
1240
1241         * loader/DocumentLoader.cpp:
1242         (WebCore::DocumentLoader::startIconLoading):
1243         (WebCore::DocumentLoader::didGetLoadDecisionForIcon):
1244         (WebCore::DocumentLoader::finishedLoadingIcon):
1245         * loader/DocumentLoader.h:
1246
1247         * loader/FrameLoaderClient.h:
1248
1249         * loader/icon/IconLoader.cpp:
1250         (WebCore::IconLoader::IconLoader):
1251         (WebCore::IconLoader::startLoading):
1252         (WebCore::IconLoader::notifyFinished):
1253         * loader/icon/IconLoader.h:
1254
1255         * platform/LinkIcon.h: Copied from Source/WebCore/html/LinkIconCollector.h.
1256         (WebCore::LinkIcon::encode):
1257         (WebCore::LinkIcon::decode):
1258
1259 2016-12-06  Jiewen Tan  <jiewen_tan@apple.com>
1260
1261         [Part 2 of 2] Add support for PKCS8 format while doing SubtleCrypto.importKey/exportKey
1262         https://bugs.webkit.org/show_bug.cgi?id=129978
1263         <rdar://problem/21799829>
1264
1265         Reviewed by Brent Fulgham.
1266
1267         This is part 2 of Bug 129978. In this patch, it adds the PKCS8 format support for
1268         SubtleCrypto.importKey/exportKey. Currently support algorithms are RSAES-PKCS1-v1_5,
1269         RSASSA-PKCS1-v1_5 and RSA-OAEP.
1270
1271         Tests: crypto/subtle/rsa-import-jwk-key-export-pkcs8-key.html
1272                crypto/subtle/rsa-import-pkcs8-key-export-jwk-key.html
1273                crypto/subtle/rsa-import-pkcs8-key-export-pkcs8-key.html
1274                crypto/subtle/rsa-oaep-generate-export-key-pkcs8.html
1275                crypto/subtle/rsa-oaep-import-pkcs8-key.html
1276                crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-pkcs8.html
1277                crypto/subtle/rsaes-pkcs1-v1_5-import-pkcs8-key.html
1278                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-pkcs8.html
1279                crypto/subtle/rsassa-pkcs1-v1_5-import-pkcs8-key.html
1280                crypto/workers/subtle/rsa-export-pkcs8-key.html
1281                crypto/workers/subtle/rsa-import-pkcs8-key.html
1282
1283         * bindings/js/JSSubtleCryptoCustom.cpp:
1284         (WebCore::toKeyData):
1285         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1286         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
1287         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
1288         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1289         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
1290         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
1291         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1292         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
1293         (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
1294         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
1295         (WebCore::CryptoKeyRSA::importPkcs8):
1296         (WebCore::CryptoKeyRSA::exportPkcs8):
1297         * crypto/keys/CryptoKeyRSA.h:
1298         * crypto/mac/CryptoKeyRSAMac.cpp:
1299         (WebCore::CryptoKeyRSA::importSpki):
1300         (WebCore::CryptoKeyRSA::importPkcs8):
1301         (WebCore::CryptoKeyRSA::exportPkcs8):
1302
1303 2016-12-09  Geoffrey Garen  <ggaren@apple.com>
1304
1305         Deploy OrdinalNumber in JSC::SourceCode
1306         https://bugs.webkit.org/show_bug.cgi?id=165687
1307
1308         Reviewed by Michael Saboff.
1309
1310         Updated for interface changes.
1311
1312         * bindings/js/ScriptController.cpp:
1313         (WebCore::ScriptController::evaluateModule):
1314         * bindings/js/ScriptSourceCode.h:
1315         (WebCore::ScriptSourceCode::startLine):
1316
1317 2016-12-09  Joseph Pecoraro  <pecoraro@apple.com>
1318
1319         Web Inspector: Some resources fetched via Fetch API do not have data
1320         https://bugs.webkit.org/show_bug.cgi?id=165230
1321         <rdar://problem/29449220>
1322
1323         Reviewed by Alex Christensen.
1324
1325         Tests: http/tests/inspector/network/fetch-response-body.html
1326                http/tests/inspector/network/xhr-response-body.html
1327
1328         * platform/network/ResourceRequestBase.h:
1329         Distinguish Fetch requests.
1330
1331         * Modules/fetch/FetchRequest.cpp:
1332         (WebCore::FetchRequest::initializeWith):
1333         Set the requester type as Fetch.
1334
1335         * loader/DocumentThreadableLoader.cpp:
1336         (WebCore::DocumentThreadableLoader::didReceiveResponse):
1337         * loader/DocumentThreadableLoader.h:
1338         * inspector/InspectorInstrumentation.cpp:
1339         (WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponseImpl):
1340         (WebCore::InspectorInstrumentation::didReceiveXHRResponseImpl): Deleted.
1341         * inspector/InspectorInstrumentation.h:
1342         (WebCore::InspectorInstrumentation::didReceiveResourceResponse):
1343         (WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponse):
1344         (WebCore::InspectorInstrumentation::didReceiveXHRResponse): Deleted.
1345         * inspector/InspectorNetworkAgent.cpp:
1346         (WebCore::InspectorNetworkAgent::didReceiveThreadableLoaderResponse):
1347         (WebCore::InspectorNetworkAgent::didFinishXHRLoading):
1348         (WebCore::InspectorNetworkAgent::didReceiveXHRResponse): Deleted.
1349         Add a generic way for a ThreadableLoader load to update the type of a network request.
1350         This will include both XHR and Fetch requests.
1351
1352         * inspector/InspectorPageAgent.cpp:
1353         (WebCore::hasTextContent):
1354         (WebCore::createXHRTextDecoder):
1355         (WebCore::InspectorPageAgent::resourceTypeJson):
1356         (WebCore::InspectorPageAgent::cachedResourceType):
1357         (WebCore::InspectorPageAgent::createTextDecoder):
1358         (WebCore::textContentForCachedResource):
1359         * inspector/InspectorPageAgent.h:
1360         * inspector/NetworkResourcesData.cpp:
1361         (WebCore::createOtherResourceTextDecoder): Deleted.
1362         Share the logic that creates a Text Decoders for XHR with other non-buffered requests
1363         (like Fetch). This moves us to identical behavior for now.
1364
1365         * platform/MIMETypeRegistry.cpp:
1366         (WebCore::MIMETypeRegistry::isSupportedJSONMIMEType):
1367         (WebCore::MIMETypeRegistry::isTextMIMEType):
1368         * platform/MIMETypeRegistry.h:
1369         Better detect different JSON content based on MIME Type.
1370
1371 2016-12-09  Ryosuke Niwa  <rniwa@webkit.org>
1372
1373         document.webkitFullscreenElement leaks elements inside a shadow tree
1374         https://bugs.webkit.org/show_bug.cgi?id=158471
1375
1376         Reviewed by Chris Dumez.
1377
1378         Fixed the bug by calling the newly added ancestorElementInThisScope in webkitCurrentFullScreenElementForBindings
1379         and webkitFullscreenElementForBinding.
1380
1381         The specification (https://fullscreen.spec.whatwg.org/#dom-document-fullscreenelement) uses "the result of
1382         retargeting fullscreen element" and returns null if the result is not in the same tree as the context object.
1383
1384         This is equivalent to the algorithm implemented by ancestorElementInThisScope. Observe that the retargeting
1385         algorithm (https://dom.spec.whatwg.org/#retarget) finds the lowest common tree scope of the retargetee and
1386         the context object. There are two cases to consider.
1387
1388         1. The context object's tree scope is the lowest common tree scope: In this case, an ancestor shadow host or
1389         the retargetee itself is in this tree scope. It's sufficient traverse every shadow host to find the one that
1390         resides in the same tree scope as the context object. This is precisely what ancestorElementInThisScope does.
1391
1392         2. The context object's tree scope is not the lowest common tree scope: In this case, the context object is
1393         inside a shadow tree whose ancestor shadow host is in the lowest common tree scope. In this case, retargeting
1394         algorithm finds a node which is not in the same tree as the context object. Thus, the result is null.
1395         ancestorElementInThisScope traveres ancestor shadow hosts and returns null if no shadow host's tree scope
1396         matches that of the context object's tree scope. Thus, it would return null in this case as desired.
1397
1398         Also renamed TreeScope::focusedElement to focusedElementInScope for clarity since Document which inherits
1399         from TreeScope also has a distinct member function named focusedElement called by TreeScope::focusedElement,
1400         and used ancestorElementInThisScope since it uses the same algorithm.
1401
1402         Tests: fast/shadow-dom/activeElement-for-focused-element-in-another-shadow.html
1403                fast/shadow-dom/blur-on-shadow-host-with-focused-shadow-content.html
1404                fast/shadow-dom/fullscreen-in-shadow-fullscreenElement.html
1405                fast/shadow-dom/fullscreen-in-shadow-webkitCurrentFullScreenElement.html
1406                fast/shadow-dom/fullscreen-in-slot-fullscreenElement.html
1407                fast/shadow-dom/fullscreen-in-slot-webkitCurrentFullScreenElement.html
1408
1409         * dom/Document.cpp:
1410         (WebCore::Document::removeFocusedNodeOfSubtree):
1411         (WebCore::Document::activeElement):
1412         * dom/Document.h:
1413         (WebCore::Document::webkitCurrentFullScreenElementForBindings): Added.
1414         (WebCore::Document::webkitFullscreenElementForBindings): Added.
1415         * dom/Document.idl:
1416         * dom/Element.cpp:
1417         (WebCore::Element::blur):
1418         * dom/ShadowRoot.h:
1419         (WebCore::ShadowRoot::activeElement):
1420         * dom/TreeScope.cpp:
1421         (WebCore::TreeScope::ancestorNodeInThisScope): Renamed from ancestorInThisScope for clarity.
1422         (WebCore::TreeScope::ancestorElementInThisScope):
1423         (WebCore::TreeScope::focusedElementInScope): Renamed from focusedElement to disambiguate it from Document's
1424         focusedElement.
1425         * dom/TreeScope.h:
1426         * editing/VisibleSelection.cpp:
1427         (WebCore::adjustPositionForEnd):
1428         (WebCore::adjustPositionForStart):
1429         * editing/htmlediting.cpp:
1430         (WebCore::comparePositions):
1431         (WebCore::firstEditablePositionAfterPositionInRoot):
1432         (WebCore::lastEditablePositionBeforePositionInRoot):
1433         * page/DOMSelection.cpp:
1434         (WebCore::selectionShadowAncestor):
1435         (WebCore::DOMSelection::shadowAdjustedNode):
1436         (WebCore::DOMSelection::shadowAdjustedOffset):
1437         * rendering/HitTestResult.cpp:
1438         (WebCore::HitTestResult::addNodeToRectBasedTestResult): Added a FIXME here since this is clearly wrong for
1439         shadow trees created by author scripts.
1440
1441 2016-12-09  Geoffrey Garen  <ggaren@apple.com>
1442
1443         TextPosition and OrdinalNumber should be more like idiomatic numbers
1444         https://bugs.webkit.org/show_bug.cgi?id=165678
1445
1446         Reviewed by Filip Pizlo.
1447
1448         * bindings/js/CachedScriptSourceProvider.h:
1449         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
1450         * bindings/js/JSEventListener.h:
1451         (WebCore::JSEventListener::sourcePosition):
1452         * bindings/js/JSLazyEventListener.cpp:
1453         (WebCore::JSLazyEventListener::JSLazyEventListener):
1454         * bindings/js/ScriptController.cpp:
1455         (WebCore::ScriptController::eventHandlerPosition):
1456         * bindings/js/ScriptSourceCode.h:
1457         (WebCore::ScriptSourceCode::ScriptSourceCode):
1458         * css/CSSStyleSheet.cpp:
1459         (WebCore::CSSStyleSheet::create):
1460         * dom/ScriptElement.h:
1461         * html/parser/HTMLTreeBuilder.cpp:
1462         (WebCore::uninitializedPositionValue1):
1463         * inspector/InspectorStyleSheet.cpp:
1464         (WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo): Adopt
1465         default construtor.
1466
1467         * xml/XMLErrors.cpp:
1468         (WebCore::XMLErrors::XMLErrors):
1469         (WebCore::XMLErrors::handleError):
1470         * xml/XMLErrors.h: Use std::optional instead of belowRangePosition()
1471         because in-band signaling is harder to reason about.
1472
1473         * xml/parser/XMLDocumentParserLibxml2.cpp:
1474         (WebCore::XMLDocumentParser::textPosition): Adopt default constructor.
1475
1476 2016-12-09  Chris Dumez  <cdumez@apple.com>
1477
1478         [Cocoa] Validation message for required checkbox doesn’t conform the the Apple Style Guide
1479         https://bugs.webkit.org/show_bug.cgi?id=165661
1480
1481         Reviewed by Dan Bernstein.
1482
1483         Update validation message as per Apple Style Guide.
1484
1485         * English.lproj/Localizable.strings:
1486         * platform/LocalizedStrings.cpp:
1487         (WebCore::validationMessageValueMissingForCheckboxText):
1488
1489 2016-12-09  Zalan Bujtas  <zalan@apple.com>
1490
1491         ASSERTION FAILED: !beforeChild->isRubyRun() in WebCore::RenderRubyAsBlock::addChild
1492         https://bugs.webkit.org/show_bug.cgi?id=141433
1493         <rdar://problem/27711351>
1494
1495         Reviewed by Dean Jackson.
1496
1497         Do not try to inject the list marker into a block ruby subtree. Have it as the sibling
1498         of the ruby instead (with an anonymous block wrapper ofc).
1499
1500         Test: fast/ruby/assert-with-listitem-and-block-ruby.html
1501
1502         * rendering/RenderListItem.cpp:
1503         (WebCore::getParentOfFirstLineBox):
1504
1505 2016-12-09  Antoine Quint  <graouts@apple.com>
1506
1507         [Modern Media Controls] Implement the pageScaleFactor property
1508         https://bugs.webkit.org/show_bug.cgi?id=165660
1509
1510         Reviewed by Dean Jackson.
1511
1512         We implement the pageScaleFactor property on MediaController. This property is set
1513         by the HTMLMediaElement when the page scale factor changes, and we only choose to handle
1514         it on iOS by setting controlsDependOnPageScaleFactor to true on the MediaControlsHost.
1515
1516         To do so, we now size the media controls by multiplying the layout size of the media by
1517         the page scale factor, and apply an inverse CSS zoom on the media controls themselves.
1518
1519         Test: media/modern-media-controls/media-controller/media-controller-scale-factor.html
1520
1521         * Modules/modern-media-controls/controls/media-controls.css:
1522         (.media-controls-container,):
1523         * Modules/modern-media-controls/controls/media-controls.js:
1524         (MediaControls.prototype.get scaleFactor):
1525         (MediaControls.prototype.set scaleFactor):
1526         (MediaControls.prototype.commitProperty):
1527         * Modules/modern-media-controls/media/media-controller.js:
1528         (MediaController):
1529         (MediaController.prototype.set pageScaleFactor):
1530         (MediaController.prototype._updateControlsSize):
1531         * html/HTMLMediaElement.cpp:
1532         (WebCore::controllerJSValue):
1533         (WebCore::HTMLMediaElement::setControllerJSProperty):
1534
1535         We no longer hit a JSC assertion when trying to set the pageScaleFactor property before
1536         the JS controller was actually created.
1537
1538 2016-12-09  Daniel Bates  <dabates@apple.com>
1539
1540         Attempt to fix the Mac CMake build following <http://trac.webkit.org/changeset/209549>
1541         (https://bugs.webkit.org/show_bug.cgi?id=165572)
1542
1543         Add directory html/canvas to the list of forwarding headers directories so that
1544         the Legacy WebKit Objective-C DOM binding DOMHTMLCanvasElement.mm can ultimately
1545         include header WebGLContextAttributes.h.
1546
1547         * PlatformMac.cmake:
1548
1549 2016-12-09  Brady Eidson  <beidson@apple.com>
1550
1551         LinkIconCollector refactoring.
1552         https://bugs.webkit.org/show_bug.cgi?id=165657
1553
1554         Reviewed by Dean Jackson.
1555
1556         No new tests (Refactor, no behavior change)
1557
1558         * WebCore.xcodeproj/project.pbxproj:
1559
1560         * html/LinkIconCollector.cpp:
1561         (WebCore::iconSize):
1562         (WebCore::compareIcons):
1563         * html/LinkIconCollector.h:
1564
1565         * platform/LinkIcon.h: Move outside of LinkIconCollector for future expandability.
1566
1567 2016-12-09  Ryan Haddad  <ryanhaddad@apple.com>
1568
1569         Unreviewed, rolling out r209574.
1570
1571         This change broke the Windows build.
1572
1573         Reverted changeset:
1574
1575         "[WebIDL] Remove custom bindings for Geolocation"
1576         https://bugs.webkit.org/show_bug.cgi?id=165625
1577         http://trac.webkit.org/changeset/209574
1578
1579 2016-12-09  Ryosuke Niwa  <rniwa@webkit.org>
1580
1581         Custom Elements from a different document are not customized when created with innerHTML
1582         https://bugs.webkit.org/show_bug.cgi?id=165617
1583
1584         Reviewed by Antti Koivisto.
1585
1586         The bug was caused by a superflous null check on window in createHTMLElementOrFindCustomElementInterface.
1587         Removed the nullcheck to fix the bug.
1588
1589         Test: fast/custom-elements/adopting-from-frameless-document.html
1590
1591         * html/parser/HTMLConstructionSite.cpp:
1592         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
1593
1594 2016-12-09  Daniel Bates  <dabates@apple.com>
1595
1596         [CSP] Policy of window opener not applied to about:blank window
1597         https://bugs.webkit.org/show_bug.cgi?id=165531
1598         <rdar://problem/29426639>
1599
1600         Reviewed by Brent Fulgham.
1601
1602         Fixes an issue where the content security policy of the opener document was not applied to
1603         an about:blank window.
1604
1605         An about:blank window inherits its security origin from its opener document. It should also
1606         copy (inherit) the ContentSecurityPolicy from its opener document. When copying the ContentSecurityPolicy
1607         state from the opener document to the about:blank document we must take care to avoid copying
1608         any upgrade-insecure-request directive because new windows should not inherit it by definition.
1609         With respect to upgrade-insecure-requests, new windows should only inherit the insecure navigation set
1610         from their opener document.
1611
1612         Test: http/tests/security/contentSecurityPolicy/image-blocked-in-about-blank-window.html
1613
1614         * dom/Document.cpp:
1615         (WebCore::Document::initContentSecurityPolicy): Copy the ContentSecurityPolicy state from the
1616         owner document to this document when it inherits its security origin from its owner. An about:blank
1617         window is one example of a document that inherits its security origin from its owner.
1618         * loader/WorkerThreadableLoader.cpp:
1619         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Call ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
1620         to copy the upgrade insecure requests state from the owner document to the worker now that
1621         ContentSecurityPolicy::copyStateFrom() no longer does this.
1622         * page/csp/ContentSecurityPolicy.cpp:
1623         (WebCore::ContentSecurityPolicy::copyStateFrom): Do not copy the upgrade insecure request state.
1624         Callers are now responsible for calling ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
1625         to copy this state.
1626         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1627         (WebCore::ContentSecurityPolicyDirectiveList::parse): Ignore directive upgrade-insecure-requests when
1628         inheriting ContentSecurityPolicy state as this directive as the Upgrade Insecure Requests feature has
1629         its own inheritance semantics that differ from the semantics of copying a ContentSecurityPolicy object.
1630         * xml/XSLTProcessor.cpp:
1631         (WebCore::XSLTProcessor::createDocumentFromSource): Call ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
1632         to copy the upgrade insecure requests state from the original document to the transformed document now
1633         that ContentSecurityPolicy::copyStateFrom() no longer does this.
1634
1635 2016-12-09  Antoine Quint  <graouts@apple.com>
1636
1637         [Modern Media Controls] Remaining time label first appears way to the left
1638         https://bugs.webkit.org/show_bug.cgi?id=165637
1639
1640         Reviewed by Dean Jackson.
1641
1642         We would sometimes see the remaining time label be laid out in an incorrect position
1643         when a video would start playing. This happened because the time label was being committed
1644         from a previous value before, in the same frame, we would call the layout() function
1645         of MacOSInlineMediaControls. This would set the newly computed location for the
1646         remaining time label, but because we would reset the list of dirty properties after
1647         calling all layout functions, the new value set in MacOSInlineMediaControls.layout()
1648         would be disregarded and the wrong, committed value would persist until it was reset
1649         in a much later frame.
1650
1651         We now correctly clear the list of dirty nodes before laying them out, giving all nodes
1652         a chance to become dirty again during layout, and updated again in the next frame.
1653
1654         Test: media/modern-media-controls/layout-node/node-made-dirty-during-layout.html
1655
1656         * Modules/modern-media-controls/controls/layout-node.js:
1657         (performScheduledLayout):
1658
1659 2016-12-09  Per Arne Vollan  <pvollan@apple.com>
1660
1661         Fix compile errors on Windows when building with .proj files.
1662
1663         Unreviewed build fix.
1664
1665         Fix include paths.
1666
1667         * platform/graphics/win/IntPointWin.cpp:
1668         * platform/graphics/win/IntRectWin.cpp:
1669         * platform/graphics/win/IntSizeWin.cpp:
1670
1671 2016-12-09  Csaba Osztrogonác  <ossy@webkit.org>
1672
1673         Unreviewed buildfix after r209570.
1674
1675         * bindings/js/JSDOMGlobalObject.cpp:
1676         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1677
1678 2016-12-01  Sergio Villar Senin  <svillar@igalia.com>
1679
1680         [css-grid] Pass Grid as argument to items' placement methods
1681         https://bugs.webkit.org/show_bug.cgi?id=165250
1682
1683         Reviewed by Darin Adler.
1684
1685         In order to constify computeIntrinsicLogicalWidths() it is required to constify
1686         placeItemsOnGrid() first, which is the base method of the grid items' positioning logic. The
1687         first step is to constify all the methods invoked by the latter, which basically means to
1688         pass the Grid as argument to all of them instead of directly using the m_grid attribute from
1689         RenderGrid. As this is an intermediate step, a new const_cast<> was required in the
1690         intrinsic size computation. However it will be promptly removed after the const-ification of
1691         placeItemsOnGrid().
1692
1693         After this, only the methods used by the track sizing algorithm will directly access
1694         m_grid. All those would get a reference to the Grid via GridSizingData, but that's a matter
1695         of a follow up patch.
1696
1697         Apart from that, m_gridIsDirty was removed because it was always too confusing. It was
1698         replaced by Grid's m_needsItemsPlacement which is much more concise. The clearGrid() call
1699         was indeed only forcing a new placement of the grid items.
1700
1701         No new tests as this is a refactoring.
1702
1703         * rendering/RenderGrid.cpp:
1704         (WebCore::RenderGrid::Grid::setNeedsItemsPlacement): New method to flag the Grid whenever
1705         grid items' placement algorithm needs to be run.
1706         (WebCore::RenderGrid::canPerformSimplifiedLayout):
1707         (WebCore::RenderGrid::layoutBlock):
1708         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
1709         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
1710         (WebCore::RenderGrid::placeItemsOnGrid):
1711         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Constified. Got Grid as
1712         argument.
1713         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid): Ditto.
1714         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Ditto.
1715         (WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Ditto.
1716         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Ditto.
1717         (WebCore::RenderGrid::clearGrid):
1718         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1719         (WebCore::RenderGrid::numTracks):
1720         * rendering/RenderGrid.h:
1721
1722 2016-12-09  Gavin Barraclough  <barraclough@apple.com>
1723
1724         Revert - Add _WKIconLoadingDelegate SPI
1725         https://bugs.webkit.org/show_bug.cgi?id=164894
1726
1727         Unreviewed rollout due to performance regression.
1728
1729         * WebCore.xcodeproj/project.pbxproj:
1730         * dom/Document.cpp:
1731         (WebCore::Document::implicitClose):
1732         * html/LinkIconCollector.cpp:
1733         (WebCore::iconSize):
1734         (WebCore::compareIcons):
1735         * html/LinkIconCollector.h:
1736         * loader/DocumentLoader.cpp:
1737         (WebCore::DocumentLoader::startIconLoading): Deleted.
1738         (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Deleted.
1739         (WebCore::DocumentLoader::finishedLoadingIcon): Deleted.
1740         * loader/DocumentLoader.h:
1741         * loader/FrameLoaderClient.h:
1742         * loader/icon/IconLoader.cpp:
1743         (WebCore::IconLoader::IconLoader):
1744         (WebCore::IconLoader::startLoading):
1745         (WebCore::IconLoader::notifyFinished):
1746         * loader/icon/IconLoader.h:
1747         * platform/LinkIcon.h: Removed.
1748
1749 2016-12-08  Jiewen Tan  <jiewen_tan@apple.com>
1750
1751         [WebCrypto] Remove NoInterfaceObject attribute from SubtleCrypto Interface
1752         https://bugs.webkit.org/show_bug.cgi?id=165629
1753         <rdar://problem/29586203>
1754
1755         Reviewed by Chris Dumez.
1756
1757         Covered by existing tests.
1758
1759         * crypto/SubtleCrypto.idl:
1760
1761 2016-12-08  Keith Rollin  <krollin@apple.com>
1762
1763         FileHandle::printf doesn't build on Windows
1764         https://bugs.webkit.org/show_bug.cgi?id=165642
1765
1766         Reviewed by Ryosuke Niwa.
1767
1768         Fix the build -- vasprintf does not exist on Windows, so make
1769         FileHandle::printf a no-op on that platform.
1770
1771         No new tests -- affected facility is currently only used in testing
1772         code and is not user reachable.
1773
1774         * platform/FileHandle.cpp:
1775         (WebCore::FileHandle::printf):
1776
1777 2016-12-08  Antoine Quint  <graouts@apple.com>
1778
1779         [Modern Media Controls] Exiting fullscreen with paused media shows the start button
1780         https://bugs.webkit.org/show_bug.cgi?id=165640
1781
1782         Reviewed by Dean Jackson.
1783
1784         Like all supporting objects, the StartSupport instance gets recreated when creating controls
1785         for new layout traits, which happens when going from fullscreen to inline. Due to this, the
1786         "_isPlayed" property is not longer set to true, even if the media has played prior to being
1787         paused in fullscreen. We now also check the media's played range to identify whether media
1788         has been played.
1789
1790         * Modules/modern-media-controls/media/start-support.js:
1791         (StartSupport.prototype._shouldShowStartButton):
1792         (StartSupport):
1793
1794 2016-12-08  Myles C. Maxfield  <mmaxfield@apple.com>
1795
1796         ASSERTION FAILED: locale in WebCore::lastHyphenLocation
1797         https://bugs.webkit.org/show_bug.cgi?id=164182
1798
1799         Reviewed by Zalan Bujtas.
1800
1801         Our hyphenation code assumes the locale is in a small set of known locales.
1802         However, web content can put whatever string it wants in the locale field.
1803
1804         Test: fast/text/hyphenation-unknown-locale.html
1805
1806         * platform/text/cf/HyphenationCF.cpp:
1807         (WebCore::lastHyphenLocation):
1808         * rendering/RenderText.cpp:
1809         (WebCore::maxWordFragmentWidth): When computing the minimum preferred width of
1810         an element, we want to know the size of the widest nonbreakable unit. When
1811         hyphenation is enabled, we have to measure the width of each fragment of each
1812         word (where "fragment" is determined by a substring between two successive
1813         hyphenation points, appended with a hyphen character). A hyphenation point at
1814         string offset 0 is irrelevant for this purpose, because it would lead to an
1815         empty fragment. Therefore, skip this situation.
1816
1817 2016-12-08  David Kilzer  <ddkilzer@apple.com>
1818
1819         Always check the return value of pthread_key_create()
1820         <https://webkit.org/b/165274>
1821
1822         Reviewed by Darin Adler.
1823
1824         * platform/ios/wak/WebCoreThread.mm:
1825         (InitThreadContextKey): Call CRASH() if pthread_key_create()
1826         returns an error.  The error code will be stored in a register
1827         available in a crash log, so no need to log the value
1828         explicitly.
1829
1830 2016-12-08  Alex Christensen  <achristensen@webkit.org>
1831
1832         Reduce PassRefPtr use in platform/graphics
1833         https://bugs.webkit.org/show_bug.cgi?id=165636
1834
1835         Reviewed by Dean Jackson.
1836
1837         No change in behavior.
1838
1839         * platform/graphics/GraphicsContext3D.h:
1840         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
1841         (WebCore::DisplayRefreshMonitorMac::create):
1842         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1843         (WebCore::GraphicsContext3D::createForCurrentGLContext):
1844         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
1845
1846 2016-12-08  Keith Rollin  <krollin@apple.com>
1847
1848         Move FileHandle to WebCore FileHandle.h
1849         https://bugs.webkit.org/show_bug.cgi?id=165562
1850
1851         Reviewed by Alex Christensen.
1852
1853         Add FileHandle, a small wrapper around FileSystem facilities to manage
1854         the lifetime of an open file and give the facilities a C++ interface.
1855
1856         No new tests -- affected facility is currently only used in testing
1857         code and is not user reachable.
1858
1859         * CMakeLists.txt:
1860         * WebCore.xcodeproj/project.pbxproj:
1861         * platform/FileHandle.cpp: Added.
1862         (WebCore::FileHandle::FileHandle):
1863         (WebCore::FileHandle::~FileHandle):
1864         (WebCore::FileHandle::operator=):
1865         (WebCore::FileHandle::operator bool):
1866         (WebCore::FileHandle::open):
1867         (WebCore::FileHandle::read):
1868         (WebCore::FileHandle::write):
1869         (WebCore::FileHandle::printf):
1870         (WebCore::FileHandle::close):
1871         * platform/FileHandle.h: Added.
1872
1873 2016-12-07  Ryosuke Niwa  <rniwa@webkit.org>
1874
1875         ASSERTION FAILED: m_items.isEmpty() in CustomElementReactionQueue destructor
1876         https://bugs.webkit.org/show_bug.cgi?id=162029
1877         <rdar://problem/28945851>
1878
1879         Reviewed by Chris Dumez.
1880
1881         The bug was caused by Document::removedLastRef enqueuing disconnectedCallback during a tear down.
1882         Don't enqueue a disconnectedCallback while a document is getting torn down since that should not be
1883         observable to author scripts. The connected, adopted, and attributeChanged callbacks are immune from
1884         this problem since they don't happen during a document destruction.
1885
1886         Note that this was also the case prior to this patch since the disconnectedCallback would have been
1887         added to the current CustomElementReactionQueue which will be destructed without invoking callbacks
1888         (or hit a release assertion added in r208785 and r209426 for now).
1889
1890         Tests: fast/custom-elements/disconnected-callback-in-detached-iframe.html
1891                fast/custom-elements/element-queue-during-document-destruction.html
1892
1893         * dom/CustomElementReactionQueue.cpp:
1894         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Added an assertion that
1895         document's refCount hasn't reached zero yet.
1896         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Fixed the bug.
1897         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Added the same assertion.
1898         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto.
1899
1900 2016-12-08  Daniel Bates  <dabates@apple.com>
1901
1902         Add Strict Mixed Content Checking and Upgrade Insecure Requests to WebKit Feature Status dashboard
1903         https://bugs.webkit.org/show_bug.cgi?id=165635
1904
1905         Rubber-stamped by Ryosuke Niwa.
1906
1907         * features.json:
1908
1909 2016-12-08  Daniel Bates  <dabates@apple.com>
1910
1911         Implement Strict Mixed Content Checking
1912         https://bugs.webkit.org/show_bug.cgi?id=165438
1913         <rdar://problem/26103867>
1914
1915         Reviewed by Brent Fulgham and Andy Estes.
1916
1917         Add support for the CSP directive block-all-mixed-content to enable strict mixed content checking
1918         as per <https://www.w3.org/TR/2016/CR-mixed-content-20160802/#strict-checking> (2 August 2016).
1919
1920         Currently WebKit only blocks blockable content as such content can contaminate the security origin
1921         that loaded it. Optionally-blockable content, including images, would be allowed to load as mixed
1922         content. When strict mixed content checking is enabled all mixed content is blocked. That is, both
1923         blockable and optionally-blockable content will be blocked. A web site can opt into strict mixed
1924         content checking by adding the directive block-all-mixed-content to their content security policy.
1925
1926         Tests: http/tests/security/contentSecurityPolicy/block-all-mixed-content/data-url-iframe-in-main-frame.html
1927                http/tests/security/contentSecurityPolicy/block-all-mixed-content/duplicate-directive.html
1928                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only.html
1929                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe.html
1930                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame.html
1931                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-iframe.html
1932                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html
1933                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-blob-url-iframe-in-iframe.html
1934                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-enforced-and-report-policies.html
1935                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-inherited-policy.html
1936                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe.html
1937                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-javascript-url-iframe-in-iframe.html
1938                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-main-frame.html
1939                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-xslt-document-in-iframe-with-inherited-policy.html
1940                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-iframe.html
1941                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-main-frame.html
1942                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-with-inherited-policy.html
1943                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe.html
1944                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-main-frame.html
1945                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe.html
1946                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame.html
1947                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-iframe.html
1948                http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-main-frame.html
1949                http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-in-iframe.html
1950                http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-redirect-in-iframe.html
1951
1952         * dom/Document.cpp:
1953         (WebCore::Document::initSecurityContext): Inherit strict mixed content checking mode from parent document.
1954         * dom/SecurityContext.h:
1955         (WebCore::SecurityContext::isStrictMixedContentMode): Added.
1956         (WebCore::SecurityContext::setStrictMixedContentMode): Added.
1957         * loader/DocumentLoader.cpp:
1958         (WebCore::DocumentLoader::willSendRequest): Check mixed content policy with respect to the current frame.
1959         The document in the current frame may have opted into strict mixed content checking or inherited it from
1960         its parent document.
1961         * loader/DocumentWriter.cpp:
1962         (WebCore::DocumentWriter::begin): Inherit the strict mixed content checking mode from the owner document
1963         when loading a JavaScript URL in a frame (e.g. <iframe src="javascript:...">) because such URLs inherit
1964         the security origin of their parent document.
1965         * loader/MixedContentChecker.cpp:
1966         (WebCore::MixedContentChecker::canDisplayInsecureContent): Check the content security policy of the document
1967         and the strict mixed content checking mode bit on the document (in that order) to determine if we are in
1968         strict mode. Block display of insecure content when in strict mode. Modified to take enum AlwaysDisplayInNonStrictMode (defaults
1969         to AlwaysDisplayInNonStrictMode::No) as to whether to allow our current relaxed behavior of displaying insecure
1970         content in non-strict mode.
1971         (WebCore::MixedContentChecker::canRunInsecureContent): Check the content security policy of the document
1972         and the strict mixed content checking mode bit on the document (in that order) to determine if we are in
1973         strict mode. Block running of insecure content when in strict mode.
1974         * loader/MixedContentChecker.h:
1975         * loader/cache/CachedResourceLoader.cpp:
1976         (WebCore::CachedResourceLoader::checkInsecureContent): Always check mixed content policy with respect to
1977         the current frame. The document in the current frame may have opted into strict mixed content checking or
1978         inherited it from its parent document. Also renamed a local variable f to frame to better describe its
1979         purpose.
1980         * page/csp/ContentSecurityPolicy.cpp:
1981         (WebCore::ContentSecurityPolicy::allowRunningOrDisplayingInsecureContent): Added. Iterate through all the
1982         policies and report violations with respect to policies that have directive block-all-mixed-content.
1983         (WebCore::ContentSecurityPolicy::didReceiveHeader): Move logic to set eval() error message from here...
1984         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): ...to here so that we only perform
1985         it once we are ready to apply the CSP policy to the script execution context. Additionally, enable
1986         strict mixed content checking on the script execution context if applicable.
1987         (WebCore::ContentSecurityPolicy::reportViolation): Added overrides that take a string and a directive list
1988         object (ContentSecurityPolicyDirectiveList) for the effective violated directive and its associated directive
1989         list, respectively. We make use of these overrides so as to support reporting block-all-mixed-content
1990         violations, which are not implemented using a ContentSecurityPolicyDirective object as it seemed sufficient
1991         to implement it as a boolean on ContentSecurityPolicyDirectiveList.
1992         * page/csp/ContentSecurityPolicy.h:
1993         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1994         (WebCore::ContentSecurityPolicyDirectiveList::setBlockAllMixedContentEnabled): Added.
1995         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Parse the directive block-all-mixed-content.
1996         * page/csp/ContentSecurityPolicyDirectiveList.h:
1997         (WebCore::ContentSecurityPolicyDirectiveList::hasBlockAllMixedContentDirective): Added.
1998         * page/csp/ContentSecurityPolicyDirectiveNames.cpp:
1999         * page/csp/ContentSecurityPolicyDirectiveNames.h: Add constant for "block-all-mixed-content".
2000
2001 2016-12-08  Sam Weinig  <sam@webkit.org>
2002
2003         [WebIDL] Remove custom bindings for Geolocation
2004         https://bugs.webkit.org/show_bug.cgi?id=165625
2005
2006         Reviewed by Alex Christensen.
2007
2008         * CMakeLists.txt:
2009         * DerivedSources.cpp:
2010         * DerivedSources.make:
2011         * WebCore.xcodeproj/project.pbxproj:
2012         * bindings/js/JSBindingsAllInOne.cpp:
2013         Add/remove files.
2014
2015         * Modules/geolocation/GeoNotifier.cpp:
2016         (WebCore::GeoNotifier::GeoNotifier):
2017         (WebCore::GeoNotifier::hasZeroTimeout):
2018         (WebCore::GeoNotifier::startTimerIfNeeded):
2019         * Modules/geolocation/GeoNotifier.h:
2020         (WebCore::GeoNotifier::create):
2021         (WebCore::GeoNotifier::options):
2022         Update to store PositionOptions as a value, and pass the PositionCallback
2023         as a Ref, rather than a RefPtr, since it is not optional.
2024
2025         * Modules/geolocation/Geolocation.cpp:
2026         (WebCore::createGeoposition):
2027         Use auto, to get the good type for Coordinates (Ref).
2028
2029         (WebCore::Geolocation::getCurrentPosition):
2030         (WebCore::Geolocation::watchPosition):
2031         (WebCore::Geolocation::haveSuitableCachedPosition):
2032         (WebCore::Geolocation::startUpdating):
2033         * Modules/geolocation/Geolocation.h:
2034         Update to pass PositionOptions itself now that it is a plain struct.
2035
2036         * Modules/geolocation/Geolocation.idl:
2037         Remove [Custom] extended attribute and add FIXME about nullable annotation. 
2038
2039         * Modules/geolocation/Geoposition.h:
2040         Pass/store Coordinates as a Ref.
2041  
2042         * Modules/geolocation/PositionOptions.h:
2043         Convert to be a simple struct.
2044
2045         * Modules/geolocation/PositionOptions.idl:
2046         Added.
2047         
2048         * bindings/js/JSGeolocationCustom.cpp:
2049         Removed.
2050
2051 2016-12-08  Alex Christensen  <achristensen@webkit.org>
2052
2053         REGRESSION (URL parser): Relative URLs aren’t resolved correctly when the base URL is an applewebdata: URL
2054         https://bugs.webkit.org/show_bug.cgi?id=165621
2055
2056         Reviewed by Dan Bernstein.
2057
2058         Covered by new API tests.
2059
2060         * platform/URLParser.cpp:
2061         (WebCore::URLParser::parse):
2062         URLs with nonspecial schemes and no slash after the host get no slash as the path to maintain compatibility with all browsers.
2063         This was proposed to the URL spec in https://github.com/whatwg/url/issues/148
2064         When such as URL is used as a base URL with a relative path, in order to maintain compatibility with URL::parse we need to prepend
2065         a slash to the path.  For completeness I added tests with a relative path, a relative query, a relative fragment, and a relative empty string,
2066         and because the fate of the spec is unclear in this case, I decided to maintain compatibility with URL::parse in all these cases.
2067
2068 2016-12-06  Filip Pizlo  <fpizlo@apple.com>
2069
2070         Concurrent GC should be stable enough to land enabled on X86_64
2071         https://bugs.webkit.org/show_bug.cgi?id=164990
2072
2073         Reviewed by Geoffrey Garen.
2074         
2075         Made WebCore down with concurrent marking by adding some locking and adapting to some new API.
2076
2077         This has new test modes in run-sjc-stress-tests. Also, the way that LayoutTests run is already
2078         a fantastic GC test.
2079
2080         * ForwardingHeaders/heap/DeleteAllCodeEffort.h: Added.
2081         * ForwardingHeaders/heap/LockDuringMarking.h: Added.
2082         * bindings/js/GCController.cpp:
2083         (WebCore::GCController::deleteAllCode):
2084         (WebCore::GCController::deleteAllLinkedCode):
2085         * bindings/js/GCController.h:
2086         * bindings/js/JSDOMBinding.cpp:
2087         (WebCore::getCachedDOMStructure):
2088         (WebCore::cacheDOMStructure):
2089         * bindings/js/JSDOMGlobalObject.cpp:
2090         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2091         (WebCore::JSDOMGlobalObject::visitChildren):
2092         * bindings/js/JSDOMGlobalObject.h:
2093         (WebCore::getDOMConstructor):
2094         * bindings/js/JSDOMPromise.cpp:
2095         (WebCore::DeferredPromise::DeferredPromise):
2096         (WebCore::DeferredPromise::clear):
2097         * bindings/js/JSXPathResultCustom.cpp:
2098         (WebCore::JSXPathResult::visitAdditionalChildren):
2099         * dom/EventListenerMap.cpp:
2100         (WebCore::EventListenerMap::clear):
2101         (WebCore::EventListenerMap::replace):
2102         (WebCore::EventListenerMap::add):
2103         (WebCore::EventListenerMap::remove):
2104         (WebCore::EventListenerMap::find):
2105         (WebCore::EventListenerMap::removeFirstEventListenerCreatedFromMarkup):
2106         (WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
2107         (WebCore::EventListenerIterator::EventListenerIterator):
2108         * dom/EventListenerMap.h:
2109         (WebCore::EventListenerMap::lock):
2110         * dom/EventTarget.cpp:
2111         (WebCore::EventTarget::visitJSEventListeners):
2112         * dom/EventTarget.h:
2113         (WebCore::EventTarget::visitJSEventListeners): Deleted.
2114         * dom/Node.cpp:
2115         (WebCore::Node::eventTargetDataConcurrently):
2116         (WebCore::Node::ensureEventTargetData):
2117         (WebCore::Node::clearEventTargetData):
2118         * dom/Node.h:
2119         * page/MemoryRelease.cpp:
2120         (WebCore::releaseCriticalMemory):
2121         * page/cocoa/MemoryReleaseCocoa.mm:
2122         (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
2123         (WebCore::registerMemoryReleaseNotifyCallbacks):
2124
2125 2016-12-08  Dave Hyatt  <hyatt@apple.com>
2126
2127         [CSS Parser] Add strict checking for right parens to selector functions like :matches, :not etc.
2128         https://bugs.webkit.org/show_bug.cgi?id=165624
2129
2130         Reviewed by Dean Jackson.
2131
2132         Unskipped fast/selectors/invalid-functional-pseudo-class.html.
2133
2134         * css/parser/CSSSelectorParser.cpp:
2135         (WebCore::CSSSelectorParser::consumePseudo):
2136         Bail if we don't actually consume a right parenthesis.
2137
2138 2016-12-08  Jeremy Jones  <jeremyj@apple.com>
2139
2140         Exit fullscreen on escape key down, not up.
2141         https://bugs.webkit.org/show_bug.cgi?id=165618
2142         rdar://problem/29581688
2143
2144         This problem was introduced by https://bugs.webkit.org/show_bug.cgi?id=165416
2145         The fix to only exit fullscreen on key down, not key up.
2146
2147         Reviewed by Jer Noble.
2148
2149         * page/EventHandler.cpp:
2150         (WebCore::EventHandler::keyEvent):
2151
2152 2016-12-08  Dave Hyatt  <hyatt@apple.com>
2153
2154         [CSS Parser] Unskip background parsing tests
2155         https://bugs.webkit.org/show_bug.cgi?id=165619
2156
2157         Reviewed by Zalan Bujtas.
2158
2159         Change background-position so that the origin being set is tracked
2160         on a per-x/y basis instead of as a single boolean. The single boolean
2161         caused lousy computed style dumping, since we would switch into verbose
2162         mode for both x and y, even if only one of them had a pair set for it.
2163
2164         * css/CSSComputedStyleDeclaration.cpp:
2165         (WebCore::createPositionListForLayer):
2166         * css/StyleBuilderConverter.h:
2167         (WebCore::StyleBuilderConverter::convertPositionComponent):
2168         * rendering/style/FillLayer.cpp:
2169         (WebCore::FillLayer::FillLayer):
2170         (WebCore::FillLayer::operator=):
2171         (WebCore::FillLayer::fillUnsetProperties):
2172         * rendering/style/FillLayer.h:
2173         (WebCore::FillLayer::isBackgroundXOriginSet):
2174         (WebCore::FillLayer::isBackgroundYOriginSet):
2175         (WebCore::FillLayer::setBackgroundXOrigin):
2176         (WebCore::FillLayer::setBackgroundYOrigin):
2177         (WebCore::FillLayer::clearXPosition):
2178         (WebCore::FillLayer::clearYPosition):
2179         (WebCore::FillLayer::isBackgroundOriginSet): Deleted.
2180
2181 2016-12-08  Jeremy Jones  <jeremyj@apple.com>
2182
2183         pointer lock should exit when a js alert is shown
2184         https://bugs.webkit.org/show_bug.cgi?id=165423
2185         rdar://problem/29430803
2186
2187         Reviewed by Jer Noble.
2188
2189         Test: pointer-lock/lock-lost-on-alert.html
2190
2191         * page/DOMWindow.cpp:
2192         (WebCore::DOMWindow::alert):
2193         (WebCore::DOMWindow::confirm):
2194         (WebCore::DOMWindow::prompt):
2195
2196 2016-12-07  Sam Weinig  <sam@webkit.org>
2197
2198         [WebIDL] WebGLContextAttributes should be a dictionary
2199         https://bugs.webkit.org/show_bug.cgi?id=165572
2200
2201         Reviewed by Dean Jackson.
2202
2203         * CMakeLists.txt:
2204         * WebCore.xcodeproj/project.pbxproj:
2205         Remove unused files.
2206
2207         * bindings/js/JSHTMLCanvasElementCustom.cpp:
2208         (WebCore::JSHTMLCanvasElement::getContext):
2209         (WebCore::attributesFor3DContext): Deleted.
2210         Re-work getContext to use JSDOMConvert and use the WebGLContextAttributes dictionary.
2211
2212         * bindings/scripts/CodeGeneratorJS.pm:
2213         (NativeToJSValueDOMConvertNeedsState):
2214         (NativeToJSValueDOMConvertNeedsGlobalObject):
2215         Add missing inclusion of dictionaries.
2216
2217         * html/HTMLCanvasElement.cpp:
2218         (WebCore::maxActivePixelMemory):
2219         (WebCore::HTMLCanvasElement::getContext):
2220         (WebCore::HTMLCanvasElement::is2dType):
2221         (WebCore::HTMLCanvasElement::getContext2d):
2222         (WebCore::shouldEnableWebGL):
2223         (WebCore::HTMLCanvasElement::is3dType):
2224         (WebCore::HTMLCanvasElement::getContextWebGL):
2225         * html/HTMLCanvasElement.h:
2226         Refactor context creation of 2d and WebGL contexts into their own functions. Make the 
2227         WebGL one take a WebGLContextAttributes struct.
2228
2229         * html/HTMLCanvasElement.idl:
2230         No functionality change. Make IDL match the latest spec.
2231
2232         * html/canvas/CanvasContextAttributes.cpp: Removed.
2233         * html/canvas/CanvasContextAttributes.h: Removed.
2234         Remove unneeded base class.
2235
2236         * html/canvas/WebGLContextAttributes.cpp: Removed.
2237         * html/canvas/WebGLContextAttributes.h:
2238         Instead of a class, we can use a type alias of GraphicsContext3D::Attributes for
2239         WebGLContextAttributes.
2240
2241         * html/canvas/WebGLContextAttributes.idl:
2242         Convert to a dictionary.
2243
2244         * html/canvas/WebGL2RenderingContext.cpp:
2245         * html/canvas/WebGL2RenderingContext.h:
2246         * html/canvas/WebGLRenderingContextBase.cpp:
2247         (WebCore::WebGLRenderingContextBase::create):
2248         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2249         (WebCore::WebGLRenderingContextBase::clearIfComposited):
2250         (WebCore::WebGLRenderingContextBase::getContextAttributes):
2251         (WebCore::WebGLRenderingContextBase::applyStencilTest):
2252         * html/canvas/WebGLRenderingContextBase.h:
2253         Update to WebGLContextAttributes by value, since it is a simple struct now. Update getContextAttributes
2254         to return a std::optional<WebGLContextAttributes>.
2255
2256         * html/canvas/WebGLRenderingContextBase.idl:
2257         Make getContextAttributes return a nullable WebGLContextAttributes, as per spec.
2258         
2259         * platform/graphics/GraphicsContext3D.h:
2260         Sort attributes into categories, one that match WebGLContextAttributes, and the remainder.
2261
2262 2016-12-08  Zalan Bujtas  <zalan@apple.com>
2263
2264         Do not create multicolumn context for certain type of renderers.
2265         https://bugs.webkit.org/show_bug.cgi?id=135601
2266         <rdar://problem/27686300>
2267
2268         Reviewed by David Hyatt.
2269
2270         Certain type of renderers including forms should not initialize multicolumn context for
2271         their inner (shadow) content. It just does not makes sense and is inline with what other browsers do.
2272
2273         Test: fast/multicol/no-multicol-for-textareas.html
2274
2275         * rendering/RenderBlockFlow.cpp:
2276         (WebCore::RenderBlockFlow::willCreateColumns):
2277         (WebCore::RenderBlockFlow::requiresColumns):
2278         * rendering/RenderBlockFlow.h:
2279
2280 2016-12-08  Dave Hyatt  <hyatt@apple.com>
2281
2282         [CSS Parser] REGRESSION: Values of 0 should not be allowed for -webkit-aspect-ratio
2283         https://bugs.webkit.org/show_bug.cgi?id=165607
2284
2285         Reviewed by Simon Fraser.
2286
2287         Unskipped fast/css/aspect-ratio-parsing-tests.html.
2288
2289         * css/parser/CSSPropertyParser.cpp:
2290         (WebCore::consumeWebkitAspectRatio):
2291         Don't allow 0 as either the left or right value of the ratio.
2292
2293 2016-12-08  Antti Koivisto  <antti@apple.com>
2294
2295         ::after and ::before don't work on :host
2296         https://bugs.webkit.org/show_bug.cgi?id=164675
2297         <rdar://problem/29231874>
2298
2299         Reviewed by Andreas Kling.
2300
2301         We didn't allow combining :host with any other selectors. Pseudo elements should be allowed.
2302
2303         Test: fast/shadow-dom/shadow-host-with-before-after.html
2304
2305         * css/ElementRuleCollector.cpp:
2306         (WebCore::ElementRuleCollector::matchAuthorRules):
2307
2308             Allow pseudo element matching.
2309
2310         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
2311
2312             Use the normal collectMatchingRulesForList path instead of a direct call to SelectorChecker::matchHostPseudoClass.
2313             This path supports pseudo elements.
2314
2315             Pass the information that we are matching :host rules with m_isMatchingHostPseudoClass bit
2316             similarly to how this is done with slots.
2317
2318         (WebCore::ElementRuleCollector::ruleMatches):
2319         * css/ElementRuleCollector.h:
2320         * css/RuleSet.cpp:
2321
2322             Collect :host rules similarly to other rules.
2323
2324         (WebCore::RuleSet::addRule):
2325         * css/SelectorChecker.cpp:
2326
2327             Rename didMoveToShadowHost->mayMatchHostPseudoClass for clarity.
2328
2329         (WebCore::SelectorChecker::match):
2330
2331             Enable :host matching in the current context immediately if needed.
2332
2333         (WebCore::SelectorChecker::matchHostPseudoClass):
2334
2335             The check for illegal combinations with :host is now done in checkOne().
2336
2337         (WebCore::localContextForParent):
2338         (WebCore::SelectorChecker::checkOne):
2339
2340             In context where :host matches nothing else can match, except pseudo elements.
2341
2342         * css/SelectorChecker.h:
2343
2344 2016-12-08  Alex Christensen  <achristensen@webkit.org>
2345
2346         Fix CMake build.
2347
2348         * PlatformMac.cmake:
2349         Add PerformanceLoggingCocoa.mm after r209181.
2350
2351 2016-12-08  Per Arne Vollan  <pvollan@apple.com>
2352
2353         [Win] Some versions of Cygwin Perl generate incorrect C++ code.
2354         https://bugs.webkit.org/show_bug.cgi?id=165524
2355         rdar://problem/29508043
2356
2357         Reviewed by Daniel Bates.
2358
2359         Perl strings with variables seems to be handled differently, depending on which version of
2360         Cygwin Perl you are running. To make sure they are handled identically, specify variables
2361         in strings as "${var}" instead of "$var".
2362
2363         * bindings/scripts/CodeGeneratorJS.pm:
2364         (GenerateHeader):
2365         (GenerateImplementation):
2366
2367 2016-12-08  Alex Christensen  <achristensen@webkit.org>
2368
2369         Fix EFL build after r209526
2370         https://bugs.webkit.org/show_bug.cgi?id=165594
2371
2372         * css/parser/CSSPropertyParserHelpers.cpp:
2373         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
2374         nullptr is being automatically converted to false everywhere but EFL.
2375         It should be false.  This function returns a bool.
2376
2377 2016-12-07  Dave Hyatt  <hyatt@apple.com>
2378
2379         REGRESSION: font shorthand parsing is broken
2380         https://bugs.webkit.org/show_bug.cgi?id=165594
2381
2382         Reviewed by Zalan Bujtas.
2383
2384         Unskipping fast/css/font-calculated-value.html.
2385
2386         * css/parser/CSSPropertyParser.cpp:
2387         (WebCore::consumeFontWeight):
2388         The new parser did not support calc() in the font-weight property.
2389         In order to support a positive integer, add new functions to consume
2390         and handle positive integers without making a CSSPrimitiveValue out of
2391         the number. These correspond to consumeNumberRaw but are limited to positive
2392         integers.
2393
2394         (WebCore::CSSPropertyParser::consumeFont):
2395         The implicit bool was incorrectly set to true when properties were
2396         defined because releaseNonNull() cleared the variables being null
2397         checked. Add separate booleans to avoid this.
2398
2399         * css/parser/CSSPropertyParserHelpers.cpp:
2400         (WebCore::CSSPropertyParserHelpers::CalcParser::consumePositiveIntegerRaw):
2401         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
2402         * css/parser/CSSPropertyParserHelpers.h:
2403         Add the new helpers that consume positive integers without creating
2404         CSSPrimitiveValues out of them.
2405
2406 2016-12-07  Jeremy Jones  <jeremyj@apple.com>
2407
2408         Exit pointer lock when page goes into page cache.
2409         https://bugs.webkit.org/show_bug.cgi?id=165425
2410         rdar://problem/29430834
2411
2412         Reviewed by Jer Noble.
2413
2414         Test: pointer-lock/lock-lost-on-navigation.html
2415
2416         Cancel pointer lock when page goes into page cache and add methods to Internals
2417         so it can be tested.
2418
2419         * dom/Document.cpp:
2420         (WebCore::Document::setPageCacheState):
2421         * page/PointerLockController.h:
2422         * testing/Internals.cpp:
2423         (WebCore::Internals::pageHasPendingPointerLock):
2424         (WebCore::Internals::pageHasPointerLock):
2425         * testing/Internals.h:
2426         * testing/Internals.idl:
2427
2428 2016-12-07  Antoine Quint  <graouts@apple.com>
2429
2430         [Modern Media Controls] Tracks panel does not display in the right location in fullscreen and cannot be dismissed
2431         https://bugs.webkit.org/show_bug.cgi?id=165575
2432
2433         Reviewed by Dean Jackson.
2434
2435         We position the tracks panel programmatically based on the current bounds of the fullscreen button in fullscreen.
2436         This allows for the tracks panel to be shown in the right spot even after dragging the controls bar. We also use
2437         the fullscreen media controls as the target for tracking "mousedown" events when the tracks panel is shown in a
2438         fullscreen presentation.
2439
2440         Tests: media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html
2441                media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html
2442
2443         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
2444         (.media-controls.mac.fullscreen .scrubber):
2445         (.media-controls.mac.fullscreen .tracks-panel): Deleted.
2446         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2447         (MacOSFullscreenMediaControls.prototype.showTracksPanel):
2448         * Modules/modern-media-controls/controls/tracks-panel.js:
2449         (TracksPanel.prototype.presentInParent):
2450         (TracksPanel.prototype.hide):
2451         (TracksPanel.prototype.get bottomY):
2452         (TracksPanel.prototype.set bottomY):
2453         (TracksPanel.prototype.commitProperty):
2454         (TracksPanel.prototype._mousedownTarget):
2455
2456 2016-12-07  Antoine Quint  <graouts@apple.com>
2457
2458         [Modern Media Controls] Use a small picture-in-picture button in fullscreen
2459         https://bugs.webkit.org/show_bug.cgi?id=165587
2460
2461         Reviewed by Dean Jackson.
2462
2463         Use a newer, smaller asset for picture-in-picture in fullscreen.
2464
2465         * Modules/modern-media-controls/controls/icon-service.js:
2466         * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png: Added.
2467         * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png: Added.
2468
2469 2016-12-07  Dean Jackson  <dino@apple.com>
2470
2471         Remove runtime toggle for pointer-lock
2472         https://bugs.webkit.org/show_bug.cgi?id=165577
2473         <rdar://problems/29566996>
2474
2475         Reviewed by Jon Lee.
2476
2477         Remove any runtime calls to check if pointer-lock is enabled. It's
2478         either compiled in or out.
2479
2480         Covered by existing tests.
2481
2482         * bindings/generic/RuntimeEnabledFeatures.h:
2483         (WebCore::RuntimeEnabledFeatures::setPointerLockEnabled): Deleted.
2484         (WebCore::RuntimeEnabledFeatures::pointerLockEnabled): Deleted.
2485         * dom/Document.idl:
2486         * dom/Element.idl:
2487         * page/Page.h:
2488         * page/PointerLockController.cpp:
2489         (WebCore::PointerLockController::requestPointerLock):
2490         (WebCore::PointerLockController::requestPointerUnlock):
2491         (WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):
2492
2493 2016-12-07  John Wilander  <wilander@apple.com>
2494
2495         Allow commas in Accept, Accept-Language, and Content-Language request headers for simple CORS
2496         https://bugs.webkit.org/show_bug.cgi?id=165566
2497         <rdar://problem/29560983>
2498
2499         Reviewed by Alex Christensen.
2500
2501         Updated the existing tests.
2502
2503         * platform/network/HTTPParsers.cpp:
2504         (WebCore::isValidAcceptHeaderValue):
2505             Now also accepts ','.
2506         (WebCore::isValidLanguageHeaderValue):
2507             Ditto.
2508
2509 2016-12-07  Dave Hyatt  <hyatt@apple.com>
2510
2511         [CSS Parser] Stop skipping tests in the css3 LayoutTests subdirectory
2512         https://bugs.webkit.org/show_bug.cgi?id=165574
2513
2514         Reviewed by Dean Jackson.
2515
2516         * css/CSSGroupingRule.cpp:
2517         (WebCore::CSSGroupingRule::insertRule):
2518         The old parser didn't support the creation of @namespace rules in the
2519         CSS OM, but the new parser does. We need to ensure that just like for
2520         @import rules, that the insertion of a @namespace rule inside a
2521         @supports rule is not allowed. This test passed in the old parser because
2522         the rule just didn't get created, but in the new parser, we need to
2523         add a check along with the @import rule check to ensure it isn't allowed.
2524
2525 2016-12-07  Antoine Quint  <graouts@apple.com>
2526
2527         [Modern Media Controls] Remove aspect ratio button
2528         https://bugs.webkit.org/show_bug.cgi?id=165571
2529
2530         Reviewed by Dean Jackson.
2531
2532         Since we do not have a way to toggle letterboxing on an HTMLMediaElement, we remove the
2533         corresponding button in the media controls.
2534
2535         * Modules/modern-media-controls/controls/aspect-ratio-button.js: Removed.
2536         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2537         * Modules/modern-media-controls/js-files:
2538
2539 2016-12-07  Jeremy Jones  <jeremyj@apple.com>
2540
2541         One esc to exit fullscreen and pointer lock
2542         https://bugs.webkit.org/show_bug.cgi?id=165416
2543         rdar://problem/29430711
2544
2545         Reviewed by Jer Noble.
2546
2547         Test: pointer-lock/lock-lost-on-esc-in-fullscreen.html
2548
2549         When handling escape, also exit fullscreen on escape.
2550         This also means that escape can exit fullscreen in TestRunner.
2551
2552         * page/EventHandler.cpp:
2553         (WebCore::EventHandler::keyEvent):
2554
2555 2016-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>
2556
2557         [JSC] Drop translate phase in module loader
2558         https://bugs.webkit.org/show_bug.cgi?id=164861
2559
2560         Reviewed by Saam Barati.
2561
2562         * bindings/js/JSDOMWindowBase.cpp:
2563         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2564
2565 2016-12-07  Keith Rollin  <krollin@apple.com>
2566
2567         Network event record/replay
2568         https://bugs.webkit.org/show_bug.cgi?id=164527
2569         <rdar://problem/29168157>
2570
2571         Reviewed by Alex Christensen.
2572
2573         Export parseURLEncodedForm.
2574
2575         No new tests -- no functionality added, changed, or removed.
2576
2577         * platform/URLParser.h:
2578
2579 2016-12-07  Dave Hyatt  <hyatt@apple.com>
2580
2581         [CSS Parser] Consolidate string/ident/url serialization functions
2582         https://bugs.webkit.org/show_bug.cgi?id=165552
2583
2584         Reviewed by Zalan Bujtas.
2585
2586         Right now CSSParser has string, ident and url serialization functions
2587         called quoteCSStringIfNeeded (which actually serializes both strings and
2588         identifiers), as well as quoteCSSURLIfNeeded.
2589
2590         CSSMarkup already has serialization functions that exist outside of the
2591         CSSParser and that handle serialization of strings, idents and URLs. This
2592         patch eliminates the CSSParser functions and consolidates all of the
2593         serialization to use CSSMarkup's functions.
2594
2595         Note that we are not spec-compliant at all here, and so I had to amend
2596         the functions to support our non-spec-compliant serialization. The goal
2597         of this patch is consolidation and not to fix our broken serialization.
2598
2599         Notable changes include parameterizing string serialization so that
2600         both single and double quotes are supported, since in the existing code
2601         we're sometimes spec-compliant (CSSSelectors) and sometimes not
2602         (CSSPrimitiveValue).
2603
2604         We also overload CSS_STRING primitive value type and have it act as both
2605         a string and a custom identifier. This is lame, since the parser should
2606         have made two different types of objects instead, but since our parser
2607         doesn't do that yet, I added a serializeAsStringOrCustomIdent that
2608         preserves our old behavior of "quote the string only if needed." In this
2609         case what that really meant was "Try to guess that we were originally a
2610         custom ident and leave off quotes if so." This function will go away
2611         once we properly create CSSStringValues and CSSCustomIdentValues instead
2612         of turning the latter into strings.
2613
2614         * css/CSSBasicShapes.cpp:
2615         (WebCore::buildPathString):
2616         * css/CSSImageValue.cpp:
2617         (WebCore::CSSImageValue::customCSSText):
2618         * css/CSSMarkup.cpp:
2619         (WebCore::isCSSTokenizerURL):
2620         (WebCore::serializeString):
2621         (WebCore::serializeURL):
2622         (WebCore::serializeAsStringOrCustomIdent):
2623         (WebCore::serializeURI): Deleted.
2624         * css/CSSMarkup.h:
2625         * css/CSSPrimitiveValue.cpp:
2626         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
2627         * css/CSSSelector.cpp:
2628         (WebCore::CSSSelector::selectorText):
2629         * css/parser/CSSParser.cpp:
2630         (WebCore::isCSSTokenizerIdent): Deleted.
2631         (WebCore::isCSSTokenizerURL): Deleted.
2632         (WebCore::quoteCSSStringInternal): Deleted.
2633         (WebCore::quoteCSSString): Deleted.
2634         (WebCore::quoteCSSStringIfNeeded): Deleted.
2635         (WebCore::quoteCSSURLIfNeeded): Deleted.
2636         * css/parser/CSSParser.h:
2637         * html/HTMLElement.cpp:
2638         (WebCore::HTMLElement::mapLanguageAttributeToLocale):
2639
2640 2016-12-07  Dean Jackson  <dino@apple.com>
2641
2642         Expose internal API to detect media documents
2643         https://bugs.webkit.org/show_bug.cgi?id=165559
2644         <rdar://problems/29564054>
2645
2646         Reviewed by Antoine Quint.
2647
2648         Expose via MediaControlsHost whether or not we're in
2649         a MediaDocument.
2650
2651         Since MediaControlsHost is only exposed to our
2652         internal controls, it's not possible to test this
2653         directly. However, a subsequent test for media documents
2654         with audio-only content will cover this change.
2655
2656         * Modules/mediacontrols/MediaControlsHost.cpp: Add isInMediaDocument and put const on
2657         various methods that should have it.
2658         (WebCore::MediaControlsHost::captionDisplayMode):
2659         (WebCore::MediaControlsHost::supportsFullscreen):
2660         (WebCore::MediaControlsHost::isVideoLayerInline):
2661         (WebCore::MediaControlsHost::isInMediaDocument):
2662         * Modules/mediacontrols/MediaControlsHost.h:
2663         * Modules/mediacontrols/MediaControlsHost.idl: Add isInMediaDocument.
2664
2665 2016-12-07  Zalan Bujtas  <zalan@apple.com>
2666
2667         ASSERTION FAILED: count >= 1 in WebCore::RenderMultiColumnSet::columnCount
2668         https://bugs.webkit.org/show_bug.cgi?id=136365
2669         <rdar://problem/27686727>
2670
2671         Reviewed by Simon Fraser.
2672
2673         Margin value overflow ends up confusing the column count computing logic.
2674
2675         Test: fast/multicol/assert-on-column-count-when-zoomed-in.html
2676
2677         * css/StyleResolver.cpp:
2678         (WebCore::addIntrinsicMargins):
2679
2680 2016-12-07  Ryosuke Niwa  <rniwa@webkit.org>
2681
2682         document.caretRangeFromPoint doesn't retarget the resultant Range correctly.
2683         https://bugs.webkit.org/show_bug.cgi?id=165146
2684
2685         Reviewed by Sam Weinig.
2686
2687         The bug was caused by caretRangeFromPoint not retargeting the resultant Range correctly.
2688         Namely, it's possible for RenderObject::positionForPoint to move across shadow boundary
2689         even if node was identically equal to ancestorInThisScope(node).
2690
2691         Fixed the bug by directly retargeting the range's container node and its offset as done
2692         for elementFromPoint in r206795.
2693
2694         Test: fast/shadow-dom/caret-range-from-point-in-shadow-tree.html
2695
2696         * dom/Document.cpp:
2697         (WebCore::Document::caretRangeFromPoint):
2698
2699 2016-12-07  Antoine Quint  <graouts@apple.com>
2700
2701         [Modern Media Controls] Entering fullscreen and returning to inline shows fullscreen controls
2702         https://bugs.webkit.org/show_bug.cgi?id=165536
2703
2704         Reviewed by Tim Horton.
2705
2706         We regressed when we implemented the fix for webkit.org/b/165494 and we started to rely solely
2707         on the "webkitpresentationmodechanged" event to identify presention mode changes. As it turns out,
2708         when the "webkitpresentationmodechanged" event is dispatched when exiting fullscreen and returning
2709         to the inline presentation mode, querying the "webkitPresentationMode" property says "inline" while
2710         "webkitDisplayingFullscreen" still returns true (raised as webkit.org/b/165538).
2711         
2712         We now use the "webkitPresentationMode" property when that property is supported and we're using the
2713         "webkitpresentationmodechanged" event, and we use the "webkitDisplayingFullscreen" property otherwise.
2714
2715         Test: media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
2716
2717         * Modules/modern-media-controls/media/media-controller.js:
2718         (MediaController.prototype.get layoutTraits):
2719
2720 2016-12-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2721
2722         Scroll position jumps to the origin when scrolling without momentum at the end of a scroll snapping container
2723         https://bugs.webkit.org/show_bug.cgi?id=165474
2724         <rdar://problem/29534305>
2725
2726         Reviewed by Simon Fraser.
2727
2728         When initializing an AppKit _NSScrollingMomentumCalculator, if the initial and target positions are the same and
2729         the initial velocity is (0, 0), the momentum calculator will output (0, 0) as the animated scroll position when
2730         animating. This causes the scroll position to jump to the top left in some cases when scrolling in scroll snap
2731         containers. To fix this, we teach the ScrollingMomentumCalculatorMac to return an animation duration of 0 and
2732         an animated scroll position equal to the final scroll position when this is the case.
2733
2734         Test: tiled-drawing/scrolling/scroll-snap/scrolling-jumps-to-top.html
2735
2736         * page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
2737         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
2738         (WebCore::ScrollingMomentumCalculatorMac::ScrollingMomentumCalculatorMac):
2739         (WebCore::ScrollingMomentumCalculatorMac::scrollOffsetAfterElapsedTime):
2740         (WebCore::ScrollingMomentumCalculatorMac::animationDuration):
2741
2742 2016-12-07  Nan Wang  <n_wang@apple.com>
2743
2744         AX: menu type toolbar should be mapped correctly on Mac
2745         https://bugs.webkit.org/show_bug.cgi?id=165537
2746
2747         Reviewed by Chris Fleizach.
2748
2749         The menu tag with a toolbar type should have the corresponding role.
2750
2751         Test: accessibility/mac/menu-type-toolbar.html
2752
2753         * accessibility/AccessibilityRenderObject.cpp:
2754         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2755
2756 2016-12-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2757
2758         Add a new project for recording and playing back editing commands in editable web content
2759         https://bugs.webkit.org/show_bug.cgi?id=165114
2760         <rdar://problem/29408135>
2761
2762         Reviewed by Beth Dakin.
2763
2764         Adds new scripts used to record and play back editing, as well as a new Xcode Copy files phase that pushes these
2765         scripts to the internal system directory when installing. See the Tools ChangeLog and individual comments below
2766         for more details. Covered by 3 new unit tests in the EditingHistory project.
2767
2768         * InternalScripts/DumpEditingHistory.js: Added.
2769         (beginProcessingTopLevelUpdate):
2770         (endProcessingTopLevelUpdate):
2771         (appendDOMUpdatesFromRecords):
2772         (appendSelectionUpdateIfNecessary):
2773
2774         Adds new entries into the top-level list of DOM updates captured when editing. Respectively, these are input
2775         events and selection changes.
2776
2777         (EditingHistory.getEditingHistoryAsJSONString):
2778         * InternalScripts/EditingHistoryUtil.js: Added.
2779         (prototype._scramble):
2780         (prototype.applyToText):
2781         (prototype.applyToFilename):
2782         (prototype._scrambedNumberIndexForCode):
2783         (prototype._scrambedLowercaseIndexForCode):
2784         (prototype._scrambedUppercaseIndexForCode):
2785
2786         Naive implementation of an obfuscator. Currently, this only affects alphanumeric characters. Obfuscation is off
2787         by default, but can be toggled on in JavaScript.
2788
2789         (elementFromMarkdown):
2790         (GlobalNodeMap):
2791         (GlobalNodeMap.prototype.nodesForGUIDs):
2792         (GlobalNodeMap.prototype.guidsForTNodes):
2793         (GlobalNodeMap.prototype.nodeForGUID):
2794         (GlobalNodeMap.prototype.guidForNode):
2795         (GlobalNodeMap.prototype.hasGUIDForNode):
2796         (GlobalNodeMap.prototype.nodes):
2797         (GlobalNodeMap.prototype.toObject):
2798         (GlobalNodeMap.fromObject):
2799         (GlobalNodeMap.dataForNode):
2800         (GlobalNodeMap.elementFromTagName):
2801         (GlobalNodeMap.nodeAttributesToObject):
2802         (GlobalNodeMap.prototype.descriptionHTMLForGUID):
2803         (GlobalNodeMap.prototype.descriptionHTMLForNode):
2804
2805         The GlobalNodeMap keeps track of every node that has appeared in the DOM, assigning each node a globally unique
2806         identifier (GUID). This GUID is used when reconstructing the DOM, as well as unapplying or applying editing.
2807
2808         (SelectionState):
2809         (SelectionState.prototype.isEqual):
2810         (SelectionState.prototype.applyToSelection):
2811         (SelectionState.fromSelection):
2812         (SelectionState.prototype.toObject):
2813         (SelectionState.fromObject):
2814
2815         Represents a snapshot of the Selection state (determined by getSelection()).
2816
2817         (DOMUpdate):
2818         (DOMUpdate.prototype.apply):
2819         (DOMUpdate.prototype.unapply):
2820         (DOMUpdate.prototype.targetNode):
2821         (DOMUpdate.prototype.detailsElement):
2822         (DOMUpdate.ofType):
2823         (DOMUpdate.fromRecords):
2824
2825         A DOMUpdate is an abstract object representing a change in the DOM that may be applied and unapplied. These are
2826         also serializable as hashes, which may then be converted to JSON when generating editing history data.
2827
2828         (ChildListUpdate):
2829         (ChildListUpdate.prototype.apply):
2830         (ChildListUpdate.prototype.unapply):
2831         (ChildListUpdate.prototype._nextSibling):
2832         (ChildListUpdate.prototype._removedNodes):
2833         (ChildListUpdate.prototype._addedNodes):
2834         (ChildListUpdate.prototype.toObject):
2835         (ChildListUpdate.prototype.detailsElement):
2836         (ChildListUpdate.fromObject):
2837
2838         These three update types correspond to the three types of DOM mutations. These may appear as top-level updates
2839         if they are not captured during an input event, but for the majority of user-input-driven changes, they will be
2840         children of an input event.
2841
2842         (CharacterDataUpdate):
2843         (CharacterDataUpdate.prototype.apply):
2844         (CharacterDataUpdate.prototype.unapply):
2845         (CharacterDataUpdate.prototype.detailsElement):
2846         (CharacterDataUpdate.prototype.toObject):
2847         (CharacterDataUpdate.fromObject):
2848         (AttributeUpdate):
2849         (AttributeUpdate.prototype.apply):
2850         (AttributeUpdate.prototype.unapply):
2851         (AttributeUpdate.prototype.detailsElement):
2852         (AttributeUpdate.prototype.toObject):
2853         (AttributeUpdate.fromObject):
2854         (SelectionUpdate):
2855         (SelectionUpdate.prototype.apply):
2856         (SelectionUpdate.prototype.unapply):
2857         (SelectionUpdate.prototype.toObject):
2858         (SelectionUpdate.fromObject):
2859         (SelectionUpdate.prototype._rangeDescriptionHTML):
2860         (SelectionUpdate.prototype._anchorDescriptionHTML):
2861         (SelectionUpdate.prototype._focusDescriptionHTML):
2862         (SelectionUpdate.prototype.detailsElement):
2863
2864         Represents a change in the Selection. While no changes to the DOM structure occur as a result of a
2865         SelectionUpdate, the information contained in these updates is used to determine where the selection should be
2866         when rewinding or playing back the editing history.
2867
2868         (InputEventUpdate):
2869         (InputEventUpdate.prototype._obfuscatedData):
2870         (InputEventUpdate.prototype.apply):
2871         (InputEventUpdate.prototype.unapply):
2872         (InputEventUpdate.prototype.toObject):
2873         (InputEventUpdate.fromObject):
2874         (InputEventUpdate.prototype.detailsElement):
2875
2876         Represents an update due to user input, which consists of some number of child DOM mutation updates.
2877
2878         * WebCore.xcodeproj/project.pbxproj:
2879
2880 2016-12-07  Jer Noble  <jer.noble@apple.com>
2881
2882         ASSERT crash while running media-source/mediasource-activesourcebuffers.html under Stress GC bot.
2883         https://bugs.webkit.org/show_bug.cgi?id=165514
2884
2885         Reviewed by Eric Carlson.
2886
2887         If a track associated with MSE is disabled after a SourceBuffer begins parsing a queued
2888         append operation, SourceBuffer can get into a state where it asks SourceBufferPrivateAVFObjC
2889         if it is ready to accept data for that disabled track. This causes an ASSERT_NOT_REACHED in
2890         isReadyForMoreData().
2891
2892         However, this seems to be a valid condition; we can safely just return "false" from
2893         isReadyForMoreSamples() (and also bail from notifyClientWhenReadyForMoreSamples()) when asked
2894         about a disabled track.
2895
2896         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2897         (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
2898         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
2899
2900 2016-12-07  Dave Hyatt  <hyatt@apple.com>
2901
2902         [CSS Parser] Eliminate the Scope class and fold it into CSSTokenizer
2903         https://bugs.webkit.org/show_bug.cgi?id=165532
2904
2905         Reviewed by Dean Jackson.
2906
2907         The Scope class, nested inside CSSTokenizer, is both poorly named and serves
2908         no purpose. It's especially weird that it was the entry point into tokenization
2909         instead of CSSTokenizer.
2910
2911         Eliminate the class, fold its members and functions into CSSTokenizer, and have
2912         callers just make a CSSTokenizer instead.
2913
2914         * css/parser/CSSParser.cpp:
2915         (WebCore::CSSParser::parseSupportsCondition):
2916         (WebCore::CSSParser::parseSelector):
2917         * css/parser/CSSParserImpl.cpp:
2918         (WebCore::CSSParserImpl::parseValue):
2919         (WebCore::CSSParserImpl::parseCustomPropertyValue):
2920         (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
2921         (WebCore::CSSParserImpl::parseDeclarationList):
2922         (WebCore::CSSParserImpl::parseRule):
2923         (WebCore::CSSParserImpl::parseStyleSheet):
2924         (WebCore::CSSParserImpl::parseKeyframeKeyList):
2925         (WebCore::CSSParserImpl::parseDeclarationListForInspector):
2926         (WebCore::CSSParserImpl::parseStyleSheetForInspector):
2927         * css/parser/CSSTokenizer.cpp:
2928         (WebCore::CSSTokenizer::CSSTokenizer):
2929         (WebCore::CSSTokenizer::tokenRange):
2930         (WebCore::CSSTokenizer::tokenCount):
2931         (WebCore::CSSTokenizer::registerString):
2932         (WebCore::CSSTokenizer::Scope::Scope): Deleted.
2933         (WebCore::CSSTokenizer::Scope::tokenRange): Deleted.
2934         (WebCore::CSSTokenizer::Scope::tokenCount): Deleted.
2935         * css/parser/CSSTokenizer.h:
2936         (WebCore::CSSTokenizer::Scope::storeString): Deleted.
2937         * css/parser/CSSTokenizerInputStream.cpp:
2938         (WebCore::CSSTokenizerInputStream::CSSTokenizerInputStream):
2939         * css/parser/CSSTokenizerInputStream.h:
2940         * css/parser/MediaQueryParser.cpp:
2941         (WebCore::MediaQueryParser::parseMediaQuerySet):
2942         * css/parser/SizesAttributeParser.cpp:
2943         (WebCore::SizesAttributeParser::SizesAttributeParser):
2944
2945 2016-12-07  Joseph Pecoraro  <pecoraro@apple.com>
2946
2947         Web Inspector: Remove unused and mostly untested Page domain commands and events
2948         https://bugs.webkit.org/show_bug.cgi?id=165507
2949
2950         Reviewed by Brian Burg.
2951
2952         Remove any code associated with the commands/events being removed.
2953
2954         * inspector/DOMPatchSupport.cpp:
2955         * inspector/DOMPatchSupport.h:
2956         * inspector/InspectorClient.h:
2957         (WebCore::InspectorClient::handleJavaScriptDialog): Deleted.
2958         * inspector/InspectorInstrumentation.cpp:
2959         (WebCore::InspectorInstrumentation::scriptsEnabledImpl): Deleted.
2960         (WebCore::InspectorInstrumentation::willRunJavaScriptDialogImpl): Deleted.
2961         (WebCore::InspectorInstrumentation::didRunJavaScriptDialogImpl): Deleted.
2962         * inspector/InspectorInstrumentation.h:
2963         (WebCore::InspectorInstrumentation::scriptsEnabled): Deleted.
2964         (WebCore::InspectorInstrumentation::willRunJavaScriptDialog): Deleted.
2965         (WebCore::InspectorInstrumentation::didRunJavaScriptDialog): Deleted.
2966         * inspector/InspectorPageAgent.cpp:
2967         (WebCore::InspectorPageAgent::disable):
2968         (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
2969         (WebCore::InspectorPageAgent::didPaint):
2970         (WebCore::InspectorPageAgent::buildObjectForFrame):
2971         (WebCore::InspectorPageAgent::archive):
2972         (WebCore::createXHRTextDecoder): Deleted.
2973         (WebCore::InspectorPageAgent::getScriptExecutionStatus): Deleted.
2974         (WebCore::InspectorPageAgent::setScriptExecutionDisabled): Deleted.
2975         (WebCore::InspectorPageAgent::willRunJavaScriptDialog): Deleted.
2976         (WebCore::InspectorPageAgent::didRunJavaScriptDialog): Deleted.
2977         (WebCore::InspectorPageAgent::scriptsEnabled): Deleted.
2978         (WebCore::InspectorPageAgent::handleJavaScriptDialog): Deleted.
2979         * inspector/InspectorPageAgent.h:
2980         * page/Chrome.cpp:
2981         (WebCore::Chrome::runBeforeUnloadConfirmPanel):
2982         (WebCore::Chrome::runJavaScriptAlert):
2983         (WebCore::Chrome::runJavaScriptConfirm):
2984         (WebCore::Chrome::runJavaScriptPrompt):
2985         * page/Settings.cpp:
2986         (WebCore::Settings::setScriptEnabled):
2987
2988 2016-12-07  Jer Noble  <jer.noble@apple.com>
2989
2990         [pointer-lock] Cursor should become visible when exiting pointer-lock via ESC key.
2991         https://bugs.webkit.org/show_bug.cgi?id=165377
2992
2993         Reviewed by Eric Carlson.
2994
2995         Follow up to previous patch; clear the m_forceCursorVisibleUponUnlock flag upon losing
2996         pointer lock, so that subsequent unlocks don't erroneously cause the cursor to become
2997         visible. 
2998
2999         * page/PointerLockController.cpp:
3000         (WebCore::PointerLockController::didLosePointerLock):
3001
3002 2016-12-06  Geoffrey Garen  <ggaren@apple.com>
3003
3004         performance.now() should truncate to 100us
3005         https://bugs.webkit.org/show_bug.cgi?id=165503
3006         <rdar://problem/29544531>
3007
3008         Reviewed by Mark Lam.
3009
3010         * page/Performance.cpp:
3011         (WebCore::Performance::reduceTimeResolution):
3012
3013 2016-12-07  Dave Hyatt  <hyatt@apple.com>
3014
3015         [CSS Parser] Turn back on a bunch of layout tests
3016         https://bugs.webkit.org/show_bug.cgi?id=165529
3017
3018         Reviewed by Zalan Bujtas.
3019
3020         Fixes fast/css/transform-origin-parsing.html.
3021
3022         * css/parser/CSSPropertyParser.cpp:
3023         (WebCore::CSSPropertyParser::consumeTransformOrigin):
3024         The implicit check was relying on a null check of the z value, but
3025         we called releaseNonNull on it already. This meant all z properties were
3026         marked as implicit incorrectly. Fix by storing whether or not we had a z
3027         value in a local variable.
3028
3029 2016-12-07  Andreas Kling  <akling@apple.com>
3030
3031         [iOS] Remove bitrotted FrameLoader attempt to limit page caching under memory pressure.
3032         <https://webkit.org/b/165527>
3033
3034         Reviewed by Antti Koivisto.
3035
3036         This code no longer does anything, as the page cache is hard capped
3037         at 0 entries while under memory pressure.
3038
3039         * loader/FrameLoader.cpp:
3040         (WebCore::FrameLoader::commitProvisionalLoad):
3041
3042 2016-12-06  Antoine Quint  <graouts@apple.com>
3043
3044         [Modern Media Controls] Use tap and pinch gestures on iOS
3045         https://bugs.webkit.org/show_bug.cgi?id=165518
3046
3047         Reviewed by Dean Jackson.
3048
3049         We now use touch events to identify taps and pinches on media controls to respond immediately
3050         to user interaction on buttons and enter fullscreen when pinching out.
3051
3052         * Modules/modern-media-controls/controls/button.css:
3053         (button):
3054         * Modules/modern-media-controls/controls/button.js:
3055         (Button):
3056         (Button.prototype.handleEvent):
3057         (Button.prototype.gestureRecognizerStateDidChange):
3058         (Button.prototype._notifyDelegateOfActivation):
3059         (Button.prototype._handleUIEvent): Deleted.
3060         * Modules/modern-media-controls/controls/controls-bar.js:
3061         (ControlsBar.prototype.set fadesWhileIdle):
3062         (ControlsBar.prototype.gestureRecognizerStateDidChange):
3063         * Modules/modern-media-controls/controls/icon-button.js:
3064         (IconButton.prototype._updateImage):
3065         (IconButton):
3066         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
3067         (IOSInlineMediaControls.prototype.gestureRecognizerStateDidChange):
3068         * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js: Added.
3069         (GestureRecognizer):
3070         (GestureRecognizer.prototype.get state):
3071         (GestureRecognizer.prototype.set state):
3072         (GestureRecognizer.prototype.get target):
3073         (GestureRecognizer.prototype.set target):
3074         (GestureRecognizer.prototype.get numberOfTouches):
3075         (GestureRecognizer.prototype.get enabled):
3076         (GestureRecognizer.prototype.set enabled):
3077         (GestureRecognizer.prototype.reset):
3078         (GestureRecognizer.prototype.locationInElement):
3079         (GestureRecognizer.prototype.locationInClient):
3080         (GestureRecognizer.prototype.locationOfTouchInElement):
3081         (GestureRecognizer.prototype.touchesBegan):
3082         (GestureRecognizer.prototype.touchesMoved):
3083         (GestureRecognizer.prototype.touchesEnded):
3084         (GestureRecognizer.prototype.touchesCancelled):
3085         (GestureRecognizer.prototype.gestureBegan):
3086         (GestureRecognizer.prototype.gestureChanged):
3087         (GestureRecognizer.prototype.gestureEnded):
3088         (GestureRecognizer.prototype.enterPossibleState):
3089         (GestureRecognizer.prototype.enterBeganState):
3090         (GestureRecognizer.prototype.enterEndedState):
3091         (GestureRecognizer.prototype.enterCancelledState):
3092         (GestureRecognizer.prototype.enterFailedState):
3093         (GestureRecognizer.prototype.enterChangedState):
3094         (GestureRecognizer.prototype.enterRecognizedState):
3095         (GestureRecognizer.prototype.handleEvent):
3096         (GestureRecognizer.prototype._initRecognizer):
3097         (GestureRecognizer.prototype._updateBaseListeners):
3098         (GestureRecognizer.prototype._removeTrackingListeners):
3099         (GestureRecognizer.prototype._updateTargetTouches):
3100         (GestureRecognizer.prototype._updateKeyboardModifiers):
3101         * Modules/modern-media-controls/gesture-recognizers/pinch.js: Added.
3102         (PinchGestureRecognizer):
3103         (PinchGestureRecognizer.prototype.get velocity):
3104         (PinchGestureRecognizer.prototype.touchesBegan):
3105         (PinchGestureRecognizer.prototype.touchesMoved):
3106         (PinchGestureRecognizer.prototype.touchesEnded):
3107         (PinchGestureRecognizer.prototype.gestureBegan):
3108         (PinchGestureRecognizer.prototype.gestureChanged):
3109         (PinchGestureRecognizer.prototype.gestureEnded):
3110         (PinchGestureRecognizer.prototype.reset):
3111         (PinchGestureRecognizer.prototype._recordGesture):
3112         (PinchGestureRecognizer.prototype._updateStateWithEvent):
3113         (PinchGestureRecognizer.prototype._distance):
3114         * Modules/modern-media-controls/gesture-recognizers/tap.js: Added.
3115         (TapGestureRecognizer):
3116         (TapGestureRecognizer.prototype.touchesBegan):
3117         (TapGestureRecognizer.prototype.touchesMoved):
3118         (TapGestureRecognizer.prototype.touchesEnded):
3119         (TapGestureRecognizer.prototype.reset):
3120         (TapGestureRecognizer.prototype.locationInElement):
3121         (TapGestureRecognizer.prototype.locationInClient):
3122         (TapGestureRecognizer.prototype._clearTimer):
3123         (TapGestureRecognizer.prototype._rewindTimer):
3124         (TapGestureRecognizer.prototype._timerFired):
3125         * Modules/modern-media-controls/js-files:
3126         * Modules/modern-media-controls/media/airplay-support.js:
3127         (AirplaySupport.prototype.buttonWasClicked): Deleted.
3128         * Modules/modern-media-controls/media/controls-visibility-support.js:
3129         (ControlsVisibilitySupport):
3130         (ControlsVisibilitySupport.prototype.handleEvent):
3131         (ControlsVisibilitySupport.prototype.syncControl): Deleted.
3132         * Modules/modern-media-controls/media/fullscreen-support.js:
3133         (FullscreenSupport):
3134         (FullscreenSupport.prototype.iOSInlineMediaControlsRecognizedPinchInGesture):
3135         (FullscreenSupport.prototype.buttonWasClicked): Deleted.
3136         * Modules/modern-media-controls/media/media-controller-support.js:
3137         (MediaControllerSupport):
3138         (MediaControllerSupport.prototype.handleEvent):
3139         (MediaControllerSupport.prototype.buttonWasClicked): Deleted.
3140         * Modules/modern-media-controls/media/mute-support.js:
3141         (MuteSupport.prototype.buttonWasClicked): Deleted.
3142         * Modules/modern-media-controls/media/pip-support.js:
3143         (PiPSupport.prototype.buttonWasClicked): Deleted.
3144         * Modules/modern-media-controls/media/playback-support.js:
3145         (PlaybackSupport.prototype.buttonWasClicked): Deleted.
3146         * Modules/modern-media-controls/media/skip-back-support.js:
3147         (SkipBackSupport.prototype.buttonWasClicked): Deleted.
3148         * Modules/modern-media-controls/media/start-support.js:
3149         (StartSupport.prototype.buttonWasClicked): Deleted.
3150         * Modules/modern-media-controls/media/tracks-support.js:
3151         (TracksSupport.prototype.buttonWasClicked): Deleted.
3152
3153 2016-12-06  Dean Jackson  <dino@apple.com>
3154
3155         Apply styling to media documents with modern controls
3156         https://bugs.webkit.org/show_bug.cgi?id=165499
3157         <rdar://problems/29543847>
3158
3159         Reviewed by Antoine Quint.
3160
3161         Forgot to commit most of the changes in MediaDocument.cpp :(
3162
3163         * html/MediaDocument.cpp:
3164         (WebCore::MediaDocumentParser::createDocumentStructure):
3165
3166 2016-12-06  Simon Fraser  <simon.fraser@apple.com>
3167
3168         Two tiled drawing tests failing with visual viewports enabled.
3169         https://bugs.webkit.org/show_bug.cgi?id=165489
3170
3171         Reviewed by Dean Jackson.
3172
3173         computeLayoutViewportOrigin() gets called for iframes when the layout viewport
3174         is zero-sized, but the visual viewport is non-zero. It doesn't really make sense
3175         to compute a layout viewport when the visual viewport is larger than the layout
3176         viewport, but if this happens just anchor the layout viewport at the origin
3177         of the visual viewport.
3178
3179         * page/FrameView.cpp:
3180         (WebCore::FrameView::computeLayoutViewportOrigin):
3181
3182 2016-12-04  Darin Adler  <darin@apple.com>
3183
3184         Remove various stray uses of WebCore::Dictionary
3185         https://bugs.webkit.org/show_bug.cgi?id=165358
3186
3187         Reviewed by Sam Weinig.
3188
3189         I discovered three completely unused classes in the MediaStream code:
3190         MediaTrackConstraint, MediaTrackConstraintSet, and MediaTrackConstraints.
3191         While there is some chance we may implement these at some point, they are
3192         likely to be dictionaries or some other kind of data structure rather than
3193         clases, and there is no reason to keep the current classes.
3194
3195         * CMakeLists.txt: Removed MediaTrackConstraint, MediaTrackConstraintSet,
3196         and MediaTrackConstraints.
3197         * DerivedSources.cpp: Ditto.
3198         * DerivedSources.make: Ditto.
3199
3200         * Modules/indexeddb/IDBDatabase.h: Removed include of Dictionary.h.
3201         * Modules/indexeddb/IDBObjectStore.cpp: Added include of HeapInlines.h.
3202         * Modules/indexeddb/IDBRequest.cpp: Added include of StrongInlines.h.
3203         * Modules/indexeddb/IDBTransaction.cpp: Added include of SerializedScriptValue.h.
3204
3205         * Modules/mediastream/MediaStreamTrack.cpp:
3206         (WebCore::MediaStreamTrack::getConstraints): Deleted.
3207         This function is implemented entirely in the bindings layer.
3208         * Modules/mediastream/MediaStreamTrack.h: Removed getConstraints.
3209
3210         * Modules/mediastream/MediaTrackConstraint.cpp: Removed.
3211         * Modules/mediastream/MediaTrackConstraint.h: Removed.
3212         * Modules/mediastream/MediaTrackConstraint.idl: Removed.
3213         * Modules/mediastream/MediaTrackConstraintSet.cpp: Removed.
3214         * Modules/mediastream/MediaTrackConstraintSet.h: Removed.
3215         * Modules/mediastream/MediaTrackConstraintSet.idl: Removed.
3216         * Modules/mediastream/MediaTrackConstraints.cpp: Removed.
3217         * Modules/mediastream/MediaTrackConstraints.h: Removed.
3218         * Modules/mediastream/MediaTrackConstraints.idl: Removed.
3219
3220         * Modules/mediastream/NavigatorUserMedia.idl: Use the type names from the latest
3221         getUserMedia specification for the arguments to webkitGetUserMedia; not sure they
3222         are precisely correct for this legacy function, but since this is a JSBuiltin,
3223         it's all ignored anyway. Just important not to call anything "Dictionary".
3224
3225         * WebCore.xcodeproj/project.pbxproj: Removed MediaTrackConstraint, MediaTrackConstraintSet,
3226         and MediaTrackConstraints.
3227
3228         * bindings/js/JSApplePaySessionCustom.cpp:
3229         (WebCore::JSApplePaySession::completeShippingMethodSelection): Use uncheckedArgument, since
3230         the code explicitly checks the number of arguments.
3231         (WebCore::JSApplePaySession::completeShippingContactSelection): Ditto.
3232         (WebCore::JSApplePaySession::completePaymentMethodSelection): Ditto.
3233
3234         * bindings/js/JSFontFaceCustom.cpp: Removed include of Dictionary.h.
3235         * dom/Document.cpp: Ditto.
3236         * dom/Element.cpp: Ditto.
3237
3238         * dom/Element.h: Removed forward declaration of Dictionary.
3239
3240 2016-12-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3241
3242         After preventing a beforeinput event, an input event is fired when formatting rich text
3243         https://bugs.webkit.org/show_bug.cgi?id=165435
3244         <rdar://problem/29522314>
3245
3246         Reviewed by Ryosuke Niwa.
3247
3248         This regressed after I refactored some input event event dispatch logic when formatting text in r208461.
3249         I moved the logic for dispatching input events when applying styles into Editor::applyStyle, but left out an
3250         early return after firing the beforeinput event if the default behavior was prevented, which caused us to
3251         continue on and dispatch an input event. The fix is to bail from applyStyle if default was prevented.
3252
3253         Augmented an existing layout test to cover this case.
3254
3255         * editing/Editor.cpp:
3256         (WebCore::Editor::applyStyle):
3257         (WebCore::Editor::applyParagraphStyle):
3258
3259 2016-12-06  Antoine Quint  <graouts@apple.com>
3260
3261         [Modern Media Controls] Instantiate iOS media controls
3262         https://bugs.webkit.org/show_bug.cgi?id=165498
3263
3264         Reviewed by Dean Jackson.
3265
3266         Add support for the modern media controls runtime flags in RenderThemeIOS and, when instantiating iOS controls,
3267         return an IOSInlineMediaControls class.
3268
3269         * Modules/modern-media-controls/media/media-controller.js:
3270         (MediaController.prototype._controlsClass):
3271         (MediaController):
3272         * rendering/RenderThemeIOS.h:
3273         * rendering/RenderThemeIOS.mm:
3274         (WebCore::RenderThemeIOS::mediaControlsStyleSheet):
3275         (WebCore::RenderThemeIOS::mediaControlsScript):
3276         (WebCore::RenderThemeIOS::mediaControlsBase64StringForIconAndPlatform):
3277
3278 2016-12-06  Dean Jackson  <dino@apple.com>
3279
3280         Apply styling to media documents with modern controls
3281         https://bugs.webkit.org/show_bug.cgi?id=165499
3282         <rdar://problems/29543847>
3283
3284         Reviewed by Antoine Quint.
3285
3286         Existing MediaDocuments got styling from the injected style
3287         sheet, which had rules for such documents. The modern media controls
3288         use a scoped style rule, so we can't touch the document style. Instead,
3289         inline the style directly from MediaDocument.
3290
3291         Test: media/modern-media-controls/media-documents/background-color-and-centering.html
3292
3293         * html/MediaDocument.cpp:
3294         (WebCore::MediaDocumentParser::createDocumentStructure):
3295
3296 2016-12-06  Zalan Bujtas  <zalan@apple.com>
3297
3298         Move RenderElement::rendererForRootBackground to RenderView.
3299         https://bugs.webkit.org/show_bug.cgi?id=165454
3300
3301         Reviewed by Simon Fraser.
3302
3303         Currently RenderElement::rendererForRootBackground can only be called on document element's renderer.
3304         This patch removes this limitation and moves the functionality from RenderElement to RenderView.
3305
3306         No change in functionality.
3307
3308         * page/FrameView.cpp:
3309         (WebCore::FrameView::calculateExtendedBackgroundMode):
3310         * rendering/RenderBox.cpp:
3311         (WebCore::RenderBox::paintRootBoxFillLayers):
3312         * rendering/RenderElement.cpp:
3313         (WebCore::RenderElement::rendererForRootBackground): Deleted.
3314         * rendering/RenderElement.h:
3315         * rendering/RenderLayerBacking.cpp:
3316         (WebCore::RenderLayerBacking::rendererBackgroundColor):
3317         * rendering/RenderView.cpp:
3318         (WebCore::RenderView::rendererForRootBackground):
3319         (WebCore::rendererObscuresBackground):
3320         (WebCore::RenderView::paintBoxDecorations):
3321         (WebCore::RenderView::rootBackgroundIsEntirelyFixed):
3322         * rendering/RenderView.h:
3323
3324 2016-12-05  Jiewen Tan  <jiewen_tan@apple.com>
3325
3326         [Part 1 of 2] Add support for SPKI format while doing SubtleCrypto.importKey/exportKey
3327         https://bugs.webkit.org/show_bug.cgi?id=129978
3328         <rdar://problem/21799829>
3329
3330         This is part 1 of Bug 129978. In this patch, it adds the SPKI format support for
3331         SubtleCrypto.importKey/exportKey. Currently support algorithms are RSAES-PKCS1-v1_5,
3332         RSASSA-PKCS1-v1_5 and RSA-OAEP.
3333
3334         Reviewed by Brent Fulgham.
3335
3336         Tests: crypto/subtle/rsa-import-jwk-key-export-spki-key.html
3337                crypto/subtle/rsa-import-spki-key-export-jwk-key.html
3338                crypto/subtle/rsa-import-spki-key-export-spki-key.html
3339                crypto/subtle/rsa-import-spki-small-key.html
3340                crypto/subtle/rsa-oaep-generate-export-key-spki.html
3341                crypto/subtle/rsa-oaep-import-spki-key.html
3342                crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-spki.html
3343                crypto/subtle/rsaes-pkcs1-v1_5-import-spki-key.html
3344                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-spki.html
3345                crypto/subtle/rsassa-pkcs1-v1_5-import-spki-key.html
3346                crypto/workers/subtle/rsa-export-spki-key.html
3347                crypto/workers/subtle/rsa-import-spki-key.html
3348
3349         * bindings/js/JSSubtleCryptoCustom.cpp:
3350         (WebCore::toKeyData):
3351         * crypto/CommonCryptoUtilities.h:
3352         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
3353         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
3354         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
3355         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
3356         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
3357         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
3358         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
3359         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
3360         (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
3361         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
3362         (WebCore::CryptoKeyRSA::importSpki):
3363         (WebCore::CryptoKeyRSA::exportSpki):
3364         * crypto/keys/CryptoKeyRSA.h:
3365         * crypto/mac/CryptoKeyRSAMac.cpp:
3366         (WebCore::bytesUsedToEncodedLength):
3367         (WebCore::bytesNeededForEncodedLength):
3368         (WebCore::addEncodedASN1Length):
3369         (WebCore::CryptoKeyRSA::importSpki):
3370         (WebCore::CryptoKeyRSA::exportSpki):
3371
3372 2016-12-06  Simon Fraser  <simon.fraser@apple.com>
3373
3374         Fix editing text flakiness introduced in r209411
3375         https://bugs.webkit.org/show_bug.cgi?id=165500
3376
3377         Reviewed by Dean Jackson.
3378
3379         The "insideFixed" out param was left uninitialized sometimes. This affected FrameSelection's 
3380         m_caretInsidePositionFixed, which caused problems in these tests.
3381
3382         Tested by editing tests in WK1.
3383
3384         * editing/htmlediting.cpp:
3385         (WebCore::absoluteBoundsForLocalCaretRect):
3386
3387 2016-12-06  Alexey Proskuryakov  <ap@apple.com>
3388
3389         Correct SDKROOT values in xcconfig files
3390         https://bugs.webkit.org/show_bug.cgi?id=165487
3391         rdar://problem/29539209
3392
3393         Reviewed by Dan Bernstein.
3394
3395         Fix suggested by Dan Bernstein.
3396
3397         * Configurations/DebugRelease.xcconfig:
3398
3399 2016-12-06  Saam Barati  <sbarati@apple.com>
3400
3401         Remove old Wasm object model
3402         https://bugs.webkit.org/show_bug.cgi?id=165481
3403
3404         Reviewed by Keith Miller and Mark Lam.
3405
3406         * testing/Internals.cpp:
3407         (WebCore::Internals::parserMetaData):
3408