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