b9ad3510b95b126118a60f0686602c63b3c7e919
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Safari does not emit composition end if blurred for dead key / Japanese IME
4         https://bugs.webkit.org/show_bug.cgi?id=164369
5         <rdar://problem/29050439>
6
7         Reviewed by Ryosuke Niwa.
8
9         On Mac, _before_ changing selection, try to finalize the composition by calling Editor::cancelComposition early.
10         This is because the focused element may have changed after performing the selection change, so we would
11         otherwise be dispatching the `compositionend` to the new focused element (or no compositionend at all) instead
12         of the element with the composition.
13
14         Doing this allows us to match Chrome and Firefox behavior. After canceling the composition, we then need to also
15         clear the system IME state. We do this on Mac WK1/WK2 through the cancelComposition() codepath, which ends up
16         calling into -discardMarkedText, which resets the marked text state. Some minor refactoring was performed to
17         accomplish this -- currently, discardedComposition sends a CompositionWasCanceled message over to the UI process
18         that discards the marked text, and then updates the editor state. This patch splits this into two separate
19         steps -- see the WebKit2 ChangeLog for more details.
20
21         Test: fast/events/ime-compositionend-on-selection-change.html
22
23         * editing/Editor.cpp:
24         (WebCore::Editor::selectionWillChange):
25         * editing/Editor.h:
26         * editing/FrameSelection.cpp:
27         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
28         * editing/mac/EditorMac.mm:
29         (WebCore::Editor::selectionWillChange):
30         * loader/EmptyClients.h:
31         * page/EditorClient.h:
32
33 2016-11-04  Brady Eidson  <beidson@apple.com>
34
35         IndexedDB 2.0: Clean up more transaction abort and exception throwing behavior from IDBObjectStore.
36         https://bugs.webkit.org/show_bug.cgi?id=164424
37
38         Reviewed by Alex Christensen.
39
40         No new tests (Covered by existing tests).
41
42         This patch actually turns a handful of PASS to FAIL in the imported tests, but those are parts of the
43         spec in flux/under discussion.
44
45         We'll update either source or the tests as things are resolved.
46
47         * Modules/indexeddb/IDBIndex.cpp:
48         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
49
50         * Modules/indexeddb/IDBObjectStore.cpp:
51         (WebCore::IDBObjectStore::get):
52         (WebCore::IDBObjectStore::putOrAdd):
53         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
54
55 2016-11-04  Ryosuke Niwa  <rniwa@webkit.org>
56
57         Load stylesheets in link elements inside a connected shadow tree
58         https://bugs.webkit.org/show_bug.cgi?id=160683
59         <rdar://problem/29040652>
60
61         Reviewed by Antti Koivisto.
62
63         Allow external stylesheets within a shadow tree by storing the appropriate style scope in HTMLLinkElement
64         when it's connected to a document instead of always talking to document's style scope.
65
66         Tests: fast/shadow-dom/link-element-in-shadow-tree.html
67                fast/shadow-dom/selected-stylesheet-in-shadow-tree.html
68
69        * html/HTMLLinkElement.cpp:
70        (WebCore::HTMLLinkElement::HTMLLinkElement):
71        (WebCore::HTMLLinkElement::~HTMLLinkElement):
72        (WebCore::HTMLLinkElement::setDisabledState): Exit early when the element is not in a document as invoking
73        didChangeActiveStyleSheetCandidates would require having a valid m_styleScope and process() already exits
74        early when inDocument() is false.
75        (WebCore::HTMLLinkElement::parseAttribute):
76        (WebCore::HTMLLinkElement::process): Removed the early exit for when the element is in a shadow tree.
77        (WebCore::HTMLLinkElement::insertedInto): Exit early unless this element has just become connected to
78        a document instead of whenever its self-inclusive ancestor is inserted into a container.
79        (WebCore::HTMLLinkElement::removedFrom): Ditto for removal. Also call removeStyleSheetCandidateNode after
80        calling removePendingSheet since the latter depends on m_styleScope being not null.
81        (WebCore::HTMLLinkElement::addPendingSheet):
82        (WebCore::HTMLLinkElement::removePendingSheet):
83        * html/HTMLLinkElement.h:
84        * html/HTMLStyleElement.cpp:
85        (WebCore::HTMLStyleElement::insertedInto): Only call inline style owner's insertedIntoDocument if this
86        element has just become connected to a document.
87        (WebCore::HTMLStyleElement::removedFrom): Ditto for the removal.
88        * style/StyleScope.h:
89        * svg/SVGStyleElement.cpp:
90        (WebCore::SVGStyleElement::insertedInto): Ditto.
91        (WebCore::SVGStyleElement::removedFrom): Ditto for the removal.
92
93 2016-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
94
95         Add a setting and preferences to enable/disable async image decoding
96         https://bugs.webkit.org/show_bug.cgi?id=164417
97
98         Reviewed by Simon Fraser.
99
100         Add an asyncImageDecodingEnabled setting. This setting controls whether an
101         image "can" be asynchronously decoded on a separate thread or not. The
102         function ImageSource::isAsyncDecodingRequired() will be used in conjunction
103         with this setting to decide whether an image "should" be asynchronously
104         decoded or not.
105
106         * page/Settings.in:
107
108 2016-11-04  Tim Horton  <timothy_horton@apple.com>
109
110         Apply post-landing review comments for r208347
111
112         * dom/Element.cpp:
113         (WebCore::Element::findAnchorElementForLink):
114         Use attributeWithoutSynchronization.
115
116         * page/PrintContext.cpp:
117         (WebCore::PrintContext::spoolPage):
118         (WebCore::PrintContext::spoolRect):
119         (WebCore::PrintContext::collectLinkedDestinations):
120         (WebCore::PrintContext::outputLinkedDestinations):
121         * page/PrintContext.h:
122         Pass Document by reference instead of Node by pointer,
123         use ElementTraversal instead of NodeTraversal to avoid
124         having to locally check the type, and null-check renderers.
125
126 2016-11-04  Myles C. Maxfield  <mmaxfield@apple.com>
127
128         Implement WebGL2RenderingContext::copyBufferSubData()
129         https://bugs.webkit.org/show_bug.cgi?id=164008
130
131         Reviewed by Dean Jackson.
132
133         Similar to previous work regarding WebGL 2 buffers, this method implements
134         the ability to copy from one buffer to another without the data leaving
135         the GPU.
136
137         Test: fast/canvas/webgl/copyBufferSubData.html
138
139         * html/canvas/WebGL2RenderingContext.cpp:
140         (WebCore::WebGL2RenderingContext::copyBufferSubData):
141         * html/canvas/WebGLBuffer.cpp:
142         (WebCore::WebGLBuffer::associateCopyBufferSubData):
143         * html/canvas/WebGLBuffer.h:
144         * platform/graphics/GraphicsContext3D.h:
145         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
146         (WebCore::GraphicsContext3D::copyBufferSubData):
147
148 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
149
150         Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
151         https://bugs.webkit.org/show_bug.cgi?id=164420
152
153         Reviewed by Tim Horton.
154
155         Rename:
156             commitNewTreeState -> commitTreeState ("new" was redundant)
157             updateBeforeChildren -> commitStateBeforeChildren
158             updateAfterChildren -> commitStateAfterChildren
159
160         * page/scrolling/ScrollingTree.cpp:
161         (WebCore::ScrollingTree::commitTreeState):
162         (WebCore::ScrollingTree::updateTreeFromStateNode):
163         (WebCore::ScrollingTree::commitNewTreeState): Deleted.
164         * page/scrolling/ScrollingTree.h:
165         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
166         (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
167         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren): Deleted.
168         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
169         * page/scrolling/ScrollingTreeNode.h:
170         (WebCore::ScrollingTreeNode::commitStateAfterChildren):
171         (WebCore::ScrollingTreeNode::updateAfterChildren): Deleted.
172         * page/scrolling/ScrollingTreeScrollingNode.cpp:
173         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
174         (WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren):
175         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren): Deleted.
176         (WebCore::ScrollingTreeScrollingNode::updateAfterChildren): Deleted.
177         * page/scrolling/ScrollingTreeScrollingNode.h:
178         * page/scrolling/ThreadedScrollingTree.cpp:
179         (WebCore::ThreadedScrollingTree::commitTreeState):
180         (WebCore::ThreadedScrollingTree::commitNewTreeState): Deleted.
181         * page/scrolling/ThreadedScrollingTree.h:
182         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
183         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
184         (WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren):
185         (WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateAfterChildren):
186         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren): Deleted.
187         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren): Deleted.
188         * page/scrolling/ios/ScrollingTreeIOS.cpp:
189         (WebCore::ScrollingTreeIOS::commitNewTreeState): Deleted.
190         * page/scrolling/ios/ScrollingTreeIOS.h:
191         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
192         (WebCore::ScrollingCoordinatorMac::commitTreeState):
193         * page/scrolling/mac/ScrollingTreeFixedNode.h:
194         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
195         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
196         (WebCore::ScrollingTreeFixedNode::updateBeforeChildren): Deleted.
197         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
198         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
199         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
200         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
201         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Deleted.
202         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren): Deleted.
203         * page/scrolling/mac/ScrollingTreeStickyNode.h:
204         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
205         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
206         (WebCore::ScrollingTreeStickyNode::updateBeforeChildren): Deleted.
207
208 2016-11-03  Anders Carlsson  <andersca@apple.com>
209
210         Add new 'other' Apple Pay button style
211         https://bugs.webkit.org/show_bug.cgi?id=164384
212         rdar://problem/28302528
213
214         Reviewed by Dean Jackson.
215
216         * DerivedSources.make:
217         * WebCorePrefix.h:
218         Add extension points.
219
220         * css/CSSPrimitiveValueMappings.h:
221         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
222         Add ApplePayButtonType::Other.
223
224         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
225         Add CSSValueOther.
226
227         * css/CSSValueKeywords.in:
228         Add other.
229
230         * css/parser/CSSParser.cpp:
231         (WebCore::isValidKeywordPropertyAndValue):
232         Add CSSValueOther.
233
234         * css/parser/CSSParserFastPaths.cpp:
235         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
236         Add CSSValueOther.
237
238         * rendering/RenderThemeCocoa.mm:
239         (WebCore::toPKPaymentButtonType):
240         Handle ApplePayButtonType::Other.
241
242         * rendering/style/RenderStyleConstants.h:
243         Add ApplePayButtonType::Other.
244
245 2016-11-04  Antti Koivisto  <antti@apple.com>
246
247         slotted() pseudo does not work with ID selector
248         https://bugs.webkit.org/show_bug.cgi?id=160538
249         <rdar://problem/28534529>
250
251         Reviewed by Andreas Kling.
252
253         When we saw an id selector while addin rules we immediately threw it into the m_idRules
254         optimization bucket and bailed out. However selectors containing ::slotted must always end
255         up in m_slottedPseudoElementRules list no matter what else is there.
256
257         Fix by treating id like other selectors and only choosing the bucket after analysing all
258         the selector components.
259
260         Test: fast/shadow-dom/css-scoping-slot-with-id.html
261
262         * css/RuleSet.cpp:
263         (WebCore::RuleSet::addRule): Also made this use switch instead of a series of ifs.
264
265 2016-11-04  Brady Eidson  <beidson@apple.com>
266
267         IndexedDB 2.0: Handle IDBObjectStore rename behavior properly when version change transaction aborts.
268         https://bugs.webkit.org/show_bug.cgi?id=164416
269
270         Reviewed by Beth Dakin.
271
272         No new tests (Covered by existing tests).
273
274         * Modules/indexeddb/IDBObjectStore.cpp:
275         (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
276
277 2016-11-04  Keith Rollin  <krollin@apple.com>
278
279         NetworkSession: Add NetworkDataTask implementation for blobs
280         https://bugs.webkit.org/show_bug.cgi?id=163939
281
282         Reviewed by Alex Christensen.
283
284         * WebCore.xcodeproj/project.pbxproj: Mark HTTPParsers.h and AsyncFileStream.h as private.
285         * fileapi/AsyncFileStream.h: Add WEBCORE_EXPORT to AsyncFileStream class.
286         * platform/network/BlobData.h: Add WEBCORE_EXPORT to length().
287         * platform/network/HTTPParsers.h: Add WEBCORE_EXPORT to parseRange().
288         * platform/network/ResourceResponseBase.h: Add WEBCORE_EXPORT to setHTTPHeaderField().
289
290 2016-11-04  Brady Eidson  <beidson@apple.com>
291
292         IndexedDB 2.0: Use IDB-specific exceptions in places where the generic exceptions are currently used.
293         https://bugs.webkit.org/show_bug.cgi?id=164406
294
295         Reviewed by Alex Christensen.
296
297         No new tests (Covered by existing tests).
298
299         * Modules/indexeddb/IDBIndex.cpp:
300         (WebCore::IDBIndex::setName):
301
302         * Modules/indexeddb/IDBObjectStore.cpp:
303         (WebCore::IDBObjectStore::setName):
304
305 2016-11-04  Joanmarie Diggs  <jdiggs@igalia.com>
306
307         AX: [ATK] Attempting to clear selection on ARIA listboxes results in crash
308         https://bugs.webkit.org/show_bug.cgi?id=164331
309
310         Reviewed by Chris Fleizach.
311
312         The ATK code is using is<AccessibilityListBox>() to identify native listboxes.
313         But is<AccessibilityListBox>() returns the value of isListBox() which returns
314         true both for AccessibilityListBox instances as well as for AccessibilityObject
315         instances which have an AccessibilityRole value of ListBoxRole. Because only
316         native listboxes should be AccessibilityListBoxes, add isNativeListBox() so
317         that we can distinguish native and ARIA listboxes.
318
319         Tests: accessibility/aria-listbox-clear-selection-crash.html
320                accessibility/listbox-clear-selection.html
321
322         * accessibility/AccessibilityListBox.h:
323         * accessibility/AccessibilityObject.h:
324         (WebCore::AccessibilityObject::isNativeListBox):
325         (WebCore::AccessibilityObject::isListBox):
326
327 2016-11-04  Brady Eidson  <beidson@apple.com>
328
329         IndexedDB 2.0: Throw the correct exceptions during IDBObjectStore/IDBIndex renaming.
330         https://bugs.webkit.org/show_bug.cgi?id=164405
331
332         Reviewed by Alex Christensen.
333
334         No new tests (Covered by existing tests).
335
336         * Modules/indexeddb/IDBIndex.cpp:
337         (WebCore::IDBIndex::setName):
338
339         * Modules/indexeddb/IDBObjectStore.cpp:
340         (WebCore::IDBObjectStore::setName):
341
342 2016-11-04  Romain Bellessort  <romain.bellessort@crf.canon.fr>
343
344         [Readable Streams API] Implement ByteStreamController error()
345         https://bugs.webkit.org/show_bug.cgi?id=164319
346
347         Reviewed by Youenn Fablet.
348
349         Implemented error() method of ReadableByteStreamController.
350
351         Updated test expectations for error() and added IDL-related tests.
352
353         * Modules/streams/ReadableByteStreamController.js:
354         (error): Implemented.
355         * Modules/streams/ReadableByteStreamInternals.js:
356         (privateInitializeReadableByteStreamController):
357         (isReadableByteStreamController): Added.
358         (readableByteStreamControllerError): Added.
359         (readableByteStreamControllerClearPendingPullIntos): Added.
360         * Modules/streams/ReadableStream.js:
361         (initializeReadableStream): More detailed error message.
362         * Modules/streams/ReadableStreamDefaultController.js:
363         (error): Removed unnecessary variable declaration.
364         * bindings/js/WebCoreBuiltinNames.h: Added totalQueuedBytes.
365
366 2016-11-03  Brady Eidson  <beidson@apple.com>
367
368         IndexedDB 2.0: Handle IDBIndex rename behavior properly when version change transaction aborts.
369         https://bugs.webkit.org/show_bug.cgi?id=164403
370
371         Reviewed by Alex Christensen.
372
373         No new tests (Covered by existing test).
374
375         * Modules/indexeddb/IDBIndex.cpp:
376         (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort): Only rollback the info if this index
377           already existed before this version change transaction.
378
379 2016-11-03  Youenn Fablet  <youenn@apple.com>
380
381         [WebRTC] Introduce asynchronous backend createOffer API
382         https://bugs.webkit.org/show_bug.cgi?id=164365
383
384         Reviewed by Sam Weinig.
385
386         Covered by existing tests.
387
388         Removing PeerEndpointBackendClient as it is only RTCPeerConnection.
389         This allows removing virtual for some functions.
390
391         Moving MediaEndpointPeerClient::m_client to PeerEndpointBackendClient::m_peerConnection and making it a reference.
392
393         Implementing createOffer at PeerConnectionBackend by splitting it in four sub-functions:
394         - main createOffer, implemented at PeerConnectionBackend.
395         - doCreateOffer implemented by subclasses (MediaEndpointPeerConnection).
396         - createOfferSucceeded/createOfferFailed implemented by PeerConnectionBackend.
397
398         * CMakeLists.txt:
399         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
400         (WebCore::createMediaEndpointPeerConnection):
401         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
402         (WebCore::MediaEndpointPeerConnection::doCreateOffer):
403         (WebCore::MediaEndpointPeerConnection::createOfferTask):
404         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
405         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
406         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
407         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
408         (WebCore::MediaEndpointPeerConnection::createReceiver):
409         (WebCore::MediaEndpointPeerConnection::replaceTrack):
410         (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
411         (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation):
412         (WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState):
413         (WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState):
414         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
415         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
416         (WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
417         (WebCore::MediaEndpointPeerConnection::createOffer): Deleted.
418         * Modules/mediastream/MediaEndpointPeerConnection.h:
419         * Modules/mediastream/PeerConnectionBackend.cpp:
420         (WebCore::PeerConnectionBackend::createOffer):
421         (WebCore::PeerConnectionBackend::createOfferSucceeded):
422         (WebCore::PeerConnectionBackend::createOfferFailed):
423         (WebCore::createPeerConnectionBackend): Deleted.
424         * Modules/mediastream/PeerConnectionBackend.h:
425         (WebCore::PeerConnectionBackend::PeerConnectionBackend):
426         (WebCore::PeerConnectionBackendClient::~PeerConnectionBackendClient): Deleted.
427         * Modules/mediastream/RTCPeerConnection.cpp:
428         (WebCore::RTCPeerConnection::RTCPeerConnection):
429         * Modules/mediastream/RTCPeerConnection.h:
430         * WebCore.xcodeproj/project.pbxproj:
431
432 2016-11-03  Antti Koivisto  <antti@apple.com>
433
434         REGRESSION (r207717): DumpRenderTree crashed in com.apple.WebCore: WebCore::Style::Scope::flushPendingUpdate + 16
435         https://bugs.webkit.org/show_bug.cgi?id=164397
436         <rdar://problem/29100135>
437
438         Reviewed by Ryosuke Niwa.
439
440         The problem here was that we were leaving stale pointers to Document::m_inDocumentShadowRoots set when
441         using fast-path document teardown.
442
443         (Patch and stories mostly by rniwa).
444
445         * dom/Document.cpp:
446         (WebCore::Document::~Document):
447         (WebCore::Document::didInsertInDocumentShadowRoot):
448         (WebCore::Document::didRemoveInDocumentShadowRoot):
449
450             Improve asserts.
451
452         * dom/Element.cpp:
453         (WebCore::Element::removeShadowRoot):
454
455             Remove the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to
456             avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that
457             ~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer()
458             since the latter function tears down nodes via the deletion queue during a document destruction and use
459             notifyChildNodeRemoved() on nodes that outlive the shadow root.
460
461         * dom/ShadowRoot.cpp:
462         (WebCore::ShadowRoot::~ShadowRoot):
463
464             Take care to clean up inDocumentShadowRoots for fast-pathed destruction too.
465
466         (WebCore::ShadowRoot::insertedInto):
467         (WebCore::ShadowRoot::removedFrom):
468
469             Improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from
470             m_inDocumentShadowRoots when the connected-ness changes.
471
472 2016-11-03  Simon Fraser  <simon.fraser@apple.com>
473
474         Give all the geometry classes a single-argument scale() function for consistency
475         https://bugs.webkit.org/show_bug.cgi?id=164400
476
477         Reviewed by Zalan Bujtas.
478
479         Add single-argument scale() to FloatPoint, FloatQuad, FloatSize and LayoutPoint, as well
480         as adding one to GraphicsContext. Switch callers who passed the same value for sx and sy
481         to the new functions.
482
483         * dom/Document.cpp:
484         (WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale):
485         * dom/MouseRelatedEvent.cpp:
486         (WebCore::MouseRelatedEvent::init):
487         (WebCore::MouseRelatedEvent::computeRelativePosition):
488         * dom/TreeScope.cpp:
489         (WebCore::TreeScope::nodeFromPoint):
490         * page/PrintContext.cpp:
491         (WebCore::PrintContext::spoolPage):
492         * platform/cocoa/ThemeCocoa.mm:
493         (WebCore::fitContextToBox):
494         * platform/graphics/FloatPoint.h:
495         (WebCore::FloatPoint::scale):
496         * platform/graphics/FloatQuad.h:
497         (WebCore::FloatQuad::scale):
498         * platform/graphics/FloatSize.h:
499         (WebCore::FloatSize::scale):
500         * platform/graphics/GraphicsContext.cpp:
501         (WebCore::GraphicsContext::applyDeviceScaleFactor):
502         * platform/graphics/GraphicsContext.h:
503         (WebCore::GraphicsContext::scale):
504         * platform/graphics/LayoutPoint.h:
505         (WebCore::LayoutPoint::scale):
506         * platform/graphics/ca/TileCoverageMap.cpp:
507         (WebCore::TileCoverageMap::update):
508         * platform/graphics/ca/TileGrid.cpp:
509         (WebCore::TileGrid::platformCALayerPaintContents):
510         * platform/graphics/cg/ImageBufferCG.cpp:
511         (WebCore::ImageBuffer::drawConsuming):
512         (WebCore::ImageBuffer::draw):
513         (WebCore::ImageBuffer::drawPattern):
514         * platform/mac/ThemeMac.mm:
515         (WebCore::paintToggleButton):
516         (WebCore::paintButton):
517         (WebCore::paintStepper):
518         * rendering/RenderImage.cpp:
519         (WebCore::RenderImage::nodeAtPoint):
520         * rendering/RenderMediaControls.cpp:
521         (WebCore::getUnzoomedRectAndAdjustCurrentContext):
522         * rendering/RenderThemeMac.mm:
523         (WebCore::RenderThemeMac::paintMenuList):
524         (WebCore::RenderThemeMac::paintSliderThumb):
525         (WebCore::RenderThemeMac::paintSearchField):
526         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
527         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
528         * rendering/svg/SVGInlineTextBox.cpp:
529         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
530         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
531         (WebCore::SVGInlineTextBox::paintTextWithShadows):
532         * svg/SVGPathBlender.cpp:
533         (WebCore::SVGPathBlender::blendAnimatedFloatPoint):
534         (WebCore::SVGPathBlender::blendArcToSegment):
535         * svg/SVGPathParser.cpp:
536         (WebCore::SVGPathParser::parseCurveToCubicSmoothSegment):
537         (WebCore::SVGPathParser::parseCurveToQuadraticSegment):
538         (WebCore::SVGPathParser::parseCurveToQuadraticSmoothSegment):
539         (WebCore::SVGPathParser::decomposeArcToCubic):
540         * svg/SVGSVGElement.cpp:
541         (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
542
543 2016-11-03  Antti Koivisto  <antti@apple.com>
544
545         REGRESSION (r207669): Crash under media controls shadow root construction
546         https://bugs.webkit.org/show_bug.cgi?id=164381
547         <rdar://problem/28935401>
548
549         Reviewed by Simon Fraser.
550
551         The problem is that we are running a script for media control UA shadow tree in HTMLMediaElement::insertedInto.
552         It is not safe to run scripts in insertedInto as the tree is in inconsistent state. Instead finishedInsertingSubtree
553         callback should be used.
554
555         Test: media/media-controls-shadow-construction-crash.html
556
557         Seen on https://www.theguardian.com/artanddesign/video/2013/oct/14/banksy-central-park-new-york-video
558
559         * html/HTMLMediaElement.cpp:
560         (WebCore::HTMLMediaElement::insertedInto):
561         (WebCore::HTMLMediaElement::finishedInsertingSubtree):
562
563             Move configureMediaControls() to finishedInsertingSubtree().
564
565         * html/HTMLMediaElement.h:
566         * style/StyleTreeResolver.cpp:
567         (WebCore::Style::TreeResolver::resolveComposedTree):
568
569             Add an assert to make the bad state easier to hit in tests.
570
571 2016-11-03  Ryosuke Niwa  <rniwa@webkit.org>
572
573         Add an assertion to diagnose stress GC bots test failures
574         https://bugs.webkit.org/show_bug.cgi?id=164396
575
576         Reviewed by Antti Koivisto.
577
578         Added an assertion for calling ElementQueue::add while ElementQueue::invokeAll is in progress.
579         This should never happen as long as all DOM API has an appropriate CEReactions IDL attribute.
580
581         * dom/CustomElementReactionQueue.cpp:
582         (WebCore::CustomElementReactionStack::ElementQueue::add):
583         (WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
584         * dom/CustomElementReactionQueue.h:
585
586 2016-11-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
587
588         Add the asynchronous image decoding mode
589         https://bugs.webkit.org/show_bug.cgi?id=155546
590
591         Reviewed by Simon Fraser.
592
593         The asynchronous image decoding feature targets enhancing the rendering
594         in two scenarios: the animated images and scrolling a page which large
595         images. Enabling this feature for these two scenarios will be landed
596         separately. 
597
598         The goal of the asynchronous image decoding is to have the decoded image
599         frame ready before it has to be drawn. Drawing an image does not have to
600         wait the image frame to be decoded.
601
602         * platform/graphics/BitmapImage.cpp:
603         (WebCore::BitmapImage::frameImageAtIndex): Use the negation of frameHasValidNativeImageAtIndex().
604         * platform/graphics/BitmapImage.h:
605         (WebCore::BitmapImage::frameIsBeingDecodedAtIndex): Answers whether a frame is being decoded.
606         (WebCore::BitmapImage::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
607         (WebCore::BitmapImage::frameHasInvalidNativeImageAtIndex): Deleted.
608         * platform/graphics/Image.h:
609         (WebCore::Image::newFrameNativeImageAvailableAtIndex): Notifies the image with the availability of a frame NativeImage.
610         * platform/graphics/ImageFrame.h:
611         (WebCore::ImageFrame::isBeingDecoded): Answers whether the frame is being decoded.
612         (WebCore::ImageFrame::hasValidNativeImage): Checks the validity of the frame.
613         (WebCore::ImageFrame::hasInvalidNativeImage): Deleted.
614         * platform/graphics/ImageFrameCache.cpp:
615         (WebCore::ImageFrameCache::~ImageFrameCache): Asserts the decoding loop was ended before deleting the ImageFrameCache.
616         (WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Rename this function to matches the other which take the frame index.
617         (WebCore::ImageFrameCache::setFrameMetadataAtIndex): Ditto.
618         (WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): It setts the ImageFrame's members and updates the decoded size.
619         (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Replaces the frame NativeImage and notifies the Image with the new frame.
620         (WebCore::ImageFrameCache::decodingQueue): Ensures the decoding WorkQueue is created and returns it.
621         (WebCore::ImageFrameCache::startAsyncDecodingQueue): Starts a decoding WorkQueue which loops until m_frameRequestQueue is closed.
622         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Allows ImageSource to send a request to start asynchronous frame image decoding.
623         (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Stops the decoding WorkQueue by closing m_frameRequestQueue.
624         (WebCore::ImageFrameCache::frameAtIndex): Call replaceFrameNativeImageAtIndex().
625         (WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Returns true if a request for the image frame is issued but not finished yet.
626         (WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
627         (WebCore::ImageFrameCache::setFrameNativeImage): Deleted. Was renamed to be setFrameNativeImageAtIndex.
628         (WebCore::ImageFrameCache::setFrameMetadata): Deleted. Was renamed to be setFrameMetadataAtIndex
629         (WebCore::ImageFrameCache::frameHasInvalidNativeImageAtIndex): Deleted. Was renamed to be frameHasValidNativeImageAtIndex.
630         * platform/graphics/ImageFrameCache.h:
631         (WebCore::ImageFrameCache::create): The decoding queue needs to hold a reference to this class so it can stop decoding safely without blocking.
632         (WebCore::ImageFrameCache::hasDecodingQueue): Returns true if a decoding queue has started.
633         * platform/graphics/ImageSource.cpp:
634         (WebCore::ImageSource::ImageSource): Call ImageFrameCache::create().
635         (WebCore::ImageSource::clear): Deleting the decoder is unnecessary for asynchronous decoding because ImageFrameCache manages all the memory.
636         
637         (WebCore::ImageSource::destroyDecodedData):
638         (WebCore::ImageSource::destroyDecodedDataIfNecessary):
639         (WebCore::ImageSource::ensureDecoderAvailable):
640         (WebCore::ImageSource::dataChanged):
641         (WebCore::ImageSource::isAllDataReceived):
642         (WebCore::ImageSource::isAsyncDecodingRequired): Answers the question whether the async image decoding is required for this ImageSource.
643         (WebCore::ImageSource::frameImageAtIndex):
644         * platform/graphics/ImageSource.h:
645         (WebCore::ImageSource::decodedSize):
646         (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex):
647         (WebCore::ImageSource::stopAsyncDecodingQueue):
648         (WebCore::ImageSource::isSizeAvailable):
649         (WebCore::ImageSource::frameCount):
650         (WebCore::ImageSource::repetitionCount):
651         (WebCore::ImageSource::filenameExtension):
652         (WebCore::ImageSource::hotSpot):
653         (WebCore::ImageSource::size):
654         (WebCore::ImageSource::sizeRespectingOrientation):
655         (WebCore::ImageSource::singlePixelSolidColor):
656         (WebCore::ImageSource::frameIsBeingDecodedAtIndex):
657         (WebCore::ImageSource::frameIsCompleteAtIndex):
658         (WebCore::ImageSource::frameHasAlphaAtIndex):
659         (WebCore::ImageSource::frameHasImageAtIndex):
660         (WebCore::ImageSource::frameSubsamplingLevelAtIndex):
661         (WebCore::ImageSource::frameSizeAtIndex):
662         (WebCore::ImageSource::frameBytesAtIndex):
663         (WebCore::ImageSource::frameDurationAtIndex):
664         (WebCore::ImageSource::frameOrientationAtIndex):
665          Make m_frameCache a type Ref<ImageFrameCache>. Use '->' instead of '.' when accessing its members.
666
667         (WebCore::ImageSource::frameHasValidNativeImageAtIndex): Checks the validity of a frame.
668         (WebCore::ImageSource::frameHasInvalidNativeImageAtIndex): Deleted. Was renamed to be frameHasValidNativeImageAtIndex.
669
670 2016-11-03  Myles C. Maxfield  <mmaxfield@apple.com>
671
672         [WebGL2] Implement getBufferSubData()
673         https://bugs.webkit.org/show_bug.cgi?id=164111
674
675         Reviewed by Dean Jackson.
676
677         The call exists in OpenGL 3.2 but in order to have parity with
678         OpenGL ES 3 we back it with glMapBufferRange() instead.
679
680         This patch simply adds surface area to GraphicsContext3D
681         until we can get an ANGLE implementation of it.
682
683         When testing this patch I discovered that r207649 incorrectly
684         interpreted arguments to bufferData() and bufferSubData() as
685         byte offsets. Instead, they should be element indices. This
686         patch fixes those functions to work correctly so that
687         getBufferSubData() can be tested correctly.
688
689         Tests: fast/canvas/webgl/webgl2-buffers.html
690                fast/canvas/webgl/getBufferSubData-webgl1.html
691
692         * html/canvas/WebGL2RenderingContext.cpp:
693         (WebCore::arrayBufferViewElementSize):
694         (WebCore::WebGL2RenderingContext::bufferData):
695         (WebCore::WebGL2RenderingContext::bufferSubData):
696         (WebCore::WebGL2RenderingContext::getBufferSubData):
697         * html/canvas/WebGL2RenderingContext.h:
698         * html/canvas/WebGL2RenderingContext.idl:
699         * platform/graphics/GraphicsContext3D.h:
700         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
701         (WebCore::GraphicsContext3D::getBufferSubData):
702         (WebCore::GraphicsContext3D::mapBufferRange):
703         (WebCore::GraphicsContext3D::unmapBuffer):
704
705 2016-11-03  Chris Dumez  <cdumez@apple.com>
706
707         Unreviewed, mark support for the 'download' attribute as 'Done'.
708
709         * features.json:
710
711 2016-11-03  Chris Dumez  <cdumez@apple.com>
712
713         [WK2][Cocoa] Implement user interface for HTML form validation
714         https://bugs.webkit.org/show_bug.cgi?id=164143
715         <rdar://problem/28944652>
716
717         Reviewed by Simon Fraser.
718
719         Add ValidationBubble class to show HTML form validation messages
720         using native dialogs. It currently has an implementation for both
721         Mac and iOS. It is in WebCore under platform/ so that it can be
722         used by both WebKit1 and WebKit2.
723
724         Update ownership of ValidationMessageClient so that is is owned
725         by the Page using a unique_ptr<>, which seems to be the modern
726         way of handling lifetime for page clients.
727
728         Test: fast/forms/validation-messages.html
729
730         * WebCore.xcodeproj/project.pbxproj:
731         * html/HTMLFormControlElement.cpp:
732         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
733         * html/ValidationMessage.cpp:
734         (WebCore::ValidationMessage::updateValidationMessage):
735         * page/Page.cpp:
736         (WebCore::Page::Page):
737         (WebCore::Page::~Page):
738         * page/Page.h:
739         (WebCore::Page::validationMessageClient):
740         * page/PageConfiguration.cpp:
741         * page/PageConfiguration.h:
742         * platform/ValidationBubble.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
743         (WebCore::ValidationBubble::message):
744         * platform/ios/ValidationBubbleIOS.mm: Added.
745         (-[WebValidationBubbleDelegate adaptivePresentationStyleForPresentationController:traitCollection:]):
746         (WebCore::ValidationBubble::ValidationBubble):
747         (WebCore::ValidationBubble::~ValidationBubble):
748         (WebCore::ValidationBubble::show):
749         (WebCore::ValidationBubble::setAnchorRect):
750         * platform/mac/ValidationBubbleMac.mm: Added.
751         (WebCore::ValidationBubble::ValidationBubble):
752         (WebCore::ValidationBubble::~ValidationBubble):
753         (WebCore::ValidationBubble::showRelativeTo):
754
755 2016-11-03  Brady Eidson  <beidson@apple.com>
756
757         IndexedDB 2.0: Rename IDBKeyRange.contains to IDBKeyRange.includes.
758         https://bugs.webkit.org/show_bug.cgi?id=164383
759
760         Reviewed by Beth Dakin.
761
762         No new tests (Updated existing tests).
763
764         * Modules/indexeddb/IDBKeyRange.cpp:
765         (WebCore::IDBKeyRange::includes):
766         (WebCore::IDBKeyRange::contains): Deleted.
767         * Modules/indexeddb/IDBKeyRange.h:
768         * Modules/indexeddb/IDBKeyRange.idl:
769
770 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
771
772         Unreviewed, rolling out r208302.
773
774         This change causes LayoutTest crashes under GuardMalloc.
775
776         Reverted changeset:
777
778         "Load stylesheets in link elements inside a connected shadow
779         tree"
780         https://bugs.webkit.org/show_bug.cgi?id=160683
781         http://trac.webkit.org/changeset/208302
782
783 2016-11-03  Chris Dumez  <cdumez@apple.com>
784
785         Unreviewed, add HTML5 specification for HTML Interactive Form Validation feature.
786
787         * features.json:
788
789 2016-11-03  Chris Dumez  <cdumez@apple.com>
790
791         Unreviewed, add HTML Interactive Form Validation to features.json
792
793         * features.json:
794
795 2016-11-03  Yusuke Suzuki  <utatane.tea@gmail.com>
796
797         Unreviewed, rolling out due to crash in Amazon web site
798         https://bugs.webkit.org/show_bug.cgi?id=164380
799         <rdar://problem/29094221>
800
801         * dom/Node.idl:
802         * domjit/JSNodeDOMJIT.cpp:
803         (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): Deleted.
804         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
805
806 2016-11-03  Brady Eidson  <beidson@apple.com>
807
808         IndexedDB 2.0: Support binary keys.
809         <rdar://problem/28806927> and https://bugs.webkit.org/show_bug.cgi?id=164359
810
811         Reviewed by Alex Christensen.
812
813         Tests: storage/indexeddb/modern/binary-keys-1-private.html
814                storage/indexeddb/modern/binary-keys-1.html
815                Changes to other existing tests.
816
817         * Modules/indexeddb/IDBKey.cpp:
818         (WebCore::IDBKey::createBinary):
819         (WebCore::IDBKey::IDBKey):
820         (WebCore::IDBKey::compare):
821         * Modules/indexeddb/IDBKey.h:
822         (WebCore::IDBKey::binary):
823         (WebCore::compareBinaryKeyData):
824
825         * Modules/indexeddb/IDBKeyData.cpp:
826         (WebCore::IDBKeyData::IDBKeyData):
827         (WebCore::IDBKeyData::maybeCreateIDBKey):
828         (WebCore::IDBKeyData::isolatedCopy):
829         (WebCore::IDBKeyData::encode):
830         (WebCore::IDBKeyData::decode):
831         (WebCore::IDBKeyData::compare):
832         (WebCore::IDBKeyData::loggingString):
833         (WebCore::IDBKeyData::operator==):
834         * Modules/indexeddb/IDBKeyData.h:
835         (WebCore::IDBKeyData::hash):
836         (WebCore::IDBKeyData::encode):
837         (WebCore::IDBKeyData::decode):
838
839         * Modules/indexeddb/IndexedDB.h: Add new enum for the new key type.
840
841         * bindings/js/IDBBindingUtilities.cpp:
842         (WebCore::toJS):
843         (WebCore::createIDBKeyFromValue):
844
845         * platform/ThreadSafeDataBuffer.h:
846         (WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl):
847         (WebCore::ThreadSafeDataBuffer::copyData):
848         (WebCore::ThreadSafeDataBuffer::size):
849         (WebCore::ThreadSafeDataBuffer::operator==):
850         (WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer):
851
852 2016-11-03  Tim Horton  <timothy_horton@apple.com>
853
854         Printing to PDF should produce internal links when HTML has internal links
855         https://bugs.webkit.org/show_bug.cgi?id=112081
856         <rdar://problem/5955705>
857
858         Reviewed by Simon Fraser.
859         Patch originally by David Lattimore.
860
861         No new tests, as it's unclear how to test PDF output.
862
863         * dom/Element.cpp:
864         (WebCore::Element::findAnchorElementForLink):
865         * dom/Element.h:
866         Add findAnchorElementForLink, which looks up the anchor element corresponding
867         to the current element's href, and also returns the fragment name as an out parameter.
868
869         * page/PrintContext.cpp:
870         (WebCore::PrintContext::PrintContext):
871         (WebCore::PrintContext::spoolPage):
872         (WebCore::PrintContext::spoolRect):
873         (WebCore::PrintContext::end):
874         (WebCore::PrintContext::collectLinkedDestinations):
875         (WebCore::PrintContext::outputLinkedDestinations):
876         * rendering/RenderObject.cpp:
877         (WebCore::RenderObject::addPDFURLRect):
878         Plumb internal links (fragment links) through to GraphicsContext, using
879         the fragment name from the page.
880
881         * page/PrintContext.h:
882         * platform/graphics/GraphicsContext.cpp:
883         (WebCore::GraphicsContext::supportsInternalLinks):
884         (WebCore::GraphicsContext::setDestinationForRect):
885         (WebCore::GraphicsContext::addDestinationAtPoint):
886         * platform/graphics/GraphicsContext.h:
887         * platform/graphics/cg/GraphicsContextCG.cpp:
888         (WebCore::GraphicsContext::supportsInternalLinks):
889         (WebCore::GraphicsContext::setDestinationForRect):
890         (WebCore::GraphicsContext::addDestinationAtPoint):
891         Plumb internal links through to the CGContext. Apply the CTM, because
892         these functions expect positions in global coordinates.
893
894         * platform/graphics/win/GraphicsContextDirect2D.cpp:
895         (WebCore::GraphicsContext::setURLForRect):
896         * platform/graphics/cairo/GraphicsContextCairo.cpp:
897         (WebCore::GraphicsContext::setURLForRect):
898         Adjust setURLForRect to take a FloatRect, like everything else, and
899         stop rounding.
900
901 2016-11-03  Alex Christensen  <achristensen@webkit.org>
902
903         Unreviewed, rolling out r208298.
904         https://bugs.webkit.org/show_bug.cgi?id=163939
905
906         caused asan crashes
907
908         Reverted changeset:
909
910         "NetworkSession: Add NetworkDataTask implementation for blobs"
911         https://bugs.webkit.org/show_bug.cgi?id=163939
912         http://trac.webkit.org/changeset/208298
913
914 2016-11-03  Brent Fulgham  <bfulgham@apple.com>
915
916         [Win][Direct2D] Native Windows widgets are drawn upside-down
917         https://bugs.webkit.org/show_bug.cgi?id=164370
918
919         Reviewed by Alex Christensen.
920
921         When we return from drawing in GDI code, we need to flip the resulting
922         bitmap so that it draws in the proper orientation in Direct2D.
923
924         Tested by existing widget tests.
925
926         * platform/graphics/win/GraphicsContextDirect2D.cpp:
927         (WebCore::GraphicsContext::releaseWindowsContext): Flip before drawing
928         to our Direct2D context.
929
930 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
931
932         Remove PageThrottler & all related code
933         https://bugs.webkit.org/show_bug.cgi?id=164302
934
935         Reviewed by Ryosuke Niwa.
936
937         All relevant information now available from the ActivityState.
938
939         * CMakeLists.txt:
940         * WebCore.xcodeproj/project.pbxproj:
941         * html/HTMLMediaElement.cpp:
942         (WebCore::HTMLMediaElement::setMuted):
943         (WebCore::HTMLMediaElement::updateVolume):
944         (WebCore::HTMLMediaElement::updatePlayState):
945         (WebCore::HTMLMediaElement::updateAudioAssertionState): Deleted.
946         * html/HTMLMediaElement.h:
947         * loader/FrameLoader.cpp:
948         (WebCore::FrameLoader::completed):
949         (WebCore::FrameLoader::started):
950         * loader/FrameLoader.h:
951         * page/ChromeClient.h:
952         * page/Page.cpp:
953         (WebCore::Page::Page):
954         * page/Page.h:
955         (WebCore::Page::pageActivityStateChanged): Deleted.
956         (WebCore::Page::pageThrottler): Deleted.
957         * page/PageThrottler.cpp: Removed.
958         * page/PageThrottler.h: Removed.
959
960 2016-11-03  Dan Bernstein  <mitz@apple.com>
961
962         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
963         https://bugs.webkit.org/show_bug.cgi?id=164340
964         <rdar://problem/29074344>
965
966         Reviewed by Tim Horton.
967
968         To give WebKit a chance to deliver the painting milestones to its client after the commit,
969         we must tell it about them before or during the commit. To that end, we should not defer
970         the call to firePaintRelatedMilestonesIfNeeded until after the commit.
971
972         * rendering/RenderLayerCompositor.cpp:
973         (WebCore::RenderLayerCompositor::RenderLayerCompositor): Removed
974           m_paintRelatedMilestonesTimer initializer.
975         (WebCore::RenderLayerCompositor::didPaintBacking): Call
976           FrameView::firePaintRelatedMilestonesIfNeeded directly from here.
977         (WebCore::RenderLayerCompositor::paintRelatedMilestonesTimerFired): Deleted.
978         * rendering/RenderLayerCompositor.h:
979
980 2016-11-03  Antti Koivisto  <antti@apple.com>
981
982         imported/mozilla/svg/paint-order-01.svg and imported/mozilla/svg/paint-order-02.svg are flaky failures
983         https://bugs.webkit.org/show_bug.cgi?id=164355
984
985         Reviewed by Ryosuke Niwa.
986
987         Revert one change from https://trac.webkit.org/changeset/207669 to see if it is causing flakiness in
988         some XML based tests.
989
990         * xml/parser/XMLDocumentParser.cpp:
991         (WebCore::XMLDocumentParser::end):
992
993 2016-11-02  Yusuke Suzuki  <utatane.tea@gmail.com>
994
995         Unreviewed, fix CLoop build after r208320.
996         https://bugs.webkit.org/show_bug.cgi?id=162980
997
998         Guard with ENABLE(JIT).
999
1000         * bindings/scripts/CodeGeneratorJS.pm:
1001         (GenerateImplementation):
1002         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1003
1004 2016-11-02  Brady Eidson  <beidson@apple.com>
1005
1006         Expand upon IndexedDB status in features.json.
1007         
1008         * features.json:
1009
1010 2016-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
1011
1012         CSS.supports("font-variation-settings", "'wght' 500") erroneously returns false
1013         https://bugs.webkit.org/show_bug.cgi?id=164244
1014
1015         Reviewed by Michael Catanzaro.
1016
1017         Because we weren't passing a Document into CSSParserContext's constructor,
1018         there was no way for our parser to know whether the runtime switch was on
1019         or not. Instead, we can use the CallWith attribute in the IDL file to pass
1020         in a Document.
1021
1022         Test: fast/text/variations/css-supports-runtime-switch.html
1023
1024         * css/DOMCSSNamespace.cpp:
1025         (WebCore::DOMCSSNamespace::supports):
1026         * css/DOMCSSNamespace.h:
1027         * css/DOMCSSNamespace.idl:
1028
1029 2016-11-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1030
1031         [DOMJIT] Add DOMJIT::Signature
1032         https://bugs.webkit.org/show_bug.cgi?id=162980
1033
1034         Reviewed by Saam Barati and Sam Weinig.
1035
1036         We introduce DOMJIT::Signature. This signature object is automatically generated by IDL code generator.
1037         It holds (1) types, (2) pointer to the unsafe function (the function without checks), and (3) the effect
1038         of the function. We use constexpr to initialize DOMJIT::Signature without invoking global constructors.
1039         Thus the content is embedded into the binary as the constant values.
1040
1041         We also clean up the IDL code generator related to DOMJIT part. Instead of switching things inside IDL
1042         code generator, we use C++ template to dispatch things at compile time. This template meta programming
1043         is highly utilized in IDL these days.
1044
1045         To make DOMJIT::Signature constexpr, we also need to define DOMJIT abstract heap things in the build time.
1046         To do so, we introduce a tiny Ruby script to calculate the range of abstract heaps. We can offer the abstract
1047         heap tree as YAML format and the script will produce a C++ header holding the calculated abstract heap ranges
1048
1049         * CMakeLists.txt:
1050         * DerivedSources.make:
1051         * ForwardingHeaders/bytecode/SpeculatedType.h: Renamed from Source/WebCore/domjit/DOMJITAbstractHeapRepository.h.
1052         * ForwardingHeaders/domjit/DOMJITSignature.h: Renamed from Source/WebCore/domjit/DOMJITAbstractHeapRepository.cpp.
1053         * WebCore.xcodeproj/project.pbxproj:
1054         * bindings/js/JSDOMGlobalObject.h:
1055         * bindings/scripts/CodeGeneratorJS.pm:
1056         (GenerateHeader):
1057         (GeneratePropertiesHashTable):
1058         (GetUnsafeArgumentType):
1059         (GetArgumentTypeFilter):
1060         (GetResultTypeFilter):
1061         (GenerateImplementation):
1062         (UnsafeToNative):
1063         (GenerateHashTableValueArray):
1064         (ComputeFunctionSpecial):
1065         * bindings/scripts/IDLAttributes.txt:
1066         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1067         (WebCore::BindingCaller<JSTestDOMJIT>::castForOperation):
1068         (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT):
1069         (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT):
1070         (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT):
1071         (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT):
1072         (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT):
1073         (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT):
1074         (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT):
1075         (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT):
1076         (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT):
1077         (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT):
1078         (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT):
1079         (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT):
1080         (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT):
1081         (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT):
1082         (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT):
1083         (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT):
1084         (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT):
1085         (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT):
1086         (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT):
1087         (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT):
1088         (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT):
1089         (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT):
1090         (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT):
1091         (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT):
1092         (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT):
1093         (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT):
1094         (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT):
1095         (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT):
1096         (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT):
1097         (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT):
1098         (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT):
1099         (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT):
1100         (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT):
1101         (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT):
1102         (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT):
1103         (WebCore::jsTestDOMJITPrototypeFunctionGetAttribute):
1104         (WebCore::jsTestDOMJITPrototypeFunctionGetAttributeCaller):
1105         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetAttribute):
1106         (WebCore::jsTestDOMJITPrototypeFunctionItem):
1107         (WebCore::jsTestDOMJITPrototypeFunctionItemCaller):
1108         (WebCore::unsafeJsTestDOMJITPrototypeFunctionItem):
1109         (WebCore::jsTestDOMJITPrototypeFunctionHasAttribute):
1110         (WebCore::jsTestDOMJITPrototypeFunctionHasAttributeCaller):
1111         (WebCore::unsafeJsTestDOMJITPrototypeFunctionHasAttribute):
1112         (WebCore::jsTestDOMJITPrototypeFunctionGetElementById):
1113         (WebCore::jsTestDOMJITPrototypeFunctionGetElementByIdCaller):
1114         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementById):
1115         (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByName):
1116         (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByNameCaller):
1117         (WebCore::unsafeJsTestDOMJITPrototypeFunctionGetElementsByName):
1118         * bindings/scripts/test/TestDOMJIT.idl:
1119         * dom/Element.idl:
1120         * domjit/DOMJITAbstractHeapRepository.yaml: Added.
1121         * domjit/DOMJITIDLConvert.h: Added.
1122         (WebCore::DOMJIT::DirectConverter<IDLDOMString>::directConvert<StringConversionConfiguration::Normal>):
1123         * domjit/DOMJITIDLType.h: Added.
1124         * domjit/DOMJITIDLTypeFilter.h: Added.
1125         * domjit/JSDocumentDOMJIT.cpp:
1126         (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
1127         * domjit/JSNodeDOMJIT.cpp:
1128         (WebCore::NodeFirstChildDOMJIT::callDOMGetter):
1129         (WebCore::NodeLastChildDOMJIT::callDOMGetter):
1130         (WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
1131         (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
1132         (WebCore::NodeParentNodeDOMJIT::callDOMGetter):
1133         (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
1134         * domjit/generate-abstract-heap.rb: Added.
1135
1136 2016-11-02  Simon Fraser  <simon.fraser@apple.com>
1137
1138         Followup after r208314.
1139
1140         The style created for reflections contains transforms and a mask, so needs to get explicit
1141         z-index on it. This doesn't change rendering, since this layer has no children.
1142
1143         Fixes assertions in various reflection tests.
1144
1145         * rendering/RenderLayer.cpp:
1146         (WebCore::RenderLayer::calculateClipRects):
1147
1148 2016-11-02  Simon Fraser  <simon.fraser@apple.com>
1149
1150         REGRESSION (r208025) GraphicsContext state stack assertions loading webkit.org
1151         https://bugs.webkit.org/show_bug.cgi?id=164350
1152         rdar://problem/29053414
1153
1154         Reviewed by Dean Jackson.
1155
1156         After r208025 it as possible for KeyframeAnimation::animate() to produce a RenderStyle
1157         with a non-1 opacity, but without the explicit z-index that triggers stacking context.
1158         This confused the RenderLayer paintWithTransparency code, triggering mismsatched GraphicsContext
1159         save/restores.
1160
1161         This occurred when the runningOrFillingForwards state was mis-computed. keyframeAnim->animate()
1162         can spit out a new style when in the StartWaitTimer sometimes, so "!keyframeAnim->waitingToStart() && !keyframeAnim->postActive()"
1163         gave the wrong answser.
1164
1165         Rather than depend on the super-confusing animation state, use a bool out param from animate() to say
1166         when it actually produced a new style, and when true, do the setZIndex(0).
1167
1168         Test: animations/stacking-during-opacity-animation.html
1169
1170         * page/animation/AnimationBase.h:
1171         * page/animation/CSSPropertyAnimation.cpp:
1172         (WebCore::CSSPropertyAnimation::blendProperties): Log after blending so the log shows the blended style.
1173         * page/animation/CompositeAnimation.cpp:
1174         (WebCore::CompositeAnimation::animate):
1175         * page/animation/ImplicitAnimation.cpp:
1176         (WebCore::ImplicitAnimation::animate):
1177         * page/animation/ImplicitAnimation.h:
1178         * page/animation/KeyframeAnimation.cpp:
1179         (WebCore::KeyframeAnimation::animate):
1180         * page/animation/KeyframeAnimation.h:
1181         * platform/graphics/GraphicsContext.cpp:
1182         (WebCore::GraphicsContext::restore):
1183         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1184         (PlatformCALayer::drawLayerContents): No functional change, but created scope for the
1185         GraphicsContext so that it didn't outlive the CGContextRestoreGState(context).
1186         * rendering/RenderLayer.cpp:
1187         (WebCore::RenderLayer::beginTransparencyLayers): New assertion that catches the problem earlier.
1188
1189 2016-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
1190
1191         [iOS] [WebGL] Multisample resolve step may operate on stale data
1192         https://bugs.webkit.org/show_bug.cgi?id=164347
1193
1194         Reviewed by Dean Jackson.
1195
1196         When antialiasing is enabled, WebKit internally creates a multisampled FBO
1197         and uses that as the target of all the drawing commands. Then, just before
1198         we actually put the image on the glass, we perform a “resolve” step which
1199         averages all the samples to create the final image. However, it appears
1200         that this resolve step only waits for commands to complete which were
1201         already submitted to the hardware. OpenGL is allowed (indeed, expected) to
1202         batch up drawing commands in main memory so it can submit them to the
1203         hardware in fewer batches, but this means that the hardware may not know
1204         about all the commands that the application submitted. Because of this,
1205         the data the resolve step saw is the result of only some of the previous
1206         draw calls - not all of them.
1207
1208         This doesn’t occur on macOS because we have a different code path there
1209         for performing the resolve step. On iOS 9 and below, WebKit didn’t
1210         implement multisampling in WebGL at all, which explains why this only
1211         occurs on iOS 10. 
1212
1213         Luckily, the OpenGL command glFlush() is exactly designed to submit any
1214         pending commands to the hardware.
1215
1216         Test: fast/canvas/webgl/multisample-resolve-consistency.html
1217
1218         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1219         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
1220
1221 2016-11-02  Brady Eidson  <beidson@apple.com>
1222
1223         Give IDBKey(Data) a WTF::Variant overhaul.
1224         https://bugs.webkit.org/show_bug.cgi?id=164332
1225
1226         Reviewed by Alex Christensen and Andy Estes.
1227
1228         No new tests (Refactor, no behavior change).
1229
1230         * Modules/indexeddb/IDBKey.cpp:
1231         (WebCore::IDBKey::IDBKey):
1232         (WebCore::IDBKey::isValid):
1233         (WebCore::IDBKey::compare):
1234         * Modules/indexeddb/IDBKey.h:
1235         (WebCore::IDBKey::array):
1236         (WebCore::IDBKey::string):
1237         (WebCore::IDBKey::date):
1238         (WebCore::IDBKey::number):
1239         (WebCore::IDBKey::IDBKey): Deleted.
1240
1241         * Modules/indexeddb/IDBKeyData.cpp:
1242         (WebCore::IDBKeyData::IDBKeyData):
1243         (WebCore::IDBKeyData::maybeCreateIDBKey):
1244         (WebCore::IDBKeyData::isolatedCopy):
1245         (WebCore::IDBKeyData::encode):
1246         (WebCore::IDBKeyData::decode):
1247         (WebCore::IDBKeyData::compare):
1248         (WebCore::IDBKeyData::loggingString):
1249         (WebCore::IDBKeyData::setArrayValue):
1250         (WebCore::IDBKeyData::setStringValue):
1251         (WebCore::IDBKeyData::setDateValue):
1252         (WebCore::IDBKeyData::setNumberValue):
1253         (WebCore::IDBKeyData::operator==):
1254         * Modules/indexeddb/IDBKeyData.h:
1255         (WebCore::IDBKeyData::hash):
1256         (WebCore::IDBKeyData::string):
1257         (WebCore::IDBKeyData::date):
1258         (WebCore::IDBKeyData::number):
1259         (WebCore::IDBKeyData::array):
1260         (WebCore::IDBKeyData::encode):
1261         (WebCore::IDBKeyData::decode):
1262
1263 2016-11-01  Sam Weinig  <sam@webkit.org>
1264
1265         [WebIDL] Move interfaces and typed arrays over to JSDOMConvert
1266         https://bugs.webkit.org/show_bug.cgi?id=164256
1267
1268         Reviewed by Alex Christensen.
1269
1270         - Add the ability to pass an "exception thrower" functor to the convert functions.
1271           This is only implemented for convert<IDLInterface<T>> and convert<IDLNullable<IDLInterface<T>>>
1272           for now, but can be extended for more types as necessary to improve exception messages.
1273         - Add support for using toJSNewlyCreated in JSDOMConvert.
1274
1275         * bindings/generic/IDLTypes.h:
1276         (WebCore::IDLString::extractValueFromNullable):
1277         Use forwarding to simplify extraction function.
1278
1279         (WebCore::IDLInterface::nullValue):
1280         Update nullValue to work for both RefPtr<T> and T*.
1281
1282         (WebCore::IDLInterface::extractValueFromNullable):
1283         Use forwarding to simplify extraction function.
1284
1285         * bindings/js/JSDOMConvert.h:
1286         (WebCore::DefaultExceptionThrower::operator()):
1287         Add a default "exception thrower" which throws a normal type error.
1288
1289         (WebCore::convert):
1290         Add an overload of convert which takes an "exception thrower".
1291
1292         (WebCore::toJSNewlyCreated):
1293         Add new overloaded function toJSNewlyCreated, matching the toJS overload set,
1294         which will return "newly created" values. This only works for types that implement
1295         a toJSNewlyCreated function for themselves.
1296
1297         (WebCore::Converter<IDLNullable<T>>::convert):
1298         Fix the return type of Converter<IDLNullable<T>> to be specialized when
1299         T is an IDLInterface. In that case, we want to match the return type of
1300         inner converter.
1301         
1302         Also add implementation of convert overload that takes an "exception thrower".
1303
1304         (WebCore::JSConverter<IDLNullable<T>>::convert):
1305         (WebCore::JSConverter<IDLNullable<T>>::convertNewlyCreated):
1306         Reimplement conversion to use forwarding of the value.
1307
1308         (WebCore::Converter<IDLInterface<T>>::convert):
1309         Add support for an "exception thrower".
1310
1311         (WebCore::Detail::getPtrOrRef):
1312         Add helper functions that extract either a pointer or reference, depending on the type,
1313         and const_casts it allowing the value to be used with toJS functions.
1314
1315         (WebCore::JSConverter<IDLInterface<T>>::convert):
1316         Re-implement to support more varied input values.
1317
1318         (WebCore::JSConverter<IDLInterface<T>>::convertNewlyCreated):
1319         Added. Forwards to overloaded toJSNewlyCreated functions.
1320
1321         * bindings/scripts/CodeGeneratorJS.pm:
1322         (AddToImplIncludesForIDLType):
1323         Add support for adding the right includes for SerializedScriptValue and Dictionary.
1324
1325         (GetArgumentExceptionThrower):
1326         (GetAttributeExceptionThrower):
1327         Add helpers to generate "exception thrower" lambdas for wrappers and typed arrays
1328         being passed to setters and functions.
1329
1330         (GenerateParametersCheck):
1331         Move around special cases so it is clear that it's not wrappers and typed arrays that
1332         need specialization here, it is now just EventListener and XPathNSResolver.
1333
1334         (GetIDLInterfaceName):
1335         Add helper to get the InterfaceName for use in IDLInterface template.
1336
1337         (GetBaseIDLType):
1338         Use new GetIDLInterfaceName helper.
1339
1340         (IsValidContextForJSValueToNative):
1341         Remove IDLOperation as a valid context. It is not.
1342
1343         (JSValueToNative):
1344         Move JSDOMConvert based conversion to the bottom, to show that everything above it
1345         is a special case that should be fixed. I have used explicit c-style if-statements
1346         to make it clear what the types of the exceptional cases are.
1347
1348         (NativeToJSValueDOMConvertNeedsState):
1349         (NativeToJSValueDOMConvertNeedsGlobalObject):
1350         Add wrapper types and typed arrays to the list needing state and globalObject.
1351
1352         (NativeToJSValue):
1353         Move JSDOMConvert based conversion to the bottom, to show that everything above it
1354         is a special case that should be fixed. I have used explicit c-style if-statements
1355         to make it clear what the types of the exceptional cases are.
1356
1357         (JSValueToNativeIsHandledByDOMConvert): Deleted.
1358         (NativeToJSValueIsHandledByDOMConvert): Deleted.
1359         Remove predicates protecting use of JSDOMConvert now that it is the default.
1360
1361         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1362         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1363         * bindings/scripts/test/JS/JSTestCallback.cpp:
1364         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1365         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1366         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1367         * bindings/scripts/test/JS/JSTestInterface.cpp:
1368         * bindings/scripts/test/JS/JSTestObj.cpp:
1369         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1370         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1371         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1372         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1373         Update test results.
1374
1375 2016-11-02  David Kilzer  <ddkilzer@apple.com>
1376
1377         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
1378         <https://webkit.org/b/164333>
1379         <rdar://problem/29072727>
1380
1381         Reviewed by Alex Christensen.
1382
1383         * page/DiagnosticLoggingKeys.cpp:
1384         (WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
1385         - Add implementation for new key method.
1386         * page/DiagnosticLoggingKeys.h:
1387         (WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
1388         - Add declaration for new key method.
1389
1390 2016-11-02  Filip Pizlo  <fpizlo@apple.com>
1391
1392         The GC should be in a thread
1393         https://bugs.webkit.org/show_bug.cgi?id=163562
1394
1395         Reviewed by Geoffrey Garen and Andreas Kling.
1396
1397         No new tests because existing tests cover this.
1398         
1399         We now need to be more careful about using JSLock. This fixes some places that were not
1400         holding it. New assertions in the GC are more likely to catch this than before.
1401
1402         * bindings/js/WorkerScriptController.cpp:
1403         (WebCore::WorkerScriptController::WorkerScriptController):
1404
1405 2016-11-02  Joseph Pecoraro  <pecoraro@apple.com>
1406
1407         Web Inspector: Include DebuggerAgent in Workers - see, pause, and step through scripts
1408         https://bugs.webkit.org/show_bug.cgi?id=164136
1409         <rdar://problem/29028462>
1410
1411         Reviewed by Brian Burg.
1412
1413         Tests: inspector/worker/debugger-pause.html
1414                inspector/worker/debugger-scripts.html
1415
1416         * CMakeLists.txt:
1417         * WebCore.xcodeproj/project.pbxproj:
1418         * inspector/InspectorAllInOne.cpp:
1419         New file.
1420
1421         * inspector/PageDebuggerAgent.h:
1422         * inspector/WorkerDebuggerAgent.cpp: Added.
1423         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
1424         (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
1425         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
1426         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
1427         * inspector/WorkerDebuggerAgent.h: Added.
1428         DebuggerAgent customizations for Workers.
1429
1430         * inspector/WorkerInspectorController.cpp:
1431         (WebCore::WorkerInspectorController::WorkerInspectorController):
1432         Add the new agent.
1433
1434         * inspector/WorkerScriptDebugServer.cpp:
1435         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
1436         Implement the nested run loop for Workers.
1437
1438 2016-11-02  Simon Fraser  <simon.fraser@apple.com>
1439
1440         Add Battery Status to features.json, marked as "Removed".
1441
1442         * features.json:
1443
1444 2016-11-02  Ryosuke Niwa  <rniwa@webkit.org>
1445
1446         Load stylesheets in link elements inside a connected shadow tree
1447         https://bugs.webkit.org/show_bug.cgi?id=160683
1448         <rdar://problem/29040652>
1449
1450         Reviewed by Antti Koivisto.
1451
1452         Allow external stylesheets within a shadow tree by storing the appropriate style scope in HTMLLinkElement
1453         when it's connected to a document instead of always talking to document's style scope.
1454
1455         Also improve ShadowRoot's insertedInto and removedFrom so that they only try to add and remove itself from
1456         m_inDocumentShadowRoots when the connected-ness changes.
1457
1458         This patch also removes the superfluous call to notifyChildNodeRemoved in Element::removeShadowRoot to
1459         avoid invoking notifyChildNodeRemoved during a document teardown, which is incorrect. It's sufficient that
1460         ~ShadowRoot calls ContainerNode::removeDetachedChildren(), and in turn removeDetachedChildrenInContainer()
1461         since the latter function tears down nodes via the deletion queue during a document destruction and use
1462         notifyChildNodeRemoved() on nodes that outlive the shadow root.
1463
1464         Tests: fast/shadow-dom/link-element-in-shadow-tree.html
1465                fast/shadow-dom/selected-stylesheet-in-shadow-tree.html
1466
1467        * dom/Document.cpp:
1468        (WebCore::Document::didInsertInDocumentShadowRoot): Assert that the shadow root is not in the set.
1469        (WebCore::Document::didRemoveInDocumentShadowRoot): Assert that the shadow root is not in the document as
1470        this function is now called after Node::removedFrom in ShadowRoot::removedFrom.
1471        * dom/Element.cpp:
1472        (WebCore::Element::removeShadowRoot): See the description above.
1473        * dom/ShadowRoot.cpp:
1474        (WebCore::ShadowRoot::insertedInto): Only call didInsertInDocumentShadowRoot when the this shadow root is
1475        newly connected to a document so we can add assertions in didInsertInDocumentShadowRoot.
1476        (WebCore::ShadowRoot::removedFrom): Ditto for the removal.
1477        * html/HTMLLinkElement.cpp:
1478        (WebCore::HTMLLinkElement::HTMLLinkElement):
1479        (WebCore::HTMLLinkElement::~HTMLLinkElement):
1480        (WebCore::HTMLLinkElement::setDisabledState): Exit early when the element is not in a document as invoking
1481        didChangeActiveStyleSheetCandidates would require having a valid m_styleScope and process() already exits
1482        early when inDocument() is false.
1483        (WebCore::HTMLLinkElement::parseAttribute):
1484        (WebCore::HTMLLinkElement::process): Removed the early exit for when the element is in a shadow tree.
1485        (WebCore::HTMLLinkElement::insertedInto): Exit early unless this element has just become connected to
1486        a document instead of whenever its self-inclusive ancestor is inserted into a container.
1487        (WebCore::HTMLLinkElement::removedFrom): Ditto for removal. Also call removeStyleSheetCandidateNode after
1488        calling removePendingSheet since the latter depends on m_styleScope being not null.
1489        (WebCore::HTMLLinkElement::addPendingSheet):
1490        (WebCore::HTMLLinkElement::removePendingSheet):
1491        * html/HTMLLinkElement.h:
1492        * html/HTMLStyleElement.cpp:
1493        (WebCore::HTMLStyleElement::insertedInto): Only call inline style owner's insertedIntoDocument if this
1494        element has just become connected to a document.
1495        (WebCore::HTMLStyleElement::removedFrom): Ditto for the removal.
1496        * style/StyleScope.h:
1497        * svg/SVGStyleElement.cpp:
1498        (WebCore::SVGStyleElement::insertedInto): Ditto.
1499        (WebCore::SVGStyleElement::removedFrom): Ditto for the removal.
1500
1501 2016-11-02  Dave Hyatt  <hyatt@apple.com>
1502
1503         [CSS Parser] Clean up new parser's grid layout ifdefs/runtime checking
1504         https://bugs.webkit.org/show_bug.cgi?id=164341
1505
1506         Reviewed by Dean Jackson.
1507
1508         * css/parser/CSSPropertyParser.cpp:
1509         (WebCore::consumeGridTrackRepeatFunction):
1510         (WebCore::consumeGridTrackList):
1511         (WebCore::CSSPropertyParser::parseSingleValue):
1512
1513 2016-11-02  Alex Christensen  <achristensen@webkit.org>
1514
1515         Remove Battery Status API from the tree
1516         https://bugs.webkit.org/show_bug.cgi?id=164213
1517
1518         Reviewed by Sam Weinig.
1519
1520         * CMakeLists.txt:
1521         * DerivedSources.cpp:
1522         * Modules/battery: Removed.
1523         * Modules/battery/BatteryClient.h: Removed.
1524         * Modules/battery/BatteryController.cpp: Removed.
1525         * Modules/battery/BatteryController.h: Removed.
1526         * Modules/battery/BatteryManager.cpp: Removed.
1527         * Modules/battery/BatteryManager.h: Removed.
1528         * Modules/battery/BatteryManager.idl: Removed.
1529         * Modules/battery/BatteryStatus.cpp: Removed.
1530         * Modules/battery/BatteryStatus.h: Removed.
1531         * Modules/battery/NavigatorBattery.cpp: Removed.
1532         * Modules/battery/NavigatorBattery.h: Removed.
1533         * Modules/battery/NavigatorBattery.idl: Removed.
1534         * PlatformEfl.cmake:
1535         * dom/EventTargetFactory.in:
1536         * platform/efl/BatteryProviderEfl.cpp: Removed.
1537         * platform/efl/BatteryProviderEfl.h: Removed.
1538         * platform/efl/BatteryProviderEflClient.h: Removed.
1539         * platform/glib/BatteryProviderUPower.cpp: Removed.
1540         * platform/glib/BatteryProviderUPower.h: Removed.
1541         * platform/glib/BatteryProviderUPowerClient.h: Removed.
1542         * testing/Internals.cpp:
1543         (WebCore::Internals::setBatteryStatus): Deleted.
1544         * testing/Internals.h:
1545         * testing/Internals.idl:
1546
1547 2016-11-02  Keith Rollin  <krollin@apple.com>
1548
1549         NetworkSession: Add NetworkDataTask implementation for blobs
1550         https://bugs.webkit.org/show_bug.cgi?id=163939
1551
1552         Reviewed by Alex Christensen.
1553
1554         * WebCore.xcodeproj/project.pbxproj: Mark HTTPParsers.h and AsyncFileStream.h as private.
1555         * fileapi/AsyncFileStream.h: Add WEBCORE_EXPORT to AsyncFileStream class.
1556         * platform/network/BlobData.h: Add WEBCORE_EXPORT to length().
1557         * platform/network/HTTPParsers.h: Add WEBCORE_EXPORT to parseRange().
1558         * platform/network/ResourceResponseBase.h: Add WEBCORE_EXPORT to setHTTPHeaderField().
1559
1560 2016-11-02  Olivier Blin  <olivier.blin@softathome.com>
1561
1562         [GTK] Use libgcrypt instead of GnuTLS for CryptoDigest and SubtleCrypto HMAC implementation
1563         https://bugs.webkit.org/show_bug.cgi?id=163125
1564
1565         Reviewed by Michael Catanzaro.
1566
1567         No new tests, already covered by existing SubtleCrypto tests.
1568
1569         * PlatformGTK.cmake: Use libgcrypt instead of gnutls.
1570         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp: Added. Adapted from the GnuTLS backend.
1571         (WebCore::getGCryptDigestAlgorithm):
1572         (WebCore::calculateSignature):
1573         (WebCore::CryptoAlgorithmHMAC::platformSign):
1574         (WebCore::CryptoAlgorithmHMAC::platformVerify):
1575         * platform/crypto/gcrypt/CryptoDigestGCrypt.cpp: Added. Adapted from the GnuTLS backend.
1576         (WebCore::CryptoDigest::CryptoDigest):
1577         (WebCore::CryptoDigest::~CryptoDigest):
1578         (WebCore::CryptoDigest::create):
1579         (WebCore::CryptoDigest::addBytes):
1580         (WebCore::CryptoDigest::computeHash):
1581
1582 2016-11-02  Brent Fulgham  <bfulgham@apple.com>
1583
1584         REGRESSION(r203289):Assertion in MathOperator::stretchTo() on Wikipedia Page
1585         https://bugs.webkit.org/show_bug.cgi?id=162933
1586         <rdar://problem/28570590>
1587
1588         Reviewed by Dean Jackson.
1589
1590         A debug assertion is triggered when an empty <mo> tag is used with a "stretchy" flag.
1591
1592         We shouldn't be trying to apply stretch operations on an empty MathML element. Create a
1593         helper function (isStretchy) to encapsulate the fact that only non-empty elements with
1594         the 'MathMLOperatorDictionary::Stretchy' operator flag should have stretching applied.
1595
1596         Test: mathml/empty-mo.html
1597
1598         * rendering/mathml/RenderMathMLOperator.cpp:
1599         (WebCore::RenderMathMLOperator::stretchTo): Revise assertion to use new 'isStretchy' predicate.
1600         * rendering/mathml/RenderMathMLOperator.h:
1601         (WebCore::RenderMathMLOperator::isStretchy): Added.
1602         * rendering/mathml/RenderMathMLRow.cpp:
1603         (WebCore::RenderMathMLRow::computeLineVerticalStretch): Use new 'isStretchy' predicate.
1604         (WebCore::RenderMathMLRow::layoutRowItems): Ditto.
1605         * rendering/mathml/RenderMathMLUnderOver.cpp:
1606         (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Ditto.
1607         (WebCore::RenderMathMLUnderOver::verticalParameters): Ditto.
1608
1609 2016-11-01  Dean Jackson  <dino@apple.com>
1610
1611         Filter functions grayscale/invert/opacity/sepia should clamp values over 100%, not fail
1612         https://bugs.webkit.org/show_bug.cgi?id=164310
1613
1614         Reviewed by Sam Weinig.
1615
1616         When bringing up the new CSS parser, I discovered that our old parser was
1617         not conforming to the specification.
1618
1619         Covered by existing tests.
1620
1621         * css/parser/CSSParser.cpp:
1622         (WebCore::CSSParser::parseBuiltinFilterArguments): For these functions, clamp to
1623         100% rather than fail.
1624
1625 2016-11-02  Brent Fulgham  <bfulgham@apple.com>
1626
1627         WebKit nullptr dereference Archive Subframe
1628         https://bugs.webkit.org/show_bug.cgi?id=164281
1629         <rdar://problem/28943006>
1630
1631         Reviewed by Andy Estes.
1632
1633         If the page is torn down during a load, we can attempt to use a deallocated
1634         (and nulled) document loader. Most places that use the "active document loader"
1635         null-check it before using, but there was one place that did not. This patch
1636         fixes that oversight.
1637
1638         Test: fast/dom/crash-with-bad-url.html
1639
1640         * loader/FrameLoader.cpp:
1641         (WebCore::FrameLoader::loadURLIntoChildFrame): Check that the active document
1642         loader is non-null before using.
1643
1644 2016-11-02  Dave Hyatt  <hyatt@apple.com>
1645
1646         [CSS Parser] Support scroll-snap-* properties
1647         https://bugs.webkit.org/show_bug.cgi?id=164321
1648
1649         Reviewed by Simon Fraser.
1650
1651         * css/CSSPrimitiveValue.h:
1652         * css/StyleBuilderConverter.h:
1653         (WebCore::StyleBuilderConverter::convertScrollSnapPoints):
1654         (WebCore::StyleBuilderConverter::convertSnapCoordinatePair):
1655         (WebCore::StyleBuilderConverter::convertScrollSnapCoordinates):
1656         * css/parser/CSSPropertyParser.cpp:
1657         (WebCore::consumePositionLonghand):
1658         (WebCore::consumePositionX):
1659         (WebCore::consumePositionY):
1660         (WebCore::consumePositionList):
1661         (WebCore::consumeScrollSnapDestination):
1662         (WebCore::consumeScrollSnapPoints):
1663         (WebCore::CSSPropertyParser::parseSingleValue):
1664
1665 2016-11-02  David Kilzer  <ddkilzer@apple.com>
1666
1667         Add logging for "WebKit encountered an internal error" messages
1668         <https://webkit.org/b/164272>
1669         <rdar://problem/28546064>
1670
1671         Reviewed by Alex Christensen.
1672
1673         * page/DiagnosticLoggingKeys.cpp:
1674         (WebCore::DiagnosticLoggingKeys::internalErrorKey):
1675         (WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
1676         (WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
1677         (WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
1678         - Add implementations for new key methods.
1679
1680         * page/DiagnosticLoggingKeys.h:
1681         (WebCore::DiagnosticLoggingKeys::internalErrorKey):
1682         (WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
1683         (WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
1684         (WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
1685         - Add declarations for new key methods.
1686
1687 2016-11-02  Zalan Bujtas  <zalan@apple.com>
1688
1689         [Tables] Simplified layout skips captions.
1690         https://bugs.webkit.org/show_bug.cgi?id=164284
1691
1692         Reviewed by David Hyatt.
1693
1694         This patch ensures that we take care of simplified normalflow captions during layout.    
1695
1696         Covered by fast/regions/table-caption-as-region.html
1697
1698         * rendering/RenderTable.cpp:
1699         (WebCore::RenderTable::layoutCaption):
1700         (WebCore::RenderTable::layoutCaptions): _caption_side is 2bits, can't use bitmask. 
1701         (WebCore::RenderTable::simplifiedNormalFlowLayout):
1702         (WebCore::RenderTable::layout):
1703         * rendering/RenderTable.h:
1704
1705 2016-11-02  Youenn Fablet  <youenn@apple.com>
1706
1707         REGRESSION(r207753-207755): ASSERTION FAILED: m_parsedStyleSheetCache->isInMemoryCache()
1708         https://bugs.webkit.org/show_bug.cgi?id=163905
1709
1710         Reviewed by Antti Koivisto.
1711
1712         Covered by existing tests and http/tests/security/cached-cross-origin-shared-css-stylesheet.html
1713
1714         Small refactoring to do more member fields initialization in StyleSheetContents header.
1715         Refactored StyleSheetContents::m_isInMemoryCache to be a counter instead of a boolean.
1716         This allows StyleSheetContents to be linked to several CachedCSSStyleSheets.
1717
1718         * css/StyleSheetContents.cpp:
1719         (WebCore::StyleSheetContents::StyleSheetContents):
1720         (WebCore::StyleSheetContents::addedToMemoryCache):
1721         (WebCore::StyleSheetContents::removedFromMemoryCache):
1722         * css/StyleSheetContents.h:
1723         * loader/cache/CachedCSSStyleSheet.cpp:
1724         (WebCore::CachedCSSStyleSheet::setBodyDataFrom): Making reuse of saveParsedStyleSheet to handle update of StyleSheetContents cache count.
1725
1726 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1727
1728         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
1729         https://bugs.webkit.org/show_bug.cgi?id=164315
1730
1731         Reviewed by Michael Catanzaro.
1732
1733         * platform/FileSystem.h:
1734         * platform/glib/FileSystemGlib.cpp:
1735         (WebCore::stringFromFileSystemRepresentation):
1736         (WebCore::homeDirectoryPath):
1737         (WebCore::listDirectory):
1738         (WebCore::filenameToString): Deleted.
1739
1740 2016-11-02  Manuel Rego Casasnovas  <rego@igalia.com>
1741
1742         [css-grid] mimax(auto, <flex>) should be serialized as <flex>
1743         https://bugs.webkit.org/show_bug.cgi?id=164316
1744
1745         Reviewed by Sergio Villar Senin.
1746
1747         * css/CSSComputedStyleDeclaration.cpp:
1748         (WebCore::specifiedValueForGridTrackSize): Add a simple if to serialize
1749         properly this case.
1750         * rendering/style/GridLength.h:
1751         (WebCore::GridLength::isAuto): Add new function to check if GridLength
1752         is or not "auto".
1753
1754 2016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1755
1756         [Readable Streams API] Enable creation of ReadableByteStreamController
1757         https://bugs.webkit.org/show_bug.cgi?id=164014
1758
1759         Reviewed by Youenn Fablet.
1760
1761         Added support for creating ReadableByteStreamController. IDL is mostly
1762         implemented but methods return TypeError. Tests have been added to ensure
1763         behaviour. This part of Readable Streams API is associated to
1764         a flag (READABLE_BYTE_STREAM_API).
1765
1766         Test: streams/readable-byte-stream-controller.html
1767
1768         * CMakeLists.txt:
1769         * Configurations/FeatureDefines.xcconfig:
1770         * DerivedSources.cpp:
1771         * DerivedSources.make:
1772         * Modules/streams/ReadableByteStreamController.idl: Added.
1773         * Modules/streams/ReadableByteStreamController.js: Added.
1774         (enqueue): Empty method for the moment, throws TypeError.
1775         (error): Empty method for the moment, throws TypeError.
1776         (close): Empty method for the moment, throws TypeError.
1777         (byobRequest): Empty method for the moment, throws TypeError.
1778         (desiredSize): Empty method for the moment, throws TypeError.
1779         * Modules/streams/ReadableByteStreamInternals.js: Added.
1780         (privateInitializeReadableByteStreamController):
1781         * Modules/streams/ReadableStream.js:
1782         (initializeReadableStream):
1783         * WebCore.xcodeproj/project.pbxproj:
1784         * bindings/js/JSDOMGlobalObject.cpp:
1785         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1786         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1787         (WebCore::constructJSReadableByteStreamController):
1788         (WebCore::constructJSReadableStreamDefaultReader):
1789         (WebCore::JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable):
1790         (WebCore::createReadableByteStreamControllerPrivateConstructor):
1791         * bindings/js/JSReadableStreamPrivateConstructors.h:
1792         * bindings/js/WebCoreBuiltinNames.h:
1793
1794 2016-11-02  Antoine Quint  <graouts@apple.com>
1795
1796         [Modern Media Controls] Media Controller: fullscreen toggle support
1797         https://bugs.webkit.org/show_bug.cgi?id=163728
1798         <rdar://problem/27989486>
1799
1800         Reviewed by Darin Adler.
1801
1802         We introduce the FullscreenSupport class which brings support for entering and
1803         exiting fullscreen by clicking on the fullscreen button in the media controls
1804         and correctly reflecting the media's fullscreen state should it be changed
1805         via the media API.
1806
1807         Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-click.html
1808                media/modern-media-controls/fullscreen-support/fullscreen-support-enabled.html
1809
1810         * Modules/modern-media-controls/js-files:
1811         * Modules/modern-media-controls/media/fullscreen-support.js: Added.
1812         (FullscreenSupport):
1813         (FullscreenSupport.prototype.get control):
1814         (FullscreenSupport.prototype.get mediaEvents):
1815         (FullscreenSupport.prototype.buttonWasClicked):
1816         (FullscreenSupport.prototype.syncControl):
1817         * Modules/modern-media-controls/media/media-controller.js:
1818         (MediaController):
1819         * WebCore.xcodeproj/project.pbxproj:
1820
1821 2016-11-02  Antoine Quint  <graouts@apple.com>
1822
1823         [Modern Media Controls] Media Controller: PiP support
1824         https://bugs.webkit.org/show_bug.cgi?id=163730
1825         <rdar://problem/27989485>
1826
1827         Reviewed by Dean Jackson.
1828
1829         We introduce the PiPSupport class which brings support for entering picture-in-picture
1830         by clicking on the PiP button in the media controls and enabling the button only when
1831         picture-in-picture mode is available.
1832
1833         Tests: media/modern-media-controls/pip-support/pip-support-click.html
1834                media/modern-media-controls/pip-support/pip-support-enabled.html
1835
1836         * Modules/modern-media-controls/js-files:
1837         * Modules/modern-media-controls/media/media-controller.js:
1838         (MediaController):
1839         * Modules/modern-media-controls/media/pip-support.js: Added.
1840         (PiPSupport.prototype.get control):
1841         (PiPSupport.prototype.get mediaEvents):
1842         (PiPSupport.prototype.buttonWasClicked):
1843         (PiPSupport.prototype.syncControl):
1844         (PiPSupport):
1845         * WebCore.xcodeproj/project.pbxproj:
1846
1847 2016-11-01  Dave Hyatt  <hyatt@apple.com>
1848
1849         [CSS Parser] Support the shadow DOM
1850         https://bugs.webkit.org/show_bug.cgi?id=164240
1851
1852         Reviewed by Dean Jackson.
1853
1854         * css/CSSSelector.cpp:
1855         (WebCore::CSSSelector::selectorText):
1856         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
1857         ShadowDescendant combinator.
1858
1859         * css/CSSSelector.h:
1860         * css/SelectorChecker.cpp:
1861         (WebCore::SelectorChecker::matchRecursively):
1862         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
1863         ShadowDescendant combinator.
1864
1865         * css/SelectorFilter.cpp:
1866         (WebCore::SelectorFilter::collectIdentifierHashes):
1867         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
1868         ShadowDescendant combinator.
1869
1870         * css/SelectorPseudoElementTypeMap.in:
1871         Add support for slotted.
1872
1873         * css/parser/CSSParserValues.cpp:
1874         (WebCore::CSSParserSelector::appendTagHistory):
1875         * css/parser/CSSParserValues.h:
1876         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
1877         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
1878         ShadowDescendant combinator. Take :slotted out of
1879         needsImplicitShadowCombinatorForMatching(), since our code doesn't do
1880         this for :slotted.
1881
1882         * css/parser/CSSSelectorParser.cpp:
1883         (WebCore::isPseudoClassFunction):
1884         :host can be both an id and a function, so don't restrict it.
1885
1886         (WebCore::CSSSelectorParser::consumePseudo):
1887         Put in a hack for :host (inside the hack we already plan on removing
1888         once we turn on).
1889
1890         (WebCore::CSSSelectorParser::consumeCombinator):
1891         Remove deep shadow combinator support, as we don't support matching
1892         on it.
1893
1894         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
1895         (WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
1896         Make the split use our combinator, ShadowDescendant, and no longer do anything
1897         special with :slotted.
1898
1899         * cssjit/SelectorCompiler.cpp:
1900         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
1901         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
1902         ShadowDescendant combinator.
1903
1904 2016-11-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1905
1906         Turn the Input Events runtime flag on by default
1907         https://bugs.webkit.org/show_bug.cgi?id=164297
1908
1909         Reviewed by Ryosuke Niwa.
1910
1911         Set the initial value of inputEventsEnabled in Settings to true.
1912
1913         * page/Settings.in:
1914
1915 2016-11-01  Brady Eidson  <beidson@apple.com>
1916
1917         IndexedDB 2.0: Support IDBIndex getAll/getAllKeys.
1918         <rdar://problem/28806933> and https://bugs.webkit.org/show_bug.cgi?id=164294
1919
1920         Reviewed by Alex Christensen.
1921
1922         Tests: storage/indexeddb/modern/idbindex-getall-1-private.html
1923                storage/indexeddb/modern/idbindex-getall-1.html
1924                storage/indexeddb/modern/idbindex-getallkeys-1-private.html
1925                storage/indexeddb/modern/idbindex-getallkeys-1.html
1926                Existing imported W3C tests.
1927
1928         * Modules/indexeddb/IDBIndex.cpp:
1929         (WebCore::IDBIndex::getAll):
1930         (WebCore::IDBIndex::getAllKeys):
1931         * Modules/indexeddb/IDBIndex.h:
1932         * Modules/indexeddb/IDBIndex.idl:
1933
1934         * Modules/indexeddb/IDBRequest.cpp:
1935         (WebCore::IDBRequest::create):
1936         (WebCore::IDBRequest::createIndexGet):
1937         (WebCore::IDBRequest::createCount): Deleted.
1938         (WebCore::IDBRequest::createGet): Deleted.
1939         * Modules/indexeddb/IDBRequest.h:
1940
1941         * Modules/indexeddb/IDBTransaction.cpp:
1942         (WebCore::IDBTransaction::requestGetAllIndexRecords):
1943         (WebCore::IDBTransaction::requestIndexRecord):
1944         (WebCore::IDBTransaction::requestCount):
1945         * Modules/indexeddb/IDBTransaction.h:
1946
1947         * Modules/indexeddb/server/IndexValueStore.cpp:
1948         (WebCore::IDBServer::IndexValueStore::allValuesForKey):
1949         * Modules/indexeddb/server/IndexValueStore.h:
1950
1951         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1952         (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
1953
1954         * Modules/indexeddb/server/MemoryIndex.cpp:
1955         (WebCore::IDBServer::MemoryIndex::getAllRecords):
1956         * Modules/indexeddb/server/MemoryIndex.h:
1957
1958         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1959         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
1960         (WebCore::IDBServer::queryForGetAllObjectStoreRecords):
1961         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
1962         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
1963         (WebCore::IDBServer::queryForGetAllRecords): Deleted.
1964         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1965
1966 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
1967
1968         Remove CUSTOM_ELEMENTS build flag
1969         https://bugs.webkit.org/show_bug.cgi?id=164267
1970
1971         Reviewed by Antti Koivisto.
1972
1973         Removed the build flag. Also rebaselined the bindings tests.
1974
1975         * Configurations/FeatureDefines.xcconfig:
1976         * DerivedSources.cpp:
1977         * bindings/generic/RuntimeEnabledFeatures.h:
1978         (WebCore::RuntimeEnabledFeatures::customElementsEnabled):
1979         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1980         (WebCore::JSCSSStyleDeclaration::putDelegate):
1981         * bindings/js/JSCustomElementInterface.cpp:
1982         * bindings/js/JSCustomElementInterface.h:
1983         * bindings/js/JSCustomElementRegistryCustom.cpp:
1984         * bindings/js/JSDOMStringMapCustom.cpp:
1985         (WebCore::JSDOMStringMap::deleteProperty):
1986         (WebCore::JSDOMStringMap::putDelegate):
1987         * bindings/js/JSElementCustom.cpp:
1988         (WebCore::toJSNewlyCreated):
1989         * bindings/js/JSHTMLElementCustom.cpp:
1990         (WebCore::constructJSHTMLElement):
1991         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1992         (WebCore::JSHTMLOptionsCollection::setLength):
1993         (WebCore::JSHTMLOptionsCollection::indexSetter):
1994         * bindings/js/JSHTMLSelectElementCustom.cpp:
1995         (WebCore::JSHTMLSelectElement::indexSetter):
1996         * bindings/js/JSMainThreadExecState.h:
1997         * bindings/scripts/CodeGeneratorJS.pm:
1998         (GenerateImplementation):
1999         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2000         (WebCore::setJSTestCEReactionsAttributeWithCEReactionsFunction):
2001         (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsFunction):
2002         (WebCore::setJSTestCEReactionsStringifierAttributeFunction):
2003         (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactions):
2004         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2005         (WebCore::setJSTestCEReactionsStringifierValueFunction):
2006         * css/CSSSelector.cpp:
2007         (WebCore::CSSSelector::selectorText):
2008         * css/CSSSelector.h:
2009         * css/PropertySetCSSStyleDeclaration.cpp:
2010         * css/SelectorChecker.cpp:
2011         (WebCore::SelectorChecker::checkOne):
2012         * css/SelectorCheckerTestFunctions.h:
2013         (WebCore::isDefinedElement):
2014         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
2015         * cssjit/SelectorCompiler.cpp:
2016         (WebCore::SelectorCompiler::addPseudoClassType):
2017         * dom/CustomElementReactionQueue.cpp:
2018         * dom/CustomElementReactionQueue.h:
2019         * dom/CustomElementRegistry.cpp:
2020         * dom/CustomElementRegistry.h:
2021         * dom/CustomElementRegistry.idl:
2022         * dom/Document.cpp:
2023         (WebCore::createHTMLElementWithNameValidation):
2024         (WebCore::createFallbackHTMLElement):
2025         * dom/Element.cpp:
2026         (WebCore::Element::attributeChanged):
2027         (WebCore::Element::didMoveToNewDocument):
2028         (WebCore::Element::insertedInto):
2029         (WebCore::Element::removedFrom):
2030         * dom/Element.h:
2031         * dom/ElementRareData.cpp:
2032         * dom/ElementRareData.h:
2033         (WebCore::ElementRareData::setCustomElementReactionQueue):
2034         * dom/Node.h:
2035         (WebCore::Node::isFailedCustomElement):
2036         * dom/make_names.pl:
2037         (printWrapperFactoryCppFile):
2038         * html/HTMLElement.idl:
2039         * html/parser/HTMLConstructionSite.cpp:
2040         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
2041         * html/parser/HTMLConstructionSite.h:
2042         * html/parser/HTMLDocumentParser.cpp:
2043         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
2044         * html/parser/HTMLTreeBuilder.cpp:
2045         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
2046         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
2047         * html/parser/HTMLTreeBuilder.h:
2048         (WebCore::HTMLTreeBuilder::hasParserBlockingScriptWork):
2049         * page/DOMWindow.cpp:
2050         * page/DOMWindow.h:
2051         * page/DOMWindow.idl:
2052
2053 2016-11-01  Antoine Quint  <graouts@apple.com>
2054
2055         [Modern Media Controls] Media Controller: Airplay support
2056         https://bugs.webkit.org/show_bug.cgi?id=163729
2057         <rdar://problem/27989484>
2058
2059         Reviewed by Dean Jackson.
2060
2061         We introduce the AirplaySupport class which brings support for playing the media
2062         via Airplay by clicking on the Airplay button in the media controls and correctly
2063         reflecting when the media is played through Airplay via the media API. The enabled
2064         state of the Airplay button is also tied to Airplay sources being available.
2065
2066         Test: media/modern-media-controls/airplay-support/airplay-support.html
2067
2068         * Modules/modern-media-controls/controls/airplay-button.js:
2069         (AirplayButton.prototype.get on):
2070         * Modules/modern-media-controls/js-files:
2071         * Modules/modern-media-controls/media/airplay-support.js: Added.
2072         (AirplaySupport.prototype.get control):
2073         (AirplaySupport.prototype.get mediaEvents):
2074         (AirplaySupport.prototype.buttonWasClicked):
2075         (AirplaySupport.prototype.handleEvent):
2076         (AirplaySupport.prototype.syncControl):
2077         (AirplaySupport):
2078         * Modules/modern-media-controls/media/media-controller.js:
2079         (MediaController):
2080         * WebCore.xcodeproj/project.pbxproj:
2081
2082 2016-11-01  Dean Jackson  <dino@apple.com>
2083
2084         Remove WebKitCSSFilterValue to make Hyatt happy
2085         https://bugs.webkit.org/show_bug.cgi?id=164289
2086         <rdar://problems/29050973>
2087
2088         Reviewed by Simon Fraser.
2089
2090         The new CSS parser should not use WebKitCSSFilterValue. It's non-standard,
2091         very likely only used in our tests, doesn't provide much benefit, and will be
2092         covered by the new CSSOM function interface.
2093
2094         Covered by modifying existing tests.
2095
2096         * DerivedSources.make: Remove WebKitCSSFilterValue.idl.
2097
2098         * WebCore.xcodeproj/project.pbxproj: Make CSSFunctionValue.h private so API testing
2099         can see it.
2100
2101         * bindings/js/JSCSSValueCustom.cpp:
2102         (WebCore::toJSNewlyCreated): No WebKitCSSFilterValue.
2103
2104         * css/CSSComputedStyleDeclaration.cpp: Use CSSFunctionValue or CSSPrimitiveValue to
2105         build up the computed style.
2106         (WebCore::ComputedStyleExtractor::valueForFilter):
2107
2108         * css/CSSValue.cpp: No WebKitCSSFilterValue.
2109         (WebCore::CSSValue::equals):
2110         (WebCore::CSSValue::cssText):
2111         (WebCore::CSSValue::destroy):
2112         (WebCore::CSSValue::cloneForCSSOM):
2113         * css/CSSValue.h:
2114         (WebCore::CSSValue::isFilterImageValue):
2115         (WebCore::CSSValue::isWebKitCSSFilterValue): Deleted.
2116
2117         * css/StyleResolver.cpp: Resolve against CSSFunctionValues with
2118         CSSValueIDs as name, rather than WebKitCSSFilterValue.
2119         (WebCore::filterOperationForType):
2120         (WebCore::StyleResolver::createFilterOperations):
2121         * css/StyleResolver.h:
2122
2123         * css/WebKitCSSFilterValue.cpp: Removed.
2124         * css/WebKitCSSFilterValue.h: Removed.
2125         * css/WebKitCSSFilterValue.idl: Removed.
2126
2127         * css/parser/CSSParser.cpp: Parse into CSSPrimitiveValue and CSSFunctionValue.
2128         (WebCore::isValidPrimitiveFilterFunction):
2129         (WebCore::CSSParser::parseBuiltinFilterArguments):
2130         (WebCore::cssValueKeywordIDForFunctionName):
2131         (WebCore::CSSParser::parseFilter):
2132         (WebCore::filterInfoForName): Deleted.
2133         * css/parser/CSSParser.h:
2134         * css/parser/CSSPropertyParser.cpp:
2135         (WebCore::consumeFilterFunction):
2136
2137 2016-11-01  Simon Fraser  <simon.fraser@apple.com>
2138
2139         Add ViewportAPI to features.json
2140
2141         * features.json:
2142
2143 2016-11-01  Joseph Pecoraro  <pecoraro@apple.com>
2144
2145         Unreviewed build fix for r208240.
2146
2147         * inspector/InspectorInstrumentation.h:
2148         Don't export an inlined function.
2149
2150 2016-11-01  Eric Carlson  <eric.carlson@apple.com>
2151
2152         [MediaStream] restrict media capture secure connections
2153         https://bugs.webkit.org/show_bug.cgi?id=164234
2154         <rdar://problem/28944906>
2155
2156         Reviewed by Alex Christensen.
2157
2158         Tests: http/tests/ssl/media-stream/get-user-media-different-host.html
2159                http/tests/ssl/media-stream/get-user-media-nested.html
2160                http/tests/ssl/media-stream/get-user-media-secure-connection.html
2161
2162         * Modules/mediastream/UserMediaRequest.cpp:
2163         (WebCore::isSecure): New.
2164         (WebCore::canCallGetUserMedia): New.
2165         (WebCore::UserMediaRequest::start): When the setting says the require secure a secure connection, 
2166           fail immediately if the page or one of its ancestors is not secure.
2167
2168         * page/Settings.cpp:
2169         (WebCore::Settings::mediaCaptureRequiresSecureConnection): New.
2170         (WebCore::Settings::setMediaCaptureRequiresSecureConnection): New.
2171         * page/Settings.h:
2172
2173         * testing/InternalSettings.cpp:
2174         (WebCore::InternalSettings::InternalSettings): Do not require a secure connection for media 
2175           capture during tests.
2176         (WebCore::InternalSettings::resetToConsistentState):
2177         (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
2178         * testing/InternalSettings.h:
2179         * testing/InternalSettings.idl:
2180         * testing/Internals.cpp:
2181         (WebCore::Internals::Internals):
2182
2183 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
2184
2185         Port Page timer throttling to use ActivityState instead of PageThrottler
2186         https://bugs.webkit.org/show_bug.cgi?id=164291
2187
2188         Reviewed by Geoff Garen & Antti Koivisto.
2189
2190         ActivityState now conveys this information; after this change PageThrottler is redundant and can be removed.
2191
2192         * page/Page.cpp:
2193         (WebCore::Page::updateTimerThrottlingState):
2194             - determine page throttling mode based on IsAudible/IsLoading in ActivityState.
2195         (WebCore::Page::setActivityState):
2196             - call updateTimerThrottlingState if IsAudible/IsLoading change.
2197         * page/Page.h:
2198         (WebCore::Page::pageActivityStateChanged):
2199             - no need to listen for PageActivityState changes from the PageThrottler.
2200
2201 2016-11-01  Antoine Quint  <graouts@apple.com>
2202
2203         [Modern Media Controls] Media Controller: Placard support
2204         https://bugs.webkit.org/show_bug.cgi?id=163731
2205         <rdar://problem/28869598>
2206
2207         Reviewed by Dean Jackson.
2208
2209         We introduce the PlacardSupport class which brings support for showing the
2210         appropriate placard when the media is played via AirPlay or in picture-in-picture.
2211
2212         Tests: media/modern-media-controls/placard-support/placard-support-airplay.html
2213                media/modern-media-controls/placard-support/placard-support-pip.html
2214
2215         * Modules/modern-media-controls/js-files:
2216         * Modules/modern-media-controls/media/media-controller.js:
2217         (MediaController):
2218         * Modules/modern-media-controls/media/placard-support.js: Added.
2219         (PlacardSupport):
2220         (PlacardSupport.prototype.get mediaEvents):
2221         (PlacardSupport.prototype.handleEvent):
2222         (PlacardSupport.prototype._updatePlacard):
2223         * WebCore.xcodeproj/project.pbxproj:
2224
2225 2016-11-01  Zalan Bujtas  <zalan@apple.com>
2226
2227         ShowRenderTree: Add information about the type of the needsLayout bit.
2228         https://bugs.webkit.org/show_bug.cgi?id=164287
2229
2230         Reviewed by Simon Fraser.
2231
2232         Currently showRenderTree only tells you whether a renderer's "needs layout bit" is set or not.
2233         With certain type of layout bugs, it's essential to know the kind of layout a particular
2234         renderer needs.
2235         This patch extends the renderer output by listing all the layout bits set.
2236
2237         B------- -+ BODY RenderBody  (0.00, 0.00) (0.00, 0.00) renderer->(0x) node->(0x) layout->[self][normal child]
2238
2239         Not testable.
2240
2241         * rendering/RenderObject.cpp:
2242         (WebCore::RenderObject::showRenderObject):
2243
2244 2016-11-01  Joseph Pecoraro  <pecoraro@apple.com>
2245
2246         Web Inspector: Use more references in inspector code
2247         https://bugs.webkit.org/show_bug.cgi?id=164283
2248
2249         Reviewed by Timothy Hatcher.
2250
2251         (WebCore::frameForScriptExecutionContext):
2252         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
2253         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
2254         (WebCore::InspectorInstrumentation::willFireTimerImpl):
2255         (WebCore::InspectorInstrumentation::didLayoutImpl):
2256         (WebCore::InspectorInstrumentation::willPaintImpl):
2257         (WebCore::InspectorInstrumentation::didPaintImpl):
2258         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
2259         (WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
2260         (WebCore::InspectorInstrumentation::didDispatchDOMStorageEventImpl):
2261         (WebCore::InspectorInstrumentation::instrumentingAgentsForRenderer):
2262         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage): Deleted.
2263         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted.
2264         * inspector/InspectorInstrumentation.h:
2265         (WebCore::InspectorInstrumentation::frameWindowDiscarded):
2266         (WebCore::InspectorInstrumentation::didInstallTimer):
2267         (WebCore::InspectorInstrumentation::didRemoveTimer):
2268         (WebCore::InspectorInstrumentation::willFireTimer):
2269         (WebCore::InspectorInstrumentation::didLayout):
2270         (WebCore::InspectorInstrumentation::willComposite):
2271         (WebCore::InspectorInstrumentation::didComposite):
2272         (WebCore::InspectorInstrumentation::willPaint):
2273         (WebCore::InspectorInstrumentation::didPaint):
2274         (WebCore::InspectorInstrumentation::continueAfterPingLoader):
2275         (WebCore::InspectorInstrumentation::scriptImported):
2276         (WebCore::InspectorInstrumentation::didCommitLoad):
2277         (WebCore::InspectorInstrumentation::frameDocumentUpdated):
2278         (WebCore::InspectorInstrumentation::frameStartedLoading):
2279         (WebCore::InspectorInstrumentation::frameStoppedLoading):
2280         (WebCore::InspectorInstrumentation::frameScheduledNavigation):
2281         (WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
2282         (WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent):
2283         (WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
2284         (WebCore::InspectorInstrumentation::workerStarted):
2285         (WebCore::InspectorInstrumentation::workerTerminated):
2286         (WebCore::InspectorInstrumentation::didHandleMemoryPressure):
2287         (WebCore::InspectorInstrumentation::networkStateChanged):
2288         (WebCore::InspectorInstrumentation::addMessageToConsole):
2289         (WebCore::InspectorInstrumentation::consoleCount):
2290         (WebCore::InspectorInstrumentation::startConsoleTiming):
2291         (WebCore::InspectorInstrumentation::stopConsoleTiming):
2292         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
2293         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
2294         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
2295         Convert to references where possible.
2296
2297         * inspector/InspectorCSSAgent.cpp:
2298         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
2299         (WebCore::InspectorCSSAgent::buildObjectForRule):
2300         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
2301         * inspector/InspectorCSSAgent.h:
2302         * inspector/InspectorDOMAgent.cpp:
2303         (WebCore::InspectorDOMAgent::frameDocumentUpdated):
2304         * inspector/InspectorDOMAgent.h:
2305         * inspector/InspectorDOMStorageAgent.cpp:
2306         (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
2307         * inspector/InspectorDOMStorageAgent.h:
2308         * inspector/InspectorInstrumentation.cpp:
2309         * inspector/InspectorPageAgent.cpp:
2310         (WebCore::InspectorPageAgent::frameNavigated):
2311         (WebCore::InspectorPageAgent::didPaint):
2312         * inspector/InspectorPageAgent.h:
2313         * inspector/InspectorReplayAgent.cpp:
2314         (WebCore::InspectorReplayAgent::frameNavigated):
2315         * inspector/InspectorReplayAgent.h:
2316         * inspector/InspectorTimelineAgent.cpp:
2317         (WebCore::InspectorTimelineAgent::didLayout):
2318         (WebCore::InspectorTimelineAgent::didPaint):
2319         * inspector/InspectorTimelineAgent.h:
2320         Pass references through InspectorInstrumentation to the Agents.
2321
2322         * loader/FrameLoader.cpp:
2323         (WebCore::FrameLoader::clear):
2324         * page/DOMTimer.cpp:
2325         (WebCore::DOMTimer::install):
2326         (WebCore::DOMTimer::removeById):
2327         (WebCore::DOMTimer::fired):
2328         * page/DOMWindow.cpp:
2329         (WebCore::DOMWindow::willDetachPage):
2330         * page/Frame.cpp:
2331         (WebCore::Frame::setDocument):
2332         * page/FrameView.cpp:
2333         (WebCore::FrameView::layout):
2334         (WebCore::FrameView::willPaintContents):
2335         (WebCore::FrameView::didPaintContents):
2336         * page/Page.cpp:
2337         (WebCore::networkStateChanged):
2338         * rendering/RenderLayerBacking.cpp:
2339         (WebCore::RenderLayerBacking::paintContents):
2340         * replay/ReplayController.cpp:
2341         (WebCore::ReplayController::frameNavigated):
2342         * replay/ReplayController.h:
2343         * storage/StorageEventDispatcher.cpp:
2344         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
2345         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
2346         * workers/Worker.cpp:
2347         (WebCore::Worker::notifyFinished):
2348         * workers/WorkerGlobalScope.cpp:
2349         (WebCore::WorkerGlobalScope::importScripts):
2350         (WebCore::WorkerGlobalScope::addConsoleMessage):
2351         (WebCore::WorkerGlobalScope::addMessage):
2352         * workers/WorkerInspectorProxy.cpp:
2353         (WebCore::WorkerInspectorProxy::workerStartMode):
2354         (WebCore::WorkerInspectorProxy::workerStarted):
2355         (WebCore::WorkerInspectorProxy::workerTerminated):
2356         * workers/WorkerInspectorProxy.h:
2357         * workers/WorkerMessagingProxy.cpp:
2358         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2359         Pass references to InspectorInstrumentation.
2360
2361 2016-11-01  Alex Christensen  <achristensen@webkit.org>
2362
2363         Percent-encode non-ASCII code points in hosts of URLs with unrecognized schemes
2364         https://bugs.webkit.org/show_bug.cgi?id=164290
2365
2366         Reviewed by Tim Horton.
2367
2368         NSURL fails to parse these URLs, WebKit used to punycode encode them, but now we match Chrome and Firefox,
2369         as well as what will likely become the standard once https://github.com/whatwg/url/issues/148 is resolved.
2370         We continue to parse IPv6 address hosts because otherwise we wouldn't be able to tell where a port
2371         starts in a URL with colons in the IPv6 address and before the port like "a://[b::c]:4"
2372
2373         Covered by new API tests and updated LayoutTests.
2374
2375         * platform/URLParser.cpp:
2376         (WebCore::URLParser::domainToASCII):
2377         (WebCore::URLParser::parseHostAndPort):
2378
2379 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
2380
2381         Add IsAudible, IsLoading to ActivityState
2382         https://bugs.webkit.org/show_bug.cgi?id=164286
2383
2384         Reviewed by Geoff Garen.
2385
2386         By computing these values in the UIProcess and passing them to WebContent we can
2387         more closely unify iOS & macOS throttling, and remove the PageThrottler class.
2388
2389         * page/ActivityState.h:
2390             - added IsAudible, IsLoading
2391
2392 2016-10-31  Gavin Barraclough  <barraclough@apple.com>
2393
2394         Rename ViewState to ActivityState
2395         https://bugs.webkit.org/show_bug.cgi?id=164254
2396
2397         Reviewed by Andreas Kling.
2398
2399         We plan to add a couple more flags to ViewState that aren't directly related to the view
2400         itself - whether there is an ongoing page load, and whether whether there is audio playback.
2401         This will allow viewState (now activityState) to fully drive throttling decisions.
2402
2403         Renaming this bitfield accordingly.
2404         * Modules/geolocation/GeolocationController.cpp:
2405         (WebCore::GeolocationController::GeolocationController):
2406         (WebCore::GeolocationController::~GeolocationController):
2407         (WebCore::GeolocationController::activityStateDidChange):
2408         (WebCore::GeolocationController::viewStateDidChange): Deleted.
2409         * Modules/geolocation/GeolocationController.h:
2410         * WebCore.xcodeproj/project.pbxproj:
2411         * page/ActivityState.h: Copied from Source/WebCore/page/ViewState.h.
2412         * page/ActivityStateChangeObserver.h: Copied from Source/WebCore/page/ViewStateChangeObserver.h.
2413         (WebCore::ActivityStateChangeObserver::~ActivityStateChangeObserver):
2414         (WebCore::ViewStateChangeObserver::~ViewStateChangeObserver): Deleted.
2415         * page/FocusController.cpp:
2416         (WebCore::FocusController::FocusController):
2417         (WebCore::FocusController::setFocused):
2418         (WebCore::FocusController::setActivityState):
2419         (WebCore::FocusController::setActive):
2420         (WebCore::FocusController::setViewState): Deleted.
2421         * page/FocusController.h:
2422         (WebCore::FocusController::isActive):
2423         (WebCore::FocusController::isFocused):
2424         (WebCore::FocusController::contentIsVisible):
2425         * page/Page.cpp:
2426         (WebCore::Page::Page):
2427         (WebCore::Page::setIsInWindow):
2428         (WebCore::Page::addActivityStateChangeObserver):
2429         (WebCore::Page::removeActivityStateChangeObserver):
2430         (WebCore::Page::updateTimerThrottlingState):
2431         (WebCore::Page::setActivityState):
2432         (WebCore::Page::isVisibleAndActive):
2433         (WebCore::Page::setIsVisible):
2434         (WebCore::Page::addViewStateChangeObserver): Deleted.
2435         (WebCore::Page::removeViewStateChangeObserver): Deleted.
2436         (WebCore::Page::setViewState): Deleted.
2437         * page/Page.h:
2438         (WebCore::Page::isVisible):
2439         (WebCore::Page::isInWindow):
2440         * page/PageThrottler.h:
2441         * page/ViewState.h: Removed.
2442         * page/ViewStateChangeObserver.h: Removed.
2443
2444 2016-11-01  Ryan Haddad  <ryanhaddad@apple.com>
2445
2446         Unreviewed, rolling out r208100.
2447
2448         This change caused LayoutTest crashes under GuardMalloc.
2449
2450         Reverted changeset:
2451
2452         "MediaEndpoint::generateDtlsInfo is not needed"
2453         https://bugs.webkit.org/show_bug.cgi?id=164130
2454         http://trac.webkit.org/changeset/208100
2455
2456 2016-11-01  Claudio Saavedra  <csaavedra@igalia.com>
2457
2458         Add missing inline include to JSDeviceMotionEventCustom
2459         https://bugs.webkit.org/show_bug.cgi?id=164269
2460
2461         Reviewed by Michael Catanzaro.
2462
2463         Inlined JSObject functions are used through JSObject::get() get here,
2464         so this fixes the build with -fvisibility-inlines-hidden.
2465
2466         * bindings/js/JSDeviceMotionEventCustom.cpp: Include JSObjectInlines.h
2467
2468 2016-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
2469
2470         [CMake] generate-bindings-all.pl uses USES_TERMINAL which leaves a noisy line in interactive Ninja build
2471         https://bugs.webkit.org/show_bug.cgi?id=163868
2472
2473         Reviewed by Michael Catanzaro.
2474
2475         It takes long time for generate-bindings-all.pl to generate all
2476         bindings.  So, it shows the progress while running and
2477         USES_TERMINAL option of add_custom_target have been used to invoke
2478         the command.  However, USES_TERMINAL leaves a noisy line in
2479         Ninja's neat build log of interactive build.
2480
2481         A new CMake option SHOW_BINDINGS_GENERATION_PROGRESS is added to
2482         stop using USES_TERMINAL only in case of interactive Ninja build.
2483
2484         * bindings/scripts/generate-bindings-all.pl: Added a new switch
2485         --showProgress.  Removed $terminalWidth and getTerminalWidth which
2486         are mainly for interactive Ninja build.  Added printProgress.
2487
2488 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
2489
2490         Web Inspector: Add the support for custom elements
2491         https://bugs.webkit.org/show_bug.cgi?id=164266
2492         <rdar://problem/29038883>
2493
2494         Reviewed by Joseph Pecoraro.
2495
2496         Set "customElementState" property on each DOMNode object when building a protocol object for the node.
2497         Also added InspectorInstrumentation::didChangeCustomElementState to track the changes to custom element states.
2498
2499         Tests: inspector/dom/customElementState.html
2500
2501         * dom/Element.cpp:
2502         (WebCore::Element::setIsDefinedCustomElement): Invoke didChangeCustomElementState to update the state.
2503         (WebCore::Element::setIsFailedCustomElement): Ditto.
2504         (WebCore::Element::setIsCustomElementUpgradeCandidate): Ditto.
2505         (WebCore::Element::enqueueToUpgrade): Ditto.
2506         * inspector/InspectorDOMAgent.cpp:
2507         (WebCore::customElementState): Added.
2508         (WebCore::InspectorDOMAgent::buildObjectForNode): Set the custom element state.
2509         (WebCore::InspectorDOMAgent::didChangeCustomElementState): Invoke customElementStateChanged.
2510         * inspector/InspectorDOMAgent.h:
2511         * inspector/InspectorInstrumentation.cpp:
2512         (WebCore::InspectorInstrumentation::didChangeCustomElementStateImpl): Added.
2513         * inspector/InspectorInstrumentation.h:
2514         (WebCore::InspectorInstrumentation::didChangeCustomElementState): Added.
2515
2516 2016-10-31  Ryosuke Niwa  <rniwa@webkit.org>
2517
2518         Add StaticPasteboard.cpp to the cmake after r207841.
2519
2520         * CMakeLists.txt:
2521
2522 2016-10-31  Zalan Bujtas  <zalan@apple.com>
2523
2524         Simple line layout: Clear needs layout flag even when only overflow is getting recomputed.
2525         https://bugs.webkit.org/show_bug.cgi?id=164253
2526
2527         Reviewed by Antti Koivisto.
2528
2529         When a style change triggers visual overflow re-computation, we set StyleDifferenceLayout style diff
2530         but in practice we don't actually make changes to the simple line structure. We just re-compute the visual overflow later.
2531         This patch moves the 'clean the renderes' logic back to RenderBlockFlow::layoutSimpleLines so that
2532         we set the needs layout bit to false regardless of whether we preformed layout.
2533
2534         Covered by fast/events/tabindex-focus-blur-all.html
2535
2536         * rendering/RenderBlockFlow.cpp:
2537         (WebCore::RenderBlockFlow::layoutSimpleLines):
2538         * rendering/SimpleLineLayout.cpp:
2539         (WebCore::SimpleLineLayout::create):
2540
2541 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
2542
2543         Add basic visual/layout viewport support for fixed position layout
2544         https://bugs.webkit.org/show_bug.cgi?id=164261
2545
2546         Reviewed by Dean Jackson.
2547
2548         This patch adds a new behavior for position:fixed objects on zooming. Instead of
2549         interpolating between two implicit viewports as we do now, have explicit and distinct
2550         layout and visual viewports.
2551
2552         The layout viewport is always the size of the initial containing block (i.e. the RenderView).
2553         Position:fixed and sticky elements are laid out relative to the layout viewport.
2554
2555         The visual viewport is the visible part of the view, in content coordinates.
2556
2557         When the user pans and zooms, the visual viewport changes. If it hits the edge of the
2558         layout viepwort, it pushes the layout viewport in that direction; it's as if the user
2559         is dragging the layout viewport around.
2560
2561         The layout viewport is maintained on FrameView, and has to be recomputed when the
2562         scroll position changes, when the view size changes, and when the content size (which
2563         affets min/max scroll position) changes. Layout viewport size and position are computed
2564         in unzoomed coordinates, requiring some new functions on FrameView to return these.
2565
2566         Updated the TileCoverageMap to show the layout viewport visually.
2567
2568         Subsequent patches will plumb the layout and visual viewports through the scrolling tree.
2569
2570         Tests: fast/visual-viewport/nonzoomed-rects.html
2571                fast/visual-viewport/zoomed-fixed-scroll-down-then-up.html
2572                fast/visual-viewport/zoomed-fixed.html
2573                fast/visual-viewport/zoomed-rects.html
2574
2575         * page/FrameView.cpp:
2576         (WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling):
2577         (WebCore::FrameView::scrollPositionRespectingCustomFixedPosition):
2578         (WebCore::FrameView::computeLayoutViewportOrigin):
2579         (WebCore::FrameView::setLayoutViewportOrigin):
2580         (WebCore::FrameView::updateLayoutViewport):
2581         (WebCore::FrameView::minStableLayoutViewportOrigin):
2582         (WebCore::FrameView::maxStableLayoutViewportOrigin):
2583         (WebCore::FrameView::layoutViewportRect):
2584         (WebCore::FrameView::visualViewportRect):
2585         (WebCore::FrameView::viewportConstrainedVisibleContentRect):
2586         (WebCore::FrameView::rectForFixedPositionLayout):
2587         (WebCore::FrameView::scrollPositionForFixedPosition):
2588         (WebCore::FrameView::unscaledMinimumScrollPosition):
2589         (WebCore::FrameView::unscaledMaximumScrollPosition):
2590         (WebCore::FrameView::scrollPositionChanged):
2591         (WebCore::FrameView::availableContentSizeChanged):
2592         (WebCore::FrameView::performPostLayoutTasks):
2593         (WebCore::FrameView::scrollTo):
2594         (WebCore::FrameView::useCustomFixedPositionLayoutRect):
2595         * page/FrameView.h:
2596         * page/Settings.in:
2597         * page/scrolling/AsyncScrollingCoordinator.cpp:
2598         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2599         * platform/graphics/TiledBacking.h:
2600         * platform/graphics/ca/TileController.cpp:
2601         (WebCore::TileController::setLayoutViewportRect):
2602         * platform/graphics/ca/TileController.h:
2603         * platform/graphics/ca/TileCoverageMap.cpp:
2604         (WebCore::TileCoverageMap::TileCoverageMap):
2605         (WebCore::TileCoverageMap::update):
2606         * platform/graphics/ca/TileCoverageMap.h:
2607         * rendering/RenderBoxModelObject.cpp:
2608         (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
2609         * rendering/RenderLayerBacking.cpp:
2610         (WebCore::RenderLayerBacking::updateCompositedBounds):
2611         * rendering/RenderLayerCompositor.cpp:
2612         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
2613         (WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
2614         * rendering/RenderTreeAsText.cpp:
2615         (WebCore::externalRepresentation): Logging here is useful when debugging tests.
2616         * testing/Internals.cpp:
2617         (WebCore::Internals::layoutViewportRect): Expose these rects so tests can dump them.
2618         (WebCore::Internals::visualViewportRect):
2619         * testing/Internals.h:
2620         * testing/Internals.idl:
2621
2622 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
2623
2624         Fix bindings tests after r208209.
2625
2626         * bindings/scripts/test/JS/JSTestObj.cpp:
2627         (WebCore::setJSTestObjTypedArrayAttrFunction):
2628         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2629         (WebCore::constructJSTestOverloadedConstructors1):
2630         (WebCore::constructJSTestOverloadedConstructors2):
2631
2632 2016-10-31  Joseph Pecoraro  <pecoraro@apple.com>
2633
2634         Warning: Multiple build commands for output file RenderThemeCocoa.h
2635         https://bugs.webkit.org/show_bug.cgi?id=164265
2636
2637         Reviewed by Ryosuke Niwa.
2638
2639         * WebCore.xcodeproj/project.pbxproj:
2640
2641 2016-10-29  Filip Pizlo  <fpizlo@apple.com>
2642
2643         JSC should support SharedArrayBuffer
2644         https://bugs.webkit.org/show_bug.cgi?id=163986
2645
2646         Reviewed by Keith Miller.
2647
2648         New tests added in the LayoutTests/workers/sab directory.
2649         
2650         This teaches WebCore that a typed array could be shared or not. By default, WebCore will
2651         reject shared typed arrays as if they were not typed arrays. This ensures that we don't get
2652         race conditions in code that can't handle it.
2653         
2654         If you postMessage a SharedArrayBuffer or something that wraps it, you will send the shared
2655         memory to the other worker.
2656
2657         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
2658         (WebCore::CDMSessionClearKey::cachedKeyForKeyID):
2659         * Modules/fetch/FetchBody.cpp:
2660         (WebCore::FetchBody::extract):
2661         * Modules/mediastream/RTCDataChannel.cpp:
2662         (WebCore::RTCDataChannel::send):
2663         * Modules/webaudio/AudioBuffer.cpp:
2664         (WebCore::AudioBuffer::getChannelData):
2665         * Modules/websockets/WebSocket.cpp:
2666         (WebCore::WebSocket::send):
2667         * bindings/js/JSBlobCustom.cpp:
2668         (WebCore::constructJSBlob):
2669         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2670         (WebCore::createRsaKeyGenParams):
2671         * bindings/js/JSCryptoCustom.cpp:
2672         (WebCore::JSCrypto::getRandomValues):
2673         * bindings/js/JSCryptoOperationData.cpp:
2674         (WebCore::cryptoOperationDataFromJSValue):
2675         * bindings/js/JSDOMBinding.h:
2676         (WebCore::toJS):
2677         (WebCore::toPossiblySharedArrayBufferView):
2678         (WebCore::toUnsharedArrayBufferView):
2679         (WebCore::toPossiblySharedInt8Array):
2680         (WebCore::toPossiblySharedInt16Array):
2681         (WebCore::toPossiblySharedInt32Array):
2682         (WebCore::toPossiblySharedUint8Array):
2683         (WebCore::toPossiblySharedUint8ClampedArray):
2684         (WebCore::toPossiblySharedUint16Array):
2685         (WebCore::toPossiblySharedUint32Array):
2686         (WebCore::toPossiblySharedFloat32Array):
2687         (WebCore::toPossiblySharedFloat64Array):
2688         (WebCore::toUnsharedInt8Array):
2689         (WebCore::toUnsharedInt16Array):
2690         (WebCore::toUnsharedInt32Array):
2691         (WebCore::toUnsharedUint8Array):
2692         (WebCore::toUnsharedUint8ClampedArray):
2693         (WebCore::toUnsharedUint16Array):
2694         (WebCore::toUnsharedUint32Array):
2695         (WebCore::toUnsharedFloat32Array):
2696         (WebCore::toUnsharedFloat64Array):
2697         (WebCore::toArrayBufferView): Deleted.
2698         (WebCore::toInt8Array): Deleted.
2699         (WebCore::toInt16Array): Deleted.
2700         (WebCore::toInt32Array): Deleted.
2701         (WebCore::toUint8Array): Deleted.
2702         (WebCore::toUint8ClampedArray): Deleted.
2703         (WebCore::toUint16Array): Deleted.
2704         (WebCore::toUint32Array): Deleted.
2705         (WebCore::toFloat32Array): Deleted.
2706         (WebCore::toFloat64Array): Deleted.
2707         * bindings/js/JSDataCueCustom.cpp:
2708         (WebCore::constructJSDataCue):
2709         * bindings/js/JSDictionary.cpp:
2710         (WebCore::JSDictionary::convertValue):
2711         * bindings/js/JSFileCustom.cpp:
2712         (WebCore::constructJSFile):
2713         * bindings/js/JSMessagePortCustom.cpp:
2714         (WebCore::extractTransferables):
2715         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2716         (WebCore::dataFunctionf):
2717         (WebCore::dataFunctioni):
2718         (WebCore::dataFunctionMatrix):
2719         * bindings/js/JSXMLHttpRequestCustom.cpp:
2720         (WebCore::JSXMLHttpRequest::send):
2721         * bindings/js/SerializedScriptValue.cpp:
2722         (WebCore::CloneSerializer::dumpArrayBufferView):
2723         (WebCore::CloneSerializer::dumpIfTerminal):
2724         (WebCore::CloneDeserializer::readArrayBufferView):
2725         (WebCore::CloneDeserializer::readTerminal):
2726         (WebCore::SerializedScriptValue::transferArrayBuffers):
2727         * bindings/js/StructuredClone.cpp:
2728         (WebCore::structuredCloneArrayBuffer):
2729         (WebCore::structuredCloneArrayBufferView):
2730         * bindings/scripts/CodeGeneratorJS.pm:
2731         (JSValueToNative):
2732         * css/FontFace.cpp:
2733         (WebCore::FontFace::create):
2734         * html/canvas/WebGL2RenderingContext.cpp:
2735         (WebCore::WebGL2RenderingContext::bufferData):
2736         (WebCore::WebGL2RenderingContext::bufferSubData):
2737         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2738         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
2739
2740 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
2741
2742         Make UIScriptController::zoomToScale() work on Mac WK1 and WK2
2743         https://bugs.webkit.org/show_bug.cgi?id=164238
2744
2745         Reviewed by Dean Jackson.
2746
2747         Test: fast/zooming/uiscript-zooming.html
2748         
2749         Expose pageScaleFactor() for tests.
2750
2751         * testing/Internals.cpp:
2752         (WebCore::Internals::pageScaleFactor):
2753         * testing/Internals.h:
2754         * testing/Internals.idl:
2755
2756 2016-10-31  Myles C. Maxfield  <mmaxfield@apple.com>
2757
2758         Migrate CanvasRenderingContext's internal canvas pointer to a reference
2759         https://bugs.webkit.org/show_bug.cgi?id=164259
2760
2761         Reviewed by Dean Jackson.
2762
2763         It is never nullptr.
2764
2765         No new tests because there is no behavior change.
2766
2767         * html/HTMLCanvasElement.cpp:
2768         (WebCore::HTMLCanvasElement::getContext):
2769         * html/canvas/CanvasRenderingContext.cpp:
2770         (WebCore::CanvasRenderingContext::CanvasRenderingContext):
2771         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
2772         (WebCore::CanvasRenderingContext::checkOrigin):
2773         * html/canvas/CanvasRenderingContext.h:
2774         (WebCore::CanvasRenderingContext::ref):
2775         (WebCore::CanvasRenderingContext::deref):
2776         (WebCore::CanvasRenderingContext::canvas):
2777         (WebCore::CanvasRenderingContext::checkOrigin):
2778         * html/canvas/CanvasRenderingContext2D.cpp:
2779         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
2780         (WebCore::CanvasRenderingContext2D::unwindStateStack):
2781         (WebCore::CanvasRenderingContext2D::isAccelerated):
2782         (WebCore::CanvasRenderingContext2D::realizeSaves):
2783         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
2784         (WebCore::CanvasRenderingContext2D::setFillStyle):
2785         (WebCore::CanvasRenderingContext2D::setShadowColor):
2786         (WebCore::CanvasRenderingContext2D::resetTransform):
2787         (WebCore::CanvasRenderingContext2D::setStrokeColor):
2788         (WebCore::CanvasRenderingContext2D::setFillColor):
2789         (WebCore::CanvasRenderingContext2D::setShadow):
2790         (WebCore::CanvasRenderingContext2D::clearCanvas):
2791         (WebCore::CanvasRenderingContext2D::transformAreaToDevice):
2792         (WebCore::CanvasRenderingContext2D::rectContainsCanvas):
2793         (WebCore::CanvasRenderingContext2D::calculateCompositingBufferRect):
2794         (WebCore::CanvasRenderingContext2D::compositeBuffer):
2795         (WebCore::CanvasRenderingContext2D::createPattern):
2796         (WebCore::CanvasRenderingContext2D::didDrawEntireCanvas):
2797         (WebCore::CanvasRenderingContext2D::didDraw):
2798         (WebCore::CanvasRenderingContext2D::paintRenderingResultsToCanvas):
2799         (WebCore::CanvasRenderingContext2D::drawingContext):
2800         (WebCore::CanvasRenderingContext2D::getImageData):
2801         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
2802         (WebCore::CanvasRenderingContext2D::putImageData):
2803         (WebCore::CanvasRenderingContext2D::setFont):
2804         (WebCore::CanvasRenderingContext2D::toTextDirection):
2805         (WebCore::CanvasRenderingContext2D::direction):
2806         (WebCore::CanvasRenderingContext2D::platformLayer):
2807         * html/canvas/WebGL2RenderingContext.cpp:
2808         (WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
2809         * html/canvas/WebGL2RenderingContext.h:
2810         * html/canvas/WebGLRenderingContext.cpp:
2811         (WebCore::WebGLRenderingContext::WebGLRenderingContext):
2812         * html/canvas/WebGLRenderingContext.h:
2813         * html/canvas/WebGLRenderingContextBase.cpp:
2814         (WebCore::WebGLRenderingContextBase::create):
2815         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2816         (WebCore::WebGLRenderingContextBase::setupFlags):
2817         (WebCore::WebGLRenderingContextBase::markContextChanged):
2818         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
2819         (WebCore::WebGLRenderingContextBase::reshape):
2820         (WebCore::WebGLRenderingContextBase::isContextLostOrPending):
2821         (WebCore::WebGLRenderingContextBase::readPixels):
2822         (WebCore::WebGLRenderingContextBase::loseContextImpl):
2823         (WebCore::WebGLRenderingContextBase::printWarningToConsole):
2824         (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
2825         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
2826         (WebCore::WebGLRenderingContextBase::clampedCanvasSize):
2827         * html/canvas/WebGLRenderingContextBase.h:
2828
2829 2016-10-31  Brady Eidson  <beidson@apple.com>
2830
2831         Address style feedback in https://bugs.webkit.org/show_bug.cgi?id=164097
2832         https://bugs.webkit.org/show_bug.cgi?id=164248
2833
2834         Unreviewed. Addressing review feedback (and then some) from Darin Adler on earlier patch.
2835
2836         No new tests (No behavior change).
2837
2838         * Modules/indexeddb/IDBTransaction.cpp:
2839         (WebCore::IDBTransaction::commit):
2840         (WebCore::IDBTransaction::createObjectStore):
2841         (WebCore::IDBTransaction::renameObjectStore):
2842         (WebCore::IDBTransaction::createIndex):
2843         (WebCore::IDBTransaction::renameIndex):
2844         (WebCore::IDBTransaction::requestOpenCursor):
2845         (WebCore::IDBTransaction::doRequestOpenCursor):
2846         (WebCore::IDBTransaction::iterateCursor):
2847         (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
2848         (WebCore::IDBTransaction::requestGetRecord):
2849         (WebCore::IDBTransaction::requestGetValue):
2850         (WebCore::IDBTransaction::requestGetKey):
2851         (WebCore::IDBTransaction::requestIndexRecord):
2852         (WebCore::IDBTransaction::requestCount):
2853         (WebCore::IDBTransaction::requestDeleteRecord):
2854         (WebCore::IDBTransaction::requestClearObjectStore):
2855         (WebCore::IDBTransaction::requestPutOrAdd):
2856         (WebCore::IDBTransaction::deleteObjectStore):
2857         (WebCore::IDBTransaction::deleteIndex):
2858
2859         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2860         (WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
2861         (WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
2862         (WebCore::IDBClient::IDBConnectionProxy::renameIndex):
2863         (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
2864         (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
2865         (WebCore::IDBClient::IDBConnectionProxy::createIndex):
2866         (WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
2867         (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
2868         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
2869         (WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
2870         (WebCore::IDBClient::IDBConnectionProxy::getCount):
2871         (WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
2872         (WebCore::IDBClient::IDBConnectionProxy::openCursor):
2873         (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
2874
2875         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2876         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
2877         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
2878         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
2879         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
2880         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
2881         (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
2882         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
2883         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
2884         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
2885         (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
2886         (WebCore::IDBServer::MemoryIDBBackingStore::keyExistsInObjectStore):
2887         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
2888         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
2889         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
2890         (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
2891         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
2892         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
2893         (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
2894         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
2895         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
2896
2897         * Modules/indexeddb/shared/IDBResultData.cpp:
2898         (WebCore::IDBResultData::error):
2899         (WebCore::IDBResultData::openDatabaseSuccess):
2900         (WebCore::IDBResultData::openDatabaseUpgradeNeeded):
2901         (WebCore::IDBResultData::deleteDatabaseSuccess):
2902         (WebCore::IDBResultData::putOrAddSuccess):
2903         (WebCore::IDBResultData::getRecordSuccess):
2904         (WebCore::IDBResultData::getAllRecordsSuccess):
2905         (WebCore::IDBResultData::getCountSuccess):
2906         (WebCore::IDBResultData::openCursorSuccess):
2907         (WebCore::IDBResultData::iterateCursorSuccess):
2908
2909 2016-10-31  Ryosuke Niwa  <rniwa@webkit.org>
2910
2911         Enable custom elements by default everywhere
2912         https://bugs.webkit.org/show_bug.cgi?id=164242
2913
2914         Reviewed by Antti Koivisto.
2915
2916         Set the status of Custom Elements API to "Done".
2917
2918         * features.json:
2919
2920 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
2921
2922         Unreviewed, rolling out r207967.
2923
2924         This change seems to be the cause of at least one LayoutTest
2925         becoming flaky.
2926
2927         Reverted changeset:
2928
2929         "REGRESSION(r207753-207755): ASSERTION FAILED:
2930         m_parsedStyleSheetCache->isInMemoryCache()"
2931         https://bugs.webkit.org/show_bug.cgi?id=163905
2932         http://trac.webkit.org/changeset/207967
2933
2934 2016-10-31  Joseph Pecoraro  <pecoraro@apple.com>
2935
2936         Web Inspector: Shadow DOM scoped styles are missing
2937         https://bugs.webkit.org/show_bug.cgi?id=164247
2938         <rdar://problem/29035061>
2939
2940         Reviewed by Antti Koivisto.
2941
2942         Test: inspector/css/shadow-scoped-style.html
2943
2944         * css/ElementRuleCollector.cpp:
2945         (WebCore::ElementRuleCollector::matchAuthorRules):
2946         Only match :host pseudo class for NOPSEUDO. It doesn't make sense
2947         with a pseudo element request (:host::before does not make sense).
2948
2949         * css/InspectorCSSOMWrappers.h:
2950         * css/InspectorCSSOMWrappers.cpp:
2951         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
2952         (WebCore::InspectorCSSOMWrappers::collectDocumentWrappers):
2953         (WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
2954         Simplify existing "once per document" wrapper collection.
2955
2956         (WebCore::InspectorCSSOMWrappers::maybeCollectFromStyleSheets):
2957         (WebCore::InspectorCSSOMWrappers::collectScopeWrappers):
2958         Include a path to add style sheets that weren't already collected.
2959         This will be useful when trying the StyleScope stylesheets which
2960         are different for different nodes.
2961
2962         * inspector/InspectorCSSAgent.cpp:
2963         (WebCore::containingStyleScopeForElement):        
2964         (WebCore::InspectorCSSAgent::buildObjectForRule):
2965         Collect rules for document and StyleScope sheets separately.
2966         For elements with a shadow root, add the root's sheets as
2967         well in case there are :host rules that affect the element.
2968
2969 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
2970
2971         Unreviewed, rolling out r208180.
2972
2973         This change caused fast/shadow-dom/slotted-pseudo-element-css-
2974         text.html to crash on macOS and iOS on every test run.
2975
2976         Reverted changeset:
2977
2978         "[CSS Parser] Support the shadow DOM"
2979         https://bugs.webkit.org/show_bug.cgi?id=164240
2980         http://trac.webkit.org/changeset/208180
2981
2982 2016-10-31  Nan Wang  <n_wang@apple.com>
2983
2984         AX: aria-sort is not exposed on iOS
2985         https://bugs.webkit.org/show_bug.cgi?id=164245
2986
2987         Reviewed by Chris Fleizach.
2988
2989         Exposed the aria-sort attribute value in accessibilitySortDirection.
2990
2991         Test: accessibility/ios-simulator/aria-sort-ios.html
2992
2993         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2994         (-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
2995
2996 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
2997
2998         Unreviewed, rolling out r208178.
2999
3000         The test added with this change fails or times out on macOS
3001         and iOS.
3002
3003         Reverted changeset:
3004
3005         "[Modern Media Controls] Media Controller: Airplay support"
3006         https://bugs.webkit.org/show_bug.cgi?id=163729
3007         http://trac.webkit.org/changeset/208178
3008
3009 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
3010
3011         Unreviewed, rolling out r208182.
3012
3013         Both of the tests added with this change time out on macOS
3014         Release.
3015
3016         Reverted changeset:
3017
3018         "[Modern Media Controls] Media Controller: Placard support"
3019         https://bugs.webkit.org/show_bug.cgi?id=163731
3020         http://trac.webkit.org/changeset/208182
3021
3022 2016-10-31  Brady Eidson  <beidson@apple.com>
3023
3024         IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
3025         <rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
3026
3027         Reviewed by Darin Adler.
3028
3029         Tests: storage/indexeddb/modern/idbobjectstore-getall-1-private.html
3030                storage/indexeddb/modern/idbobjectstore-getall-1.html
3031                storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html
3032                storage/indexeddb/modern/idbobjectstore-getallkeys-1.html
3033                Existing imported W3C tests.
3034
3035         - Add new objects for "IDBGetAllRequestData" and "IDBGetAllResult" to represent these
3036           new requests and responses.
3037         - Add lots of boilerplate code to move these new objects around in the IDB machinery.
3038         - Update "GetRecord" code to be shared with "GetAll" code where necessary.
3039         - Other tweaks here and there.
3040
3041         * WebCore.xcodeproj/project.pbxproj:
3042         * CMakeLists.txt:
3043
3044         * Modules/indexeddb/IDBGetAllResult.cpp: Added.
3045         (WebCore::isolatedCopyOfVariant):
3046         (WebCore::IDBGetAllResult::isolatedCopy):
3047         (WebCore::IDBGetAllResult::addKey):
3048         (WebCore::IDBGetAllResult::addValue):
3049         (WebCore::IDBGetAllResult::keys):
3050         (WebCore::IDBGetAllResult::values):
3051         (WebCore::IDBGetAllResult::allBlobFilePaths):
3052         * Modules/indexeddb/IDBGetAllResult.h: Added.
3053         (WebCore::IDBGetAllResult::IDBGetAllResult):
3054         (WebCore::IDBGetAllResult::type):
3055         (WebCore::IDBGetAllResult::encode):
3056         (WebCore::IDBGetAllResult::decode):
3057
3058         * Modules/indexeddb/IDBObjectStore.cpp:
3059         (WebCore::IDBObjectStore::getAll):
3060         (WebCore::IDBObjectStore::getAllKeys):
3061         * Modules/indexeddb/IDBObjectStore.h:
3062         * Modules/indexeddb/IDBObjectStore.idl:
3063
3064         * Modules/indexeddb/IDBRequest.cpp:
3065         (WebCore::IDBRequest::setResult):
3066         * Modules/indexeddb/IDBRequest.h:
3067
3068         * Modules/indexeddb/IDBTransaction.cpp:
3069         (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
3070         (WebCore::IDBTransaction::getAllRecordsOnServer):
3071         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
3072         * Modules/indexeddb/IDBTransaction.h:
3073
3074         * Modules/indexeddb/IndexedDB.h:
3075
3076         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3077         (WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
3078         * Modules/indexeddb/client/IDBConnectionProxy.h:
3079
3080         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3081         (WebCore::IDBClient::IDBConnectionToServer::getAllRecords):
3082         (WebCore::IDBClient::IDBConnectionToServer::didGetAllRecords):
3083         * Modules/indexeddb/client/IDBConnectionToServer.h:
3084         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3085
3086         * Modules/indexeddb/server/IDBBackingStore.h:
3087
3088         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
3089         (WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
3090         * Modules/indexeddb/server/IDBConnectionToClient.h:
3091         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
3092
3093         * Modules/indexeddb/server/IDBServer.cpp:
3094         (WebCore::IDBServer::IDBServer::getAllRecords):
3095         * Modules/indexeddb/server/IDBServer.h:
3096
3097         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3098         (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
3099         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3100
3101         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3102         (WebCore::IDBServer::MemoryObjectStore::getAllRecords):
3103         * Modules/indexeddb/server/MemoryObjectStore.h:
3104
3105         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3106         (WebCore::IDBServer::queryForGetAllRecords):
3107         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
3108         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3109
3110         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3111         (WebCore::IDBServer::UniqueIDBDatabase::hasAnyPendingCallbacks):
3112         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
3113         (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
3114         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllRecords):
3115         (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetAllRecords):
3116         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
3117         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3118
3119         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3120         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
3121         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
3122
3123         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: Added.
3124         (WebCore::IDBGetAllRecordsData::isolatedCopy):
3125         * Modules/indexeddb/shared/IDBGetAllRecordsData.h: Added.
3126         (WebCore::IDBGetAllRecordsData::encode):
3127         (WebCore::IDBGetAllRecordsData::decode):
3128
3129         * Modules/indexeddb/shared/IDBResultData.cpp:
3130         (WebCore::IDBResultData::IDBResultData):
3131         (WebCore::IDBResultData::getAllRecordsSuccess):
3132         (WebCore::IDBResultData::getAllResult):
3133         * Modules/indexeddb/shared/IDBResultData.h:
3134         (WebCore::IDBResultData::encode):
3135         (WebCore::IDBResultData::decode):
3136
3137         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3138         (WebCore::InProcessIDBServer::didGetAllRecords):
3139         (WebCore::InProcessIDBServer::getAllRecords):
3140         * Modules/indexeddb/shared/InProcessIDBServer.h:
3141
3142         * bindings/js/IDBBindingUtilities.cpp:
3143         (WebCore::deserializeIDBValueToJSValue):
3144         (WebCore::toJS):
3145         * bindings/js/IDBBindingUtilities.h:
3146
3147 2016-10-31  Ryosuke Niwa  <rniwa@webkit.org>
3148
3149         GTK+ and EFL build fixes after r208176.
3150
3151         * css/PropertySetCSSStyleDeclaration.cpp:
3152
3153 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
3154
3155         Fix #include case.
3156
3157         * page/IntersectionObserverEntry.h:
3158
3159 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3160
3161         [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
3162         https://bugs.webkit.org/show_bug.cgi?id=164236
3163         <rdar://problem/28747712>
3164
3165         Reviewed by Beth Dakin.
3166
3167         Moves state that keeps track of whether or not a dictionary lookup is active from the WebPage to the Editor, so
3168         that when clicking a text field or contenteditable in WK1 or WK2, we are able to avoid notifying the
3169         WebEditorClient of the selection change.
3170
3171         Changes to WK2 are covered by existing unit tests in WKWebViewCandidateTests which verify that clicking does not
3172         thrash candidate list visibility. A similar test will be added in the future for the WK1 case in CandidateTests.
3173
3174         * editing/Editor.h:
3175         (WebCore::Editor::setIsGettingDictionaryPopupInfo):
3176         (WebCore::Editor::isGettingDictionaryPopupInfo):
3177
3178 2016-10-31  Antoine Quint  <graouts@apple.com>
3179
3180         [Modern Media Controls] Media Controller: Placard support
3181         https://bugs.webkit.org/show_bug.cgi?id=163731
3182         <rdar://problem/28869598>
3183
3184         Reviewed by Dean Jackson.
3185
3186         We introduce the PlacardSupport class which brings support for showing the
3187         appropriate placard when the media is played via AirPlay or in picture-in-picture.
3188
3189         Tests: media/modern-media-controls/placard-support/placard-support-airplay.html
3190                media/modern-media-controls/placard-support/placard-support-pip.html
3191
3192         * Modules/modern-media-controls/js-files:
3193         * Modules/modern-media-controls/media/media-controller.js:
3194         (MediaController):
3195         * Modules/modern-media-controls/media/placard-support.js: Added.
3196         (PlacardSupport):
3197         (PlacardSupport.prototype.get mediaEvents):
3198         (PlacardSupport.prototype.handleEvent):
3199         (PlacardSupport.prototype._updatePlacard):
3200         * WebCore.xcodeproj/project.pbxproj:
3201
3202 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
3203
3204         Implement IntersectionObserver
3205         https://bugs.webkit.org/show_bug.cgi?id=159475
3206
3207         Reviewed by Ryosuke Niwa.
3208         
3209         Add bindings support for Intersection Observer
3210         <https://wicg.github.io/IntersectionObserver/>
3211         
3212         Code is wrapped in ENABLE(INTERSECTION_OBSERVER), and controlled by a runtime
3213         Setting (off by default for now).
3214         
3215         A minor bindings change was required to fix the callback code.
3216         
3217         IntersectionObserver is just a shell for now.
3218
3219         Tests: intersection-observer/intersection-observer-entry-interface.html
3220                intersection-observer/intersection-observer-interface.html
3221
3222         * CMakeLists.txt:
3223         * Configurations/FeatureDefines.xcconfig:
3224         * DerivedSources.make:
3225         * WebCore.xcodeproj/project.pbxproj:
3226         * bindings/scripts/CodeGeneratorJS.pm:
3227         (ShouldPassWrapperByReference):
3228         * bindings/scripts/test/JS/JSTestObj.cpp:
3229         (WebCore::JSTestObjConstructor::construct):
3230         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3231         (WebCore::JSTestTypedefsConstructor::construct):
3232         * page/IntersectionObserver.cpp: Added.
3233         (WebCore::IntersectionObserver::IntersectionObserver):
3234         (WebCore::IntersectionObserver::observe):
3235         (WebCore::IntersectionObserver::unobserve):
3236         (WebCore::IntersectionObserver::disconnect):
3237         (WebCore::IntersectionObserver::takeRecords):
3238         * page/IntersectionObserver.h: Added.
3239         (WebCore::IntersectionObserver::create):
3240         (WebCore::IntersectionObserver::root):
3241         (WebCore::IntersectionObserver::rootMargin):
3242         (WebCore::IntersectionObserver::thresholds):
3243         * page/IntersectionObserver.idl: Added.
3244         * page/IntersectionObserverCallback.h: Added.
3245         (WebCore::IntersectionObserverCallback::~IntersectionObserverCallback):
3246         * page/IntersectionObserverCallback.idl: Added.
3247         * page/IntersectionObserverEntry.cpp: Added.
3248         (WebCore::IntersectionObserverEntry::IntersectionObserverEntry):
3249         * page/IntersectionObserverEntry.h: Added.
3250         (WebCore::IntersectionObserverEntry::create):
3251         (WebCore::IntersectionObserverEntry::time):
3252         (WebCore::IntersectionObserverEntry::rootBounds):
3253         (WebCore::IntersectionObserverEntry::boundingClientRect):
3254         (WebCore::IntersectionObserverEntry::intersectionRect):
3255         (WebCore::IntersectionObserverEntry::target):
3256         (WebCore::IntersectionObserverEntry::intersectionRatio):
3257         * page/IntersectionObserverEntry.idl: Added.
3258         * page/Settings.in:
3259
3260 2016-10-31  Dave Hyatt  <hyatt@apple.com>
3261
3262         [CSS Parser] Support the shadow DOM
3263         https://bugs.webkit.org/show_bug.cgi?id=164240
3264
3265         Reviewed by Dean Jackson.
3266
3267         * css/CSSSelector.cpp:
3268         (WebCore::CSSSelector::selectorText):
3269         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
3270         ShadowDescendant combinator.
3271
3272         * css/CSSSelector.h:
3273         * css/SelectorChecker.cpp:
3274         (WebCore::SelectorChecker::matchRecursively):
3275         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
3276         ShadowDescendant combinator.
3277
3278         * css/SelectorFilter.cpp:
3279         (WebCore::SelectorFilter::collectIdentifierHashes):
3280         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
3281         ShadowDescendant combinator.
3282
3283         * css/SelectorPseudoElementTypeMap.in:
3284         Add support for slotted.
3285
3286         * css/parser/CSSParserValues.cpp:
3287         (WebCore::CSSParserSelector::appendTagHistory):
3288         * css/parser/CSSParserValues.h:
3289         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
3290         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
3291         ShadowDescendant combinator. Take :slotted out of
3292         needsImplicitShadowCombinatorForMatching(), since our code doesn't do
3293         this for :slotted.
3294
3295         * css/parser/CSSSelectorParser.cpp:
3296         (WebCore::isPseudoClassFunction):
3297         :host can be both an id and a function, so don't restrict it.
3298
3299         (WebCore::CSSSelectorParser::consumePseudo):
3300         Put in a hack for :host (inside the hack we already plan on removing
3301         once we turn on).
3302
3303         (WebCore::CSSSelectorParser::consumeCombinator):
3304         Remove deep shadow combinator support, as we don't support matching
3305         on it.
3306
3307         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
3308         (WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
3309         Make the split use our combinator, ShadowDescendant, and no longer do anything
3310         special with :slotted.
3311
3312         * cssjit/SelectorCompiler.cpp:
3313         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
3314         Remove ShadowDeep, ShadowSlot and ShadowPseudo in favor of our
3315         ShadowDescendant combinator.
3316
3317 2016-10-31  Joseph Pecoraro  <pecoraro@apple.com>
3318
3319         Use #pragma once in WebCore
3320         https://bugs.webkit.org/show_bug.cgi?id=164194
3321
3322         Rubber-stamped by Sam Weinig.
3323
3324         * accessibility/*.h:
3325         * bindings/*.h:
3326         * contentextensions/*.h:
3327         * dom/*.h:
3328         * html/*.h:
3329         * page/*.h:
3330         Use #pragma once in headers.
3331
3332         * html/parser/ParsingUtilities.h:
3333         Add missing namespace.
3334
3335         * html/track/VTTScanner.h:
3336         (WebCore::VTTScanner::skipWhile):
3337         (WebCore::VTTScanner::skipUntil):
3338         (WebCore::VTTScanner::collectWhile):
3339         (WebCore::VTTScanner::collectUntil):
3340         Include namespace.
3341
3342 2016-10-31  Antoine Quint  <graouts@apple.com>
3343
3344         [Modern Media Controls] Media Controller: Airplay support
3345         https://bugs.webkit.org/show_bug.cgi?id=163729
3346
3347         Reviewed by Dean Jackson.
3348
3349         We introduce the AirplaySupport class which brings support for playing the media
3350         via Airplay by clicking on the Airplay button in the media controls and correctly
3351         reflecting when the media is played through Airplay via the media API. The enabled
3352         state of the Airplay button is also tied to Airplay sources being available.
3353
3354         Test: media/modern-media-controls/airplay-support/airplay-support.html
3355
3356         * Modules/modern-media-controls/controls/airplay-button.js:
3357         (AirplayButton.prototype.get on):
3358         * Modules/modern-media-controls/js-files:
3359         * Modules/modern-media-controls/media/airplay-support.js: Added.
3360         (AirplaySupport.prototype.get control):
3361         (AirplaySupport.prototype.get mediaEvents):
3362         (AirplaySupport.prototype.buttonWasClicked):
3363         (AirplaySupport.prototype.handleEvent):
3364         (AirplaySupport.prototype.syncControl):
3365         (AirplaySupport):
3366         * Modules/modern-media-controls/media/media-controller.js:
3367         (MediaController):
3368         * WebCore.xcodeproj/project.pbxproj:
3369
3370 2016-10-31  Joseph Pecoraro  <pecoraro@apple.com>
3371
3372         Web Inspector: Provide an opportunity to clear ScriptValues associated with debugged target
3373         https://bugs.webkit.org/show_bug.cgi?id=164167
3374         <rdar://problem/29010148>
3375
3376         Reviewed by Mark Lam.
3377
3378         * inspector/InspectorController.cpp:
3379         (WebCore::InspectorController::inspectedPageDestroyed):
3380         Page is going away, discard values.
3381
3382         * inspector/WorkerInspectorController.h:
3383         * inspector/WorkerInspectorController.cpp:
3384         (WebCore::WorkerInspectorController::workerTerminating):
3385         Worker is going away, discard values.
3386
3387 2016-10-31  Ryosuke Niwa  <rniwa@webkit.org>
3388
3389         CSSStyleDeclaration should be annotated with CEReactions
3390         https://bugs.webkit.org/show_bug.cgi?id=163968
3391
3392         Reviewed by Antti Koivisto.
3393
3394         Added CEReactions to CSSStyleDeclaration.idl.
3395
3396         Test: fast/custom-elements/reactions/CSSStyleDeclaration.html
3397
3398         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3399         (WebCore::JSCSSStyleDeclaration::putDelegate):
3400         * css/CSSStyleDeclaration.idl:
3401         * css/PropertySetCSSStyleDeclaration.cpp:
3402         (WebCore::StyleAttributeMutationScope::StyleAttributeMutationScope): Remember the old value when this is
3403         an inline style declaration for a custom element. Also store m_oldValue and m_customElement instead of
3404         a mutation record so that we don't create a superfluous mutation record for custom elements.
3405         (WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope): Enqueue attributeChangedCallback
3406         when m_customElement is not null.
3407         * dom/CustomElementReactionQueue.cpp:
3408         (WebCore::CustomElementReactionQueue::observesStyleAttribute):
3409         * dom/CustomElementReactionQueue.h:
3410
3411 2016-10-31  Jer Noble  <jer.noble@apple.com>
3412
3413         Unreviewed build fix for the build fix; AVStreamDataParser not defined on iOS.
3414
3415         * platform/spi/mac/AVFoundationSPI.h:
3416
3417 2016-10-31  Zalan Bujtas  <zalan@apple.com>
3418
3419         LayoutTests/fast/frames/invalid-frameset.html is not clean by the end of FrameView::layout().
3420         https://bugs.webkit.org/show_bug.cgi?id=164230
3421
3422         Reviewed by Simon Fraser.
3423
3424         When a <frameset> has invalid children, in addition to clear the needs layout flag on the children
3425         we also need to do clear the descendants too.
3426
3427         Covered by LayoutTests/fast/frames/invalid-frameset.html.
3428
3429         * rendering/RenderFrameSet.cpp:
3430         (WebCore::RenderFrameSet::positionFrames):
3431
3432 2016-10-31  Jer Noble  <jer.noble@apple.com>
3433
3434         Unreviewed build fix after r208151; outputMIMECodecParameterForInputMIMECodecParameter not
3435         defined pre-Sierra.
3436
3437         * platform/spi/mac/AVFoundationSPI.h:
3438
3439 2016-10-31  Zalan Bujtas  <zalan@apple.com>
3440
3441         ASSERTION FAILED: !m_trailingWhitespaceWidth in WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace
3442         https://bugs.webkit.org/show_bug.cgi?id=164076
3443
3444         Reviewed by Antti Koivisto.
3445
3446         FontCascade's text measure methods return NaN for zero sized fonts. We could actually early return and not
3447         measure text with zero font size at all.
3448
3449         Test: fast/text/simple-line-layout-with-zero-sized-font.html
3450
3451         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3452         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
3453         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
3454
3455 2016-10-31  Dave Hyatt  <hyatt@apple.com>
3456
3457         [CSS Parser] Support -webkit-named-image
3458         https://bugs.webkit.org/show_bug.cgi?id=164235
3459
3460         Reviewed by Dean Jackson.
3461
3462         * css/CSSValueKeywords.in:
3463         * css/parser/CSSPropertyParserHelpers.cpp:
3464         (WebCore::CSSPropertyParserHelpers::consumeWebkitNamedImage):
3465         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
3466         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
3467
3468 2016-10-28  Brent Fulgham  <bfulgham@apple.com>
3469
3470         Do a better job of protecting Frame objects in the context of JavaScript calls
3471         https://bugs.webkit.org/show_bug.cgi?id=164163
3472         <rdar://problem/28955249>
3473
3474         Reviewed by Darin Adler.
3475
3476         * editing/AlternativeTextController.cpp:
3477         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Protected the Frame.
3478         * editing/Editor.cpp:
3479         (WebCore::Editor::setTextAsChildOfElement): Ditto.
3480         * editing/EditorCommand.cpp:
3481         (WebCore::executeSwapWithMark): Ditto.
3482         * editing/TypingCommand.cpp:
3483         (WebCore::TypingCommand::deleteKeyPressed): Ditto.
3484         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
3485         * editing/mac/EditorMac.mm:
3486         (WebCore::Editor::replaceNodeFromPasteboard): Ditto.
3487         * page/ContextMenuController.cpp:
3488         (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
3489         * page/DOMSelection.cpp:
3490         (WebCore::DOMSelection::collapse): Ditto.
3491         (WebCore::DOMSelection::collapseToEnd): Ditto.
3492         (WebCore::DOMSelection::collapseToStart): Ditto.
3493         (WebCore::DOMSelection::setBaseAndExtent): Ditto.
3494         (WebCore::DOMSelection::setPosition): Ditto.
3495         (WebCore::DOMSelection::modify): Ditto.
3496         (WebCore::DOMSelection::extend): Ditto.
3497         (WebCore::DOMSelection::addRange): Ditto.
3498         (WebCore::DOMSelection::deleteFromDocument): Ditto.
3499         * page/DragController.cpp:
3500         (WebCore::setSelectionToDragCaret): Ditto.
3501         (WebCore::DragController::startDrag): Ditto.
3502         * page/Frame.cpp:
3503         (WebCore::Frame::checkOverflowScroll): Ditto.
3504         * page/TextIndicator.cpp:
3505         (WebCore::TextIndicator::createWithRange): Ditto.
3506
3507 2016-10-31  Dave Hyatt  <hyatt@apple.com>
3508
3509         [CSS Parser] Make sure to fail on :role(a,b) and :dir(a,b)
3510         https://bugs.webkit.org/show_bug.cgi?id=164233
3511
3512         Reviewed by Dean Jackson.
3513
3514         * css/parser/CSSSelectorParser.cpp:
3515         (WebCore::CSSSelectorParser::consumePseudo):
3516
3517 2016-10-31  Dave Hyatt  <hyatt@apple.com>
3518
3519         [CSS Parser] Allow unitless values on background-size in quirks mode
3520         https://bugs.webkit.org/show_bug.cgi?id=164232
3521
3522         Reviewed by Dean Jackson.
3523
3524         * css/parser/CSSPropertyParser.cpp:
3525         (WebCore::consumeBackgroundSize):
3526
3527 2016-10-31  Jer Noble  <jer.noble@apple.com>
3528
3529         Unreviewed build fix after r208151; _setPreventsSleepDuringVideoPlayback: only defined in non-simulator SDKs.
3530
3531         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3532         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3533         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
3534         * platform/spi/mac/AVFoundationSPI.h:
3535
3536 2016-10-31  Nan Wang  <n_wang@apple.com>
3537
3538         AX: iOS Voiceover does not announce previously selected value from input type="date" form field
3539         https://bugs.webkit.org/show_bug.cgi?id=164176
3540
3541         Reviewed by Chris Fleizach.
3542
3543         Input type date is a popup button on iOS and its value was not exposed in stringValue() since
3544         it's not considered a text control. Instead, the value was exposed in AXTitle. Fixed this by adding
3545         the case in stringValue() and removing the AXTitle exposure.
3546
3547         Changes are covered in modified test.
3548
3549         * accessibility/AccessibilityObject.h:
3550         * accessibility/AccessibilityRenderObject.cpp:
3551         (WebCore::AccessibilityRenderObject::stringValue):
3552         * accessibility/ios/AccessibilityObjectIOS.mm:
3553         (WebCore::AccessibilityObject::isInputTypePopupButton):
3554         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3555         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
3556
3557 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
3558
3559         Add requestIdleCallback to features.json.
3560
3561         * features.json:
3562
3563 2016-10-31  Dave Hyatt  <hyatt@apple.com>
3564
3565         [CSS Parser] Fully support prefixed background-size and box-shadows
3566         https://bugs.webkit.org/show_bug.cgi?id=164228
3567
3568         Reviewed by Zalan Bujtas.
3569
3570         * css/parser/CSSPropertyParser.cpp:
3571         (WebCore::CSSPropertyParser::parseSingleValue):
3572
3573 2016-10-31  Dave Hyatt  <hyatt@apple.com>
3574
3575         [CSS Parser] Get rid of CSSCustomIdentValue::creates
3576         https://bugs.webkit.org/show_bug.cgi?id=164225
3577
3578         Reviewed by Zalan Bujtas.
3579
3580         Get rid of all instances of CSSCustomIdent::create, since our style
3581         resolution code isn't prepared to handle that value type yet.
3582
3583         * css/parser/CSSPropertyParser.cpp:
3584         (WebCore::consumeAnimationName):
3585         (WebCore::consumeTransitionProperty):
3586         (WebCore::consumeAttr):
3587
3588 2016-10-31  Jer Noble  <jer.noble@apple.com>
3589
3590         Opt-out of AVPlayer automatic sleep disabling
3591         https://bugs.webkit.org/show_bug.cgi?id=163983
3592
3593         Reviewed by Eric Carlson.
3594
3595         In addition to the DisplaySleepDisabler, notify the MediaPlayerPrivateAVFoundationObjC object whether
3596         it should disable display sleep.  Provide all the necessary boilerplate to allow the media player private
3597         to query the HTMLMediaPlayer so that the correct value can be set on AVPlayer upon creation.
3598
3599         * html/HTMLMediaElement.cpp:
3600         (WebCore::HTMLMediaElement::updateSleepDisabling):
3601         * html/HTMLMediaElement.h:
3602         * platform/graphics/MediaPlayer.cpp:
3603         (WebCore::MediaPlayer::setShouldDisableSleep):
3604         (WebCore::MediaPlayer::shouldDisableSleep):
3605         * platform/graphics/MediaPlayer.h:
3606         (WebCore::MediaPlayerClient::mediaPlayerShouldDisableSleep):
3607         * platform/graphics/MediaPlayerPrivate.h:
3608         (WebCore::MediaPlayerPrivateInterface::setShouldDisableSleep):
3609         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3610         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3611         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3612         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
3613
3614         Drive-by fix: Re-organize the contents of AVFoundationSPI.h so that there's a single top-level
3615         #if USE(APPLE_INTERNAL_SDK) statement, rather than that conditional being sprinkled about the
3616         file.
3617
3618         * platform/spi/mac/AVFoundationSPI.h:
3619
3620 2016-10-31  Jer Noble  <jer.noble@apple.com>
3621
3622         REGRESSION (r206300): LayoutTest media/media-source/media-source-duplicate-seeked.html timing out
3623         https://bugs.webkit.org/show_bug.cgi?id=162496
3624
3625         Reviewed by Darin Adler.
3626
3627         The change to MockMediaSourcePrivate in r206300 revealed a true bug: seeks to the MediaSource's duration
3628         will always fail. We should discard out of hand seeks which are greater than the duration, but allow seeks
3629         directly to the duration.
3630
3631         * Modules/mediasource/MediaSource.cpp:
3632         (WebCore::MediaSource::hasBufferedTime):
3633
3634 2016-10-31  Jer Noble  <jer.noble@apple.com>
3635
3636         Allow multiple playing videos on a page with 'autoplay' and 'playsinline' attributes
3637         https://bugs.webkit.org/show_bug.cgi?id=162366
3638         <rdar://problem/28639600>
3639
3640         Reviewed by Eric Carlson.
3641
3642         Tests: media/video-concurrent-visible-playback.html
3643                media/video-multiple-concurrent-playback.html
3644
3645         Separate out the concept of "video-only" from "video-with-audio" in PlatformMediaSession::MediaType,
3646         and only set the ConcurrentPlaybackNotPermitted restriction for "video-with-audio".  This allows multiple
3647         silent video elements to play back simultaneously.
3648
3649         However, the bug in question also shows bad behavior when both concurrent playback and invisible playback
3650         are not allowed. Namely, an invisible element will attempt to autoplay, interrupt visible elements, and
3651         then fail to play due to it's non-visibility.  Add an extra check to canTransitionFromAutoplayToPlay()
3652         which asks the session if autoplay is allowed (which will return false if the element is not visible).
3653
3654         * html/HTMLMediaElement.cpp:
3655         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
3656         (WebCore::HTMLMediaElement::mediaType):
3657         (WebCore::HTMLMediaElement::presentationType):
3658         (WebCore::HTMLMediaElement::updateShouldAutoplay):
3659         (WebCore::mediaElementIsAllowedToAutoplay): Deleted.
3660         * html/MediaElementSession.cpp:
3661         (WebCore::MediaElementSession::autoplayPermitted):
3662         * html/MediaElementSession.h:
3663         * platform/audio/PlatformMediaSession.h:
3664         * platform/audio/ios/MediaSessionManagerIOS.mm:
3665         (WebCore::MediaSessionManageriOS::resetRestrictions):
3666         * testing/Internals.cpp:
3667         (WebCore::Internals::setMediaSessionRestrictions):
3668
3669 2016-10-31  Dave Hyatt  <hyatt@apple.com>
3670
3671         [CSS Parser] Support unprefixed cross-fade
3672         https://bugs.webkit.org/show_bug.cgi?id=164224
3673
3674         Reviewed by Zalan Bujtas.
3675
3676         * css/CSSValueKeywords.in:
3677         * css/parser/CSSPropertyParserHelpers.cpp:
3678         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
3679         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
3680
3681 2016-10-31  Dave Hyatt  <hyatt@apple.com>
3682
3683         [CSS Parser] Simplify background-position-x/y style mapping
3684         https://bugs.webkit.org/show_bug.cgi?id=164223
3685
3686         Reviewed by Zalan Bujtas.
3687
3688         * css/CSSToStyleMap.cpp:
3689         (WebCore::CSSToStyleMap::mapFillXPosition):
3690         (WebCore::CSSToStyleMap::mapFillYPosition):
3691         * css/StyleBuilderConverter.h:
3692         (WebCore::StyleBuilderConverter::convertFontSynthesis):
3693
3694 2016-10-31  Darin Adler  <darin@apple.com>
3695
3696         Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
3697         https://bugs.webkit.org/show_bug.cgi?id=164214
3698
3699         Reviewed by Alex Christensen.
3700
3701         * Modules/fetch/FetchRequest.cpp:
3702         (WebCore::FetchRequest::initializeOptions): Use FetchHeaders& instead of
3703         Ref<FetchHeaders> for return value.
3704         (WebCore::FetchRequest::initializeWith): Ditto.
3705         * Modules/fetch/FetchRequest.h: Updated for above.
3706
3707         * Modules/mediasource/MediaSource.cpp:
3708         (WebCore::MediaSource::addSourceBuffer): Use SourceBuffer& instead of
3709         SourceBuffer* for return value.
3710         * Modules/mediasource/MediaSource.h: Updated for above.
3711
3712         * bindings/js/JSDOMBinding.h: Added overloads of checkSecurityForNode so
3713         it works with a function returning a reference.
3714
3715         * css/CSSPrimitiveValue.cpp:
3716         (WebCore::CSSPrimitiveValue::getCounterValue): Use Counter& instead of
3717         Counter* for return value.
3718         (WebCore::CSSPrimitiveValue::getRectValue): Use Rect& instead of
3719         Rect* for return value.
3720         * css/CSSPrimitiveValue.h: Updated for above.
3721
3722         * dom/ChildNode.idl: Use non-legacy exceptions.
3723
3724         * dom/ContainerNode.cpp:
3725         (WebCore::ContainerNode::querySelector): Use ExceptionOr.
3726         (WebCore::ContainerNode::querySelectorAll): Ditto.
3727         (WebCore::ContainerNode::append): Ditto.
3728         (WebCore::ContainerNode::prepend): Ditto.
3729         * dom/ContainerNode.h: Updated for above.
3730
3731         * dom/Document.cpp:
3732         (WebCore::Document::selectorQueryForString): Use ExceptionOr.
3733         * dom/Document.h: Updated for above.
3734
3735         * dom/Element.cpp:
3736         (WebCore::Element::attachShadow): Return ShadowRoot& instead of
3737         Ref<ShadowRoot> since the shadow root is owned by the element, not
3738         the caller.
3739         (WebCore::Element::matches): Updated for change to make the
3740         selectorQueryForString function use ExceptionOr.
3741         (WebCore::Element::closest): Ditto.
3742         (WebCore::contextNodeForInsertion): Return ContainerNode& instead of
3743         ContainerNode*.
3744         (WebCore::contextElementForInsertion): Updated for above.
3745         * dom/Element.h: Updated for above.
3746         * dom/Element.idl: Changed return type for closest and for
3747         insertAdjacentElement to be nullable since both can return null.
3748
3749         * dom/ExceptionOr.h: Added a specialization for ExceptionOr<T&>.
3750
3751         * dom/Node.cpp:
3752         (WebCore::Node::convertNodesOrStringsIntoNode): Use ExceptionOr.
3753         (WebCore::Node::before): Ditto.
3754         (WebCore::Node::after): Ditto.
3755         (WebCore::Node::replaceWith): Ditto.
3756         * dom/Node.h: Updated for above changes.
3757
3758         * dom/ParentNode.idl: Use non-legacy exceptions.
3759
3760         * dom/SelectorQuery.cpp:
3761         (WebCore::SelectorDataList::queryAll): Changed return type to Ref.
3762         (WebCore::SelectorQueryCache::add): Use ExceptionOr.
3763         * dom/SelectorQuery.h: Updated for above changes.
3764
3765         * html/HTMLFrameOwnerElement.cpp:
3766         (WebCore::HTMLFrameOwnerElement::getSVGDocument): Return
3767         Document& instead of Document*.
3768         * html/HTMLFrameOwnerElement.h: Updated for above change.
3769
3770         * html/HTMLMediaElement.cpp:
3771         (WebCore::HTMLMediaElement::addTextTrack): Return TextTrack&
3772         instead of Ref<TextTrack>.
3773         * html/HTMLMediaElement.h: Updated for above.
3774
3775         * html/HTMLPlugInImageElement.cpp:
3776         (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay):
3777         Updated for new exceptions.
3778         * inspector/InspectorDOMAgent.cpp:
3779         (WebCore::InspectorDOMAgent::querySelector): Ditto.
3780         (WebCore::InspectorDOMAgent::querySelectorAll): Ditto.
3781         (WebCore::InspectorDOMAgent::performSearch): Ditto.
3782         (WebCore::InspectorDOMAgent::highlightSelector): Ditto.
3783
3784         * inspector/InspectorNodeFinder.cpp:
3785         (WebCore::InspectorNodeFinder::performSearch): Put a null check
3786         here so callers don't have to do it. Pass references to the
3787         individual functions since the pointer can't be null.
3788         (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
3789         Updated to use reference and streamlined code a bit, using
3790         containsIgnoringASCIICase instead of findIgnoringCase.
3791         (WebCore::InspectorNodeFinder::matchesAttribute): Ditto.
3792         (WebCore::InspectorNodeFinder::matchesElement): Ditto.
3793         (WebCore::InspectorNodeFinder::searchUsingXPath): Ditto.
3794         (WebCore::InspectorNodeFinder::searchUsingCSSSelectors): Ditto.
3795         Also updated  for new exceptions in querySelectorAll.
3796         * inspector/InspectorNodeFinder.h: Updated for above.
3797
3798         * page/Crypto.cpp:
3799         (WebCore::Crypto::webkitSubtle): Return WebKitSubtleCrypto&
3800         insetad of WebKitSubtleCrypto*.
3801         * page/Crypto.h: Updated for above.
3802
3803         * testing/Internals.h: Removed declarations for functions already
3804         removed: ensureShadowRoot and createShadowRoot.
3805
3806 2016-10-31  Darin Adler  <darin@apple.com>
3807
3808         Convert Document from ExceptionCode to Exception
3809         https://bugs.webkit.org/show_bug.cgi?id=164212
3810
3811         Reviewed by Alex Christensen.
3812
3813         * Modules/websockets/WebSocketChannel.cpp:
3814         (WebCore::WebSocketChannel::processBuffer): Removed IGNORE_EXCEPTION.
3815
3816         * dom/ContainerNode.cpp:
3817         (WebCore::ContainerNode::takeAllChildrenFrom): Use releaseReturnValue
3818         instead of ASSERT_NO_EXCEPTION.
3819         (WebCore::ContainerNode::parserInsertBefore): Removed ASSERT_NO_EXCEPTION.
3820         (WebCore::ContainerNode::parserAppendChild): Ditto.
3821
3822         * dom/DOMImplementation.cpp:
3823         (WebCore::DOMImplementation::createDocumentType): Updated for new
3824         exception handling.
3825         (WebCore::DOMImplementation::createDocument): Ditto.
3826
3827         * dom/Document.cpp:
3828         (WebCore::createHTMLElementWithNameValidation): Return ExceptionOr.
3829         (WebCore::Document::createElementForBindings): Ditto.
3830         (WebCore::Document::createCDATASection): Ditto.
3831         (WebCore::Document::createProcessingInstruction): Ditto.
3832         (WebCore::Document::importNode): Ditto.
3833         (WebCore::Document::adoptNode): Ditto.
3834         (WebCore::Document::createElementNS): Ditto.
3835         (WebCore::Document::setXMLVersion): Ditto.
3836         (WebCore::Document::setBodyOrFrameset): Ditto.
3837         (WebCore::Document::processHttpEquiv): Ditto.
3838         (WebCore::Document::createEvent): Ditto.
3839         (WebCore::Document::cookie): Ditto.
3840         (WebCore::Document::setCookie): Ditto.
3841         (WebCore::Document::setDomain): Ditto.
3842         (WebCore::Document::parseQualifiedName): Ditto. Also added an overload
3843         that constructs a QualifiedName directly that most call sites can use.
3844         (WebCore::Document::createAttribute): Return ExceptionOr.
3845         (WebCore::Document::createAttributeNS): Ditto.
3846         (WebCore::Document::createTouch): Removed unneeded ExceptionCode&.
3847         * dom/Document.h: Updated for above.
3848         * dom/Document.idl: Use non-legacy exceptions. Removed exception
3849         entirely from createTouch.
3850
3851         * dom/Element.cpp:
3852         (WebCore::Element::parseAttributeName): Updated to use the new
3853         Document::parseQualifiedName.
3854         * editing/EditorCommand.cpp:
3855         (WebCore::executeFormatBlock): Ditto.
3856
3857         * inspector/InspectorDOMAgent.cpp:
3858         (WebCore::InspectorDOMAgent::setNodeName): Updated for the new
3859         exception handling.
3860         * inspector/InspectorPageAgent.cpp:
3861         (WebCore::InspectorPageAgent::getCookies): Ditto.
3862
3863         * page/ios/FrameIOS.mm:
3864         (WebCore::Frame::initWithSimpleHTMLDocument): Use the
3865         HTMLHtmlElement::create and HTMLBodyElement::create instead of using
3866         createElementNS to make the simple document.
3867
3868         * svg/animation/SVGSMILElement.cpp:
3869         (WebCore::SVGSMILElement::constructAttributeName): Renamed, made this
3870         a member function, updated to use the new Document::parseQualifiedName,
3871         and also moved the code to get the attribute in here.
3872         (WebCore::SVGSMILElement::constructAttributeName): Added. Helper function
3873         for the two places we update the attribute name from attributeNameAttr.
3874         (WebCore::SVGSMILElement::insertedInto): Use updateAttributeName.
3875         (WebCore::SVGSMILElement::svgAttributeChanged): Ditto.
3876         * svg/animation/SVGSMILElement.h: Updated for the above.
3877
3878         * xml/parser/XMLDocumentParserLibxml2.cpp:
3879         (WebCore::XMLDocumentParser::processingInstruction): Updated to understand
3880         ExceptionOr rather than an out argument.
3881         (WebCore::XMLDocumentParser::startDocument): Removed ASSERT_NO_EXCEPTION.
3882
3883 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3884
3885         Holding down a key to choose an accented character should fire "insertReplacementText" input events
3886         https://bugs.webkit.org/show_bug.cgi?id=164209
3887         <rdar://problem/29019305>
3888
3889         Reviewed by Darin Adler.
3890
3891         For TypingCommands that correspond to "insertReplacementText" inputTypes, vend dataTransfers for resulting
3892         beforeinput and input events if the edited area is not an input field or textarea. To do this, convert the plain
3893         text representation of the content to be inserted to HTML text using a helper function,
3894         MarkupAccumulator::appendCharactersReplacingEntities, that is used when creating markup for Text nodes.
3895
3896         Tests: fast/events/before-input-prevent-insert-replacement.html
3897                fast/events/input-event-insert-replacement.html
3898
3899         * editing/TypingCommand.cpp:
3900         (WebCore::TypingCommand::inputEventData):
3901         (WebCore::TypingCommand::inputEventDataTransfer):
3902         * editing/TypingCommand.h:
3903
3904 2016-10-30  Dave Hyatt  <hyatt@apple.com>
3905
3906         [CSS Parser] Miscellaneous bug fixes
3907         https://bugs.webkit.org/show_bug.cgi?id=164211
3908
3909         Reviewed by Darin Adler.
3910
3911         * css/parser/CSSPropertyParser.cpp:
3912         (WebCore::CSSPropertyParser::consumeTransformOrigin):
3913         Make sure to properly reject invalid transform-origin-z values.
3914
3915         * css/parser/CSSSelectorParser.cpp:
3916         (WebCore::CSSSelectorParser::consumeAttribute):
3917         Make attribute selector parsing strict about requiring a ] to end
3918         the selector.
3919
3920         (WebCore::CSSSelectorParser::consumePseudo):
3921         Force the nth-child "of" syntax to have whitespace after "of" but
3922         before the selector. It is unclear if this should be a requirement
3923         or not (spec is ambiguous), but for now we match the old parser.
3924
3925         (WebCore::CSSSelectorParser::consumeCombinator):
3926         Fix a bug that caused the double child combinator to match even
3927         when there was whitespace between the two > symbols.
3928
3929 2016-10-31  Youenn Fablet  <youenn@apple.com>
3930
3931         RTCOfferAnswerOptions does not need to be refcounted
3932         https://bugs.webkit.org/show_bug.cgi?id=164216
3933
3934         Reviewed by Darin Adler.
3935
3936         Covered by existing tests.
3937
3938         Making RTCOffer/Answer options dictionaries as per specification.
3939         Removing code that handles RTCOffer/Answer options dictionary since this is done by the binding generator.
3940         Updated users of the options accordingly.
3941
3942         * CMakeLists.txt:
3943         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3944         (WebCore::MediaEndpointPeerConnection::createOffer):
3945         (WebCore::MediaEndpointPeerConnection::createOfferTask):
3946         (WebCore::MediaEndpointPeerConnection::createAnswer):
3947         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
3948         * Modules/mediastream/MediaEndpointPeerConnection.h:
3949         * Modules/mediastream/PeerConnectionBackend.h:
3950         * Modules/mediastream/RTCOfferAnswerOptions.cpp: Removed.
3951         * Modules/mediastream/RTCOfferAnswerOptions.h:
3952         * Modules/mediastream/RTCPeerConnection.cpp:
3953         (WebCore::RTCPeerConnection::queuedCreateOffer):
3954         (WebCore::RTCPeerConnection::queuedCreateAnswer):
3955         * Modules/mediastream/RTCPeerConnection.h:
3956         * Modules/mediastream/RTCPeerConnection.idl:
3957         * WebCore.xcodeproj/project.pbxproj:
3958
3959 2016-10-31  Youenn Fablet  <youenn@apple.com>
3960
3961         fast/mediastream/RTCPeerConnection-* tests crashing under ASan
3962         https://bugs.webkit.org/show_bug.cgi?id=164215
3963
3964         Reviewed by Philippe Normand.
3965
3966         Covered by ASAN bot tests.
3967
3968         * platform/mediastream/SDPProcessorScriptResource.cpp:
3969         (WebCore::SDPProcessorScriptResource::scriptString):
3970
3971 2016-10-28  Philippe Normand  <pnormand@igalia.com>
3972
3973         [OpenWebRTC] Initialize library one time only
3974         https://bugs.webkit.org/show_bug.cgi?id=164118
3975
3976         Reviewed by Darin Adler.
3977
3978         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp:
3979         (WebCore::initializeOpenWebRTC): Prevent multiple initialisations of the library.
3980
3981 2016-10-30  Brent Fulgham  <bfulgham@apple.com>
3982
3983         Unreviewed fix: Correct ChangeLog after my bad merge.
3984
3985         * ChangeLog
3986
3987 2016-10-30  Darin Adler  <darin@apple.com>
3988
3989         Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
3990         https://bugs.webkit.org/show_bug.cgi?id=164206
3991
3992         Reviewed by Chris Dumez.
3993
3994         * bindings/js/JSDOMStringMapCustom.cpp:
3995         (WebCore::JSDOMStringMap::getOwnPropertyNames): Use modern for loop, and
3996         updates since the names function now returns a vector.
3997         (WebCore::JSDOMStringMap::putDelegate): Use propagateException. Also return
3998         true any time an exception is raised. Since true tells the caller to return
3999         without doing any work, we always want to return that on an exception.
4000         * dom/DatasetDOMStringMap.cpp:
4001         (WebCore::DatasetDOMStringMap::names): Renamed from getNames and made this
4002         return a Vector instead of populating a passed-in vector.
4003         (WebCore::DatasetDOMStringMap::setItem): Use ExceptionOr.
4004         * dom/DatasetDOMStringMap.h: Updated for above.
4005
4006         * dom/Document.cpp:
4007         (WebCore::Document::adoptNode): Updated to use ExceptionOr for
4008         removeAttributeNode. Changed to use remove rather than removeChild for
4009         better clarity.
4010
4011         * dom/Element.cpp:
4012         (WebCore::Element::setAttribute): Use ExceptionOr.
4013         (WebCore::Element::createShadowRoot): Deleted. Unused.
4014         (WebCore::Element::attachShadow): Use ExceptionOr.
4015         (WebCore::Element::shadowRootForBindings): Tweaked a bit.
4016         (WebCore::Element::userAgentShadowRoot): Removed unneeded if statemment.
4017         (WebCore::Element::ensureUserAgentShadowRoot): Tweaked a bit.
4018         (WebCore::Element::setAttributeNode): Use ExceptionOr.
4019         (WebCore::Element::setAttributeNodeNS): Ditto.
4020         (WebCore::Element::removeAttributeNode): Ditto.
4021         (WebCore::Element::parseAttributeName): Ditto. Also changed return result
4022         to be a QualifiedName instead of using an out argument.
4023         (WebCore::Element::setAttributeNS): Ditto.
4024         (WebCore::Element::mergeWithNextTextNode): Ditto.
4025         (WebCore::Element::setOuterHTML): Ditto.
4026         (WebCore::Element::setInnerHTML): Ditto.
4027         (WebCore::Element::matches): Ditto.
4028         (WebCore::Element::closest): Ditto.
4029         (WebCore::Element::insertAdjacent): Ditto.
4030         (WebCore::Element::insertAdjacentElement): Ditto.
4031         (WebCore::contextNodeForInsertion): Ditto.
4032         (WebCore::contextElementForInsertion): Added. Helper for the
4033         insertAdjacentHTML function to eliminate a local variable.
4034         (WebCore::Element::insertAdjacentHTML): Use ExceptionOr.
4035         (WebCore::Element::insertAdjacentText): Ditto.
4036         * dom/Element.h: Updated for above.
4037         * dom/Element.idl: Use non-legacy exceptions.
4038
4039         * dom/NamedNodeMap.cpp:
4040         (WebCore::NamedNodeMap::removeNamedItem): Use ExceptionOr.
4041         (WebCore::NamedNodeMap::supportedPropertyNames): Updated to check
4042         which strings should be removed without copying the strings.
4043         (WebCore::NamedNodeMap::removeNamedItemNS): Use ExceptionOr.
4044         (WebCore::NamedNodeMap::setNamedItem): Ditto. Removed overload for
4045         legacy bindings; move that to the bindings themselves.
4046         * dom/NamedNodeMap.h: Updated for above.
4047         * dom/NamedNodeMap.idl: Use non-legacy exceptions.
4048