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