5753a585e66374f23b1ed4f112ee68d5addcecff
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-31  Jer Noble  <jer.noble@apple.com>
2
3         Unreviewed build fix for the build fix; AVStreamDataParser not defined on iOS.
4
5         * platform/spi/mac/AVFoundationSPI.h:
6
7 2016-10-31  Zalan Bujtas  <zalan@apple.com>
8
9         LayoutTests/fast/frames/invalid-frameset.html is not clean by the end of FrameView::layout().
10         https://bugs.webkit.org/show_bug.cgi?id=164230
11
12         Reviewed by Simon Fraser.
13
14         When a <frameset> has invalid children, in addition to clear the needs layout flag on the children
15         we also need to do clear the descendants too.
16
17         Covered by LayoutTests/fast/frames/invalid-frameset.html.
18
19         * rendering/RenderFrameSet.cpp:
20         (WebCore::RenderFrameSet::positionFrames):
21
22 2016-10-31  Jer Noble  <jer.noble@apple.com>
23
24         Unreviewed build fix after r208151; outputMIMECodecParameterForInputMIMECodecParameter not
25         defined pre-Sierra.
26
27         * platform/spi/mac/AVFoundationSPI.h:
28
29 2016-10-31  Zalan Bujtas  <zalan@apple.com>
30
31         ASSERTION FAILED: !m_trailingWhitespaceWidth in WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace
32         https://bugs.webkit.org/show_bug.cgi?id=164076
33
34         Reviewed by Antti Koivisto.
35
36         FontCascade's text measure methods return NaN for zero sized fonts. We could actually early return and not
37         measure text with zero font size at all.
38
39         Test: fast/text/simple-line-layout-with-zero-sized-font.html
40
41         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
42         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
43         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
44
45 2016-10-31  Dave Hyatt  <hyatt@apple.com>
46
47         [CSS Parser] Support -webkit-named-image
48         https://bugs.webkit.org/show_bug.cgi?id=164235
49
50         Reviewed by Dean Jackson.
51
52         * css/CSSValueKeywords.in:
53         * css/parser/CSSPropertyParserHelpers.cpp:
54         (WebCore::CSSPropertyParserHelpers::consumeWebkitNamedImage):
55         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
56         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
57
58 2016-10-28  Brent Fulgham  <bfulgham@apple.com>
59
60         Do a better job of protecting Frame objects in the context of JavaScript calls
61         https://bugs.webkit.org/show_bug.cgi?id=164163
62         <rdar://problem/28955249>
63
64         Reviewed by Darin Adler.
65
66         * editing/AlternativeTextController.cpp:
67         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Protected the Frame.
68         * editing/Editor.cpp:
69         (WebCore::Editor::setTextAsChildOfElement): Ditto.
70         * editing/EditorCommand.cpp:
71         (WebCore::executeSwapWithMark): Ditto.
72         * editing/TypingCommand.cpp:
73         (WebCore::TypingCommand::deleteKeyPressed): Ditto.
74         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
75         * editing/mac/EditorMac.mm:
76         (WebCore::Editor::replaceNodeFromPasteboard): Ditto.
77         * page/ContextMenuController.cpp:
78         (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
79         * page/DOMSelection.cpp:
80         (WebCore::DOMSelection::collapse): Ditto.
81         (WebCore::DOMSelection::collapseToEnd): Ditto.
82         (WebCore::DOMSelection::collapseToStart): Ditto.
83         (WebCore::DOMSelection::setBaseAndExtent): Ditto.
84         (WebCore::DOMSelection::setPosition): Ditto.
85         (WebCore::DOMSelection::modify): Ditto.
86         (WebCore::DOMSelection::extend): Ditto.
87         (WebCore::DOMSelection::addRange): Ditto.
88         (WebCore::DOMSelection::deleteFromDocument): Ditto.
89         * page/DragController.cpp:
90         (WebCore::setSelectionToDragCaret): Ditto.
91         (WebCore::DragController::startDrag): Ditto.
92         * page/Frame.cpp:
93         (WebCore::Frame::checkOverflowScroll): Ditto.
94         * page/TextIndicator.cpp:
95         (WebCore::TextIndicator::createWithRange): Ditto.
96
97 2016-10-31  Dave Hyatt  <hyatt@apple.com>
98
99         [CSS Parser] Make sure to fail on :role(a,b) and :dir(a,b)
100         https://bugs.webkit.org/show_bug.cgi?id=164233
101
102         Reviewed by Dean Jackson.
103
104         * css/parser/CSSSelectorParser.cpp:
105         (WebCore::CSSSelectorParser::consumePseudo):
106
107 2016-10-31  Dave Hyatt  <hyatt@apple.com>
108
109         [CSS Parser] Allow unitless values on background-size in quirks mode
110         https://bugs.webkit.org/show_bug.cgi?id=164232
111
112         Reviewed by Dean Jackson.
113
114         * css/parser/CSSPropertyParser.cpp:
115         (WebCore::consumeBackgroundSize):
116
117 2016-10-31  Jer Noble  <jer.noble@apple.com>
118
119         Unreviewed build fix after r208151; _setPreventsSleepDuringVideoPlayback: only defined in non-simulator SDKs.
120
121         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
122         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
123         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
124         * platform/spi/mac/AVFoundationSPI.h:
125
126 2016-10-31  Nan Wang  <n_wang@apple.com>
127
128         AX: iOS Voiceover does not announce previously selected value from input type="date" form field
129         https://bugs.webkit.org/show_bug.cgi?id=164176
130
131         Reviewed by Chris Fleizach.
132
133         Input type date is a popup button on iOS and its value was not exposed in stringValue() since
134         it's not considered a text control. Instead, the value was exposed in AXTitle. Fixed this by adding
135         the case in stringValue() and removing the AXTitle exposure.
136
137         Changes are covered in modified test.
138
139         * accessibility/AccessibilityObject.h:
140         * accessibility/AccessibilityRenderObject.cpp:
141         (WebCore::AccessibilityRenderObject::stringValue):
142         * accessibility/ios/AccessibilityObjectIOS.mm:
143         (WebCore::AccessibilityObject::isInputTypePopupButton):
144         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
145         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
146
147 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
148
149         Add requestIdleCallback to features.json.
150
151         * features.json:
152
153 2016-10-31  Dave Hyatt  <hyatt@apple.com>
154
155         [CSS Parser] Fully support prefixed background-size and box-shadows
156         https://bugs.webkit.org/show_bug.cgi?id=164228
157
158         Reviewed by Zalan Bujtas.
159
160         * css/parser/CSSPropertyParser.cpp:
161         (WebCore::CSSPropertyParser::parseSingleValue):
162
163 2016-10-31  Dave Hyatt  <hyatt@apple.com>
164
165         [CSS Parser] Get rid of CSSCustomIdentValue::creates
166         https://bugs.webkit.org/show_bug.cgi?id=164225
167
168         Reviewed by Zalan Bujtas.
169
170         Get rid of all instances of CSSCustomIdent::create, since our style
171         resolution code isn't prepared to handle that value type yet.
172
173         * css/parser/CSSPropertyParser.cpp:
174         (WebCore::consumeAnimationName):
175         (WebCore::consumeTransitionProperty):
176         (WebCore::consumeAttr):
177
178 2016-10-31  Jer Noble  <jer.noble@apple.com>
179
180         Opt-out of AVPlayer automatic sleep disabling
181         https://bugs.webkit.org/show_bug.cgi?id=163983
182
183         Reviewed by Eric Carlson.
184
185         In addition to the DisplaySleepDisabler, notify the MediaPlayerPrivateAVFoundationObjC object whether
186         it should disable display sleep.  Provide all the necessary boilerplate to allow the media player private
187         to query the HTMLMediaPlayer so that the correct value can be set on AVPlayer upon creation.
188
189         * html/HTMLMediaElement.cpp:
190         (WebCore::HTMLMediaElement::updateSleepDisabling):
191         * html/HTMLMediaElement.h:
192         * platform/graphics/MediaPlayer.cpp:
193         (WebCore::MediaPlayer::setShouldDisableSleep):
194         (WebCore::MediaPlayer::shouldDisableSleep):
195         * platform/graphics/MediaPlayer.h:
196         (WebCore::MediaPlayerClient::mediaPlayerShouldDisableSleep):
197         * platform/graphics/MediaPlayerPrivate.h:
198         (WebCore::MediaPlayerPrivateInterface::setShouldDisableSleep):
199         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
200         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
201         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
202         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
203
204         Drive-by fix: Re-organize the contents of AVFoundationSPI.h so that there's a single top-level
205         #if USE(APPLE_INTERNAL_SDK) statement, rather than that conditional being sprinkled about the
206         file.
207
208         * platform/spi/mac/AVFoundationSPI.h:
209
210 2016-10-31  Jer Noble  <jer.noble@apple.com>
211
212         REGRESSION (r206300): LayoutTest media/media-source/media-source-duplicate-seeked.html timing out
213         https://bugs.webkit.org/show_bug.cgi?id=162496
214
215         Reviewed by Darin Adler.
216
217         The change to MockMediaSourcePrivate in r206300 revealed a true bug: seeks to the MediaSource's duration
218         will always fail. We should discard out of hand seeks which are greater than the duration, but allow seeks
219         directly to the duration.
220
221         * Modules/mediasource/MediaSource.cpp:
222         (WebCore::MediaSource::hasBufferedTime):
223
224 2016-10-31  Jer Noble  <jer.noble@apple.com>
225
226         Allow multiple playing videos on a page with 'autoplay' and 'playsinline' attributes
227         https://bugs.webkit.org/show_bug.cgi?id=162366
228         <rdar://problem/28639600>
229
230         Reviewed by Eric Carlson.
231
232         Tests: media/video-concurrent-visible-playback.html
233                media/video-multiple-concurrent-playback.html
234
235         Separate out the concept of "video-only" from "video-with-audio" in PlatformMediaSession::MediaType,
236         and only set the ConcurrentPlaybackNotPermitted restriction for "video-with-audio".  This allows multiple
237         silent video elements to play back simultaneously.
238
239         However, the bug in question also shows bad behavior when both concurrent playback and invisible playback
240         are not allowed. Namely, an invisible element will attempt to autoplay, interrupt visible elements, and
241         then fail to play due to it's non-visibility.  Add an extra check to canTransitionFromAutoplayToPlay()
242         which asks the session if autoplay is allowed (which will return false if the element is not visible).
243
244         * html/HTMLMediaElement.cpp:
245         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
246         (WebCore::HTMLMediaElement::mediaType):
247         (WebCore::HTMLMediaElement::presentationType):
248         (WebCore::HTMLMediaElement::updateShouldAutoplay):
249         (WebCore::mediaElementIsAllowedToAutoplay): Deleted.
250         * html/MediaElementSession.cpp:
251         (WebCore::MediaElementSession::autoplayPermitted):
252         * html/MediaElementSession.h:
253         * platform/audio/PlatformMediaSession.h:
254         * platform/audio/ios/MediaSessionManagerIOS.mm:
255         (WebCore::MediaSessionManageriOS::resetRestrictions):
256         * testing/Internals.cpp:
257         (WebCore::Internals::setMediaSessionRestrictions):
258
259 2016-10-31  Dave Hyatt  <hyatt@apple.com>
260
261         [CSS Parser] Support unprefixed cross-fade
262         https://bugs.webkit.org/show_bug.cgi?id=164224
263
264         Reviewed by Zalan Bujtas.
265
266         * css/CSSValueKeywords.in:
267         * css/parser/CSSPropertyParserHelpers.cpp:
268         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
269         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
270
271 2016-10-31  Dave Hyatt  <hyatt@apple.com>
272
273         [CSS Parser] Simplify background-position-x/y style mapping
274         https://bugs.webkit.org/show_bug.cgi?id=164223
275
276         Reviewed by Zalan Bujtas.
277
278         * css/CSSToStyleMap.cpp:
279         (WebCore::CSSToStyleMap::mapFillXPosition):
280         (WebCore::CSSToStyleMap::mapFillYPosition):
281         * css/StyleBuilderConverter.h:
282         (WebCore::StyleBuilderConverter::convertFontSynthesis):
283
284 2016-10-31  Darin Adler  <darin@apple.com>
285
286         Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
287         https://bugs.webkit.org/show_bug.cgi?id=164214
288
289         Reviewed by Alex Christensen.
290
291         * Modules/fetch/FetchRequest.cpp:
292         (WebCore::FetchRequest::initializeOptions): Use FetchHeaders& instead of
293         Ref<FetchHeaders> for return value.
294         (WebCore::FetchRequest::initializeWith): Ditto.
295         * Modules/fetch/FetchRequest.h: Updated for above.
296
297         * Modules/mediasource/MediaSource.cpp:
298         (WebCore::MediaSource::addSourceBuffer): Use SourceBuffer& instead of
299         SourceBuffer* for return value.
300         * Modules/mediasource/MediaSource.h: Updated for above.
301
302         * bindings/js/JSDOMBinding.h: Added overloads of checkSecurityForNode so
303         it works with a function returning a reference.
304
305         * css/CSSPrimitiveValue.cpp:
306         (WebCore::CSSPrimitiveValue::getCounterValue): Use Counter& instead of
307         Counter* for return value.
308         (WebCore::CSSPrimitiveValue::getRectValue): Use Rect& instead of
309         Rect* for return value.
310         * css/CSSPrimitiveValue.h: Updated for above.
311
312         * dom/ChildNode.idl: Use non-legacy exceptions.
313
314         * dom/ContainerNode.cpp:
315         (WebCore::ContainerNode::querySelector): Use ExceptionOr.
316         (WebCore::ContainerNode::querySelectorAll): Ditto.
317         (WebCore::ContainerNode::append): Ditto.
318         (WebCore::ContainerNode::prepend): Ditto.
319         * dom/ContainerNode.h: Updated for above.
320
321         * dom/Document.cpp:
322         (WebCore::Document::selectorQueryForString): Use ExceptionOr.
323         * dom/Document.h: Updated for above.
324
325         * dom/Element.cpp:
326         (WebCore::Element::attachShadow): Return ShadowRoot& instead of
327         Ref<ShadowRoot> since the shadow root is owned by the element, not
328         the caller.
329         (WebCore::Element::matches): Updated for change to make the
330         selectorQueryForString function use ExceptionOr.
331         (WebCore::Element::closest): Ditto.
332         (WebCore::contextNodeForInsertion): Return ContainerNode& instead of
333         ContainerNode*.
334         (WebCore::contextElementForInsertion): Updated for above.
335         * dom/Element.h: Updated for above.
336         * dom/Element.idl: Changed return type for closest and for
337         insertAdjacentElement to be nullable since both can return null.
338
339         * dom/ExceptionOr.h: Added a specialization for ExceptionOr<T&>.
340
341         * dom/Node.cpp:
342         (WebCore::Node::convertNodesOrStringsIntoNode): Use ExceptionOr.
343         (WebCore::Node::before): Ditto.
344         (WebCore::Node::after): Ditto.
345         (WebCore::Node::replaceWith): Ditto.
346         * dom/Node.h: Updated for above changes.
347
348         * dom/ParentNode.idl: Use non-legacy exceptions.
349
350         * dom/SelectorQuery.cpp:
351         (WebCore::SelectorDataList::queryAll): Changed return type to Ref.
352         (WebCore::SelectorQueryCache::add): Use ExceptionOr.
353         * dom/SelectorQuery.h: Updated for above changes.
354
355         * html/HTMLFrameOwnerElement.cpp:
356         (WebCore::HTMLFrameOwnerElement::getSVGDocument): Return
357         Document& instead of Document*.
358         * html/HTMLFrameOwnerElement.h: Updated for above change.
359
360         * html/HTMLMediaElement.cpp:
361         (WebCore::HTMLMediaElement::addTextTrack): Return TextTrack&
362         instead of Ref<TextTrack>.
363         * html/HTMLMediaElement.h: Updated for above.
364
365         * html/HTMLPlugInImageElement.cpp:
366         (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay):
367         Updated for new exceptions.
368         * inspector/InspectorDOMAgent.cpp:
369         (WebCore::InspectorDOMAgent::querySelector): Ditto.
370         (WebCore::InspectorDOMAgent::querySelectorAll): Ditto.
371         (WebCore::InspectorDOMAgent::performSearch): Ditto.
372         (WebCore::InspectorDOMAgent::highlightSelector): Ditto.
373
374         * inspector/InspectorNodeFinder.cpp:
375         (WebCore::InspectorNodeFinder::performSearch): Put a null check
376         here so callers don't have to do it. Pass references to the
377         individual functions since the pointer can't be null.
378         (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
379         Updated to use reference and streamlined code a bit, using
380         containsIgnoringASCIICase instead of findIgnoringCase.
381         (WebCore::InspectorNodeFinder::matchesAttribute): Ditto.
382         (WebCore::InspectorNodeFinder::matchesElement): Ditto.
383         (WebCore::InspectorNodeFinder::searchUsingXPath): Ditto.
384         (WebCore::InspectorNodeFinder::searchUsingCSSSelectors): Ditto.
385         Also updated  for new exceptions in querySelectorAll.
386         * inspector/InspectorNodeFinder.h: Updated for above.
387
388         * page/Crypto.cpp:
389         (WebCore::Crypto::webkitSubtle): Return WebKitSubtleCrypto&
390         insetad of WebKitSubtleCrypto*.
391         * page/Crypto.h: Updated for above.
392
393         * testing/Internals.h: Removed declarations for functions already
394         removed: ensureShadowRoot and createShadowRoot.
395
396 2016-10-31  Darin Adler  <darin@apple.com>
397
398         Convert Document from ExceptionCode to Exception
399         https://bugs.webkit.org/show_bug.cgi?id=164212
400
401         Reviewed by Alex Christensen.
402
403         * Modules/websockets/WebSocketChannel.cpp:
404         (WebCore::WebSocketChannel::processBuffer): Removed IGNORE_EXCEPTION.
405
406         * dom/ContainerNode.cpp:
407         (WebCore::ContainerNode::takeAllChildrenFrom): Use releaseReturnValue
408         instead of ASSERT_NO_EXCEPTION.
409         (WebCore::ContainerNode::parserInsertBefore): Removed ASSERT_NO_EXCEPTION.
410         (WebCore::ContainerNode::parserAppendChild): Ditto.
411
412         * dom/DOMImplementation.cpp:
413         (WebCore::DOMImplementation::createDocumentType): Updated for new
414         exception handling.
415         (WebCore::DOMImplementation::createDocument): Ditto.
416
417         * dom/Document.cpp:
418         (WebCore::createHTMLElementWithNameValidation): Return ExceptionOr.
419         (WebCore::Document::createElementForBindings): Ditto.
420         (WebCore::Document::createCDATASection): Ditto.
421         (WebCore::Document::createProcessingInstruction): Ditto.
422         (WebCore::Document::importNode): Ditto.
423         (WebCore::Document::adoptNode): Ditto.
424         (WebCore::Document::createElementNS): Ditto.
425         (WebCore::Document::setXMLVersion): Ditto.
426         (WebCore::Document::setBodyOrFrameset): Ditto.
427         (WebCore::Document::processHttpEquiv): Ditto.
428         (WebCore::Document::createEvent): Ditto.
429         (WebCore::Document::cookie): Ditto.
430         (WebCore::Document::setCookie): Ditto.
431         (WebCore::Document::setDomain): Ditto.
432         (WebCore::Document::parseQualifiedName): Ditto. Also added an overload
433         that constructs a QualifiedName directly that most call sites can use.
434         (WebCore::Document::createAttribute): Return ExceptionOr.
435         (WebCore::Document::createAttributeNS): Ditto.
436         (WebCore::Document::createTouch): Removed unneeded ExceptionCode&.
437         * dom/Document.h: Updated for above.
438         * dom/Document.idl: Use non-legacy exceptions. Removed exception
439         entirely from createTouch.
440
441         * dom/Element.cpp:
442         (WebCore::Element::parseAttributeName): Updated to use the new
443         Document::parseQualifiedName.
444         * editing/EditorCommand.cpp:
445         (WebCore::executeFormatBlock): Ditto.
446
447         * inspector/InspectorDOMAgent.cpp:
448         (WebCore::InspectorDOMAgent::setNodeName): Updated for the new
449         exception handling.
450         * inspector/InspectorPageAgent.cpp:
451         (WebCore::InspectorPageAgent::getCookies): Ditto.
452
453         * page/ios/FrameIOS.mm:
454         (WebCore::Frame::initWithSimpleHTMLDocument): Use the
455         HTMLHtmlElement::create and HTMLBodyElement::create instead of using
456         createElementNS to make the simple document.
457
458         * svg/animation/SVGSMILElement.cpp:
459         (WebCore::SVGSMILElement::constructAttributeName): Renamed, made this
460         a member function, updated to use the new Document::parseQualifiedName,
461         and also moved the code to get the attribute in here.
462         (WebCore::SVGSMILElement::constructAttributeName): Added. Helper function
463         for the two places we update the attribute name from attributeNameAttr.
464         (WebCore::SVGSMILElement::insertedInto): Use updateAttributeName.
465         (WebCore::SVGSMILElement::svgAttributeChanged): Ditto.
466         * svg/animation/SVGSMILElement.h: Updated for the above.
467
468         * xml/parser/XMLDocumentParserLibxml2.cpp:
469         (WebCore::XMLDocumentParser::processingInstruction): Updated to understand
470         ExceptionOr rather than an out argument.
471         (WebCore::XMLDocumentParser::startDocument): Removed ASSERT_NO_EXCEPTION.
472
473 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
474
475         Holding down a key to choose an accented character should fire "insertReplacementText" input events
476         https://bugs.webkit.org/show_bug.cgi?id=164209
477         <rdar://problem/29019305>
478
479         Reviewed by Darin Adler.
480
481         For TypingCommands that correspond to "insertReplacementText" inputTypes, vend dataTransfers for resulting
482         beforeinput and input events if the edited area is not an input field or textarea. To do this, convert the plain
483         text representation of the content to be inserted to HTML text using a helper function,
484         MarkupAccumulator::appendCharactersReplacingEntities, that is used when creating markup for Text nodes.
485
486         Tests: fast/events/before-input-prevent-insert-replacement.html
487                fast/events/input-event-insert-replacement.html
488
489         * editing/TypingCommand.cpp:
490         (WebCore::TypingCommand::inputEventData):
491         (WebCore::TypingCommand::inputEventDataTransfer):
492         * editing/TypingCommand.h:
493
494 2016-10-30  Dave Hyatt  <hyatt@apple.com>
495
496         [CSS Parser] Miscellaneous bug fixes
497         https://bugs.webkit.org/show_bug.cgi?id=164211
498
499         Reviewed by Darin Adler.
500
501         * css/parser/CSSPropertyParser.cpp:
502         (WebCore::CSSPropertyParser::consumeTransformOrigin):
503         Make sure to properly reject invalid transform-origin-z values.
504
505         * css/parser/CSSSelectorParser.cpp:
506         (WebCore::CSSSelectorParser::consumeAttribute):
507         Make attribute selector parsing strict about requiring a ] to end
508         the selector.
509
510         (WebCore::CSSSelectorParser::consumePseudo):
511         Force the nth-child "of" syntax to have whitespace after "of" but
512         before the selector. It is unclear if this should be a requirement
513         or not (spec is ambiguous), but for now we match the old parser.
514
515         (WebCore::CSSSelectorParser::consumeCombinator):
516         Fix a bug that caused the double child combinator to match even
517         when there was whitespace between the two > symbols.
518
519 2016-10-31  Youenn Fablet  <youenn@apple.com>
520
521         RTCOfferAnswerOptions does not need to be refcounted
522         https://bugs.webkit.org/show_bug.cgi?id=164216
523
524         Reviewed by Darin Adler.
525
526         Covered by existing tests.
527
528         Making RTCOffer/Answer options dictionaries as per specification.
529         Removing code that handles RTCOffer/Answer options dictionary since this is done by the binding generator.
530         Updated users of the options accordingly.
531
532         * CMakeLists.txt:
533         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
534         (WebCore::MediaEndpointPeerConnection::createOffer):
535         (WebCore::MediaEndpointPeerConnection::createOfferTask):
536         (WebCore::MediaEndpointPeerConnection::createAnswer):
537         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
538         * Modules/mediastream/MediaEndpointPeerConnection.h:
539         * Modules/mediastream/PeerConnectionBackend.h:
540         * Modules/mediastream/RTCOfferAnswerOptions.cpp: Removed.
541         * Modules/mediastream/RTCOfferAnswerOptions.h:
542         * Modules/mediastream/RTCPeerConnection.cpp:
543         (WebCore::RTCPeerConnection::queuedCreateOffer):
544         (WebCore::RTCPeerConnection::queuedCreateAnswer):
545         * Modules/mediastream/RTCPeerConnection.h:
546         * Modules/mediastream/RTCPeerConnection.idl:
547         * WebCore.xcodeproj/project.pbxproj:
548
549 2016-10-31  Youenn Fablet  <youenn@apple.com>
550
551         fast/mediastream/RTCPeerConnection-* tests crashing under ASan
552         https://bugs.webkit.org/show_bug.cgi?id=164215
553
554         Reviewed by Philippe Normand.
555
556         Covered by ASAN bot tests.
557
558         * platform/mediastream/SDPProcessorScriptResource.cpp:
559         (WebCore::SDPProcessorScriptResource::scriptString):
560
561 2016-10-28  Philippe Normand  <pnormand@igalia.com>
562
563         [OpenWebRTC] Initialize library one time only
564         https://bugs.webkit.org/show_bug.cgi?id=164118
565
566         Reviewed by Darin Adler.
567
568         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp:
569         (WebCore::initializeOpenWebRTC): Prevent multiple initialisations of the library.
570
571 2016-10-30  Brent Fulgham  <bfulgham@apple.com>
572
573         Unreviewed fix: Correct ChangeLog after my bad merge.
574
575         * ChangeLog
576
577 2016-10-30  Darin Adler  <darin@apple.com>
578
579         Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
580         https://bugs.webkit.org/show_bug.cgi?id=164206
581
582         Reviewed by Chris Dumez.
583
584         * bindings/js/JSDOMStringMapCustom.cpp:
585         (WebCore::JSDOMStringMap::getOwnPropertyNames): Use modern for loop, and
586         updates since the names function now returns a vector.
587         (WebCore::JSDOMStringMap::putDelegate): Use propagateException. Also return
588         true any time an exception is raised. Since true tells the caller to return
589         without doing any work, we always want to return that on an exception.
590         * dom/DatasetDOMStringMap.cpp:
591         (WebCore::DatasetDOMStringMap::names): Renamed from getNames and made this
592         return a Vector instead of populating a passed-in vector.
593         (WebCore::DatasetDOMStringMap::setItem): Use ExceptionOr.
594         * dom/DatasetDOMStringMap.h: Updated for above.
595
596         * dom/Document.cpp:
597         (WebCore::Document::adoptNode): Updated to use ExceptionOr for
598         removeAttributeNode. Changed to use remove rather than removeChild for
599         better clarity.
600
601         * dom/Element.cpp:
602         (WebCore::Element::setAttribute): Use ExceptionOr.
603         (WebCore::Element::createShadowRoot): Deleted. Unused.
604         (WebCore::Element::attachShadow): Use ExceptionOr.
605         (WebCore::Element::shadowRootForBindings): Tweaked a bit.
606         (WebCore::Element::userAgentShadowRoot): Removed unneeded if statemment.
607         (WebCore::Element::ensureUserAgentShadowRoot): Tweaked a bit.
608         (WebCore::Element::setAttributeNode): Use ExceptionOr.
609         (WebCore::Element::setAttributeNodeNS): Ditto.
610         (WebCore::Element::removeAttributeNode): Ditto.
611         (WebCore::Element::parseAttributeName): Ditto. Also changed return result
612         to be a QualifiedName instead of using an out argument.
613         (WebCore::Element::setAttributeNS): Ditto.
614         (WebCore::Element::mergeWithNextTextNode): Ditto.
615         (WebCore::Element::setOuterHTML): Ditto.
616         (WebCore::Element::setInnerHTML): Ditto.
617         (WebCore::Element::matches): Ditto.
618         (WebCore::Element::closest): Ditto.
619         (WebCore::Element::insertAdjacent): Ditto.
620         (WebCore::Element::insertAdjacentElement): Ditto.
621         (WebCore::contextNodeForInsertion): Ditto.
622         (WebCore::contextElementForInsertion): Added. Helper for the
623         insertAdjacentHTML function to eliminate a local variable.
624         (WebCore::Element::insertAdjacentHTML): Use ExceptionOr.
625         (WebCore::Element::insertAdjacentText): Ditto.
626         * dom/Element.h: Updated for above.
627         * dom/Element.idl: Use non-legacy exceptions.
628
629         * dom/NamedNodeMap.cpp:
630         (WebCore::NamedNodeMap::removeNamedItem): Use ExceptionOr.
631         (WebCore::NamedNodeMap::supportedPropertyNames): Updated to check
632         which strings should be removed without copying the strings.
633         (WebCore::NamedNodeMap::removeNamedItemNS): Use ExceptionOr.
634         (WebCore::NamedNodeMap::setNamedItem): Ditto. Removed overload for
635         legacy bindings; move that to the bindings themselves.
636         * dom/NamedNodeMap.h: Updated for above.
637         * dom/NamedNodeMap.idl: Use non-legacy exceptions.
638
639         * html/HTMLElement.cpp:
640         (WebCore::HTMLElement::setOuterText): Updated since mergeWithNextTextNode
641         now uses ExceptionOr.
642
643         * inspector/DOMEditor.cpp: Updated to use ExceptionOr.
644
645         * inspector/InspectorDOMAgent.cpp:
646         (WebCore::InspectorDOMAgent::toErrorString): Added an overload for
647         Exception.
648         (WebCore::InspectorDOMAgent::setAttributesAsText): Updated to use ExceptionOr.
649         * inspector/InspectorDOMAgent.h: Updated for above.
650
651         * inspector/InspectorStyleSheet.cpp:
652         (WebCore::InspectorStyleSheetForInlineStyle::setStyleText): Updated to
653         use the correct version of setAttribute; there was never a risk that there
654         would be an exception, but now that's clearer.
655
656         * testing/Internals.cpp:
657         (WebCore::Internals::ensureShadowRoot): Deleted. Was unused.
658         (WebCore::Internals::createShadowRoot): Ditto.
659         * testing/Internals.idl: Updated for above.
660
661         * xml/parser/XMLDocumentParserLibxml2.cpp:
662         (WebCore::handleNamespaceAttributes): Use updated parseAttributeName,
663         which uses ExceptionOr and a return value instead of an out argument.
664         (WebCore::handleElementAttributes): Ditto.
665
666 2016-10-30  Sam Weinig  <sam@webkit.org>
667
668         [WebIDL] Restructure IDLParser structs to better match modern WebIDL concepts
669         https://bugs.webkit.org/show_bug.cgi?id=164208
670
671         Reviewed by Darin Adler.
672
673         Restructure IDLParsers structs to match modern WebIDL conventions:
674         - Rename structs to have more WebCore like naming, consistently using
675           the prefix IDL.
676         - Remove domSignature. Sinking it's properties into the structs that
677           contained it.
678         - Add IDLArgument, replacing the use of domSignatures for arguments.
679           IDLArgument is the subset of domSignatures needed for arguments.
680         - Rename domFunction to IDLOperation (matching WebILD nomenclature),
681           replace signature with its own name, type (for returnType), specials,
682           and extended attributes properties.
683         - Give IDLAttribute it's own name, type and extended attributes properties.
684         - Add IDLDictionaryMember, replacing the use of domSignature as the
685           type of members in IDLDictionary. Give it name, type, isRequired,
686           default and extendedAttributes properties.
687         - Renamed Typedef to be IDLTypedef. Remove the extended attributes 
688           property as those are not allowed in typedefs per-PebIDL.
689
690         Also fix some parsing issues:
691         - Stop parsing 'in' directives in function arguments.
692         - Stop parsing extended attributes in typedefs.
693         - Support applying typedefs to types deep in aggregate types
694           (e.g. (sequence<(LONG or STRING)> or DOMString)?).
695
696         * bindings/scripts/CodeGenerator.pm:
697         * bindings/scripts/IDLParser.pm:
698         * bindings/scripts/generate-bindings.pl:
699         Update for new struct types.
700
701         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
702         * bindings/scripts/test/TestTypedefs.idl:
703         Remove test which tested extended attributes in typedefs,
704         and add a test which tests typedefs used in deep type structures.
705
706         * page/make_settings.pl:
707         Don't generate the 'in' prefix for arguments in IDL files.
708
709 2016-10-30  Dave Hyatt  <hyatt@apple.com>
710
711         [CSS Parser] Fix nth-child serialization
712         https://bugs.webkit.org/show_bug.cgi?id=164210
713
714         Reviewed by Darin Adler.
715
716         Our nth-child serialization preserves what the author originally
717         typed. Even though this is not spec-compliant (the latest CSS Syntax
718         spec has a dumbed down serialization process that doesn't preserve what
719         the author originally typed), I think it's better behavior to preserve
720         this text.
721
722         * css/parser/CSSParserToken.cpp:
723         (WebCore::CSSParserToken::serialize):
724         Fix a bug in the serialization of number tokens that started with
725         a plus sign. Make sure the plus sign is preserved.
726
727         * css/parser/CSSSelectorParser.cpp:
728         (WebCore::CSSSelectorParser::consumePseudo):
729         Grab the range of tokens from after the ( and up to the ) or the "of"
730         and then serialize them. Strip whitepsace from the ends and set that
731         as the selector argument.
732
733 2016-10-30  Brent Fulgham  <bfulgham@apple.com>
734
735         [Win][Direct2D] Correct bookkeeping for begin/end draw pairs
736         https://bugs.webkit.org/show_bug.cgi?id=163898
737
738         Reviewed by Darin Adler.
739
740         Simon pointed out that GraphicsContext objects are generally only created at
741         the time we intend to do drawing, so calling 'BeginDraw' as part of object
742         construction, and 'EndDraw' at time of destruction should be sufficient.
743
744         As usual, he was correct.
745         
746         This patch gets rid of unneeded code and greatly simplifies the Direct2D
747         drawing path.
748         
749         Tested by existing layout tests.
750
751         * platform/graphics/GraphicsContext.h:
752         * platform/graphics/win/GradientDirect2D.cpp:
753         (WebCore::Gradient::fill):Remove unneeded use
754         of 'RenderTargetScopedDrawing.h'.
755         * platform/graphics/win/GraphicsContextDirect2D.cpp:
756         (WebCore::GraphicsContext::releaseWindowsContext): Remove unneeded use
757         of RenderTargetScopedDrawing class.
758         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): Enter
759         the 'BeginDraw' state at object creation.
760         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): End
761         draw state at object destruction.
762         (WebCore::GraphicsContextPlatformPrivate::clip): Remove unneeded call to 'beginDraw'.
763         (WebCore::GraphicsContextPlatformPrivate::beginDraw): Renamed from 'beginDrawIfNeeded'.
764         (WebCore::GraphicsContextPlatformPrivate::endDraw): Get rid of draw state flags.
765         (WebCore::GraphicsContext::beginDraw): Renamed from 'beginDrawIfNeeded'.
766         (WebCore::GraphicsContext::flush): Added.
767         (WebCore::GraphicsContext::drawWithoutShadow): Remove unneeded use of
768         RenderTargetScopedDrawing class.
769         (WebCore::GraphicsContext::drawWithShadow): Ditto.
770         (WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
771         (WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
772         (WebCore::GraphicsContext::didBeginDraw): Deleted.
773         (WebCore::GraphicsContextPlatformPrivate::beginDrawIfNeeded): Deleted.
774         (WebCore::GraphicsContext::beginDrawIfNeeded): Deleted.
775         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
776         (WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Deleted.
777         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
778         (WebCore::ImageBufferData::getData): Remove unneeded use of RenderTargetScopedDrawing class.
779         (WebCore::ImageBufferData::putData):
780         * platform/graphics/win/ImageBufferDirect2D.cpp:
781         (WebCore::ImageBuffer::flushContext): Call new GraphicsContext 'flush' command.
782         (WebCore::ImageBuffer::draw): Remove unneeded use of RenderTargetScopedDrawing class.
783         * platform/graphics/win/NativeImageDirect2D.cpp: Ditto.
784         * platform/graphics/win/RenderTargetScopedDrawing.h: Removed.
785         * svg/graphics/SVGImage.cpp:
786         (WebCore::SVGImage::nativeImage): Remove unneeded use of RenderTargetScopedDrawing class.
787
788 2016-10-30  Dave Hyatt  <hyatt@apple.com> 
789
790         [CSS Parser] Clean up the two types of descendant relations in CSSSelector 
791         https://bugs.webkit.org/show_bug.cgi?id=164203 
792
793         Reviewed by Zalan Bujtas. 
794
795         This patch gets rid of the separate boolean for double child and allows it 
796         to be a unique relation type. Rename Descendant to DescendantSpace and 
797         name the new relation DescendantDoubleChild. 
798
799         * css/CSSSelector.cpp: 
800         (WebCore::CSSSelector::CSSSelector): 
801         (WebCore::CSSSelector::selectorText): 
802         * css/CSSSelector.h: 
803         (WebCore::CSSSelector::hasDescendantRelation): 
804         (WebCore::CSSSelector::hasDescendantOrChildRelation): 
805         (WebCore::CSSSelector::CSSSelector): 
806         (WebCore::CSSSelector::setDescendantUseDoubleChildSyntax): Deleted. 
807         * css/RuleFeature.cpp: 
808         (WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector): 
809         * css/SelectorChecker.cpp: 
810         (WebCore::SelectorChecker::matchRecursively): 
811         (WebCore::SelectorChecker::determineLinkMatchType): 
812         * css/SelectorFilter.cpp: 
813         (WebCore::SelectorFilter::collectIdentifierHashes): 
814         * css/parser/CSSParserValues.cpp: 
815         (WebCore::CSSParserSelector::appendTagHistory): 
816         * css/parser/CSSParserValues.h: 
817         (WebCore::CSSParserSelector::setDescendantUseDoubleChildSyntax): Deleted. 
818         * css/parser/CSSSelectorParser.cpp: 
819         (WebCore::isDescendantCombinator): 
820         (WebCore::CSSSelectorParser::consumeComplexSelector): 
821         (WebCore::CSSSelectorParser::consumeCombinator): 
822         * cssjit/SelectorCompiler.cpp: 
823         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation): 
824
825 2016-10-30  Frederic Wang  <fwang@igalia.com> 
826
827         Unreviewed gardening 
828
829         Fix build error on WinCairo. 
830
831         * platform/graphics/opentype/OpenTypeMathData.cpp: 
832
833 2016-10-30  Frederic Wang  <fwang@igalia.com> 
834
835         Use HarfBuzz ot-math API to parse the OpenType MATH table 
836         https://bugs.webkit.org/show_bug.cgi?id=162671 
837
838         Reviewed by Michael Catanzaro. 
839
840         No new tests, already covered by existing tests. 
841
842         * platform/graphics/opentype/OpenTypeMathData.cpp: Add alternative implementation relying on 
843         HarfBuzz's new OpenType MATH API. 
844         * platform/graphics/opentype/OpenTypeMathData.h: Ditto. 
845         (WebCore::OpenTypeMathData::hasMathData): 
846         (WebCore::OpenTypeMathData::HbFontDeleter::operator()): 
847
848 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
849
850         [CSS Parser] Support unprefixed image-sets 
851         https://bugs.webkit.org/show_bug.cgi?id=164198 
852
853         Reviewed by Dean Jackson. 
854
855         * css/CSSValueKeywords.in: 
856         * css/parser/CSSPropertyParserHelpers.cpp: 
857         (WebCore::CSSPropertyParserHelpers::consumeImage): 
858
859 2016-10-30  Yusuke Suzuki  <utatane.tea@gmail.com> 
860
861         [DOM] Introduce WebCore::jsDynamicDowncast 
862         https://bugs.webkit.org/show_bug.cgi?id=164137 
863  
864         Reviewed by Darin Adler. 
865
866         In WebCore, we have several extended JSTypes, like JSElementType. 
867         For these types, WebCore offers the faster casting function compared 
868         to JSC::jsDynamicCast. For example, for JSElementType, we have 
869         jsElementCast. 
870
871         The problem is that we may fall into the slow code if we choose 
872         JSC::jsDynamicCast by accident. Selecting the appropriate function 
873         requires special care in the IDL code generator when we would like 
874         to use faster casting functions. 
875
876         This patch implements a new casting function, WebCore::jsDynamicDowncast. 
877         It is a thin wrapper to the JSC::jsDynamicCast. But it selects the 
878         faster casting functions correctly by template specialization. 
879
880         We do not choose the way specializing JSC::jsDynamicCast directly. 
881         If we forget to include the header that specializes JSC::jsDyanmicCast, 
882         it does not cause any compile errors, but it causes performance regression. 
883         This bug is hard to figure out. To avoid this problem, we add a new function. 
884
885         Outside JSC, only Tools' DumpRenderTree uses JSC::jsDynamicCast. 
886         This code has FIXME that we should use JSC APIs instead of directly calling 
887         JSC thingy. So this should be solved in the layer of JSC APIs and changing 
888         this jsDynamicCast to WebCore's jsDynamicDowncast and exposing WebCore's thingy 
889         are not good change. So we leave the code as is. 
890
891         * WebCore.xcodeproj/project.pbxproj: 
892         * bindings/js/JSApplePaySessionCustom.cpp: 
893         (WebCore::JSApplePaySession::completeShippingMethodSelection): 
894         (WebCore::JSApplePaySession::completeShippingContactSelection): 
895         (WebCore::JSApplePaySession::completePaymentMethodSelection): 
896         * bindings/js/JSDOMBinding.cpp: 
897         (WebCore::reportException): 
898         * bindings/js/JSDOMBinding.h: 
899         (WebCore::castThisValue): 
900         (WebCore::toArrayBufferView): 
901         * bindings/js/JSDOMIterator.h: 
902         (WebCore::IteratorTraits>::next): 
903         * bindings/js/JSDOMWindowShell.cpp: 
904         (WebCore::JSDOMWindowShell::toWrapped): 
905         * bindings/js/JSDictionary.cpp: 
906         (WebCore::JSDictionary::convertValue): 
907         * bindings/js/JSDocumentCustom.h: 
908         (WebCore::jsDocumentCast): 
909         * bindings/js/JSDynamicDowncast.h: Added. 
910         (WebCore::JSDynamicCastTrait::cast): 
911         (WebCore::JSDynamicCastTrait<JSNode>::cast): 
912         (WebCore::JSDynamicCastTrait<JSElement>::cast): 
913         (WebCore::JSDynamicCastTrait<JSDocument>::cast): 
914         (WebCore::JSDynamicCastTrait<JSEvent>::cast): 
915         (WebCore::jsDynamicDowncast): 
916         * bindings/js/JSElementCustom.h: 
917         (WebCore::jsElementCast): 
918         * bindings/js/JSEventCustom.h: 
919         (WebCore::jsEventCast): 
920         * bindings/js/JSEventListener.cpp: 
921         (WebCore::setDocumentEventHandlerAttribute): 
922         * bindings/js/JSEventTargetCustom.cpp: 
923         (WebCore::jsEventTargetCast): 
924         * bindings/js/JSMediaStreamTrackCustom.cpp: 
925         (WebCore::JSMediaStreamTrack::getSettings): 
926         (WebCore::JSMediaStreamTrack::getCapabilities): 
927         * bindings/js/JSNodeCustom.h: 
928         (WebCore::jsNodeCast): 
929         * bindings/js/JSPluginElementFunctions.cpp: 
930         (WebCore::pluginElementPropertyGetter): 
931         * bindings/js/JSReadableStreamPrivateConstructors.cpp: 
932         (WebCore::constructJSReadableStreamDefaultReader): 
933         * bindings/js/JSReadableStreamSourceCustom.cpp: 
934         (WebCore::startReadableStream): 
935         (WebCore::JSReadableStreamSource::start): 
936         (WebCore::pullReadableStream): 
937         * bindings/js/JSWorkerGlobalScopeBase.cpp: 
938         (WebCore::toJSDedicatedWorkerGlobalScope): 
939         * bindings/js/ScriptModuleLoader.cpp: 
940         (WebCore::ScriptModuleLoader::evaluate): 
941         * bindings/js/SerializedScriptValue.cpp: 
942         (WebCore::CloneSerializer::serialize): 
943         * bindings/js/StructuredClone.cpp: 
944         (WebCore::structuredCloneArrayBufferView): 
945         * bindings/scripts/CodeGeneratorJS.pm: 
946         (GetCastingHelperForThisObject): 
947         (GenerateImplementation): 
948         * bindings/scripts/test/JS/JSInterfaceName.cpp: 
949         (WebCore::jsInterfaceNameConstructor): 
950         (WebCore::setJSInterfaceNameConstructor): 
951         (WebCore::JSInterfaceName::toWrapped): 
952         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: 
953         (WebCore::BindingCaller<JSTestActiveDOMObject>::castForAttribute): 
954         (WebCore::BindingCaller<JSTestActiveDOMObject>::castForOperation): 
955         (WebCore::jsTestActiveDOMObjectConstructor): 
956         (WebCore::setJSTestActiveDOMObjectConstructor): 
957         (WebCore::JSTestActiveDOMObject::toWrapped): 
958         * bindings/scripts/test/JS/JSTestCEReactions.cpp: 
959         (WebCore::BindingCaller<JSTestCEReactions>::castForAttribute): 
960         (WebCore::BindingCaller<JSTestCEReactions>::castForOperation): 
961         (WebCore::jsTestCEReactionsConstructor): 
962         (WebCore::setJSTestCEReactionsConstructor): 
963         (WebCore::JSTestCEReactions::toWrapped): 
964         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: 
965         (WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForAttribute): 
966         (WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForOperation): 
967         (WebCore::jsTestCEReactionsStringifierConstructor): 
968         (WebCore::setJSTestCEReactionsStringifierConstructor): 
969         (WebCore::JSTestCEReactionsStringifier::toWrapped): 
970         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: 
971         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor): 
972         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor): 
973         (WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped): 
974         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: 
975         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor): 
976         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor): 
977         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped): 
978         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: 
979         (WebCore::BindingCaller<JSTestCustomNamedGetter>::castForOperation): 
980         (WebCore::jsTestCustomNamedGetterConstructor): 
981         (WebCore::setJSTestCustomNamedGetterConstructor): 
982         (WebCore::JSTestCustomNamedGetter::toWrapped): 
983         * bindings/scripts/test/JS/JSTestDOMJIT.cpp: 
984         (WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute): 
985         (WebCore::jsTestDOMJITConstructor): 
986         (WebCore::setJSTestDOMJITConstructor): 
987         * bindings/scripts/test/JS/JSTestEventConstructor.cpp: 
988         (WebCore::BindingCaller<JSTestEventConstructor>::castForAttribute): 
989         (WebCore::jsTestEventConstructorConstructor): 
990         (WebCore::setJSTestEventConstructorConstructor): 
991         * bindings/scripts/test/JS/JSTestEventTarget.cpp: 
992         (WebCore::BindingCaller<JSTestEventTarget>::castForOperation): 
993         (WebCore::jsTestEventTargetConstructor): 
994         (WebCore::setJSTestEventTargetConstructor): 
995         (WebCore::JSTestEventTarget::toWrapped): 
996         * bindings/scripts/test/JS/JSTestException.cpp: 
997         (WebCore::BindingCaller<JSTestException>::castForAttribute): 
998         (WebCore::jsTestExceptionConstructor): 
999         (WebCore::setJSTestExceptionConstructor): 
1000         (WebCore::JSTestException::toWrapped): 
1001         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: 
1002         (WebCore::jsTestGenerateIsReachableConstructor): 
1003         (WebCore::setJSTestGenerateIsReachableConstructor): 
1004         (WebCore::JSTestGenerateIsReachable::toWrapped): 
1005         * bindings/scripts/test/JS/JSTestGlobalObject.cpp: 
1006         (WebCore::BindingCaller<JSTestGlobalObject>::castForAttribute): 
1007         (WebCore::BindingCaller<JSTestGlobalObject>::castForOperation): 
1008         (WebCore::jsTestGlobalObjectConstructor): 
1009         (WebCore::setJSTestGlobalObjectConstructor): 
1010         (WebCore::JSTestGlobalObject::toWrapped): 
1011         * bindings/scripts/test/JS/JSTestInterface.cpp: 
1012         (WebCore::BindingCaller<JSTestInterface>::castForAttribute): 
1013         (WebCore::BindingCaller<JSTestInterface>::castForOperation): 
1014         (WebCore::jsTestInterfaceConstructor): 
1015         (WebCore::setJSTestInterfaceConstructor): 
1016         (WebCore::JSTestInterface::toWrapped): 
1017         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: 
1018         (WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute): 
1019         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor): 
1020         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor): 
1021         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped): 
1022         * bindings/scripts/test/JS/JSTestIterable.cpp: 
1023         (WebCore::BindingCaller<JSTestIterable>::castForOperation): 
1024         (WebCore::jsTestIterableConstructor): 
1025         (WebCore::setJSTestIterableConstructor): 
1026         (WebCore::JSTestIterable::toWrapped): 
1027         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: 
1028         (WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForAttribute): 
1029         (WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForOperation): 
1030         (WebCore::jsTestJSBuiltinConstructorConstructor): 
1031         (WebCore::setJSTestJSBuiltinConstructorConstructor): 
1032         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: 
1033         (WebCore::BindingCaller<JSTestMediaQueryListListener>::castForOperation): 
1034         (WebCore::jsTestMediaQueryListListenerConstructor): 
1035         (WebCore::setJSTestMediaQueryListListenerConstructor): 
1036         (WebCore::JSTestMediaQueryListListener::toWrapped): 
1037         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: 
1038         (WebCore::jsTestNamedConstructorConstructor): 
1039         (WebCore::setJSTestNamedConstructorConstructor): 
1040         (WebCore::JSTestNamedConstructor::toWrapped): 
1041         * bindings/scripts/test/JS/JSTestNode.cpp: 
1042         (WebCore::BindingCaller<JSTestNode>::castForAttribute): 
1043         (WebCore::BindingCaller<JSTestNode>::castForOperation): 
1044         (WebCore::jsTestNodeConstructor): 
1045         (WebCore::setJSTestNodeConstructor): 
1046         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: 
1047         (WebCore::BindingCaller<JSTestNondeterministic>::castForAttribute): 
1048         (WebCore::BindingCaller<JSTestNondeterministic>::castForOperation): 
1049         (WebCore::jsTestNondeterministicConstructor): 
1050         (WebCore::setJSTestNondeterministicConstructor): 
1051         (WebCore::JSTestNondeterministic::toWrapped): 
1052         * bindings/scripts/test/JS/JSTestObj.cpp: 
1053         (WebCore::BindingCaller<JSTestObj>::castForAttribute): 
1054         (WebCore::BindingCaller<JSTestObj>::castForOperation): 
1055         (WebCore::jsTestObjConstructor): 
1056         (WebCore::setJSTestObjConstructor): 
1057         (WebCore::JSTestObj::toWrapped): 
1058         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: 
1059         (WebCore::jsTestOverloadedConstructorsConstructor): 
1060         (WebCore::setJSTestOverloadedConstructorsConstructor): 
1061         (WebCore::JSTestOverloadedConstructors::toWrapped): 
1062         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: 
1063         (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor): 
1064         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor): 
1065         (WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped): 
1066         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: 
1067         (WebCore::BindingCaller<JSTestOverrideBuiltins>::castForOperation): 
1068         (WebCore::jsTestOverrideBuiltinsConstructor): 
1069         (WebCore::setJSTestOverrideBuiltinsConstructor): 
1070         (WebCore::JSTestOverrideBuiltins::toWrapped): 
1071         * bindings/scripts/test/JS/JSTestSerialization.cpp: 
1072         (WebCore::BindingCaller<JSTestSerialization>::castForAttribute): 
1073         (WebCore::BindingCaller<JSTestSerialization>::castForOperation): 
1074         (WebCore::jsTestSerializationConstructor): 
1075         (WebCore::setJSTestSerializationConstructor): 
1076         (WebCore::JSTestSerialization::toWrapped): 
1077         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 
1078         (WebCore::BindingCaller<JSTestSerializedScriptValueInterface>::castForAttribute): 
1079         (WebCore::jsTestSerializedScriptValueInterfaceConstructor): 
1080         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor): 
1081         (WebCore::JSTestSerializedScriptValueInterface::toWrapped): 
1082         * bindings/scripts/test/JS/JSTestTypedefs.cpp: 
1083         (WebCore::BindingCaller<JSTestTypedefs>::castForAttribute): 
1084         (WebCore::BindingCaller<JSTestTypedefs>::castForOperation): 
1085         (WebCore::jsTestTypedefsConstructor): 
1086         (WebCore::setJSTestTypedefsConstructor): 
1087         (WebCore::JSTestTypedefs::toWrapped): 
1088         * bridge/objc/WebScriptObject.mm: 
1089         (-[WebScriptObject setValue:forKey:]): 
1090         * bridge/runtime_array.cpp: 
1091         (JSC::RuntimeArray::lengthGetter): 
1092         * bridge/runtime_method.cpp: 
1093         (JSC::RuntimeMethod::lengthGetter): 
1094         * html/HTMLMediaElement.cpp: 
1095         (WebCore::controllerJSValue): 
1096         (WebCore::HTMLMediaElement::updateCaptionContainer): 
1097         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): 
1098         * inspector/InspectorDOMAgent.cpp: 
1099         (WebCore::InspectorDOMAgent::buildObjectForEventListener): 
1100
1101 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1102
1103         [CSS Parser] Add font-variant-* keyword property support 
1104         https://bugs.webkit.org/show_bug.cgi?id=164195 
1105  
1106         Reviewed by Zalan Bujtas. 
1107  
1108         * css/parser/CSSParserFastPaths.cpp: 
1109         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): 
1110
1111 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1112
1113         [CSS Parser] Fix text-emphasis-position parsing 
1114         https://bugs.webkit.org/show_bug.cgi?id=164197 
1115
1116         Reviewed by Zalan Bujtas. 
1117
1118         * css/parser/CSSParserFastPaths.cpp: 
1119         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): 
1120         (WebCore::CSSParserFastPaths::isKeywordPropertyID): 
1121         * css/parser/CSSPropertyParser.cpp: 
1122         (WebCore::consumeTextEmphasisPosition): 
1123         (WebCore::CSSPropertyParser::parseSingleValue): 
1124
1125 2016-10-29  Darin Adler  <darin@apple.com> 
1126
1127         Convert more of DOM from ExceptionCode to Exception 
1128         https://bugs.webkit.org/show_bug.cgi?id=164173 
1129  
1130         Reviewed by Ryosuke Niwa. 
1131  
1132         * Modules/mediastream/MediaDevices.cpp: 
1133         (WebCore::MediaDevices::getUserMedia): Use ExceptionOr. 
1134         (WebCore::MediaDevices::enumerateDevices): Ditto. 
1135         * Modules/mediastream/MediaDevices.h: Updated for above. 
1136         * Modules/mediastream/MediaDevices.idl: Use non-legacy exceptions. 
1137  
1138         * Modules/mediastream/MediaEndpointSessionDescription.cpp: 
1139         Added now-needed include of ExceptionCode.h. 
1140  
1141         * Modules/mediastream/RTCConfiguration.cpp: 
1142         (WebCore::parseIceServer): Use ExceptionOr. 
1143         (WebCore::RTCConfiguration::create): Ditto. 
1144         (WebCore::RTCConfiguration::initialize): Ditto. 
1145         * Modules/mediastream/RTCConfiguration.h: Updated for above. 
1146         * Modules/mediastream/RTCConfiguration.idl: Use non-legacy exceptions. 
1147  
1148         * Modules/mediastream/RTCDTMFSender.cpp: 
1149         (WebCore::RTCDTMFSender::create): Use ExceptionOr. 
1150         (WebCore::RTCDTMFSender::insertDTMF): Ditto. 
1151         * Modules/mediastream/RTCDTMFSender.h: Updated for above. 
1152         * Modules/mediastream/RTCDTMFSender.idl: Use non-legacy exceptions. 
1153  
1154         * Modules/mediastream/RTCDataChannel.cpp: 
1155         (WebCore::RTCDataChannel::create): Use ExceptionOr. 
1156         (WebCore::RTCDataChannel::setBinaryType): Ditto. 
1157         (WebCore::RTCDataChannel::send): Ditto. 
1158         (WebCore::RTCDataChannel::didReceiveRawData): Ditto. 
1159         * Modules/mediastream/RTCDataChannel.h: Updated for above. 
1160         Also changed return values to use const AtomicString& and 
1161         unsigned instead of unsigned long. Also made more private. 
1162         Also changed BinaryType into an enum class. 
1163         * Modules/mediastream/RTCDataChannel.idl: Use non-legacy exceptions. 
1164  
1165         * Modules/mediastream/RTCIceCandidate.cpp: 
1166         (WebCore::RTCIceCandidate::create): Use ExceptionOr. 
1167         * Modules/mediastream/RTCIceCandidate.h: Updated for above. 
1168         * Modules/mediastream/RTCIceCandidate.idl: Use non-legacy exception. 
1169  
1170         * Modules/mediastream/RTCOfferAnswerOptions.cpp: 
1171         (WebCore::RTCOfferOptions::create): Use ExceptionOr. 
1172         (WebCore::RTCAnswerOptions::create): Ditto. 
1173         * Modules/mediastream/RTCOfferAnswerOptions.h: Updated for above. 
1174         Also removed all virtual functions since nothing here is polymorphic 
1175         and initalized data members in the header. 
1176  
1177         * Modules/mediastream/RTCPeerConnection.cpp: 
1178         (WebCore::RTCPeerConnection::initializeWith): Use ExceptionOr. 
1179         (WebCore::RTCPeerConnection::addTrack): Ditto. 
1180         (WebCore::RTCPeerConnection::removeTrack): Ditto. 
1181         (WebCore::RTCPeerConnection::addTransceiver): Ditto. 
1182         (WebCore::RTCPeerConnection::completeAddTransceiver): Ditto. 
1183         (WebCore::RTCPeerConnection::queuedCreateOffer): Ditto. 
1184         (WebCore::RTCPeerConnection::queuedCreateAnswer): Ditto. 
1185         (WebCore::RTCPeerConnection::setConfiguration): Ditto. 
1186         (WebCore::RTCPeerConnection::createDataChannel): Ditto. 
1187         * Modules/mediastream/RTCPeerConnection.h: Updated for above. 
1188         * Modules/mediastream/RTCPeerConnection.idl: Use non-legacy exceptions. 
1189  
1190         * Modules/mediastream/RTCRtpSender.cpp: 
1191         (WebCore::RTCRtpSender::replaceTrack): Use ExceptionOr. 
1192         * Modules/mediastream/RTCRtpSender.h: Updated for above. 
1193         * Modules/mediastream/RTCRtpSender.idl: Use non-legacy exception. 
1194  
1195         * Modules/mediastream/RTCSessionDescription.cpp: 
1196         (WebCore::RTCSessionDescription::create): Use ExceptoinOr. 
1197         * Modules/mediastream/RTCSessionDescription.h: Updated for above. 
1198         (WebCore::RTCSessionDescription::~RTCSessionDescription): 
1199         * Modules/mediastream/RTCSessionDescription.idl: Use non-legacy exceptions. 
1200  
1201         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp: 
1202         (WebCore::verifyCustomHandlerURL): Just return a boolean, no exception. 
1203         (WebCore::verifyProtocolHandlerScheme): Ditto. 
1204         (WebCore::NavigatorContentUtils::registerProtocolHandler): Use ExceptionOr. 
1205         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered): Ditto. 
1206         (WebCore::NavigatorContentUtils::unregisterProtocolHandler): Ditto. 
1207         * Modules/navigatorcontentutils/NavigatorContentUtils.h: Updated for above. 
1208         * Modules/navigatorcontentutils/NavigatorContentUtils.idl: Use non-legacy exceptions. 
1209  
1210         * bindings/js/JSMediaDevicesCustom.cpp: 
1211         (WebCore::JSMediaDevicesGetUserMediaPromiseFunction): Use propagateException. 
1212  
1213         * bindings/scripts/CodeGeneratorJS.pm: 
1214         (NeedsExplicitPropagateExceptionCall): Added. Helper function to decide whether 
1215         we need to call propagateException explicitly, if return value processing is not 
1216         going to propagate the exception for us. 
1217         (GenerateParametersCheck): Moved the code from GenerateReturnParameters inline 
1218         because it's almost as short as the function call. Use the newly created 
1219         NeedsExplicitPropagateExceptionCall function, which properly handles the case 
1220         where the return value is a promise. 
1221         (GenerateReturnParameters): Deleted. 
1222  
1223         * dom/CharacterData.cpp: 
1224         (WebCore::CharacterData::substringData): Use ExceptionOr. 
1225         (WebCore::CharacterData::insertData): Ditto. 
1226         (WebCore::CharacterData::deleteData): Ditto. 
1227         (WebCore::CharacterData::replaceData): Ditto. 
1228         * dom/CharacterData.h: Updated for above. 
1229         * dom/CharacterData.idl: Use non-legacy exceptions. 
1230  
1231         * dom/DataTransferItemList.h: Tried to use ExceptionOr, but this seems 
1232         like dead code that doesn't compile. 
1233         * dom/DataTransferItemList.idl: Use non-legacy exceptions. 
1234  
1235         * dom/MessagePort.idl: Use non-legacy exceptions, except this has 
1236         already been converted and was a custom binding. 
1237  
1238         * dom/MutationObserver.cpp: 
1239         (WebCore::MutationObserver::observe): Use ExceptionOr. 
1240         * dom/MutationObserver.h: Updated for above. 
1241         * dom/MutationObserver.idl: Use non-legacy exception. 
1242  
1243         * dom/Range.cpp: 
1244         (WebCore::deleteCharacterData): Updated use of calls that now use 
1245         ExceptionOr. 
1246         (WebCore::Range::processContentsBetweenOffsets): Ditto. 
1247         (WebCore::Range::insertNode): Ditto. 
1248  
1249         * dom/ShadowRoot.cpp: 
1250         (WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr. 
1251         * dom/ShadowRoot.h: Updated for above. 
1252         * dom/ShadowRoot.idl: Use non-legacy exception. 
1253  
1254         * dom/Text.cpp: 
1255         (WebCore::Text::splitText): Use ExceptionOr. 
1256         (WebCore::Text::replaceWholeText): Removed unused ExceptionCode&. 
1257         * dom/Text.h: Updated for above. 
1258         * dom/Text.idl: Use non-legacy exception. 
1259  
1260         * editing/ApplyBlockElementCommand.cpp: 
1261         (WebCore::isNewLineAtPosition): Rewrote to use data rather than 
1262         substringData; more efficient. 
1263  
1264         * editing/DeleteFromTextNodeCommand.cpp: 
1265         (WebCore::DeleteFromTextNodeCommand::doApply): Updated to work with 
1266         functions that return ExceptionOr. 
1267         (WebCore::DeleteFromTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION. 
1268  
1269         * editing/InsertIntoTextNodeCommand.cpp: 
1270         (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand): 
1271         Use WTFMove to avoid a little bit of reference count churn. 
1272         (WebCore::InsertIntoTextNodeCommand::doApply): Removed IGNORE_EXCEPTION. 
1273         (WebCore::InsertIntoTextNodeCommand::doReapply): Removed ExceptionCode. 
1274         (WebCore::InsertIntoTextNodeCommand::doUnapply): Removed IGNORE_EXCEPTION. 
1275  
1276         * editing/SplitTextNodeCommand.cpp: 
1277         (WebCore::SplitTextNodeCommand::doApply): Updated to work with functions 
1278         that return ExceptionCode. 
1279         (WebCore::SplitTextNodeCommand::doUnapply): Removed ASSERT_NO_EXCEPTION. 
1280         (WebCore::SplitTextNodeCommand::insertText1AndTrimText2): Updated to work 
1281         with functions that return ExceptionCode. 
1282  
1283         * html/HTMLTextFormControlElement.cpp: 
1284         Added now-needed include of ExceptionCode.h. 
1285  
1286         * inspector/DOMEditor.cpp: Removed ExceptionCode out argument from calls 
1287         to replaceWholeText, which never throws an exception. 
1288  
1289 2016-10-29  Dean Jackson  <dino@apple.com> 
1290  
1291         Parse color() function 
1292         https://bugs.webkit.org/show_bug.cgi?id=164146 
1293         <rdar://problems/29007218> 
1294  
1295         Reviewed by Darin Adler. 
1296  
1297         Support the new CSS color() function: 
1298         https://drafts.csswg.org/css-color/#color-function 
1299  
1300         There are separate code paths for the old and new CSS parser. 
1301  
1302         Tests: css3/color/color-function-computed-style.html 
1303                css3/color/color-function-parsing.html 
1304  
1305         * css/CSSComputedStyleDeclaration.cpp: Use Color directly, not via rgb(). 
1306         (WebCore::ComputedStyleExtractor::currentColorOrValidColor): 
1307         (WebCore::ComputedStyleExtractor::valueForShadow): 
1308         (WebCore::ComputedStyleExtractor::propertyValue): 
1309  
1310         * css/CSSValueKeywords.in: Note that there is a color function, but the 
1311         keyword is already defined. Also add keywords for the color spaces. 
1312         * css/SVGCSSValueKeywords.in: sRGB is used outside of SVG now. 
1313  
1314         * css/parser/CSSParser.cpp: Old CSS parser code to handle color(). 
1315         (WebCore::isPercent): Helper to tell if a ValueWithCalculation is a percentage or not. 
1316         (WebCore::CSSParser::parseColorInt): Renamed. 
1317         (WebCore::CSSParser::parseColorDouble): Helper to get a Number/Percentage into a double 
1318         (WebCore::CSSParser::parseRGBParameters): 
1319         (WebCore::CSSParser::parseColorFunctionParameters): 
1320         (WebCore::CSSParser::parseHSLParameters): 
1321         (WebCore::CSSParser::parseColorFromValue): 
1322         (WebCore::CSSParser::colorIntFromValue): Deleted. 
1323         * css/parser/CSSParser.h: 
1324  
1325         * css/parser/CSSPropertyParserHelpers.cpp: New CSS parser code to handle color(). 
1326         (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters): 
1327         (WebCore::CSSPropertyParserHelpers::parseColorFunction): 
1328  
1329         * platform/graphics/Color.h: 
1330         (WebCore::Color::isValid): An extended color is valid. 
1331         (WebCore::Color::rgb): Move the code to a standalone inline 
1332         so that I could add a longer comment. 
1333  
1334         * platform/graphics/ExtendedColor.cpp: 
1335         (WebCore::ExtendedColor::cssText): Alpha output is only needed if != 1. 
1336  
1337         * platform/graphics/cg/ColorCG.cpp: Handle ExtendedColor -> CGColor. 
1338         (WebCore::leakCGColor): 
1339         (WebCore::cachedCGColor): 
1340  
1341 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1342  
1343         [CSS Parser] Disable -webkit-text-size-adjust when the context says to. 
1344         https://bugs.webkit.org/show_bug.cgi?id=164191 
1345  
1346         Reviewed by Dean Jackson. 
1347  
1348         * css/parser/CSSPropertyParser.cpp: 
1349         (WebCore::CSSPropertyParser::parseSingleValue): 
1350  
1351 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1352  
1353         [CSS Parser] Match old parser's image-rendering values 
1354         https://bugs.webkit.org/show_bug.cgi?id=164190 
1355  
1356         Reviewed by Dean Jackson. 
1357  
1358         * css/parser/CSSParserFastPaths.cpp: 
1359         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): 
1360  
1361 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1362  
1363         [CSS Parser] Support -webkit-text value for background-clip and -webkit-background-clip 
1364         https://bugs.webkit.org/show_bug.cgi?id=164189 
1365  
1366         Reviewed by Dean Jackson. 
1367  
1368         * css/parser/CSSPropertyParser.cpp: 
1369         (WebCore::consumeBackgroundBox): 
1370         (WebCore::consumePrefixedBackgroundBox): 
1371  
1372 2016-10-29  Joseph Pecoraro  <pecoraro@apple.com> 
1373  
1374         Remove some unnecessary includes 
1375         https://bugs.webkit.org/show_bug.cgi?id=164174 
1376  
1377         Reviewed by Darin Adler. 
1378  
1379 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1380  
1381         [CSS Parser] Support -webkit-aspect-ratio 
1382         https://bugs.webkit.org/show_bug.cgi?id=164187 
1383  
1384         Reviewed by Simon Fraser. 
1385  
1386         * css/parser/CSSPropertyParser.cpp: 
1387         (WebCore::consumeWebkitAspectRatio): 
1388         (WebCore::CSSPropertyParser::parseSingleValue): 
1389  
1390 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1391  
1392         [CSS Parser] Support the caps lock indicator appearance 
1393         https://bugs.webkit.org/show_bug.cgi?id=164186 
1394  
1395         Reviewed by Simon Fraser. 
1396  
1397         * css/parser/CSSParserFastPaths.cpp: 
1398         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): 
1399  
1400 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1401  
1402         [CSS Parser] Support the alt property 
1403         https://bugs.webkit.org/show_bug.cgi?id=164184 
1404  
1405         Reviewed by Simon Fraser. 
1406  
1407         * css/parser/CSSPropertyParser.cpp: 
1408         (WebCore::consumeAlt): 
1409         (WebCore::CSSPropertyParser::parseSingleValue): 
1410  
1411 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1412  
1413         [CSS Parser] Add support for -webkit-hyphenate-limit-* properties 
1414         https://bugs.webkit.org/show_bug.cgi?id=164183 
1415  
1416         Reviewed by Simon Fraser. 
1417  
1418         * css/parser/CSSPropertyParser.cpp: 
1419         (WebCore::consumeHyphenateLimit): 
1420         (WebCore::CSSPropertyParser::parseSingleValue): 
1421  
1422 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1423  
1424         [CSS Parser] Fix transform-origin and perspective-origin to parse as shorthands 
1425         https://bugs.webkit.org/show_bug.cgi?id=164178 
1426  
1427         Reviewed by Zalan Bujtas. 
1428  
1429         * css/CSSPropertyNames.in: 
1430         Patch the transform-origin-x/y and perspective-origin-x/y properties 
1431         to use new converters that can handle keywords. 
1432  
1433         * css/StyleBuilderConverter.h: 
1434         (WebCore::StyleBuilderConverter::convertPositionComponentX): 
1435         (WebCore::StyleBuilderConverter::convertPositionComponentY): 
1436         Add the new converters. They just call convertPositionComponent method 
1437         that we already use for object-position and background-position. 
1438  
1439         * css/parser/CSSPropertyParser.cpp: 
1440         (WebCore::CSSPropertyParser::consumeTransformOrigin): 
1441         (WebCore::CSSPropertyParser::consumePerspectiveOrigin): 
1442         Changed to treat the properties as shorthands and add the longhand 
1443         properties once parsed. 
1444  
1445         (WebCore::CSSPropertyParser::parseSingleValue): 
1446         (WebCore::CSSPropertyParser::parseShorthand): 
1447         * css/parser/CSSPropertyParser.h: 
1448         Move the parsing into the shorthand method, since we're still treating 
1449         these properties as shorthands. 
1450  
1451 2016-10-29  Dave Hyatt  <hyatt@apple.com> 
1452  
1453         [CSS Parser] Support -webkit-background-composite 
1454         https://bugs.webkit.org/show_bug.cgi?id=164179 
1455  
1456         Reviewed by Zalan Bujtas. 
1457  
1458         * css/parser/CSSPropertyParser.cpp: 
1459         (WebCore::consumeBackgroundComponent): 
1460         (WebCore::CSSPropertyParser::parseSingleValue): 
1461  
1462 2016-10-29  Youenn Fablet  <youenn@apple.com> 
1463  
1464         REGRESSION (r207754): LayoutTest http/tests/security/svg-image-with-css-cross-domain.html is a flaky failure 
1465         https://bugs.webkit.org/show_bug.cgi?id=163922 
1466  
1467         Reviewed by Alex Christensen. 
1468  
1469         Test: http/tests/security/cached-svg-image-with-css-cross-domain.html 
1470  
1471         Raw data was not copied in cloned CachedCSSStyleSheet while it is used by some of its clients. 
1472         Updated CachedCSSStyleSheet and CachedImage cloning to copy its raw data. 
1473  
1474         * loader/cache/CachedCSSStyleSheet.cpp: 
1475         (WebCore::CachedCSSStyleSheet::setBodyDataFrom): 
1476         * loader/cache/CachedImage.cpp: 
1477         (WebCore::CachedImage::setBodyDataFrom): 
1478         * loader/cache/CachedResource.h: 
1479         (WebCore::CachedResource::mayTryReplaceEncodedData): 
1480  
1481 2016-10-29  Youenn Fablet  <youenn@apple.com> 
1482  
1483         REGRESSION (Safari 10 / r189445): WKWebView and WebView no longer allow async XMLHttpRequest timeout to exceed 60 seconds 
1484         https://bugs.webkit.org/show_bug.cgi?id=163814 
1485         <rdar://problem/28917420> 
1486  
1487         Reviewed by Darin Adler. 
1488  
1489         Tests: http/tests/xmlhttprequest/resetting-timeout-to-zero.html 
1490                http/tests/xmlhttprequest/timeout-greater-than-default-network-timeout.html 
1491  
1492         * xml/XMLHttpRequest.cpp: 
1493         (WebCore::XMLHttpRequest::setTimeout): If the XHR timeout is active, resetting the timeout to zero should lead to using the default network timeout. 
1494         Since it is difficult to update the timeout once the request is sent, we mimic the default network timeout with a 60 seconds XHR timeout. 
1495         (WebCore::XMLHttpRequest::createRequest): Setting network timeout to infinity if the XHR timeout is active. 
1496  
1497 2016-10-29  Youenn Fablet  <youenn@apple.com> 
1498  
1499         MediaEndpoint::generateDtlsInfo is not needed 
1500         https://bugs.webkit.org/show_bug.cgi?id=164130 
1501  
1502         Reviewed by Eric Carlson. 
1503  
1504         No change of behavior. 
1505  
1506         Removing MediaEndpoint::generateDtlsInfo as it can be called directly from createMediaEndpointOwr. 
1507  
1508         * Modules/mediastream/MediaEndpointPeerConnection.cpp: 
1509         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): 
1510         * platform/mediastream/MediaEndpoint.cpp: 
1511         * platform/mediastream/MediaEndpoint.h: 
1512         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: 
1513         (WebCore::createMediaEndpointOwr): 
1514         * platform/mediastream/openwebrtc/MediaEndpointOwr.h: 
1515         * platform/mock/MockMediaEndpoint.cpp: 
1516         (WebCore::MockMediaEndpoint::MockMediaEndpoint): 
1517         (WebCore::MockMediaEndpoint::generateDtlsInfo): Deleted. 
1518         * platform/mock/MockMediaEndpoint.h: 
1519  
1520 2016-10-28  Wenson Hsieh  <wenson_hsieh@apple.com> 
1521  
1522         Unreviewed, add Input Events to the features list. 
1523  
1524         * features.json: 
1525  
1526 2016-10-28  Darin Adler  <darin@apple.com> 
1527  
1528         Fix mismerge that broke a CEReactions test. 
1529  
1530         * html/HTMLOptionsCollection.idl: Add back CEReactions to the remove function. 
1531  
1532 2016-10-28  Darin Adler  <darin@apple.com> 
1533  
1534         Move all classes in the HTML directory from ExceptionCode to Exception 
1535         https://bugs.webkit.org/show_bug.cgi?id=163876 
1536  
1537         Reviewed by Sam Weinig. 
1538  
1539         * bindings/js/JSDOMBinding.cpp: 
1540         (WebCore::shouldAllowAccessToNode): Deleted. 
1541         (WebCore::BindingSecurity::shouldAllowAccessToFrame): Moved function into the 
1542         BindingSecurity namespace. Also changed arguments to references. 
1543         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow): Ditto. 
1544         (WebCore::BindingSecurity::shouldAllowAccessToNode): Changed argument type 
1545         from pointer to reference. 
1546  
1547         * bindings/js/JSDOMBinding.h: Removed top level shouldAllowAccessTo functions, 
1548         moving all of them into the BindingSecurity namespace. Changed BindingSecurity 
1549         from a class into a namespace. Added new checkSecurityForNode functions that 
1550         can be used directly to implement CheckSecurityForNode; they turn the node 
1551         into a null, which is no change in behavior from what bindings already did. 
1552  
1553         * bindings/js/JSDOMWindowCustom.cpp: 
1554         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Changed argument 
1555         type for passed-in string to const String& instead of String&. 
1556         (WebCore::JSDOMWindow::getOwnPropertySlot): Updated for BindingSecurity changes. 
1557         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): Ditto. 
1558         (WebCore::JSDOMWindow::put): Ditto. 
1559  
1560         * bindings/js/JSHTMLCanvasElementCustom.cpp: 
1561         (WebCore::attributesFor3DContext): Renamed from get3DContextAttributes and 
1562         changed to use a return value instead of an out argument. 
1563         (WebCore::JSHTMLCanvasElement::getContext): Updated for the above. 
1564         (WebCore::JSHTMLCanvasElement::toDataURL): Rewrote to handle ExceptionOr 
1565         and also to use Optional<double> instead of const double*. 
1566  
1567         * bindings/js/JSHTMLFrameElementCustom.cpp: 
1568         (WebCore::JSHTMLFrameElement::setLocation): Moved the logic from 
1569         allowSettingJavascriptURL in here and updated for BindingSecurity changes. 
1570  
1571         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: 
1572         (WebCore::JSHTMLOptionsCollection::setLength): Use propagateException. 
1573         Also streamlined the code a bit. 
1574         (WebCore::JSHTMLOptionsCollection::indexSetter): Updated for new name and 
1575         argument types for selectElementIndexSetter. 
1576  
1577         * bindings/js/JSHTMLSelectElementCustom.cpp: 
1578         (WebCore::selectElementIndexSetter): Updated name and argument types and 
1579         to use propagateException. 
1580         (WebCore::JSHTMLSelectElement::indexSetter): Updated for above. 
1581         * bindings/js/JSHTMLSelectElementCustom.h: Ditto. 
1582  
1583         * bindings/js/JSLocationCustom.cpp: 
1584         (WebCore::JSLocation::getOwnPropertySlotDelegate): Updated for changes to 
1585         BindingSecurity. 
1586         (WebCore::JSLocation::putDelegate): Ditto. Also rearranged logic a bit. 
1587  
1588         * bindings/js/ScriptController.cpp: 
1589         (WebCore::ScriptController::canAccessFromCurrentOrigin): Updated for 
1590         changes to BindingSecurity. 
1591  
1592         * bindings/scripts/CodeGeneratorJS.pm: 
1593         (GenerateImplementation): Removed old support for CheckSecurityForNode. 
1594         (NativeToJSValue): Added new support for CheckSecurityForNode, which uses 
1595         the new checkSecurityForNode function, and works properly with ExceptionOr. 
1596  
1597         * bindings/scripts/test/JS/JSTestObj.cpp: Updated for change below. 
1598  
1599         * dom/ChildNode.idl: Move the remove function to non-legacy exception. 
1600         Needed now because this needs to match the one in HTMLSelectElement. 
1601  
1602         * dom/Element.cpp: 
1603         (WebCore::Element::dispatchMouseForceWillBegin): Refactored a little bit. 
1604         (WebCore::Element::mergeWithNextTextNode): Support ExceptionOr for remove. 
1605         (WebCore::Element::setOuterHTML): Support ExceptionOr for 
1606         createFragmentForInnerOuterHTML. 
1607         (WebCore::Element::setInnerHTML): Ditto. 
1608         (WebCore::Element::insertAdjacentHTML): Ditto. 
1609  
1610         * dom/Node.cpp: 
1611         (WebCore::Node::remove): Use ExceptionOr. 
1612         (WebCore::Node::normalize): Remove use of IGNORE_EXCEPTION. 
1613         * dom/Node.h: Use ExceptionOr for remove. 
1614  
1615         * dom/Range.cpp: 
1616         (WebCore::Range::insertNode): Updated for change to remove. 
1617         (WebCore::Range::createContextualFragment): Updated for change 
1618         to WebCore::createContextualFragment. 
1619  
1620         * dom/ShadowRoot.cpp: 
1621         (WebCore::ShadowRoot::setInnerHTML): Use ExceptionOr for 
1622         createFragmentForInnerOuterHTML and replaceChildrenWithFragment. 
1623  
1624         * editing/AppendNodeCommand.cpp: 
1625         (WebCore::AppendNodeCommand::doUnapply): Remove IGNORE_EXCEPTION. 
1626         * editing/InsertNodeBeforeCommand.cpp: 
1627         (WebCore::InsertNodeBeforeCommand::doUnapply): Ditto. 
1628         * editing/MergeIdenticalElementsCommand.cpp: 
1629         (WebCore::MergeIdenticalElementsCommand::doApply): Ditto. 
1630         * editing/RemoveNodeCommand.cpp: 
1631         (WebCore::RemoveNodeCommand::doApply): Ditto. 
1632         * editing/SplitElementCommand.cpp: 
1633         (WebCore::SplitElementCommand::doUnapply): Ditto. 
1634         * editing/SplitTextNodeCommand.cpp: 
1635         (WebCore::SplitTextNodeCommand::doUnapply): Ditto. 
1636         * editing/WrapContentsInDummySpanCommand.cpp: 
1637         (WebCore::WrapContentsInDummySpanCommand::doUnapply): Ditto. 
1638  
1639         * editing/Editor.cpp: 
1640         (WebCore::Editor::insertDictationPhrases): Deleted. Moved this 
1641         iOS-specific function to EditorIOS.mm. 
1642         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto. 
1643         (WebCore::Editor::confirmMarkedText): Ditto. 
1644         (WebCore::Editor::setTextAsChildOfElement): Ditto. 
1645         (WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): Ditto. 
1646  
1647         * editing/ios/EditorIOS.mm: 
1648         (WebCore::Editor::fontForSelection): Remove ASSERT_NO_EXCEPTION. 
1649         (WebCore::Editor::fontAttributesForSelectionStart): Ditto. 
1650         (WebCore::Editor::insertDictationPhrases): Moved here from Editor.cpp. 
1651         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto. Also 
1652         updated code that used remove to not pass an ExceptionCode. 
1653         (WebCore::Editor::confirmMarkedText): Ditto. 
1654         (WebCore::Editor::setTextAsChildOfElement): Ditto. 
1655         (WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): Ditto. 
1656  
1657         * editing/mac/EditorMac.mm: 
1658         (WebCore::Editor::fontForSelection): Remove ASSERT_NO_EXCEPTION. 
1659         (WebCore::Editor::fontAttributesForSelectionStart): Ditto. 
1660  
1661         * editing/markup.cpp: 
1662         (WebCore::createFragmentForInnerOuterHTML): Use ExceptionOr. 
1663         (WebCore::createContextualFragment): Ditto. 
1664         (WebCore::replaceChildrenWithFragment): Ditto. 
1665         (WebCore::replaceChildrenWithText): Ditto. 
1666         * editing/markup.h: Updated for above changes. 
1667  
1668         * html/BaseChooserOnlyDateAndTimeInputType.cpp: 
1669         (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance): 
1670         Removed ASSERT_NO_EXCEPTION. 
1671  
1672         * html/BaseDateAndTimeInputType.cpp: 
1673         (WebCore::BaseDateAndTimeInputType::setValueAsDate): Use ExceptionOr. 
1674         (WebCore::BaseDateAndTimeInputType::setValueAsDecimal): Ditto. 
1675         * html/BaseDateAndTimeInputType.h: Updated for above changes. 
1676  
1677         * html/DateTimeLocalInputType.cpp: 
1678         (WebCore::DateTimeLocalInputType::setValueAsDate): Use ExceptionOr. 
1679         * html/DateTimeLocalInputType.h: Updated for above changes. 
1680  
1681         * html/DOMTokenList.cpp: 
1682         (WebCore::DOMTokenList::validateToken): Use ExceptionOr. 
1683         (WebCore::DOMTokenList::validateTokens): Ditto. 
1684         (WebCore::DOMTokenList::addInternal): Ditto. 
1685         (WebCore::DOMTokenList::add): Ditto. 
1686         (WebCore::DOMTokenList::removeInternal): Ditto. 
1687         (WebCore::DOMTokenList::remove): Ditto. 
1688         (WebCore::DOMTokenList::toggle): Ditto. 
1689         (WebCore::DOMTokenList::replace): Ditto. 
1690         (WebCore::DOMTokenList::supports): Ditto. 
1691         * html/DOMTokenList.h: Updated for above changes. 
1692         * html/DOMTokenList.idl: Use non-legacy exceptions. 
1693  
1694         * html/DOMURL.cpp: 
1695         (WebCore::DOMURL::DOMURL): Just take the two URL objects and let 
1696         the create functions do all the processing. 
1697         (WebCore::DOMURL::create): Use ExceptionOr, and move the processing 
1698         of the URLs here out of the constructors. 
1699         (WebCore::DOMURL::setHref): Use ExceptionOr. 
1700         * html/DOMURL.h: Updated for above changes. 
1701         * html/DOMURL.idl: Use non-legacy exceptions. 
1702  
1703         * html/FTPDirectoryDocument.cpp: 
1704         (WebCore::FTPDirectoryDocumentParser::appendEntry): Remove 
1705         IGNORE_EXCEPTION and use releaseReturnValue(). 
1706  
1707         * html/HTMLCanvasElement.cpp: 
1708         (WebCore::HTMLCanvasElement::toDataURL): Use ExceptionOr. 
1709         * html/HTMLCanvasElement.h: Updated for above changes. 
1710         * html/HTMLCanvasElement.idl: Use non-legacy exception. 
1711  
1712         * html/HTMLElement.cpp: 
1713         (WebCore::HTMLElement::textToFragment): Use ExceptionOr. 
1714         (WebCore::HTMLElement::setInnerText): Ditto. 
1715         (WebCore::HTMLElement::setOuterText): Ditto. 
1716         (WebCore::HTMLElement::setContentEditable): Ditto. 
1717         (WebCore::HTMLElement::translateAttributeMode): Deleted. 
1718         (WebCore::HTMLElement::translate): Moved the logic from the 
1719         translateAttributeMode function in here. 
1720         * html/HTMLElement.h: Updated for above changes. 
1721         * html/HTMLElement.idl: Use non-legacy exceptions. 
1722  
1723         * html/HTMLEmbedElement.idl: Use non-legacy exception. 
1724         * html/HTMLFrameElement.idl: Ditto. 
1725  
1726         * html/HTMLFrameOwnerElement.cpp: 
1727         (WebCore::HTMLFrameOwnerElement::getSVGDocument): Use ExceptionOr. 
1728         * html/HTMLFrameOwnerElement.h: Updated for above. 
1729  
1730         * html/HTMLIFrameElement.idl: Use non-legacy exception. 
1731  
1732         * html/HTMLInputElement.cpp: 
1733         (WebCore::HTMLInputElement::stepUp): Use ExceptionOr. 
1734         (WebCore::HTMLInputElement::stepDown): Ditto. 
1735         (WebCore::HTMLInputElement::setValue): Ditto. 
1736         (WebCore::HTMLInputElement::setValueAsDate): Ditto. 
1737         (WebCore::HTMLInputElement::setValueAsNumber): Ditto. 
1738         (WebCore::HTMLInputElement::setSize): Ditto. 
1739         (WebCore::HTMLInputElement::maxLengthAttributeChanged): Use the 
1740         new internalSetMaxLength function; old code relied on a setMaxLength 
1741         that was different from the one exposed to bindings. 
1742         (WebCore::HTMLInputElement::minLengthAttributeChanged): Ditto. 
1743         (WebCore::HTMLInputElement::setRangeText): Use ExceptionOr. 
1744         * html/HTMLInputElement.h: Updated for above changes. Also use 
1745         data member initialization for InputElementClickState instead of 
1746         a constructor. 
1747         * html/HTMLInputElement.idl: Use non-legacy exception. 
1748  
1749         * html/HTMLMarqueeElement.cpp: 
1750         (WebCore::HTMLMarqueeElement::setLoop): Use ExceptionOr. 
1751         (WebCore::HTMLMarqueeElement::renderMarquee): Tweaked. 
1752         * html/HTMLMarqueeElement.h: Updated for above changes. 
1753         * html/HTMLMarqueeElement.idl: Ditto. 
1754  
1755         * html/HTMLMediaElement.cpp: 
1756         (WebCore::HTMLMediaElement::TrackGroup::TrackGroup): 
1757         Initialize most data members in class definition rather than 
1758         the constructor. 
1759         (WebCore::HTMLMediaElement::HTMLMediaElement): Ditto. 
1760         (WebCore::HTMLMediaElement::~HTMLMediaElement): Updated since 
1761         removeMediaElement now takes a reference. 
1762         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Use 
1763         a modern for loop to streamline code. 
1764         (WebCore::HTMLMediaElement::textTrackModeChanged): Updated since 
1765         track now returns a reference. 
1766         (WebCore::HTMLMediaElement::setCurrentTimeForBindings): Renamed 
1767         to prevent ambiguity with the other version that has slightly 
1768         different semantics and overloading and changed to use ExceptionOr. 
1769         (WebCore::HTMLMediaElement::playInternal): Updated to use reference. 
1770         (WebCore::HTMLMediaElement::setVolume): Use ExceptionOr. 
1771         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Take a 
1772         reference instead of a PassRefPtr. 
1773         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto. 
1774         (WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Ditto. 
1775         (WebCore::HTMLMediaElement::mediaPlayerDidRemoveAudioTrack): Ditto. 
1776         (WebCore::HTMLMediaElement::mediaPlayerDidRemoveTextTrack): Ditto. 
1777         (WebCore::HTMLMediaElement::mediaPlayerDidRemoveVideoTrack): Ditto. 
1778         (WebCore::HTMLMediaElement::addTextTrack): Use ExceptionOr. 
1779         (WebCore::HTMLMediaElement::didAddTextTrack): Use a reference. 
1780         (WebCore::HTMLMediaElement::didRemoveTextTrack): Ditto. 
1781         (WebCore::HTMLMediaElement::maxBufferedTime): Update to use different 
1782         interface to time ranges that does not need to deal with exceptions. 
1783         (WebCore::HTMLMediaElement::setController): Pass references. 
1784         (WebCore::HTMLMediaElement::outOfBandTrackSources): Use reference. 
1785         * html/HTMLMediaElement.h: Updated for above. 
1786         * html/HTMLMediaElement.idl: Use non-legacy exceptions. 
1787
1788         * html/HTMLObjectElement.idl: Use non-legacy exception. 
1789      
1790         * html/HTMLOptionElement.cpp: 
1791         (WebCore::HTMLOptionElement::createForJSConstructor): Use ExceptionOr. 
1792         * html/HTMLOptionElement.h: Updated for above change. 
1793         * html/HTMLOptionElement.idl: Use non-legacy exception. 
1794
1795         * html/HTMLOptionsCollection.cpp: 
1796         (WebCore::HTMLOptionsCollection::setLength): Use ExceptionOr. 
1797         * html/HTMLOptionsCollection.h: Updated for above change. 
1798         * html/HTMLOptionsCollection.idl: Use non-legacy exception. 
1799  
1800         * html/HTMLProgressElement.cpp: 
1801         (WebCore::HTMLProgressElement::setValue): Removed non-finite handling 
1802         because that is now handled by the bindings. 
1803         (WebCore::HTMLProgressElement::setMax): Ditto. 
1804         * html/HTMLProgressElement.h: Updated for above. 
1805         * html/HTMLProgressElement.idl: Changed attributes to be double instead 
1806         of unrestricted double, and this was able to remove exceptions. 
1807  
1808         * html/HTMLSelectElement.cpp: 
1809         (WebCore::HTMLSelectElement::removeByIndex): Drop IGNORE_EXCEPTION. 
1810         (WebCore::HTMLSelectElement::remove): Use ExceptionOr. 
1811         (WebCore::HTMLSelectElement::setOption): Ditto. 
1812         (WebCore::HTMLSelectElement::setLength): Ditto. 
1813         * html/HTMLSelectElement.h: Updated for above changes. 
1814         * html/HTMLSelectElement.idl: Use non-legacy exceptions. 
1815  
1816         * html/HTMLTableElement.cpp: 
1817         (WebCore::HTMLTableElement::setCaption): Use ExceptionOr. 
1818         (WebCore::HTMLTableElement::setTHead): Ditto. 
1819         (WebCore::HTMLTableElement::setTFoot): Ditto. 
1820         (WebCore::HTMLTableElement::createTHead): Streamline a bit. 
1821         (WebCore::HTMLTableElement::deleteTHead): Ditto. 
1822         (WebCore::HTMLTableElement::createTFoot): Ditto. 
1823         (WebCore::HTMLTableElement::deleteTFoot): Ditto. 
1824         (WebCore::HTMLTableElement::createTBody): Ditto. 
1825         (WebCore::HTMLTableElement::createCaption): Ditto. 
1826         (WebCore::HTMLTableElement::insertRow): Use ExceptionOr. 
1827         (WebCore::HTMLTableElement::deleteRow): Ditto. 
1828         * html/HTMLTableElement.h: Updated for above changes. 
1829         * html/HTMLTableElement.idl: Use non-legacy exceptions. 
1830  
1831         * html/HTMLTableRowElement.cpp: 
1832         (WebCore::findTable): Added. 
1833         (WebCore::HTMLTableRowElement::rowIndex): Streamline a bit using the 
1834         findTable function above. 
1835         (WebCore::findRows): Added. 
1836         (WebCore::HTMLTableRowElement::sectionRowIndex): Streamline a bit using 
1837         the findRows function above. 
1838         (WebCore::HTMLTableRowElement::insertCell): Use ExceptionOr. 
1839         (WebCore::HTMLTableRowElement::deleteCell): Ditto. 
1840         (WebCore::HTMLTableRowElement::setCells): Deleted. 
1841         * html/HTMLTableRowElement.h: Updated for the above. The setCells function 
1842         was dead code. 
1843         * html/HTMLTableRowElement.idl: Use non-legacy exceptions. 
1844  
1845         * html/HTMLTableSectionElement.cpp: 
1846         (WebCore::HTMLTableSectionElement::additionalPresentationAttributeStyle): 
1847         Tweaked a bit to use early return. 
1848         (WebCore::HTMLTableSectionElement::insertRow): Use ExceptionOr. 
1849         (WebCore::HTMLTableSectionElement::deleteRow): Ditto. 
1850         (WebCore::HTMLTableSectionElement::numRows): Use childrenOfType. 
1851         (WebCore::HTMLTableSectionElement::align): Deleted. 
1852         (WebCore::HTMLTableSectionElement::setAlign): Deleted. 
1853         (WebCore::HTMLTableSectionElement::ch): Deleted. 
1854         (WebCore::HTMLTableSectionElement::setCh): Deleted. 
1855         (WebCore::HTMLTableSectionElement::chOff): Deleted. 
1856         (WebCore::HTMLTableSectionElement::setChOff): Deleted. 
1857         (WebCore::HTMLTableSectionElement::vAlign): Deleted. 
1858         (WebCore::HTMLTableSectionElement::setVAlign): Deleted. 
1859         * html/HTMLTableSectionElement.h: Updated for the above. 
1860         * html/HTMLTableSectionElement.idl: Use non-legacy exception. 
1861  
1862         * html/HTMLTextAreaElement.cpp: 
1863         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged): Use the new 
1864         internalSetMaxLength function; old code relied on a setMaxLength 
1865         that was different from the one exposed to bindings. 
1866         (WebCore::HTMLTextAreaElement::minLengthAttributeChanged): Ditto. 
1867         (WebCore::HTMLTextAreaElement::updatePlaceholderText): Removed 
1868         ASSERT_NO_EXCEPTION. 
1869         * html/HTMLTextAreaElement.idl: Use non-legacy exceptions. 
1870  
1871         * html/HTMLTextFormControlElement.cpp: 
1872         (WebCore::HTMLTextFormControlElement::setRangeText): Use ExceptionOr. 
1873         (WebCore::HTMLTextFormControlElement::setInnerTextValue): Ditto. 
1874         (WebCore::HTMLTextFormControlElement::setMaxLength): Ditto. 
1875         (WebCore::HTMLTextFormControlElement::setMinLength): Ditto. 
1876         * html/HTMLTextFormControlElement.h: Updated for above changes. 
1877         Also renamed the setMin/MaxLength function overloads for internal use 
1878         to internSetMin/MaxLength and made them protected. 
1879  
1880         * html/HTMLTrackElement.cpp: 
1881         (WebCore::HTMLTrackElement::~HTMLTrackElement): Call clearElement on the 
1882         track to break the connection. Before this was done as a side effect of 
1883         clearClient, but that is called in other cases where we do not want to 
1884         clear the link back to the track element. 
1885         (WebCore::HTMLTrackElement::insertedInto): Removed code that uses the 
1886         track function for its side effect of creating a track; no longer needed. 
1887         Rewrote this so it's more symmetric with removedFrom. 
1888         (WebCore::HTMLTrackElement::removedFrom): Pass reference. Also reordered 
1889         and removed an unnecessary check for null parent. 
1890         (WebCore::HTMLTrackElement::parseAttribute): Use track. 
1891         (WebCore::HTMLTrackElement::kind): Ditto. 
1892         (WebCore::HTMLTrackElement::track): Renamed ensureTrack to this. Also 
1893         removed the redundant code to call setTrackElement; we no longer change 
1894         the track element on a track until the track element is destroyed. 
1895         (WebCore::HTMLTrackElement::scheduleLoad): Use track. 
1896         (WebCore::HTMLTrackElement::loadTimerFired): Ditto. 
1897         (WebCore::HTMLTrackElement::setReadyState): Ditto. 
1898         (WebCore::HTMLTrackElement::readyState): Ditto. 
1899         (WebCore::HTMLTrackElement::mediaElement): Rearranged to use early return. 
1900         * html/HTMLTrackElement.h: Updated for above changes. 
1901  
1902         * html/HTMLVideoElement.cpp: 
1903         (WebCore::HTMLVideoElement::webkitEnterFullscreen): Use ExceptionOr. 
1904         * html/HTMLVideoElement.h: Removed the functions used just for 
1905         capitalization reasons; that's now handled in the bindings. 
1906         * html/HTMLVideoElement.idl: Use non-legacy bindings and ImplementedAs. 
1907  
1908         * html/ImageData.cpp: 
1909         (WebCore::ImageData::create): Return ExceptionOr. 
1910         * html/ImageData.h: Updated for above changes. 
1911         * html/ImageData.idl: Use non-legacy exceptions. 
1912  
1913         * html/InputType.cpp: 
1914         (WebCore::InputType::setValueAsDate): Use ExceptionOr. 
1915         (WebCore::InputType::setValueAsDouble): Ditto. 
1916         (WebCore::InputType::setValueAsDecimal): Ditto. 
1917         (WebCore::InputType::applyStep): Ditto. 
1918         (WebCore::InputType::stepUp): Ditto. 
1919         (WebCore::InputType::stepUpFromRenderer): Removed IGNORE_EXCEPTION. 
1920         * html/InputType.h: Updated for the above. 
1921  
1922         * html/MediaController.cpp: 
1923         (MediaController::addMediaElement): Take a reference instead of a pointer. 
1924         (MediaController::removeMediaElement): Ditto. 
1925         (MediaController::containsMediaElement): Ditto. 
1926         (MediaController::setVolume): Use ExceptionOr. 
1927         (MediaController::bringElementUpToSpeed): Take a reference. 
1928         * html/MediaController.h: Updated for above changes. Also made lots of 
1929         function overrides private. 
1930         * html/MediaController.idl: Use non-legacy exception. 
1931  
1932         * html/MediaControllerInterface.h: Use ExceptionOr for setVolume. 
1933  
1934         * html/NumberInputType.cpp: 
1935         (WebCore::RealNumberRenderSize::max): Use aggregate initialization instead 
1936         of a constructor. 
1937         (WebCore::calculateRenderSize): Ditto. 
1938         (WebCore::NumberInputType::setValueAsDouble): Use ExceptionOr. 
1939         (WebCore::NumberInputType::setValueAsDecimal): Ditto. 
1940         * html/NumberInputType.h: Updated for above changes. 
1941  
1942         * html/RangeInputType.cpp: 
1943         (WebCore::RangeInputType::RangeInputType): Initialize scalar data member 
1944         in class definition instead of here. 
1945         (WebCore::RangeInputType::setValueAsDecimal): Use ExceptionOr. 
1946         (WebCore::RangeInputType::handleKeydownEvent): Removed IGNORE_EXCEPTION. 
1947         * html/RangeInputType.h: Updated for above changes. 
1948  
1949         * html/TextFieldInputType.cpp: 
1950         (WebCore::TextFieldInputType::updatePlaceholderText): Removed 
1951         ASSERT_NO_EXCEPTION. 
1952  
1953         * html/TimeRanges.cpp: 
1954         (WebCore::TimeRanges::start): Use ExceptionOr. 
1955         (WebCore::TimeRanges::end): Ditto. 
1956         * html/TimeRanges.h: Updated for the above. 
1957         * html/TimeRanges.idl: Use non-legacy exceptions. 
1958  
1959         * html/URLUtils.idl: Use non-legacy exception. 
1960  
1961         * html/ValidationMessage.cpp: 
1962         (WebCore::ValidationMessage::setMessageDOMAndStartTimer): Removed 
1963         ASSERT_NO_EXCEPTION, IGNORE_EXCEPTION, and other exception-ignoring idioms. 
1964         * html/parser/HTMLTreeBuilder.cpp: 
1965         (WebCore::HTMLTreeBuilder::processStartTagForInBody): Ditto. 
1966         * html/shadow/MediaControlElementTypes.cpp: 
1967         (WebCore::MediaControlVolumeSliderElement::defaultEventHandler): Ditto. 
1968         * html/shadow/MediaControlElements.cpp: 
1969         (WebCore::MediaControlPanelElement::setPosition): Ditto. 
1970         (WebCore::MediaControlPanelElement::resetPosition): Ditto. 
1971         (WebCore::MediaControlStatusDisplayElement::update): Ditto. 
1972         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Ditto. 
1973         (WebCore::MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler): Ditto. 
1974         (WebCore::MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler): Ditto. 
1975         * html/shadow/MediaControls.cpp: 
1976         (WebCore::MediaControls::updateCurrentTimeDisplay): Ditto. 
1977         * html/shadow/MediaControlsApple.cpp: 
1978         (WebCore::MediaControlsApple::updateCurrentTimeDisplay): Ditto. 
1979  
1980         * html/track/LoadableTextTrack.cpp: 
1981         (WebCore::LoadableTextTrack::LoadableTextTrack): Take reference. 
1982         (WebCore::LoadableTextTrack::~LoadableTextTrack): Deleted. 
1983         (WebCore::LoadableTextTrack::clearClient): Deleted override. We no longer 
1984         want to clear m_trackElement when clearing the client. 
1985         (WebCore::LoadableTextTrack::setTrackElement): Deleted. 
1986         (WebCore::LoadableTextTrack::id): Changed to use 
1987         attributeWithoutSynchronization for better performance and idAttr instead 
1988         of a string constant. 
1989         * html/track/LoadableTextTrack.h: Updated for above changes. Added a new 
1990         clearElement function. Made the element and isDefault functions private. 
1991  
1992         * html/track/VTTCue.cpp: 
1993         (WebCore::VTTCue::~VTTCue): Removed ASSERT_NO_EXCEPTION, IGNORE_EXCEPTION, 
1994         and other exception-ignoring idioms. 
1995         (WebCore::VTTCue::removeDisplayTree): Ditto. 
1996         * html/track/VTTRegion.cpp: 
1997         (WebCore::VTTRegion::displayLastTextTrackCueBox): Ditto. 
1998         (WebCore::VTTRegion::willRemoveTextTrackCueBox): Ditto. 
1999  
2000         * inspector/InspectorDOMAgent.cpp: 
2001         (WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend): 
2002         Rewrote to avoid multiplehash table lookups and added a FIXME about 
2003         the peculiar code here. 
2004         (WebCore::InspectorDOMAgent::resolveNode): Streamlined. 
2005         (WebCore::InspectorDOMAgent::nodeAsScriptValue): Use the new 
2006         checkSecurityForNode instead of the old shouldAllowAccessToNode. 
2007  
2008         * platform/graphics/ImageBuffer.h: Take Optional<double> instead of 
2009         const double* in toDataURL. Renamed ImageDataToDataURL to just dataURL. 
2010  
2011         * platform/graphics/MediaPlayer.cpp: 
2012         (WebCore::MediaPlayer::addAudioTrack): Take a reference instead of PassRefPtr. 
2013         (WebCore::MediaPlayer::removeAudioTrack): Ditto. 
2014         (WebCore::MediaPlayer::addTextTrack): Ditto. 
2015         (WebCore::MediaPlayer::removeTextTrack): Ditto. 
2016         (WebCore::MediaPlayer::addVideoTrack): Ditto. 
2017         (WebCore::MediaPlayer::removeVideoTrack): Ditto. 
2018         * platform/graphics/MediaPlayer.h: Updated for the above. 
2019  
2020         * platform/graphics/PlatformTimeRanges.h: Exported a couple of functions 
2021         that are now used in WebKit. 
2022  
2023         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: 
2024         (WebCore::MediaPlayerPrivateAVFoundation::clearTextTracks): Use a modern for loop. 
2025         (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks): 
2026         Fixed a bug that would cause this function to fail to process half the tracks. 
2027         Also updated for the change from PassRefPtr to references. 
2028  
2029         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 
2030         (WebCore::determineChangedTracksFromNewTracksAndOldItems): Pass references. 
2031         (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider): Ditto. 
2032         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): Ditto. 
2033         (WebCore::assetMetadataKeyNames): Tweaked formatting. 
2034         (WebCore::itemKVOProperties): Ditto. 
2035         (WebCore::playerKVOProperties): Ditto. 
2036  
2037         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: 
2038         (WebCore::updateTracksOfType): Pass references. 
2039  
2040         * platform/graphics/cairo/ImageBufferCairo.cpp: 
2041         (WebCore::ImageBuffer::toDataURL): Use Optional<double> 
2042  
2043         * platform/graphics/cg/ImageBufferCG.cpp: 
2044         (WebCore::createBitmapImageAfterScalingIfNeeded): Use auto. 
2045         (WebCore::encodeImage): Ditto. Also renamed from CGImageEncodeToData. 
2046         (WebCore::dataURL): Ditto. Also renamed from CGImageToDataURL and from 
2047         ImageDataToDataURL. 
2048         (WebCore::ImageBuffer::toDataURL): Ditto. 
2049  
2050         * platform/graphics/efl/ImageBufferEfl.cpp: 
2051         (WebCore::encodeImageJPEG): Use Optional<double> 
2052         (WebCore::ImageBuffer::toDataURL): Ditto. 
2053  
2054         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 
2055         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Pass 
2056         a reference instead of pointer. 
2057         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto. 
2058         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Ditto. 
2059         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): Ditto. 
2060         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContents): Ditto. 
2061  
2062         * platform/graphics/gtk/ImageBufferGtk.cpp: 
2063         (WebCore::encodeImage): Use Optional<double> 
2064         (WebCore::ImageBuffer::toDataURL): Ditto. 
2065  
2066 2016-10-28  Dave Hyatt  <hyatt@apple.com> 
2067  
2068         [CSS Parser] Allow @font-face src descriptor's format function to contain identifiers 
2069         https://bugs.webkit.org/show_bug.cgi?id=164169 
2070  
2071         Reviewed by Simon Fraser. 
2072  
2073         * css/parser/CSSPropertyParser.cpp: 
2074         (WebCore::consumeFontFaceSrcURI): 
2075  
2076 2016-10-28  Jer Noble  <jer.noble@apple.com> 
2077  
2078         WebAudio does not resume when moving from background to foreground tab. 
2079         https://bugs.webkit.org/show_bug.cgi?id=164043 
2080  
2081         Reviewed by Darin Adler. 
2082  
2083         Test: webaudio/page-canstartmedia.html 
2084  
2085         * Modules/webaudio/AudioContext.cpp: 
2086         (WebCore::AudioContext::mediaCanStart): 
2087  
2088 2016-10-28  Wenson Hsieh  <wenson_hsieh@apple.com> 
2089  
2090         iOS autocorrection does not trigger an input event of inputType "insertReplacementText" 
2091         https://bugs.webkit.org/show_bug.cgi?id=164077 
2092         <rdar://problem/28987810> 
2093  
2094         Reviewed by Simon Fraser. 
2095  
2096         Fixes candidate insertion on iOS, so that it fires input events of type "insertReplacementText" and adds two 
2097         iOS unit tests covering this change as well as the test infrastructure needed to support these tests. See 
2098         comments below for more details. 
2099  
2100         Tests: fast/events/ios/before-input-events-prevent-candidate-insertion.html 
2101                fast/events/ios/input-events-insert-replacement-text.html 
2102  
2103         * dom/TextEvent.h: 
2104  
2105         Adds isAutocompletion() to TextEvent, as well as the TextEventInputAutocompletion text input type. When the 
2106         Editor handles this TextEvent, it will use this information when creating or modifying the corresponding typing 
2107         command. 
2108  
2109         * dom/TextEventInputType.h: 
2110         * editing/Editor.cpp: 
2111         (WebCore::Editor::insertText): 
2112         (WebCore::Editor::insertTextWithoutSendingTextEvent): 
2113         * editing/Editor.h: 
2114         * editing/TypingCommand.cpp: 
2115         (WebCore::editActionForTypingCommand): 
2116  
2117         Now takes whether the command is autocorrection into account. If so, the corresponding edit action should be 
2118         EditActionInsertReplacement rather than EditActionTypingInsertText. 
2119  
2120         (WebCore::TypingCommand::TypingCommand): 
2121         (WebCore::TypingCommand::deleteSelection): 
2122         (WebCore::TypingCommand::deleteKeyPressed): 
2123         (WebCore::TypingCommand::forwardDeleteKeyPressed): 
2124         (WebCore::TypingCommand::insertText): 
2125         (WebCore::TypingCommand::insertLineBreak): 
2126         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent): 
2127         (WebCore::TypingCommand::insertParagraphSeparator): 
2128         (WebCore::TypingCommand::inputEventData): 
2129         (WebCore::TypingCommand::willAddTypingToOpenCommand): 
2130         * editing/TypingCommand.h: 
2131  
2132         Adds a new TypingCommand option, IsAutocompletion. 
2133  
2134 2016-10-28  Commit Queue  <commit-queue@webkit.org> 
2135  
2136         Unreviewed, rolling out r207700. 
2137         https://bugs.webkit.org/show_bug.cgi?id=164168 
2138  
2139         We are ready after r208086 (Requested by alexchristensen on 
2140         #webkit). 
2141  
2142         Reverted changeset: 
2143  
2144         "Unreviewed, rolling out r207582." 
2145         https://bugs.webkit.org/show_bug.cgi?id=163819 
2146         http://trac.webkit.org/changeset/207700 
2147  
2148 2016-10-28  Dave Hyatt  <hyatt@apple.com> 
2149  
2150         [CSS Parser] Allow unknown properties in will-change 
2151         https://bugs.webkit.org/show_bug.cgi?id=164165 
2152  
2153         Reviewed by Simon Fraser. 
2154  
2155         * css/parser/CSSPropertyParser.cpp: 
2156         (WebCore::consumeWillChange): 
2157  
2158 2016-10-28  Alex Christensen  <achristensen@webkit.org> 
2159  
2160         Partially revert 207805 after resolution in URL spec issue 87 
2161         https://bugs.webkit.org/show_bug.cgi?id=164142 
2162  
2163         Reviewed by Andy Estes. 
2164  
2165         Covered by updated layout tests and API tests. 
2166  
2167         * platform/URLParser.cpp: 
2168         (WebCore::URLParser::isSingleDotPathSegment): 
2169         (WebCore::URLParser::isDoubleDotPathSegment): 
2170         (WebCore::URLParser::consumeSingleDotPathSegment): 
2171         (WebCore::URLParser::consumeDoubleDotPathSegment): 
2172         Treat %2e%2e as .. and %2e as . but only if it is entirety of the path segment. 
2173         There are tests for URLs like http://host/abc%2edef which have not changed because 
2174         the %2e is not the entirety of the path segment. 
2175  
2176 2016-10-28  Alex Christensen  <achristensen@webkit.org> 
2177  
2178         URLParser should not try to interpret host of URLs with unrecognized schemes as IPv4 address 
2179         https://bugs.webkit.org/show_bug.cgi?id=164154 
2180  
2181         Reviewed by Andy Estes. 
2182  
2183         This is needed to match behavior of all browsers. 
2184         This is being discussed in the spec at https://github.com/whatwg/url/issues/148 
2185  
2186         Covered by new API tests. 
2187  
2188         * platform/URLParser.cpp: 
2189         (WebCore::URLParser::parseHostAndPort): 
2190         Only try to parse and canonicalize the host as an IPv4 address if the scheme is special (http, wss, etc.) 
2191  
2192 2016-10-28  Chris Dumez  <cdumez@apple.com> 
2193  
2194         DOMStringMap reports properties as non-enumerable 
2195         https://bugs.webkit.org/show_bug.cgi?id=164114 
2196  
2197         Reviewed by Sam Weinig. 
2198  
2199         DOMStringMap's named properties should be configurable, enumerable 
2200         and writable as per: 
2201         - https://heycam.github.io/webidl/#getownproperty-guts (2.7-9) 
2202         - https://html.spec.whatwg.org/multipage/dom.html#domstringmap 
2203  
2204         Firefox and Chrome agree with the specification. However, WebKit 
2205         was doing the complete opposite. 
2206  
2207         No new tests, updated existing test. 
2208  
2209         * bindings/js/JSDOMStringMapCustom.cpp: 
2210         (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate): 
2211  
2212 2016-10-28  Ryosuke Niwa  <rniwa@webkit.org> 
2213  
2214         Add CEReactions to the remaining HTML DOM APIs 
2215         https://bugs.webkit.org/show_bug.cgi?id=163969 
2216  
2217         Reviewed by Chris Dumez. 
2218  
2219         Added CEReactions to the remaining DOM and HTML APIs as needed. 
2220  
2221         Tests: fast/custom-elements/reactions-for-indieui.html 
2222                fast/custom-elements/reactions/Document.html 
2223                fast/custom-elements/reactions/HTMLAnchorElement.html 
2224                fast/custom-elements/reactions/HTMLOptionElement.html 
2225                fast/custom-elements/reactions/HTMLOptionsCollection.html 
2226                fast/custom-elements/reactions/HTMLOutputElement.html 
2227                fast/custom-elements/reactions/HTMLSelectElement.html 
2228                fast/custom-elements/reactions/HTMLTableElement.html 
2229                fast/custom-elements/reactions/HTMLTableRowElement.html 
2230                fast/custom-elements/reactions/HTMLTableSectionElement.html 
2231                fast/custom-elements/reactions/HTMLTitleElement.html 
2232                fast/custom-elements/reactions/ShadowRoot.html 
2233  
2234         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: 
2235         (WebCore::JSHTMLOptionsCollection::setLength): 
2236         (WebCore::JSHTMLOptionsCollection::indexSetter): 
2237         * bindings/js/JSHTMLSelectElementCustom.cpp: 
2238         (WebCore::JSHTMLSelectElement::indexSetter): 
2239         * dom/CharacterData.idl: 
2240         * dom/Document.idl: 
2241         * dom/Element.idl: 
2242         * dom/ShadowRoot.idl: 
2243         * html/HTMLAnchorElement.idl: 
2244         * html/HTMLDocument.idl: 
2245         * html/HTMLOptionElement.idl: 
2246         * html/HTMLOptionsCollection.idl: 
2247         * html/HTMLOutputElement.idl: 
2248         * html/HTMLSelectElement.idl: 
2249         * html/HTMLTableElement.idl: 
2250         * html/HTMLTableRowElement.idl: 
2251         * html/HTMLTableSectionElement.idl: 
2252         * html/HTMLTitleElement.idl: 
2253  
2254 2016-10-28  Antoine Quint  <graouts@apple.com> 
2255  
2256         [Modern Media Controls] Media Controller: volume control support 
2257         https://bugs.webkit.org/show_bug.cgi?id=163727 
2258  
2259         Reviewed by Dean Jackson. 
2260  
2261         We introduce the VolumeSupport class which brings support for modifying the media 
2262         volume by interacting with the mute volume slider in the media controls and correctly 
2263         reflecting the media's volume should it be changed via the media API. 
2264  
2265         Tests: media/modern-media-controls/volume-support/volume-support-click.html 
2266                media/modern-media-controls/volume-support/volume-support-drag.html 
2267                media/modern-media-controls/volume-support/volume-support-media-api-mute.html 
2268                media/modern-media-controls/volume-support/volume-support-media-api.html 
2269  
2270         * Modules/modern-media-controls/js-files: 
2271         * Modules/modern-media-controls/media/media-controller.js: 
2272         (MediaController): 
2273         * Modules/modern-media-controls/media/volume-support.js: Added. 
2274         (VolumeSupport.prototype.get control): 
2275         (VolumeSupport.prototype.get mediaEvents): 
2276         (VolumeSupport.prototype.controlValueWillStartChanging): 
2277         (VolumeSupport.prototype.controlValueDidChange): 
2278         (VolumeSupport.prototype.syncControl): 
2279         (VolumeSupport): 
2280         * WebCore.xcodeproj/project.pbxproj: 
2281  
2282 2016-10-28  Yusuke Suzuki  <utatane.tea@gmail.com> 
2283  
2284         [DOMJIT] Rename CallDOM to CallDOMGetter 
2285         https://bugs.webkit.org/show_bug.cgi?id=164157 
2286  
2287         Reviewed by Keith Miller. 
2288  
2289         No behavior change. 
2290  
2291         * bindings/scripts/CodeGeneratorJS.pm: 
2292         (GenerateHeader): 
2293         * bindings/scripts/test/JS/JSTestDOMJIT.h: 
2294         * domjit/JSDocumentDOMJIT.cpp: 
2295         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): 
2296         (WebCore::DocumentDocumentElementDOMJIT::callDOM): Deleted. 
2297         * domjit/JSNodeDOMJIT.cpp: 
2298         (WebCore::createCallDOMGetterForOffsetAccess): 
2299         (WebCore::NodeFirstChildDOMJIT::callDOMGetter): 
2300         (WebCore::NodeLastChildDOMJIT::callDOMGetter): 
2301         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): 
2302         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): 
2303         (WebCore::NodeParentNodeDOMJIT::callDOMGetter): 
2304         (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): 
2305         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): 
2306         (WebCore::createCallDOMForOffsetAccess): Deleted. 
2307         (WebCore::NodeFirstChildDOMJIT::callDOM): Deleted. 
2308         (WebCore::NodeLastChildDOMJIT::callDOM): Deleted. 
2309         (WebCore::NodeNextSiblingDOMJIT::callDOM): Deleted. 
2310         (WebCore::NodePreviousSiblingDOMJIT::callDOM): Deleted. 
2311         (WebCore::NodeParentNodeDOMJIT::callDOM): Deleted. 
2312         (WebCore::NodeNodeTypeDOMJIT::callDOM): Deleted. 
2313         (WebCore::NodeOwnerDocumentDOMJIT::callDOM): Deleted. 
2314  
2315 2016-10-28  Dave Hyatt  <hyatt@apple.com> 
2316  
2317         [CSS Parser] Fix font-family parsing inside @font-face 
2318         https://bugs.webkit.org/show_bug.cgi?id=164155 
2319  
2320         Reviewed by Simon Fraser. 
2321  
2322         * css/parser/CSSPropertyParser.cpp: 
2323         (WebCore::CSSPropertyParser::parseFontFaceDescriptor): 
2324         Use the full font-family parsing that returns a CSSValueList, 
2325         since we can handle multiple families. 
2326  
2327 2016-10-28  Per Arne Vollan  <pvollan@apple.com> 
2328  
2329         [Win][Direct2D] Implement ImageBufferData::putData. 
2330         https://bugs.webkit.org/show_bug.cgi?id=164151 
2331  
2332         Reviewed by Brent Fulgham. 
2333  
2334         * platform/graphics/win/ImageBufferDataDirect2D.cpp: 
2335         (WebCore::ImageBufferData::getData): 
2336         (WebCore::ImageBufferData::putData): 
2337  
2338 2016-10-28  Dave Hyatt  <hyatt@apple.com> 
2339  
2340         [CSS Parser] Support hanging-punctuation 
2341         https://bugs.webkit.org/show_bug.cgi?id=164153 
2342  
2343         Reviewed by Simon Fraser. 
2344  
2345         * css/parser/CSSPropertyParser.cpp: 
2346         (WebCore::consumeHangingPunctuation): 
2347         (WebCore::CSSPropertyParser::parseSingleValue): 
2348
2349 2016-10-28  Yusuke Suzuki  <utatane.tea@gmail.com>
2350
2351         [DOMJIT] Implement Document::documentElement
2352         https://bugs.webkit.org/show_bug.cgi?id=164113
2353
2354         Reviewed by Sam Weinig.
2355
2356         Test: js/dom/domjit-accessor-document-element.html
2357
2358         This patch implements document.documentElement DOMJIT accessor.
2359         Similar to ownerDocument accessor, the way to access to document.documentElement
2360         from JIT code is already prepared for CSSJIT. DOMJIT just utilizes the existing
2361         functionality: using documentElementMemoryOffset().
2362
2363         document.documentElement is frequently called in jQuery. Especially, every time
2364         we call jQuery.attr(), this is called.
2365
2366         To implement Document accessor, we clean up some code in DOMJITHelpers.
2367         We create the cpp file for DOMJITHelpers and move some helpers to it.
2368         And we also implement DOMJIT::checkDOM<DOMInterface> for convenience.
2369         It returns appropriate CheckDOM patchpoint implementation.
2370
2371         This patch improves Dromaeo jslib-attr-jquery.html 10% (481.64 v.s. 532.54).
2372
2373         * CMakeLists.txt:
2374         * WebCore.xcodeproj/project.pbxproj:
2375         * cssjit/SelectorCompiler.cpp:
2376         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
2377         * dom/Document.idl:
2378         * domjit/DOMJITAbstractHeapRepository.h:
2379         * domjit/DOMJITCheckDOM.h: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
2380         (WebCore::DOMJIT::TypeChecker<Node>::branchIfFail):
2381         (WebCore::DOMJIT::TypeChecker<Document>::branchIfFail):
2382         (WebCore::DOMJIT::TypeChecker<Event>::branchIfFail):
2383         (WebCore::DOMJIT::TypeChecker<Element>::branchIfFail):
2384         (WebCore::DOMJIT::checkDOM):
2385         * domjit/DOMJITHelpers.cpp: Copied from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
2386         (WebCore::DOMJIT::loadDocument):
2387         (WebCore::DOMJIT::loadDocumentElement):
2388         * domjit/DOMJITHelpers.h:
2389         (WebCore::DOMJIT::toWrapperSlow):
2390         (WebCore::DOMJIT::loadDocument): Deleted.
2391         * domjit/JSDocumentDOMJIT.cpp: Added.
2392         (WebCore::DocumentDocumentElementDOMJIT::checkDOM):
2393         (WebCore::DocumentDocumentElementDOMJIT::callDOM):
2394         * domjit/JSNodeDOMJIT.cpp:
2395         (WebCore::createCallDOMForOffsetAccess):
2396         (WebCore::NodeFirstChildDOMJIT::checkDOM):
2397         (WebCore::NodeLastChildDOMJIT::checkDOM):
2398         (WebCore::NodeNextSiblingDOMJIT::checkDOM):
2399         (WebCore::NodePreviousSiblingDOMJIT::checkDOM):
2400         (WebCore::NodeParentNodeDOMJIT::checkDOM):
2401         (WebCore::NodeNodeTypeDOMJIT::checkDOM):
2402         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM):
2403         (WebCore::NodeOwnerDocumentDOMJIT::callDOM):
2404         (WebCore::toWrapperSlow): Deleted.
2405         (WebCore::checkNode): Deleted.
2406
2407 2016-10-28  Dave Hyatt  <hyatt@apple.com>
2408
2409         [CSS Parser] Support initial-letter
2410         https://bugs.webkit.org/show_bug.cgi?id=164150
2411
2412         Reviewed by Simon Fraser.
2413
2414         * css/parser/CSSPropertyParser.cpp:
2415         (WebCore::consumeInitialLetter):
2416         (WebCore::CSSPropertyParser::parseSingleValue):
2417
2418 2016-10-28  Simon Fraser  <simon.fraser@apple.com>
2419
2420         Remove some unused code in RenderLayerCompositor::computeExtent()
2421         https://bugs.webkit.org/show_bug.cgi?id=163934
2422
2423         Reviewed by Zalan Bujtas.
2424
2425         viewportRect was never used.
2426
2427         * rendering/RenderLayerCompositor.cpp:
2428         (WebCore::RenderLayerCompositor::computeExtent):
2429
2430 2016-10-28  Sam Weinig  <sam@webkit.org>
2431
2432         [WebIDL] Update parser and code generators to only access type information through the type property
2433         https://bugs.webkit.org/show_bug.cgi?id=164141
2434
2435         Reviewed by Anders Carlsson.
2436
2437         Update IDLParser structs:
2438         - domSignature: Rename idlType to type. Specify that type is a domType.
2439         - domInterface: Remove name and parent. Specify that type and parentType are a domTypes.
2440         - domFunction: Specify that signature is a domSignature.
2441         - domAttribute: Remove unused type. Specify that signature is a domSignature.
2442         - domIterable: Remove idlKeyType and valueKeyType. Specify that keyType and valueType are a domTypes
2443         - domConstant: Specify that type is a domType.
2444         - domEnum: Specify that type is a domType.
2445         - domDictionary: Remove name and parent. Specify that type and parentType are a domTypes.
2446         - Typedef: Rename idlType to type and specify that it is a domType.
2447
2448         * bindings/scripts/IDLParser.pm:
2449         Remove redundant properties and specify type info in structs where possible.
2450
2451         * bindings/scripts/CodeGenerator.pm:
2452         (IsSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
2453         (IsSVGTypeWithWritablePropertiesNeedingTearOffForType): Renamed to remove ForType suffix.
2454         (GetSVGTypeNeedingTearOffForType): Renamed to remove ForType suffix.
2455         (GetSVGWrappedTypeNeedingTearOffForType): Renamed to remove ForType suffix.
2456
2457         Update to always access type information through type accessors. Remove use of removed
2458         properties.
2459
2460         * bindings/scripts/CodeGeneratorJS.pm:
2461         (IsNullableType): Deleted.
2462         (StripNullable): Deleted.
2463         Remove unused functions.
2464
2465         Update to always access type information through type accessors. Remove use of removed
2466         properties.
2467
2468         * bindings/scripts/generate-bindings.pl:
2469         Update to always access type information through type accessors. Remove use of removed
2470         properties.
2471
2472 2016-10-28  Dave Hyatt  <hyatt@apple.com>
2473
2474         [CSS Parser] Support bopomofo Ruby
2475         https://bugs.webkit.org/show_bug.cgi?id=164148
2476
2477         Reviewed by Simon Fraser.
2478
2479         * css/parser/CSSParserFastPaths.cpp:
2480         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2481
2482 2016-10-28  Dave Hyatt  <hyatt@apple.com>
2483
2484         [CSS Parser] Add support for -webkit-canvas images
2485         https://bugs.webkit.org/show_bug.cgi?id=164144
2486
2487         Reviewed by Simon Fraser.
2488
2489         * css/CSSValueKeywords.in:
2490         * css/parser/CSSParser.cpp:
2491         (WebCore::CSSParserContext::CSSParserContext):
2492         * css/parser/CSSPropertyParserHelpers.cpp:
2493         (WebCore::CSSPropertyParserHelpers::consumeWebkitCanvas):
2494         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
2495         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
2496
2497 2016-10-27  Geoffrey Garen  <ggaren@apple.com>
2498
2499         One file per class for Executable.h/.cpp
2500         https://bugs.webkit.org/show_bug.cgi?id=164099
2501
2502         Reviewed by Saam Barati.
2503
2504         * ForwardingHeaders/runtime/Executable.h: Removed.
2505         * ForwardingHeaders/runtime/FunctionExecutable.h: Copied from Source/WebCore/ForwardingHeaders/runtime/Executable.h.
2506         * bindings/js/JSLazyEventListener.cpp:
2507         * bindings/js/JSMainThreadExecStateInstrumentation.h:
2508
2509 2016-10-28  Dave Hyatt  <hyatt@apple.com>
2510
2511         [CSS Parser] Clean up gradient parsing
2512         https://bugs.webkit.org/show_bug.cgi?id=164139
2513
2514         Reviewed by Dean Jackson.
2515
2516         * css/CSSGradientValue.cpp:
2517         (WebCore::positionFromValue):
2518         (WebCore::CSSGradientValue::computeEndPoint):
2519         * css/parser/CSSPropertyParserHelpers.cpp:
2520         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
2521         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
2522         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
2523         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
2524         (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
2525
2526 2016-10-28  Dean Jackson  <dino@apple.com>
2527
2528         New CSS Parser should use Colors not RGBA32s
2529         https://bugs.webkit.org/show_bug.cgi?id=164124
2530         <rdar://problem/29000373>
2531
2532         Reviewed by Darin Adler.
2533
2534         The old parser has moved from using RGBA32 values to using
2535         Colors directly. This was so we could support ExtendedColors
2536         via the new color() syntax.
2537
2538         Update the new CSS parser to do the same.
2539
2540         * css/parser/CSSPropertyParserHelpers.cpp:
2541         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
2542         (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
2543         (WebCore::CSSPropertyParserHelpers::parseHexColor):
2544         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
2545         (WebCore::CSSPropertyParserHelpers::consumeColor):
2546
2547 2016-10-28  Dean Jackson  <dino@apple.com>
2548
2549         Allow new CSS parser to handle insertRule, etc via parseRule
2550         https://bugs.webkit.org/show_bug.cgi?id=164122
2551         <rdar://problem/29000101>
2552
2553         Reviewed by Darin Adler.
2554
2555         Call the new CSS parser from CSSParser::parseRule if enabled. This
2556         allows style added via the CSSOM insertRule to go through
2557         the parser.
2558
2559         I tested this across our layout tests that use insertRule. It
2560         works fine, but does cause some filter tests to fail. This is
2561         because the new parser does not generate WebKitCSSFilterValues,
2562         but I think the CSSFunctionValue is good enough. I'll remove
2563         WebKitCSSFilterValue separately.
2564
2565         * css/parser/CSSParser.cpp:
2566         (WebCore::CSSParser::parseRule): Call CSSParserImpl::parseRule.
2567
2568 2016-10-28  Simon Fraser  <simon.fraser@apple.com>
2569
2570         Wrong blur radius for filter: drop-shadow()
2571         https://bugs.webkit.org/show_bug.cgi?id=163667
2572
2573         Reviewed by Darin Adler.
2574         
2575         The "stdDev" parameter to <feDropShadow> and <feGaussianBlur> represents the standard
2576         deviation (σ) of the Gaussian blur function. CSS filters drop-shadow() and blur() follow
2577         this with their radius parameter.
2578         
2579         However, CSS box-shadow and text-shadow use 2σ to describe the blur radius, since this
2580         is conveniently close to the number of pixels the effect of the blur extends out.
2581         
2582         feDropShadow, which is used by non-accelerated filter: drop-shadow(), was using
2583         the wrong blur radius because it passed its stdDev directly to ShadowBlur. ShadowBlur
2584         was written for CSS box-shadow, so expected its input "blur radius" to be twice the
2585         stdDev.
2586         
2587         Tests: css3/filters/drop-shadow-blur-radius.html
2588                svg/filters/feDropShadow-blur-radius.html
2589
2590         * platform/graphics/filters/FEDropShadow.cpp:
2591         (WebCore::FEDropShadow::platformApplySoftware):
2592
2593 2016-10-28  Youenn Fablet  <youenn@apple.com>
2594
2595         Expose RTCPeerConnection unprefixed
2596         https://bugs.webkit.org/show_bug.cgi?id=164060
2597
2598         Reviewed by Darin Adler.
2599
2600         Covered by rebased and activated tests.
2601
2602         * Modules/mediastream/RTCPeerConnection.idl:
2603
2604 2016-10-28  Dave Hyatt  <hyatt@apple.com>
2605
2606         [CSS Parser] Support the marquee properties
2607         https://bugs.webkit.org/show_bug.cgi?id=164132
2608
2609         Reviewed by Zalan Bujtas.
2610
2611         * css/parser/CSSParserFastPaths.cpp:
2612         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2613         * css/parser/CSSPropertyParser.cpp:
2614         (WebCore::consumeWebkitMarqueeIncrement):
2615         (WebCore::consumeWebkitMarqueeRepetition):
2616         (WebCore::consumeWebkitMarqueeSpeed):
2617         (WebCore::CSSPropertyParser::parseSingleValue):
2618         (WebCore::CSSPropertyParser::parseShorthand):
2619
2620 2016-10-28  Dave Hyatt  <hyatt@apple.com>
2621
2622         [CSS Parser] Miscellaneous bug fixes
2623         https://bugs.webkit.org/show_bug.cgi?id=164131
2624
2625         Reviewed by Zalan Bujtas.
2626
2627         * css/CSSComputedStyleDeclaration.cpp:
2628         (WebCore::ComputedStyleExtractor::propertyValue):
2629         * css/CSSPropertyNames.in:
2630         The prefix was incorrectly dropped from -webkit-column-progression.
2631         Put it back.
2632
2633         * css/StyleBuilderConverter.h:
2634         (WebCore::StyleBuilderConverter::convertPositionComponent):
2635         (WebCore::StyleBuilderConverter::convertObjectPosition):
2636         Fix object-position parsing so that the position components can
2637         be ids.
2638
2639         * css/StyleBuilderCustom.h:
2640         (WebCore::StyleBuilderCustom::applyValueContent):
2641         The new parser doesn't make a list for content:none, since none can't be
2642         a component of a list anyway. Add code to handle this case in the
2643         apply function.
2644
2645         * css/parser/CSSParser.cpp:
2646         (WebCore::isValidKeywordPropertyAndValue):
2647         Put the prefix back on -webkit-column-progression.
2648
2649         * css/parser/CSSParserFastPaths.cpp:
2650         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2651         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2652         Same.
2653
2654         * css/parser/CSSParserImpl.cpp:
2655         (WebCore::CSSParserImpl::parsePageSelector):
2656         Make sure match type is checked, since our code asserts if it isn't.
2657
2658         * css/parser/CSSPropertyParser.cpp:
2659         (WebCore::validWidthOrHeightKeyword):
2660         (WebCore::consumeLineGrid):
2661         (WebCore::CSSPropertyParser::parseSingleValue):
2662         Add support for the line-grid properties and for -webkit-nbsp-mode.
2663
2664 2016-10-28  Antti Koivisto  <antti@apple.com>
2665
2666         Always use iOS preload behavior
2667         https://bugs.webkit.org/show_bug.cgi?id=164127
2668
2669         Reviewed by Andreas Kling.
2670
2671         On non-iOS platforms we were delaying issuing lower priority preload (images mostly) until document has body.
2672         This should be unnecessary as networking layer prioritization should ensure higher priority resources are
2673         loaded earlier. Testing on iOS has showed that more aggressive behavior is a win.
2674
2675         This patch switches to iOS behavior on all platforms (and simplified the logic).
2676
2677         * html/parser/HTMLResourcePreloader.cpp:
2678         (WebCore::HTMLResourcePreloader::preload):
2679         * loader/LinkLoader.cpp:
2680         (WebCore::LinkLoader::preloadIfNeeded):
2681         * loader/cache/CachedResourceLoader.cpp:
2682         (WebCore::CachedResourceLoader::performPostLoadActions):
2683         (WebCore::CachedResourceLoader::preload):
2684         (WebCore::CachedResourceLoader::isPreloaded):
2685         (WebCore::CachedResourceLoader::checkForPendingPreloads): Deleted.
2686         (WebCore::CachedResourceLoader::requestPreload): Deleted.
2687         (WebCore::CachedResourceLoader::clearPendingPreloads): Deleted.
2688         * loader/cache/CachedResourceLoader.h:
2689
2690 2016-10-28  Youenn Fablet  <youenn@apple.com>
2691
2692         [Fetch] Ensure redirection count is no more than 20 in case of cross origin requests
2693         https://bugs.webkit.org/show_bug.cgi?id=164117
2694
2695         Reviewed by Sam Weinig.
2696
2697         Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin-worker.html
2698                imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin.html
2699
2700         Introducing a ResourceLoaderOptions that defines the maximum redirection count.
2701         By default, it is set to 20 as per fetch specification.
2702
2703         This option is used by SubresourceLoader to cancel load if its redirection count is above that maximum.
2704         DocumentThreadableLoader stopping redirections to make preflight if needed, it now uses the maxRedirectCount loader option to ensure
2705         that the total number of redirections is 20.
2706
2707         * loader/DocumentThreadableLoader.cpp:
2708         (WebCore::DocumentThreadableLoader::redirectReceived):
2709         * loader/ResourceLoaderOptions.h:
2710         * loader/SubresourceLoader.cpp:
2711         (WebCore::SubresourceLoader::willSendRequestInternal):
2712         * loader/SubresourceLoader.h:
2713
2714 2016-10-28  Fujii Hironori  <Hironori.Fujii@sony.com>
2715
2716         generate-bindings-all.pl should recompile supplemented IDL if its supplemental IDL are added or removed
2717         https://bugs.webkit.org/show_bug.cgi?id=164054
2718
2719         Reviewed by Michael Catanzaro.
2720
2721         generate-bindings-all.pl determines which IDL to recompile by
2722         comparing timestamps of generated files, source IDL and its
2723         dependencies.  But this is not enough. If a new supplemental IDL
2724         is added, its supplemented IDL needs to be recompiled even though
2725         the timestamp of the supplemental IDL is older than the
2726         generated files.
2727
2728         * bindings/scripts/generate-bindings-all.pl: Read supplemental
2729         dependency file both before and after invoking preprocess-idls.pl.
2730         Recompile IDL files if its supplemental dependencies are added or
2731         removed.
2732
2733 2016-10-28  Youenn Fablet  <youenn@apple.com>
2734
2735         PeerMediaDescription does not need to be refcounted
2736         https://bugs.webkit.org/show_bug.cgi?id=164059
2737
2738         Reviewed by Darin Adler.
2739
2740         No change of behavior.
2741
2742         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2743         (WebCore::MediaEndpointPeerConnection::createOfferTask):
2744         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
2745         (WebCore::createSourceMap):
2746         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
2747         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
2748         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
2749         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
2750         * Modules/mediastream/MediaEndpointPeerConnection.h:
2751         * Modules/mediastream/SDPProcessor.cpp:
2752         (WebCore::configurationFromJSON):
2753         (WebCore::configurationToJSON):
2754         (WebCore::SDPProcessor::generateCandidateLine):
2755         (WebCore::SDPProcessor::parseCandidateLine):
2756         * platform/mediastream/IceCandidate.h:
2757         * platform/mediastream/MediaEndpointSessionConfiguration.h:
2758         (WebCore::MediaEndpointSessionConfiguration::mediaDescriptions):
2759         (WebCore::MediaEndpointSessionConfiguration::addMediaDescription):
2760         (WebCore::MediaEndpointSessionConfiguration::clone):
2761         * platform/mediastream/PeerMediaDescription.h:
2762         (WebCore::PeerMediaDescription::addPayload):
2763         (WebCore::PeerMediaDescription::addSsrc):
2764         (WebCore::PeerMediaDescription::clearSsrcs):
2765         (WebCore::PeerMediaDescription::addIceCandidate):
2766         (WebCore::PeerMediaDescription::create): Deleted.
2767         (WebCore::PeerMediaDescription::~PeerMediaDescription): Deleted.
2768         (WebCore::PeerMediaDescription::type): Deleted.
2769         (WebCore::PeerMediaDescription::setType): Deleted.
2770         (WebCore::PeerMediaDescription::port): Deleted.
2771         (WebCore::PeerMediaDescription::setPort): Deleted.
2772         (WebCore::PeerMediaDescription::address): Deleted.
2773         (WebCore::PeerMediaDescription::setAddress): Deleted.
2774         (WebCore::PeerMediaDescription::mode): Deleted.
2775         (WebCore::PeerMediaDescription::setMode): Deleted.
2776         (WebCore::PeerMediaDescription::mid): Deleted.
2777         (WebCore::PeerMediaDescription::setMid): Deleted.
2778         (WebCore::PeerMediaDescription::payloads): Deleted.
2779         (WebCore::PeerMediaDescription::setPayloads): Deleted.
2780         (WebCore::PeerMediaDescription::rtcpMux): Deleted.
2781         (WebCore::PeerMediaDescription::setRtcpMux): Deleted.
2782         (WebCore::PeerMediaDescription::rtcpAddress): Deleted.
2783         (WebCore::PeerMediaDescription::setRtcpAddress): Deleted.
2784         (WebCore::PeerMediaDescription::rtcpPort): Deleted.
2785         (WebCore::PeerMediaDescription::setRtcpPort): Deleted.
2786         (WebCore::PeerMediaDescription::mediaStreamId): Deleted.
2787         (WebCore::PeerMediaDescription::setMediaStreamId): Deleted.
2788         (WebCore::PeerMediaDescription::mediaStreamTrackId): Deleted.
2789         (WebCore::PeerMediaDescription::setMediaStreamTrackId): Deleted.
2790         (WebCore::PeerMediaDescription::dtlsSetup): Deleted.
2791         (WebCore::PeerMediaDescription::setDtlsSetup): Deleted.
2792         (WebCore::PeerMediaDescription::dtlsFingerprintHashFunction): Deleted.
2793         (WebCore::PeerMediaDescription::setDtlsFingerprintHashFunction): Deleted.
2794         (WebCore::PeerMediaDescription::dtlsFingerprint): Deleted.
2795         (WebCore::PeerMediaDescription::setDtlsFingerprint): Deleted.
2796         (WebCore::PeerMediaDescription::cname): Deleted.
2797         (WebCore::PeerMediaDescription::setCname): Deleted.
2798         (WebCore::PeerMediaDescription::ssrcs): Deleted.
2799         (WebCore::PeerMediaDescription::iceUfrag): Deleted.
2800         (WebCore::PeerMediaDescription::setIceUfrag): Deleted.
2801         (WebCore::PeerMediaDescription::icePassword): Deleted.
2802         (WebCore::PeerMediaDescription::setIcePassword): Deleted.
2803         (WebCore::PeerMediaDescription::iceCandidates): Deleted.
2804         (WebCore::PeerMediaDescription::clone): Deleted.
2805         (WebCore::PeerMediaDescription::PeerMediaDescription): Deleted.
2806         * platform/mediastream/mac/MediaEndpointMac.cpp:
2807         (WebCore::MediaEndpointMac::addRemoteCandidate):
2808         (WebCore::MediaEndpointMac::OnIceCandidate):
2809         * platform/mediastream/mac/MediaEndpointMac.h:
2810         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
2811         (WebCore::MediaEndpointOwr::updateSendConfiguration):
2812         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
2813         * platform/mock/MockMediaEndpoint.cpp:
2814         (WebCore::MockMediaEndpoint::updateConfigurationMids):
2815
2816 2016-10-28  Antoine Quint  <graouts@apple.com>
2817
2818         [Modern Media Controls] Media Controller: scrubbing support
2819         https://bugs.webkit.org/show_bug.cgi?id=163726
2820         <rdar://problem/27989481>
2821
2822         Reviewed by Dean Jackson.
2823
2824         We introduce the ScrubberSupport class which brings support for scrubbing the media
2825         by interacting with the scrubber in the media controls and correctly reflecting
2826         the media's current time as set via the media API.
2827
2828         Tests: media/modern-media-controls/scrubber-support/scrubber-support-click.html
2829                media/modern-media-controls/scrubber-support/scrubber-support-drag.html
2830                media/modern-media-controls/scrubber-support/scrubber-support-media-api.html
2831
2832         * Modules/modern-media-controls/js-files:
2833         * Modules/modern-media-controls/media/media-controller.js:
2834         (MediaController):
2835         * Modules/modern-media-controls/media/scrubbing-support.js: Added.
2836         (ScrubbingSupport.prototype.get control):
2837         (ScrubbingSupport.prototype.get mediaEvents):
2838         (ScrubbingSupport.prototype.controlValueWillStartChanging):
2839         (ScrubbingSupport.prototype.controlValueDidChange):
2840         (ScrubbingSupport.prototype.controlValueDidStopChanging):
2841         (ScrubbingSupport.prototype.syncControl):
2842         (ScrubbingSupport):
2843         * WebCore.xcodeproj/project.pbxproj:
2844
2845 2016-10-28  Alex Christensen  <achristensen@webkit.org>
2846
2847         Fix Windows WebGL build after r208022
2848         https://bugs.webkit.org/show_bug.cgi?id=164091
2849
2850         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
2851         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
2852         (WebCore::Extensions3DOpenGLES::Extensions3DOpenGLES):
2853         * platform/graphics/opengl/Extensions3DOpenGLES.h:
2854         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2855         (WebCore::GraphicsContext3D::getExtensions):
2856
2857 2016-10-27  Youenn Fablet  <youenn@apple.com>
2858
2859         [Fetch API] Fetch ReadableStream should only clone the second branch
2860         https://bugs.webkit.org/show_bug.cgi?id=164058
2861
2862         Reviewed by Darin Adler.
2863
2864         Covered by rebased tests.
2865
2866         * Modules/streams/ReadableStreamInternals.js:
2867         (readableStreamTeePullFunction):
2868
2869 2016-10-27  Alex Christensen  <achristensen@webkit.org>
2870
2871         Update ANGLE
2872         https://bugs.webkit.org/show_bug.cgi?id=164101
2873
2874         Reviewed by Darin Adler.
2875
2876         ShCheckVariablesWithinPackingLimits has changed signatures from taking a ShVariableInfo* and length
2877         to taking a std::vector<sh::ShaderVariable> which requires more information about the shader variables
2878         than we kept in GraphicsContext3D::SymbolInfo.  I removed the SymbolInfo class because it was redundant
2879         with ANGLE's sh::ShaderVariable and now unused.
2880
2881         Covered by existing WebGL tests.
2882
2883         * CMakeLists.txt:
2884         * PlatformMac.cmake:
2885         * PlatformWin.cmake:
2886         * platform/graphics/ANGLEWebKitBridge.cpp:
2887         (WebCore::appendSymbol):
2888         (WebCore::getStructInfo):
2889         (WebCore::getSymbolInfo):
2890         (WebCore::ANGLEWebKitBridge::compileShaderSource):
2891         * platform/graphics/ANGLEWebKitBridge.h:
2892         (WebCore::ANGLEShaderSymbol::isSampler): Deleted.
2893         * platform/graphics/GraphicsContext3D.h:
2894         (WebCore::GraphicsContext3D::SymbolInfo::SymbolInfo): Deleted.
2895         (WebCore::GraphicsContext3D::SymbolInfo::operator==): Deleted.
2896         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2897         (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
2898         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2899         (WebCore::GraphicsContext3D::checkVaryingsPacking):
2900         (WebCore::GraphicsContext3D::precisionsMatch):
2901         (WebCore::GraphicsContext3D::mappedSymbolName):
2902         (WebCore::GraphicsContext3D::originalSymbolName):
2903
2904 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
2905
2906         Remove RenderStyle::isRunningAcceleratedAnimation()
2907         https://bugs.webkit.org/show_bug.cgi?id=164109
2908
2909         Reviewed by David Hyatt.
2910
2911         RenderStyle::isRunningAcceleratedAnimation() was added in r40876 to handle interrupted
2912         accelerated transitions, and to allow RenderLayer::currentTransform() to know when it
2913         has to manually get the animated style.
2914         
2915         The latter can now use isRunningAcceleratedAnimationOnRenderer(), and interrupting
2916         accelerated transitions seems to work fine without it, so remove it.
2917
2918         * page/animation/ImplicitAnimation.cpp:
2919         (WebCore::ImplicitAnimation::animate):
2920         * page/animation/KeyframeAnimation.cpp:
2921         (WebCore::KeyframeAnimation::animate):
2922         * rendering/RenderLayer.cpp:
2923         (WebCore::RenderLayer::currentTransform):
2924         * rendering/style/RenderStyle.h:
2925         (WebCore::RenderStyle::isRunningAcceleratedAnimation): Deleted.
2926         (WebCore::RenderStyle::setIsRunningAcceleratedAnimation): Deleted.
2927         * rendering/style/StyleRareNonInheritedData.cpp:
2928         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2929         (WebCore::StyleRareNonInheritedData::operator==):
2930         * rendering/style/StyleRareNonInheritedData.h:
2931
2932 2016-10-27  Myles C. Maxfield  <mmaxfield@apple.com>
2933
2934         Teach WebGL code about new buffer targets in WebGL2
2935         https://bugs.webkit.org/show_bug.cgi?id=163924
2936
2937         Reviewed by Dean Jackson.
2938
2939         WebGL 2 adds new buffer targets. Instead of completely reimplementing
2940         the functions again for WebGL 2, we can simply check if we are using
2941         a new kind of context to conditionally enable support.
2942
2943         Test: fast/canvas/webgl/webgl2-buffer-targets.html
2944
2945         * html/canvas/WebGL2RenderingContext.h:
2946         * html/canvas/WebGL2RenderingContext.idl:
2947         * html/canvas/WebGLBuffer.cpp:
2948         (WebCore::WebGLBuffer::associateBufferDataImpl):
2949         (WebCore::WebGLBuffer::associateBufferSubDataImpl):
2950         (WebCore::WebGLBuffer::setTarget):
2951         * html/canvas/WebGLBuffer.h:
2952         * html/canvas/WebGLRenderingContextBase.cpp:
2953         (WebCore::WebGLRenderingContextBase::bindBuffer):
2954         (WebCore::WebGLRenderingContextBase::getBufferParameter):
2955         (WebCore::WebGLRenderingContextBase::validateBufferDataParameters):
2956         * html/canvas/WebGLRenderingContextBase.h:
2957
2958 2016-10-27  Dave Hyatt  <hyatt@apple.com>
2959
2960         [CSS Parser] Enhance grid-auto-flow parsing to allow dense first.
2961         https://bugs.webkit.org/show_bug.cgi?id=164110
2962
2963         Reviewed by Simon Fraser.
2964
2965         * css/StyleBuilderConverter.h:
2966         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
2967
2968 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
2969
2970         constify the CSSValue arguments to StyleBuilderConverter functions
2971         https://bugs.webkit.org/show_bug.cgi?id=164106
2972
2973         Reviewed by Zalan Bujtas.
2974
2975         Make almost all the CSSValue& arguments const (this makes it clear that they
2976         are in params, not out params). Only a few that are CSSImageValues are non-const,
2977         because they fall into a non-const code path.
2978
2979         * css/StyleBuilderConverter.h:
2980         (WebCore::StyleBuilderConverter::convertLengthOrAuto):
2981         (WebCore::StyleBuilderConverter::convertLengthSizing):
2982         (WebCore::StyleBuilderConverter::convertLengthMaxSizing):
2983         (WebCore::StyleBuilderConverter::convertComputedLength):
2984         (WebCore::StyleBuilderConverter::convertLineWidth):
2985         (WebCore::StyleBuilderConverter::convertSpacing):
2986         (WebCore::StyleBuilderConverter::convertToRadiusLength):
2987         (WebCore::StyleBuilderConverter::convertRadius):
2988         (WebCore::StyleBuilderConverter::convertObjectPosition):
2989         (WebCore::StyleBuilderConverter::convertTextDecoration):
2990         (WebCore::StyleBuilderConverter::convertNumber):
2991         (WebCore::StyleBuilderConverter::convertNumberOrAuto):
2992         (WebCore::StyleBuilderConverter::convertWebkitHyphenateLimitLines):
2993         (WebCore::StyleBuilderConverter::convertTransform):
2994         (WebCore::StyleBuilderConverter::convertString):
2995         (WebCore::StyleBuilderConverter::convertStringOrAuto):
2996         (WebCore::StyleBuilderConverter::convertStringOrNone):
2997         (WebCore::StyleBuilderConverter::valueToEmphasisPosition):
2998         (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
2999         (WebCore::StyleBuilderConverter::convertTextAlign):
3000         (WebCore::StyleBuilderConverter::convertClipPath):
3001         (WebCore::StyleBuilderConverter::convertResize):
3002         (WebCore::StyleBuilderConverter::convertMarqueeRepetition):
3003         (WebCore::StyleBuilderConverter::convertMarqueeSpeed):
3004         (WebCore::StyleBuilderConverter::convertQuotes):
3005         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
3006         (WebCore::StyleBuilderConverter::convertReflection):
3007         (WebCore::StyleBuilderConverter::convertInitialLetter):
3008         (WebCore::StyleBuilderConverter::convertTextStrokeWidth):
3009         (WebCore::StyleBuilderConverter::convertLineBoxContain):
3010         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
3011         (WebCore::StyleBuilderConverter::convertScrollSnapPoints):
3012         (WebCore::StyleBuilderConverter::convertSnapCoordinatePair):
3013         (WebCore::StyleBuilderConverter::convertScrollSnapCoordinates):
3014         (WebCore::StyleBuilderConverter::createGridTrackBreadth):
3015         (WebCore::StyleBuilderConverter::createGridTrackSize):
3016         (WebCore::StyleBuilderConverter::createGridTrackList):
3017         (WebCore::StyleBuilderConverter::createGridPosition):
3018         (WebCore::StyleBuilderConverter::convertGridTrackSizeList):
3019         (WebCore::StyleBuilderConverter::convertGridTrackSize):
3020         (WebCore::StyleBuilderConverter::convertGridPosition):
3021         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
3022         (WebCore::StyleBuilderConverter::convertWordSpacing):
3023         (WebCore::StyleBuilderConverter::convertPerspective):
3024         (WebCore::StyleBuilderConverter::convertMarqueeIncrement):
3025         (WebCore::StyleBuilderConverter::convertFilterOperations):
3026         (WebCore::StyleBuilderConverter::convertFontFeatureSettings):
3027         (WebCore::StyleBuilderConverter::convertFontVariationSettings):
3028         (WebCore::StyleBuilderConverter::convertTouchCallout):
3029         (WebCore::StyleBuilderConverter::convertTapHighlightColor):
3030         (WebCore::StyleBuilderConverter::convertOverflowScrolling):
3031         (WebCore::StyleBuilderConverter::convertSVGLength):
3032         (WebCore::StyleBuilderConverter::convertSVGLengthVector):
3033         (WebCore::StyleBuilderConverter::convertStrokeDashArray):
3034         (WebCore::StyleBuilderConverter::convertPaintOrder):
3035         (WebCore::StyleBuilderConverter::convertOpacity):
3036         (WebCore::StyleBuilderConverter::convertSVGURIReference):
3037         (WebCore::StyleBuilderConverter::convertSVGColor):
3038         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
3039         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
3040         (WebCore::StyleBuilderConverter::convertGlyphOrientation):
3041         (WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
3042         (WebCore::StyleBuilderConverter::convertLineHeight):
3043         (WebCore::StyleBuilderConverter::convertFontSynthesis):
3044         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
3045         (WebCore::StyleBuilderConverter::convertPageBreakInside):
3046         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
3047         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
3048         (WebCore::StyleBuilderConverter::convertRegionBreakBetween):
3049         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
3050         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
3051
3052 2016-10-27  Dave Hyatt  <hyatt@apple.com>
3053
3054         [CSS Parser] Add support for a reference box to -webkit-clip-path
3055         https://bugs.webkit.org/show_bug.cgi?id=164107
3056
3057         Reviewed by Simon Fraser.
3058
3059         * css/parser/CSSPropertyParser.cpp:
3060         (WebCore::consumeBasicShape):
3061         (WebCore::consumeBasicShapeOrBox):
3062         (WebCore::consumeWebkitClipPath):
3063
3064 2016-10-27  Yusuke Suzuki  <utatane.tea@gmail.com>
3065
3066         [DOM] Add JSEventType
3067         https://bugs.webkit.org/show_bug.cgi?id=164096
3068
3069         Reviewed by Darin Adler.
3070
3071         Event is inherited by many Event classes. But, Event's accessors and interfaces are
3072         frequently called. For example, event.{type, target, srcElement} for accessors. And
3073         event.stopPropagation() and event.preventDefault() functions.
3074
3075         However, since the user-visible event instance is typically the instance of the subclass,
3076         jsDynamicCast<JSEvent*>() walks several classes before it succeeds. It is costly.
3077
3078         In this patch, we add a new WebCore JSType JSEventType for JSEvent and add a new
3079         function jsEventCast. That supports a super fast cast operation. And it paves the way
3080         for implementing DOM accessors of Event in DOMJIT.
3081
3082         No behavior change.
3083
3084         * WebCore.xcodeproj/project.pbxproj:
3085         * bindings/js/JSDOMWrapper.h:
3086         * bindings/js/JSEventCustom.h: Added.
3087         (WebCore::jsEventCast):
3088         * bindings/scripts/CodeGeneratorJS.pm:
3089         (GetJSTypeForNode):
3090         (GenerateHeader):
3091         (GetCastingHelperForThisObject):
3092         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3093         (WebCore::JSTestEventConstructor::createStructure):
3094         * dom/Event.idl:
3095         * domjit/DOMJITHelpers.h:
3096         (WebCore::DOMJIT::branchIfEvent):
3097         (WebCore::DOMJIT::branchIfNotEvent):
3098
3099 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
3100
3101         Rename StyleRareNonInheritedData::opacity to m_opacity
3102         https://bugs.webkit.org/show_bug.cgi?id=164104
3103
3104         Reviewed by Dave Hyatt.
3105
3106         Pure rename.
3107
3108         * rendering/style/RenderStyle.cpp:
3109         (WebCore::RenderStyle::changeRequiresLayerRepaint):
3110         * rendering/style/RenderStyle.h:
3111         (WebCore::RenderStyle::opacity):
3112         (WebCore::RenderStyle::setOpacity):
3113         * rendering/style/StyleRareNonInheritedData.cpp:
3114         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3115         (WebCore::StyleRareNonInheritedData::operator==):
3116         * rendering/style/StyleRareNonInheritedData.h:
3117         (WebCore::StyleRareNonInheritedData::hasOpacity):
3118
3119 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
3120
3121         If an animation's keyframes affect stacking context properties, create stacking context while the animation is running
3122         https://bugs.webkit.org/show_bug.cgi?id=164094
3123
3124         Reviewed by Dean Jackson.
3125
3126         The CSS animations spec <https://drafts.csswg.org/css-animations-1/> now makes it
3127         clear that a keyframe animation animating properties which can affect stacking context
3128         should establish stacking context while it's running, or filling-forwards. This is part
3129         of the "the user agent must act as if the will-change property...includes all the properties
3130         animated by the animation" clause.
3131
3132         Implement by having CompositeAnimation::animate() track whether running animations should
3133         create stacking context, replacing existing code in AnimationController::updateAnimations()
3134         which only looked at opacity and transform. Transitions are also checked to see if they need
3135         to trigger stacking context.
3136
3137         This allows for the removal of a 0.9999 hack when blending opacity.
3138
3139         Tests: animations/stacking-context-fill-forwards.html
3140                animations/stacking-context-not-fill-forwards.html
3141                animations/stacking-context-unchanged-while-running.html
3142
3143         * page/animation/AnimationController.cpp:
3144         (WebCore::AnimationController::updateAnimations):
3145         * page/animation/CSSPropertyAnimation.cpp:
3146         * page/animation/CompositeAnimation.cpp:
3147         (WebCore::CompositeAnimation::animate):
3148         * page/animation/KeyframeAnimation.cpp:
3149         (WebCore::KeyframeAnimation::KeyframeAnimation):
3150         (WebCore::KeyframeAnimation::computeStackingContextImpact):
3151         (WebCore::KeyframeAnimation::animate):
3152         * page/animation/KeyframeAnimation.h:
3153         * rendering/RenderLayer.cpp:
3154         (WebCore::RenderLayer::currentTransform):
3155         * rendering/style/WillChangeData.cpp:
3156         (WebCore::WillChangeData::propertyCreatesStackingContext):
3157         (WebCore::propertyCreatesStackingContext): Deleted.
3158         * rendering/style/WillChangeData.h:
3159
3160 2016-10-27  Sam Weinig  <sam@webkit.org>
3161
3162         [WebIDL] Move code generators off of domSignature::type and onto domSignature::idlType
3163         https://bugs.webkit.org/show_bug.cgi?id=164089
3164
3165         Reviewed by Alex Christensen.
3166
3167         Make more IDLParser structures contain domTypes for type descriptions, rather than strings:
3168         - domInterface gains type and parentType.
3169         - domConstant gains type.
3170         - domEnum gains type.
3171         - domDictionary gains type and parentType.
3172
3173         With these structs now containing domTypes, we can update the CodeGenerators to operate on
3174         domTypes exclusively, rather than types as strings. This allows us to consistently have access
3175         to information such as subtypes and nullability.
3176
3177         * bindings/scripts/CodeGenerator.pm:
3178         Update helpers to operate of domTypes. The one exception is SkipIncludeHeader, which
3179         still operates on a type name, since it is called late in code generation on the textual
3180         form of type names in the include list. 
3181
3182         * bindings/scripts/CodeGeneratorJS.pm:
3183         Update to use domTypes.
3184
3185         * bindings/scripts/IDLParser.pm:
3186         - Add domType accessors to domInterface, domConstant, domEnum, and domDictionary
3187           and populate them.
3188         - Remove type accessors from domSignature (domType is accessible from idlType).
3189         - Remove special cases for sequence and FrozenArray, now that they are always
3190           accessed as domTypes.
3191
3192         * html/HTMLEmbedElement.idl:
3193         * html/HTMLFrameElement.idl:
3194         * html/HTMLFrameOwnerElement.cpp:
3195         (WebCore::HTMLFrameOwnerElement::getSVGDocument):
3196         * html/HTMLFrameOwnerElement.h:
3197         * html/HTMLIFrameElement.idl:
3198         * html/HTMLObjectElement.idl:
3199         Fix interfaces declaring getSVGDocument() to correctly have it return
3200         a Document, rather than an SVGDocument, which does exist anymore. To
3201         make the bindings happy, also change the signature of HTMLFrameOwnerElement::getSVGDocument
3202         to return a Document.
3203
3204         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3205         * bindings/scripts/test/JS/JSTestInterface.cpp:
3206         * bindings/scripts/test/JS/JSTestObj.cpp:
3207         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3208         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3209         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3210         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3211         Update test results to remove some redundant headers (Already included JSFoo.h, so no need for Foo.h).
3212
3213 2016-10-27  Myles C. Maxfield  <mmaxfield@apple.com>
3214
3215         [macOS] [WebGL2] Temporarily upgrade WebGL 2's internal OpenGL context from version 2.1 to 3.2
3216         https://bugs.webkit.org/show_bug.cgi?id=164091
3217
3218         Reviewed by Dean Jackson.
3219
3220         In order to test WebGL2 correctly, I had to upgrade the macOS's OpenGL 
3221         context to a 3.2-compatible context to make sure the new symbols are
3222         accepted. Eventually, this 3.2-compatible context will have to be
3223         reverted and replaced with an ANGLE context. The current 3.2-compatible
3224         context is just for testing.
3225
3226         Test: fast/canvas/webgl/webgl2-context-creation.html
3227
3228         * html/canvas/WebGLBuffer.cpp: Use "nullptr" instead of 0.
3229         (WebCore::WebGLBuffer::associateBufferData):
3230         * html/canvas/WebGLRenderingContextBase.cpp: Use make_unique() instead
3231         of the unique_ptr constructor.
3232         (WebCore::WebGLRenderingContextBase::create):
3233         * platform/graphics/GraphicsContext3D.h: GraphicsContext should know
3234         if it is using a 3.2-compatible context because some parts of 2.1 are
3235         removed in these contexts, and replaced with new things which aren't
3236         in 2.1.
3237         * platform/graphics/mac/GraphicsContext3DMac.mm:
3238         (WebCore::setPixelFormat): Use kCGLPFAOpenGLProfile to specify an
3239         OpenGL 3.2 context.
3240         (WebCore::GraphicsContext3D::GraphicsContext3D): GL_CLAMP is deprecated
3241         in OpenGL 3.2. Fortunately, GL_CLAMP_TO_EDGE isn't deprecated and does
3242         exactly what we want. In OpenGL3.2, point sprites are always enabled,
3243         so there's no need to enable them in those contexts.
3244         (WebCore::GraphicsContext3D::isGLES2Compliant):
3245         * platform/graphics/opengl/Extensions3DOpenGL.cpp: In OpenGL 3.2,
3246         glGetString() no longer accepts GL_EXTENSIONS. Instead, glGetStringi()
3247         is used instead. Unfortunately, glGetString() is not available in
3248         OpenGL 2.1 contexts, so we need to use one or the other based on the
3249         version of the context we're using.
3250         (WebCore::Extensions3DOpenGL::Extensions3DOpenGL):
3251         (WebCore::Extensions3DOpenGL::getExtensions):
3252         * platform/graphics/opengl/Extensions3DOpenGL.h:
3253         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
3254         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
3255         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
3256         Instead of modifying getExtensions() to use glGetStringi(), it makes
3257         better sense to modify this function because getExtensions() returns
3258         a string. Building up a string just to split it up again is silly, so
3259         modifying this function instead makes more sense.
3260         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
3261         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
3262         (WebCore::GraphicsContext3D::getIntegerv): GL_MAX_VARYING_FLOATS is
3263         removed in OpenGL 3.2 contexts. However, it is replaced by
3264         GL_MAX_VARYING_COMPONENTS, though this is deprecated but not removed.
3265         In the more recent OpenGL context versions, GL_MAX_VARYING_VECTORS is
3266         recommended instead, but that isn't available in OpenGL 3.2.
3267         (WebCore::GraphicsContext3D::getExtensions):
3268
3269 2016-10-27  Megan Gardner  <megan_gardner@apple.com>
3270
3271         Add support for wide gamut for ShareableBitmap for image popovers
3272         https://bugs.webkit.org/show_bug.cgi?id=164001
3273
3274         Reviewed by Simon Fraser.
3275
3276         Add a function to return a CGColorSpaceRef for extended sRGB.
3277
3278         This is currently untestable, so no tests added.
3279
3280         * platform/graphics/cg/GraphicsContextCG.cpp:
3281         (WebCore::extendedSRGBColorSpaceRef):
3282
3283 2016-10-25  Brent Fulgham  <bfulgham@apple.com>
3284
3285         [Win][Direct2D] Create a RAII Helper Class for the Render Target
3286         https://bugs.webkit.org/show_bug.cgi?id=164005
3287
3288         Reviewed by Alex Christensen.
3289
3290         Tested by existing SVG, image, and Canvas layout tests.
3291
3292         * platform/graphics/GraphicsContext.h:
3293         * platform/graphics/win/GradientDirect2D.cpp:
3294         (WebCore::Gradient::fill): Use new convenience helper class.
3295         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3296         (WebCore::GraphicsContext::didBeginDraw):
3297         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
3298         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): Add an
3299         assertion that we are in a valid state when cleaning up the graphics context.
3300         (WebCore::GraphicsContextPlatformPrivate::clip): Clipping can only happen in a Draw operation.
3301         Open a new BeginDraw if asked to Clip. The Begin must stay active when this method returns,
3302         as the Clip layer is only valid during a Draw operation.
3303         (WebCore::GraphicsContextPlatformPrivate::beginDraw): Added.
3304         (WebCore::GraphicsContextPlatformPrivate::endDraw): Added.
3305         (WebCore::GraphicsContext::beginDrawIfNeeded): Added.
3306         (WebCore::GraphicsContext::endDraw): Added.
3307         (WebCore::GraphicsContext::drawWithoutShadow): Revise to use new RenderTargetHelper class.
3308         (WebCore::GraphicsContext::drawWithShadow): Ditto.
3309         (WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
3310         (WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
3311         (WebCore::GraphicsContext::setDidBeginDraw): Deleted.
3312         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
3313         (WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Revise to use count instead of
3314         a separate boolean.
3315         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
3316         (WebCore::ImageBufferData::getData): Revise to use new RenderTargetHelper class.
3317         * platform/graphics/win/NativeImageDirect2D.cpp:
3318         (WebCore::drawNativeImage): Ditto.
3319         * platform/graphics/win/RenderTargetHelper.h: Added.
3320         (WebCore::RenderTargetHelper::RenderTargetHelper):
3321         (WebCore::RenderTargetHelper::~RenderTargetHelper):
3322         (WebCore::RenderTargetHelper::endDraw):
3323         * svg/graphics/SVGImage.cpp:
3324         (WebCore::SVGImage::nativeImage): Revise to use new RenderTargetHelper class.
3325
3326 2016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3327
3328         Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
3329         https://bugs.webkit.org/show_bug.cgi?id=163948
3330         <rdar://problem/28921433>
3331
3332         Reviewed by Darin Adler.
3333
3334         Implements support for "insertFromDrop" and "deleteByDrag" inputTypes. These are fired when dragging and
3335         dropping text in editable areas. To do this, we introduce EditActionInsertFromDrop and EditActionDeleteByDrag
3336         (renamed from EditActionDrag, which is no longer necessary after this patch).
3337
3338         When moving text from an editable element to another, we will use a DeleteSelectionCommand to delete the text
3339         from the source element and a ReplaceSelectionCommand to insert the text into the destination element. This
3340         means that we currently fire two input events on the source and destination elements (i.e. given by the start
3341         and end selections) after both child editing commands of the MoveSelectionCommand have been applied. Instead, we
3342         need to fire events in this order:
3343
3344         1. beforeinput ("deleteByDrag") on the source
3345         2. Update DOM
3346         3. input ("deleteByDrag") on the source
3347
3348         4. beforeinput ("insertFromDrop") on the destination
3349         5. Update DOM
3350         6. input ("insertFromDrop") on the destination
3351
3352         To accomplish this, we allow an edit command to defer dispatching input events to its child commands via
3353         CompositeEditCommand::shouldDispatchInputEvents, which the MoveSelectionCommand overrides. Additionally,
3354         when applying the MoveSelectionCommand, we now apply() the child DeleteSelectionCommand and
3355         ReplaceSelectionCommand instead of using doApply(). This allows these children to separately dispatch input
3356         events, and also handle preventDefault() separately.
3357
3358         Tests: fast/events/before-input-events-prevent-drag-and-drop.html
3359                fast/events/input-events-drag-and-drop.html
3360                fast/events/input-events-insert-by-drop.html
3361
3362         * editing/CompositeEditCommand.cpp:
3363         (WebCore::CompositeEditCommand::apply):
3364         (WebCore::CompositeEditCommand::composition):
3365
3366         Searches for the top-level command and returns its composition. Also ASSERTs that the m_command of all child
3367         commands along the way is null. In places where we used to ASSERT that command.composition() should be null, we
3368         now perform the assertion here instead.
3369
3370         * editing/CompositeEditCommand.h:
3371         (WebCore::CompositeEditCommand::shouldDispatchInputEvents):
3372
3373         This is true by default, which means that if apply() is called for a composite edit command that does not
3374         override this to return false, it will try to dispatch input events. In most cases, the parent command will call
3375         on the child command to doApply(), bypassing this check.
3376
3377         (WebCore::CompositeEditCommand::composition): Deleted.
3378         * editing/EditAction.h:
3379         * editing/EditCommand.cpp:
3380         (WebCore::inputTypeNameForEditingAction):
3381         (WebCore::EditCommand::isEditingTextAreaOrTextInput):
3382         (WebCore::EditCommand::setStartingSelection):
3383         (WebCore::EditCommand::setEndingSelection):
3384         (WebCore::EditCommand::setParent):
3385         * editing/Editor.cpp:
3386         (WebCore::Editor::willApplyEditing):
3387         (WebCore::Editor::appliedEditing):
3388
3389         After applying editing, only adjust the current selection and notify clients of selection change if the applied
3390         command was a top-level command; otherwise, these actions should wait until all child commands of the top-level
3391         command have been applied. In particular, we should not register the applied command as an undo step.
3392
3393         * editing/MoveSelectionCommand.cpp:
3394         (WebCore::MoveSelectionCommand::doApply):
3395         (WebCore::MoveSelectionCommand::editingAction):
3396         * editing/MoveSelectionCommand.h:
3397         * page/DragController.cpp:
3398         (WebCore::DragController::concludeEditDrag):
3399
3400         For the cases where we're not deleting text from the drag source (i.e. we're just applying a
3401         ReplaceSelectionCommand) pass in EditActionInsertFromDrop as the EditAction when creating the command.
3402
3403 2016-10-27  Per Arne Vollan  <pvollan@apple.com>
3404
3405         [Win][Direct2D] Implement GraphicsContext::releaseWindowsContext.
3406         https://bugs.webkit.org/show_bug.cgi?id=163988
3407
3408         Reviewed by Brent Fulgham.
3409
3410         This method is needed to draw native controls.
3411
3412         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3413         (WebCore::GraphicsContext::releaseWindowsContext):
3414
3415 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
3416
3417         Web Inspector: Worker should recover if Inspector is closed and never sent Worker.initialized command
3418         https://bugs.webkit.org/show_bug.cgi?id=164073
3419
3420         Reviewed by Brian Burg.
3421
3422         Test: inspector/worker/worker-recover-if-inspector-close.html
3423
3424         * workers/WorkerInspectorProxy.cpp:
3425         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
3426         Ensure we stop the debugger only task loop if needed when the last debugger
3427         message comes in.
3428
3429 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
3430
3431         Web Inspector: Include ConsoleAgent in Workers - real console.log support
3432         https://bugs.webkit.org/show_bug.cgi?id=163844
3433         <rdar://problem/28903328>
3434
3435         Reviewed by Brian Burg.
3436
3437         Test: inspector/worker/console-basic.html
3438
3439         This introduces a real ConsoleAgent in the Worker InspectorController.
3440         We no longer need to pass partial ConsoleMessage objects to be logged
3441         through the Page, we can just send the full ConsoleMessages to a
3442         frontend once it connects to the Worker.
3443
3444         In order to guarantee that the Worker InspectorController is properly
3445         all Workers will start paused if there is an Inspector attached to
3446         the Page. The frontend _must_ call the new Worker.initialized method
3447         after sending its setup commands to the Worker. This ensures we get
3448         handle all initialization commands (like Agent.enable(), and
3449         setting state like breakpoints) before any script executes in the
3450         Worker. This mirrors the Inspector.initialized method that does the
3451         same thing for JSContext auto-attach of the Main target.
3452
3453         In the backend, the wait until initialized state is just running
3454         the WorkerThread's RunLoop in a special debugger mode to only process
3455         debugger commands until we are ready. This will effectively be
3456         the same as pausing so it is generalized into WorkerThread.
3457
3458         * CMakeLists.txt:
3459         * WebCore.xcodeproj/project.pbxproj:
3460         * inspector/InspectorAllInOne.cpp:
3461         New files.
3462
3463         * inspector/InspectorWorkerAgent.cpp:
3464         (WebCore::InspectorWorkerAgent::initialized):
3465         (WebCore::InspectorWorkerAgent::shouldWaitForDebuggerOnStart):
3466         * inspector/InspectorWorkerAgent.h:
3467         Add the new initialized method. This just uses the proxy to send
3468         a message to be handled on the Worker Thread and unpause.
3469
3470         * inspector/WorkerConsoleAgent.cpp:
3471         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
3472         (WebCore::WorkerConsoleAgent::addInspectedNode):
3473         * inspector/WorkerConsoleAgent.h:
3474         * inspector/WorkerInspectorController.cpp:
3475         (WebCore::WorkerInspectorController::WorkerInspectorController):
3476         Add a ConsoleAgent to WorkerInspectorController.
3477
3478         * workers/WorkerInspectorProxy.h:
3479         * workers/WorkerInspectorProxy.cpp:
3480         (WebCore::WorkerInspectorProxy::workerStartMode):
3481         (WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
3482         (WebCore::WorkerInspectorProxy::connectToWorkerInspector):
3483         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspector):
3484         (WebCore::WorkerInspectorProxy::sendMessageToWorkerInspector):
3485         Use the debugger mode when sending messages to the WorkerThread.
3486
3487         * workers/Worker.cpp:
3488         (WebCore::Worker::notifyFinished):
3489         * workers/WorkerMessagingProxy.cpp:
3490         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
3491         (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject): Deleted.
3492         * workers/WorkerMessagingProxy.h:
3493         * workers/WorkerReportingProxy.h:
3494         * workers/WorkerGlobalScope.cpp:
3495         (WebCore::WorkerGlobalScope::addConsoleMessage):
3496         (WebCore::WorkerGlobalScope::addMessage):
3497         * workers/WorkerGlobalScope.h:
3498         * workers/WorkerGlobalScopeProxy.h:
3499         Remove legacy partial console support.
3500
3501         * workers/WorkerRunLoop.h:
3502         * workers/WorkerRunLoop.cpp:
3503         (WebCore::WorkerRunLoop::debuggerMode):
3504         * workers/WorkerThread.h:
3505         * workers/WorkerThread.cpp:
3506         (WebCore::WorkerThread::workerThread):
3507         (WebCore::WorkerThread::startRunningDebuggerTasks):
3508         (WebCore::WorkerThread::stopRunningDebuggerTasks):
3509         General code for spinning the WorkerThread and only processing debugger
3510         (Inspector) commands. Use this when starting the thread to ensure the
3511         frontend initializes the Worker's Agents before any JavaScript executes.
3512
3513         * page/PageConsoleClient.cpp:
3514         * workers/WorkerConsoleClient.cpp:
3515         (WebCore::WorkerConsoleClient::count):
3516         (WebCore::WorkerConsoleClient::time):
3517         (WebCore::WorkerConsoleClient::timeEnd):
3518         * inspector/InspectorConsoleInstrumentation.h: Removed.
3519         * inspector/InspectorInstrumentation.cpp:
3520         (WebCore::InspectorInstrumentation::startConsoleTimingImpl):
3521         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
3522         (WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStartImpl):
3523         * inspector/InspectorInstrumentation.h:
3524         (WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
3525         (WebCore::InspectorInstrumentation::addMessageToConsole):
3526         (WebCore::InspectorInstrumentation::consoleCount):
3527         (WebCore::InspectorInstrumentation::takeHeapSnapshot):
3528         (WebCore::InspectorInstrumentation::startConsoleTiming):
3529         (WebCore::InspectorInstrumentation::stopConsoleTiming):
3530         (WebCore::InspectorInstrumentation::consoleTimeStamp):
3531         (WebCore::InspectorInstrumentation::startProfiling):
3532         (WebCore::InspectorInstrumentation::stopProfiling):
3533         Implement a few more basic console APIs that required ConsoleAgent.
3534
3535 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
3536
3537         Web Inspector: Include RuntimeAgent in Workers - evaluate in Worker context
3538         https://bugs.webkit.org/show_bug.cgi?id=163835
3539         <rdar://problem/28901465>
3540
3541         Reviewed by Brian Burg.
3542
3543         Tests: inspector/unit-tests/target-manager.html
3544                inspector/worker/runtime-basic.html
3545
3546         * CMakeLists.txt:
3547         * WebCore.xcodeproj/project.pbxproj:
3548         * inspector/InspectorAllInOne.cpp:
3549         New file.
3550
3551         * inspector/InspectorWebAgentBase.h:
3552         (WebCore::WorkerAgentContext::WorkerAgentContext):
3553         New agent context creation struct for Workers.
3554
3555         * inspector/WorkerInspectorController.cpp:
3556         (WebCore::WorkerInspectorController::WorkerInspectorController):
3557         Create a RuntimeAgent for Workers.
3558
3559         * inspector/WorkerRuntimeAgent.cpp: Added.
3560         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
3561         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
3562         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
3563         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
3564         * inspector/WorkerRuntimeAgent.h: Added.
3565         Workers currently only ever have a single execution context.
3566
3567 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
3568
3569         Web Inspector: Introduce Page WorkerAgent and Worker InspectorController
3570         https://bugs.webkit.org/show_bug.cgi?id=163817
3571         <rdar://problem/28899063>
3572
3573         Reviewed by Brian Burg.
3574
3575         Test: inspector/worker/worker-create-and-terminate.html
3576
3577         From the perspective of an Inspector frontend, Workers are
3578         like a special JavaScript context, separate from the page, that
3579         may have its own set of Agents. This patch adds the necessary
3580         backend infrastructure to provide WorkerGlobalObject with an
3581         InspectorController and the means to communicate with a frontend
3582         through a Page's WorkerAgent.
3583
3584         Pages now get a WorkerAgent. This informs the frontend about
3585         created and terminated Workers. It also provides a communication
3586         channel to dispatch and return inspector protocol messages to
3587         each of the Workers. The Page side always interacts with the
3588         WorkerInspectorProxy on the main thread. The Page's Worker Agent
3589         can sends and receives messages to WorkerInspectorControllers.
3590
3591         WorkerGlobalScopes now get a WorkerInspectorController which
3592         will eventually contain its own set of agents. There are no
3593         agents yet, but they will be added individually in follow-up
3594         patches. The Worker side always interacts with the
3595         WorkerGlobalScope on the worker thread. WorkerInspectorController
3596         dispatches messages on its agents.
3597
3598         All communication with Worker agents goes through Worker.sendMessageToWorker,
3599         which tunnels the command request to the Worker's InspectorController
3600         and agents. At the protocol level, worker agent command responses and
3601         worker agent events are sent as events through Worker.dispatchMessageFromWorker.
3602         On the frontend, the message dispatcher code will pair up replies with
3603         their commands, and no-reply messages as events, like normal. So calling
3604         worker agent methods in the frontend will be no different from the
3605         existing callback/promise-based ways.
3606
3607         * CMakeLists.txt:
3608         * WebCore.xcodeproj/project.pbxproj:
3609         * inspector/InspectorAllInOne.cpp:
3610         Add new files.
3611
3612         * bindings/js/WorkerScriptController.cpp:
3613         (WebCore::WorkerScriptController::WorkerScriptController):
3614         (WebCore::WorkerScriptController::initScript):
3615         * bindings/js/WorkerScriptController.h:
3616         Some cleanup.
3617
3618         * inspector/InspectorController.cpp:
3619         (WebCore::InspectorController::InspectorController):
3620         * inspector/InspectorController.h:
3621         * inspector/InstrumentingAgents.cpp:
3622         (WebCore::InstrumentingAgents::reset):
3623         * inspector/InstrumentingAgents.h:
3624         (WebCore::InstrumentingAgents::inspectorWorkerAgent):
3625         (WebCore::InstrumentingAgents::setInspectorWorkerAgent):
3626         * inspector/InspectorInstrumentation.cpp:
3627         (WebCore::InspectorInstrumentation::workerStartedImpl):
3628         (WebCore::InspectorInstrumentation::workerTerminatedImpl):
3629         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
3630         * inspector/InspectorInstrumentation.h:
3631         (WebCore::InspectorInstrumentation::workerStarted):
3632         (WebCore::InspectorInstrumentation::workerTerminated):
3633         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
3634         Give the Page a WorkerAgent and Instrumentation methods for
3635         Worker creation and termination.
3636
3637         * inspector/InspectorWorkerAgent.h: Added.
3638         * inspector/InspectorWorkerAgent.cpp: Added.
3639         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
3640         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
3641         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
3642         (WebCore::InspectorWorkerAgent::enable):
3643         (WebCore::InspectorWorkerAgent::disable):
3644         (WebCore::InspectorWorkerAgent::workerStarted):
3645         (WebCore::InspectorWorkerAgent::workerTerminated):
3646         (WebCore::InspectorWorkerAgent::connectToAllWorkerInspectorProxiesForPage):
3647         (WebCore::InspectorWorkerAgent::disconnectFromAllWorkerInspectorProxies):
3648         (WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
3649         (WebCore::InspectorWorkerAgent::disconnectFromWorkerInspectorProxy):
3650         Handle connecting to Workers. This performs the "connectFrontend"
3651         and "disconnectFrontend" dance with each Worker's InspectorController.
3652         We only connect to workers when the Worker domain is enabled.
3653
3654         (WebCore::InspectorWorkerAgent::sendMessageToWorker):
3655         (WebCore::InspectorWorkerAgent::sendMessageFromWorkerToFrontend):
3656         Proxying messages to individual messages happens through the
3657         WorkerInspectorProxy. That takes care of passing messages
3658         across threads for us.
3659
3660         * workers/WorkerInspectorProxy.cpp: Added.
3661         (WebCore::WorkerInspectorProxy::allWorkerInspectorProxies):
3662         (WebCore::WorkerInspectorProxy::WorkerInspectorProxy):
3663         (WebCore::WorkerInspectorProxy::~WorkerInspectorProxy):
3664         (WebCore::WorkerInspectorProxy::workerStarted):
3665         (WebCore::WorkerInspectorProxy::workerTerminated):
3666         (WebCore::WorkerInspectorProxy::connectToWorkerInspector):
3667         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspector):
3668         (WebCore::WorkerInspectorProxy::sendMessageToWorkerInspector):
3669         (WebCore::WorkerInspectorProxy::sendMessageFromWorkerToFrontend):
3670         * workers/WorkerInspectorProxy.h: Added.
3671         (WebCore::WorkerInspectorProxy::PageChannel::~PageChannel):
3672         (WebCore::WorkerInspectorProxy::url):
3673         (WebCore::WorkerInspectorProxy::identifier):
3674         (WebCore::WorkerInspectorProxy::scriptExecutionContext):
3675         The WorkerInspectorProxy simplifies the cross thread communication
3676         between the Page Inspector and Worker Inspector. It also provides
3677         a clean interface between the two sides.
3678
3679         * inspector/WorkerToPageFrontendChannel.h: Added.
3680         * inspector/WorkerInspectorController.h: Added.
3681         * inspector/WorkerInspectorController.cpp: Added.
3682         (WebCore::WorkerInspectorController::WorkerInspectorController):
3683         (WebCore::WorkerInspectorController::~WorkerInspectorController):
3684         (WebCore::WorkerInspectorController::workerTerminating):
3685         (WebCore::WorkerInspectorController::connectFrontend):
3686         (WebCore::WorkerInspectorController::disconnectFrontend):
3687         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
3688         (WebCore::WorkerInspectorController::functionCallHandler):
3689         (WebCore::WorkerInspectorController::evaluateHandler):
3690         (WebCore::WorkerInspectorController::vm):
3691         A basic InspectorController for a WorkerGlobalScope.
3692         No agents yet, they will come soon.
3693
3694         * inspector/WorkerScriptDebugServer.h:
3695         * inspector/WorkerScriptDebugServer.cpp:
3696         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
3697         (WebCore::WorkerScriptDebugServer::attachDebugger):
3698         (WebCore::WorkerScriptDebugServer::detachDebugger):
3699         (WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
3700         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
3701         (WebCore::WorkerScriptDebugServer::reportException):
3702         (WebCore::WorkerScriptDebugServer::interruptAndRunTask):
3703         A basic WorkerScriptDebug server for a WorkerGlobalScope.
3704         Not really used until we implement DebuggerAgent, but needed for InspectorEnvironment.
3705
3706         * workers/WorkerGlobalScope.cpp:
3707         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
3708         * workers/WorkerGlobalScope.h:
3709         (WebCore::WorkerGlobalScope::inspectorController):
3710         Give the WorkerGlobalScope an InspectorController.
3711
3712         * workers/WorkerThread.cpp:
3713         (WebCore::WorkerThread::stop):
3714         Ensure the Worker InspectorController is immediately on
3715         the WorkerThread when it is about to be closed.
3716
3717         * workers/WorkerMessagingProxy.cpp:
3718         (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
3719         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
3720         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
3721         (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal):
3722         (WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope):
3723         * workers/WorkerMessagingProxy.h:
3724         * workers/WorkerReportingProxy.h:
3725         Call into the WorkerInspectorProxy for any inspector related logic,
3726         such as creation, termination, and messages received from the Worker.
3727
3728 2016-10-27  Dave Hyatt  <hyatt@apple.com>
3729
3730         [CSS Parser] Implement CSS variables
3731         https://bugs.webkit.org/show_bug.cgi?id=164075
3732
3733         Reviewed by Dean Jackson.
3734
3735         * CMakeLists.txt:
3736         * WebCore.xcodeproj/project.pbxproj:
3737         Add CSSCustomPropertyValue.cpp to the project.
3738
3739         * css/CSSCustomPropertyValue.cpp: Added.
3740         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles):
3741         (WebCore::CSSCustomPropertyValue::resolveVariableReferences):
3742         * css/CSSCustomPropertyValue.h:
3743         These functions abstract the old and new implementations of CSS
3744         variables so that the callers don't have to worry about it.
3745
3746         * css/CSSValue.cpp:
3747         (WebCore::CSSValue::equals):
3748         Make sure CSSVariableReferenceValue and CSSPendingSubstitutionValue
3749         have equals implemented.
3750
3751         (WebCore::CSSValue::isInvalidCustomPropertyValue): Deleted.
3752         This code was dead and never called.
3753
3754         * css/CSSValue.h:
3755         (WebCore::CSSValue::isCustomPropertyValue):
3756         (WebCore::CSSValue::hasVariableReferences):
3757         Add a helper function for asking if a CSSValue has variable references.
3758         This abstracts the old and new implementations so that callers can
3759         ask if the value has variables without caring which implementation is
3760         being used.
3761
3762         * css/CSSValueList.cpp:
3763         (WebCore::CSSValueList::checkVariablesForCycles):
3764         * css/CSSValueList.h:
3765         In order to abstract the old and new variables implementations, custom
3766         properties now store CSSCustomPropertyValue as their values instead of
3767         raw values. The old implementation needs to be patched to deal with this
3768         wrapper being present now.
3769
3770         * css/CSSVariableData.cpp:
3771         (WebCore::CSSVariableData::checkVariablesForCycles):
3772         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
3773         (WebCore::CSSVariableData::resolveVariableFallback):
3774         (WebCore::CSSVariableData::resolveVariableReference):
3775         (WebCore::CSSVariableData::resolveVariableReferences):
3776         (WebCore::CSSVariableData::resolveTokenRange):
3777         * css/CSSVariableData.h:
3778         Implementation of cycle checking and variable resolution. The logic of
3779         this implementation is the same as the old. It walks CSSParserTokens
3780         instead of the old CSSParser structures.
3781
3782         * css/CSSVariableReferenceValue.cpp:
3783         (WebCore::CSSVariableReferenceValue::customCSSText):
3784         Add support for serialization caching, just like the old implementation
3785         had in CSSVariableDependentValue.
3786
3787         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles):
3788         * css/CSSVariableReferenceValue.h:
3789         Add cycle checking and variable resolution helper functions.
3790
3791         * css/CSSVariableValue.cpp:
3792         (WebCore::CSSVariableValue::buildParserValueListSubstitutingVariables):
3793         Patched to account for the change in storage of custom properties to
3794         have custom property value wrappers.
3795
3796         * css/StyleProperties.cpp:
3797         (WebCore::StyleProperties::getPropertyValue):
3798         (WebCore::StyleProperties::borderSpacingValue):
3799         (WebCore::StyleProperties::getLayeredShorthandValue):
3800         (WebCore::StyleProperties::getShorthandValue):
3801         (WebCore::StyleProperties::getCommonValue):
3802         (WebCore::StyleProperties::getPropertyCSSValue):
3803         (WebCore::StyleProperties::asText):
3804         Clean up the resolution of pending substitution values. Instead of hacking
3805         it into every possible StyleShorthandProperty crawling function, obtain
3806         the shorthand for the property up front, access the first longhand, and
3807         if we see a pending substitution value, perform the substitution.
3808
3809         * css/StyleResolver.cpp:
3810         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
3811         (WebCore::StyleResolver::applyProperty):
3812         (WebCore::StyleResolver::resolvedVariableValue):
3813         * css/StyleResolver.h:
3814         Add support for the new implementation in all the same places as the old.
3815
3816         * css/parser/CSSParser.cpp:
3817         (WebCore::CSSParser::parseInlineStyleDeclaration):
3818         (WebCore::CSSParser::parseValueWithVariableReferences):
3819         (WebCore::CSSParser::parseVariableDependentValue): Deleted.
3820         * css/parser/CSSParser.h:
3821         Rename parseVariableDependentValue to parseValueWithVariableReferences,
3822         since it is operating on three distinct value types now. Turn on new
3823         parser support for parseInlineStyleDeclaration.
3824
3825         * css/parser/CSSParserImpl.cpp:
3826         (WebCore::filterProperties):
3827         (WebCore::CSSParserImpl::parseVariableValue): Deleted.
3828         (WebCore::CSSParserImpl::parseCustomPropertySet): Deleted.
3829         * css/parser/CSSParserImpl.h:
3830         Remove parser functions that aren't relevant to our implementation
3831         of CSS variables.
3832
3833         * css/parser/CSSVariableParser.cpp:
3834         (WebCore::classifyVariableRange):
3835         Add support for the CSS4 'revert' keyword to the new variable parser.
3836
3837         * rendering/style/RenderStyle.cpp:
3838         (WebCore::RenderStyle::checkVariablesInCustomProperties):
3839         Modified to store CSSCustomPropertyValues as the values always now and
3840         to use the method abstractions on CSSCustomPropertyValue to resolve
3841         cycles and perform substitutions.
3842
3843         * rendering/style/RenderStyle.h:
3844         (WebCore::RenderStyle::setCustomPropertyValue):
3845         (WebCore::RenderStyle::getCustomPropertyValue):
3846         * rendering/style/StyleCustomPropertyData.h:
3847         (WebCore::StyleCustomPropertyData::operator==):
3848         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
3849         (WebCore::StyleCustomPropertyData::getCustomPropertyValue):
3850         Tighten up the map to store CSSCustomPropertyValue instead of just
3851         CSSValue.
3852
3853 2016-10-27  Zalan Bujtas  <zalan@apple.com>
3854
3855         RenderMultiColumnFlowThread::processPossibleSpannerDescendant should take RenderObject& instead of RenderObject*
3856         https://bugs.webkit.org/show_bug.cgi?id=164072
3857
3858         Reviewed by Simon Fraser.
3859
3860         No change in functionality.
3861
3862         * rendering/RenderFlowThread.h:
3863         * rendering/RenderMultiColumnFlowThread.cpp:
3864         (WebCore::findSetRendering):
3865         (WebCore::isValidColumnSpanner):
3866         (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
3867         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
3868         (WebCore::RenderMultiColumnFlowThread::findSetRendering): Deleted.
3869         * rendering/RenderMultiColumnFlowThread.h:
3870         * rendering/RenderMultiColumnSet.cpp:
3871         (WebCore::precedesRenderer):
3872         (WebCore::RenderMultiColumnSet::containsRendererInFlowThread):
3873         * rendering/RenderMultiColumnSet.h:
3874         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
3875         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
3876         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
3877         * rendering/RenderMultiColumnSpannerPlaceholder.h:
3878         * rendering/RenderObject.cpp:
3879         (WebCore::RenderObject::insertedIntoTree):
3880
3881 2016-10-27  Brent Fulgham  <bfulgham@apple.com>
3882
3883         Prevent hit tests from being performed on an invalid render tree
3884         https://bugs.webkit.org/show_bug.cgi?id=163877
3885         <rdar://problem/28675761>
3886
3887         Reviewed by Simon Fraser.
3888
3889         Changeset r200971 added code to ensure that layout is up-to-date before hit testing, but did
3890         so only for the main frame. It was still possible to enter cross-frame hit testing with a
3891         subframe needing style recalc. In that situation, the subframe's updateLayout() would get
3892         called, which could trigger a compositing change that marked the parent frame as needing style
3893         recalc. A subsequent layout on the parent frame (for example by hit testing traversing into
3894         a second subframe) could then mutate the parent frame's layer tree while hit testing was
3895         traversing it.
3896         
3897         This patch modifies the hit test logic to ensure that a recursive layout is performed so that
3898         we always perform hit tests on a clean set of frames. It also adds some assertions to warn
3899         us if we encounter this invalid state.
3900
3901         Tested by fast/layers/prevent-hit-test-during-layout.html.
3902
3903         * dom/Document.cpp:
3904         (WebCore::Document::scheduleStyleRecalc): Assert that we are not hit testing
3905         during style recalculation.
3906         * page/EventHandler.cpp:
3907         (WebCore::EventHandler::hitTestResultAtPoint): Ensure that we have a clean render tree
3908         when hit testing.
3909         * page/FrameView.cpp:
3910         (WebCore::FrameView::setNeedsLayout): Assert that we are not in the process of hit testing
3911         when we schedule a layout.
3912         * rendering/RenderView.cpp:
3913         (WebCore::RenderView::hitTest): Mark RenderView as in an active hit test.
3914         * rendering/RenderView.h:
3915
3916 2016-10-27  Zan Dobersek  <zdobersek@igalia.com>
3917
3918         BufferSource should behave as an union
3919         https://bugs.webkit.org/show_bug.cgi?id=164056
3920
3921         Reviewed by Chris Dumez.
3922
3923         WebIDL typedefs BufferSource as (ArrayBufferView or ArrayBuffer).
3924         To follow that definition, IDLBufferSource is now type-aliased
3925         to IDLUnion<IDLInterface<ArrayBufferView>, IDLInterface<ArrayBuffer>>.
3926
3927         Converter<IDLBufferSource> template specialization can now be
3928         removed since the default specialization for IDLUnion will be
3929         used.
3930
3931         C++ implementations still work through a BufferSource object.
3932         That class now has an implicit constructor that consumes the
3933         Variant object. The data() and length() methods on the class
3934         now iterate the variant to find an existing object that can
3935         provide a pointer to the data or the length of it.
3936
3937         * Modules/mediasource/SourceBuffer.cpp:
3938         (WebCore::SourceBuffer::appendBuffer):
3939         * bindings/generic/IDLTypes.h:
3940         * bindings/js/BufferSource.h:
3941         (WebCore::BufferSource::BufferSource):
3942         (WebCore::BufferSource::data):
3943         (WebCore::BufferSource::length):
3944         * bindings/js/JSDOMConvert.h:
3945         (WebCore::Converter<IDLBufferSource>::convert): Deleted.
3946
3947 2016-10-27  Chris Dumez  <cdumez@apple.com>
3948
3949         Merge Element::ShadowRootMode and ShadowRoot::Mode enumerations
3950         https://bugs.webkit.org/show_bug.cgi?id=164063
3951
3952         Reviewed by Sam We