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