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