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