WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-10-21  Chris Dumez  <cdumez@apple.com>
2
3         WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading
4         https://bugs.webkit.org/show_bug.cgi?id=163792
5
6         Reviewed by Darin Adler.
7
8         WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading for 
9         - https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7 (for texSubImage3D)
10         - https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14 (for TexImageSource)
11
12         * html/canvas/WebGL2RenderingContext.cpp:
13         (WebCore::WebGL2RenderingContext::texSubImage3D):
14         * html/canvas/WebGL2RenderingContext.h:
15         * html/canvas/WebGL2RenderingContext.idl:
16
17 2016-10-21  Zalan Bujtas  <zalan@apple.com>
18
19         Do not mutate the render tree while collecting selection repaint rects.
20         https://bugs.webkit.org/show_bug.cgi?id=163800
21         <rdar://problem/28806886>
22
23         Reviewed by David Hyatt.
24
25         RenderListItem not only mutates the tree while in layout but it also uses
26         the old descendant context to find the insertion point.
27         This patch strictly ensures that we only do it while in layout and never
28         in other cases such as collecting repaint rects.
29         This gets redundant when webkit.org/b/163789 is fixed.
30
31         Test: fast/lists/crash-when-list-marker-is-moved-during-selection.html
32
33         * rendering/RenderListItem.cpp:
34         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
35
36 2016-10-21  Dave Hyatt  <hyatt@apple.com>
37
38         [CSS Parser] Support horizontal-bt writing mode
39         https://bugs.webkit.org/show_bug.cgi?id=163797
40
41         Reviewed by Zalan Bujtas.
42
43         * css/parser/CSSParserFastPaths.cpp:
44         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
45
46 2016-10-20  Brent Fulgham  <bfulgham@apple.com>
47
48         [Win][Direct2D] Correct some memory leaks and other minor bugs
49         https://bugs.webkit.org/show_bug.cgi?id=163769
50
51         Reviewed by Alex Christensen.
52
53         Several D2D handles were being leaked.
54  
55         Direct2D sometimes returns an infinite rect containing { -inf, -inf, FloatMax, FloatMax },
56         sometimes { -FloatMax, -FloatMax, inf, inf }, and various combinations thereof. This caused
57         most SVG drawing to decide no screen rect was contained in the "infinite rect" so nothing
58         would be drawn.
59         
60         Tested by existing layout tests. 
61
62         * platform/graphics/GraphicsContext.h:
63         * platform/graphics/win/FloatRectDirect2D.cpp:
64         (WebCore::isInfiniteRect): Recognize various infinite rects in Windows.
65         (WebCore::FloatRect::FloatRect): Convert a Windows infinite rect to the style
66         we use inside WebKit.
67         * platform/graphics/win/FontCascadeDirect2D.cpp:
68         (WebCore::FontCascade::drawGlyphs): Use cached brushes if possible.
69         * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
70         (WebCore::GlyphPage::fill): Don't terminate on this error case.
71         * platform/graphics/win/GradientDirect2D.cpp:
72         (WebCore::Gradient::generateGradient): Don't leak gradients.
73         * platform/graphics/win/GraphicsContextDirect2D.cpp:
74         (WebCore::GraphicsContextPlatformPrivate::brushWithColor): Added.
75         (WebCore::GraphicsContext::brushWithColor): Added.
76         (WebCore::GraphicsContextPlatformPrivate::concatCTM): Perform transform multiplication
77         in the right order (hint: it's not distributive).
78         (WebCore::GraphicsContext::drawWithShadow): Use convenience method.
79         (WebCore::GraphicsContext::fillRect): Ditto.
80         (WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
81         (WebCore::GraphicsContext::clearRect): Ditto.
82         (WebCore::GraphicsContext::setPlatformStrokeColor): Ditto.
83         (WebCore::GraphicsContext::setPlatformFillColor): Ditto.
84         * platform/graphics/win/PathDirect2D.cpp:
85         (WebCore::Path::polygonPathFromPoints): No need to convert manually.
86         (WebCore::Path::~Path): Don't leak ID2D1Geometry entities.
87         (WebCore::Path::appendGeometry): Ditto.
88         (WebCore::Path::createGeometryWithFillMode): Ditto.
89         (WebCore::Path::Path): Ditto.
90         (WebCore::Path::operator=): Ditto.
91         (WebCore::Path::strokeBoundingRect): Provide an implementation.
92         (WebCore::Path::addRect): No need for manual casting here.
93
94 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
95
96         Fix minor style issue in the signature of StaticRange::create
97         https://bugs.webkit.org/show_bug.cgi?id=163786
98         <rdar://problem/28853079>
99
100         Reviewed by Alex Christensen.
101
102         Change `Ref<WebCore::Node> &&` to `Ref<Node>&&`.
103
104         * dom/StaticRange.cpp:
105         (WebCore::StaticRange::create):
106
107 2016-10-21  Dave Hyatt  <hyatt@apple.com>
108
109         [CSS Parser] Add support for -webkit-line-box-contain
110         https://bugs.webkit.org/show_bug.cgi?id=163794
111
112         Reviewed by Zalan Bujtas.
113
114         * css/parser/CSSPropertyParser.cpp:
115         (WebCore::consumeLineBoxContain):
116         (WebCore::CSSPropertyParser::parseSingleValue):
117
118 2016-10-21  Dave Hyatt  <hyatt@apple.com>
119
120         [CSS Parser] Add support for @-webkit-region rules
121         https://bugs.webkit.org/show_bug.cgi?id=163787
122
123         Reviewed by Zalan Bujtas.
124
125         * css/StyleRule.cpp:
126         (WebCore::StyleRuleRegion::StyleRuleRegion):
127         * css/StyleRule.h:
128         * css/parser/CSSAtRuleID.cpp:
129         (WebCore::cssAtRuleID):
130         * css/parser/CSSAtRuleID.h:
131         * css/parser/CSSParserImpl.cpp:
132         (WebCore::CSSParserImpl::consumeAtRule):
133         (WebCore::CSSParserImpl::consumePageRule):
134         (WebCore::CSSParserImpl::consumeRegionRule):
135         * css/parser/CSSParserImpl.h:
136
137 2016-10-21  David Kilzer  <ddkilzer@apple.com>
138
139         Bug 163757: Use IntSize::unclampedArea() in PDFDocumentImage::updateCachedImageIfNeeded()
140         <https://webkit.org/b/163757>
141
142         Reviewed by Brent Fulgham.
143
144         No new tests since there is no change in nominal behavior.
145
146         * platform/graphics/cg/PDFDocumentImage.cpp:
147         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Use
148         IntSize::unclampedArea() where manual calculations were used
149         previously.  Also gets rid of more safeCast<size_t>() use.
150
151 2016-10-21  Chris Dumez  <cdumez@apple.com>
152
153         [Web IDL] Support unions in our overload resolution algorithm
154         https://bugs.webkit.org/show_bug.cgi?id=163764
155
156         Reviewed by Darin Adler.
157
158         Support unions in our overload resolution algorithm as per:
159         - https://heycam.github.io/webidl/#es-overloads
160         - https://heycam.github.io/webidl/#dfn-distinguishable
161
162         * bindings/scripts/CodeGeneratorJS.pm:
163         (IsIDLTypeDistinguishableWithUnionForOverloadResolution):
164         (AreTypesDistinguishableForOverloadResolution):
165         (GetOverloadThatMatches):
166         (GenerateOverloadedFunctionOrConstructor):
167         * bindings/scripts/test/JS/JSTestObj.cpp:
168         * bindings/scripts/test/TestObj.idl:
169
170 2016-10-21  Chris Dumez  <cdumez@apple.com>
171
172         AudioNode.connect(): First parameter should not be nullable
173         https://bugs.webkit.org/show_bug.cgi?id=163773
174
175         Reviewed by Darin Adler.
176
177         AudioNode.connect()'s first parameter should not be nullable:
178         - https://webaudio.github.io/web-audio-api/#idl-def-AudioNode.
179
180         We were throwing a SYNTAX_ERR when passing null, we now throw
181         a TypeError instead.
182
183         No new tests, updated existing test.
184
185         * Modules/webaudio/AudioBasicInspectorNode.cpp:
186         (WebCore::AudioBasicInspectorNode::connect):
187         * Modules/webaudio/AudioBasicInspectorNode.h:
188         * Modules/webaudio/AudioNode.cpp:
189         (WebCore::AudioNode::connect):
190         * Modules/webaudio/AudioNode.h:
191         * Modules/webaudio/AudioNode.idl:
192
193 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
194
195         Implement InputEvent.getTargetRanges() for the input events spec
196         https://bugs.webkit.org/show_bug.cgi?id=162947
197         <rdar://problem/28853079>
198
199         Reviewed by Darin Adler.
200
201         Implements InputEvent.getTargetRanges(). See individual method changes below for more details. Adds a new hook
202         for subclasses of CompositeEditCommand to vend a list of target StaticRanges when retrieving target ranges for
203         an editing command on a contenteditable area.
204
205         Tests: fast/events/before-input-delete-empty-list-target-ranges.html
206                fast/events/before-input-delete-text-target-ranges.html
207                fast/events/before-input-replace-text-target-ranges.html
208
209         * CMakeLists.txt:
210         * DerivedSources.make:
211         * WebCore.xcodeproj/project.pbxproj:
212
213         Add StaticRange.idl, StaticRange.cpp and StaticRange.h.
214
215         * bindings/generic/RuntimeEnabledFeatures.h:
216         (WebCore::RuntimeEnabledFeatures::setInputEventsEnabled):
217         (WebCore::RuntimeEnabledFeatures::inputEventsEnabled):
218
219         Add a new runtime bindings flag for InputEvents and guard both InputEvent and StaticRange behind it.
220
221         * dom/DOMAllInOne.cpp:
222         * dom/InputEvent.cpp:
223         (WebCore::InputEvent::InputEvent):
224         * dom/InputEvent.h:
225         * dom/InputEvent.idl:
226         * dom/StaticRange.cpp: Copied from Source/WebCore/dom/InputEvent.cpp.
227         (WebCore::StaticRange::StaticRange):
228         (WebCore::StaticRange::create):
229         (WebCore::StaticRange::createFromRange):
230
231         Convenience method for creating a StaticRange from a Range's start/end container and offset.
232
233         (WebCore::StaticRange::startContainer):
234         (WebCore::StaticRange::endContainer):
235         (WebCore::StaticRange::collapsed):
236         * dom/StaticRange.h: Copied from Source/WebCore/dom/InputEvent.cpp.
237         (WebCore::StaticRange::startOffset):
238         (WebCore::StaticRange::endOffset):
239         * dom/StaticRange.idl: Copied from Source/WebCore/editing/ReplaceRangeWithTextCommand.h.
240         * editing/CompositeEditCommand.cpp:
241         (WebCore::CompositeEditCommand::willApplyCommand):
242         (WebCore::CompositeEditCommand::targetRanges):
243
244         Virtual method that returns a list of target ranges which are associated with this command.
245
246         (WebCore::CompositeEditCommand::targetRangesForBindings):
247
248         Non-virtual method that calls the above targetRanges(). Takes whether or not the CompositeEditCommand is editing
249         a textarea or plain text input into account.
250
251         (WebCore::CompositeEditCommand::moveParagraphs):
252         * editing/CompositeEditCommand.h:
253         * editing/EditCommand.cpp:
254         (WebCore::EditCommand::frame):
255         * editing/EditCommand.h:
256         (WebCore::EditCommand::document):
257         * editing/Editor.cpp:
258         (WebCore::dispatchBeforeInputEvent):
259         (WebCore::dispatchInputEvent):
260         (WebCore::dispatchBeforeInputEvents):
261
262         Changed the `beforeinput` event dispatch to use the regular Node::dispatchEvent instead of dispatchScopedEvent.
263         This is because if the page prevents the `beforeinput` event, we need to know immediately in order to bail from
264         the default action.
265
266         (WebCore::dispatchInputEvents):
267         (WebCore::Editor::willApplyEditing):
268
269         Added a list of static ranges as a parameter when calling on the Editor to dispatch `beforeinput` events.
270         By default, this uses the composite edit command's targetRangesForBindings(), though it may be special cased
271         by subclasses of CompositeEditCommand (see ReplaceRangeWithTextCommand, SpellingCorrectionCommand, and
272         TypingCommand).
273
274         * editing/Editor.h:
275         * editing/ReplaceRangeWithTextCommand.cpp:
276         (WebCore::ReplaceRangeWithTextCommand::targetRanges):
277         * editing/ReplaceRangeWithTextCommand.h:
278         * editing/SpellingCorrectionCommand.cpp:
279         (WebCore::SpellingCorrectionCommand::targetRanges):
280         * editing/SpellingCorrectionCommand.h:
281         * editing/TypingCommand.cpp:
282         (WebCore::editActionIsDeleteByTyping):
283         (WebCore::TypingCommand::shouldDeferWillApplyCommandUntilAddingTypingCommand):
284         (WebCore::TypingCommand::willApplyCommand):
285         (WebCore::TypingCommand::willAddTypingToOpenCommand):
286         (WebCore::TypingCommand::deleteKeyPressed):
287         (WebCore::TypingCommand::forwardDeleteKeyPressed):
288
289         Moves the firing of the `beforeinput` until after the selection range to delete has been computed.
290
291         * editing/TypingCommand.h:
292
293 2016-10-21  Antti Koivisto  <antti@apple.com>
294
295         Style resolver should be updated lazily
296         https://bugs.webkit.org/show_bug.cgi?id=163721
297
298         Reviewed by Andreas Kling.
299
300         Currently when stylesheets change in some way we generally update style resolvers and
301         invalidate style immediately. We should do this lazily to avoid unnecessary work.
302
303         Also improve naming of the stylesheet invalidation functions and use more optimal functions in some places.
304
305         * css/CSSComputedStyleDeclaration.cpp:
306         (WebCore::updateStyleIfNeededForNode):
307         * css/CSSStyleSheet.cpp:
308         (WebCore::CSSStyleSheet::didMutateRules):
309         (WebCore::CSSStyleSheet::didMutate):
310         (WebCore::CSSStyleSheet::setDisabled):
311         * css/StyleResolver.cpp:
312         (WebCore::StyleResolver::StyleResolver):
313
314             Initialize root style font with null font selector.
315             This avoids hitting a CSSFontSelector assert in fast/media/mq-relative-constraints-08.html where
316             media query evaluation requires font information before it is ready.
317             Exposed by increased laziness in this patch.
318
319         * dom/Document.cpp:
320         (WebCore::Document::setContentLanguage):
321         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
322         (WebCore::Document::isPageBoxVisible):
323         (WebCore::Document::pageSizeAndMarginsInPixels):
324         (WebCore::Document::processHttpEquiv):
325         (WebCore::Document::setSelectedStylesheetSet):
326         (WebCore::Document::didInsertInDocumentShadowRoot):
327         (WebCore::Document::didRemoveInDocumentShadowRoot):
328         * dom/Document.h:
329         (WebCore::Document::inDocumentShadowRoots):
330
331             Track all shadow roots in the document. This allows us to find and flush style scopes cheaply.
332
333         * dom/Element.cpp:
334         (WebCore::Element::computedStyle):
335         * dom/ExtensionStyleSheets.cpp:
336         (WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
337         (WebCore::ExtensionStyleSheets::clearPageUserSheet):
338         (WebCore::ExtensionStyleSheets::updatePageUserSheet):
339         (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
340         (WebCore::ExtensionStyleSheets::addUserStyleSheet):
341         (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
342         (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
343         (WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
344         (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired): Deleted.
345
346             Since updates are now done lazily we don't need a special timer for extension stylesheets.
347
348         * dom/ExtensionStyleSheets.h:
349         * dom/ProcessingInstruction.cpp:
350         (WebCore::ProcessingInstruction::checkStyleSheet):
351         (WebCore::ProcessingInstruction::sheetLoaded):
352         (WebCore::ProcessingInstruction::removedFrom):
353         * dom/ShadowRoot.cpp:
354         (WebCore::ShadowRoot::ShadowRoot):
355         (WebCore::ShadowRoot::insertedInto):
356         (WebCore::ShadowRoot::removedFrom):
357         (WebCore::ShadowRoot::styleScope):
358         * dom/ShadowRoot.h:
359         * html/HTMLLinkElement.cpp:
360         (WebCore::HTMLLinkElement::setDisabledState):
361         (WebCore::HTMLLinkElement::parseAttribute):
362         (WebCore::HTMLLinkElement::process):
363         (WebCore::HTMLLinkElement::removePendingSheet):
364         * html/HTMLStyleElement.cpp:
365         (WebCore::HTMLStyleElement::parseAttribute):
366         * inspector/InspectorCSSAgent.cpp:
367         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
368         (WebCore::InspectorCSSAgent::forcePseudoState):
369         (WebCore::InspectorCSSAgent::resetPseudoStates):
370         * inspector/InspectorPageAgent.cpp:
371         (WebCore::InspectorPageAgent::setEmulatedMedia):
372         * page/Frame.cpp:
373         (WebCore::Frame::setPrinting):
374         * page/FrameView.cpp:
375         (WebCore::FrameView::layout):
376         (WebCore::FrameView::setPagination):
377         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
378         * page/Page.cpp:
379         (WebCore::Page::setViewMode):
380         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
381         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
382         * style/StyleScope.cpp:
383         (WebCore::Style::Scope::setPreferredStylesheetSetName):
384         (WebCore::Style::Scope::setSelectedStylesheetSetName):
385         (WebCore::Style::Scope::removePendingSheet):
386         (WebCore::Style::Scope::removeStyleSheetCandidateNode):
387         (WebCore::Style::Scope::activeStyleSheetsForInspector):
388         (WebCore::Style::Scope::flushPendingUpdate):
389
390             Also flush descendant shadow roots.
391
392         (WebCore::Style::Scope::scheduleUpdate):
393         (WebCore::Style::Scope::didChangeActiveStyleSheetCandidates):
394
395             Make lazy.
396
397         (WebCore::Style::Scope::didChangeStyleSheetContents):
398
399             Make lazy.
400
401         (WebCore::Style::Scope::didChangeStyleSheetEnvironment):
402
403             Environment changes also affect author shadow roots.
404
405         (WebCore::Style::Scope::styleSheetsForStyleSheetList):
406         (WebCore::Style::Scope::scheduleActiveSetUpdate): Deleted.
407         (WebCore::Style::Scope::didChangeCandidatesForActiveSet): Deleted.
408         (WebCore::Style::Scope::didChangeContentsOrInterpretation): Deleted.
409
410             Improved naming of these and split didChangeContentsOrInterpretation into two separate functions.
411
412         * style/StyleScope.h:
413         (WebCore::Style::Scope::styleSheetsForStyleSheetList): Deleted.
414         (WebCore::Style::Scope::setPreferredStylesheetSetName): Deleted.
415         (WebCore::Style::Scope::setSelectedStylesheetSetName): Deleted.
416         * svg/SVGFontFaceElement.cpp:
417         (WebCore::SVGFontFaceElement::rebuildFontFace):
418         (WebCore::SVGFontFaceElement::removedFrom):
419         * testing/Internals.cpp:
420         (WebCore::Internals::resetToConsistentState):
421
422             Ensure that cationsStyleSheetOverride really becomes empty. Some tests rely on not having suprise
423             inserted stylesheets. Previously this was racy and the patch affected order of things.
424
425         (WebCore::Internals::styleChangeType):
426         * xml/XMLTreeViewer.cpp:
427         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
428         * xml/parser/XMLDocumentParser.cpp:
429         (WebCore::XMLDocumentParser::end):
430         * xml/parser/XMLDocumentParserLibxml2.cpp:
431         (WebCore::XMLDocumentParser::doEnd):
432
433 2016-10-21  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Adam Bergkvist  <adam.bergkvist@ericsson.com>
434
435         WebRTC: [OpenWebRTC] Move SDPProcessorScriptResource(Gtk) to openwebrtc directory
436         https://bugs.webkit.org/show_bug.cgi?id=163778
437
438         Reviewed by Philippe Normand.
439
440         Move SDPProcessorScriptResourceGtk from the platform gtk directory to the port generic
441         openwebrtc directory to make it usable by other ports. Also drop the Gtk-suffix.
442
443         No change of behavior.
444
445         * PlatformGTK.cmake:
446         * platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp:
447         (WebCore::SDPProcessorScriptResource::scriptString): Deleted.
448         * platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Renamed from Source/WebCore/platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp.
449         (WebCore::SDPProcessorScriptResource::scriptString):
450
451 2016-10-21  Miguel Gomez  <magomez@igalia.com>
452
453         [GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
454         https://bugs.webkit.org/show_bug.cgi?id=163511
455
456         Reviewed by Carlos Garcia Campos.
457
458         Perform the video repaint in the main thread when accelerated compositing is disabled. Added a new method to
459         MediaPlayerClient to get whether accelerated compositing is enabled from the MediaPlayer. This is needed
460         because mediaPlayerAcceleratedCompositingEnabled() will return false while HTMLMediaElement doesn't have a
461         RenderVideo, even when accelerated compositing is enabled.
462
463         Covered by existent tests.
464
465         * html/HTMLMediaElement.cpp:
466         (WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
467         * html/HTMLMediaElement.h:
468         * platform/graphics/MediaPlayer.h:
469         (WebCore::MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled):
470         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
471         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
472         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
473         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
474         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
475
476 2016-10-21  Adam Bergkvist  <adam.bergkvist@ericsson.com>
477
478         WebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend
479         https://bugs.webkit.org/show_bug.cgi?id=163327
480
481         Reviewed by Philippe Normand.
482
483         Add MediaEndpointOwr which is a MediaEndpoint implementation (WebRTC backend) based on
484         OpenWebRTC [1]. The WebRTC backend can be tested with a manual test. Automatic testing
485         is still done with MockMediaEndpoint.
486
487         [1] http://www.openwebrtc.org/
488
489         Testing: Added manual test (webrtc-one-tab-p2p.html)
490
491         * CMakeLists.txt:
492         * platform/GStreamer.cmake:
493         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Added.
494         (WebCore::createMediaEndpointOwr):
495         (WebCore::MediaEndpointOwr::MediaEndpointOwr):
496         (WebCore::MediaEndpointOwr::~MediaEndpointOwr):
497         (WebCore::MediaEndpointOwr::setConfiguration):
498         (WebCore::cryptoDataCallback):
499         (WebCore::MediaEndpointOwr::generateDtlsInfo):
500         (WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
501         (WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
502         (WebCore::payloadsContainType):
503         (WebCore::MediaEndpointOwr::filterPayloads):
504         (WebCore::MediaEndpointOwr::updateReceiveConfiguration):
505         (WebCore::findRtxPayload):
506         (WebCore::MediaEndpointOwr::updateSendConfiguration):
507         (WebCore::MediaEndpointOwr::addRemoteCandidate):
508         (WebCore::MediaEndpointOwr::replaceMutedRemoteSourceMid):
509         (WebCore::MediaEndpointOwr::createMutedRemoteSource):
510         (WebCore::MediaEndpointOwr::replaceSendSource):
511         (WebCore::MediaEndpointOwr::stop):
512         (WebCore::MediaEndpointOwr::transceiverIndexForSession):
513         (WebCore::MediaEndpointOwr::sessionMid):
514         (WebCore::MediaEndpointOwr::matchTransceiverByMid):
515         (WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
516         (WebCore::MediaEndpointOwr::dispatchGatheringDone):
517         (WebCore::MediaEndpointOwr::processIceTransportStateChange):
518         (WebCore::MediaEndpointOwr::dispatchDtlsFingerprint):
519         (WebCore::MediaEndpointOwr::unmuteRemoteSource):
520         (WebCore::MediaEndpointOwr::prepareSession):
521         (WebCore::MediaEndpointOwr::prepareMediaSession):
522         (WebCore::parseHelperServerUrl):
523         (WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
524         (WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
525         (WebCore::gotCandidate):
526         (WebCore::candidateGatheringDone):
527         (WebCore::iceConnectionStateChange):
528         (WebCore::gotIncomingSource):
529         * platform/mediastream/openwebrtc/MediaEndpointOwr.h: Added.
530         (WebCore::OwrTransceiver::create):
531         (WebCore::OwrTransceiver::~OwrTransceiver):
532         (WebCore::OwrTransceiver::mid):
533         (WebCore::OwrTransceiver::session):
534         (WebCore::OwrTransceiver::owrIceState):
535         (WebCore::OwrTransceiver::setOwrIceState):
536         (WebCore::OwrTransceiver::gotEndOfRemoteCandidates):
537         (WebCore::OwrTransceiver::markGotEndOfRemoteCandidates):
538         (WebCore::OwrTransceiver::OwrTransceiver):
539         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
540         (WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr):
541         (WebCore::RealtimeMediaSourceOwr::swapOutShallowSource):
542         Add support for an initially muted source. This is used for early
543         creation of remote sources.
544
545 2016-10-21  Javier Fernandez  <jfernandez@igalia.com>
546
547         [css-grid] Content Alignment broken with indefinite sized grid container
548         https://bugs.webkit.org/show_bug.cgi?id=163724
549
550         Reviewed by Manuel Rego Casasnovas.
551
552         The Grid Tracks sizing algorithm receives as parameter the
553         available space to be used as space for tracks. We hold a variable
554         to store the remaining free space for each dimension.
555
556         When the grid container size is indefinite we can't compute the
557         available free space after computing track sizes until such
558         indefinite size is resolved.
559
560         No new tests, just added some additional test cases.
561
562         * rendering/RenderGrid.cpp:
563         (WebCore::RenderGrid::layoutBlock): Compute freeSpace for Rows
564         after doing layout and resolving the indefinite height.
565
566 2016-10-21  Jer Noble  <jer.noble@apple.com>
567
568         CRASH in SourceBuffer::sourceBufferPrivateDidReceiveSample + 2169
569         https://bugs.webkit.org/show_bug.cgi?id=163735
570
571         Reviewed by Eric Carlson.
572
573         Test: media/media-source/media-source-sample-wrong-track-id.html
574
575         When SourceBuffer receives a sample in sourceBufferPrivateDidReceiveSample() containing
576         a trackID not previously seen in an initialization segment, it creates a default TrackBuffer
577         object to contain that track's samples. One of the fields in TrackBuffer, description, is
578         normally filled out when an initialization segment is received, but with this default
579         TrackBuffer, it's still null when it's checked later in sourceBufferPrivateDidReceiveSample().
580
581         Rather than adding a null-check on trackBuffer.description, drop any sample that has a 
582         trackID which was not present during a previous initialization segment.
583
584         * Modules/mediasource/SourceBuffer.cpp:
585         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
586
587 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
588
589         [GTK] Configures but fails to link with ENABLE_OPENGL=OFF
590         https://bugs.webkit.org/show_bug.cgi?id=163449
591
592         Reviewed by Michael Catanzaro.
593
594         Only define sharingGLContext in PlatformDisplay if EGL or GLX are enabled.
595
596         * platform/graphics/PlatformDisplay.cpp:
597         * platform/graphics/PlatformDisplay.h:
598         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
599         (WebCore::PlatformDisplayWayland::initialize):
600         * platform/graphics/x11/PlatformDisplayX11.cpp:
601         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
602
603 2016-10-20  Filip Pizlo  <fpizlo@apple.com>
604
605         The tracking of the coarse-grain Heap state (allocating or not, collector or not, eden vs full) should respect the orthogonality between allocating and collecting
606         https://bugs.webkit.org/show_bug.cgi?id=163738
607
608         Reviewed by Geoffrey Garen.
609
610         No new tests because no change in behavior.
611
612         * bindings/js/GCController.cpp:
613         (WebCore::GCController::garbageCollectNow):
614
615 2016-10-20  Chris Dumez  <cdumez@apple.com>
616
617         [Bindings] Start using signature->idlType instead of signature->type in the overload resolution code
618         https://bugs.webkit.org/show_bug.cgi?id=163767
619
620         Reviewed by Darin Adler.
621
622         Start using signature->idlType instead of signature->type in the overload resolution code
623         to prepare for union type support.
624
625         * bindings/scripts/CodeGeneratorJS.pm:
626         (ComputeEffectiveOverloadSet):
627         (AreTypesDistinguishableForOverloadResolution):
628         (GetDistinguishingArgumentIndex):
629         (GetOverloadThatMatches):
630         (GenerateOverloadedFunctionOrConstructor):
631
632 2016-10-20  Myles C. Maxfield  <mmaxfield@apple.com>
633
634         Implement WebGL2 bufferData() and bufferSubData() methods
635         https://bugs.webkit.org/show_bug.cgi?id=163759
636
637         Reviewed by Dean Jackson.
638
639         These new overloads simply clip the input array buffer.
640
641         Test: fast/canvas/webgl/bufferData-offset-length.html
642
643         * html/canvas/WebGL2RenderingContext.cpp:
644         (WebCore::WebGL2RenderingContext::bufferData):
645         (WebCore::WebGL2RenderingContext::bufferSubData):
646         * html/canvas/WebGL2RenderingContext.h:
647         * html/canvas/WebGL2RenderingContext.idl:
648
649 2016-10-20  Chris Dumez  <cdumez@apple.com>
650
651         "Download Linked File" context menu action should use 'download' attribute as suggested filename
652         https://bugs.webkit.org/show_bug.cgi?id=163742
653         <rdar://problem/28840734>
654
655         Reviewed by Darin Adler.
656
657         Add convenience method to HitTestResult to return the URL element's
658         download attribute.
659
660         * rendering/HitTestResult.cpp:
661         (WebCore::HitTestResult::URLElementDownloadAttribute):
662         * rendering/HitTestResult.h:
663
664 2016-10-20  Nan Wang  <n_wang@apple.com>
665
666         AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
667         https://bugs.webkit.org/show_bug.cgi?id=163763
668
669         Reviewed by Chris Fleizach.
670
671         Test: accessibility/mac/aria-tree-with-presentation-role.html
672
673         Web authors sometimes use presentation role in the aria tree to hide elements. We should
674         consider this a valid case if they specify tree items and groups correctly.
675
676         * accessibility/AccessibilityNodeObject.cpp:
677         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
678         * accessibility/AccessibilityTree.cpp:
679         (WebCore::AccessibilityTree::nodeHasTreeItemChild):
680         (WebCore::AccessibilityTree::isTreeValid):
681         * accessibility/AccessibilityTree.h:
682
683 2016-10-20  Myles C. Maxfield  <mmaxfield@apple.com>
684
685         Many WebGL functions which don't throw are marked as possibly throwing
686         https://bugs.webkit.org/show_bug.cgi?id=163747
687
688         Reviewed by Dean Jackson.
689
690         Mechanically remove the exception code.
691
692         No new tests because there is no behavior change.
693
694         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
695         (WebCore::getObjectParameter):
696         (WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
697         (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
698         (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
699         (WebCore::JSWebGLRenderingContextBase::getUniform):
700         (WebCore::dataFunctionf):
701         (WebCore::dataFunctioni):
702         (WebCore::dataFunctionMatrix):
703         * html/canvas/WebGL2RenderingContext.cpp:
704         (WebCore::WebGL2RenderingContext::texSubImage2D):
705         * html/canvas/WebGLRenderingContext.cpp:
706         (WebCore::WebGLRenderingContext::texSubImage2D):
707         * html/canvas/WebGLRenderingContextBase.cpp:
708         (WebCore::WebGLRenderingContextBase::activeTexture):
709         (WebCore::WebGLRenderingContextBase::attachShader):
710         (WebCore::WebGLRenderingContextBase::bindAttribLocation):
711         (WebCore::WebGLRenderingContextBase::bindBuffer):
712         (WebCore::WebGLRenderingContextBase::bindFramebuffer):
713         (WebCore::WebGLRenderingContextBase::bindRenderbuffer):
714         (WebCore::WebGLRenderingContextBase::bindTexture):
715         (WebCore::WebGLRenderingContextBase::bufferData):
716         (WebCore::WebGLRenderingContextBase::bufferSubData):
717         (WebCore::WebGLRenderingContextBase::compileShader):
718         (WebCore::WebGLRenderingContextBase::createShader):
719         (WebCore::WebGLRenderingContextBase::detachShader):
720         (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
721         (WebCore::WebGLRenderingContextBase::drawArrays):
722         (WebCore::WebGLRenderingContextBase::drawElements):
723         (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
724         (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
725         (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
726         (WebCore::WebGLRenderingContextBase::getActiveAttrib):
727         (WebCore::WebGLRenderingContextBase::getActiveUniform):
728         (WebCore::WebGLRenderingContextBase::getAttachedShaders):
729         (WebCore::WebGLRenderingContextBase::getBufferParameter):
730         (WebCore::WebGLRenderingContextBase::getProgramParameter):
731         (WebCore::WebGLRenderingContextBase::getProgramInfoLog):
732         (WebCore::WebGLRenderingContextBase::getRenderbufferParameter):
733         (WebCore::WebGLRenderingContextBase::getShaderParameter):
734         (WebCore::WebGLRenderingContextBase::getShaderInfoLog):
735         (WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
736         (WebCore::WebGLRenderingContextBase::getShaderSource):
737         (WebCore::WebGLRenderingContextBase::getTexParameter):
738         (WebCore::WebGLRenderingContextBase::getUniform):
739         (WebCore::WebGLRenderingContextBase::getUniformLocation):
740         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
741         (WebCore::WebGLRenderingContextBase::linkProgram):
742         (WebCore::WebGLRenderingContextBase::readPixels):
743         (WebCore::WebGLRenderingContextBase::shaderSource):
744         (WebCore::WebGLRenderingContextBase::videoFrameToImage):
745         (WebCore::WebGLRenderingContextBase::texImage2D):
746         (WebCore::WebGLRenderingContextBase::uniform1f):
747         (WebCore::WebGLRenderingContextBase::uniform1fv):
748         (WebCore::WebGLRenderingContextBase::uniform1i):
749         (WebCore::WebGLRenderingContextBase::uniform1iv):
750         (WebCore::WebGLRenderingContextBase::uniform2f):
751         (WebCore::WebGLRenderingContextBase::uniform2fv):
752         (WebCore::WebGLRenderingContextBase::uniform2i):
753         (WebCore::WebGLRenderingContextBase::uniform2iv):
754         (WebCore::WebGLRenderingContextBase::uniform3f):
755         (WebCore::WebGLRenderingContextBase::uniform3fv):
756         (WebCore::WebGLRenderingContextBase::uniform3i):
757         (WebCore::WebGLRenderingContextBase::uniform3iv):
758         (WebCore::WebGLRenderingContextBase::uniform4f):
759         (WebCore::WebGLRenderingContextBase::uniform4fv):
760         (WebCore::WebGLRenderingContextBase::uniform4i):
761         (WebCore::WebGLRenderingContextBase::uniform4iv):
762         (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
763         (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
764         (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
765         (WebCore::WebGLRenderingContextBase::useProgram):
766         (WebCore::WebGLRenderingContextBase::validateProgram):
767         (WebCore::WebGLRenderingContextBase::vertexAttribPointer):
768         (WebCore::WebGLRenderingContextBase::restoreCurrentFramebuffer):
769         (WebCore::WebGLRenderingContextBase::restoreCurrentTexture2D):
770         * html/canvas/WebGLRenderingContextBase.h:
771         * html/canvas/WebGLRenderingContextBase.idl:
772
773 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
774
775         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
776         https://bugs.webkit.org/show_bug.cgi?id=163374
777
778         Reviewed by Darin Adler.
779
780         Because of platform lack of support for variations in in-memory fonts,
781         this feature should be disabled on the affected OSes.
782
783         No tests because there is no behavior change (on the relevant platforms).
784
785         * Configurations/FeatureDefines.xcconfig:
786
787 2016-10-20  Brady Eidson  <beidson@apple.com>
788
789         IndexedDB 2.0: Support IDBObjectStore name assignment.
790         <rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
791
792         Reviewed by Alex Christensen.
793
794         Tests: storage/indexeddb/modern/objectstore-rename-1-private.html
795                storage/indexeddb/modern/objectstore-rename-1.html
796
797         Touches a *lot* of code sites, but none of them are particularly interesting.
798         They are all just getting the new name spread out to all of the various objects that need it.
799
800         * Modules/indexeddb/IDBDatabase.cpp:
801         (WebCore::IDBDatabase::renameObjectStore):
802         * Modules/indexeddb/IDBDatabase.h:
803
804         * Modules/indexeddb/IDBObjectStore.cpp:
805         (WebCore::IDBObjectStore::setName):
806         * Modules/indexeddb/IDBObjectStore.h:
807         * Modules/indexeddb/IDBObjectStore.idl:
808
809         * Modules/indexeddb/IDBTransaction.cpp:
810         (WebCore::IDBTransaction::renameObjectStore):
811         (WebCore::IDBTransaction::renameObjectStoreOnServer):
812         (WebCore::IDBTransaction::didRenameObjectStoreOnServer):
813         * Modules/indexeddb/IDBTransaction.h:
814
815         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
816         (WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
817         * Modules/indexeddb/client/IDBConnectionProxy.h:
818
819         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
820         (WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
821         (WebCore::IDBClient::IDBConnectionToServer::didRenameObjectStore):
822         * Modules/indexeddb/client/IDBConnectionToServer.h:
823         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
824
825         * Modules/indexeddb/server/IDBBackingStore.h:
826
827         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
828         (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
829         (WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
830         * Modules/indexeddb/server/IDBConnectionToClient.h:
831         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
832
833         * Modules/indexeddb/server/IDBServer.cpp:
834         (WebCore::IDBServer::IDBServer::renameObjectStore):
835         * Modules/indexeddb/server/IDBServer.h:
836
837         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
838         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
839         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
840         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
841
842         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
843         (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
844         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
845
846         * Modules/indexeddb/server/MemoryObjectStore.h:
847         (WebCore::IDBServer::MemoryObjectStore::rename):
848
849         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
850         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
851         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
852
853         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
854         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
855         (WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
856         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
857         * Modules/indexeddb/server/UniqueIDBDatabase.h:
858
859         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
860         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
861         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
862
863         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
864         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
865         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
866
867         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
868         (WebCore::IDBDatabaseInfo::renameObjectStore):
869         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
870
871         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
872         (WebCore::IDBObjectStoreInfo::rename):
873
874         * Modules/indexeddb/shared/IDBResultData.cpp:
875         (WebCore::IDBResultData::renameObjectStoreSuccess):
876         * Modules/indexeddb/shared/IDBResultData.h:
877
878         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
879         (WebCore::InProcessIDBServer::didRenameObjectStore):
880         (WebCore::InProcessIDBServer::renameObjectStore):
881         * Modules/indexeddb/shared/InProcessIDBServer.h:
882
883 2016-10-20  Chris Dumez  <cdumez@apple.com>
884
885         Make table.deleteRow(-1) a no-op when there are no rows
886         https://bugs.webkit.org/show_bug.cgi?id=163746
887
888         Reviewed by Alex Christensen.
889
890         Make table.deleteRow(-1) a no-op when there are no rows, instead of throwing:
891         - https://github.com/whatwg/html/pull/1924
892
893         This is more consistent with the behavior of tbody.deleteRow(-1) and
894         tr.deleteCell(-1). This is also consistent with Gecko. Blink is doing the
895         same change via:
896         - https://codereview.chromium.org/2427963004/
897
898         No new tests, updated existing tests.
899
900         * html/HTMLTableElement.cpp:
901         (WebCore::HTMLTableElement::deleteRow):
902
903 2016-10-20  Dave Hyatt  <hyatt@apple.com>
904
905         [CSS Parser] Make sure to handle prefixed transform-style
906         https://bugs.webkit.org/show_bug.cgi?id=163756
907
908         Reviewed by Dean Jackson.
909
910         * css/parser/CSSParserFastPaths.cpp:
911         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
912
913 2016-10-20  Dave Hyatt  <hyatt@apple.com>
914
915         [CSS Parser] Fix crash when parsing -webkit-margin-collapse
916         https://bugs.webkit.org/show_bug.cgi?id=163753
917
918         Reviewed by Dean Jackson.
919
920         * css/parser/CSSPropertyParser.cpp:
921         (WebCore::CSSPropertyParser::parseShorthand):
922
923 2016-10-20  Chris Dumez  <cdumez@apple.com>
924
925         Passing a number as the pixel parameter to texImage2D() doesn't thrown an exception
926         https://bugs.webkit.org/show_bug.cgi?id=163715
927
928         Reviewed by Darin Adler.
929
930         Enable strict type checking for typed arrays in the bindings, similarly
931         do what we do for other wrapper types, as per Web IDL.
932
933         No new tests, updated existing tests.
934
935         * bindings/scripts/CodeGeneratorJS.pm:
936         (GenerateImplementation):
937         (GenerateParametersCheck):
938
939 2016-10-20  Myles C. Maxfield  <mmaxfield@apple.com>
940
941         Improve error message when passing a null ArrayBuffer to bufferData()
942         https://bugs.webkit.org/show_bug.cgi?id=163745
943
944         Reviewed by Dean Jackson.
945
946         Test: fast/canvas/webgl/bufferData-nullable-array-buffer-view.html
947
948         Update the idl file to accept a nullable ArrayBuffer, and throw
949         the relevant error with a more helpful error string.
950
951         * html/canvas/WebGLRenderingContextBase.cpp:
952         (WebCore::WebGLRenderingContextBase::bufferData):
953         * html/canvas/WebGLRenderingContextBase.h:
954         * html/canvas/WebGLRenderingContextBase.idl:
955
956 2016-10-20  Zalan Bujtas  <zalan@apple.com>
957
958         Stop searching for first-letter containers at multi-column boundary.
959         https://bugs.webkit.org/show_bug.cgi?id=163739
960         <rdar://problem/28810750>
961
962         We should not cross the multi-column boundary while searching for the first-letter container.
963         While moving first-letter renderers to a multi-column parent, it could result in finding the wrong
964         container and end up adding a new wrapper under the original container (from where we are moving the renderers).    
965
966         Reviewed by David Hyatt.
967
968         Test: fast/css-generated-content/first-letter-move-to-multicolumn-crash.html
969
970         * rendering/RenderBoxModelObject.cpp:
971         (WebCore::RenderBoxModelObject::moveChildrenTo):
972         * rendering/RenderTextFragment.cpp:
973         (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
974
975 2016-10-19  Dean Jackson  <dino@apple.com>
976
977         Support CSS Shapes Level 1 without a prefix
978         https://bugs.webkit.org/show_bug.cgi?id=163709
979         <rdar://problem/28859369>
980
981         Reviewed by Myles Maxfield.
982
983         Support the unprefixed form of CSS Shapes, now that
984         it is in CR.
985
986         We have a few failing tests:
987
988         - Some image-based shaping failures, now skipped.
989           https://bugs.webkit.org/show_bug.cgi?id=163706
990
991         - Some false negatives, where my understanding
992           of the CSS OM seems to suggest that the W3C tests
993           are incorrect.
994           https://bugs.webkit.org/show_bug.cgi?id=163708
995
996         Tests: imported/w3c/csswg-test/css-shapes-1
997
998         * css/CSSComputedStyleDeclaration.cpp:
999         (WebCore::ComputedStyleExtractor::propertyValue):
1000         * css/CSSPropertyNames.in:
1001         * css/CSSValueKeywords.in:
1002         * css/parser/CSSParser.cpp:
1003         (WebCore::isSimpleLengthPropertyID):
1004         (WebCore::CSSParser::parseValue):
1005         * css/parser/CSSPropertyParser.cpp:
1006         (WebCore::CSSPropertyParser::parseSingleValue):
1007         * page/animation/CSSPropertyAnimation.cpp:
1008         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1009
1010 2016-10-20  Dave Hyatt  <hyatt@apple.com>
1011
1012         [CSS Parser] Fix region, column and page break parsing
1013         https://bugs.webkit.org/show_bug.cgi?id=163743
1014
1015         Reviewed by Simon Fraser.
1016
1017         * css/parser/CSSParserFastPaths.cpp:
1018         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1019         Add the missing values for break support.
1020
1021         * css/parser/CSSPropertyParser.cpp:
1022         (WebCore::isLegacyBreakProperty):
1023         (WebCore::CSSPropertyParser::parseValueStart):
1024         Add a special case for handling legacy break properties. Blink treats them like
1025         shorthands, but we can't do that without breaking the old parser, so for now
1026         we add a special case.
1027
1028         (WebCore::mapFromPageBreakBetween):
1029         (WebCore::mapFromColumnBreakBetween):
1030         (WebCore::mapFromRegionBreakBetween):
1031         Updated to have the AvoidXXX values (where XXX is Column/Page/Region).
1032
1033         (WebCore::CSSPropertyParser::parseShorthand):
1034         Remove the consumeLegacyBreak from the shorthand function, since we can't treat
1035         the legacy break properties as shorthands yet.
1036
1037 2016-10-20  Sam Weinig  <sam@webkit.org>
1038
1039         Add convenience function that combines WTF::visit(...) with WTF::makeVisitor(...)
1040         https://bugs.webkit.org/show_bug.cgi?id=163713
1041
1042         Reviewed by Dan Bernstein.
1043
1044         Switch uses of WTF::visit to use WTF::switchOn.
1045
1046         * dom/MessageEvent.cpp:
1047         (WebCore::MessageEvent::source):
1048         * dom/Node.cpp:
1049         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
1050         (WebCore::Node::convertNodesOrStringsIntoNode):
1051         * html/HTMLSelectElement.cpp:
1052         (WebCore::HTMLSelectElement::add):
1053         * html/track/TrackEvent.cpp:
1054         (WebCore::TrackEvent::TrackEvent):
1055         * testing/TypeConversions.h:
1056         (WebCore::TypeConversions::typeConversionsDictionaryUnionType):
1057
1058 2016-10-20  Dave Hyatt  <hyatt@apple.com>
1059
1060         [CSS Parser] Fix font family parsing and add CSS region property parsing
1061         https://bugs.webkit.org/show_bug.cgi?id=163741
1062
1063         Reviewed by Zalan Bujtas.
1064
1065         * css/parser/CSSParser.cpp:
1066         (WebCore::isKeywordPropertyID):
1067         (WebCore::parseKeywordValue):
1068         (WebCore::CSSParser::parseValue):
1069         Modify the old CSSParser to have its own keyword check, since keywords were
1070         incorrectly added to the new parser when this check was consolidated. Column
1071         and region breaks are considered keyword properties by the old parser, but
1072         not by the new parser, since the new parser special cases them and maps them
1073         into the generic break property.
1074
1075         * css/parser/CSSParserFastPaths.cpp:
1076         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1077         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1078         Update for regions to make sure all the region properties are there. Remove the
1079         column and region break properties, since they're not supposed to be here in the
1080         new parser.
1081
1082         * css/parser/CSSPropertyParser.cpp:
1083         (WebCore::consumeFamilyName):
1084         Fix font parsing to make font family values so that fonts work.
1085
1086         (WebCore::consumeFlowProperty):
1087         Add a function for handling -webkit-flow-from and -webkit-flow-into.
1088
1089         (WebCore::CSSPropertyParser::parseSingleValue):
1090         Add support for the region properties.
1091
1092         (WebCore::mapFromRegionBreakBetween):
1093         (WebCore::mapFromColumnRegionOrPageBreakInside):
1094         (WebCore::mapFromLegacyBreakProperty):
1095         (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
1096         (WebCore::mapFromColumnOrPageBreakInside): Deleted.
1097         Update to handle the region break properties in the same way that column break
1098         properties are handled.
1099
1100 2016-10-20  Jer Noble  <jer.noble@apple.com>
1101
1102         CRASH in WebCore::MediaSource::seekToTime + 185
1103         https://bugs.webkit.org/show_bug.cgi?id=163652
1104
1105         Reviewed by Eric Carlson.
1106
1107         Test: media/media-source/media-source-seek-detach-crash.html
1108
1109         Add isClosed() checks (which are effectively m_private null-checks) everywhere m_private is
1110         dereferenced. The one place where m_private is cleared without setting the state to closed
1111         is stop(), so make stop() set the state to closed as well (without firing any events).
1112
1113         * Modules/mediasource/MediaSource.cpp:
1114         (WebCore::MediaSource::seekToTime):
1115         (WebCore::MediaSource::completeSeek):
1116         (WebCore::MediaSource::monitorSourceBuffers):
1117         (WebCore::MediaSource::streamEndedWithError):
1118         (WebCore::MediaSource::stop):
1119
1120 2016-10-20  Andreas Kling  <akling@apple.com>
1121
1122         Drop StyleResolver and SelectorQueryCache when entering PageCache.
1123         <https://webkit.org/b/154238>
1124
1125         Reviewed by Antti Koivisto.
1126
1127         Stop keeping these around for cached pages to save lots of memory.
1128         We can easily rebuild them if a cached navigation occurs, and this
1129         way we also don't need to worry about invalidating style for cached
1130         pages in all the right places.
1131
1132         Restoring a cached page will now lead to a forced style recalc.
1133         We don't try to defer this (beyond a zero-timer) since it's going
1134         to happen anyway, and it's nicer to front-load the cost rather than
1135         stuttering on the first user content interaction.
1136
1137         * dom/Document.cpp:
1138         (WebCore::Document::setPageCacheState):
1139         * history/CachedPage.cpp:
1140         (WebCore::CachedPage::restore):
1141         (WebCore::CachedPage::clear):
1142         * history/CachedPage.h:
1143         (WebCore::CachedPage::markForVisitedLinkStyleRecalc): Deleted.
1144         (WebCore::CachedPage::markForFullStyleRecalc): Deleted.
1145         * history/PageCache.cpp:
1146         (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted.
1147         (WebCore::PageCache::markPagesForFullStyleRecalc): Deleted.
1148         * history/PageCache.h:
1149         * page/Frame.cpp:
1150         (WebCore::Frame::setPageAndTextZoomFactors):
1151         * page/Page.cpp:
1152         (WebCore::Page::setViewScaleFactor):
1153         (WebCore::Page::setDeviceScaleFactor):
1154         (WebCore::Page::setPagination):
1155         (WebCore::Page::setPaginationLineGridEnabled):
1156         (WebCore::Page::setVisitedLinkStore):
1157
1158 2016-10-20  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1159
1160         [GTK] Build fix after r207616
1161         https://bugs.webkit.org/show_bug.cgi?id=163333
1162
1163         Reviewed by Carlos Garcia Campos.
1164
1165         EGL_PLATFORM_X11_KHR and EGL_PLATFORM_WAYLAND_KHR are not defined
1166         on the EGL headers shipped by Mesa 10.3 (shipped by Debian 8)
1167
1168         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1169         (WebCore::PlatformDisplayWayland::initialize):
1170         * platform/graphics/x11/PlatformDisplayX11.cpp:
1171         (WebCore::PlatformDisplayX11::initializeEGLDisplay):
1172
1173 2016-10-20  Fujii Hironori  <Hironori.Fujii@sony.com>
1174
1175         [CMake] CMake does not support the dep files for implicit dependency
1176         https://bugs.webkit.org/show_bug.cgi?id=161433
1177
1178         Reviewed by Brent Fulgham.
1179
1180         Created a Perl script to generate all IDL bindings for CMake.
1181         This script can regenerate outdated bindings by based on the
1182         supplemental dependency and dep files created by
1183         '--write-dependencies' switch of generate-bindings.pl.
1184
1185         add_custom_target is used to invoke the script instead of
1186         add_custom_command because Ninja deletes all output files before
1187         executing the command in case of add_custom_command.
1188
1189         USES_TERMINAL option of add_custom_target has two effects:
1190         1) Not buffering output of the command
1191         2) Invoking the command in the special Ninja pool which inhibits parallel build
1192         One needs to use CMake 3.2 or later to enable this feature.
1193
1194         * CMakeLists.txt: Specified target names for
1195         GENERATE_BINDINGS. Added dependency for the targets.
1196         * bindings/scripts/generate-bindings-all.pl: Added.
1197
1198 2016-10-20  Adam Jackson  <ajax@redhat.com>
1199
1200         Prefer eglGetPlatformDisplay to eglGetDisplay
1201         https://bugs.webkit.org/show_bug.cgi?id=163333
1202
1203         Reviewed by Carlos Garcia Campos.
1204
1205         eglGetDisplay forces the implementation to guess what kind of void* it's been handed. Different implementations
1206         do different things, in particular glvnd and Mesa behave differently. Fortunately there exists API to tell EGL
1207         what kind of display it is, so let's use it.
1208
1209         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1210         (WebCore::PlatformDisplayWayland::initialize):
1211         * platform/graphics/x11/PlatformDisplayX11.cpp:
1212         (WebCore::PlatformDisplayX11::initializeEGLDisplay):
1213
1214 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1215
1216         [GTK] Avoid including egl.h headers in internal headers
1217         https://bugs.webkit.org/show_bug.cgi?id=163722
1218
1219         Reviewed by Žan Doberšek.
1220
1221         egl.h includes eglplatform.h that decides the native types for the platform at compile time. However, we support
1222         to build with X11 and Wayland at the same time and decide what to use at runtime. Currently GLContext.h includes
1223         eglplatform.h after wayland-egl.h if Wayland is enabled. That means that the wayland native types are used by
1224         default from all cpp files including GLContext.h. It currently works in X11 because we cast the value anyway and
1225         for example EGLNativeWindowType is a pointer in Wayland that can be casted to unsigned long in X11 to represent
1226         the X Window. This is very fragile in any case, we should avoid adding egl headers in our headers and only
1227         include it in cpp files. But we also need to ensure we don't use X11 and Wayland in the same cpp file.
1228
1229         * PlatformGTK.cmake:
1230         * platform/graphics/GLContext.cpp:
1231         (WebCore::GLContext::createContextForWindow):
1232         * platform/graphics/GLContext.h:
1233         * platform/graphics/egl/GLContextEGL.cpp:
1234         (WebCore::GLContextEGL::createWindowContext):
1235         (WebCore::GLContextEGL::createContext):
1236         (WebCore::GLContextEGL::~GLContextEGL):
1237         * platform/graphics/egl/GLContextEGL.h:
1238         * platform/graphics/egl/GLContextEGLWayland.cpp: Added.
1239         (WebCore::GLContextEGL::GLContextEGL):
1240         (WebCore::GLContextEGL::createWindowSurfaceWayland):
1241         (WebCore::GLContextEGL::createWaylandContext):
1242         (WebCore::GLContextEGL::destroyWaylandWindow):
1243         * platform/graphics/egl/GLContextEGLX11.cpp: Added.
1244         (WebCore::GLContextEGL::GLContextEGL):
1245         (WebCore::GLContextEGL::createWindowSurfaceX11):
1246         (WebCore::GLContextEGL::createPixmapContext):
1247         * platform/graphics/glx/GLContextGLX.cpp:
1248         (WebCore::GLContextGLX::createWindowContext):
1249         (WebCore::GLContextGLX::createContext):
1250         (WebCore::GLContextGLX::GLContextGLX):
1251         * platform/graphics/glx/GLContextGLX.h:
1252         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1253         * platform/graphics/x11/PlatformDisplayX11.cpp:
1254
1255 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1256
1257         [GTK] Avoid strstr() when checking (E)GL extensions
1258         https://bugs.webkit.org/show_bug.cgi?id=161958
1259
1260         Reviewed by Žan Doberšek.
1261
1262         Add static method GLContext::isExtensionSupported() to properly search extenstions in the given extension
1263         list, and use it instead of strstr().
1264
1265         * platform/graphics/GLContext.cpp:
1266         (WebCore::GLContext::isExtensionSupported):
1267         * platform/graphics/GLContext.h:
1268         * platform/graphics/egl/GLContextEGL.cpp:
1269         (WebCore::GLContextEGL::createSurfacelessContext):
1270         * platform/graphics/glx/GLContextGLX.cpp:
1271         (WebCore::hasSGISwapControlExtension):
1272
1273 2016-10-20  Per Arne Vollan  <pvollan@apple.com>
1274
1275         [Win][Direct2D] Implement ImageBufferData::getData.
1276         https://bugs.webkit.org/show_bug.cgi?id=163668
1277
1278         Reviewed by Brent Fulgham.
1279
1280         Render data to a bitmap in system memory, which data can be read from.
1281
1282         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1283         (WebCore::ImageBufferData::getData):
1284         * platform/graphics/win/ImageBufferDirect2D.cpp:
1285         (WebCore::ImageBuffer::ImageBuffer):
1286
1287 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1288
1289         Wrong use of EGL_DEPTH_SIZE
1290         https://bugs.webkit.org/show_bug.cgi?id=155536
1291
1292         Reviewed by Michael Catanzaro.
1293
1294         What happens here is that the driver doesn't implement EGL_DEPTH_SIZE and the default value, which is 0, is
1295         returned. Then XCreatePixmap fails because 0 is not a valid depth. The thing is that even if EGL_DEPTH_SIZE or
1296         EGL_BUFFER_SIZE returned a valid depth, it still might not be supported by the default screen and XCreatePixmap
1297         can fail. What we need to ensure is that the depth we pass is compatible with the X display, not only with the
1298         EGL config, to avoid failures when creating the pixmap. So, we can use EGL_NATIVE_VISUAL_ID instead, and
1299         then ask X for the visual info for that id. If it isn't found then we just return before creating the pixmap,
1300         but if the visual is found then we can be sure that the depth of the visual will not make the pixmap creation
1301         fail. However, with the driver I'm using it doesn't matter how we create the pixmap that eglCreatePixmapSurface
1302         always fails, again with X errors that are fatal by default. Since the driver is not free, I assume it doesn't
1303         support eglCreatePixmapSurface or it's just buggy, so the only option we have here is trap the x errors and
1304         ignore them. It turns out that the X errors are not fatal in this case, because eglCreatePixmapSurface ends up
1305         returning a surface, and since these are offscreen contexts, it doesn't really matter if they contain an
1306         invalid pixmap, because we never do swap buffer on them, so just ignoring the X errors fixes the crashes and
1307         makes everythig work. This patch adds a helper class XErrorTrapper that allows to trap XErrors and decide what
1308         to do with them (ignore, warn or crash) or even not consider a particular set of errors as errors.
1309
1310         * PlatformEfl.cmake: Add new file to compilation.
1311         * PlatformGTK.cmake: Ditto.
1312         * platform/graphics/egl/GLContextEGL.cpp:
1313         (WebCore::GLContextEGL::createPixmapContext): Use EGL_NATIVE_VISUAL_ID instead of EGL_DEPTH_SIZE to figure out
1314         the depth to be passed to XCreatePixmap. Also use the XErrorTrapper class to ignore all BadDrawable errors
1315         produced by eglCreatePixmapSurface() and only show a warning about all other X errors.
1316         * platform/graphics/x11/XErrorTrapper.cpp: Added.
1317         (WebCore::xErrorTrappersMap):
1318         (WebCore::XErrorTrapper::XErrorTrapper):
1319         (WebCore::XErrorTrapper::~XErrorTrapper):
1320         (WebCore::XErrorTrapper::errorCode):
1321         (WebCore::XErrorTrapper::errorEvent):
1322         * platform/graphics/x11/XErrorTrapper.h: Added.
1323         (WebCore::XErrorTrapper::XErrorTrapper):
1324
1325 2016-10-20  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1326
1327         WebRTC: The MediaStreamTrackEvent init dictionary needs a required track member
1328         https://bugs.webkit.org/show_bug.cgi?id=146232
1329
1330         Update MediaStreamTrackEvent IDL as per specification.
1331
1332         Reviewed by Darin Adler.
1333
1334         No additional test required, rebase existings tests.
1335
1336         * Modules/mediastream/MediaStreamTrackEvent.idl:
1337
1338 2016-10-19  Antoine Quint  <graouts@apple.com>
1339
1340         [Modern Media Controls] Media Controller: mute support
1341         https://bugs.webkit.org/show_bug.cgi?id=163677
1342         <rdar://problem/28851582>
1343
1344         Reviewed by Dean Jackson.
1345
1346         We introduce the MuteSupport class which brings support for muting the media
1347         by clicking on the mute button in the media controls and correctly reflecting
1348         the media's muted state should the media be muted via the media API.
1349
1350         Tests: media/modern-media-controls/mute-support/mute-support-button-click.html
1351                media/modern-media-controls/mute-support/mute-support-media-api.html
1352                media/modern-media-controls/mute-support/mute-support-muted.html
1353
1354         * Modules/modern-media-controls/media/media-controller.js:
1355         (MediaController):
1356         * Modules/modern-media-controls/media/mute-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
1357         (MuteSupport.prototype.get control):
1358         (MuteSupport.prototype.get mediaEvents):
1359         (MuteSupport.prototype.buttonWasClicked):
1360         (MuteSupport.prototype.syncControl):
1361         (MuteSupport):
1362         * WebCore.xcodeproj/project.pbxproj:
1363         * rendering/RenderThemeMac.mm:
1364         (WebCore::RenderThemeMac::mediaControlsScript):
1365
1366 2016-10-19  Alex Christensen  <achristensen@webkit.org>
1367
1368         Revert r207151
1369         https://bugs.webkit.org/show_bug.cgi?id=163675
1370
1371         Reviewed by Brent Fulgham.
1372
1373         This code is still useful for comparison with Windows.  I'll remove it again soon.
1374
1375         No new tests.  No change in behavior.
1376
1377         * WebCore.xcodeproj/project.pbxproj:
1378         * WebCorePrefix.h:
1379         * loader/DocumentLoader.h:
1380         * loader/EmptyClients.h:
1381         * loader/FrameLoaderClient.h:
1382         * loader/ResourceLoader.cpp:
1383         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
1384         * loader/ResourceLoader.h:
1385         * loader/SubresourceLoader.h:
1386         * loader/cf/ResourceLoaderCFNet.cpp:
1387         * loader/cocoa/SubresourceLoaderCocoa.mm:
1388         (WebCore::SubresourceLoader::willCacheResponse):
1389         * loader/mac/DocumentLoaderMac.cpp:
1390         * loader/mac/ResourceLoaderMac.mm:
1391         (WebCore::ResourceLoader::willCacheResponse):
1392         * page/mac/PageMac.mm:
1393         (WebCore::Page::platformInitialize):
1394         (WebCore::Page::addSchedulePair):
1395         (WebCore::Page::removeSchedulePair):
1396         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1397         (WebCore::WebCoreNSURLAuthenticationChallengeClient::create):
1398         (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient):
1399         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
1400         * platform/mac/WebCoreSystemInterface.h:
1401         * platform/network/NetworkStorageSession.h:
1402         * platform/network/ProtectionSpace.h:
1403         * platform/network/ProtectionSpaceBase.cpp:
1404         * platform/network/ResourceHandle.cpp:
1405         * platform/network/ResourceHandle.h:
1406         * platform/network/ResourceHandleClient.cpp:
1407         * platform/network/ResourceHandleClient.h:
1408         * platform/network/ResourceHandleInternal.h:
1409         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1410         * platform/network/ResourceRequestBase.cpp:
1411         * platform/network/cf/AuthenticationCF.cpp:
1412         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
1413         (WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
1414         (WebCore::AuthenticationChallenge::authenticationClient): Deleted.
1415         (WebCore::AuthenticationChallenge::platformCompare): Deleted.
1416         (WebCore::createCF): Deleted.
1417         (WebCore::core): Deleted.
1418         * platform/network/cf/AuthenticationCF.h:
1419         * platform/network/cf/AuthenticationChallenge.h:
1420         * platform/network/cf/CookieJarCFNet.cpp:
1421         * platform/network/cf/CredentialStorageCFNet.cpp:
1422         (WebCore::CredentialStorage::getFromPersistentStorage):
1423         (WebCore::CredentialStorage::saveToPersistentStorage):
1424         * platform/network/cf/LoaderRunLoopCF.cpp:
1425         * platform/network/cf/LoaderRunLoopCF.h:
1426         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1427         (WebCore::NetworkStorageSession::cookieStorage):
1428         * platform/network/cf/ProtectionSpaceCFNet.cpp:
1429         * platform/network/cf/ProtectionSpaceCFNet.h:
1430         * platform/network/cf/ResourceError.h:
1431         * platform/network/cf/ResourceErrorCF.cpp:
1432         * platform/network/cf/ResourceHandleCFNet.cpp:
1433         (WebCore::shouldSniffConnectionProperty):
1434         (WebCore::ResourceHandle::createCFURLConnection):
1435         (WebCore::ResourceHandle::start):
1436         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1437         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
1438         (WebCore::ResourceHandle::receivedCredential):
1439         (WebCore::ResourceHandle::schedule):
1440         (WebCore::ResourceHandle::unschedule):
1441         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1442         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1443         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1444         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
1445         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1446         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1447         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1448         * platform/network/cf/ResourceRequest.h:
1449         (WebCore::ResourceRequest::encodingRequiresPlatformData):
1450         * platform/network/cf/ResourceRequestCFNet.cpp:
1451         (WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction):
1452         (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
1453         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1454         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
1455         (WebCore::ResourceRequest::doUpdateResourceRequest):
1456         (WebCore::ResourceRequest::setStorageSession):
1457         * platform/network/cf/ResourceRequestCFNet.h:
1458         * platform/network/cf/ResourceResponse.h:
1459         * platform/network/cf/ResourceResponseCFNet.cpp:
1460         (WebCore::ResourceResponse::cfURLResponse):
1461         * platform/network/cf/SynchronousLoaderClientCFNet.cpp:
1462         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1463         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
1464         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
1465         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
1466         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
1467         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
1468         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
1469         * platform/network/cocoa/CredentialCocoa.h:
1470         * platform/network/cocoa/CredentialCocoa.mm:
1471         (WebCore::Credential::Credential):
1472         (WebCore::Credential::cfCredential):
1473         * platform/network/cocoa/ProtectionSpaceCocoa.h:
1474         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
1475         (WebCore::ProtectionSpace::ProtectionSpace):
1476         (WebCore::ProtectionSpace::cfSpace):
1477         * platform/network/cocoa/ResourceRequestCocoa.mm:
1478         (WebCore::ResourceRequest::nsURLRequest):
1479         * platform/network/cocoa/ResourceResponseCocoa.mm:
1480         (WebCore::ResourceResponse::platformCertificateInfo):
1481         (WebCore::ResourceResponse::nsURLResponse):
1482         (WebCore::ResourceResponse::ResourceResponse):
1483         * platform/network/ios/QuickLook.h:
1484         * platform/network/ios/QuickLook.mm:
1485         (-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]):
1486         (-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]):
1487         (-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]):
1488         (-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]):
1489         (-[WebQuickLookHandleAsDelegate connection:didFailWithError:]):
1490         (-[WebQuickLookHandleAsDelegate detachHandle]):
1491         (WebCore::QuickLookHandle::create):
1492         (WebCore::QuickLookHandle::cfResponse):
1493         * platform/network/mac/AuthenticationMac.mm:
1494         (-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]):
1495         (-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]):
1496         (WebCore::core):
1497         (WebCore::mac):
1498         * platform/network/mac/CookieJarMac.mm:
1499         (WebCore::setCookiesFromDOM):
1500         (WebCore::addCookie):
1501         (WebCore::cookieStorage):
1502         * platform/network/mac/CredentialStorageMac.mm:
1503         * platform/network/mac/FormDataStreamMac.h:
1504         * platform/network/mac/FormDataStreamMac.mm:
1505         * platform/network/mac/ResourceErrorMac.mm:
1506         (NSErrorFromCFError):
1507         (WebCore::ResourceError::ResourceError):
1508         (WebCore::ResourceError::nsError):
1509         (WebCore::ResourceError::operator NSError *):
1510         * platform/network/mac/ResourceHandleMac.mm:
1511         (WebCore::ResourceHandle::getConnectionTimingData):
1512         * platform/network/mac/ResourceRequestMac.mm: Added.
1513         (WebCore::ResourceRequest::ResourceRequest):
1514         (WebCore::ResourceRequest::updateNSURLRequest):
1515         * platform/network/mac/SynchronousLoaderClient.mm:
1516         * platform/network/mac/WebCoreResourceHandleAsDelegate.h:
1517         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1518         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
1519         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1520         * platform/network/mac/WebCoreURLResponse.mm:
1521         * platform/win/TemporaryLinkStubs.cpp:
1522         * testing/js/WebCoreTestSupportPrefix.h:
1523
1524 2016-10-19  Jer Noble  <jer.noble@apple.com>
1525
1526         REGRESSION (r206025): All YouTube videos play with black bars on all four sides
1527         https://bugs.webkit.org/show_bug.cgi?id=163308
1528
1529         Reviewed by Darin Adler.
1530
1531         Test: media/media-source/media-source-resize.html
1532
1533         After r206025, we do not fire resize events when the size change notification happens equal-
1534         to-or-before the current time, which can happen at the very beginning of a stream. Take care
1535         of this case by checking that the target time isn't actually in the past inside of
1536         sizeWillChangeAtTime(), and also always skip the boundary time observer when there was no
1537         previous size (such as after a flush due to a seek).
1538
1539         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1540         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1541         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
1542         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
1543         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1544         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
1545         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1546
1547 2016-10-19  Nan Wang  <n_wang@apple.com>
1548
1549         AX: [Mac] Mark element AXAPI should comform to specs
1550         https://bugs.webkit.org/show_bug.cgi?id=163707
1551
1552         Reviewed by Chris Fleizach.
1553
1554         Created a new role for mark elements on Mac and exposed the role
1555         description.
1556
1557         Changes are covered in modified test expectaions.
1558
1559         * English.lproj/Localizable.strings:
1560         * accessibility/AccessibilityObject.h:
1561         * accessibility/AccessibilityRenderObject.cpp:
1562         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1563         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1564         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1565         * accessibility/mac/AccessibilityObjectMac.mm:
1566         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
1567         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1568         (createAccessibilityRoleMap):
1569         (-[WebAccessibilityObjectWrapper roleDescription]):
1570         * platform/LocalizedStrings.cpp:
1571         (WebCore::AXMarkText):
1572         * platform/LocalizedStrings.h:
1573
1574 2016-10-19  Alex Christensen  <achristensen@webkit.org>
1575
1576         Re-enable URLParser for non-Safari Cocoa apps after r207321
1577         https://bugs.webkit.org/show_bug.cgi?id=163690
1578
1579         Reviewed by Darin Adler.
1580
1581         I disabled the URLParser for non-Safari applications in r207305
1582         to give me time to make URLParser more compatible, which I did in r207321
1583
1584         Updated some API tests which will be investigated in 
1585         https://bugs.webkit.org/show_bug.cgi?id=163127
1586
1587         * platform/URLParser.cpp:
1588         (WebCore::URLParser::setEnabled):
1589         (WebCore::URLParser::enabled):
1590         * testing/js/WebCoreTestSupport.cpp:
1591         (WebCoreTestSupport::setURLParserEnabled): Deleted.
1592         * testing/js/WebCoreTestSupport.h:
1593
1594 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
1595
1596         CSS font-variation-settings does not handle uppercase axis names in variable fonts
1597         https://bugs.webkit.org/show_bug.cgi?id=163546
1598
1599         Reviewed by Dean Jackson.
1600
1601         Remove the extra toASCIILower() call.
1602
1603         Test: fast/text/variations/case-axis-names.html
1604
1605         * css/parser/CSSParser.cpp:
1606         (WebCore::CSSParser::parseFontVariationTag):
1607
1608 2016-10-19  Anders Carlsson  <andersca@apple.com>
1609
1610         Remove m_redirectURLs from HistoryItem
1611         https://bugs.webkit.org/show_bug.cgi?id=163704
1612
1613         Reviewed by Dan Bernstein.
1614
1615         * history/HistoryItem.cpp:
1616         (WebCore::HistoryItem::HistoryItem):
1617         (WebCore::HistoryItem::reset):
1618         * history/HistoryItem.h:
1619
1620 2016-10-19  Joone Hur  <joone.hur@intel.com>
1621
1622         Add a plain space instead of &nbsp; between text nodes
1623         https://bugs.webkit.org/show_bug.cgi?id=123163
1624
1625         Reviewed by Ryosuke Niwa.
1626
1627         When we rebalance white spaces, &nbsp; can be added as space
1628         under some conditions. This patch adds a condition that the next
1629         sibling text node should not exist.
1630
1631         No new tests, updated existing test.
1632
1633         * editing/CompositeEditCommand.cpp:
1634         (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
1635         * editing/htmlediting.cpp:
1636         (WebCore::stringWithRebalancedWhitespace):
1637         * editing/htmlediting.h:
1638
1639 2016-10-19  Sam Weinig  <sam@webkit.org>
1640
1641         Add support for sequences and dictionaries in unions
1642         https://bugs.webkit.org/show_bug.cgi?id=163695
1643
1644         Reviewed by Chris Dumez.
1645
1646         Tests:
1647          - Updated js/dom/webidl-type-mapping.html
1648
1649         * bindings/generic/IDLTypes.h:
1650         Add additional helper predicates and fix formatting.
1651
1652         * bindings/js/JSDOMBinding.h:
1653         Export hasIteratorMethod for use in testing.
1654
1655         * bindings/js/JSDOMConvert.h:
1656         - Change return type of Converter<IDLDictionary<T>> to T, from Optional<T>.
1657         - Add support for unions conversion step 12 (parts 1-3).
1658
1659         * bindings/scripts/CodeGeneratorJS.pm:
1660         (GenerateDefaultValue):
1661         Support complex default value computations for unions using the convert infrastructure.
1662
1663         (GenerateParametersCheck):
1664         (GenerateConstructorDefinition):
1665         Remove incorrect .value() calls now that Converter<IDLDictionary<T>> returns T.
1666
1667         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1668         * bindings/scripts/test/JS/JSTestObj.cpp:
1669         Update bindings test results.
1670
1671         * testing/TypeConversions.h:
1672         (WebCore::TypeConversions::setTypeConversionsDictionary):
1673         (WebCore::TypeConversions::typeConversionsDictionaryLongValue):
1674         (WebCore::TypeConversions::typeConversionsDictionaryStringValue):
1675         (WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
1676         (WebCore::TypeConversions::typeConversionsDictionaryUnionType):
1677         * testing/TypeConversions.idl:
1678         Add some complex types to allow testing IDL conversions from tests.
1679
1680 2016-10-19  Ryosuke Niwa  <rniwa@webkit.org>
1681
1682         Annotate more DOM and HTML IDLs with CEReactions
1683         https://bugs.webkit.org/show_bug.cgi?id=163653
1684
1685         Reviewed by Darin Adler.
1686
1687         Added CEReactions to more IDL files.
1688
1689         Test: fast/custom-elements/reactions-for-webkit-extensions.html
1690
1691         * bindings/js/JSDOMStringMapCustom.cpp:
1692         (WebCore::JSDOMStringMap::deleteProperty): Instantiate CustomElementReactionStack, which is equivalent to
1693         adding CEReactions in IDL.
1694         (WebCore::JSDOMStringMap::putDelegate): Ditto.
1695         * dom/Document.idl:
1696         * dom/Element.idl:
1697         * html/HTMLElement.idl:
1698         * page/DOMSelection.idl:
1699
1700 2016-10-19  Ryan Haddad  <ryanhaddad@apple.com>
1701
1702         Unreviewed, rolling out r207557.
1703
1704         This change caused animations/font-variations tests to time
1705         out on pre-Sierra Macs.
1706
1707         Reverted changeset:
1708
1709         "[macOS] [iOS] Disable variation fonts on macOS El Capitan and
1710         iOS 9"
1711         https://bugs.webkit.org/show_bug.cgi?id=163374
1712         http://trac.webkit.org/changeset/207557
1713
1714 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1715
1716         [CSS Parser] Support -webkit-border-fit
1717         https://bugs.webkit.org/show_bug.cgi?id=163687
1718
1719         Reviewed by Zalan Bujtas.
1720
1721         Add support for -webkit-border-fit to isValidKeywordPropertyAndValue.
1722
1723         * css/parser/CSSParserFastPaths.cpp:
1724         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1725
1726 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1727
1728         [CSS Parser] class and id parsing need to be case-insensitive in HTML quirks mode
1729         https://bugs.webkit.org/show_bug.cgi?id=163685
1730
1731         Reviewed by Zalan Bujtas.
1732
1733         Class and ID parsing should be case-insensitive in quirks mode. Apply the same hack
1734         that the old parser did and lowercase the class and ids in place.
1735
1736         * css/parser/CSSSelectorParser.cpp:
1737         (WebCore::CSSSelectorParser::consumeId):
1738         (WebCore::CSSSelectorParser::consumeClass):
1739
1740 2016-10-19  Nan Wang  <n_wang@apple.com>
1741
1742         AX: crash: com.apple.WebCore: WebCore::AccessibilityObject::findMatchingObjects + 600
1743         https://bugs.webkit.org/show_bug.cgi?id=163682
1744
1745         Reviewed by Chris Fleizach.
1746
1747         There's a null pointer crash when we ask for startObject->parentObjectUnignored() in
1748         AccessibilityObject::findMatchingObject. Added a null check for the startObject to fix that.
1749
1750         Test: accessibility/mac/search-predicate-crash.html
1751
1752         * accessibility/AccessibilityObject.cpp:
1753         (WebCore::AccessibilityObject::findMatchingObjects):
1754
1755 2016-10-19  David Kilzer  <ddkilzer@apple.com>
1756
1757         Bug 163670: Refine assertions in WebCore::ImageData constructors
1758         <https://webkit.org/b/163670>
1759         <rdar://problem/27497338>
1760
1761         Reviewed by Brent Fulgham.
1762
1763         No new tests because there is no change in nominal behavior.
1764
1765         * html/ImageData.cpp:
1766         (WebCore::ImageData::ImageData(const IntSize&)): Change to use
1767         ASSERT() since the worst-case scenario here is a nullptr deref.
1768         Switch to IntSize::area() to compute the area.
1769         (WebCore::ImageData::ImageData(const IntSize&, Ref<Uint8ClampedArray>&&)):
1770         Add ASSERT() identical to the previous constructor, and change
1771         ASSERT_WITH_SECURITY_IMPLICATION() to only fire when m_data is
1772         not nullptr and the length check fails.  Switch to
1773         IntSize::area() to compute the area.
1774
1775 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
1776
1777         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
1778         https://bugs.webkit.org/show_bug.cgi?id=163374
1779
1780         Reviewed by Darin Adler.
1781
1782         Because of platform lack of support for variations in in-memory fonts,
1783         this feature should be disabled on the affected OSes.
1784
1785         No tests because there is no behavior change (on the relevant platforms).
1786
1787         * Configurations/FeatureDefines.xcconfig:
1788
1789 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1790
1791         [CSS Parser] Fix background-position parsing
1792         https://bugs.webkit.org/show_bug.cgi?id=163681
1793
1794         Reviewed by Dean Jackson.
1795
1796         The new parser has a more efficient parsed representation of background positions. When
1797         background-position is "center" or when no length unit is specified for a dimension,
1798         then rather than creating a pair, the new parser makes a singleton primitive value.
1799
1800         Patch the StyleBuilder code to handle this case, resolving center to (left,50%) or
1801         (top,50%) as appropriate and also handling top/left without any associated length.
1802
1803         * css/CSSToStyleMap.cpp:
1804         (WebCore::CSSToStyleMap::mapFillXPosition):
1805         (WebCore::CSSToStyleMap::mapFillYPosition):
1806
1807 2016-10-19  Antoine Quint  <graouts@apple.com>
1808
1809         [Modern Media Controls] Media Controller: click-to-start support
1810         https://bugs.webkit.org/show_bug.cgi?id=163659
1811         <rdar://problem/28845656>
1812
1813         Reviewed by Dean Jackson.
1814
1815         We introduce the MediaControllerSupport class which will allow a number of media controller
1816         features to be implemented by subclasses each devoted to implementing a specific subset of
1817         media controller features. With this bug, we add the correct behavior for click-to-start,
1818         only showing the start button under the right circumstances.
1819
1820         A MediaController object indicates which media control to attach click event listeners to
1821         through the `control` property, and a list of media events it should register on the media
1822         element through the `mediaEvents` property. Then, as the user interacts with the specified
1823         control and the media, the Button delegation method `buttonWasClicked()` and the `syncControl()`
1824         methods are called to allow for the media state to be correctly set and represented in the
1825         media controls. Custom event handling for the specified events can also be achieved by
1826         subclassing the `handleEvent()` method.
1827
1828         Tests: media/modern-media-controls/start-support/start-support-audio.html
1829                media/modern-media-controls/start-support/start-support-autoplay.html
1830                media/modern-media-controls/start-support/start-support-click-to-start.html
1831                media/modern-media-controls/start-support/start-support-error.html
1832                media/modern-media-controls/start-support/start-support-fullscreen.html
1833                media/modern-media-controls/start-support/start-support-manual-play.html
1834                media/modern-media-controls/start-support/start-support-no-source.html
1835
1836         * Modules/modern-media-controls/media/media-controller-support.js: Added.
1837         (MediaControllerSupport):
1838         (MediaControllerSupport.prototype.get control):
1839         (MediaControllerSupport.prototype.get mediaEvents):
1840         (MediaControllerSupport.prototype.buttonWasClicked):
1841         (MediaControllerSupport.prototype.handleEvent):
1842         (MediaControllerSupport.prototype.syncControl):
1843         * Modules/modern-media-controls/media/media-controller.js:
1844         (MediaController):
1845         (MediaController.prototype.buttonWasClicked): Deleted.
1846         * Modules/modern-media-controls/media/start-support.js: Added.
1847         (StartSupport.prototype.get control):
1848         (StartSupport.prototype.get mediaEvents):
1849         (StartSupport.prototype.buttonWasClicked):
1850         (StartSupport.prototype.handleEvent):
1851         (StartSupport.prototype.syncControl):
1852         (StartSupport.prototype._shouldShowStartButton):
1853         (StartSupport):
1854
1855 2016-10-19  Aaron Chu  <aaron_chu@apple.com>
1856
1857         Web Inspector: AXI: expose computed tree node and heading level
1858         https://bugs.webkit.org/show_bug.cgi?id=130825
1859         <rdar://problem/16442349>
1860
1861         Reviewed by Joseph Pecoraro.
1862
1863         Exposing two new accessibility properties: Heading Level and Hierarchical Level.
1864
1865         Updated Test: LayoutTest/inspector/dom/getAccessibilityPropertiesForNode.html
1866
1867         * inspector/InspectorDOMAgent.cpp:
1868         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1869
1870 2016-10-19  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1871
1872         WebRTC: Implement MediaEndpointPeerConnection::stop()
1873         https://bugs.webkit.org/show_bug.cgi?id=163660
1874
1875         Reviewed by Philippe Normand.
1876
1877         Make MediaEndpointPeerConnection::stop() stop its MediaEndpoint.
1878
1879         Testing: This fix deals with cleanup and tearing down resources down in the platform layer
1880         and is not covered by automated tests. It is however observable in the manual test added
1881         in [1] where the remote videos should stop when the connections are closed.
1882
1883         [1] http://webkit.org/b/163327
1884
1885         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1886         (WebCore::MediaEndpointPeerConnection::stop):
1887
1888 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1889
1890         [CSS Parser] Fix -webkit-mask-box-image parsing
1891         https://bugs.webkit.org/show_bug.cgi?id=163676
1892
1893         Reviewed by Dean Jackson.
1894
1895         -webkit-mask-box-image is not a shorthand in our current code, so treat it the same as the legacy
1896         -webkit-border-image.
1897
1898         * css/parser/CSSPropertyParser.cpp:
1899         (WebCore::CSSPropertyParser::parseSingleValue):
1900         (WebCore::CSSPropertyParser::parseShorthand):
1901
1902 2016-10-19  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1903
1904         [GTK][EFL] Build fix after r207543.
1905         https://bugs.webkit.org/show_bug.cgi?id=163671
1906
1907         Unreviewed.
1908
1909         Fix typo on the filename of the included header:
1910         Mac filesystem is case insensitive, but Linux filesystems are case sensitive.
1911
1912         * css/parser/CSSPropertyParser.cpp:
1913
1914 2016-10-19  Zalan Bujtas  <zalan@apple.com>
1915
1916         Use anonymous table row for new child at RenderTableRow::addChild() if available.
1917         https://bugs.webkit.org/show_bug.cgi?id=163651
1918         <rdar://problem/28705022>
1919
1920         Reviewed by David Hyatt.
1921
1922         We should try to prevent the continuation siblings from getting separated and inserted into
1923         wrapper renderers. It makes finding these continuation siblings difficult.
1924         This patch adds a checks for anonymous table rows so that we could find a closer common ancestor of
1925         beforeChild/new child. 
1926
1927         Test: fast/table/crash-when-table-has-continuation-and-content-inserted.html
1928
1929         * rendering/RenderObject.cpp:
1930         (WebCore::RenderObject::showRenderObject): Add continuation information.
1931         * rendering/RenderTableRow.cpp:
1932         (WebCore::RenderTableRow::addChild):
1933
1934 2016-10-19  Joseph Pecoraro  <pecoraro@apple.com>
1935
1936         Cleanup WebCore/workers
1937         https://bugs.webkit.org/show_bug.cgi?id=163635
1938
1939         Reviewed by Chris Dumez.
1940
1941         * workers/*:
1942         Cleanup like pragma once, nullptr, remove stale includes, declarations.
1943
1944 2016-10-19  Chris Dumez  <cdumez@apple.com>
1945
1946         MouseEvent's coordinates should be 0 for simulated clicks
1947         https://bugs.webkit.org/show_bug.cgi?id=163648
1948
1949         Reviewed by Darin Adler.
1950
1951         MouseEvent's coordinates should be 0 / 0 for simulated clicks triggered
1952         by JavaScript (i.e. via element.click()). This behavior matches Chrome
1953         and Firefox.
1954
1955         WebKit was computing actual coordinates for the element which was
1956         expensive, especially because computing  screenX / screenY required
1957         a synchronous IPC with the UI process.
1958
1959         Test: fast/events/element-click-no-coords.html
1960
1961         * dom/Element.cpp:
1962         (WebCore::Element::dispatchSimulatedClick):
1963         * dom/SimulatedClick.cpp:
1964         (WebCore::simulateMouseEvent):
1965         (WebCore::simulateClick):
1966         * dom/SimulatedClick.h:
1967         * html/HTMLElement.cpp:
1968         (WebCore::HTMLElement::click):
1969
1970 2016-10-19  Dave Hyatt  <hyatt@apple.com>
1971
1972         [CSS Parser] Fix transform parsing
1973         https://bugs.webkit.org/show_bug.cgi?id=163671
1974
1975         Reviewed by Dean Jackson.
1976
1977         The new parser turned function names into CSSValueIDs and made CSSFunctionValue store them. This
1978         meant it could be used to handle transform values, with the function name representing the
1979         transform operation efficiently as a CSSValueID.
1980
1981         The old parser, however, creates WebKitCSSTransformValues. This value does not exist in the new
1982         parser. Rather than forcing the old and new parser over to CSSFunctionValues, I opted to
1983         just make the new parser build WebkitCSSTransformValues too.
1984
1985         The main reason I did this is that WebkitCSSTransformValue is actually exposed to the Web via
1986         IDL. To be safe, I am not eliminating it (even though Blink has).
1987
1988         * css/parser/CSSPropertyParser.cpp:
1989         (WebCore::consumeTranslate3d):
1990         (WebCore::consumeNumbers):
1991         (WebCore::consumePerspective):
1992         (WebCore::transformOperationForCSSValueID):
1993         (WebCore::consumeTransformValue):
1994
1995 2016-10-19  Darin Adler  <darin@apple.com>
1996
1997         Move XPath from ExceptionCode to Exception
1998         https://bugs.webkit.org/show_bug.cgi?id=163656
1999
2000         Reviewed by Chris Dumez.
2001
2002         * dom/Document.cpp:
2003         (WebCore::Document::createExpression): Use ExceptionOr.
2004         (WebCore::Document::createNSResolver): Return Ref.
2005         (WebCore::Document::evaluate): Use ExceptionOr.
2006         * dom/Document.h: Updated for above changes.
2007         * dom/Document.idl: Use non-legacy exceptions for the functions above.
2008
2009         * inspector/InspectorNodeFinder.cpp:
2010         (WebCore::InspectorNodeFinder::searchUsingXPath): Call XPath functions
2011         with new interface.
2012
2013         * xml/DOMParser.cpp:
2014         (WebCore::DOMParser::DOMParser): Marked inline.
2015         (WebCore::DOMParser::create): Moved here from header.
2016         (WebCore::DOMParser::parseFromString): Use ExceptionOr.
2017         * xml/DOMParser.h: Updated for above changes.
2018         * xml/DOMParser.idl: Use non-legacy exception.
2019
2020         * xml/XPathEvaluator.cpp:
2021         (WebCore::XPathEvaluator::createExpression): Use ExceptionOr.
2022         (WebCore::XPathEvaluator::evaluate): Ditto.
2023         * xml/XPathEvaluator.h: Updated for above changes.
2024         * xml/XPathEvaluator.idl: Use non-legacy exceptions.
2025
2026         * xml/XPathExpression.cpp:
2027         (WebCore::XPathExpression::createExpression): Use ExceptionOr.
2028         (WebCore::XPathExpression::evaluate): Ditto.
2029         * xml/XPathExpression.h: Updated for above changes.
2030         * xml/XPathExpression.idl: Use non-legacy exceptions.
2031
2032         * xml/XPathGrammar.y: Added include of XPathStep.h.
2033
2034         * xml/XPathParser.cpp:
2035         (WebCore::XPath::Parser::Parser): Initialize three scalar data members
2036         in the class definition rather than here.
2037         (WebCore::XPath::Parser::parseStatement): Use ExceptionOr.
2038         * xml/XPathParser.h: Updated for above changes.
2039
2040         * xml/XPathResult.cpp:
2041         (WebCore::XPathResult::XPathResult): Use a reference rather than a
2042         pointer for the document. Alao initialize two scalar data members
2043         in the class definition rather than here.
2044         (WebCore::XPathResult::convertTo): Use ExceptionOr.
2045         (WebCore::XPathResult::numberValue): Ditto.
2046         (WebCore::XPathResult::stringValue): Ditto.
2047         (WebCore::XPathResult::booleanValue): Ditto.
2048         (WebCore::XPathResult::singleNodeValue): Ditto.
2049         (WebCore::XPathResult::snapshotLength): Ditto.
2050         (WebCore::XPathResult::iterateNext): Ditto.
2051         (WebCore::XPathResult::snapshotItem): Ditto.
2052         * xml/XPathResult.h: Updated for the changes above.
2053         * xml/XPathResult.idl: Use non-legacy exceptions.
2054
2055 2016-10-19  Nan Wang  <n_wang@apple.com>
2056
2057         AX: [Mac] Meter element should use AXValueDescription to descrbe the status of the value
2058         https://bugs.webkit.org/show_bug.cgi?id=163610
2059
2060         Reviewed by Chris Fleizach.
2061
2062         Exposed the goodness of the meter value in AXValueDescription.
2063
2064         Test: accessibility/mac/meter-gauge-value-description.html
2065
2066         * English.lproj/Localizable.strings:
2067         * accessibility/AccessibilityProgressIndicator.cpp:
2068         (WebCore::AccessibilityProgressIndicator::gaugeRegionValueDescription):
2069         * accessibility/AccessibilityProgressIndicator.h:
2070         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2071         (-[WebAccessibilityObjectWrapper valueDescriptionForMeter]):
2072         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2073         * platform/LocalizedStrings.cpp:
2074         (WebCore::AXMeterGaugeRegionOptimumText):
2075         (WebCore::AXMeterGaugeRegionSuboptimalText):
2076         (WebCore::AXMeterGaugeRegionLessGoodText):
2077         * platform/LocalizedStrings.h:
2078
2079 2016-10-19  Dave Hyatt  <hyatt@apple.com>
2080
2081         [CSS Parser] Fix named color parsing
2082         https://bugs.webkit.org/show_bug.cgi?id=163662
2083
2084         Reviewed by Zalan Bujtas.
2085
2086         Named color parsing in the old parser for extended colors relied on constructing a Color with the
2087         name and doing a lookup that way.
2088
2089         The new parser allows the back end to hold a primitive identifier value for extended colors.
2090
2091         StyleColor contains a helper function for looking up the correct color.
2092
2093         This patch switches both the old and the new parsers over to the new StyleColor function.
2094
2095         Also remove some asserts from the CSSSelectorList, since the new parser allows it to be empty and
2096         detects parsing failure that way.
2097
2098         * css/CSSSelectorList.cpp:
2099         (WebCore::CSSSelectorList::CSSSelectorList):
2100         (WebCore::CSSSelectorList::operator=):
2101         * css/StyleColor.cpp:
2102         (WebCore::StyleColor::isColorKeyword):
2103         * css/StyleResolver.cpp:
2104         (WebCore::StyleResolver::colorFromPrimitiveValue):
2105         (WebCore::colorForCSSValue): Deleted.
2106
2107 2016-10-19  Youenn Fablet  <youenn@apple.com>
2108
2109         Remove SecurityOrigin::taintsCanvas
2110         https://bugs.webkit.org/show_bug.cgi?id=163594
2111
2112         Reviewed by Darin Adler.
2113
2114         No change of behavior.
2115
2116         * html/canvas/CanvasRenderingContext.cpp:
2117         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
2118         * page/SecurityOrigin.cpp:
2119         (WebCore::SecurityOrigin::canReceiveDragData):
2120         (WebCore::SecurityOrigin::taintsCanvas): Deleted.
2121         * page/SecurityOrigin.h:
2122
2123 2016-10-18  Dave Hyatt  <hyatt@apple.com>
2124
2125         [CSS Parser] Fix compound selector parsing.
2126         https://bugs.webkit.org/show_bug.cgi?id=163649
2127
2128         Reviewed by Darin Adler.
2129
2130         The new CSS parser is failing to handle compound selectors. The code has an assumption that the
2131         first value in the RelationType enum is SubSelector. This patch changes the enum to have the same
2132         name used in Blink, RelationType, and to make the ordering be exactly the same.
2133
2134         * css/CSSSelector.h:
2135         (WebCore::CSSSelector::relation):
2136         (WebCore::CSSSelector::setRelation):
2137         * css/SelectorChecker.cpp:
2138         (WebCore::SelectorChecker::matchRecursively):
2139         (WebCore::canMatchHoverOrActiveInQuirksMode):
2140         (WebCore::SelectorChecker::determineLinkMatchType):
2141         * css/SelectorFilter.cpp:
2142         (WebCore::SelectorFilter::collectIdentifierHashes):
2143         * css/parser/CSSParserValues.cpp:
2144         (WebCore::CSSParserSelector::insertTagHistory):
2145         (WebCore::CSSParserSelector::appendTagHistory):
2146         * css/parser/CSSParserValues.h:
2147         (WebCore::CSSParserSelector::setRelation):
2148         * css/parser/CSSSelectorParser.cpp:
2149         (WebCore::CSSSelectorParser::consumeComplexSelector):
2150         (WebCore::CSSSelectorParser::consumeCombinator):
2151         * css/parser/CSSSelectorParser.h:
2152         * cssjit/SelectorCompiler.cpp:
2153         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
2154         (WebCore::SelectorCompiler::constructFragmentsInternal):
2155
2156 2016-10-19  Javier Fernandez  <jfernandez@igalia.com>
2157
2158         Web Inspector: Debugger buttons positioned incorrectly, align-content default value is unexpected
2159         https://bugs.webkit.org/show_bug.cgi?id=163572
2160
2161         Reviewed by Sergio Villar Senin.
2162
2163         We only allow the new CSS Box Alignment syntax when the Grid Layout
2164         feature is enabled. Due to flexbox backward compatibility we have
2165         implemented a different code path for the style initial/default values
2166         assignment. However, we have incorrectly resolved both align-content
2167         and justify-content to 'flex-start' when grid layout is disabled.
2168
2169         This patch changes the approach, so we set 'normal' (the value specified
2170         by the new syntax) for both properties, but using the values defined in
2171         the old syntax (Flexbox specification) at computed style resolution.
2172
2173         Since 'stretch' is the default value for the align-content property, this
2174         issue implies that any flexbox line with an undefined height will be
2175         laid out incorrectly, if not explicitly set via CSS, because flex items
2176         can't use the available height, even though they use 'stretch' for their
2177         'align-self' properties.
2178
2179         Test: css3/flexbox/flexbox-lines-must-be-stretched-by-default.html
2180
2181         * css/CSSComputedStyleDeclaration.cpp:
2182         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
2183         (WebCore::ComputedStyleExtractor::propertyValue):
2184         * rendering/style/RenderStyle.h:
2185         (WebCore::RenderStyle::initialContentAlignment):
2186
2187 2016-10-19  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2188
2189         [GTK] REGRESSION(r207396) Build broken with Clang.
2190         https://bugs.webkit.org/show_bug.cgi?id=163599
2191
2192         Suggested and reviewed by Darin Adler.
2193
2194         * css/CSSPrimitiveValue.cpp:
2195         (WebCore::CSSPrimitiveValue::getStringValue):
2196
2197 2016-10-19  Darin Adler  <darin@apple.com>
2198
2199         Try to fix build.
2200
2201         * page/PerformanceUserTiming.cpp: Add back class name; needed by some compiler versions.
2202
2203 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2204
2205         Unreviewed. Fix the build after r207522.
2206
2207         * page/PerformanceUserTiming.cpp: Include PerformanceTiming.h.
2208
2209 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2210
2211         Unreviewed. Fix the build after r207519.
2212
2213         The build error is:
2214         IDL ATTRIBUTE CHECKER ERROR: Unknown IDL attribute [PassContext] is found at TestRunner.idl.
2215
2216         Because PassContext was removed from IDLAttributes.txt in rr207519, but it's implemented by
2217         CodeGeneratorTestRunner.pm and used by TestRunner.idl.
2218
2219         * bindings/scripts/IDLAttributes.txt: Bring back PassContext.
2220
2221 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2222
2223         Unreviewed. Fix the build with GCC 4.9 after r207463.
2224
2225         Add constructors to MediaConstraintsData.
2226
2227         * Modules/mediastream/MediaConstraintsImpl.h:
2228         (WebCore::MediaConstraintsData::MediaConstraintsData):
2229
2230 2016-10-19  Jer Noble  <jer.noble@apple.com>
2231
2232         [Mac][MSE] Movies with a 'mehd' box have a zero-duration
2233         https://bugs.webkit.org/show_bug.cgi?id=163641
2234
2235         Reviewed by Darin Adler.
2236
2237         Test: media/media-source/media-source-init-segment-duration.html
2238
2239         The canonical (ISO/IEC 14496-12:2012) way to signal the duration of a fragmented media file is to add a
2240         'mehd' box to the 'mvex' container box specifying the duration of the fragment. Support this through the
2241         AVAsset -overallDurationHint property.
2242
2243         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2244         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2245         * platform/spi/mac/AVFoundationSPI.h:
2246
2247 2016-10-18  Darin Adler  <darin@apple.com>
2248
2249         Move many miscellaneous classes from ExceptionCode to Exception
2250         https://bugs.webkit.org/show_bug.cgi?id=163645
2251
2252         Reviewed by Ryosuke Niwa.
2253
2254         * bindings/js/JSCryptoCustom.cpp:
2255         (WebCore::JSCrypto::getRandomValues): Use propagateException.
2256         * bindings/js/JSDOMWindowCustom.cpp:
2257         (WebCore::handlePostMessage): Ditto.
2258         (WebCore::JSDOMWindow::setTimeout): Use toJSNumber.
2259         (WebCore::JSDOMWindow::setInterval): Ditto.
2260         * bindings/js/JSStorageCustom.cpp:
2261         (WebCore::JSStorage::nameGetter): Use propagateException.
2262         (WebCore::JSStorage::deleteProperty): Ditto.
2263         (WebCore::JSStorage::getOwnPropertyNames): Ditto.
2264         (WebCore::JSStorage::putDelegate): Ditto.
2265
2266         * loader/appcache/DOMApplicationCache.cpp:
2267         (WebCore::DOMApplicationCache::update): Use ExceptionOr.
2268         (WebCore::DOMApplicationCache::swapCache): Ditto.
2269         * loader/appcache/DOMApplicationCache.h: Update for above changes.
2270         * loader/appcache/DOMApplicationCache.idl: Use non-legacy exceptions.
2271
2272         * page/Crypto.cpp:
2273         (WebCore::Crypto::getRandomValues): Use ExceptionOr.
2274         (WebCore::Crypto::webkitSubtle): Ditto.
2275         * page/Crypto.h: Updated for above changes.
2276         * page/Crypto.idl: Use non-legacy exceptions.
2277
2278         * page/DOMWindow.cpp:
2279         (WebCore::DOMWindow::DOMWindow): Initialize many data members in
2280         the class definition instead of here.
2281         (WebCore::DOMWindow::page): Use nullptr.
2282         (WebCore::DOMWindow::screen): Ditto.
2283         (WebCore::DOMWindow::crypto): Ditto.
2284         (WebCore::DOMWindow::locationbar): Ditto.
2285         (WebCore::DOMWindow::menubar): Ditto.
2286         (WebCore::DOMWindow::personalbar): Ditto.
2287         (WebCore::DOMWindow::scrollbars): Ditto.
2288         (WebCore::DOMWindow::statusbar): Ditto.
2289         (WebCore::DOMWindow::toolbar): Ditto.
2290         (WebCore::DOMWindow::applicationCache): Ditto.
2291         (WebCore::DOMWindow::sessionStorage): Use ExceptionOr.
2292         (WebCore::DOMWindow::localStorage): Ditto.
2293         (WebCore::DOMWindow::postMessage): Ditto.
2294         (WebCore::DOMWindow::frameElement): Use nullptr.
2295         (WebCore::DOMWindow::self): Ditto.
2296         (WebCore::DOMWindow::opener): Ditto.
2297         (WebCore::DOMWindow::parent): Ditto.
2298         (WebCore::DOMWindow::top): Ditto.
2299         (WebCore::DOMWindow::getComputedStyle): Use Ref.
2300         (WebCore::DOMWindow::setTimeout): Use ExceptionOr.
2301         (WebCore::DOMWindow::setInterval): Ditto.
2302         (WebCore::didAddStorageEventListener): Use a reference instead of a
2303         pointer, and ignore return value instead of using IGNORE_EXCEPTION.
2304         (WebCore::DOMWindow::addEventListener): Pass reference to function above.
2305         (WebCore::DOMWindow::dispatchEvent): Use enum class version of PageStatus.
2306         * page/DOMWindow.h: Updated for changes above. Also changed indentatation.
2307         * page/DOMWindow.idl: Use non-legacy exceptions.
2308
2309         * page/EventSource.cpp:
2310         (WebCore::EventSource::create): Use ExceptionOr.
2311         * page/EventSource.h: Updated for change above.
2312         * page/EventSource.idl: Use non-legacy exception.
2313
2314         * page/Location.cpp:
2315         (WebCore::Location::setProtocol): Use ExceptionOr.
2316         * page/Location.h: Updated for change above.
2317         * page/Location.idl: Use non-legacy exception.
2318
2319         * page/Performance.cpp:
2320         (WebCore::Performance::Performance): Remove unnecessary initialization of
2321         smart pointer to null, and moved initialization of m_resourceTimingBufferSize
2322         to the header.
2323         (WebCore::Performance::navigation): Made non-const and return a reference.
2324         (WebCore::Performance::timing): Ditto.
2325         (WebCore::Performance::addResourceTiming): Change LoadTiming argument to use
2326         a const& instead of passing in a copy.
2327         (WebCore::Performance::webkitMark): Use ExceptionOr and make_unique.
2328         (WebCore::Performance::webkitClearMarks): Ditto.
2329         (WebCore::Performance::webkitMeasure): Ditto.
2330         (WebCore::Performance::webkitClearMeasures): Ditto.
2331         (WebCore::Performance::reduceTimeResolution): Use std::floor.
2332         * page/Performance.h: Updated for above changes. Removed unneeded includes.
2333         Made more things private. Removed unneeded reference counting of UserTiming.
2334         * page/Performance.idl: Use non-legacy exceptions.
2335
2336         * page/PerformanceUserTiming.cpp:
2337         (WebCore::restrictedMarkFunction): Removed unneeded class name.
2338         (WebCore::UserTiming::UserTiming): Take a reference instead of a pointer.
2339         (WebCore::UserTiming::mark): Use ExceptionOr.
2340         (WebCore::UserTiming::findExistingMarkStartTime): Ditto.
2341         (WebCore::UserTiming::measure): Ditto.
2342         (WebCore::getEntrySequenceByName): Simplified code using HashMap::get.
2343         * page/PerformanceUserTiming.h: Updated for above changes. Removed reference
2344         counting since this is a single-owner object.
2345
2346         * page/UserMessageHandler.cpp:
2347         (WebCore::UserMessageHandler::postMessage): Use ExceptionOr.
2348         * page/UserMessageHandler.h: Updated for above change.
2349         * page/UserMessageHandler.idl: Use non-legacy exception.
2350
2351         * storage/Storage.cpp:
2352         (WebCore::Storage::length): Use ExceptionOr.
2353         (WebCore::Storage::key): Ditto.
2354         (WebCore::Storage::getItem): Ditto.
2355         (WebCore::Storage::setItem): Ditto.
2356         (WebCore::Storage::removeItem): Ditto.
2357         (WebCore::Storage::clear): Ditto.
2358         (WebCore::Storage::contains): Ditto.
2359         * storage/Storage.h: Updated for above change.
2360         * storage/Storage.idl: Use non-legacy exceptions.
2361
2362         * storage/StorageEventDispatcher.cpp:
2363         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
2364         Updated for ExceptionOr.
2365         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.
2366
2367 2016-10-18  Darin Adler  <darin@apple.com>
2368
2369         Move internal testing classes from ExceptionCode to Exception
2370         https://bugs.webkit.org/show_bug.cgi?id=163553
2371
2372         Reviewed by Ryosuke Niwa.
2373
2374         * bindings/js/JSDOMBinding.h: Added toJSArray. Also exported a function that
2375         is now needed in the testing library.
2376         * bindings/scripts/CodeGeneratorJS.pm:
2377         (NativeToJSValue): Added code to handle the jsArray case with an exception.
2378
2379         * css/parser/CSSPropertyParser.cpp: Fix #if to make code compile when
2380         CSS_SCROLL_SNAP is not enabled.
2381
2382         * dom/Element.cpp:
2383         (WebCore::Element::createShadowRoot): Changed return type to a raw pointer.
2384         There is no reason it needs to be a RefPtr.
2385         * dom/Element.h: Updated for above change.
2386
2387         * svg/SVGPathStringBuilder.h: Exported class and made more public so it can
2388         be used in test code.
2389
2390         * svg/SVGPathUtilities.cpp:
2391         (WebCore::pathIteratorForBuildingString): Deleted. Needed only for test code,
2392         so moved into there.
2393         (WebCore::buildStringFromPath): Deleted. Ditto.
2394         * svg/SVGPathUtilities.h: Removed buildStringFromPath.
2395
2396         * testing/InternalSettings.cpp: Simplified the guard macro and used the all
2397         capitals style that our style guide prescribes for non-function-like macros.
2398         (WebCore::InternalSettings::create): Moved here, no longer inline Use m_page.
2399         (WebCore::InternalSettings::resetToConsistentState): Updated since settings
2400         returns a reference.
2401         (WebCore::InternalSettings::settings): Changed to return a reference and
2402         assert that m_page is not null; functions all check m_page for null first.
2403         (WebCore::InternalSettings::setTouchEventEmulationEnabled): Updated to use
2404         ExceptionOr, do an m_page check, and use settings that returns a reference.
2405         (WebCore::InternalSettings::setStandardFontFamily): Ditto.
2406         (WebCore::InternalSettings::setSerifFontFamily): Ditto.
2407         (WebCore::InternalSettings::setSansSerifFontFamily): Ditto.
2408         (WebCore::InternalSettings::setFixedFontFamily): Ditto.
2409         (WebCore::InternalSettings::setCursiveFontFamily): Ditto.
2410         (WebCore::InternalSettings::setFantasyFontFamily): Ditto.
2411         (WebCore::InternalSettings::setPictographFontFamily): Ditto.
2412         (WebCore::InternalSettings::setTextAutosizingEnabled): Ditto.
2413         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): Ditto.
2414         (WebCore::InternalSettings::setMediaTypeOverride): Ditto.
2415         (WebCore::InternalSettings::setCanStartMedia): Ditto.
2416         (WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Ditto.
2417         (WebCore::InternalSettings::setEditingBehavior): Ditto.
2418         (WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
2419         (WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
2420         (WebCore::InternalSettings::setStorageBlockingPolicy): Ditto.
2421         (WebCore::InternalSettings::setPreferMIMETypeForImages): Ditto.
2422         (WebCore::InternalSettings::setImagesEnabled): Ditto.
2423         (WebCore::InternalSettings::setPDFImageCachingPolicy): Ditto.
2424         (WebCore::InternalSettings::setMinimumTimerInterval): Ditto.
2425         (WebCore::InternalSettings::setDefaultVideoPosterURL): Ditto.
2426         (WebCore::InternalSettings::setForcePendingWebGLPolicy): Ditto.
2427         (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): Ditto.
2428         (WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): Ditto.
2429         (WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled): Ditto.
2430         (WebCore::InternalSettings::setFontFallbackPrefersPictographs): Ditto.
2431         (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Ditto.
2432         (WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Ditto.
2433         (WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Ditto.
2434         (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): Ditto.
2435         (WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy): Ditto.
2436         (WebCore::InternalSettings::setScrollingTreeIncludesFrames): Ditto.
2437         (WebCore::InternalSettings::setAllowsInlineMediaPlayback): Ditto.
2438         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen): Ditto.
2439         (WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Ditto.
2440         (WebCore::InternalSettings::setIndexedDBWorkersEnabled): Ditto.
2441         (WebCore::InternalSettings::userInterfaceDirectionPolicy): Ditto.
2442         (WebCore::InternalSettings::setUserInterfaceDirectionPolicy): Ditto.
2443         (WebCore::InternalSettings::systemLayoutDirection): Ditto.
2444         (WebCore::InternalSettings::setSystemLayoutDirection): Ditto.
2445         (WebCore::InternalSettings::variationFontsEnabled): Ditto.
2446         (WebCore::InternalSettings::setVariationFontsEnabled): Ditto.
2447         (WebCore::InternalSettings::forcedPrefersReducedMotionValue): Ditto.
2448         (WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Ditto.
2449         * testing/InternalSettings.h: Updated for above changes. Also moved Backup to make
2450         it private instead of public.
2451         * testing/InternalSettings.idl: Use non-legacy execption. Also removed unneeded
2452         exception for setIndexedDBWorkersEnabled.
2453
2454         * testing/Internals.cpp: Marked InspectorStubFrontend final and made everything private.
2455         (WebCore::Internals::setCanShowModalDialogOverride): Use ExceptionOr.
2456         (WebCore::Internals::lastSpatialNavigationCandidateCount): Ditto.
2457         (WebCore::Internals::animationsAreSuspended): Ditto.
2458         (WebCore::Internals::suspendAnimations): Ditto.
2459         (WebCore::Internals::resumeAnimations): Ditto.
2460         (WebCore::Internals::pauseAnimationAtTimeOnElement): Ditto.
2461         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
2462         (WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
2463         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
2464         (WebCore::Internals::elementRenderTreeAsText): Ditto.
2465         (WebCore::Internals::ensureShadowRoot): Ditto.
2466         (WebCore::Internals::createShadowRoot): Ditto.
2467         (WebCore::Internals::shadowRootType): Ditto.
2468         (WebCore::Internals::isTimerThrottled): Ditto.
2469         (WebCore::Internals::formControlStateOfPreviousHistoryItem): Ditto.
2470         (WebCore::Internals::setFormControlStateOfPreviousHistoryItem): Ditto.
2471         (WebCore::Internals::absoluteCaretBounds): Ditto.
2472         (WebCore::Internals::inspectorHighlightRects): Ditto.
2473         (WebCore::Internals::inspectorHighlightObject): Ditto.
2474         (WebCore::Internals::markerCountForNode): Ditto.
2475         (WebCore::Internals::markerAt): Ditto.
2476         (WebCore::Internals::markerRangeForNode): Ditto.
2477         (WebCore::Internals::markerDescriptionForNode): Ditto.
2478         (WebCore::Internals::dumpMarkerRects): Ditto.
2479         (WebCore::Internals::setMarkedTextMatchesAreHighlighted): Ditto.
2480         (WebCore::Internals::setScrollViewPosition): Ditto.
2481         (WebCore::Internals::setViewBaseBackgroundColor): Ditto.
2482         (WebCore::Internals::setPagination): Ditto.
2483         (WebCore::Internals::setPaginationLineGridEnabled): Ditto.
2484         (WebCore::Internals::configurationForViewport): Ditto.
2485         (WebCore::Internals::wasLastChangeUserEdit): Ditto.
2486         (WebCore::Internals::scrollElementToRect): Ditto.
2487         (WebCore::Internals::autofillFieldName): Ditto.
2488         (WebCore::Internals::paintControlTints): Ditto.
2489         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Ditto.
2490         (WebCore::Internals::setDelegatesScrolling): Ditto.
2491         (WebCore::Internals::lastSpellCheckRequestSequence): Ditto.
2492         (WebCore::Internals::lastSpellCheckProcessedSequence): Ditto.
2493         (WebCore::Internals::wheelEventHandlerCount): Ditto.
2494         (WebCore::Internals::touchEventHandlerCount): Ditto.
2495         (WebCore::Internals::nodesFromRect): Ditto.
2496         (WebCore::Internals::setBatteryStatus): Ditto.
2497         (WebCore::Internals::setDeviceProximity): Ditto.
2498         (WebCore::Internals::hasSpellingMarker): Ditto.
2499         (WebCore::Internals::hasAutocorrectedMarker): Ditto.
2500         (WebCore::Internals::handleAcceptedCandidate): Ditto.
2501         (WebCore::Internals::isOverwriteModeEnabled): Ditto.
2502         (WebCore::Internals::toggleOverwriteModeEnabled): Ditto.
2503         (WebCore::Internals::countMatchesForText): Ditto.
2504         (WebCore::Internals::countFindMatches): Ditto.
2505         (WebCore::Internals::setInspectorIsUnderTest): Ditto.
2506         (WebCore::Internals::hasGrammarMarker): Ditto.
2507         (WebCore::Internals::numberOfScrollableAreas): Ditto.
2508         (WebCore::Internals::isPageBoxVisible): Ditto.
2509         (WebCore::Internals::layerTreeAsText): Ditto.
2510         (WebCore::Internals::repaintRectsAsText): Ditto.
2511         (WebCore::Internals::scrollingStateTreeAsText): Ditto.
2512         (WebCore::Internals::mainThreadScrollingReasons): Ditto.
2513         (WebCore::Internals::nonFastScrollableRects): Ditto.
2514         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
2515         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
2516         (WebCore::Internals::displayListForElement): Ditto.
2517         (WebCore::Internals::replayDisplayListForElement): Ditto.
2518         (WebCore::Internals::garbageCollectDocumentResources): Ditto.
2519         (WebCore::Internals::insertAuthorCSS): Ditto.
2520         (WebCore::Internals::insertUserCSS): Ditto.
2521         (WebCore::Internals::pageProperty): Ditto.
2522         (WebCore::Internals::pageSizeAndMarginsInPixels): Ditto.
2523         (WebCore::Internals::setPageScaleFactor): Ditto.
2524         (WebCore::Internals::setPageZoomFactor): Ditto.
2525         (WebCore::Internals::setTextZoomFactor): Ditto.
2526         (WebCore::Internals::setUseFixedLayout): Ditto.
2527         (WebCore::Internals::setFixedLayoutSize): Ditto.
2528         (WebCore::Internals::setViewExposedRect): Ditto.
2529         (WebCore::Internals::setHeaderHeight): Ditto.
2530         (WebCore::Internals::setFooterHeight): Ditto.
2531         (WebCore::Internals::setTopContentInset): Ditto.
2532         (WebCore::Internals::setApplicationCacheOriginQuota): Ditto.
2533         (WebCore::Internals::startTrackingRepaints): Ditto.
2534         (WebCore::Internals::stopTrackingRepaints): Ditto.
2535         (WebCore::Internals::startTrackingLayerFlushes): Ditto.
2536         (WebCore::Internals::layerFlushCount): Ditto.
2537         (WebCore::Internals::startTrackingStyleRecalcs): Ditto.
2538         (WebCore::Internals::styleRecalcCount): Ditto.
2539         (WebCore::Internals::startTrackingCompositingUpdates): Ditto.
2540         (WebCore::Internals::compositingUpdateCount): Ditto.
2541         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Ditto.
2542         (WebCore::Internals::getCurrentCursorInfo): Ditto.
2543         (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
2544         (WebCore::Internals::captionsStyleSheetOverride): Ditto.
2545         (WebCore::Internals::setCaptionsStyleSheetOverride): Ditto.
2546         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride): Ditto.
2547         (WebCore::Internals::setCaptionDisplayMode): Ditto.
2548         (WebCore::Internals::selectionBounds): Ditto.
2549         (WebCore::Internals::isVibrating): Ditto.
2550         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Ditto.
2551         (WebCore::Internals::beginMediaSessionInterruption): Ditto.
2552         (WebCore::Internals::setMediaSessionRestrictions): Ditto.
2553         (WebCore::Internals::postRemoteControlCommand): Ditto.
2554         (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
2555         (WebCore::Internals::installMockPageOverlay): Ditto.
2556         (WebCore::Internals::pageOverlayLayerTreeAsText): Ditto.
2557         (WebCore::Internals::scrollSnapOffsets): Ditto.
2558         (WebCore::Internals::pathStringWithShrinkWrappedRects): Moved the code that builds
2559         the path string in here for now since it's only used for this testing.
2560         (WebCore::Internals::resourceLoadStatisticsForOrigin): Take a const String&.
2561
2562         * testing/Internals.h: Updated for above changes.
2563         * testing/Internals.idl: Use non-legacy exceptions.
2564
2565 2016-10-18  Chris Dumez  <cdumez@apple.com>
2566
2567         [Web IDL] Drop webkit-specific extended attributes that are no longer useful
2568         https://bugs.webkit.org/show_bug.cgi?id=163643
2569
2570         Reviewed by Ryosuke Niwa.
2571
2572         Drop webkit-specific IDL extended attributes that are no longer useful:
2573         - [CustomReturn]: I believe this used to be for ObjC bindings. It has
2574           no impact in JS bindings.
2575         - [Deletable]: It only had an impact on static attributes and was only
2576           used on HTMLAllCollection.all, which is not static. I updated the
2577           bindings generator to so that static attributes are now configurable
2578           by default (unless marked as [Unforgeable], as per Web IDL [1]. This
2579           causes Notification.permission (This only static attribute we have)
2580           to become deletable. This behavior is consistent with the specification
2581           and with Chrome. I added test coverage for this.
2582         - [ImplementationNamespace]: Implemented but unused.
2583         - [PassContext]: Not implemented and unused.
2584         - [TypedArray=*]: Not implemented and unused.
2585
2586         [1] https://heycam.github.io/webidl/#es-attributes
2587
2588         Test: fast/notifications/notification-permisssion-deletable.html
2589
2590         * bindings/scripts/CodeGeneratorJS.pm:
2591         (GetNamespaceForInterface):
2592         (GenerateImplementation):
2593         * bindings/scripts/IDLAttributes.txt:
2594         * bindings/scripts/test/JS/JSTestInterface.cpp:
2595         * bindings/scripts/test/JS/JSTestObj.cpp:
2596         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2597         * dom/Node.idl:
2598         * html/HTMLDocument.idl:
2599
2600 2016-10-18  Sam Weinig  <sam@webkit.org>
2601
2602         Replace std::experimental::variant with WTF::Variant (or similar)
2603         https://bugs.webkit.org/show_bug.cgi?id=163626
2604
2605         Reviewed by Chris Dumez.
2606
2607         Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc.
2608         into the WTF namespace.
2609
2610         * Modules/fetch/FetchBody.h:
2611         (WebCore::FetchBody::isBlob):
2612         (WebCore::FetchBody::isFormData):
2613         (WebCore::FetchBody::isArrayBuffer):
2614         (WebCore::FetchBody::isArrayBufferView):
2615         (WebCore::FetchBody::isURLSearchParams):
2616         (WebCore::FetchBody::isText):
2617         (WebCore::FetchBody::blobBody):
2618         (WebCore::FetchBody::formDataBody):
2619         (WebCore::FetchBody::arrayBufferBody):
2620         (WebCore::FetchBody::arrayBufferViewBody):
2621         (WebCore::FetchBody::textBody):
2622         (WebCore::FetchBody::urlSearchParamsBody):
2623         * bindings/generic/IDLTypes.h:
2624         * dom/ExceptionOr.h:
2625         (WebCore::ExceptionOr<ReturnType>::hasException):
2626         (WebCore::ExceptionOr<ReturnType>::releaseException):
2627         (WebCore::ExceptionOr<ReturnType>::releaseReturnValue):
2628         * dom/MessageEvent.cpp:
2629         (WebCore::MessageEvent::source):
2630         * dom/MessageEvent.h:
2631         * dom/Node.cpp:
2632         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
2633         (WebCore::Node::convertNodesOrStringsIntoNode):
2634         * dom/Node.h:
2635         * html/HTMLOptionsCollection.h:
2636         * html/HTMLSelectElement.cpp:
2637         (WebCore::HTMLSelectElement::add):
2638         * html/HTMLSelectElement.h:
2639         * html/track/TrackEvent.cpp:
2640         (WebCore::TrackEvent::TrackEvent):
2641         * html/track/TrackEvent.h:
2642
2643 2016-10-18  Chris Dumez  <cdumez@apple.com>
2644
2645         Unreviewed, rebaseline bindings tests after Sam's r207505.
2646
2647         * bindings/scripts/test/JS/JSTestCallback.cpp:
2648         (WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
2649         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2650         (WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
2651         * bindings/scripts/test/JS/JSTestObj.cpp:
2652         (WebCore::jsTestObjPrototypeFunctionSerializedValueCaller):
2653         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2654         (WebCore::jsTestSerializedScriptValueInterfaceValueGetter):
2655         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValueGetter):
2656         (WebCore::jsTestSerializedScriptValueInterfaceCachedValueGetter):
2657         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter):
2658         (WebCore::setJSTestSerializedScriptValueInterfaceValueFunction):
2659         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValueFunction):
2660         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2661         (WebCore::jsTestTypedefsImmutableSerializedScriptValueGetter):
2662         (WebCore::setJSTestTypedefsImmutableSerializedScriptValueFunction):
2663
2664 2016-10-18  Chris Dumez  <cdumez@apple.com>
2665
2666         [Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
2667         https://bugs.webkit.org/show_bug.cgi?id=163630
2668
2669         Reviewed by Darin Adler.
2670
2671         Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor] in our
2672         IDL now that all our events use proper constructors instead.
2673
2674         * bindings/scripts/CodeGenerator.pm:
2675         * bindings/scripts/CodeGeneratorJS.pm:
2676         (GenerateHeader):
2677         (GenerateConstructorDefinition):
2678         (GenerateConstructorHelperMethods):
2679         (IsConstructable):
2680         * bindings/scripts/IDLAttributes.txt:
2681         * dom/Event.h:
2682         (WebCore::Event::create):
2683         * dom/Event.idl:
2684         * dom/UIEvent.h:
2685         (WebCore::UIEvent::create):
2686         * dom/UIEvent.idl:
2687
2688 2016-10-18  Chris Dumez  <cdumez@apple.com>
2689
2690         Changing details.open should cause a toggle event to be fired asynchronously
2691         https://bugs.webkit.org/show_bug.cgi?id=163568
2692
2693         Reviewed by Darin Adler.
2694
2695         Changing details.open should cause a toggle event to be fired asynchronously:
2696         - https://html.spec.whatwg.org/#details-notification-task-steps
2697
2698         Firefox and Chrome implement this, we don't.
2699
2700         Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html
2701
2702         * dom/EventNames.h:
2703         * dom/GlobalEventHandlers.idl:
2704         * html/HTMLAttributeNames.in:
2705         * html/HTMLDetailsElement.cpp:
2706         (WebCore::detailToggleEventSender):
2707         (WebCore::HTMLDetailsElement::~HTMLDetailsElement):
2708         (WebCore::HTMLDetailsElement::dispatchPendingEvent):
2709         (WebCore::HTMLDetailsElement::parseAttribute):
2710         * html/HTMLDetailsElement.h:
2711         * html/HTMLElement.cpp:
2712         (WebCore::HTMLElement::createEventHandlerNameMap):
2713
2714 2016-10-18  Dave Hyatt  <hyatt@apple.com>
2715
2716         [CSS Parser] Enable basic parser testing.
2717         https://bugs.webkit.org/show_bug.cgi?id=163639
2718
2719         Reviewed by Dean Jackson.
2720
2721         * css/SelectorChecker.cpp:
2722         (WebCore::SelectorChecker::matchRecursively):
2723         Remove the ASSERT_NOT_REACHED on the new shadow selectors. We need to implement this
2724         eventually, but it's better to not assert on that for now.
2725
2726         * css/parser/CSSParserValues.cpp:
2727         (WebCore::CSSParserSelector::isHostPseudoSelector):
2728         Make sure to check that we're a pseudoclass selector first, since otherwise we'll assert.
2729
2730         * css/parser/CSSParserValues.h:
2731         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
2732         Make sure to check that we're a pseudoelement selector first, since otherwise we'll assert.
2733
2734         * css/parser/CSSPropertyParser.cpp:
2735         (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
2736         copyRef is needed here, since a singleton value is being propagated to all the expanded shorthand properties.
2737
2738         (WebCore::parseSingleShadow):
2739         (WebCore::CSSPropertyParser::consumeFont):
2740         Remove the font properties that aren't part of our shorthand. We will need to revisit this eventually as it seems
2741         some of the font properties should be reset as part of this shorthand but aren't.
2742 '
2743         * css/parser/CSSPropertyParserHelpers.cpp:
2744         (WebCore::CSSPropertyParserHelpers::consumeInteger):
2745         Just return a number for now instead of the parser_integer type.
2746
2747         * css/parser/CSSSelectorParser.cpp:
2748         (WebCore::CSSSelectorParser::consumePseudo):
2749         Clean this up so that it doesn't assert by making sure to add qualifying checks for the appropriate match type.
2750
2751 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
2752
2753         Update the comment for HTML Imports as there is now a proposal to use ES6 Modules for this.
2754         Also replace the contact by me since I'm most familiar with this feature.
2755
2756         * features.json:
2757
2758 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
2759
2760         Update the status of shadow DOM API to "Done" with a comment saying we're still fixing bugs.
2761
2762         Also update my contact information since I'm no longer on Twitter.
2763
2764         * features.json:
2765
2766 2016-10-18  Chris Dumez  <cdumez@apple.com>
2767
2768         Provide better form validation messages
2769         https://bugs.webkit.org/show_bug.cgi?id=163584
2770
2771         Reviewed by Darin Adler.
2772
2773         Provide better form validation messages that match more closely the ones
2774         from Chrome and Firefox.
2775
2776         No new tests, updated existing tests.
2777
2778         * English.lproj/Localizable.strings:
2779         * platform/LocalizedStrings.cpp:
2780         (WebCore::validationMessageValueMissingText):
2781         (WebCore::validationMessageValueMissingForCheckboxText):
2782         (WebCore::validationMessageValueMissingForFileText):
2783         (WebCore::validationMessageValueMissingForMultipleFileText):
2784         (WebCore::validationMessageValueMissingForRadioText):
2785         (WebCore::validationMessageValueMissingForSelectText):
2786         (WebCore::validationMessageTypeMismatchText):
2787         (WebCore::validationMessageTypeMismatchForEmailText):
2788         (WebCore::validationMessageTypeMismatchForMultipleEmailText):
2789         (WebCore::validationMessageTypeMismatchForURLText):
2790         (WebCore::validationMessagePatternMismatchText):
2791         (WebCore::validationMessageTooShortText):
2792         (WebCore::validationMessageTooLongText):
2793         (WebCore::validationMessageRangeUnderflowText):
2794         (WebCore::validationMessageRangeOverflowText):
2795         (WebCore::validationMessageStepMismatchText):
2796         (WebCore::validationMessageBadInputForNumberText):
2797
2798 2016-10-18  Dave Hyatt  <hyatt@apple.com>
2799
2800         Fix GTK build.
2801
2802         * css/parser/CSSPropertyParser.cpp:
2803         (WebCore::CSSPropertyParser::parseSingleValue):
2804
2805 2016-10-18  Sam Weinig  <sam@webkit.org>
2806
2807         Simplify SerializedScriptValue, MessagePortArray and ArrayBufferArray to ease generation
2808         https://bugs.webkit.org/show_bug.cgi?id=163625
2809
2810         Reviewed by Chris Dumez.
2811
2812         - Replace uses of MessagePortArray (a.k.a. Vector<RefPtr<MessagePort>, 1>) with Vector<RefPtr<MessagePort>>.
2813         - Replace uses of ArrayBufferArray (a.k.a. Vector<RefPtr<ArrayBuffer>, 1>) with Vector<RefPtr<ArrayBuffer>>.
2814         - Add convenience functions to SerializedScriptValue to allow calling with fewer parameters.
2815         - Move MessagePorts and ArrayBuffers more where possible.
2816
2817         * Modules/indexeddb/IDBObjectStore.cpp:
2818         (WebCore::IDBObjectStore::putOrAdd):
2819         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2820         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2821         * bindings/js/IDBBindingUtilities.cpp:
2822         (WebCore::deserializeIDBValueToJSValue):
2823         * bindings/js/JSCustomEventCustom.cpp:
2824         (WebCore::JSCustomEvent::detail):
2825         * bindings/js/JSHistoryCustom.cpp:
2826         (WebCore::JSHistory::state):
2827         (WebCore::JSHistory::pushState):
2828         (WebCore::JSHistory::replaceState):
2829         * bindings/js/JSPopStateEventCustom.cpp:
2830         (WebCore::JSPopStateEvent::state):
2831         * dom/CustomEvent.cpp:
2832         (WebCore::CustomEvent::trySerializeDetail):
2833         * dom/ErrorEvent.cpp:
2834         (WebCore::ErrorEvent::sanitizedErrorValue):
2835         (WebCore::ErrorEvent::trySerializeError):
2836         * dom/PopStateEvent.cpp:
2837         (WebCore::PopStateEvent::trySerializeState):
2838         * page/DOMWindow.cpp:
2839         (WebCore::DOMWindow::postMessage):
2840         * page/DOMWindow.h:
2841         * workers/DedicatedWorkerGlobalScope.cpp:
2842         (WebCore::DedicatedWorkerGlobalScope::postMessage):
2843         * workers/DedicatedWorkerGlobalScope.h:
2844         * workers/Worker.cpp:
2845         (WebCore::Worker::postMessage):
2846         * workers/Worker.h:
2847         * bindings/js/JSDOMWindowCustom.cpp:
2848         (WebCore::handlePostMessage):
2849         * bindings/js/JSDictionary.cpp:
2850         (WebCore::JSDictionary::convertValue):
2851         * bindings/js/JSDictionary.h:
2852         Updated for new SerializedScriptValue interface/vector naming.
2853
2854         * bindings/js/JSMessageEventCustom.cpp:
2855         (WebCore::handleInitMessageEvent):
2856         Update handleInitMessageEvent to check for exceptions and use convert for the MessagePort sequence.
2857
2858         * bindings/js/JSMessagePortCustom.cpp:
2859         (WebCore::extractTransferables):
2860         (WebCore::fillMessagePortArray): Deleted.
2861         * bindings/js/JSMessagePortCustom.h:
2862         (WebCore::handlePostMessage):
2863         Rename fillMessagePortArray to extractTransferables to better express what it does.
2864
2865         * bindings/js/SerializedScriptValue.cpp:
2866         (WebCore::CloneSerializer::serialize):
2867         (WebCore::CloneSerializer::CloneSerializer):
2868         (WebCore::CloneSerializer::fillTransferMap):
2869         (WebCore::CloneSerializer::dumpIfTerminal):
2870         (WebCore::CloneDeserializer::deserialize):
2871         (WebCore::CloneDeserializer::CloneDeserializer):
2872         (WebCore::CloneDeserializer::readTerminal):
2873         (WebCore::SerializedScriptValue::transferArrayBuffers):
2874         (WebCore::SerializedScriptValue::create):
2875         (WebCore::SerializedScriptValue::deserialize):
2876         * bindings/js/SerializedScriptValue.h:
2877         Simplify interface to allow more callers to avoid passing default arguments. Use ExecState& more.
2878         * bindings/scripts/CodeGeneratorJS.pm:
2879         (GetNativeVectorType):
2880         Remove special case for MessagePort.
2881         (JSValueToNative):
2882         (NativeToJSValue):
2883         Updated for new SerializedScriptValue interface.
2884
2885         * dom/MessageEvent.cpp:
2886         (WebCore::MessageEvent::MessageEvent):
2887         (WebCore::MessageEvent::create):
2888         (WebCore::MessageEvent::initMessageEvent):
2889         (WebCore::MessageEvent::trySerializeData):
2890         * dom/MessageEvent.h:
2891         Store the MessagePort sequence as a Vector<RefPtr<MessagePort>> rather than in a unique_ptr.
2892
2893         * dom/MessageEvent.idl:
2894         Update last type in init functions to be sequence<MessagePort> rather than Array. They are still
2895         custom, as we don't quite generate these correctly yet. 
2896
2897         * dom/MessagePort.cpp:
2898         (WebCore::MessagePort::postMessage):
2899         (WebCore::MessagePort::dispatchMessages):
2900         (WebCore::MessagePort::disentanglePorts):
2901         (WebCore::MessagePort::entanglePorts):
2902         * dom/MessagePort.h:
2903         Update interface to take MessagePort vectors by rvalue reference.
2904
2905 2016-10-18  Chris Dumez  <cdumez@apple.com>
2906
2907         [iOS] Drop JSDictionary::convertValue() overload taking a TouchList
2908         https://bugs.webkit.org/show_bug.cgi?id=163620
2909
2910         Reviewed by Sam Weinig.
2911
2912         Drop JSDictionary::convertValue() overload taking a TouchList now that
2913         TouchEvent is using a proper constructor with a TouchEventInit
2914         dictionary on iOS.
2915
2916         * bindings/js/JSDictionary.cpp:
2917
2918 2016-10-18  Dean Jackson  <dino@apple.com>
2919
2920         Remove CSS_SHAPES feature definition. This should always be on.
2921         https://bugs.webkit.org/show_bug.cgi?id=163628
2922         <rdar://problem/28834613>
2923
2924         Reviewed by Tim Horton.
2925
2926         CSS Shapes is in Candidate Recommendation. It's a core part
2927         of CSS. It should always be enabled.
2928
2929         * Configurations/FeatureDefines.xcconfig:
2930         * css/CSSComputedStyleDeclaration.cpp:
2931         (WebCore::shapePropertyValue):
2932         (WebCore::ComputedStyleExtractor::propertyValue):
2933         * css/CSSPropertyNames.in:
2934         * css/CSSValueKeywords.in:
2935         * css/StyleBuilderConverter.h:
2936         (WebCore::StyleBuilderConverter::convertShapeValue):
2937         * css/parser/CSSParser.cpp:
2938         (WebCore::isSimpleLengthPropertyID):
2939         (WebCore::CSSParser::parseValue):
2940         (WebCore::CSSParser::parseShapeProperty):
2941         * css/parser/CSSParser.h:
2942         * inspector/InspectorOverlay.cpp:
2943         (WebCore::buildObjectForShapeOutside):
2944         (WebCore::buildObjectForElementData):
2945         * page/animation/CSSPropertyAnimation.cpp:
2946         (WebCore::blendFunc):
2947         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2948         * rendering/FloatingObjects.cpp:
2949         (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
2950         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
2951         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
2952         * rendering/RenderBlock.cpp:
2953         * rendering/RenderBlockFlow.cpp:
2954         (WebCore::RenderBlockFlow::positionNewFloats):
2955         * rendering/RenderBox.cpp:
2956         (WebCore::RenderBox::~RenderBox):
2957         (WebCore::RenderBox::styleDidChange):
2958         (WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange):
2959         (WebCore::isCandidateForOpaquenessTest):
2960         (WebCore::RenderBox::imageChanged):
2961         * rendering/RenderBox.h:
2962         (WebCore::RenderBox::markShapeOutsideDependentsForLayout):
2963         * rendering/RenderElement.cpp:
2964         (WebCore::RenderElement::~RenderElement):
2965         (WebCore::RenderElement::updateShapeImage):
2966         (WebCore::RenderElement::initializeStyle):
2967         (WebCore::RenderElement::setStyle):
2968         * rendering/RenderElement.h:
2969         (WebCore::RenderElement::hasShapeOutside):
2970         * rendering/SimpleLineLayout.cpp:
2971         (WebCore::SimpleLineLayout::canUseForWithReason):
2972         * rendering/line/LineWidth.cpp:
2973         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
2974         (WebCore::LineWidth::wrapNextToShapeOutside):
2975         (WebCore::LineWidth::fitBelowFloats):
2976         * rendering/line/LineWidth.h:
2977         * rendering/shapes/ShapeOutsideInfo.cpp:
2978         * rendering/shapes/ShapeOutsideInfo.h:
2979         * rendering/style/RenderStyle.cpp:
2980         (WebCore::RenderStyle::changeRequiresLayout):
2981         (WebCore::RenderStyle::changeRequiresRepaint):
2982         * rendering/style/RenderStyle.h:
2983         (WebCore::RenderStyle::initialShapeImageThreshold):
2984         * rendering/style/ShapeValue.cpp:
2985         * rendering/style/ShapeValue.h:
2986         * rendering/style/StyleRareNonInheritedData.cpp:
2987         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2988         (WebCore::StyleRareNonInheritedData::operator==):
2989         * rendering/style/StyleRareNonInheritedData.h:
2990         * style/StylePendingResources.cpp:
2991         (WebCore::Style::loadPendingResources):
2992
2993 2016-10-18  Chris Dumez  <cdumez@apple.com>
2994
2995         convertDictionary<>() no longer needs to return an Optional<> type
2996         https://bugs.webkit.org/show_bug.cgi?id=163624
2997
2998         Reviewed by Sam Weinig.
2999
3000         convertDictionary<>() no longer needs to return an Optional<> type now
3001         that our dictionary structures are all default constructible after
3002         <https://trac.webkit.org/changeset/206974>.
3003
3004         * bindings/js/JSDOMConvert.h:
3005         * bindings/scripts/CodeGeneratorJS.pm:
3006         (GenerateDictionaryHeaderContent):
3007         (GenerateDictionaryImplementationContent):
3008         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3009         (WebCore::convertDictionary<TestEventConstructor::Init>):
3010         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3011         * bindings/scripts/test/JS/JSTestObj.cpp:
3012         (WebCore::convertDictionary<TestObj::Dictionary>):
3013         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
3014         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
3015         (WebCore::convertDictionary<AlternateDictionaryName>):
3016         (WebCore::convertDictionary<TestObj::ParentDictionary>):
3017         (WebCore::convertDictionary<TestObj::ChildDictionary>):
3018         * bindings/scripts/test/JS/JSTestObj.h:
3019         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
3020         (WebCore::convertDictionary<DictionaryImplName>):
3021         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
3022
3023 2016-10-18  Chris Dumez  <cdumez@apple.com>
3024
3025         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add()
3026         https://bugs.webkit.org/show_bug.cgi?id=163608
3027
3028         Reviewed by Ryosuke Niwa.
3029
3030         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add():
3031         - https://html.spec.whatwg.org/#htmlselectelement
3032         - https://html.spec.whatwg.org/#htmloptionscollection
3033
3034         No new tests, rebaseline existing test.
3035
3036         * bindings/scripts/CodeGeneratorJS.pm:
3037         (GenerateDefaultValue):
3038         (GenerateParametersCheck):
3039         * bindings/scripts/test/JS/JSTestObj.cpp:
3040         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyCaller):
3041         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3042         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
3043         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3044         (WebCore::jsTestTypedefsPrototypeFunctionFuncCaller):
3045         * html/HTMLOptGroupElement.idl:
3046         * html/HTMLOptionsCollection.cpp:
3047         (WebCore::HTMLOptionsCollection::add):
3048         * html/HTMLOptionsCollection.h:
3049         * html/HTMLOptionsCollection.idl:
3050         * html/HTMLSelectElement.cpp:
3051         (WebCore::HTMLSelectElement::add):
3052         (WebCore::HTMLSelectElement::setOption):
3053         (WebCore::HTMLSelectElement::setLength):
3054         * html/HTMLSelectElement.h:
3055         * html/HTMLSelectElement.idl:
3056
3057 2016-10-18  Aaron Chu  <aaron_chu@apple.com>
3058
3059         Web Inspector: AXI: focused/focusable state should be based on Accessibility Object instead of Element
3060         https://bugs.webkit.org/show_bug.cgi?id=163088
3061         <rdar://problem/16421985>
3062
3063         Reviewed by Darin Adler.
3064
3065         Changed code in InspectDOMAgent so that it determines the focusability of a Node based
3066         on the AccessibilityNodeObject and not the Element class.
3067
3068         Covered by existing tests: 
3069         LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html
3070
3071         * inspector/InspectorDOMAgent.cpp:
3072         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
3073
3074 2016-10-18  Anders Carlsson  <andersca@apple.com>
3075
3076         Get rid of more WebHistoryItem cruft
3077         https://bugs.webkit.org/show_bug.cgi?id=163623
3078
3079         Reviewed by Tim Horton.
3080
3081         * history/HistoryItem.cpp:
3082         (WebCore::HistoryItem::HistoryItem):
3083         * history/HistoryItem.h:
3084         (WebCore::HistoryItem::setViewportArguments):
3085         (WebCore::HistoryItem::bookmarkID): Deleted.
3086         (WebCore::HistoryItem::setBookmarkID): Deleted.
3087         (WebCore::HistoryItem::sharedLinkUniqueIdentifier): Deleted.
3088         (WebCore::HistoryItem::setSharedLinkUniqueIdentifier): Deleted.
3089
3090 2016-10-18  Dave Hyatt  <hyatt@apple.com>
3091
3092         Fix Windows build.
3093  
3094         * css/parser/CSSPropertyParser.cpp:
3095         (WebCore::CSSPropertyParser::parseSingleValue):
3096
3097 2016-10-18  Antoine Quint  <graouts@apple.com>
3098
3099         Modern media controls don't update their rendering correctly
3100         https://bugs.webkit.org/show_bug.cgi?id=163603
3101         <rdar://problem/28826022>
3102
3103         Reviewed by Dean Jackson.
3104
3105         There are rendering issues when we use an absolutely-positioned element
3106         as the top-most element in a media element's shadow root (webkit.org/b/163592).
3107         Since we only need for that element to be positioned, we can use "position: relative"
3108         instead, which removes the rendering issues.
3109
3110         * Modules/modern-media-controls/controls/media-controls.css:
3111         (.media-controls):
3112         (.media-controls,): Deleted.
3113
3114 2016-10-18  Dean Jackson  <dino@apple.com>
3115
3116         Add preliminary support for extended colors to WebCore::Color
3117         https://bugs.webkit.org/show_bug.cgi?id=162878
3118         <rdar://problem/28596413>
3119
3120         Follow-up review comments from Darin Adler.
3121
3122         * html/canvas/CanvasGradient.cpp:
3123         (WebCore::CanvasGradient::addColorStop): Use nullptr.
3124         * platform/graphics/Color.cpp:
3125         (WebCore::Color::Color): Explicitly zero before assigning the pointer.
3126         * platform/graphics/Color.h: Add some comments about the failings of operator== and hash.
3127         (WebCore::Color::Color): Add some static_asserts to the constructors. Move the empty and deleted values
3128         to static constants.
3129         (WebCore::Color::isHashTableDeletedValue):
3130         (WebCore::Color::hash): Replacement for asUint64, which was only being used for a hash.
3131         (WebCore::Color::asUint64): Deleted.
3132         * platform/graphics/ColorHash.h: Use new hash functions. Use "using" instead of typedef.
3133         (WTF::ColorHash::hash):
3134
3135 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
3136
3137         REGRESSION (r201471): Keyboard remains visible when swiping back on twitter.com
3138         https://bugs.webkit.org/show_bug.cgi?id=163581
3139         <rdar://problem/27739558>
3140
3141         Reviewed by Simon Fraser.
3142
3143         The bug was caused by Chrome::elementDidBlur not getting called, which resulted in
3144         StopAssistingNode not getting sent to the UI process.
3145
3146         Test: fast/forms/ios/hide-keyboard-on-node-removal.html
3147
3148         * dom/Document.cpp:
3149         (WebCore::Document::setFocusedElement): Restore the behavior prior to r201471 by calling
3150         Chrome::elementDidBlur explicitly.
3151         * html/HTMLTextFormControlElement.cpp:
3152         (WebCore::HTMLTextFormControlElement::dispatchBlurEvent): Added a comment about ordering.
3153
3154 2016-10-17  Anders Carlsson  <andersca@apple.com>
3155
3156         Move some history specific HistoryItem code to WebHistoryItem
3157         https://bugs.webkit.org/show_bug.cgi?id=163567
3158
3159         Reviewed by Tim Horton.
3160
3161         * history/HistoryItem.cpp:
3162         (WebCore::HistoryItem::addRedirectURL): Deleted.
3163         (WebCore::HistoryItem::redirectURLs): Deleted.
3164         (WebCore::HistoryItem::setRedirectURLs): Deleted.
3165         * history/HistoryItem.h:
3166
3167 2016-10-18  Dave Hyatt  <hyatt@apple.com>
3168
3169         [CSS Parser] Get all the properties turned on
3170         https://bugs.webkit.org/show_bug.cgi?id=163605
3171
3172         Reviewed by Dean Jackson.
3173
3174         * WebCore.xcodeproj/project.pbxproj:
3175         * css/CSSFunctionValue.h:
3176         * css/CSSPendingSubstitutionValue.cpp: Added.
3177         (WebCore::CSSPendingSubstitutionValue::customCSSText):
3178         * css/CSSPendingSubstitutionValue.h: Added.
3179         (WebCore::CSSPendingSubstitutionValue::create):
3180         (WebCore::CSSPendingSubstitutionValue::shorthandValue):
3181         (WebCore::CSSPendingSubstitutionValue::shorthandPropertyId):
3182         (WebCore::CSSPendingSubstitutionValue::equals):
3183         (WebCore::CSSPendingSubstitutionValue::CSSPendingSubstitutionValue):
3184         * css/CSSValue.cpp:
3185         (WebCore::CSSValue::cssText):
3186         (WebCore::CSSValue::destroy):
3187         * css/CSSValue.h:
3188         (WebCore::CSSValue::isPendingSubstitutionValue):
3189         * css/CSSValueKeywords.in:
3190         * css/StylePropertyShorthand.cpp:
3191         (WebCore::transitionShorthandForParsing):
3192         * css/StylePropertyShorthand.h:
3193         * css/parser/CSSParser.cpp:
3194         (WebCore::CSSParser::completeURL):
3195         * css/parser/CSSParserImpl.cpp:
3196         (WebCore::CSSParserImpl::parseValue):
3197         (WebCore::CSSParserImpl::consumeDeclaration):
3198         (WebCore::CSSParserImpl::consumeDeclarationValue):
3199         * css/parser/CSSParserMode.h:
3200         (WebCore::CSSParserContext::completeURL):
3201         * css/parser/CSSParserToken.cpp:
3202         (WebCore::CSSParserToken::parseAsCSSPropertyID):
3203         (WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID): Deleted.
3204         * css/parser/CSSParserToken.h:
3205         * css/parser/CSSPropertyParser.cpp:
3206         (WebCore::cssPropertyID):
3207         (WebCore::CSSPropertyParser::addProperty):
3208         (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
3209         (WebCore::CSSPropertyParser::parseValue):
3210         (WebCore::CSSPropertyParser::parseSingleValue):
3211         (WebCore::CSSPropertyParser::parseValueStart):
3212         (WebCore::CSSPropertyParser::consumeCSSWideKeyword):
3213         (WebCore::consumeTransformOrigin):
3214         (WebCore::consumeWillChange):
3215         (WebCore::consumeFontFeatureTag):
3216         (WebCore::consumeFontFeatureSettings):
3217         (WebCore::consumePage):
3218         (WebCore::consumeQuotes):
3219         (WebCore::FontVariantLigaturesParser::consumeLigature):
3220         (WebCore::FontVariantLigaturesParser::finalizeValue):
3221         (WebCore::consumeFontVariantLigatures):
3222         (WebCore::consumeFontVariantCaps):
3223         (WebCore::FontVariantNumericParser::consumeNumeric):
3224         (WebCore::FontVariantNumericParser::finalizeValue):
3225         (WebCore::consumeFontVariantNumeric):
3226         (WebCore::consumeFontVariantCSS21):
3227         (WebCore::consumeFontVariantList):
3228         (WebCore::consumeFontWeight):
3229         (WebCore::consumeFamilyName):
3230         (WebCore::consumeGenericFamily):
3231         (WebCore::consumeFontFamily):
3232         (WebCore::consumeSpacing):
3233         (WebCore::consumeTabSize):
3234         (WebCore::consumeTextSizeAdjust):
3235         (WebCore::consumeFontSize):
3236         (WebCore::consumeLineHeight):
3237         (WebCore::createPrimitiveValuePair):
3238         (WebCore::consumeCounter):
3239         (WebCore::consumePageSize):
3240         (WebCore::consumeSize):
3241         (WebCore::consumeTextIndent):
3242         (WebCore::validWidthOrHeightKeyword):
3243         (WebCore::consumeMaxWidthOrHeight):
3244         (WebCore::consumeWidthOrHeight):
3245         (WebCore::consumeMarginOrOffset):
3246         (WebCore::consumeClipComponent):
3247         (WebCore::consumeClip):
3248         (WebCore::consumeTouchAction):
3249         (WebCore::consumeLineClamp):
3250         (WebCore::consumeLocale):
3251         (WebCore::consumeColumnWidth):
3252         (WebCore::consumeColumnCount):
3253         (WebCore::consumeColumnGap):
3254         (WebCore::consumeColumnSpan):
3255         (WebCore::consumeZoom):
3256         (WebCore::consumeAnimationIterationCount):
3257         (WebCore::consumeAnimationName):
3258         (WebCore::consumeTransitionProperty):
3259         (WebCore::consumeCubicBezier):
3260         (WebCore::consumeAnimationTimingFunction):
3261         (WebCore::consumeAnimationValue):
3262         (WebCore::isValidAnimationPropertyList):
3263         (WebCore::consumeAnimationPropertyList):
3264         (WebCore::CSSPropertyParser::consumeAnimationShorthand):
3265         (WebCore::consumeZIndex):
3266         (WebCore::parseSingleShadow):
3267         (WebCore::consumeShadow):
3268         (WebCore::consumeFilterFunction):
3269         (WebCore::consumeFilter):
3270         (WebCore::consumeTextDecorationLine):
3271         (WebCore::consumeTextEmphasisStyle):
3272         (WebCore::consumeOutlineColor):
3273         (WebCore::consumeLineWidth):
3274         (WebCore::consumeBorderWidth):
3275         (WebCore::consumeTextStrokeWidth):
3276         (WebCore::consumeColumnRuleWidth):
3277         (WebCore::consumeTranslate3d):
3278         (WebCore::consumeNumbers):
3279         (WebCore::consumePerspective):
3280         (WebCore::consumeTransformValue):
3281         (WebCore::consumeTransform):
3282         (WebCore::consumePositionLonghand):
3283         (WebCore::consumePositionX):
3284         (WebCore::consumePositionY):
3285         (WebCore::consumePaintStroke):
3286         (WebCore::consumePaintOrder):
3287         (WebCore::consumeNoneOrURI):
3288         (WebCore::consumeFlexBasis):
3289         (WebCore::consumeStrokeDasharray):
3290         (WebCore::consumeBaselineShift):
3291         (WebCore::consumeRxOrRy):
3292         (WebCore::consumeCursor):
3293         (WebCore::consumeAttr):
3294         (WebCore::consumeCounterContent):
3295         (WebCore::consumeContent):
3296         (WebCore::consumePositionList):
3297         (WebCore::consumeScrollSnapCoordinate):
3298         (WebCore::consumeScrollSnapPoints):
3299         (WebCore::consumeBorderRadiusCorner):
3300         (WebCore::consumeVerticalAlign):
3301         (WebCore::consumeShapeRadius):
3302         (WebCore::consumeBasicShapeCircle):
3303         (WebCore::consumeBasicShapeEllipse):
3304         (WebCore::consumeBasicShapePolygon):
3305         (WebCore::complete4Sides):
3306         (WebCore::consumeRadii):
3307         (WebCore::consumeBasicShapeInset):
3308         (WebCore::consumeBasicShape):
3309         (WebCore::consumeWebkitClipPath):
3310         (WebCore::consumeShapeOutside):
3311         (WebCore::consumeContentDistributionOverflowPosition):
3312         (WebCore::consumeBorderImageRepeatKeyword):
3313         (WebCore::consumeBorderImageRepeat):
3314         (WebCore::consumeBorderImageSlice):
3315         (WebCore::consumeBorderImageOutset):
3316         (WebCore::consumeBorderImageWidth):
3317         (WebCore::consumeBorderImageComponents):
3318         (WebCore::consumeWebkitBorderImage):
3319         (WebCore::consumeReflect):
3320         (WebCore::consumeImageOrientation):
3321         (WebCore::consumeBackgroundBlendMode):
3322         (WebCore::consumeBackgroundAttachment):
3323         (WebCore::consumeBackgroundBox):
3324         (WebCore::consumeBackgroundComposite):
3325         (WebCore::consumePrefixedBackgroundBox):
3326         (WebCore::consumeBackgroundSize):
3327         (WebCore::consumeGridAutoFlow):
3328         (WebCore::consumeBackgroundComponent):
3329         (WebCore::addBackgroundValue):
3330         (WebCore::consumeCommaSeparatedBackgroundComponent):
3331         (WebCore::consumeSelfPositionKeyword):
3332         (WebCore::consumeSelfPositionOverflowPosition):
3333         (WebCore::consumeAlignItems):
3334         (WebCore::consumeJustifyItems):
3335         (WebCore::consumeFitContent):
3336         (WebCore::consumeCustomIdentForGridLine):
3337         (WebCore::consumeGridLine):
3338         (WebCore::isGridTrackFixedSized):
3339         (WebCore::consumeGridBreadth):
3340         (WebCore::consumeGridTrackSize):
3341         (WebCore::consumeGridLineNames):
3342         (WebCore::consumeGridTrackRepeatFunction):
3343         (WebCore::consumeGridTrackList):
3344         (WebCore::consumeGridTemplatesRowsOrColumns):
3345         (WebCore::consumeGridTemplateAreas):
3346         (WebCore::consumeFontFaceUnicodeRange):
3347         (WebCore::consumeFontFaceSrcURI):
3348         (WebCore::consumeFontFaceSrcLocal):
3349         (WebCore::consumeFontFaceSrc):
3350         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
3351         (WebCore::CSSPropertyParser::consumeSystemFont):
3352         (WebCore::CSSPropertyParser::consumeFont):
3353         (WebCore::CSSPropertyParser::consumeFontVariantShorthand):
3354         (WebCore::CSSPropertyParser::consumeBorderSpacing):
3355         (WebCore::consumeSingleViewportDescriptor):
3356         (WebCore::CSSPropertyParser::parseViewportDescriptor):
3357         (WebCore::consumeColumnWidthOrCount):
3358         (WebCore::CSSPropertyParser::consumeColumns):
3359         (WebCore::CSSPropertyParser::consumeShorthandGreedily):
3360         (WebCore::CSSPropertyParser::consumeFlex):
3361         (WebCore::CSSPropertyParser::consumeBorder):
3362         (WebCore::CSSPropertyParser::consume4Values):
3363         (WebCore::CSSPropertyParser::consumeBorderImage):
3364         (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
3365         (WebCore::consumeBackgroundPosition):
3366         (WebCore::consumeRepeatStyleComponent):
3367         (WebCore::consumeRepeatStyle):
3368         (WebCore::CSSPropertyParser::consumeBackgroundShorthand):
3369         (WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
3370         (WebCore::CSSPropertyParser::consumeGridAreaShorthand):
3371         (WebCore::CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns):
3372         (WebCore::CSSPropertyParser::consumeGridTemplateShorthand):
3373         (WebCore::CSSPropertyParser::consumeGridShorthand):
3374         (WebCore::CSSPropertyParser::parseShorthand):
3375         (WebCore::unresolvedCSSPropertyID): Deleted.
3376         * css/parser/CSSPropertyParser.h:
3377         * css/parser/CSSPropertyParserHelpers.cpp:
3378         (WebCore::CSSPropertyParserHelpers::consumeIdent):
3379         (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
3380         (WebCore::CSSPropertyParserHelpers::consumeString):
3381         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
3382         * css/parser/CSSPropertyParserHelpers.h:
3383
3384 2016-10-18  Brent Fulgham  <bfulgham@apple.com>
3385
3386         Correct Document::removeAllEventListeners
3387         https://bugs.webkit.org/show_bug.cgi?id=163558
3388         <rdar://problem/28716840>
3389
3390         Reviewed by Chris Dumez.
3391
3392         Tested by fast/dom/node-move-to-new-document-crash-main.html.
3393
3394         * dom/Document.cpp:
3395         (WebCore::Document::removeAllEventListeners): Clear out the wheel and
3396         touch event targets when clearing all data.
3397
3398 2016-10-18  Dean Jackson  <dino@apple.com>
3399
3400         Remove dependency cycle with UIKit
3401         https://bugs.webkit.org/show_bug.cgi?id=163577
3402         <rdar://problem/28786160>
3403
3404         Reviewed by Tim Horton.
3405
3406         Soft link against UIKit. Followup patch because
3407         I screwed up and forgot to edit the simulator
3408         configuration.
3409
3410         * Configurations/WebCoreTestSupport.xcconfig:
3411
3412 2016-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
3413
3414         SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property
3415         https://bugs.webkit.org/show_bug.cgi?id=116470
3416
3417         Reviewed by Simon Fraser.
3418
3419         When we encounter a shorthand css property, we set m_implicitShorthand
3420         to true to tell addProperty() later that the individual properties are
3421         all set through a short hand one. We need to make sure that setting 
3422         m_implicitShorthand to true will not be leaked after finishing parsing
3423         the short hand property.
3424
3425         Test: fast/css/implicit-property-restore.html
3426
3427         * css/parser/CSSParser.cpp:
3428         (WebCore::CSSParser::parseValue):
3429         (WebCore::CSSParser::parseFillShorthand):
3430         (WebCore::CSSParser::parseShorthand):
3431         (WebCore::CSSParser::parse4Values):
3432         (WebCore::CSSParser::parseBorderRadius):
3433         (WTF::ImplicitScope::ImplicitScope): Deleted.
3434         (WTF::ImplicitScope::~ImplicitScope): Deleted.
3435         Get rid of ImplicitScope and replace its calls by TemporaryChange<bool>.
3436         
3437         * css/parser/SVGCSSParser.cpp:
3438         (WebCore::CSSParser::parseSVGValue):
3439         Restore m_implicitShorthand value after setting it temporarily to true.
3440
3441 2016-10-18  Chris Dumez  <cdumez@apple.com>
3442
3443         Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
3444         https://bugs.webkit.org/show_bug.cgi?id=163580
3445
3446         Reviewed by Sam Weinig.
3447
3448         Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
3449         and use a regular constructor as in the specification:
3450         - https://html.spec.whatwg.org/#the-trackevent-interface
3451
3452         No new tests, updated existing tests.
3453
3454         * html/track/TrackEvent.cpp:
3455         (WebCore::TrackEvent::TrackEvent):
3456         * html/track/TrackEvent.h:
3457         * html/track/TrackEvent.idl:
3458
3459 2016-10-18  Commit Queue  <commit-queue@webkit.org>
3460
3461         Unreviewed, rolling out r207409.
3462         https://bugs.webkit.org/show_bug.cgi?id=163602
3463
3464         Introduced many test failures and timeouts, causing release
3465         bot to exit early (Requested by mcatanzaro on #webkit).
3466
3467         Reverted changeset:
3468
3469         "[GTK] Several tests crashing on debug bot in (anonymous
3470         namespace)::MediaPlayerPrivateGStreamerBase::repaint"
3471         https://bugs.webkit.org/show_bug.cgi?id=163511
3472         http://trac.webkit.org/changeset/207409
3473
3474 2016-10-18  Eric Carlson  <eric.carlson@apple.com>
3475
3476         [MediaStream] Resolve constraints and enumerate devices in the UI process
3477         https://bugs.webkit.org/show_bug.cgi?id=162147
3478         <rdar://problem/28803569>
3479
3480         Reviewed by Darin Adler.
3481
3482         Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
3483         access happens in the UI process.
3484
3485         No new tests, updated results of existing tests.
3486
3487         * CMakeLists.txt: Add MediaDevicesEnumerationRequest.cpp, delete UserMediaPermissionCheck.cpp.
3488
3489         * Modules/mediastream/MediaConstraintsImpl.cpp:
3490         (WebCore::MediaConstraintsImpl::create): Only create from MediaConstraintsData.
3491         (WebCore::MediaConstraintsImpl::initialize): Deleted.
3492         * Modules/mediastream/MediaConstraintsImpl.h:
3493
3494         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Added.
3495         (WebCore::MediaDevicesEnumerationRequest::create):
3496         (WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
3497         (WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
3498         (WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin):
3499         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
3500         (WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
3501         (WebCore::MediaDevicesEnumerationRequest::start):
3502         (WebCore::MediaDevicesEnumerationRequest::cancel):
3503         (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo):
3504         (WebCore::MediaDevicesEnumerationRequest::finish):
3505         * Modules/mediastream/MediaDevicesEnumerationRequest.h: Added.
3506
3507         * Modules/mediastream/MediaDevicesRequest.cpp:
3508         (WebCore::MediaDevicesRequest::~MediaDevicesRequest): Clear the enumeration request.
3509         (WebCore::MediaDevicesRequest::contextDestroyed): Ditto.
3510         (WebCore::MediaDevicesRequest::start): Create and use a MediaDevicesEnumerationRequest.
3511         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Deleted.
3512         * Modules/mediastream/MediaDevicesRequest.h:
3513
3514         * Modules/mediastream/UserMediaClient.h:
3515         * Modules/mediastream/UserMediaController.h:
3516         (WebCore::UserMediaController::enumerateMediaDevices): New.
3517         (WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): New.
3518         (WebCore::UserMediaController::checkUserMediaPermission): Deleted.
3519         (WebCore::UserMediaController::cancelUserMediaPermissionCheck): Deleted.
3520
3521         * Modules/mediastream/UserMediaPermissionCheck.h: Deleted.
3522         * Modules/mediastream/UserMediaPermissionCheck.cpp: Deleted.
3523
3524         * Modules/mediastream/UserMediaRequest.cpp:
3525         (WebCore::UserMediaRequest::UserMediaRequest):
3526         (WebCore::UserMediaRequest::start):
3527         (WebCore::UserMediaRequest::allow):
3528         (WebCore::UserMediaRequest::deny):
3529         (WebCore::UserMediaRequest::constraintsValidated): Deleted.
3530         (WebCore::UserMediaRequest::userMediaAccessGranted): Deleted.
3531         (WebCore::UserMediaRequest::userMediaAccessDenied): Deleted.
3532         (WebCore::UserMediaRequest::constraintsInvalid): Deleted.
3533         (WebCore::UserMediaRequest::didCreateStream): Deleted.
3534         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Deleted.
3535         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Deleted.
3536         * Modules/mediastream/UserMediaRequest.h:
3537
3538         * WebCore.xcodeproj/project.pbxproj: Add MediaDevicesEnumerationRequest.*.
3539
3540         * platform/mediastream/CaptureDevice.h:
3541         (WebCore::CaptureDevice::CaptureDevice):
3542         (WebCore::CaptureDevice::setPersistentId): Add setter for argument decoder.
3543         (WebCore::CaptureDevice::setLabel): Ditto.
3544         (WebCore::CaptureDevice::setGroupId): Ditto.
3545         (WebCore::CaptureDevice::setKind): Ditto.
3546
3547         * platform/mediastream/CaptureDeviceManager.h: Remove unnecessary include.
3548
3549         * platform/mediastream/MediaConstraints.h:
3550         (WebCore::MediaConstraint::encode): New.
3551         (WebCore::MediaConstraint::decode): Ditto.
3552         (WebCore::NumericConstraint::encode): Ditto.
3553         (WebCore::NumericConstraint::decode): Ditto.
3554
3555         * platform/mediastream/MediaStreamCreationClient.h: Deleted.
3556
3557         * platform/mediastream/RealtimeMediaSourceCenter.h: Use completion handlers instead of client interface.
3558
3559         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3560         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Drive-by fix: don't initialize
3561         group id, we don't support it.
3562
3563         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3564         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): Update for interface change.
3565         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): Ditto.
3566         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
3567
3568         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
3569         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints): Ditto.
3570         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Ditto.
3571         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
3572         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
3573
3574         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
3575         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
3576         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Ditto.
3577         * platform/mock/MockRealtimeMediaSourceCenter.h:
3578
3579 2016-10-18  Zan Dobersek  <zdobersek@igalia.com>
3580
3581         [WebIDL] Support BufferSource
3582         https://bugs.webkit.org/show_bug.cgi?id=163541
3583
3584         Reviewed by Youenn Fablet.
3585
3586         Add support for the BufferSource typedef in WebIDL. The implementation
3587         adds the necessary handling for this type in the generator scripts and
3588         the specialization of the Converter<> template for the IDLBufferSource
3589         struct that enables exposing ArrayBuffer or ArrayBufferView objects by
3590         having WebCore::BufferSource objects pointing to their data.
3591
3592         The SourceBuffer interface in the MSE module has the appendBuffer()
3593         operation modified to accept a BufferSource parameter, instead of
3594         overloading it for ArrayBuffer and ArrayBufferView parameters.
3595
3596         The bindings generator tests cover BufferSource as both an operation
3597         parameter and as a dictionary member.
3598
3599         * Modules/mediasource/SourceBuffer.cpp:
3600         (WebCore::SourceBuffer::appendBuffer):
3601         (WebCore::SourceBuffer::appendBufferInternal):
3602         * Modules/mediasource/SourceBuffer.h:
3603         * Modules/mediasource/SourceBuffer.idl:
3604         * WebCore.xcodeproj/project.pbxproj:
3605         * bindings/generic/IDLTypes.h:
3606         * bindings/js/BufferSource.h: Added.
3607         * bindings/js/JSDOMConvert.h:
3608         (WebCore::Converter<IDLBufferSource>::convert):
3609         * bindings/scripts/CodeGenerator.pm:
3610         (SkipIncludeHeader):
3611         (IsWrapperType):
3612         * bindings/scripts/CodeGeneratorJS.pm:
3613         (AddClassForwardIfNeeded):
3614         (GetBaseIDLType):
3615         (IsHandledByDOMConvert):
3616         * bindings/scripts/test/JS/JSTestObj.cpp:
3617         (WebCore::convertDictionary<TestObj::Dictionary>):
3618         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
3619         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameterCaller):
3620         * bindings/scripts/test/TestObj.idl:
3621
3622 2016-10-18  Javier Fernandez  <jfernandez@igalia.com>
3623
3624         [css-grid] Different width of grid container between initial load and refresh
3625         https://bugs.webkit.org/show_bug.cgi?id=163535
3626
3627         Reviewed by Manuel Rego Casasnovas.
3628
3629         Grid's layout logic manages two different override sizes; one it's
3630         designed to implement the grid item's stretching behavior, identified
3631         with the concept of 'overrideContentLogicalSize'; there is another
3632         override size, known as overrideContainingBlockContentLogicalSize,
3633         used to implement the Grid Area abstraction, which will behave as
3634         the actual containing block of any grid item.
3635
3636         During grid's layout logic these override sizes are set according
3637         to the CSS style rules. This affects how the grid container and its
3638         children are going to be sized during layout. Grid Tracks sizing
3639         algorithm depends on these override sizes.
3640
3641         In order to ensure that the tracks sizing algorithm produces the
3642         same results when it's run consecutively several times, we need to
3643         clear these override sizes and perform a layout of the affected grid
3644         items. Otherwise, the affected items will return sizing values which
3645         depend on the override values set in the previous layout, which in
3646         some cases, like orthogonal flows, may change through different runs
3647         of the sizing algorithm.
3648
3649         Test: fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html
3650
3651         * rendering/RenderGrid.cpp:
3652         (WebCore::RenderGrid::layoutBlock):
3653
3654 2016-10-18  Youenn Fablet  <youenn@apple.com>
3655
3656         CachedResourceLoader should not need to remove fragment identifier
3657         https://bugs.webkit.org/show_bug.cgi?id=163015
3658
3659         Reviewed by Darin Adler.
3660
3661         No expected change for non-window port.
3662         For window port, CachedResourceLoader will strip the fragment identifier of the URL passed to subresourceForURL
3663         before querying the memory cache.
3664
3665         Removing the fragment identifier from the request stored in CachedResourceRequest.
3666         The fragment identifier is stored in a separate field.
3667
3668         This allows CachedResourceLoader to not care about fragment identifier.
3669         CachedResource can then get access to it.
3670
3671         * loader/cache/CachedResource.cpp:
3672         (WebCore::CachedResource::CachedResource):
3673         (WebCore::CachedResource::finishRequestInitialization): Deleted.
3674         * loader/cache/CachedResource.h:
3675         * loader/cache/CachedResourceLoader.cpp:
3676         (WebCore::CachedResourceLoader::cachedResource):
3677         Updated the method taking a const String& to strip the fragment identifier if needed.
3678         Updated the method taking a const URL& to assert if the fragment identifier is present.
3679         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3680         (WebCore::CachedResourceLoader::requestResource):
3681         * loader/cache/CachedResourceRequest.cpp:
3682         (WebCore::CachedResourceRequest::CachedResourceRequest):
3683         (WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL):
3684         * loader/cache/CachedResourceRequest.h:
3685         (WebCore::CachedResourceRequest::releaseFragmentIdentifier):
3686         (WebCore::CachedResourceRequest::clearFragmentIdentifier):
3687         * loader/cache/MemoryCache.cpp:
3688         (WebCore::MemoryCache::shouldRemoveFragmentIdentifier):
3689         (WebCore::MemoryCache::removeFragmentIdentifierIfNeeded):
3690         (WebCore::MemoryCache::revalidationSucceeded):
3691         (WebCore::MemoryCache::resourceForRequest):
3692         * loader/cache/MemoryCache.h:
3693
3694 2016-10-18  Antti Koivisto  <antti@apple.com>
3695
3696         Rename setNeedsStyleRecalc to invalidateStyle
3697         https://bugs.webkit.org/show_bug.cgi?id=163542
3698
3699         Reviewed by Darin Adler.
3700
3701         Also rename StyleChangeType enum and some related functions for clarity. For example
3702
3703             element.setNeedsStyleRecalc(SyntheticStyleChange);
3704
3705         becomes
3706
3707             element.invalidateStyleAndLayerComposition();
3708
3709         * WebCore.xcodeproj/project.pbxproj:
3710         * css/StyleInvalidationAnalysis.cpp:
3711         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
3712         * dom/Document.cpp:
3713         (WebCore::Document::recalcStyle):
3714         (WebCore::Document::updateViewportUnitsOnResize):
3715         (WebCore::Document::setCSSTarget):
3716         (WebCore::unwrapFullScreenRenderer):
3717         (WebCore::Document::setAnimatingFullScreen):
3718         * dom/Element.cpp:
3719         (WebCore::Element::setActive):
3720         (WebCore::Element::setFocus):
3721         (WebCore::Element::setHovered):
3722         (WebCore::Element::attributeChanged):
3723         (WebCore::Element::invalidateStyle):
3724         (WebCore::Element::invalidateStyleAndLayerComposition):
3725         (WebCore::Element::invalidateStyleForSubtree):
3726         (WebCore::Element::invalidateStyleAndRenderersForSubtree):
3727
3728             Move public invalidation functions to Element tightening typing.
3729             Use separate functions instead of enum values.
3730             This way the call sites look nicer and only useful combinations are exposed.
3731
3732         (WebCore::Element::addShadowRoot):
3733         (WebCore::checkForEmptyStyleChange):
3734         (WebCore::checkForSiblingStyleChanges):
3735         (WebCore::Element::needsStyleInvalidation):
3736         (WebCore::Element::setContainsFullScreenElement):
3737         * dom/Element.h:
3738         (WebCore::Element::setHasFocusWithin):
3739         * dom/Node.cpp:
3740         (WebCore::computeEditabilityFromComputedStyle):
3741         (WebCore::Node::adjustStyleValidity):
3742
3743             Update validity and mode separately. There was a potential bug here where
3744             SyntheticStyleChange could overwrite FullStyleChange (no known repro).
3745
3746         (WebCore::Node::updateAncestorsForStyleRecalc):
3747         (WebCore::Node::invalidateStyle):
3748         (WebCore::Node::insertedInto):
3749         (WebCore::Node::setNeedsStyleRecalc): Deleted.
3750         * dom/Node.h:
3751         (WebCore::Node::needsStyleRecalc):
3752         (WebCore::Node::styleValidity):
3753         (WebCore::Node::styleResolutionShouldRecompositeLayer):
3754         (WebCore::Node::setHasValidStyle):
3755         (WebCore::Node::styleChangeType): Deleted.
3756         (WebCore::Node::clearNeedsStyleRecalc): Deleted.
3757         (WebCore::Node::setStyleChange): Deleted.
3758         * dom/RadioButtonGroups.cpp:
3759         (WebCore::RadioButtonGroup::remove):
3760         (WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
3761         * dom/ShadowRoot.cpp:
3762         (WebCore::ShadowRoot::setResetStyleInheritance):
3763         * dom/SlotAssignment.cpp:
3764         (WebCore::SlotAssignment::addSlotElementByName):
3765         (WebCore::SlotAssignment::removeSlotElementByName):
3766         (WebCore::SlotAssignment::didChangeSlot):
3767         * dom/StyledElement.cpp:
3768         (WebCore::StyledElement::attributeChanged):
3769         (WebCore::StyledElement::styleAttributeChanged):
3770         (WebCore::StyledElement::invalidateStyleAttribute):
3771         * dom/Text.cpp:
3772         (WebCore::Text::updateRendererAfterContentChange):
3773         * dom/VisitedLinkState.cpp:
3774         (WebCore::VisitedLinkState::invalidateStyleForAllLinks):
3775         (WebCore::VisitedLinkState::invalidateStyleForLink):
3776         * editing/FrameSelection.cpp:
3777         (WebCore::FrameSelection::focusedOrActiveStateChanged):
3778         * html/BaseDateAndTimeInputType.cpp:
3779         (WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged):
3780         * html/FileInputType.cpp:
3781         (WebCore::FileInputType::setValue):
3782         * html/HTMLAnchorElement.cpp:
3783         (WebCore::HTMLAnchorElement::parseAttribute):
3784         * html/HTMLBodyElement.cpp:
3785         (WebCore::HTMLBodyElement::parseAttribute):
3786         * html/HTMLCanvasElement.cpp:
3787         (WebCore::HTMLCanvasElement::getContext):
3788         (WebCore::HTMLCanvasElement::createImageBuffer):
3789         * html/HTMLElement.cpp:
3790         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
3791         (WebCore::HTMLElement::calculateAndAdjustDirectionality):
3792         * html/HTMLFieldSetElement.cpp:
3793         (WebCore::HTMLFieldSetElement::addInvalidDescendant):
3794         (WebCore::HTMLFieldSetElement::removeInvalidDescendant):
3795         * html/HTMLFormControlElement.cpp:
3796         (WebCore::HTMLFormControlElement::disabledStateChanged):
3797         (WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
3798         (WebCore::HTMLFormControlElement::requiredAttributeChanged):
3799         (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
3800         (WebCore::HTMLFormControlElement::updateValidity):
3801         * html/HTMLFormElement.cpp:
3802         (WebCore::HTMLFormElement::registerFormElement):
3803         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
3804         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
3805         (WebCore::HTMLFormElement::resetDefaultButton):
3806         * html/HTMLFrameElementBase.cpp:
3807         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree):
3808         * html/HTMLFrameOwnerElement.cpp:
3809         (WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition):
3810         (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Deleted.
3811         * html/HTMLFrameOwnerElement.h:
3812         * html/HTMLFrameSetElement.cpp:
3813         (WebCore::HTMLFrameSetElement::parseAttribute):
3814         (WebCore::HTMLFrameSetElement::willRecalcStyle):
3815         * html/HTMLInputElement.cpp:
3816         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
3817         (WebCore::HTMLInputElement::parseAttribute):
3818         (WebCore::HTMLInputElement::setChecked):
3819         (WebCore::HTMLInputElement::setIndeterminate):
3820         (WebCore::HTMLInputElement::setAutoFilled):
3821         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
3822         (WebCore::HTMLInputElement::minLengthAttributeChanged):
3823         * html/HTMLLinkElement.cpp:
3824         (WebCore::HTMLLinkElement::parseAttribute):
3825         * html/HTMLMediaElement.cpp:
3826         (WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
3827         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
3828         * html/HTMLObjectElement.cpp:
3829         (WebCore::HTMLObjectElement::parseAttribute):
3830         (WebCore::HTMLObjectElement::childrenChanged):
3831         (WebCore::HTMLObjectElement::renderFallbackContent):
3832         * html/HTMLOptGroupElement.cpp:
3833         (WebCore::HTMLOptGroupElement::parseAttribute):
3834         * html/HTMLOptionElement.cpp:
3835         (WebCore::HTMLOptionElement::parseAttribute):
3836         (WebCore::HTMLOptionElement::setSelectedState):
3837         * html/HTMLPlugInElement.cpp:
3838         (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
3839         * html/HTMLPlugInImageElement.cpp:
3840         (WebCore::HTMLPlugInImageElement::setDisplayState):
3841         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
3842         (WebCore::HTMLPlugInImageElement::finishParsingChildren):
3843         (WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension):
3844         (WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired):
3845         (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
3846         * html/HTMLProgressElement.cpp:
3847         (WebCore::HTMLProgressElement::didElementStateChange):
3848         * html/HTMLSelectElement.cpp:
3849         (WebCore::HTMLSelectElement::parseAttribute):
3850         (WebCore::HTMLSelectElement::setRecalcListItems):
3851         (WebCore::HTMLSelectElement::parseMultipleAttribute):
3852         (WebCore::HTMLSelectElement::reset):
3853         * html/HTMLTableElement.cpp:
3854         (WebCore::isTableCellAncestor):
3855         (WebCore::setTableCellsChanged):
3856         (WebCore::HTMLTableElement::parseAttribute):
3857         * html/HTMLTextAreaElement.cpp:
3858         (WebCore::HTMLTextAreaElement::setValueCommon):
3859         * html/HTMLTextFormControlElement.cpp:
3860         (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
3861         * html/InputType.cpp:
3862         (WebCore::InputType::setValue):
3863         * html/NumberInputType.cpp:
3864         (WebCore::NumberInputType::minOrMaxAttributeChanged):
3865         * html/TextFieldInputType.cpp:
3866         (WebCore::TextFieldInputType::subtreeHasChanged):
3867         * mathml/MathMLElement.cpp:
3868         (WebCore::MathMLElement::parseAttribute):
3869         * mathml/MathMLSelectElement.cpp:
3870         (WebCore::MathMLSelectElement::updateSelectedChild):
3871         * page/animation/AnimationBase.cpp:
3872         (WebCore::AnimationBase::setNeedsStyleRecalc):
3873         * page/animation/AnimationController.cpp:
3874         (WebCore::AnimationControllerPrivate::clear):
3875         (WebCore::AnimationControllerPrivate::updateAnimations):
3876         (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
3877         (WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
3878         (WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
3879         (WebCore::AnimationController::cancelAnimations):
3880         * rendering/RenderImage.cpp:
3881         (WebCore::RenderImage::imageChanged):
3882         * rendering/RenderLayer.cpp:
3883         (WebCore::RenderLayer::calculateClipRects):
3884         * rendering/RenderLayerCompositor.cpp:
3885         (WebCore::RenderLayerCompositor::attachRootLayer):
3886         (WebCore::RenderLayerCompositor::detachRootLayer):
3887         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
3888         * rendering/RenderObject.cpp:
3889         (WebCore::RenderObject::updateDragState):
3890         * rendering/svg/SVGResourcesCache.cpp:
3891         (WebCore::SVGResourcesCache::clientStyleChanged):
3892         * style/AttributeChangeInvalidation.cpp:
3893         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
3894         * style/ClassChangeInvalidation.cpp:
3895         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
3896         * style/IdChangeInvalidation.cpp:
3897         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
3898         * style/RenderTreeUpdater.cpp:
3899         (WebCore::RenderTreeUpdater::updateElementRenderer):
3900         * style/StyleScope.cpp:
3901         (WebCore::Style::Scope::updateActiveStyleSheets):
3902         * style/StyleTreeResolver.cpp:
3903         (WebCore::Style::resetStyleForNonRenderedDescendants):
3904         (WebCore::Style::TreeResolver::resolveElement):
3905         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
3906         (WebCore::Style::TreeResolver::popParent):
3907         (WebCore::Style::clearNeedsStyleResolution):
3908         (WebCore::Style::TreeResolver::resolveComposedTree):
3909         * style/StyleUpdate.h:
3910         * style/StyleValidity.h: Added.
3911
3912             StyleChangeType enum splits into Style::Validity and Style::InvalidationMode.
3913             Move to a file of its own.
3914
3915         * svg/SVGAElement.cpp:
3916         (WebCore::SVGAElement::svgAttributeChanged):
3917         * svg/SVGAnimateElementBase.cpp:
3918         (WebCore::applyCSSPropertyToTarget):
3919         (WebCore::removeCSSPropertyFromTarget):
3920         * svg/SVGElement.cpp:
3921         (WebCore::SVGElement::willRecalcStyle):
3922         * svg/SVGElement.h:
3923         (WebCore::SVGElement::invalidateSVGPresentationAttributeStyle):
3924         * svg/SVGTests.cpp:
3925         (WebCore::SVGTests::handleAttributeChange):
3926         * svg/SVGUseElement.cpp:
3927         (WebCore::SVGUseElement::invalidateShadowTree):
3928         * testing/Internals.cpp:
3929         (WebCore::styleValidityToToString):
3930         (WebCore::Internals::styleChangeType):
3931         (WebCore::styleChangeTypeToString): Deleted.
3932
3933 2016-10-17  Sergio Villar Senin  <svillar@igalia.com>
3934
3935         [css-grid] Constrain by min|max-height on auto repeat computation
3936         https://bugs.webkit.org/show_bug.cgi?id=163540
3937
3938         Reviewed by Darin Adler.
3939
3940         The max-height (if definite) is used to compute the number of auto repeat rows whenever the
3941         height is indefinite. We were using the min-height only in case both values were indefinite.
3942
3943         Although not explicitly mentioned by grid specs, it's reasonable to assume that
3944         the min-height trumps the used value of height/max-height like it always does, per CSS
3945         2.2. Note that the number of rows still needs to fit within that size even if using
3946         min-height, because we're just using min-height to compute the used value of the height
3947         property. If both height and max-height are indefinite we keep doing the same, i.e., compute
3948         the minimum number of rows that fulfill min-height (if definite).
3949
3950         * rendering/RenderGrid.cpp:
3951         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
3952
3953 2016-10-17  Yusuke Suzuki  <utatane.tea@gmail.com>
3954
3955         [DOMJIT] Use NativeCallFrameTracer for operations used for DOMJIT slow calls
3956         https://bugs.webkit.org/show_bug.cgi?id=163586
3957
3958         Reviewed by Saam Barati.
3959
3960         * domjit/JSNodeDOMJIT.cpp:
3961         (WebCore::toWrapperSlow):
3962
3963 2016-10-18  Ryuan Choi  <ryuan.choi@navercorp.com>
3964
3965         [EFL] Build break since r207442
3966         https://bugs.webkit.org/show_bug.cgi?id=163587
3967
3968         Unreviewed.
3969
3970         Since r207442, setRGB is moved to private.
3971
3972         * rendering/RenderThemeEfl.cpp:
3973         (WebCore::fillColorsFromEdjeClass):
3974
3975 2016-10-17  Dean Jackson  <dino@apple.com>
3976
3977         Remove dependency cycle with UIKit
3978         https://bugs.webkit.org/show_bug.cgi?id=163577
3979         <rdar://problem/28786160>
3980
3981         Reviewed by Tim Horton.
3982
3983         Soft link against UIKit.
3984
3985         * Configurations/WebCoreTestSupport.xcconfig:
3986         * testing/Internals.mm:
3987
3988 2016-10-17  Dean Jackson  <dino@apple.com>
3989
3990         Allow creation of ExtendedColors and make Color immutable
3991         https://bugs.webkit.org/show_bug.cgi?id=163557
3992         <rdar://problem/28805360>
3993
3994         Reviewed by Darin Adler and Dave Hyatt.
3995
3996         1. Support the creation of ExtendedColor objects via the
3997         Color class.
3998
3999         2. Fix the remaining few places where a Color object is
4000         modified after creation, instead creating a new Color.
4001         Move all the mutation methods into the private section,
4002         making Color now immutable.
4003
4004         Changes to Color are covered by existing tests. Changes
4005         to ExtendedColor are covered by the ExtendedColor API test.
4006
4007         * css/parser/CSSParser.cpp:
4008         (WebCore::CSSParser::fastParseColor): Return a new named Color.
4009
4010         * dom/Document.cpp:
4011         (WebCore::Document::resetActiveLinkColor): Set to be the named "red" color.
4012
4013         * html/HTMLElement.cpp:
4014         (WebCore::HTMLElement::addHTMLColorToStyle): Use the string-based constructor
4015         where possible.
4016
4017         * page/CaptionUserPreferencesMediaAF.cpp:
4018         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): No need to
4019         use the string "black" here - we have a constant value.
4020
4021         * platform/graphics/cairo/GraphicsContextCairo.cpp: Don't use setRGB.
4022
4023         * platform/graphics/Color.cpp:
4024         (WebCore::findNamedColor): Move this up in the file.
4025         (WebCore::Color::Color): Copy in the code from setNamedColor. Also
4026         add a constructor for ExtendedColor.
4027         (WebCore::Color::serialized): Call ExtendedColor's serializer if necessary.
4028         (WebCore::Color::cssText): Ditto.
4029         (WebCore::Color::setNamedColor): Deleted.
4030         (WebCore::Color::tagAsExtended): Deleted.
4031
4032         * platform/graphics/Color.h: Add a new constructor.
4033         (WebCore::Color::setRGB): Move to private.
4034
4035         * platform/graphics/ExtendedColor.cpp:
4036         (WebCore::ExtendedColor::cssText): Implement serializer.
4037         * platform/graphics/ExtendedColor.h:
4038
4039         * rendering/style/RenderStyle.cpp:
4040         (WebCore::RenderStyle::colorIncludingFallback): Construct a new Color rather than changing an existing object.
4041
4042 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
4043
4044         Implement DOMRect/DOMRectReadOnly
4045         https://bugs.webkit.org/show_bug.cgi?id=163464
4046
4047         Reviewed by Darin Adler.
4048         
4049         Implement the DOMRectInit/DOMRectReadOnly/DOMRect interfaces specified in
4050         https://dev.w3.org/fxtf/geometry/
4051         
4052         DOMRects allow negative height/width and require double storage, so we can't just
4053         use FloatRect for storage. They also require handling of NaN and Infinity.
4054         
4055         To have the left/right/top/bottom accessors follow IEEE NaN rules, we need to use
4056         custom min/max functions that return NaN if either argument is NaN, so add 
4057         nanPropagatingMin/nanPropagatingMax helpers to MathExtras.h.
4058
4059         Test: fast/dom/domrect.html
4060
4061         * CMakeLists.txt:
4062         * DerivedSources.make:
4063         * WebCore.xcodeproj/project.pbxproj:
4064         * dom/DOMRect.h: Added.
4065         (WebCore::DOMRect::create):
4066         (WebCore::DOMRect::fromRect):
4067         (WebCore::DOMRect::setX):
4068         (WebCore::DOMRect::setY):
4069         (WebCore::DOMRect::setWidth):
4070         (WebCore::DOMRect::setHeight):
4071         (WebCore::DOMRect::DOMRect):
4072         * dom/DOMRect.idl: Added.
4073         * dom/DOMRectInit.h: Added.
4074         * dom/DOMRectInit.idl: Added.
4075         * dom/DOMRectReadOnly.h: Added.
4076         (WebCore::DOMRectReadOnly::create):
4077         (WebCore::DOMRectReadOnly::fromRect):
4078         (WebCore::DOMRectReadOnly::x):
4079         (WebCore::DOMRectReadOnly::y):
4080         (WebCore::DOMRectReadOnly::width):
4081         (WebCore::DOMRectReadOnly::height):
4082         (WebCore::DOMRectReadOnly::top):
4083         (WebCore::DOMRectReadOnly::right):
4084         (WebCore::DOMRectReadOnly::bottom):
4085         (WebCore::DOMRectReadOnly::left):
4086         (WebCore::DOMRectReadOnly::DOMRectReadOnly):
4087         * dom/DOMRectReadOnly.idl: Added.
4088
4089 2016-10-17  Antoine Quint  <graouts@apple.com>
4090
4091         [Modern Media Controls] Basic MediaController
4092         https://bugs.webkit.org/show_bug.cgi?id=163539
4093         <rdar://problem/28797542>
4094
4095         Reviewed by Darin Adler.
4096
4097         We add a new main.js file which acts as the entry point by implementing the createControls()
4098         function that HTMLMediaElement::ensureMediaControlsInjectedScript() once the shadow root has
4099         been created. That functions creates an instance of the new MediaController class, which is
4100         the controller object that will handle communication between the media controls and the media
4101         element. At first, this MediaController class is very limited and assumes macOS inline
4102         layout traits and forces a start button to be shown over the media, which can be played
4103         to start the media and show the full controls. More functionality will be added by future patches.
4104
4105         Tests: media/modern-media-controls/media-controller/media-controller-click-to-start.html
4106                media/modern-media-controls/media-controller/media-controller-constructor.html
4107                media/modern-media-controls/media-controller/media-controller-resize.html
4108
4109         * Modules/modern-media-controls/main.js: Added.
4110         (createControls):
4111         * Modules/modern-media-controls/media/media-controller.js: Added.
4112         (MediaController):
4113         (MediaController.prototype.set pageScaleFactor):
4114         (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):