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