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