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