Unreviewed. Fix the build after r207522.
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         Unreviewed. Fix the build after r207522.
4
5         * page/PerformanceUserTiming.cpp: Include PerformanceTiming.h.
6
7 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
8
9         Unreviewed. Fix the build after r207519.
10
11         The build error is:
12         IDL ATTRIBUTE CHECKER ERROR: Unknown IDL attribute [PassContext] is found at TestRunner.idl.
13
14         Because PassContext was removed from IDLAttributes.txt in rr207519, but it's implemented by
15         CodeGeneratorTestRunner.pm and used by TestRunner.idl.
16
17         * bindings/scripts/IDLAttributes.txt: Bring back PassContext.
18
19 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
20
21         Unreviewed. Fix the build with GCC 4.9 after r207463.
22
23         Add constructors to MediaConstraintsData.
24
25         * Modules/mediastream/MediaConstraintsImpl.h:
26         (WebCore::MediaConstraintsData::MediaConstraintsData):
27
28 2016-10-19  Jer Noble  <jer.noble@apple.com>
29
30         [Mac][MSE] Movies with a 'mehd' box have a zero-duration
31         https://bugs.webkit.org/show_bug.cgi?id=163641
32
33         Reviewed by Darin Adler.
34
35         Test: media/media-source/media-source-init-segment-duration.html
36
37         The canonical (ISO/IEC 14496-12:2012) way to signal the duration of a fragmented media file is to add a
38         'mehd' box to the 'mvex' container box specifying the duration of the fragment. Support this through the
39         AVAsset -overallDurationHint property.
40
41         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
42         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
43         * platform/spi/mac/AVFoundationSPI.h:
44
45 2016-10-18  Darin Adler  <darin@apple.com>
46
47         Move many miscellaneous classes from ExceptionCode to Exception
48         https://bugs.webkit.org/show_bug.cgi?id=163645
49
50         Reviewed by Ryosuke Niwa.
51
52         * bindings/js/JSCryptoCustom.cpp:
53         (WebCore::JSCrypto::getRandomValues): Use propagateException.
54         * bindings/js/JSDOMWindowCustom.cpp:
55         (WebCore::handlePostMessage): Ditto.
56         (WebCore::JSDOMWindow::setTimeout): Use toJSNumber.
57         (WebCore::JSDOMWindow::setInterval): Ditto.
58         * bindings/js/JSStorageCustom.cpp:
59         (WebCore::JSStorage::nameGetter): Use propagateException.
60         (WebCore::JSStorage::deleteProperty): Ditto.
61         (WebCore::JSStorage::getOwnPropertyNames): Ditto.
62         (WebCore::JSStorage::putDelegate): Ditto.
63
64         * loader/appcache/DOMApplicationCache.cpp:
65         (WebCore::DOMApplicationCache::update): Use ExceptionOr.
66         (WebCore::DOMApplicationCache::swapCache): Ditto.
67         * loader/appcache/DOMApplicationCache.h: Update for above changes.
68         * loader/appcache/DOMApplicationCache.idl: Use non-legacy exceptions.
69
70         * page/Crypto.cpp:
71         (WebCore::Crypto::getRandomValues): Use ExceptionOr.
72         (WebCore::Crypto::webkitSubtle): Ditto.
73         * page/Crypto.h: Updated for above changes.
74         * page/Crypto.idl: Use non-legacy exceptions.
75
76         * page/DOMWindow.cpp:
77         (WebCore::DOMWindow::DOMWindow): Initialize many data members in
78         the class definition instead of here.
79         (WebCore::DOMWindow::page): Use nullptr.
80         (WebCore::DOMWindow::screen): Ditto.
81         (WebCore::DOMWindow::crypto): Ditto.
82         (WebCore::DOMWindow::locationbar): Ditto.
83         (WebCore::DOMWindow::menubar): Ditto.
84         (WebCore::DOMWindow::personalbar): Ditto.
85         (WebCore::DOMWindow::scrollbars): Ditto.
86         (WebCore::DOMWindow::statusbar): Ditto.
87         (WebCore::DOMWindow::toolbar): Ditto.
88         (WebCore::DOMWindow::applicationCache): Ditto.
89         (WebCore::DOMWindow::sessionStorage): Use ExceptionOr.
90         (WebCore::DOMWindow::localStorage): Ditto.
91         (WebCore::DOMWindow::postMessage): Ditto.
92         (WebCore::DOMWindow::frameElement): Use nullptr.
93         (WebCore::DOMWindow::self): Ditto.
94         (WebCore::DOMWindow::opener): Ditto.
95         (WebCore::DOMWindow::parent): Ditto.
96         (WebCore::DOMWindow::top): Ditto.
97         (WebCore::DOMWindow::getComputedStyle): Use Ref.
98         (WebCore::DOMWindow::setTimeout): Use ExceptionOr.
99         (WebCore::DOMWindow::setInterval): Ditto.
100         (WebCore::didAddStorageEventListener): Use a reference instead of a
101         pointer, and ignore return value instead of using IGNORE_EXCEPTION.
102         (WebCore::DOMWindow::addEventListener): Pass reference to function above.
103         (WebCore::DOMWindow::dispatchEvent): Use enum class version of PageStatus.
104         * page/DOMWindow.h: Updated for changes above. Also changed indentatation.
105         * page/DOMWindow.idl: Use non-legacy exceptions.
106
107         * page/EventSource.cpp:
108         (WebCore::EventSource::create): Use ExceptionOr.
109         * page/EventSource.h: Updated for change above.
110         * page/EventSource.idl: Use non-legacy exception.
111
112         * page/Location.cpp:
113         (WebCore::Location::setProtocol): Use ExceptionOr.
114         * page/Location.h: Updated for change above.
115         * page/Location.idl: Use non-legacy exception.
116
117         * page/Performance.cpp:
118         (WebCore::Performance::Performance): Remove unnecessary initialization of
119         smart pointer to null, and moved initialization of m_resourceTimingBufferSize
120         to the header.
121         (WebCore::Performance::navigation): Made non-const and return a reference.
122         (WebCore::Performance::timing): Ditto.
123         (WebCore::Performance::addResourceTiming): Change LoadTiming argument to use
124         a const& instead of passing in a copy.
125         (WebCore::Performance::webkitMark): Use ExceptionOr and make_unique.
126         (WebCore::Performance::webkitClearMarks): Ditto.
127         (WebCore::Performance::webkitMeasure): Ditto.
128         (WebCore::Performance::webkitClearMeasures): Ditto.
129         (WebCore::Performance::reduceTimeResolution): Use std::floor.
130         * page/Performance.h: Updated for above changes. Removed unneeded includes.
131         Made more things private. Removed unneeded reference counting of UserTiming.
132         * page/Performance.idl: Use non-legacy exceptions.
133
134         * page/PerformanceUserTiming.cpp:
135         (WebCore::restrictedMarkFunction): Removed unneeded class name.
136         (WebCore::UserTiming::UserTiming): Take a reference instead of a pointer.
137         (WebCore::UserTiming::mark): Use ExceptionOr.
138         (WebCore::UserTiming::findExistingMarkStartTime): Ditto.
139         (WebCore::UserTiming::measure): Ditto.
140         (WebCore::getEntrySequenceByName): Simplified code using HashMap::get.
141         * page/PerformanceUserTiming.h: Updated for above changes. Removed reference
142         counting since this is a single-owner object.
143
144         * page/UserMessageHandler.cpp:
145         (WebCore::UserMessageHandler::postMessage): Use ExceptionOr.
146         * page/UserMessageHandler.h: Updated for above change.
147         * page/UserMessageHandler.idl: Use non-legacy exception.
148
149         * storage/Storage.cpp:
150         (WebCore::Storage::length): Use ExceptionOr.
151         (WebCore::Storage::key): Ditto.
152         (WebCore::Storage::getItem): Ditto.
153         (WebCore::Storage::setItem): Ditto.
154         (WebCore::Storage::removeItem): Ditto.
155         (WebCore::Storage::clear): Ditto.
156         (WebCore::Storage::contains): Ditto.
157         * storage/Storage.h: Updated for above change.
158         * storage/Storage.idl: Use non-legacy exceptions.
159
160         * storage/StorageEventDispatcher.cpp:
161         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
162         Updated for ExceptionOr.
163         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.
164
165 2016-10-18  Darin Adler  <darin@apple.com>
166
167         Move internal testing classes from ExceptionCode to Exception
168         https://bugs.webkit.org/show_bug.cgi?id=163553
169
170         Reviewed by Ryosuke Niwa.
171
172         * bindings/js/JSDOMBinding.h: Added toJSArray. Also exported a function that
173         is now needed in the testing library.
174         * bindings/scripts/CodeGeneratorJS.pm:
175         (NativeToJSValue): Added code to handle the jsArray case with an exception.
176
177         * css/parser/CSSPropertyParser.cpp: Fix #if to make code compile when
178         CSS_SCROLL_SNAP is not enabled.
179
180         * dom/Element.cpp:
181         (WebCore::Element::createShadowRoot): Changed return type to a raw pointer.
182         There is no reason it needs to be a RefPtr.
183         * dom/Element.h: Updated for above change.
184
185         * svg/SVGPathStringBuilder.h: Exported class and made more public so it can
186         be used in test code.
187
188         * svg/SVGPathUtilities.cpp:
189         (WebCore::pathIteratorForBuildingString): Deleted. Needed only for test code,
190         so moved into there.
191         (WebCore::buildStringFromPath): Deleted. Ditto.
192         * svg/SVGPathUtilities.h: Removed buildStringFromPath.
193
194         * testing/InternalSettings.cpp: Simplified the guard macro and used the all
195         capitals style that our style guide prescribes for non-function-like macros.
196         (WebCore::InternalSettings::create): Moved here, no longer inline Use m_page.
197         (WebCore::InternalSettings::resetToConsistentState): Updated since settings
198         returns a reference.
199         (WebCore::InternalSettings::settings): Changed to return a reference and
200         assert that m_page is not null; functions all check m_page for null first.
201         (WebCore::InternalSettings::setTouchEventEmulationEnabled): Updated to use
202         ExceptionOr, do an m_page check, and use settings that returns a reference.
203         (WebCore::InternalSettings::setStandardFontFamily): Ditto.
204         (WebCore::InternalSettings::setSerifFontFamily): Ditto.
205         (WebCore::InternalSettings::setSansSerifFontFamily): Ditto.
206         (WebCore::InternalSettings::setFixedFontFamily): Ditto.
207         (WebCore::InternalSettings::setCursiveFontFamily): Ditto.
208         (WebCore::InternalSettings::setFantasyFontFamily): Ditto.
209         (WebCore::InternalSettings::setPictographFontFamily): Ditto.
210         (WebCore::InternalSettings::setTextAutosizingEnabled): Ditto.
211         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): Ditto.
212         (WebCore::InternalSettings::setMediaTypeOverride): Ditto.
213         (WebCore::InternalSettings::setCanStartMedia): Ditto.
214         (WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Ditto.
215         (WebCore::InternalSettings::setEditingBehavior): Ditto.
216         (WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
217         (WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
218         (WebCore::InternalSettings::setStorageBlockingPolicy): Ditto.
219         (WebCore::InternalSettings::setPreferMIMETypeForImages): Ditto.
220         (WebCore::InternalSettings::setImagesEnabled): Ditto.
221         (WebCore::InternalSettings::setPDFImageCachingPolicy): Ditto.
222         (WebCore::InternalSettings::setMinimumTimerInterval): Ditto.
223         (WebCore::InternalSettings::setDefaultVideoPosterURL): Ditto.
224         (WebCore::InternalSettings::setForcePendingWebGLPolicy): Ditto.
225         (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls): Ditto.
226         (WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): Ditto.
227         (WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled): Ditto.
228         (WebCore::InternalSettings::setFontFallbackPrefersPictographs): Ditto.
229         (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Ditto.
230         (WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Ditto.
231         (WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Ditto.
232         (WebCore::InternalSettings::setBackgroundShouldExtendBeyondPage): Ditto.
233         (WebCore::InternalSettings::setShouldConvertPositionStyleOnCopy): Ditto.
234         (WebCore::InternalSettings::setScrollingTreeIncludesFrames): Ditto.
235         (WebCore::InternalSettings::setAllowsInlineMediaPlayback): Ditto.
236         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackAfterFullscreen): Ditto.
237         (WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Ditto.
238         (WebCore::InternalSettings::setIndexedDBWorkersEnabled): Ditto.
239         (WebCore::InternalSettings::userInterfaceDirectionPolicy): Ditto.
240         (WebCore::InternalSettings::setUserInterfaceDirectionPolicy): Ditto.
241         (WebCore::InternalSettings::systemLayoutDirection): Ditto.
242         (WebCore::InternalSettings::setSystemLayoutDirection): Ditto.
243         (WebCore::InternalSettings::variationFontsEnabled): Ditto.
244         (WebCore::InternalSettings::setVariationFontsEnabled): Ditto.
245         (WebCore::InternalSettings::forcedPrefersReducedMotionValue): Ditto.
246         (WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Ditto.
247         * testing/InternalSettings.h: Updated for above changes. Also moved Backup to make
248         it private instead of public.
249         * testing/InternalSettings.idl: Use non-legacy execption. Also removed unneeded
250         exception for setIndexedDBWorkersEnabled.
251
252         * testing/Internals.cpp: Marked InspectorStubFrontend final and made everything private.
253         (WebCore::Internals::setCanShowModalDialogOverride): Use ExceptionOr.
254         (WebCore::Internals::lastSpatialNavigationCandidateCount): Ditto.
255         (WebCore::Internals::animationsAreSuspended): Ditto.
256         (WebCore::Internals::suspendAnimations): Ditto.
257         (WebCore::Internals::resumeAnimations): Ditto.
258         (WebCore::Internals::pauseAnimationAtTimeOnElement): Ditto.
259         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Ditto.
260         (WebCore::Internals::pauseTransitionAtTimeOnElement): Ditto.
261         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Ditto.
262         (WebCore::Internals::elementRenderTreeAsText): Ditto.
263         (WebCore::Internals::ensureShadowRoot): Ditto.
264         (WebCore::Internals::createShadowRoot): Ditto.
265         (WebCore::Internals::shadowRootType): Ditto.
266         (WebCore::Internals::isTimerThrottled): Ditto.
267         (WebCore::Internals::formControlStateOfPreviousHistoryItem): Ditto.
268         (WebCore::Internals::setFormControlStateOfPreviousHistoryItem): Ditto.
269         (WebCore::Internals::absoluteCaretBounds): Ditto.
270         (WebCore::Internals::inspectorHighlightRects): Ditto.
271         (WebCore::Internals::inspectorHighlightObject): Ditto.
272         (WebCore::Internals::markerCountForNode): Ditto.
273         (WebCore::Internals::markerAt): Ditto.
274         (WebCore::Internals::markerRangeForNode): Ditto.
275         (WebCore::Internals::markerDescriptionForNode): Ditto.
276         (WebCore::Internals::dumpMarkerRects): Ditto.
277         (WebCore::Internals::setMarkedTextMatchesAreHighlighted): Ditto.
278         (WebCore::Internals::setScrollViewPosition): Ditto.
279         (WebCore::Internals::setViewBaseBackgroundColor): Ditto.
280         (WebCore::Internals::setPagination): Ditto.
281         (WebCore::Internals::setPaginationLineGridEnabled): Ditto.
282         (WebCore::Internals::configurationForViewport): Ditto.
283         (WebCore::Internals::wasLastChangeUserEdit): Ditto.
284         (WebCore::Internals::scrollElementToRect): Ditto.
285         (WebCore::Internals::autofillFieldName): Ditto.
286         (WebCore::Internals::paintControlTints): Ditto.
287         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Ditto.
288         (WebCore::Internals::setDelegatesScrolling): Ditto.
289         (WebCore::Internals::lastSpellCheckRequestSequence): Ditto.
290         (WebCore::Internals::lastSpellCheckProcessedSequence): Ditto.
291         (WebCore::Internals::wheelEventHandlerCount): Ditto.
292         (WebCore::Internals::touchEventHandlerCount): Ditto.
293         (WebCore::Internals::nodesFromRect): Ditto.
294         (WebCore::Internals::setBatteryStatus): Ditto.
295         (WebCore::Internals::setDeviceProximity): Ditto.
296         (WebCore::Internals::hasSpellingMarker): Ditto.
297         (WebCore::Internals::hasAutocorrectedMarker): Ditto.
298         (WebCore::Internals::handleAcceptedCandidate): Ditto.
299         (WebCore::Internals::isOverwriteModeEnabled): Ditto.
300         (WebCore::Internals::toggleOverwriteModeEnabled): Ditto.
301         (WebCore::Internals::countMatchesForText): Ditto.
302         (WebCore::Internals::countFindMatches): Ditto.
303         (WebCore::Internals::setInspectorIsUnderTest): Ditto.
304         (WebCore::Internals::hasGrammarMarker): Ditto.
305         (WebCore::Internals::numberOfScrollableAreas): Ditto.
306         (WebCore::Internals::isPageBoxVisible): Ditto.
307         (WebCore::Internals::layerTreeAsText): Ditto.
308         (WebCore::Internals::repaintRectsAsText): Ditto.
309         (WebCore::Internals::scrollingStateTreeAsText): Ditto.
310         (WebCore::Internals::mainThreadScrollingReasons): Ditto.
311         (WebCore::Internals::nonFastScrollableRects): Ditto.
312         (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
313         (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
314         (WebCore::Internals::displayListForElement): Ditto.
315         (WebCore::Internals::replayDisplayListForElement): Ditto.
316         (WebCore::Internals::garbageCollectDocumentResources): Ditto.
317         (WebCore::Internals::insertAuthorCSS): Ditto.
318         (WebCore::Internals::insertUserCSS): Ditto.
319         (WebCore::Internals::pageProperty): Ditto.
320         (WebCore::Internals::pageSizeAndMarginsInPixels): Ditto.
321         (WebCore::Internals::setPageScaleFactor): Ditto.
322         (WebCore::Internals::setPageZoomFactor): Ditto.
323         (WebCore::Internals::setTextZoomFactor): Ditto.
324         (WebCore::Internals::setUseFixedLayout): Ditto.
325         (WebCore::Internals::setFixedLayoutSize): Ditto.
326         (WebCore::Internals::setViewExposedRect): Ditto.
327         (WebCore::Internals::setHeaderHeight): Ditto.
328         (WebCore::Internals::setFooterHeight): Ditto.
329         (WebCore::Internals::setTopContentInset): Ditto.
330         (WebCore::Internals::setApplicationCacheOriginQuota): Ditto.
331         (WebCore::Internals::startTrackingRepaints): Ditto.
332         (WebCore::Internals::stopTrackingRepaints): Ditto.
333         (WebCore::Internals::startTrackingLayerFlushes): Ditto.
334         (WebCore::Internals::layerFlushCount): Ditto.
335         (WebCore::Internals::startTrackingStyleRecalcs): Ditto.
336         (WebCore::Internals::styleRecalcCount): Ditto.
337         (WebCore::Internals::startTrackingCompositingUpdates): Ditto.
338         (WebCore::Internals::compositingUpdateCount): Ditto.
339         (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks): Ditto.
340         (WebCore::Internals::getCurrentCursorInfo): Ditto.
341         (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
342         (WebCore::Internals::captionsStyleSheetOverride): Ditto.
343         (WebCore::Internals::setCaptionsStyleSheetOverride): Ditto.
344         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride): Ditto.
345         (WebCore::Internals::setCaptionDisplayMode): Ditto.
346         (WebCore::Internals::selectionBounds): Ditto.
347         (WebCore::Internals::isVibrating): Ditto.
348         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Ditto.
349         (WebCore::Internals::beginMediaSessionInterruption): Ditto.
350         (WebCore::Internals::setMediaSessionRestrictions): Ditto.
351         (WebCore::Internals::postRemoteControlCommand): Ditto.
352         (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
353         (WebCore::Internals::installMockPageOverlay): Ditto.
354         (WebCore::Internals::pageOverlayLayerTreeAsText): Ditto.
355         (WebCore::Internals::scrollSnapOffsets): Ditto.
356         (WebCore::Internals::pathStringWithShrinkWrappedRects): Moved the code that builds
357         the path string in here for now since it's only used for this testing.
358         (WebCore::Internals::resourceLoadStatisticsForOrigin): Take a const String&.
359
360         * testing/Internals.h: Updated for above changes.
361         * testing/Internals.idl: Use non-legacy exceptions.
362
363 2016-10-18  Chris Dumez  <cdumez@apple.com>
364
365         [Web IDL] Drop webkit-specific extended attributes that are no longer useful
366         https://bugs.webkit.org/show_bug.cgi?id=163643
367
368         Reviewed by Ryosuke Niwa.
369
370         Drop webkit-specific IDL extended attributes that are no longer useful:
371         - [CustomReturn]: I believe this used to be for ObjC bindings. It has
372           no impact in JS bindings.
373         - [Deletable]: It only had an impact on static attributes and was only
374           used on HTMLAllCollection.all, which is not static. I updated the
375           bindings generator to so that static attributes are now configurable
376           by default (unless marked as [Unforgeable], as per Web IDL [1]. This
377           causes Notification.permission (This only static attribute we have)
378           to become deletable. This behavior is consistent with the specification
379           and with Chrome. I added test coverage for this.
380         - [ImplementationNamespace]: Implemented but unused.
381         - [PassContext]: Not implemented and unused.
382         - [TypedArray=*]: Not implemented and unused.
383
384         [1] https://heycam.github.io/webidl/#es-attributes
385
386         Test: fast/notifications/notification-permisssion-deletable.html
387
388         * bindings/scripts/CodeGeneratorJS.pm:
389         (GetNamespaceForInterface):
390         (GenerateImplementation):
391         * bindings/scripts/IDLAttributes.txt:
392         * bindings/scripts/test/JS/JSTestInterface.cpp:
393         * bindings/scripts/test/JS/JSTestObj.cpp:
394         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
395         * dom/Node.idl:
396         * html/HTMLDocument.idl:
397
398 2016-10-18  Sam Weinig  <sam@webkit.org>
399
400         Replace std::experimental::variant with WTF::Variant (or similar)
401         https://bugs.webkit.org/show_bug.cgi?id=163626
402
403         Reviewed by Chris Dumez.
404
405         Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc.
406         into the WTF namespace.
407
408         * Modules/fetch/FetchBody.h:
409         (WebCore::FetchBody::isBlob):
410         (WebCore::FetchBody::isFormData):
411         (WebCore::FetchBody::isArrayBuffer):
412         (WebCore::FetchBody::isArrayBufferView):
413         (WebCore::FetchBody::isURLSearchParams):
414         (WebCore::FetchBody::isText):
415         (WebCore::FetchBody::blobBody):
416         (WebCore::FetchBody::formDataBody):
417         (WebCore::FetchBody::arrayBufferBody):
418         (WebCore::FetchBody::arrayBufferViewBody):
419         (WebCore::FetchBody::textBody):
420         (WebCore::FetchBody::urlSearchParamsBody):
421         * bindings/generic/IDLTypes.h:
422         * dom/ExceptionOr.h:
423         (WebCore::ExceptionOr<ReturnType>::hasException):
424         (WebCore::ExceptionOr<ReturnType>::releaseException):
425         (WebCore::ExceptionOr<ReturnType>::releaseReturnValue):
426         * dom/MessageEvent.cpp:
427         (WebCore::MessageEvent::source):
428         * dom/MessageEvent.h:
429         * dom/Node.cpp:
430         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
431         (WebCore::Node::convertNodesOrStringsIntoNode):
432         * dom/Node.h:
433         * html/HTMLOptionsCollection.h:
434         * html/HTMLSelectElement.cpp:
435         (WebCore::HTMLSelectElement::add):
436         * html/HTMLSelectElement.h:
437         * html/track/TrackEvent.cpp:
438         (WebCore::TrackEvent::TrackEvent):
439         * html/track/TrackEvent.h:
440
441 2016-10-18  Chris Dumez  <cdumez@apple.com>
442
443         Unreviewed, rebaseline bindings tests after Sam's r207505.
444
445         * bindings/scripts/test/JS/JSTestCallback.cpp:
446         (WebCore::JSTestCallback::callbackWithSerializedScriptValueParam):
447         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
448         (WebCore::JSTestCallbackFunction::callbackWithSerializedScriptValueParam):
449         * bindings/scripts/test/JS/JSTestObj.cpp:
450         (WebCore::jsTestObjPrototypeFunctionSerializedValueCaller):
451         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
452         (WebCore::jsTestSerializedScriptValueInterfaceValueGetter):
453         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValueGetter):
454         (WebCore::jsTestSerializedScriptValueInterfaceCachedValueGetter):
455         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter):
456         (WebCore::setJSTestSerializedScriptValueInterfaceValueFunction):
457         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValueFunction):
458         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
459         (WebCore::jsTestTypedefsImmutableSerializedScriptValueGetter):
460         (WebCore::setJSTestTypedefsImmutableSerializedScriptValueFunction):
461
462 2016-10-18  Chris Dumez  <cdumez@apple.com>
463
464         [Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
465         https://bugs.webkit.org/show_bug.cgi?id=163630
466
467         Reviewed by Darin Adler.
468
469         Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor] in our
470         IDL now that all our events use proper constructors instead.
471
472         * bindings/scripts/CodeGenerator.pm:
473         * bindings/scripts/CodeGeneratorJS.pm:
474         (GenerateHeader):
475         (GenerateConstructorDefinition):
476         (GenerateConstructorHelperMethods):
477         (IsConstructable):
478         * bindings/scripts/IDLAttributes.txt:
479         * dom/Event.h:
480         (WebCore::Event::create):
481         * dom/Event.idl:
482         * dom/UIEvent.h:
483         (WebCore::UIEvent::create):
484         * dom/UIEvent.idl:
485
486 2016-10-18  Chris Dumez  <cdumez@apple.com>
487
488         Changing details.open should cause a toggle event to be fired asynchronously
489         https://bugs.webkit.org/show_bug.cgi?id=163568
490
491         Reviewed by Darin Adler.
492
493         Changing details.open should cause a toggle event to be fired asynchronously:
494         - https://html.spec.whatwg.org/#details-notification-task-steps
495
496         Firefox and Chrome implement this, we don't.
497
498         Test: imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-details-element/toggleEvent.html
499
500         * dom/EventNames.h:
501         * dom/GlobalEventHandlers.idl:
502         * html/HTMLAttributeNames.in:
503         * html/HTMLDetailsElement.cpp:
504         (WebCore::detailToggleEventSender):
505         (WebCore::HTMLDetailsElement::~HTMLDetailsElement):
506         (WebCore::HTMLDetailsElement::dispatchPendingEvent):
507         (WebCore::HTMLDetailsElement::parseAttribute):
508         * html/HTMLDetailsElement.h:
509         * html/HTMLElement.cpp:
510         (WebCore::HTMLElement::createEventHandlerNameMap):
511
512 2016-10-18  Dave Hyatt  <hyatt@apple.com>
513
514         [CSS Parser] Enable basic parser testing.
515         https://bugs.webkit.org/show_bug.cgi?id=163639
516
517         Reviewed by Dean Jackson.
518
519         * css/SelectorChecker.cpp:
520         (WebCore::SelectorChecker::matchRecursively):
521         Remove the ASSERT_NOT_REACHED on the new shadow selectors. We need to implement this
522         eventually, but it's better to not assert on that for now.
523
524         * css/parser/CSSParserValues.cpp:
525         (WebCore::CSSParserSelector::isHostPseudoSelector):
526         Make sure to check that we're a pseudoclass selector first, since otherwise we'll assert.
527
528         * css/parser/CSSParserValues.h:
529         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
530         Make sure to check that we're a pseudoelement selector first, since otherwise we'll assert.
531
532         * css/parser/CSSPropertyParser.cpp:
533         (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
534         copyRef is needed here, since a singleton value is being propagated to all the expanded shorthand properties.
535
536         (WebCore::parseSingleShadow):
537         (WebCore::CSSPropertyParser::consumeFont):
538         Remove the font properties that aren't part of our shorthand. We will need to revisit this eventually as it seems
539         some of the font properties should be reset as part of this shorthand but aren't.
540 '
541         * css/parser/CSSPropertyParserHelpers.cpp:
542         (WebCore::CSSPropertyParserHelpers::consumeInteger):
543         Just return a number for now instead of the parser_integer type.
544
545         * css/parser/CSSSelectorParser.cpp:
546         (WebCore::CSSSelectorParser::consumePseudo):
547         Clean this up so that it doesn't assert by making sure to add qualifying checks for the appropriate match type.
548
549 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
550
551         Update the comment for HTML Imports as there is now a proposal to use ES6 Modules for this.
552         Also replace the contact by me since I'm most familiar with this feature.
553
554         * features.json:
555
556 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
557
558         Update the status of shadow DOM API to "Done" with a comment saying we're still fixing bugs.
559
560         Also update my contact information since I'm no longer on Twitter.
561
562         * features.json:
563
564 2016-10-18  Chris Dumez  <cdumez@apple.com>
565
566         Provide better form validation messages
567         https://bugs.webkit.org/show_bug.cgi?id=163584
568
569         Reviewed by Darin Adler.
570
571         Provide better form validation messages that match more closely the ones
572         from Chrome and Firefox.
573
574         No new tests, updated existing tests.
575
576         * English.lproj/Localizable.strings:
577         * platform/LocalizedStrings.cpp:
578         (WebCore::validationMessageValueMissingText):
579         (WebCore::validationMessageValueMissingForCheckboxText):
580         (WebCore::validationMessageValueMissingForFileText):
581         (WebCore::validationMessageValueMissingForMultipleFileText):
582         (WebCore::validationMessageValueMissingForRadioText):
583         (WebCore::validationMessageValueMissingForSelectText):
584         (WebCore::validationMessageTypeMismatchText):
585         (WebCore::validationMessageTypeMismatchForEmailText):
586         (WebCore::validationMessageTypeMismatchForMultipleEmailText):
587         (WebCore::validationMessageTypeMismatchForURLText):
588         (WebCore::validationMessagePatternMismatchText):
589         (WebCore::validationMessageTooShortText):
590         (WebCore::validationMessageTooLongText):
591         (WebCore::validationMessageRangeUnderflowText):
592         (WebCore::validationMessageRangeOverflowText):
593         (WebCore::validationMessageStepMismatchText):
594         (WebCore::validationMessageBadInputForNumberText):
595
596 2016-10-18  Dave Hyatt  <hyatt@apple.com>
597
598         Fix GTK build.
599
600         * css/parser/CSSPropertyParser.cpp:
601         (WebCore::CSSPropertyParser::parseSingleValue):
602
603 2016-10-18  Sam Weinig  <sam@webkit.org>
604
605         Simplify SerializedScriptValue, MessagePortArray and ArrayBufferArray to ease generation
606         https://bugs.webkit.org/show_bug.cgi?id=163625
607
608         Reviewed by Chris Dumez.
609
610         - Replace uses of MessagePortArray (a.k.a. Vector<RefPtr<MessagePort>, 1>) with Vector<RefPtr<MessagePort>>.
611         - Replace uses of ArrayBufferArray (a.k.a. Vector<RefPtr<ArrayBuffer>, 1>) with Vector<RefPtr<ArrayBuffer>>.
612         - Add convenience functions to SerializedScriptValue to allow calling with fewer parameters.
613         - Move MessagePorts and ArrayBuffers more where possible.
614
615         * Modules/indexeddb/IDBObjectStore.cpp:
616         (WebCore::IDBObjectStore::putOrAdd):
617         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
618         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
619         * bindings/js/IDBBindingUtilities.cpp:
620         (WebCore::deserializeIDBValueToJSValue):
621         * bindings/js/JSCustomEventCustom.cpp:
622         (WebCore::JSCustomEvent::detail):
623         * bindings/js/JSHistoryCustom.cpp:
624         (WebCore::JSHistory::state):
625         (WebCore::JSHistory::pushState):
626         (WebCore::JSHistory::replaceState):
627         * bindings/js/JSPopStateEventCustom.cpp:
628         (WebCore::JSPopStateEvent::state):
629         * dom/CustomEvent.cpp:
630         (WebCore::CustomEvent::trySerializeDetail):
631         * dom/ErrorEvent.cpp:
632         (WebCore::ErrorEvent::sanitizedErrorValue):
633         (WebCore::ErrorEvent::trySerializeError):
634         * dom/PopStateEvent.cpp:
635         (WebCore::PopStateEvent::trySerializeState):
636         * page/DOMWindow.cpp:
637         (WebCore::DOMWindow::postMessage):
638         * page/DOMWindow.h:
639         * workers/DedicatedWorkerGlobalScope.cpp:
640         (WebCore::DedicatedWorkerGlobalScope::postMessage):
641         * workers/DedicatedWorkerGlobalScope.h:
642         * workers/Worker.cpp:
643         (WebCore::Worker::postMessage):
644         * workers/Worker.h:
645         * bindings/js/JSDOMWindowCustom.cpp:
646         (WebCore::handlePostMessage):
647         * bindings/js/JSDictionary.cpp:
648         (WebCore::JSDictionary::convertValue):
649         * bindings/js/JSDictionary.h:
650         Updated for new SerializedScriptValue interface/vector naming.
651
652         * bindings/js/JSMessageEventCustom.cpp:
653         (WebCore::handleInitMessageEvent):
654         Update handleInitMessageEvent to check for exceptions and use convert for the MessagePort sequence.
655
656         * bindings/js/JSMessagePortCustom.cpp:
657         (WebCore::extractTransferables):
658         (WebCore::fillMessagePortArray): Deleted.
659         * bindings/js/JSMessagePortCustom.h:
660         (WebCore::handlePostMessage):
661         Rename fillMessagePortArray to extractTransferables to better express what it does.
662
663         * bindings/js/SerializedScriptValue.cpp:
664         (WebCore::CloneSerializer::serialize):
665         (WebCore::CloneSerializer::CloneSerializer):
666         (WebCore::CloneSerializer::fillTransferMap):
667         (WebCore::CloneSerializer::dumpIfTerminal):
668         (WebCore::CloneDeserializer::deserialize):
669         (WebCore::CloneDeserializer::CloneDeserializer):
670         (WebCore::CloneDeserializer::readTerminal):
671         (WebCore::SerializedScriptValue::transferArrayBuffers):
672         (WebCore::SerializedScriptValue::create):
673         (WebCore::SerializedScriptValue::deserialize):
674         * bindings/js/SerializedScriptValue.h:
675         Simplify interface to allow more callers to avoid passing default arguments. Use ExecState& more.
676         * bindings/scripts/CodeGeneratorJS.pm:
677         (GetNativeVectorType):
678         Remove special case for MessagePort.
679         (JSValueToNative):
680         (NativeToJSValue):
681         Updated for new SerializedScriptValue interface.
682
683         * dom/MessageEvent.cpp:
684         (WebCore::MessageEvent::MessageEvent):
685         (WebCore::MessageEvent::create):
686         (WebCore::MessageEvent::initMessageEvent):
687         (WebCore::MessageEvent::trySerializeData):
688         * dom/MessageEvent.h:
689         Store the MessagePort sequence as a Vector<RefPtr<MessagePort>> rather than in a unique_ptr.
690
691         * dom/MessageEvent.idl:
692         Update last type in init functions to be sequence<MessagePort> rather than Array. They are still
693         custom, as we don't quite generate these correctly yet. 
694
695         * dom/MessagePort.cpp:
696         (WebCore::MessagePort::postMessage):
697         (WebCore::MessagePort::dispatchMessages):
698         (WebCore::MessagePort::disentanglePorts):
699         (WebCore::MessagePort::entanglePorts):
700         * dom/MessagePort.h:
701         Update interface to take MessagePort vectors by rvalue reference.
702
703 2016-10-18  Chris Dumez  <cdumez@apple.com>
704
705         [iOS] Drop JSDictionary::convertValue() overload taking a TouchList
706         https://bugs.webkit.org/show_bug.cgi?id=163620
707
708         Reviewed by Sam Weinig.
709
710         Drop JSDictionary::convertValue() overload taking a TouchList now that
711         TouchEvent is using a proper constructor with a TouchEventInit
712         dictionary on iOS.
713
714         * bindings/js/JSDictionary.cpp:
715
716 2016-10-18  Dean Jackson  <dino@apple.com>
717
718         Remove CSS_SHAPES feature definition. This should always be on.
719         https://bugs.webkit.org/show_bug.cgi?id=163628
720         <rdar://problem/28834613>
721
722         Reviewed by Tim Horton.
723
724         CSS Shapes is in Candidate Recommendation. It's a core part
725         of CSS. It should always be enabled.
726
727         * Configurations/FeatureDefines.xcconfig:
728         * css/CSSComputedStyleDeclaration.cpp:
729         (WebCore::shapePropertyValue):
730         (WebCore::ComputedStyleExtractor::propertyValue):
731         * css/CSSPropertyNames.in:
732         * css/CSSValueKeywords.in:
733         * css/StyleBuilderConverter.h:
734         (WebCore::StyleBuilderConverter::convertShapeValue):
735         * css/parser/CSSParser.cpp:
736         (WebCore::isSimpleLengthPropertyID):
737         (WebCore::CSSParser::parseValue):
738         (WebCore::CSSParser::parseShapeProperty):
739         * css/parser/CSSParser.h:
740         * inspector/InspectorOverlay.cpp:
741         (WebCore::buildObjectForShapeOutside):
742         (WebCore::buildObjectForElementData):
743         * page/animation/CSSPropertyAnimation.cpp:
744         (WebCore::blendFunc):
745         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
746         * rendering/FloatingObjects.cpp:
747         (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
748         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
749         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
750         * rendering/RenderBlock.cpp:
751         * rendering/RenderBlockFlow.cpp:
752         (WebCore::RenderBlockFlow::positionNewFloats):
753         * rendering/RenderBox.cpp:
754         (WebCore::RenderBox::~RenderBox):
755         (WebCore::RenderBox::styleDidChange):
756         (WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange):
757         (WebCore::isCandidateForOpaquenessTest):
758         (WebCore::RenderBox::imageChanged):
759         * rendering/RenderBox.h:
760         (WebCore::RenderBox::markShapeOutsideDependentsForLayout):
761         * rendering/RenderElement.cpp:
762         (WebCore::RenderElement::~RenderElement):
763         (WebCore::RenderElement::updateShapeImage):
764         (WebCore::RenderElement::initializeStyle):
765         (WebCore::RenderElement::setStyle):
766         * rendering/RenderElement.h:
767         (WebCore::RenderElement::hasShapeOutside):
768         * rendering/SimpleLineLayout.cpp:
769         (WebCore::SimpleLineLayout::canUseForWithReason):
770         * rendering/line/LineWidth.cpp:
771         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
772         (WebCore::LineWidth::wrapNextToShapeOutside):
773         (WebCore::LineWidth::fitBelowFloats):
774         * rendering/line/LineWidth.h:
775         * rendering/shapes/ShapeOutsideInfo.cpp:
776         * rendering/shapes/ShapeOutsideInfo.h:
777         * rendering/style/RenderStyle.cpp:
778         (WebCore::RenderStyle::changeRequiresLayout):
779         (WebCore::RenderStyle::changeRequiresRepaint):
780         * rendering/style/RenderStyle.h:
781         (WebCore::RenderStyle::initialShapeImageThreshold):
782         * rendering/style/ShapeValue.cpp:
783         * rendering/style/ShapeValue.h:
784         * rendering/style/StyleRareNonInheritedData.cpp:
785         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
786         (WebCore::StyleRareNonInheritedData::operator==):
787         * rendering/style/StyleRareNonInheritedData.h:
788         * style/StylePendingResources.cpp:
789         (WebCore::Style::loadPendingResources):
790
791 2016-10-18  Chris Dumez  <cdumez@apple.com>
792
793         convertDictionary<>() no longer needs to return an Optional<> type
794         https://bugs.webkit.org/show_bug.cgi?id=163624
795
796         Reviewed by Sam Weinig.
797
798         convertDictionary<>() no longer needs to return an Optional<> type now
799         that our dictionary structures are all default constructible after
800         <https://trac.webkit.org/changeset/206974>.
801
802         * bindings/js/JSDOMConvert.h:
803         * bindings/scripts/CodeGeneratorJS.pm:
804         (GenerateDictionaryHeaderContent):
805         (GenerateDictionaryImplementationContent):
806         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
807         (WebCore::convertDictionary<TestEventConstructor::Init>):
808         * bindings/scripts/test/JS/JSTestEventConstructor.h:
809         * bindings/scripts/test/JS/JSTestObj.cpp:
810         (WebCore::convertDictionary<TestObj::Dictionary>):
811         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
812         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
813         (WebCore::convertDictionary<AlternateDictionaryName>):
814         (WebCore::convertDictionary<TestObj::ParentDictionary>):
815         (WebCore::convertDictionary<TestObj::ChildDictionary>):
816         * bindings/scripts/test/JS/JSTestObj.h:
817         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
818         (WebCore::convertDictionary<DictionaryImplName>):
819         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
820
821 2016-10-18  Chris Dumez  <cdumez@apple.com>
822
823         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add()
824         https://bugs.webkit.org/show_bug.cgi?id=163608
825
826         Reviewed by Ryosuke Niwa.
827
828         Leverage new union type support for HTMLSelectElement.add() / HTMLOptionsCollection.add():
829         - https://html.spec.whatwg.org/#htmlselectelement
830         - https://html.spec.whatwg.org/#htmloptionscollection
831
832         No new tests, rebaseline existing test.
833
834         * bindings/scripts/CodeGeneratorJS.pm:
835         (GenerateDefaultValue):
836         (GenerateParametersCheck):
837         * bindings/scripts/test/JS/JSTestObj.cpp:
838         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyCaller):
839         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
840         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
841         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
842         (WebCore::jsTestTypedefsPrototypeFunctionFuncCaller):
843         * html/HTMLOptGroupElement.idl:
844         * html/HTMLOptionsCollection.cpp:
845         (WebCore::HTMLOptionsCollection::add):
846         * html/HTMLOptionsCollection.h:
847         * html/HTMLOptionsCollection.idl:
848         * html/HTMLSelectElement.cpp:
849         (WebCore::HTMLSelectElement::add):
850         (WebCore::HTMLSelectElement::setOption):
851         (WebCore::HTMLSelectElement::setLength):
852         * html/HTMLSelectElement.h:
853         * html/HTMLSelectElement.idl:
854
855 2016-10-18  Aaron Chu  <aaron_chu@apple.com>
856
857         Web Inspector: AXI: focused/focusable state should be based on Accessibility Object instead of Element
858         https://bugs.webkit.org/show_bug.cgi?id=163088
859         <rdar://problem/16421985>
860
861         Reviewed by Darin Adler.
862
863         Changed code in InspectDOMAgent so that it determines the focusability of a Node based
864         on the AccessibilityNodeObject and not the Element class.
865
866         Covered by existing tests: 
867         LayoutTests/inspector/dom/getAccessibilityPropertiesForNode.html
868
869         * inspector/InspectorDOMAgent.cpp:
870         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
871
872 2016-10-18  Anders Carlsson  <andersca@apple.com>
873
874         Get rid of more WebHistoryItem cruft
875         https://bugs.webkit.org/show_bug.cgi?id=163623
876
877         Reviewed by Tim Horton.
878
879         * history/HistoryItem.cpp:
880         (WebCore::HistoryItem::HistoryItem):
881         * history/HistoryItem.h:
882         (WebCore::HistoryItem::setViewportArguments):
883         (WebCore::HistoryItem::bookmarkID): Deleted.
884         (WebCore::HistoryItem::setBookmarkID): Deleted.
885         (WebCore::HistoryItem::sharedLinkUniqueIdentifier): Deleted.
886         (WebCore::HistoryItem::setSharedLinkUniqueIdentifier): Deleted.
887
888 2016-10-18  Dave Hyatt  <hyatt@apple.com>
889
890         Fix Windows build.
891  
892         * css/parser/CSSPropertyParser.cpp:
893         (WebCore::CSSPropertyParser::parseSingleValue):
894
895 2016-10-18  Antoine Quint  <graouts@apple.com>
896
897         Modern media controls don't update their rendering correctly
898         https://bugs.webkit.org/show_bug.cgi?id=163603
899         <rdar://problem/28826022>
900
901         Reviewed by Dean Jackson.
902
903         There are rendering issues when we use an absolutely-positioned element
904         as the top-most element in a media element's shadow root (webkit.org/b/163592).
905         Since we only need for that element to be positioned, we can use "position: relative"
906         instead, which removes the rendering issues.
907
908         * Modules/modern-media-controls/controls/media-controls.css:
909         (.media-controls):
910         (.media-controls,): Deleted.
911
912 2016-10-18  Dean Jackson  <dino@apple.com>
913
914         Add preliminary support for extended colors to WebCore::Color
915         https://bugs.webkit.org/show_bug.cgi?id=162878
916         <rdar://problem/28596413>
917
918         Follow-up review comments from Darin Adler.
919
920         * html/canvas/CanvasGradient.cpp:
921         (WebCore::CanvasGradient::addColorStop): Use nullptr.
922         * platform/graphics/Color.cpp:
923         (WebCore::Color::Color): Explicitly zero before assigning the pointer.
924         * platform/graphics/Color.h: Add some comments about the failings of operator== and hash.
925         (WebCore::Color::Color): Add some static_asserts to the constructors. Move the empty and deleted values
926         to static constants.
927         (WebCore::Color::isHashTableDeletedValue):
928         (WebCore::Color::hash): Replacement for asUint64, which was only being used for a hash.
929         (WebCore::Color::asUint64): Deleted.
930         * platform/graphics/ColorHash.h: Use new hash functions. Use "using" instead of typedef.
931         (WTF::ColorHash::hash):
932
933 2016-10-18  Ryosuke Niwa  <rniwa@webkit.org>
934
935         REGRESSION (r201471): Keyboard remains visible when swiping back on twitter.com
936         https://bugs.webkit.org/show_bug.cgi?id=163581
937         <rdar://problem/27739558>
938
939         Reviewed by Simon Fraser.
940
941         The bug was caused by Chrome::elementDidBlur not getting called, which resulted in
942         StopAssistingNode not getting sent to the UI process.
943
944         Test: fast/forms/ios/hide-keyboard-on-node-removal.html
945
946         * dom/Document.cpp:
947         (WebCore::Document::setFocusedElement): Restore the behavior prior to r201471 by calling
948         Chrome::elementDidBlur explicitly.
949         * html/HTMLTextFormControlElement.cpp:
950         (WebCore::HTMLTextFormControlElement::dispatchBlurEvent): Added a comment about ordering.
951
952 2016-10-17  Anders Carlsson  <andersca@apple.com>
953
954         Move some history specific HistoryItem code to WebHistoryItem
955         https://bugs.webkit.org/show_bug.cgi?id=163567
956
957         Reviewed by Tim Horton.
958
959         * history/HistoryItem.cpp:
960         (WebCore::HistoryItem::addRedirectURL): Deleted.
961         (WebCore::HistoryItem::redirectURLs): Deleted.
962         (WebCore::HistoryItem::setRedirectURLs): Deleted.
963         * history/HistoryItem.h:
964
965 2016-10-18  Dave Hyatt  <hyatt@apple.com>
966
967         [CSS Parser] Get all the properties turned on
968         https://bugs.webkit.org/show_bug.cgi?id=163605
969
970         Reviewed by Dean Jackson.
971
972         * WebCore.xcodeproj/project.pbxproj:
973         * css/CSSFunctionValue.h:
974         * css/CSSPendingSubstitutionValue.cpp: Added.
975         (WebCore::CSSPendingSubstitutionValue::customCSSText):
976         * css/CSSPendingSubstitutionValue.h: Added.
977         (WebCore::CSSPendingSubstitutionValue::create):
978         (WebCore::CSSPendingSubstitutionValue::shorthandValue):
979         (WebCore::CSSPendingSubstitutionValue::shorthandPropertyId):
980         (WebCore::CSSPendingSubstitutionValue::equals):
981         (WebCore::CSSPendingSubstitutionValue::CSSPendingSubstitutionValue):
982         * css/CSSValue.cpp:
983         (WebCore::CSSValue::cssText):
984         (WebCore::CSSValue::destroy):
985         * css/CSSValue.h:
986         (WebCore::CSSValue::isPendingSubstitutionValue):
987         * css/CSSValueKeywords.in:
988         * css/StylePropertyShorthand.cpp:
989         (WebCore::transitionShorthandForParsing):
990         * css/StylePropertyShorthand.h:
991         * css/parser/CSSParser.cpp:
992         (WebCore::CSSParser::completeURL):
993         * css/parser/CSSParserImpl.cpp:
994         (WebCore::CSSParserImpl::parseValue):
995         (WebCore::CSSParserImpl::consumeDeclaration):
996         (WebCore::CSSParserImpl::consumeDeclarationValue):
997         * css/parser/CSSParserMode.h:
998         (WebCore::CSSParserContext::completeURL):
999         * css/parser/CSSParserToken.cpp:
1000         (WebCore::CSSParserToken::parseAsCSSPropertyID):
1001         (WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID): Deleted.
1002         * css/parser/CSSParserToken.h:
1003         * css/parser/CSSPropertyParser.cpp:
1004         (WebCore::cssPropertyID):
1005         (WebCore::CSSPropertyParser::addProperty):
1006         (WebCore::CSSPropertyParser::addExpandedPropertyForValue):
1007         (WebCore::CSSPropertyParser::parseValue):
1008         (WebCore::CSSPropertyParser::parseSingleValue):
1009         (WebCore::CSSPropertyParser::parseValueStart):
1010         (WebCore::CSSPropertyParser::consumeCSSWideKeyword):
1011         (WebCore::consumeTransformOrigin):
1012         (WebCore::consumeWillChange):
1013         (WebCore::consumeFontFeatureTag):
1014         (WebCore::consumeFontFeatureSettings):
1015         (WebCore::consumePage):
1016         (WebCore::consumeQuotes):
1017         (WebCore::FontVariantLigaturesParser::consumeLigature):
1018         (WebCore::FontVariantLigaturesParser::finalizeValue):
1019         (WebCore::consumeFontVariantLigatures):
1020         (WebCore::consumeFontVariantCaps):
1021         (WebCore::FontVariantNumericParser::consumeNumeric):
1022         (WebCore::FontVariantNumericParser::finalizeValue):
1023         (WebCore::consumeFontVariantNumeric):
1024         (WebCore::consumeFontVariantCSS21):
1025         (WebCore::consumeFontVariantList):
1026         (WebCore::consumeFontWeight):
1027         (WebCore::consumeFamilyName):
1028         (WebCore::consumeGenericFamily):
1029         (WebCore::consumeFontFamily):
1030         (WebCore::consumeSpacing):
1031         (WebCore::consumeTabSize):
1032         (WebCore::consumeTextSizeAdjust):
1033         (WebCore::consumeFontSize):
1034         (WebCore::consumeLineHeight):
1035         (WebCore::createPrimitiveValuePair):
1036         (WebCore::consumeCounter):
1037         (WebCore::consumePageSize):
1038         (WebCore::consumeSize):
1039         (WebCore::consumeTextIndent):
1040         (WebCore::validWidthOrHeightKeyword):
1041         (WebCore::consumeMaxWidthOrHeight):
1042         (WebCore::consumeWidthOrHeight):
1043         (WebCore::consumeMarginOrOffset):
1044         (WebCore::consumeClipComponent):
1045         (WebCore::consumeClip):
1046         (WebCore::consumeTouchAction):
1047         (WebCore::consumeLineClamp):
1048         (WebCore::consumeLocale):
1049         (WebCore::consumeColumnWidth):
1050         (WebCore::consumeColumnCount):
1051         (WebCore::consumeColumnGap):
1052         (WebCore::consumeColumnSpan):
1053         (WebCore::consumeZoom):
1054         (WebCore::consumeAnimationIterationCount):
1055         (WebCore::consumeAnimationName):
1056         (WebCore::consumeTransitionProperty):
1057         (WebCore::consumeCubicBezier):
1058         (WebCore::consumeAnimationTimingFunction):
1059         (WebCore::consumeAnimationValue):
1060         (WebCore::isValidAnimationPropertyList):
1061         (WebCore::consumeAnimationPropertyList):
1062         (WebCore::CSSPropertyParser::consumeAnimationShorthand):
1063         (WebCore::consumeZIndex):
1064         (WebCore::parseSingleShadow):
1065         (WebCore::consumeShadow):
1066         (WebCore::consumeFilterFunction):
1067         (WebCore::consumeFilter):
1068         (WebCore::consumeTextDecorationLine):
1069         (WebCore::consumeTextEmphasisStyle):
1070         (WebCore::consumeOutlineColor):
1071         (WebCore::consumeLineWidth):
1072         (WebCore::consumeBorderWidth):
1073         (WebCore::consumeTextStrokeWidth):
1074         (WebCore::consumeColumnRuleWidth):
1075         (WebCore::consumeTranslate3d):
1076         (WebCore::consumeNumbers):
1077         (WebCore::consumePerspective):
1078         (WebCore::consumeTransformValue):
1079         (WebCore::consumeTransform):
1080         (WebCore::consumePositionLonghand):
1081         (WebCore::consumePositionX):
1082         (WebCore::consumePositionY):
1083         (WebCore::consumePaintStroke):
1084         (WebCore::consumePaintOrder):
1085         (WebCore::consumeNoneOrURI):
1086         (WebCore::consumeFlexBasis):
1087         (WebCore::consumeStrokeDasharray):
1088         (WebCore::consumeBaselineShift):
1089         (WebCore::consumeRxOrRy):
1090         (WebCore::consumeCursor):
1091         (WebCore::consumeAttr):
1092         (WebCore::consumeCounterContent):
1093         (WebCore::consumeContent):
1094         (WebCore::consumePositionList):
1095         (WebCore::consumeScrollSnapCoordinate):
1096         (WebCore::consumeScrollSnapPoints):
1097         (WebCore::consumeBorderRadiusCorner):
1098         (WebCore::consumeVerticalAlign):
1099         (WebCore::consumeShapeRadius):
1100         (WebCore::consumeBasicShapeCircle):
1101         (WebCore::consumeBasicShapeEllipse):
1102         (WebCore::consumeBasicShapePolygon):
1103         (WebCore::complete4Sides):
1104         (WebCore::consumeRadii):
1105         (WebCore::consumeBasicShapeInset):
1106         (WebCore::consumeBasicShape):
1107         (WebCore::consumeWebkitClipPath):
1108         (WebCore::consumeShapeOutside):
1109         (WebCore::consumeContentDistributionOverflowPosition):
1110         (WebCore::consumeBorderImageRepeatKeyword):
1111         (WebCore::consumeBorderImageRepeat):
1112         (WebCore::consumeBorderImageSlice):
1113         (WebCore::consumeBorderImageOutset):
1114         (WebCore::consumeBorderImageWidth):
1115         (WebCore::consumeBorderImageComponents):
1116         (WebCore::consumeWebkitBorderImage):
1117         (WebCore::consumeReflect):
1118         (WebCore::consumeImageOrientation):
1119         (WebCore::consumeBackgroundBlendMode):
1120         (WebCore::consumeBackgroundAttachment):
1121         (WebCore::consumeBackgroundBox):
1122         (WebCore::consumeBackgroundComposite):
1123         (WebCore::consumePrefixedBackgroundBox):
1124         (WebCore::consumeBackgroundSize):
1125         (WebCore::consumeGridAutoFlow):
1126         (WebCore::consumeBackgroundComponent):
1127         (WebCore::addBackgroundValue):
1128         (WebCore::consumeCommaSeparatedBackgroundComponent):
1129         (WebCore::consumeSelfPositionKeyword):
1130         (WebCore::consumeSelfPositionOverflowPosition):
1131         (WebCore::consumeAlignItems):
1132         (WebCore::consumeJustifyItems):
1133         (WebCore::consumeFitContent):
1134         (WebCore::consumeCustomIdentForGridLine):
1135         (WebCore::consumeGridLine):
1136         (WebCore::isGridTrackFixedSized):
1137         (WebCore::consumeGridBreadth):
1138         (WebCore::consumeGridTrackSize):
1139         (WebCore::consumeGridLineNames):
1140         (WebCore::consumeGridTrackRepeatFunction):
1141         (WebCore::consumeGridTrackList):
1142         (WebCore::consumeGridTemplatesRowsOrColumns):
1143         (WebCore::consumeGridTemplateAreas):
1144         (WebCore::consumeFontFaceUnicodeRange):
1145         (WebCore::consumeFontFaceSrcURI):
1146         (WebCore::consumeFontFaceSrcLocal):
1147         (WebCore::consumeFontFaceSrc):
1148         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
1149         (WebCore::CSSPropertyParser::consumeSystemFont):
1150         (WebCore::CSSPropertyParser::consumeFont):
1151         (WebCore::CSSPropertyParser::consumeFontVariantShorthand):
1152         (WebCore::CSSPropertyParser::consumeBorderSpacing):
1153         (WebCore::consumeSingleViewportDescriptor):
1154         (WebCore::CSSPropertyParser::parseViewportDescriptor):
1155         (WebCore::consumeColumnWidthOrCount):
1156         (WebCore::CSSPropertyParser::consumeColumns):
1157         (WebCore::CSSPropertyParser::consumeShorthandGreedily):
1158         (WebCore::CSSPropertyParser::consumeFlex):
1159         (WebCore::CSSPropertyParser::consumeBorder):
1160         (WebCore::CSSPropertyParser::consume4Values):
1161         (WebCore::CSSPropertyParser::consumeBorderImage):
1162         (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
1163         (WebCore::consumeBackgroundPosition):
1164         (WebCore::consumeRepeatStyleComponent):
1165         (WebCore::consumeRepeatStyle):
1166         (WebCore::CSSPropertyParser::consumeBackgroundShorthand):
1167         (WebCore::CSSPropertyParser::consumeGridItemPositionShorthand):
1168         (WebCore::CSSPropertyParser::consumeGridAreaShorthand):
1169         (WebCore::CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns):
1170         (WebCore::CSSPropertyParser::consumeGridTemplateShorthand):
1171         (WebCore::CSSPropertyParser::consumeGridShorthand):
1172         (WebCore::CSSPropertyParser::parseShorthand):
1173         (WebCore::unresolvedCSSPropertyID): Deleted.
1174         * css/parser/CSSPropertyParser.h:
1175         * css/parser/CSSPropertyParserHelpers.cpp:
1176         (WebCore::CSSPropertyParserHelpers::consumeIdent):
1177         (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
1178         (WebCore::CSSPropertyParserHelpers::consumeString):
1179         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
1180         * css/parser/CSSPropertyParserHelpers.h:
1181
1182 2016-10-18  Brent Fulgham  <bfulgham@apple.com>
1183
1184         Correct Document::removeAllEventListeners
1185         https://bugs.webkit.org/show_bug.cgi?id=163558
1186         <rdar://problem/28716840>
1187
1188         Reviewed by Chris Dumez.
1189
1190         Tested by fast/dom/node-move-to-new-document-crash-main.html.
1191
1192         * dom/Document.cpp:
1193         (WebCore::Document::removeAllEventListeners): Clear out the wheel and
1194         touch event targets when clearing all data.
1195
1196 2016-10-18  Dean Jackson  <dino@apple.com>
1197
1198         Remove dependency cycle with UIKit
1199         https://bugs.webkit.org/show_bug.cgi?id=163577
1200         <rdar://problem/28786160>
1201
1202         Reviewed by Tim Horton.
1203
1204         Soft link against UIKit. Followup patch because
1205         I screwed up and forgot to edit the simulator
1206         configuration.
1207
1208         * Configurations/WebCoreTestSupport.xcconfig:
1209
1210 2016-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1211
1212         SVGCSSParser: m_implicitShorthand value is not reset after adding the shorthand property
1213         https://bugs.webkit.org/show_bug.cgi?id=116470
1214
1215         Reviewed by Simon Fraser.
1216
1217         When we encounter a shorthand css property, we set m_implicitShorthand
1218         to true to tell addProperty() later that the individual properties are
1219         all set through a short hand one. We need to make sure that setting 
1220         m_implicitShorthand to true will not be leaked after finishing parsing
1221         the short hand property.
1222
1223         Test: fast/css/implicit-property-restore.html
1224
1225         * css/parser/CSSParser.cpp:
1226         (WebCore::CSSParser::parseValue):
1227         (WebCore::CSSParser::parseFillShorthand):
1228         (WebCore::CSSParser::parseShorthand):
1229         (WebCore::CSSParser::parse4Values):
1230         (WebCore::CSSParser::parseBorderRadius):
1231         (WTF::ImplicitScope::ImplicitScope): Deleted.
1232         (WTF::ImplicitScope::~ImplicitScope): Deleted.
1233         Get rid of ImplicitScope and replace its calls by TemporaryChange<bool>.
1234         
1235         * css/parser/SVGCSSParser.cpp:
1236         (WebCore::CSSParser::parseSVGValue):
1237         Restore m_implicitShorthand value after setting it temporarily to true.
1238
1239 2016-10-18  Chris Dumez  <cdumez@apple.com>
1240
1241         Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
1242         https://bugs.webkit.org/show_bug.cgi?id=163580
1243
1244         Reviewed by Sam Weinig.
1245
1246         Update TrackEvent to stop using legacy [ConstructorTemplate=Event]
1247         and use a regular constructor as in the specification:
1248         - https://html.spec.whatwg.org/#the-trackevent-interface
1249
1250         No new tests, updated existing tests.
1251
1252         * html/track/TrackEvent.cpp:
1253         (WebCore::TrackEvent::TrackEvent):
1254         * html/track/TrackEvent.h:
1255         * html/track/TrackEvent.idl:
1256
1257 2016-10-18  Commit Queue  <commit-queue@webkit.org>
1258
1259         Unreviewed, rolling out r207409.
1260         https://bugs.webkit.org/show_bug.cgi?id=163602
1261
1262         Introduced many test failures and timeouts, causing release
1263         bot to exit early (Requested by mcatanzaro on #webkit).
1264
1265         Reverted changeset:
1266
1267         "[GTK] Several tests crashing on debug bot in (anonymous
1268         namespace)::MediaPlayerPrivateGStreamerBase::repaint"
1269         https://bugs.webkit.org/show_bug.cgi?id=163511
1270         http://trac.webkit.org/changeset/207409
1271
1272 2016-10-18  Eric Carlson  <eric.carlson@apple.com>
1273
1274         [MediaStream] Resolve constraints and enumerate devices in the UI process
1275         https://bugs.webkit.org/show_bug.cgi?id=162147
1276         <rdar://problem/28803569>
1277
1278         Reviewed by Darin Adler.
1279
1280         Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
1281         access happens in the UI process.
1282
1283         No new tests, updated results of existing tests.
1284
1285         * CMakeLists.txt: Add MediaDevicesEnumerationRequest.cpp, delete UserMediaPermissionCheck.cpp.
1286
1287         * Modules/mediastream/MediaConstraintsImpl.cpp:
1288         (WebCore::MediaConstraintsImpl::create): Only create from MediaConstraintsData.
1289         (WebCore::MediaConstraintsImpl::initialize): Deleted.
1290         * Modules/mediastream/MediaConstraintsImpl.h:
1291
1292         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Added.
1293         (WebCore::MediaDevicesEnumerationRequest::create):
1294         (WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
1295         (WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
1296         (WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin):
1297         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
1298         (WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
1299         (WebCore::MediaDevicesEnumerationRequest::start):
1300         (WebCore::MediaDevicesEnumerationRequest::cancel):
1301         (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo):
1302         (WebCore::MediaDevicesEnumerationRequest::finish):
1303         * Modules/mediastream/MediaDevicesEnumerationRequest.h: Added.
1304
1305         * Modules/mediastream/MediaDevicesRequest.cpp:
1306         (WebCore::MediaDevicesRequest::~MediaDevicesRequest): Clear the enumeration request.
1307         (WebCore::MediaDevicesRequest::contextDestroyed): Ditto.
1308         (WebCore::MediaDevicesRequest::start): Create and use a MediaDevicesEnumerationRequest.
1309         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Deleted.
1310         * Modules/mediastream/MediaDevicesRequest.h:
1311
1312         * Modules/mediastream/UserMediaClient.h:
1313         * Modules/mediastream/UserMediaController.h:
1314         (WebCore::UserMediaController::enumerateMediaDevices): New.
1315         (WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): New.
1316         (WebCore::UserMediaController::checkUserMediaPermission): Deleted.
1317         (WebCore::UserMediaController::cancelUserMediaPermissionCheck): Deleted.
1318
1319         * Modules/mediastream/UserMediaPermissionCheck.h: Deleted.
1320         * Modules/mediastream/UserMediaPermissionCheck.cpp: Deleted.
1321
1322         * Modules/mediastream/UserMediaRequest.cpp:
1323         (WebCore::UserMediaRequest::UserMediaRequest):
1324         (WebCore::UserMediaRequest::start):
1325         (WebCore::UserMediaRequest::allow):
1326         (WebCore::UserMediaRequest::deny):
1327         (WebCore::UserMediaRequest::constraintsValidated): Deleted.
1328         (WebCore::UserMediaRequest::userMediaAccessGranted): Deleted.
1329         (WebCore::UserMediaRequest::userMediaAccessDenied): Deleted.
1330         (WebCore::UserMediaRequest::constraintsInvalid): Deleted.
1331         (WebCore::UserMediaRequest::didCreateStream): Deleted.
1332         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError): Deleted.
1333         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError): Deleted.
1334         * Modules/mediastream/UserMediaRequest.h:
1335
1336         * WebCore.xcodeproj/project.pbxproj: Add MediaDevicesEnumerationRequest.*.
1337
1338         * platform/mediastream/CaptureDevice.h:
1339         (WebCore::CaptureDevice::CaptureDevice):
1340         (WebCore::CaptureDevice::setPersistentId): Add setter for argument decoder.
1341         (WebCore::CaptureDevice::setLabel): Ditto.
1342         (WebCore::CaptureDevice::setGroupId): Ditto.
1343         (WebCore::CaptureDevice::setKind): Ditto.
1344
1345         * platform/mediastream/CaptureDeviceManager.h: Remove unnecessary include.
1346
1347         * platform/mediastream/MediaConstraints.h:
1348         (WebCore::MediaConstraint::encode): New.
1349         (WebCore::MediaConstraint::decode): Ditto.
1350         (WebCore::NumericConstraint::encode): Ditto.
1351         (WebCore::NumericConstraint::decode): Ditto.
1352
1353         * platform/mediastream/MediaStreamCreationClient.h: Deleted.
1354
1355         * platform/mediastream/RealtimeMediaSourceCenter.h: Use completion handlers instead of client interface.
1356
1357         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1358         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Drive-by fix: don't initialize
1359         group id, we don't support it.
1360
1361         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1362         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): Update for interface change.
1363         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream): Ditto.
1364         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
1365
1366         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
1367         (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints): Ditto.
1368         (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Ditto.
1369         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable): Ditto.
1370         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
1371
1372         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1373         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
1374         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Ditto.
1375         * platform/mock/MockRealtimeMediaSourceCenter.h:
1376
1377 2016-10-18  Zan Dobersek  <zdobersek@igalia.com>
1378
1379         [WebIDL] Support BufferSource
1380         https://bugs.webkit.org/show_bug.cgi?id=163541
1381
1382         Reviewed by Youenn Fablet.
1383
1384         Add support for the BufferSource typedef in WebIDL. The implementation
1385         adds the necessary handling for this type in the generator scripts and
1386         the specialization of the Converter<> template for the IDLBufferSource
1387         struct that enables exposing ArrayBuffer or ArrayBufferView objects by
1388         having WebCore::BufferSource objects pointing to their data.
1389
1390         The SourceBuffer interface in the MSE module has the appendBuffer()
1391         operation modified to accept a BufferSource parameter, instead of
1392         overloading it for ArrayBuffer and ArrayBufferView parameters.
1393
1394         The bindings generator tests cover BufferSource as both an operation
1395         parameter and as a dictionary member.
1396
1397         * Modules/mediasource/SourceBuffer.cpp:
1398         (WebCore::SourceBuffer::appendBuffer):
1399         (WebCore::SourceBuffer::appendBufferInternal):
1400         * Modules/mediasource/SourceBuffer.h:
1401         * Modules/mediasource/SourceBuffer.idl:
1402         * WebCore.xcodeproj/project.pbxproj:
1403         * bindings/generic/IDLTypes.h:
1404         * bindings/js/BufferSource.h: Added.
1405         * bindings/js/JSDOMConvert.h:
1406         (WebCore::Converter<IDLBufferSource>::convert):
1407         * bindings/scripts/CodeGenerator.pm:
1408         (SkipIncludeHeader):
1409         (IsWrapperType):
1410         * bindings/scripts/CodeGeneratorJS.pm:
1411         (AddClassForwardIfNeeded):
1412         (GetBaseIDLType):
1413         (IsHandledByDOMConvert):
1414         * bindings/scripts/test/JS/JSTestObj.cpp:
1415         (WebCore::convertDictionary<TestObj::Dictionary>):
1416         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
1417         (WebCore::jsTestObjPrototypeFunctionBufferSourceParameterCaller):
1418         * bindings/scripts/test/TestObj.idl:
1419
1420 2016-10-18  Javier Fernandez  <jfernandez@igalia.com>
1421
1422         [css-grid] Different width of grid container between initial load and refresh
1423         https://bugs.webkit.org/show_bug.cgi?id=163535
1424
1425         Reviewed by Manuel Rego Casasnovas.
1426
1427         Grid's layout logic manages two different override sizes; one it's
1428         designed to implement the grid item's stretching behavior, identified
1429         with the concept of 'overrideContentLogicalSize'; there is another
1430         override size, known as overrideContainingBlockContentLogicalSize,
1431         used to implement the Grid Area abstraction, which will behave as
1432         the actual containing block of any grid item.
1433
1434         During grid's layout logic these override sizes are set according
1435         to the CSS style rules. This affects how the grid container and its
1436         children are going to be sized during layout. Grid Tracks sizing
1437         algorithm depends on these override sizes.
1438
1439         In order to ensure that the tracks sizing algorithm produces the
1440         same results when it's run consecutively several times, we need to
1441         clear these override sizes and perform a layout of the affected grid
1442         items. Otherwise, the affected items will return sizing values which
1443         depend on the override values set in the previous layout, which in
1444         some cases, like orthogonal flows, may change through different runs
1445         of the sizing algorithm.
1446
1447         Test: fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html
1448
1449         * rendering/RenderGrid.cpp:
1450         (WebCore::RenderGrid::layoutBlock):
1451
1452 2016-10-18  Youenn Fablet  <youenn@apple.com>
1453
1454         CachedResourceLoader should not need to remove fragment identifier
1455         https://bugs.webkit.org/show_bug.cgi?id=163015
1456
1457         Reviewed by Darin Adler.
1458
1459         No expected change for non-window port.
1460         For window port, CachedResourceLoader will strip the fragment identifier of the URL passed to subresourceForURL
1461         before querying the memory cache.
1462
1463         Removing the fragment identifier from the request stored in CachedResourceRequest.
1464         The fragment identifier is stored in a separate field.
1465
1466         This allows CachedResourceLoader to not care about fragment identifier.
1467         CachedResource can then get access to it.
1468
1469         * loader/cache/CachedResource.cpp:
1470         (WebCore::CachedResource::CachedResource):
1471         (WebCore::CachedResource::finishRequestInitialization): Deleted.
1472         * loader/cache/CachedResource.h:
1473         * loader/cache/CachedResourceLoader.cpp:
1474         (WebCore::CachedResourceLoader::cachedResource):
1475         Updated the method taking a const String& to strip the fragment identifier if needed.
1476         Updated the method taking a const URL& to assert if the fragment identifier is present.
1477         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
1478         (WebCore::CachedResourceLoader::requestResource):
1479         * loader/cache/CachedResourceRequest.cpp:
1480         (WebCore::CachedResourceRequest::CachedResourceRequest):
1481         (WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL):
1482         * loader/cache/CachedResourceRequest.h:
1483         (WebCore::CachedResourceRequest::releaseFragmentIdentifier):
1484         (WebCore::CachedResourceRequest::clearFragmentIdentifier):
1485         * loader/cache/MemoryCache.cpp:
1486         (WebCore::MemoryCache::shouldRemoveFragmentIdentifier):
1487         (WebCore::MemoryCache::removeFragmentIdentifierIfNeeded):
1488         (WebCore::MemoryCache::revalidationSucceeded):
1489         (WebCore::MemoryCache::resourceForRequest):
1490         * loader/cache/MemoryCache.h:
1491
1492 2016-10-18  Antti Koivisto  <antti@apple.com>
1493
1494         Rename setNeedsStyleRecalc to invalidateStyle
1495         https://bugs.webkit.org/show_bug.cgi?id=163542
1496
1497         Reviewed by Darin Adler.
1498
1499         Also rename StyleChangeType enum and some related functions for clarity. For example
1500
1501             element.setNeedsStyleRecalc(SyntheticStyleChange);
1502
1503         becomes
1504
1505             element.invalidateStyleAndLayerComposition();
1506
1507         * WebCore.xcodeproj/project.pbxproj:
1508         * css/StyleInvalidationAnalysis.cpp:
1509         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
1510         * dom/Document.cpp:
1511         (WebCore::Document::recalcStyle):
1512         (WebCore::Document::updateViewportUnitsOnResize):
1513         (WebCore::Document::setCSSTarget):
1514         (WebCore::unwrapFullScreenRenderer):
1515         (WebCore::Document::setAnimatingFullScreen):
1516         * dom/Element.cpp:
1517         (WebCore::Element::setActive):
1518         (WebCore::Element::setFocus):
1519         (WebCore::Element::setHovered):
1520         (WebCore::Element::attributeChanged):
1521         (WebCore::Element::invalidateStyle):
1522         (WebCore::Element::invalidateStyleAndLayerComposition):
1523         (WebCore::Element::invalidateStyleForSubtree):
1524         (WebCore::Element::invalidateStyleAndRenderersForSubtree):
1525
1526             Move public invalidation functions to Element tightening typing.
1527             Use separate functions instead of enum values.
1528             This way the call sites look nicer and only useful combinations are exposed.
1529
1530         (WebCore::Element::addShadowRoot):
1531         (WebCore::checkForEmptyStyleChange):
1532         (WebCore::checkForSiblingStyleChanges):
1533         (WebCore::Element::needsStyleInvalidation):
1534         (WebCore::Element::setContainsFullScreenElement):
1535         * dom/Element.h:
1536         (WebCore::Element::setHasFocusWithin):
1537         * dom/Node.cpp:
1538         (WebCore::computeEditabilityFromComputedStyle):
1539         (WebCore::Node::adjustStyleValidity):
1540
1541             Update validity and mode separately. There was a potential bug here where
1542             SyntheticStyleChange could overwrite FullStyleChange (no known repro).
1543
1544         (WebCore::Node::updateAncestorsForStyleRecalc):
1545         (WebCore::Node::invalidateStyle):
1546         (WebCore::Node::insertedInto):
1547         (WebCore::Node::setNeedsStyleRecalc): Deleted.
1548         * dom/Node.h:
1549         (WebCore::Node::needsStyleRecalc):
1550         (WebCore::Node::styleValidity):
1551         (WebCore::Node::styleResolutionShouldRecompositeLayer):
1552         (WebCore::Node::setHasValidStyle):
1553         (WebCore::Node::styleChangeType): Deleted.
1554         (WebCore::Node::clearNeedsStyleRecalc): Deleted.
1555         (WebCore::Node::setStyleChange): Deleted.
1556         * dom/RadioButtonGroups.cpp:
1557         (WebCore::RadioButtonGroup::remove):
1558         (WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
1559         * dom/ShadowRoot.cpp:
1560         (WebCore::ShadowRoot::setResetStyleInheritance):
1561         * dom/SlotAssignment.cpp:
1562         (WebCore::SlotAssignment::addSlotElementByName):
1563         (WebCore::SlotAssignment::removeSlotElementByName):
1564         (WebCore::SlotAssignment::didChangeSlot):
1565         * dom/StyledElement.cpp:
1566         (WebCore::StyledElement::attributeChanged):
1567         (WebCore::StyledElement::styleAttributeChanged):
1568         (WebCore::StyledElement::invalidateStyleAttribute):
1569         * dom/Text.cpp:
1570         (WebCore::Text::updateRendererAfterContentChange):
1571         * dom/VisitedLinkState.cpp:
1572         (WebCore::VisitedLinkState::invalidateStyleForAllLinks):
1573         (WebCore::VisitedLinkState::invalidateStyleForLink):
1574         * editing/FrameSelection.cpp:
1575         (WebCore::FrameSelection::focusedOrActiveStateChanged):
1576         * html/BaseDateAndTimeInputType.cpp:
1577         (WebCore::BaseDateAndTimeInputType::minOrMaxAttributeChanged):
1578         * html/FileInputType.cpp:
1579         (WebCore::FileInputType::setValue):
1580         * html/HTMLAnchorElement.cpp:
1581         (WebCore::HTMLAnchorElement::parseAttribute):
1582         * html/HTMLBodyElement.cpp:
1583         (WebCore::HTMLBodyElement::parseAttribute):
1584         * html/HTMLCanvasElement.cpp:
1585         (WebCore::HTMLCanvasElement::getContext):
1586         (WebCore::HTMLCanvasElement::createImageBuffer):
1587         * html/HTMLElement.cpp:
1588         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
1589         (WebCore::HTMLElement::calculateAndAdjustDirectionality):
1590         * html/HTMLFieldSetElement.cpp:
1591         (WebCore::HTMLFieldSetElement::addInvalidDescendant):
1592         (WebCore::HTMLFieldSetElement::removeInvalidDescendant):
1593         * html/HTMLFormControlElement.cpp:
1594         (WebCore::HTMLFormControlElement::disabledStateChanged):
1595         (WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
1596         (WebCore::HTMLFormControlElement::requiredAttributeChanged):
1597         (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
1598         (WebCore::HTMLFormControlElement::updateValidity):
1599         * html/HTMLFormElement.cpp:
1600         (WebCore::HTMLFormElement::registerFormElement):
1601         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
1602         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
1603         (WebCore::HTMLFormElement::resetDefaultButton):
1604         * html/HTMLFrameElementBase.cpp:
1605         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree):
1606         * html/HTMLFrameOwnerElement.cpp:
1607         (WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition):
1608         (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Deleted.
1609         * html/HTMLFrameOwnerElement.h:
1610         * html/HTMLFrameSetElement.cpp:
1611         (WebCore::HTMLFrameSetElement::parseAttribute):
1612         (WebCore::HTMLFrameSetElement::willRecalcStyle):
1613         * html/HTMLInputElement.cpp:
1614         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
1615         (WebCore::HTMLInputElement::parseAttribute):
1616         (WebCore::HTMLInputElement::setChecked):
1617         (WebCore::HTMLInputElement::setIndeterminate):
1618         (WebCore::HTMLInputElement::setAutoFilled):
1619         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
1620         (WebCore::HTMLInputElement::minLengthAttributeChanged):
1621         * html/HTMLLinkElement.cpp:
1622         (WebCore::HTMLLinkElement::parseAttribute):
1623         * html/HTMLMediaElement.cpp:
1624         (WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged):
1625         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
1626         * html/HTMLObjectElement.cpp:
1627         (WebCore::HTMLObjectElement::parseAttribute):
1628         (WebCore::HTMLObjectElement::childrenChanged):
1629         (WebCore::HTMLObjectElement::renderFallbackContent):
1630         * html/HTMLOptGroupElement.cpp:
1631         (WebCore::HTMLOptGroupElement::parseAttribute):
1632         * html/HTMLOptionElement.cpp:
1633         (WebCore::HTMLOptionElement::parseAttribute):
1634         (WebCore::HTMLOptionElement::setSelectedState):
1635         * html/HTMLPlugInElement.cpp:
1636         (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
1637         * html/HTMLPlugInImageElement.cpp:
1638         (WebCore::HTMLPlugInImageElement::setDisplayState):
1639         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
1640         (WebCore::HTMLPlugInImageElement::finishParsingChildren):
1641         (WebCore::HTMLPlugInImageElement::resumeFromDocumentSuspension):
1642         (WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired):
1643         (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
1644         * html/HTMLProgressElement.cpp:
1645         (WebCore::HTMLProgressElement::didElementStateChange):
1646         * html/HTMLSelectElement.cpp:
1647         (WebCore::HTMLSelectElement::parseAttribute):
1648         (WebCore::HTMLSelectElement::setRecalcListItems):
1649         (WebCore::HTMLSelectElement::parseMultipleAttribute):
1650         (WebCore::HTMLSelectElement::reset):
1651         * html/HTMLTableElement.cpp:
1652         (WebCore::isTableCellAncestor):
1653         (WebCore::setTableCellsChanged):
1654         (WebCore::HTMLTableElement::parseAttribute):
1655         * html/HTMLTextAreaElement.cpp:
1656         (WebCore::HTMLTextAreaElement::setValueCommon):
1657         * html/HTMLTextFormControlElement.cpp:
1658         (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
1659         * html/InputType.cpp:
1660         (WebCore::InputType::setValue):
1661         * html/NumberInputType.cpp:
1662         (WebCore::NumberInputType::minOrMaxAttributeChanged):
1663         * html/TextFieldInputType.cpp:
1664         (WebCore::TextFieldInputType::subtreeHasChanged):
1665         * mathml/MathMLElement.cpp:
1666         (WebCore::MathMLElement::parseAttribute):
1667         * mathml/MathMLSelectElement.cpp:
1668         (WebCore::MathMLSelectElement::updateSelectedChild):
1669         * page/animation/AnimationBase.cpp:
1670         (WebCore::AnimationBase::setNeedsStyleRecalc):
1671         * page/animation/AnimationController.cpp:
1672         (WebCore::AnimationControllerPrivate::clear):
1673         (WebCore::AnimationControllerPrivate::updateAnimations):
1674         (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
1675         (WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
1676         (WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
1677         (WebCore::AnimationController::cancelAnimations):
1678         * rendering/RenderImage.cpp:
1679         (WebCore::RenderImage::imageChanged):
1680         * rendering/RenderLayer.cpp:
1681         (WebCore::RenderLayer::calculateClipRects):
1682         * rendering/RenderLayerCompositor.cpp:
1683         (WebCore::RenderLayerCompositor::attachRootLayer):
1684         (WebCore::RenderLayerCompositor::detachRootLayer):
1685         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
1686         * rendering/RenderObject.cpp:
1687         (WebCore::RenderObject::updateDragState):
1688         * rendering/svg/SVGResourcesCache.cpp:
1689         (WebCore::SVGResourcesCache::clientStyleChanged):
1690         * style/AttributeChangeInvalidation.cpp:
1691         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
1692         * style/ClassChangeInvalidation.cpp:
1693         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
1694         * style/IdChangeInvalidation.cpp:
1695         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
1696         * style/RenderTreeUpdater.cpp:
1697         (WebCore::RenderTreeUpdater::updateElementRenderer):
1698         * style/StyleScope.cpp:
1699         (WebCore::Style::Scope::updateActiveStyleSheets):
1700         * style/StyleTreeResolver.cpp:
1701         (WebCore::Style::resetStyleForNonRenderedDescendants):
1702         (WebCore::Style::TreeResolver::resolveElement):
1703         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1704         (WebCore::Style::TreeResolver::popParent):
1705         (WebCore::Style::clearNeedsStyleResolution):
1706         (WebCore::Style::TreeResolver::resolveComposedTree):
1707         * style/StyleUpdate.h:
1708         * style/StyleValidity.h: Added.
1709
1710             StyleChangeType enum splits into Style::Validity and Style::InvalidationMode.
1711             Move to a file of its own.
1712
1713         * svg/SVGAElement.cpp:
1714         (WebCore::SVGAElement::svgAttributeChanged):
1715         * svg/SVGAnimateElementBase.cpp:
1716         (WebCore::applyCSSPropertyToTarget):
1717         (WebCore::removeCSSPropertyFromTarget):
1718         * svg/SVGElement.cpp:
1719         (WebCore::SVGElement::willRecalcStyle):
1720         * svg/SVGElement.h:
1721         (WebCore::SVGElement::invalidateSVGPresentationAttributeStyle):
1722         * svg/SVGTests.cpp:
1723         (WebCore::SVGTests::handleAttributeChange):
1724         * svg/SVGUseElement.cpp:
1725         (WebCore::SVGUseElement::invalidateShadowTree):
1726         * testing/Internals.cpp:
1727         (WebCore::styleValidityToToString):
1728         (WebCore::Internals::styleChangeType):
1729         (WebCore::styleChangeTypeToString): Deleted.
1730
1731 2016-10-17  Sergio Villar Senin  <svillar@igalia.com>
1732
1733         [css-grid] Constrain by min|max-height on auto repeat computation
1734         https://bugs.webkit.org/show_bug.cgi?id=163540
1735
1736         Reviewed by Darin Adler.
1737
1738         The max-height (if definite) is used to compute the number of auto repeat rows whenever the
1739         height is indefinite. We were using the min-height only in case both values were indefinite.
1740
1741         Although not explicitly mentioned by grid specs, it's reasonable to assume that
1742         the min-height trumps the used value of height/max-height like it always does, per CSS
1743         2.2. Note that the number of rows still needs to fit within that size even if using
1744         min-height, because we're just using min-height to compute the used value of the height
1745         property. If both height and max-height are indefinite we keep doing the same, i.e., compute
1746         the minimum number of rows that fulfill min-height (if definite).
1747
1748         * rendering/RenderGrid.cpp:
1749         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
1750
1751 2016-10-17  Yusuke Suzuki  <utatane.tea@gmail.com>
1752
1753         [DOMJIT] Use NativeCallFrameTracer for operations used for DOMJIT slow calls
1754         https://bugs.webkit.org/show_bug.cgi?id=163586
1755
1756         Reviewed by Saam Barati.
1757
1758         * domjit/JSNodeDOMJIT.cpp:
1759         (WebCore::toWrapperSlow):
1760
1761 2016-10-18  Ryuan Choi  <ryuan.choi@navercorp.com>
1762
1763         [EFL] Build break since r207442
1764         https://bugs.webkit.org/show_bug.cgi?id=163587
1765
1766         Unreviewed.
1767
1768         Since r207442, setRGB is moved to private.
1769
1770         * rendering/RenderThemeEfl.cpp:
1771         (WebCore::fillColorsFromEdjeClass):
1772
1773 2016-10-17  Dean Jackson  <dino@apple.com>
1774
1775         Remove dependency cycle with UIKit
1776         https://bugs.webkit.org/show_bug.cgi?id=163577
1777         <rdar://problem/28786160>
1778
1779         Reviewed by Tim Horton.
1780
1781         Soft link against UIKit.
1782
1783         * Configurations/WebCoreTestSupport.xcconfig:
1784         * testing/Internals.mm:
1785
1786 2016-10-17  Dean Jackson  <dino@apple.com>
1787
1788         Allow creation of ExtendedColors and make Color immutable
1789         https://bugs.webkit.org/show_bug.cgi?id=163557
1790         <rdar://problem/28805360>
1791
1792         Reviewed by Darin Adler and Dave Hyatt.
1793
1794         1. Support the creation of ExtendedColor objects via the
1795         Color class.
1796
1797         2. Fix the remaining few places where a Color object is
1798         modified after creation, instead creating a new Color.
1799         Move all the mutation methods into the private section,
1800         making Color now immutable.
1801
1802         Changes to Color are covered by existing tests. Changes
1803         to ExtendedColor are covered by the ExtendedColor API test.
1804
1805         * css/parser/CSSParser.cpp:
1806         (WebCore::CSSParser::fastParseColor): Return a new named Color.
1807
1808         * dom/Document.cpp:
1809         (WebCore::Document::resetActiveLinkColor): Set to be the named "red" color.
1810
1811         * html/HTMLElement.cpp:
1812         (WebCore::HTMLElement::addHTMLColorToStyle): Use the string-based constructor
1813         where possible.
1814
1815         * page/CaptionUserPreferencesMediaAF.cpp:
1816         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): No need to
1817         use the string "black" here - we have a constant value.
1818
1819         * platform/graphics/cairo/GraphicsContextCairo.cpp: Don't use setRGB.
1820
1821         * platform/graphics/Color.cpp:
1822         (WebCore::findNamedColor): Move this up in the file.
1823         (WebCore::Color::Color): Copy in the code from setNamedColor. Also
1824         add a constructor for ExtendedColor.
1825         (WebCore::Color::serialized): Call ExtendedColor's serializer if necessary.
1826         (WebCore::Color::cssText): Ditto.
1827         (WebCore::Color::setNamedColor): Deleted.
1828         (WebCore::Color::tagAsExtended): Deleted.
1829
1830         * platform/graphics/Color.h: Add a new constructor.
1831         (WebCore::Color::setRGB): Move to private.
1832
1833         * platform/graphics/ExtendedColor.cpp:
1834         (WebCore::ExtendedColor::cssText): Implement serializer.
1835         * platform/graphics/ExtendedColor.h:
1836
1837         * rendering/style/RenderStyle.cpp:
1838         (WebCore::RenderStyle::colorIncludingFallback): Construct a new Color rather than changing an existing object.
1839
1840 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
1841
1842         Implement DOMRect/DOMRectReadOnly
1843         https://bugs.webkit.org/show_bug.cgi?id=163464
1844
1845         Reviewed by Darin Adler.
1846         
1847         Implement the DOMRectInit/DOMRectReadOnly/DOMRect interfaces specified in
1848         https://dev.w3.org/fxtf/geometry/
1849         
1850         DOMRects allow negative height/width and require double storage, so we can't just
1851         use FloatRect for storage. They also require handling of NaN and Infinity.
1852         
1853         To have the left/right/top/bottom accessors follow IEEE NaN rules, we need to use
1854         custom min/max functions that return NaN if either argument is NaN, so add 
1855         nanPropagatingMin/nanPropagatingMax helpers to MathExtras.h.
1856
1857         Test: fast/dom/domrect.html
1858
1859         * CMakeLists.txt:
1860         * DerivedSources.make:
1861         * WebCore.xcodeproj/project.pbxproj:
1862         * dom/DOMRect.h: Added.
1863         (WebCore::DOMRect::create):
1864         (WebCore::DOMRect::fromRect):
1865         (WebCore::DOMRect::setX):
1866         (WebCore::DOMRect::setY):
1867         (WebCore::DOMRect::setWidth):
1868         (WebCore::DOMRect::setHeight):
1869         (WebCore::DOMRect::DOMRect):
1870         * dom/DOMRect.idl: Added.
1871         * dom/DOMRectInit.h: Added.
1872         * dom/DOMRectInit.idl: Added.
1873         * dom/DOMRectReadOnly.h: Added.
1874         (WebCore::DOMRectReadOnly::create):
1875         (WebCore::DOMRectReadOnly::fromRect):
1876         (WebCore::DOMRectReadOnly::x):
1877         (WebCore::DOMRectReadOnly::y):
1878         (WebCore::DOMRectReadOnly::width):
1879         (WebCore::DOMRectReadOnly::height):
1880         (WebCore::DOMRectReadOnly::top):
1881         (WebCore::DOMRectReadOnly::right):
1882         (WebCore::DOMRectReadOnly::bottom):
1883         (WebCore::DOMRectReadOnly::left):
1884         (WebCore::DOMRectReadOnly::DOMRectReadOnly):
1885         * dom/DOMRectReadOnly.idl: Added.
1886
1887 2016-10-17  Antoine Quint  <graouts@apple.com>
1888
1889         [Modern Media Controls] Basic MediaController
1890         https://bugs.webkit.org/show_bug.cgi?id=163539
1891         <rdar://problem/28797542>
1892
1893         Reviewed by Darin Adler.
1894
1895         We add a new main.js file which acts as the entry point by implementing the createControls()
1896         function that HTMLMediaElement::ensureMediaControlsInjectedScript() once the shadow root has
1897         been created. That functions creates an instance of the new MediaController class, which is
1898         the controller object that will handle communication between the media controls and the media
1899         element. At first, this MediaController class is very limited and assumes macOS inline
1900         layout traits and forces a start button to be shown over the media, which can be played
1901         to start the media and show the full controls. More functionality will be added by future patches.
1902
1903         Tests: media/modern-media-controls/media-controller/media-controller-click-to-start.html
1904                media/modern-media-controls/media-controller/media-controller-constructor.html
1905                media/modern-media-controls/media-controller/media-controller-resize.html
1906
1907         * Modules/modern-media-controls/main.js: Added.
1908         (createControls):
1909         * Modules/modern-media-controls/media/media-controller.js: Added.
1910         (MediaController):
1911         (MediaController.prototype.set pageScaleFactor):
1912         (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
1913         (MediaController.prototype.handleEvent):
1914         (MediaController.prototype.buttonWasClicked):
1915         (MediaController.prototype._updateControlsSize):
1916         * WebCore.xcodeproj/project.pbxproj:
1917         * rendering/RenderThemeMac.mm:
1918         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
1919         (WebCore::RenderThemeMac::mediaControlsScript):
1920
1921 2016-10-17  Anders Carlsson  <andersca@apple.com>
1922
1923         Remove an unused HistoryItem function
1924         https://bugs.webkit.org/show_bug.cgi?id=163565
1925
1926         Reviewed by Tim Horton.
1927
1928         * history/HistoryItem.cpp:
1929         (WebCore::HistoryItem::isAncestorOf): Deleted.
1930         * history/HistoryItem.h:
1931
1932 2016-10-17  Nan Wang  <n_wang@apple.com>
1933
1934         AX: [Mac] mapping for output elements
1935         https://bugs.webkit.org/show_bug.cgi?id=163471
1936
1937         Reviewed by Chris Fleizach.
1938
1939         Mapped the output element to status role and exposed its text content
1940         as AXTitle. 
1941
1942         Test: accessibility/mac/output-element.html
1943
1944         * English.lproj/Localizable.strings:
1945         * accessibility/AccessibilityNodeObject.cpp:
1946         (WebCore::AccessibilityNodeObject::visibleText):
1947         * accessibility/AccessibilityObject.cpp:
1948         (WebCore::AccessibilityObject::isOutput):
1949         * accessibility/AccessibilityObject.h:
1950         * accessibility/AccessibilityRenderObject.cpp:
1951         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1952         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1953         (-[WebAccessibilityObjectWrapper roleDescription]):
1954         * platform/LocalizedStrings.cpp:
1955         (WebCore::AXOutputText):
1956         * platform/LocalizedStrings.h:
1957         * platform/efl/LocalizedStringsEfl.cpp:
1958         (WebCore::AXOutputText):
1959         * platform/gtk/LocalizedStringsGtk.cpp:
1960         (WebCore::AXOutputText):
1961
1962 2016-10-17  Yusuke Suzuki  <utatane.tea@gmail.com>
1963
1964         [DOMJIT] Use DOMJIT::Patchpoint in IC
1965         https://bugs.webkit.org/show_bug.cgi?id=163223
1966
1967         Reviewed by Saam Barati.
1968
1969         Make DOMJITPatchpointParams non-const.
1970
1971         * domjit/DOMJITHelpers.h:
1972         (WebCore::DOMJITHelpers::toWrapper):
1973         * domjit/JSNodeDOMJIT.cpp:
1974         (WebCore::createCallDOMForOffsetAccess):
1975         (WebCore::checkNode):
1976         (WebCore::NodeNodeTypeDOMJIT::callDOM):
1977
1978 2016-10-17  Chris Dumez  <cdumez@apple.com>
1979
1980         Move form.reportValidity() behind InteractiveFormValidation setting
1981         https://bugs.webkit.org/show_bug.cgi?id=163550
1982
1983         Reviewed by Darin Adler.
1984
1985         Move form.reportValidity() behind InteractiveFormValidation setting for consistency
1986         given that the two features are strongly related.
1987
1988         Also enable the setting by default so we can get feedback on the implementation.
1989
1990         Demos:
1991         - Interactive form validation: http://jsfiddle.net/tj_vantoll/HdSqt/
1992         - Report validity: https://googlechrome.github.io/samples/report-validity/
1993
1994         * bindings/generic/RuntimeEnabledFeatures.h:
1995         (WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
1996         (WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):
1997         * html/HTMLButtonElement.idl:
1998         * html/HTMLFieldSetElement.idl:
1999         * html/HTMLFormElement.idl:
2000         * html/HTMLInputElement.idl:
2001         * html/HTMLKeygenElement.idl:
2002         * html/HTMLObjectElement.idl:
2003         * html/HTMLOutputElement.idl:
2004         * html/HTMLSelectElement.idl:
2005         * html/HTMLTextAreaElement.idl:
2006
2007 2016-10-17  Antoine Quint  <graouts@apple.com>
2008
2009         [Modern Media Controls] Add a MediaControlsHost API to retrieve images as base64
2010         https://bugs.webkit.org/show_bug.cgi?id=163502
2011         <rdar://problem/28792017>
2012
2013         Reviewed by Darin Adler.
2014
2015         Add a new `base64StringForIconAndPlatform()` method to MediaControlsHost such that we
2016         may load images from the modern-media-controls directory in the WebCore.framework bundle.
2017         We use this new method in the iconService singleton when a `mediaControlsHost` is set,
2018         which will be set in a later patch.
2019
2020         * Modules/mediacontrols/MediaControlsHost.cpp:
2021         (WebCore::MediaControlsHost::base64StringForIconAndPlatform):
2022         * Modules/mediacontrols/MediaControlsHost.h:
2023         * Modules/mediacontrols/MediaControlsHost.idl:
2024         * Modules/modern-media-controls/controls/icon-service.js:
2025         (const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
2026         (const.iconService.new.IconService):
2027         * rendering/RenderTheme.h:
2028         (WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform):
2029         (WebCore::RenderTheme::mediaControlsScript): Deleted.
2030         * rendering/RenderThemeMac.h:
2031         * rendering/RenderThemeMac.mm:
2032         (WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform):
2033
2034 2016-10-17  Antoine Quint  <graouts@apple.com>
2035
2036         [Modern Media Controls] Add a MediaControlsHost API to retrieve the shadow root CSS
2037         https://bugs.webkit.org/show_bug.cgi?id=163501
2038         <rdar://problem/28792014>
2039
2040         Reviewed by Darin Adler.
2041
2042         Add a new `shadowRootCSSText` property to MediaControlsHost so that we may obtain the
2043         concatenated CSS sources for the media controls shadow root via JS. Actually using this
2044         API will be done in a later patch. We also no longer inject those styles as a user-agent
2045         stylesheet when the runtime flag is on since it will no longer be necessary.
2046
2047         * Modules/mediacontrols/MediaControlsHost.cpp:
2048         (WebCore::MediaControlsHost::shadowRootCSSText):
2049         * Modules/mediacontrols/MediaControlsHost.h:
2050         * Modules/mediacontrols/MediaControlsHost.idl:
2051         * css/CSSDefaultStyleSheets.cpp:
2052         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
2053
2054 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
2055
2056         Implement DOMPoint/DOMPointReadOnly
2057         https://bugs.webkit.org/show_bug.cgi?id=133916
2058
2059         Reviewed by Darin Adler.
2060
2061         Patch mostly by Dirk Schultz <krit@webkit.org>.
2062
2063         Implement DOMPoint/DOMPointReadOnly following https://drafts.fxtf.org/geometry/
2064         (although we may need to match https://www.w3.org/TR/geometry-1/ to be compatible
2065         with Chrome).
2066         
2067         Test: geometry/DOMPoint-001.html
2068
2069         * CMakeLists.txt:
2070         * DerivedSources.make:
2071         * WebCore.xcodeproj/project.pbxproj:
2072         * dom/DOMPoint.h: Added.
2073         * dom/DOMPoint.idl: Added.
2074         * dom/DOMPointInit.h: Added.
2075         * dom/DOMPointInit.idl: Added.
2076         * dom/DOMPointReadOnly.h: Added.
2077         (WebCore::DOMPointReadOnly::create):
2078         (WebCore::DOMPointReadOnly::fromPoint):
2079         (WebCore::DOMPointReadOnly::x):
2080         (WebCore::DOMPointReadOnly::y):
2081         (WebCore::DOMPointReadOnly::z):
2082         (WebCore::DOMPointReadOnly::w):
2083         (WebCore::DOMPointReadOnly::DOMPointReadOnly):
2084         * dom/DOMPointReadOnly.idl: Added.
2085
2086 2016-10-17  Antoine Quint  <graouts@apple.com>
2087
2088         [Modern Media Controls] Use modern-media-controls module sources for media controls stylesheet and script injection
2089         https://bugs.webkit.org/show_bug.cgi?id=163500
2090         <rdar://problem/28792010>
2091
2092         Reviewed by Darin Adler.
2093
2094         Add files from the Modules/modern-media-controls directory to the Xcode project and add a copy phase
2095         to copy those files with their directory stucture as a subdirectory of the WebCore.framework Resources
2096         directory.
2097
2098         Additionally, use the modern-media-controls Module CSS and JS files when concatenating the media controls
2099         scripts and styles in RenderTheme when the runtime flag is on.
2100
2101         * WebCore.xcodeproj/project.pbxproj:
2102         * rendering/RenderThemeMac.mm:
2103         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
2104         (WebCore::RenderThemeMac::mediaControlsScript):
2105
2106 2016-10-17  Simon Fraser  <simon.fraser@apple.com>
2107
2108         Fix typo in error message.
2109
2110         * bindings/scripts/CodeGeneratorJS.pm:
2111         (GenerateSerializerFunction):
2112
2113 2016-10-17  Fujii Hironori  <Hironori.Fujii@sony.com>
2114
2115         preprocessor.pm: cl.exe outputs processing filenames if Windows Perl is used
2116         https://bugs.webkit.org/show_bug.cgi?id=163435
2117
2118         Reviewed by Alex Christensen.
2119
2120         cl.exe outputs processing filenames to stderr. Suppress this
2121         annoying messages by using open3 instead of open2.
2122
2123         * bindings/scripts/preprocessor.pm:
2124         (applyPreprocessor): Use open3 in case of Windows Perl.
2125
2126 2016-10-17  Mark Lam  <mark.lam@apple.com>
2127
2128         Use the reject() helper function for conditionally throwing TypeErrors.
2129         https://bugs.webkit.org/show_bug.cgi?id=163491
2130
2131         Reviewed by Filip Pizlo.
2132
2133         No new tests because this patch does not introduce new behavior.
2134
2135         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2136         (WebCore::createRsaKeyGenParams):
2137         * bindings/js/JSIDBDatabaseCustom.cpp:
2138         (WebCore::JSIDBDatabase::createObjectStore):
2139         * bridge/c/c_instance.cpp:
2140         (JSC::Bindings::CInstance::invokeMethod):
2141
2142 2016-10-17  Miguel Gomez  <magomez@igalia.com>
2143
2144         [GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
2145         https://bugs.webkit.org/show_bug.cgi?id=163511
2146
2147         Reviewed by Carlos Garcia Campos.
2148
2149         Perform the video repaint in the main thread when accelerated compositing is disabled.
2150
2151         Covered by existent tests.
2152
2153         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2154         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2155         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
2156         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2157         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2158
2159 2016-10-17  Konstantin Tokarev  <annulen@yandex.ru>
2160
2161         Eleminate code duplication between ResourceRequest encoding/decoding implementations
2162         https://bugs.webkit.org/show_bug.cgi?id=163507
2163
2164         Reviewed by Carlos Garcia Campos.
2165
2166         ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
2167         ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
2168         ditto for decoding implementations.
2169
2170         No new tests needed.
2171
2172         * platform/network/ResourceRequestBase.h:
2173         (WebCore::ResourceRequestBase::encodeBase):
2174         (WebCore::ResourceRequestBase::decodeBase):
2175         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
2176         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
2177         * platform/network/soup/ResourceRequest.h:
2178         (WebCore::ResourceRequest::encodeWithPlatformData):
2179         (WebCore::ResourceRequest::decodeWithPlatformData):
2180
2181 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2182
2183         Move user agent quirks to cross-platform location
2184         https://bugs.webkit.org/show_bug.cgi?id=163508
2185
2186         Reviewed by Carlos Garcia Campos.
2187
2188         Tested by Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp.
2189
2190         * PlatformGTK.cmake:
2191         * platform/UserAgent.h: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.h.
2192         * platform/UserAgentQuirks.cpp: Added. Moved from UserAgentGtk.cpp.
2193         (WebCore::urlRequiresChromeBrowser): Sneakily tighten up Google domain detection, it should
2194         only apply to sites if the base domain matches google.*, not any base domain that starts
2195         with google.
2196         (WebCore::urlRequiresMacintoshPlatform):
2197         (WebCore::UserAgentQuirks::quirksForURL):
2198         (WebCore::UserAgentQuirks::stringForQuirk):
2199         * platform/UserAgentQuirks.h: Moved from UserAgentGtk.cpp. prepare-ChangeLog thinks it was
2200         renamed from Source/WebCore/platform/efl/UserAgentEfl.h, but prepare-ChangeLog is dumb.
2201         (WebCore::UserAgentQuirks::UserAgentQuirks):
2202         (WebCore::UserAgentQuirks::add):
2203         (WebCore::UserAgentQuirks::contains):
2204         (WebCore::UserAgentQuirks::isEmpty):
2205         * platform/efl/UserAgentEfl.cpp:
2206         (WebCore::standardUserAgentForURL):
2207         * platform/gtk/UserAgentGtk.cpp:
2208         (WebCore::buildUserAgentString):
2209         (WebCore::standardUserAgentForURL):
2210         (): Deleted.
2211         (WebCore::UserAgentQuirks::UserAgentQuirks): Deleted.
2212         (WebCore::UserAgentQuirks::add): Deleted.
2213         (WebCore::UserAgentQuirks::contains): Deleted.
2214         (WebCore::UserAgentQuirks::isEmpty): Deleted.
2215         (WebCore::urlRequiresChromeBrowser): Deleted.
2216         (WebCore::urlRequiresMacintoshPlatform): Deleted.
2217
2218 2016-10-17  Alberto Garcia  <berto@igalia.com>
2219
2220         [GTK] gobject-introspection on package build with webkit2gtk fails without active X session
2221         https://bugs.webkit.org/show_bug.cgi?id=163105
2222
2223         Reviewed by Carlos Garcia Campos.
2224
2225         Don't call XCompositeQueryExtension() or XDamageQueryExtension()
2226         if m_display is NULL.
2227
2228         * platform/graphics/x11/PlatformDisplayX11.cpp:
2229         (WebCore::PlatformDisplayX11::supportsXComposite):
2230         (WebCore::PlatformDisplayX11::supportsXDamage):
2231
2232 2016-10-16  Nan Wang  <n_wang@apple.com>
2233
2234         AX: [Mac] roleDescription for AXTextField input types
2235         https://bugs.webkit.org/show_bug.cgi?id=163419
2236         <rdar://problem/28766192>
2237
2238         Reviewed by Darin Adler.
2239
2240         Provided more detailed role description for input types that
2241         exposed as standard text fields on the mac.
2242
2243         Changes are covered in modified test expectation.
2244
2245         * English.lproj/Localizable.strings:
2246         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2247         (-[WebAccessibilityObjectWrapper roleDescription]):
2248         * platform/LocalizedStrings.cpp:
2249         (WebCore::AXEmailFieldText):
2250         (WebCore::AXTelephoneFieldText):
2251         (WebCore::AXURLFieldText):
2252         (WebCore::AXDateFieldText):
2253         (WebCore::AXTimeFieldText):
2254         * platform/LocalizedStrings.h:
2255         * platform/efl/LocalizedStringsEfl.cpp:
2256         (WebCore::AXEmailFieldText):
2257         (WebCore::AXTelephoneFieldText):
2258         (WebCore::AXURLFieldText):
2259         (WebCore::AXDateFieldText):
2260         (WebCore::AXTimeFieldText):
2261         * platform/gtk/LocalizedStringsGtk.cpp:
2262         (WebCore::AXEmailFieldText):
2263         (WebCore::AXTelephoneFieldText):
2264         (WebCore::AXURLFieldText):
2265         (WebCore::AXDateFieldText):
2266         (WebCore::AXTimeFieldText):
2267
2268 2016-10-16  Chris Dumez  <cdumez@apple.com>
2269
2270         Update WebKit localizable strings
2271         https://bugs.webkit.org/show_bug.cgi?id=163513
2272
2273         Reviewed by Dan Bernstein.
2274
2275         Update WebKit localizable strings as it was missing the "too short" one needed
2276         by form validation. This was causing a "Localized string not found" message to
2277         be shown when testing the following sample on WebKit ToT:
2278         - https://googlechrome.github.io/samples/report-validity/
2279
2280         * English.lproj/Localizable.strings:
2281
2282 2016-10-16  Chris Dumez  <cdumez@apple.com>
2283
2284         REGRESSION (r206750): Crash when pressing Caps Lock if “Use the Caps Lock key to switch to and from U.S.” is selected in Input Sources preferences
2285         https://bugs.webkit.org/show_bug.cgi?id=163506
2286         <rdar://problem/28792483>
2287
2288         Reviewed by Darin Adler.
2289
2290         As per the NSEvent documentation [1], calling [NSEvent characters] is only
2291         valid on key up / key down events and will raise an NSInternalInconsistencyException
2292         if accessed on any other kind of event object. The crash happens when keyForKeyEvent()
2293         is called with the third kind of key event (NSFlagsChanged) which is used for
2294         detecting modifier keys. We normally detect the modifier key and return early before
2295         calling [NSEvent characters]. However, in some rare cases, we fail to detect the
2296         modifier key and we fall through.
2297
2298         To address the issue, we now return "Unidentified" for NSFlagsChanged events, if we
2299         fail to detect the modifier key and before calling [NSEvent characters].
2300
2301         [1] https://developer.apple.com/reference/appkit/nsevent/1534183-characters
2302
2303         No new test, not easily testable.
2304
2305         * platform/mac/PlatformEventFactoryMac.mm:
2306         (WebCore::keyForKeyEvent):
2307
2308 2016-10-16  Darin Adler  <darin@apple.com>
2309
2310         Move CSS classes from ExceptionCode to Exception
2311         https://bugs.webkit.org/show_bug.cgi?id=163494
2312
2313         Reviewed by Sam Weinig.
2314
2315         Removed the "get" prefix from the names of many CSSPrimitiveValue
2316         functions to match WebKit coding style and to disambiguate them
2317         from the public CSS DOM functions that raise exceptions.
2318
2319         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2320         (WebCore::propertyNamePrefix): Use enum class.
2321         (WebCore::parseJavaScriptCSSPropertyName): Tweak style a bit.
2322         (WebCore::stylePropertyGetter): Refactor to simplify structure.
2323         (WebCore::stylePropertyGetterPixelOrPosPrefix): Ditto. Also use floatValue.
2324         (WebCore::JSCSSStyleDeclaration::putDelegate): Use findIgnoringASCIICase,
2325         and use propagateException to handle ExcpetionOr.
2326         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Tweak style a bit.
2327         (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Use a lambda to
2328         initialize a global here.
2329
2330         * bindings/js/JSDOMBinding.h: Added toJSString to support bindings for
2331         functions returning ExceptionOr<String>.
2332
2333         * bindings/scripts/gobject-generate-headers.pl: Deleted.
2334
2335         * css/BasicShapeFunctions.cpp:
2336         (WebCore::convertToLengthSize): Use pairValue.
2337         (WebCore::convertToCenterCoordinate): Use valueID and pairValue.
2338         (WebCore::cssValueToBasicShapeRadius): Ditto.
2339         * css/CSSBasicShapes.cpp:
2340         (WebCore::serializePositionOffset): Ditto.
2341         (WebCore::buildSerializablePositionOffset): Ditto.
2342         (WebCore::CSSBasicShapeCircle::cssText): Ditto.
2343         (WebCore::CSSBasicShapeEllipse::cssText): Ditto.
2344         (WebCore::updateCornerRadiusWidthAndHeight): Ditto.
2345         * css/CSSBorderImageSliceValue.h: Use quadValue.
2346         * css/CSSCalculationValue.cpp:
2347         (WebCore::determineCategory): Use floatValue and doubleValue.
2348
2349         * css/CSSCharsetRule.h: Use ExceptionOr. Also made more things private.
2350         * css/CSSCharsetRule.idl: Use non-legacy exceptions.
2351
2352         * css/CSSComputedStyleDeclaration.cpp:
2353         (WebCore::CSSComputedStyleDeclaration::setCssText): Use ExceptionOr.
2354         (WebCore::ComputedStyleExtractor::propertyMatches): Use valueID.
2355         (WebCore::CSSComputedStyleDeclaration::setProperty): Use ExceptionOr.
2356         (WebCore::CSSComputedStyleDeclaration::removeProperty): Ditto.
2357         (WebCore::CSSComputedStyleDeclaration::setPropertyInternal): Ditto.
2358         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue): Return
2359         a Ref instead of a RefPtr.
2360         * css/CSSComputedStyleDeclaration.h: Updated for above changes.
2361
2362         * css/CSSCrossfadeValue.cpp:
2363         (WebCore::CSSCrossfadeValue::fixedSize): Use floatValue.
2364         (WebCore::CSSCrossfadeValue::image): Ditto.
2365         (WebCore::CSSCrossfadeValue::blend): Use doubleValue.
2366
2367         * css/CSSFontFace.cpp:
2368         (WebCore::CSSFontFace::calculateStyleMask): Use valueID.
2369         (WebCore::CSSFontFace::calculateWeightMask): Ditto.
2370         * css/CSSFontFaceSet.cpp:
2371         (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
2372         (WebCore::CSSFontFaceSet::matchingFaces): Use ExceptoinOr.
2373         (WebCore::CSSFontFaceSet::check): Ditto.
2374         * css/CSSFontFaceSet.h: Updated for above changes.
2375
2376         * css/CSSGradientValue.cpp:
2377         (WebCore::compareStops): Use doubleValue.
2378         (WebCore::CSSGradientValue::addStops): Use floatValue.
2379         (WebCore::positionFromValue): Use floatValue and valudID.
2380         (WebCore::CSSLinearGradientValue::customCSSText): Use doubleValue and valueID.
2381         (WebCore::CSSLinearGradientValue::createGradient): Use floatValue and valueID.
2382         (WebCore::CSSRadialGradientValue::customCSSText): Use doubleValue and valueID.
2383         (WebCore::CSSRadialGradientValue::resolveRadius): Use floatValue.
2384         (WebCore::CSSRadialGradientValue::createGradient): Use valueID.
2385
2386         * css/CSSGroupingRule.cpp:
2387         (WebCore::CSSGroupingRule::insertRule): Use ExceptionOr.
2388         (WebCore::CSSGroupingRule::deleteRule): Ditto.
2389         * css/CSSGroupingRule.h: Updated for above changes.
2390
2391         * css/CSSImageGeneratorValue.cpp:
2392         (WebCore::CSSImageGeneratorValue::subimageIsPending): Use valueID.
2393         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): Ditto.
2394
2395         * css/CSSImageSetValue.cpp:
2396         (WebCore::CSSImageSetValue::fillImageSet): Use floatValue.
2397
2398         * css/CSSMediaRule.idl: Use non-legacy exceptions.
2399
2400         * css/CSSPrimitiveValue.cpp:
2401         (WebCore::CSSPrimitiveValue::computeDegrees): Use doubleValue.
2402         (WebCore::CSSPrimitiveValue::setFloatValue): Use ExceptionOr.
2403         (WebCore::CSSPrimitiveValue::getFloatValue): Replaced getDoubleValue with this,
2404         since getDoubleValue is unused, moving the call to clampTo into this function.
2405         Also changed this to use ExceptionOr.
2406         (WebCore::CSSPrimitiveValue::doubleValue): Renamed from getDoubleValue.
2407         (WebCore::CSSPrimitiveValue::doubleValueInternal): Use Optional instead of a bool
2408         and an out argument to return the value and check for type failure.
2409         (WebCore::CSSPrimitiveValue::setStringValue): Use ExceptionOr.
2410         (WebCore::CSSPrimitiveValue::getStringValue): Ditto.
2411         (WebCore::CSSPrimitiveValue::stringValue): Renamed from getStringValue.
2412         (WebCore::CSSPrimitiveValue::getCounterValue): Use ExceptionOr.
2413         (WebCore::CSSPrimitiveValue::getRectValue): Use ExceptionOr.
2414         (WebCore::CSSPrimitiveValue::getQuadValue): Deleted.
2415         (WebCore::CSSPrimitiveValue::getLengthRepeatValue): Deleted.
2416         (WebCore::CSSPrimitiveValue::getRGBColorValue): Use ExceptionOr.
2417         (WebCore::CSSPrimitiveValue::getPairValue): Deleted.
2418         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use new names for functions.
2419         * css/CSSPrimitiveValue.h: Reorganized the class, moved large inline function bodies
2420         out of the class definition. Updated for the above changes.
2421         * css/CSSPrimitiveValue.idl: Use non-legacy exceptions.
2422
2423         * css/CSSPrimitiveValueMappings.h: Use value instead of getValue, etc.
2424
2425         * css/CSSRule.cpp:
2426         (WebCore::CSSRule::setCssText): Use ExceptionOr.
2427         * css/CSSRule.h: Updated for above change.
2428         * css/CSSRule.idl: Use non-legacy exceptions.
2429
2430         * css/CSSStyleDeclaration.h: Use ExceptionOr.
2431         * css/CSSStyleDeclaration.idl: Use non-legacy exceptions.
2432
2433         * css/CSSStyleSheet.cpp:
2434         (WebCore::CSSStyleSheet::deprecatedInsertRule): Use ExceptionOr.
2435         (WebCore::CSSStyleSheet::insertRule): Ditto.
2436         (WebCore::CSSStyleSheet::deleteRule): Ditto.
2437         (WebCore::CSSStyleSheet::addRule): Ditto.
2438         * css/CSSStyleSheet.h: Updated for the above changes.
2439         * css/CSSStyleSheet.idl: Use non-legacy exceptions.
2440
2441         * css/CSSSupportsRule.idl: Use non-legacy exceptions.
2442
2443         * css/CSSToStyleMap.cpp:
2444         (WebCore::CSSToStyleMap::mapFillAttachment): Use valueID instead of getValueID, etc.
2445         (WebCore::convertToLengthSize): Ditto.
2446         (WebCore::CSSToStyleMap::mapFillSize): Ditto.
2447         (WebCore::CSSToStyleMap::mapFillXPosition): Ditto.
2448         (WebCore::CSSToStyleMap::mapFillYPosition): Ditto.
2449         (WebCore::CSSToStyleMap::mapFillMaskSourceType): Ditto.
2450         (WebCore::CSSToStyleMap::mapAnimationDirection): Ditto.
2451         (WebCore::CSSToStyleMap::mapAnimationFillMode): Ditto.
2452         (WebCore::CSSToStyleMap::mapAnimationIterationCount): Ditto.
2453         (WebCore::CSSToStyleMap::mapAnimationName): Ditto.
2454         (WebCore::CSSToStyleMap::mapAnimationPlayState): Ditto.
2455         (WebCore::CSSToStyleMap::mapAnimationProperty): Ditto.
2456         (WebCore::CSSToStyleMap::mapAnimationTimingFunction): Ditto.
2457         (WebCore::CSSToStyleMap::mapAnimationTrigger): Ditto.
2458         (WebCore::CSSToStyleMap::mapNinePieceImageSlice): Ditto.
2459         (WebCore::CSSToStyleMap::mapNinePieceImageQuad): Ditto.
2460         (WebCore::CSSToStyleMap::mapNinePieceImageRepeat): Ditto.
2461
2462         * css/CSSValue.h: Use ExceptionOr.
2463         * css/CSSValue.idl: Use non-legacy exceptions.
2464
2465         * css/Counter.h: Use stringValue instead of getStringValue, etc.
2466
2467         * css/FontFace.cpp:
2468         (WebCore::FontFace::create): Use ExceptionOr.
2469         (WebCore::FontFace::setFamily): Ditto.
2470         (WebCore::FontFace::setStyle): Ditto.
2471         (WebCore::FontFace::setWeight): Ditto.
2472         (WebCore::FontFace::setStretch): Ditto.
2473         (WebCore::FontFace::setUnicodeRange): Ditto.
2474         (WebCore::FontFace::setVariant): Ditto.
2475         (WebCore::FontFace::setFeatureSettings): Ditto.
2476         * css/FontFace.h: Updated for above changes.
2477         * css/FontFace.idl: Use non-legacy exceptions.
2478
2479         * css/FontFaceSet.cpp:
2480         (WebCore::FontFaceSet::load): Use ExceptionOr.
2481         (WebCore::FontFaceSet::check): Ditto.
2482         * css/FontFaceSet.h: Updated for above changes.
2483         * css/FontFaceSet.idl: Use non-legacy exceptions.
2484
2485         * css/FontVariantBuilder.cpp:
2486         (WebCore::extractFontVariantLigatures): Use valueID instead of getValueID, etc.
2487         (WebCore::extractFontVariantNumeric): Ditto.
2488         (WebCore::extractFontVariantEastAsian): Ditto.
2489
2490         * css/MediaList.cpp:
2491         (WebCore::MediaList::setMediaText): Use ExceptionOr.
2492         (WebCore::MediaList::deleteMedium): Ditto.
2493         (WebCore::MediaList::appendMedium): Ditto.
2494         * css/MediaList.h: Updated for above changes.
2495         * css/MediaList.idl: Use non-legacy exceptions.
2496
2497         * css/MediaQueryEvaluator.cpp:
2498         (WebCore::doubleValue): Use valueID instead of getValueID, etc.
2499         (WebCore::colorGamutEvaluate): Ditto.
2500         (WebCore::invertedColorsEvaluate): Ditto.
2501         (WebCore::orientationEvaluate): Ditto.
2502         (WebCore::evaluateResolution): Ditto.
2503         (WebCore::computeLength): Ditto.
2504         (WebCore::viewModeEvaluate): Ditto.
2505         (WebCore::hoverEvaluate): Ditto.
2506         (WebCore::pointerEvaluate): Ditto.
2507         (WebCore::prefersReducedMotionEvaluate): Ditto.
2508
2509         * css/PropertySetCSSStyleDeclaration.cpp:
2510         (WebCore::PropertySetCSSStyleDeclaration::setCssText): Use ExceptionOr.
2511         (WebCore::PropertySetCSSStyleDeclaration::setProperty): Ditto.
2512         (WebCore::PropertySetCSSStyleDeclaration::removeProperty): Ditto.
2513         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal): Ditto.
2514         (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal): Ditto.
2515         * css/PropertySetCSSStyleDeclaration.h: Updated for above changes.
2516         Also marked a couple additional functions private.
2517
2518         * css/StyleBuilderConverter.h: Use doubleValue instead of getDoubleValue, etc.
2519         * css/StyleBuilderCustom.h: Ditto.
2520         * css/StyleProperties.cpp:
2521         (WebCore::StyleProperties::getLayeredShorthandValue): Ditto.
2522         * css/StyleResolver.cpp:
2523         (WebCore::StyleResolver::MatchResult::addMatchedProperties): Ditto.
2524         (WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement): Ditto.
2525         (WebCore::StyleResolver::colorFromPrimitiveValue): Ditto.
2526         (WebCore::StyleResolver::createFilterOperations): Ditto.
2527         * css/TransformFunctions.cpp:
2528         (WebCore::transformsForValue): Ditto.
2529         * css/ViewportStyleResolver.cpp:
2530         (WebCore::ViewportStyleResolver::getViewportArgumentValue): Ditto.
2531
2532         * css/WebKitCSSMatrix.cpp:
2533         (WebCore::WebKitCSSMatrix::WebKitCSSMatrix): Tweaked constructors a bit,
2534         getting rid of the one that uses an ExceptionCode.
2535         (WebCore::WebKitCSSMatrix::create): Moved in here, and use ExceptionOr.
2536         (WebCore::WebKitCSSMatrix::setMatrixValue): Use ExceptionOr.
2537         (WebCore::WebKitCSSMatrix::multiply): Tweak coding style a bit.
2538         (WebCore::WebKitCSSMatrix::inverse): Use ExceptionOr.
2539         (WebCore::WebKitCSSMatrix::translate): Return a Ref instead of RefPtr.
2540         (WebCore::WebKitCSSMatrix::scale): Ditto.
2541         (WebCore::WebKitCSSMatrix::rotate): Ditto.
2542         (WebCore::WebKitCSSMatrix::rotateAxisAngle): Ditto.
2543         (WebCore::WebKitCSSMatrix::skewX): Ditto.
2544         (WebCore::WebKitCSSMatrix::skewY): Ditto.
2545         (WebCore::WebKitCSSMatrix::toString): Tweaked formatting a bit.
2546         * css/WebKitCSSMatrix.h: Updated for above changes.
2547         * css/WebKitCSSMatrix.idl: Use non-legacy extensions.
2548
2549         * css/makeprop.pl:
2550         (handleCurrentColorValue): Use valueID instead of getValueID.
2551         (generateValueSetter): Ditto.
2552
2553         * css/parser/CSSParser.cpp:
2554         (WebCore::CSSParser::parse4ValuesFillPosition): Use valueID instead of getValueID, etc.
2555         (WebCore::CSSParser::parse3ValuesFillPosition): Ditto.
2556         (WebCore::CSSParser::parseFillPosition): Ditto.
2557         (WebCore::CSSParser::parseFillRepeat): Ditto.
2558         (WebCore::CSSParser::parseGridPosition): Ditto.
2559         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): Ditto.
2560         (WebCore::isGridTrackFixedSized): Ditto.
2561         (WebCore::CSSParser::parseRadialGradient): Ditto.
2562         (WebCore::CSSParser::parseBuiltinFilterArguments): Ditto.
2563
2564         * css/parser/CSSParserValues.cpp:
2565         (WebCore::CSSParserValue::createCSSValue): Removed the unneeded call to
2566         setPrimitiveType here. The createParserOperator returns an object that
2567         already has the correct primitive type.
2568
2569         * css/parser/CSSPropertyParser.cpp: Updated most cases of calling the old
2570         getXXXValue functions, but not sure if it's right since it is commented out
2571         code that I did not compile.
2572
2573         * css/parser/CSSPropertyParserHelpers.cpp:
2574         (WebCore::CSSPropertyParserHelpers::clampRGBComponent): Use intValue instead of getIntValue, etc.
2575         (WebCore::CSSPropertyParserHelpers::parseHSLParameters): Ditto.
2576         (WebCore::CSSPropertyParserHelpers::isHorizontalPositionKeywordOnly): Ditto.
2577         (WebCore::CSSPropertyParserHelpers::isVerticalPositionKeywordOnly): Ditto.
2578         (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues): Ditto.
2579         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient): Ditto.
2580
2581         * dom/Range.cpp: Added now-needed include of ExceptionCode.h.
2582         * dom/SelectorQuery.cpp: Ditto.
2583
2584         * editing/ApplyStyleCommand.cpp:
2585         (WebCore::toIdentifier): Use valueID instead of getValueID, etc.
2586         (WebCore::ApplyStyleCommand::computedFontSize): Ditto.
2587         * editing/EditingStyle.cpp:
2588         (WebCore::identifierForStyleProperty): Ditto.
2589         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle): Ditto.
2590         (WebCore::EditingStyle::extractFontSizeDelta): Ditto.
2591         (WebCore::EditingStyle::textDirection): Ditto.
2592         (WebCore::EditingStyle::prepareToApplyAt): Ditto.
2593         (WebCore::EditingStyle::textDirectionForSelection): Ditto.
2594         (WebCore::fontWeightIsBold): Ditto.
2595         (WebCore::legacyFontSizeFromCSSValue): Ditto.
2596         (WebCore::isTransparentColorValue): Ditto.
2597         (WebCore::hasTransparentBackgroundColor): Ditto.
2598         (WebCore::backgroundColorInEffect): Ditto.
2599
2600         * editing/Editor.cpp:
2601         (WebCore::Editor::applyEditingStyleToElement): Removed IGNORE_EXCEPTION; that is
2602         what we do by default for things returning ExceptionOr.
2603         * editing/RemoveCSSPropertyCommand.cpp:
2604         (WebCore::RemoveCSSPropertyCommand::doApply): Ditto.
2605         (WebCore::RemoveCSSPropertyCommand::doUnapply): Ditto.
2606         * editing/ReplaceSelectionCommand.cpp:
2607         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): Ditto.
2608
2609         * editing/cocoa/HTMLConverter.mm:
2610         (floatValueFromPrimitiveValue): Use floatValue instead of getFloatValue, etc.
2611         * editing/markup.cpp:
2612         (WebCore::propertyMissingOrEqualToNone): Ditto.
2613
2614         * inspector/InspectorStyleSheet.cpp:
2615         (WebCore::InspectorStyleSheet::addRule): Updated to call ExceptionOr-returning functions.
2616         (WebCore::InspectorStyleSheet::deleteRule): Ditto.
2617         (WebCore::InspectorStyleSheet::setStyleText): Ditto.
2618
2619         * svg/SVGLength.cpp:
2620         (WebCore::SVGLength::fromCSSPrimitiveValue): Use floatValue instead of getFloatValue.
2621
2622 2016-10-16  Antoine Quint  <graouts@apple.com>
2623
2624         [Modern Media Controls] Styles for StartButton are missing
2625         https://bugs.webkit.org/show_bug.cgi?id=163499
2626         <rdar://problem/28792009>
2627
2628         Reviewed by Darin Adler.
2629
2630         Add styling for StartButton so that instances are always displayed in the center of their container.
2631
2632         Test: media/modern-media-controls/start-button/start-button-styles.html
2633
2634         * Modules/modern-media-controls/controls/start-button.css: Added.
2635         (button.start):
2636         (button.start > *):
2637         (button.start > div):
2638         (button.start > img):
2639         (button.start:active > img):
2640
2641 2016-10-16  Simon Fraser  <simon.fraser@apple.com>
2642
2643         Implement serializer = { attribute }
2644         https://bugs.webkit.org/show_bug.cgi?id=163466
2645         
2646         Follow-up fix to die if "serializer {...}" lists an attribute not present
2647         on the interface. I don't think this is testable with the current bindings tests.
2648
2649         * bindings/scripts/CodeGeneratorJS.pm:
2650         (GenerateSerializerFunction):
2651
2652 2016-10-16  Simon Fraser  <simon.fraser@apple.com>
2653
2654         Add the "Geometry Interfaces" to features.json.
2655
2656         * features.json:
2657
2658 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2659
2660         Document request not updated after willSendRequest is called for a redirect
2661         https://bugs.webkit.org/show_bug.cgi?id=163436
2662
2663         Reviewed by Michael Catanzaro.
2664
2665         The first willSendRequest happens before DocumentLoader::startLoadingMainResource(), that calls setRequest, but
2666         the second one happens after DocumentLoader::redirectReceived() and then the request is never updated again.
2667
2668         Covered by GTK+ unit tests.
2669
2670         * loader/DocumentLoader.cpp:
2671         (WebCore::DocumentLoader::willContinueMainResourceLoadAfterRedirect): Set the new request.
2672         * loader/DocumentLoader.h:
2673         * loader/SubresourceLoader.cpp:
2674         (WebCore::SubresourceLoader::willSendRequestInternal): Notify the document loader when loading the main resource
2675         and called for a redirection.
2676
2677 2016-10-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
2678
2679         Delete the animated image catchup code
2680         https://bugs.webkit.org/show_bug.cgi?id=163410
2681
2682         Reviewed by Simon Fraser.
2683
2684         This patch fixes two issues in the animated image workflow:
2685
2686         1) Setting the animation timer should follow the following rules:
2687         
2688             -- Initial case: Which happens before drawing the first frame. We
2689             should set the timer to fire after the current_frame_duration.
2690
2691             -- Late case (Slow animation): This happens if the current_time is
2692             past the next_frame_desired_time. In this case we should fire the
2693             timer immediately.
2694
2695             -- Early case (Fast animation): This happens when there is still time
2696             before the next_frame_desired_time. In this case we should set the
2697             timer to fire after the difference between the next_frame_desired_time
2698             and the current_time.
2699
2700         2) Deleting the code for catching up the current_frame:
2701         
2702             This code used to run in the slow animation case. It was never used
2703             on iOS. It was trying to adjust the current_frame according to the
2704             current_time as if there were no delay. It turned out that this might
2705             cause a bigger delay because most likely the decoder decodes the image
2706             frames incrementally; i.e. to decode frame k, it has to have frame
2707             (k - 1) decoded.
2708
2709         Test: fast/images/ordered-animated-image-frames.html
2710
2711         * platform/graphics/BitmapImage.cpp:
2712         (WebCore::BitmapImage::draw): Remove the iOS specific code.
2713         (WebCore::BitmapImage::startAnimation): Move the animation finishing code from 
2714         BitmapImage::internalAdvanceAnimation() to this function. Simplify the timer
2715         duration code as it is described above.
2716
2717         (WebCore::BitmapImage::advanceAnimation): Merge BitmapImage::internalAdvanceAnimation()
2718         into this function.
2719
2720         (WebCore::BitmapImage::resetAnimation):
2721         
2722         (WebCore::BitmapImage::internalAdvanceAnimation): Deleted.
2723         * platform/graphics/BitmapImage.h:
2724
2725         * platform/graphics/Image.cpp:
2726         (WebCore::Image::drawTiled):
2727         * platform/graphics/Image.h:
2728         (WebCore::Image::startAnimation):
2729         * svg/graphics/SVGImage.cpp:
2730         (WebCore::SVGImage::startAnimation):
2731         * svg/graphics/SVGImage.h:
2732         Remove the catchup code form the Image and SVGImage classes.
2733
2734 2016-10-15  Darin Adler  <darin@apple.com>
2735
2736         Move Web SQL database and WebSockets off legacy exceptions
2737         https://bugs.webkit.org/show_bug.cgi?id=163284
2738
2739         Reviewed by Chris Dumez.
2740
2741         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2742         (WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr.
2743         * Modules/webdatabase/DOMWindowWebDatabase.h: Update for above.
2744         * Modules/webdatabase/DOMWindowWebDatabase.idl: Ditto.
2745
2746         * Modules/webdatabase/SQLResultSet.cpp:
2747         (WebCore::SQLResultSet::SQLResultSet): Move initialization of
2748         many data members into the class definition.
2749         (WebCore::SQLResultSet::insertId): Use ExceptionOr.
2750         (WebCore::SQLResultSet::rowsAffected): Moved into class definition.
2751         (WebCore::SQLResultSet::rows): Ditto.
2752         (WebCore::SQLResultSet::setInsertId): Ditto.
2753         (WebCore::SQLResultSet::setRowsAffected): Ditto.
2754
2755         * Modules/webdatabase/SQLResultSet.h: Updated for above.
2756
2757         * Modules/webdatabase/SQLResultSet.idl: Use non-legacy exceptions.
2758         Added a FIXME about the mismatch between long and int64_t.
2759
2760         * Modules/webdatabase/SQLStatement.cpp:
2761         (WebCore::SQLStatement::execute): Use reference instead of pointer.
2762
2763         * Modules/websockets/WebSocket.cpp:
2764         (WebCore::isValidProtocolString): Use StringView.
2765         (WebCore::WebSocket::subprotocolSeparator): Fixed capitalization and
2766         spelling error in the name of this function.
2767         (WebCore::WebSocket::WebSocket): Move initialization of many data
2768         members into the class definition.
2769         (WebCore::WebSocket::create): Use ExceptionOr.
2770         (WebCore::WebSocket::connect): Ditto.
2771         (WebCore::WebSocket::send): Ditto.
2772         (WebCore::WebSocket::close): Ditto.
2773         (WebCore::WebSocket::binaryType): Update to use enum class.
2774         (WebCore::WebSocket::setBinaryType): Use ExecptionOr and update to
2775         use enum class.
2776         (WebCore::WebSocket::didReceiveBinaryData): Ditto.
2777
2778         * Modules/websockets/WebSocket.h: Updated for above. Changed the
2779         BinaryType enum into an enum class.
2780
2781         * Modules/websockets/WebSocket.idl: Use non-legacy exceptions.
2782
2783         * Modules/websockets/WebSocketHandshake.cpp:
2784         (WebCore::WebSocketHandshake::checkResponseHeaders):
2785         Updated for name change to subprotocolSeparator.
2786
2787         * dom/ExceptionOr.h: Added a constructor for scalar types that does not
2788         require an rvalue reference. We can refine this more later, but for now
2789         this is sufficient to obviate the need for WTFMove where it otherwise would
2790         have been needed in the code above.
2791
2792         * inspector/InspectorDatabaseAgent.cpp: Use reference instead of pointer.
2793
2794         * page/DOMWindow.idl: Touched this file to work around bugs in the dependency
2795         analysis of the current CMake build system, since otherwise it doesn't process the
2796         change to the partial interface WebSocket. Edited lots of comments, removed many
2797         others, and tweaked formatting.
2798
2799 2016-10-14  Sam Weinig  <sam@webkit.org>
2800
2801         MessageEvent's source property should be a (DOMWindow or MessagePort)? rather than a EventTarget?
2802         https://bugs.webkit.org/show_bug.cgi?id=163475
2803
2804         Reviewed by Simon Fraser.
2805
2806         Start fleshing out union support, starting with MessageEvent.
2807         - Simplify things a bit for now by requiring interface types to use RefPtr<T> as their type when
2808           used in sequences and unions. We should revisit this later, and see if we can use Ref<T> where
2809           possible, but it causes complications for dictionaries, since they want a Ref<T> uninitialized.
2810
2811         * bindings/generic/IDLTypes.h:
2812         Switch IDLInterface to use RefPtr<T> as its implementation type.
2813
2814         * bindings/js/JSDOMConvert.h:
2815         (WebCore::Detail::VariadicConverterBase::convert):
2816         - Remove isJSDOMWrapperType() optimization. It was not correct, due to not being able to detect window
2817           and window shell, and not always an optimization, e.g. in the case of a single interface.
2818         - Switch from JSC::jsDynamicCast<WrapperType*>() to WrapperType::toWrapped() which can be faster and
2819           handles window and window shell correctly.
2820         - Also fix an issue where we would wrongly assert that one interface had to match.
2821
2822         * bindings/js/JSDOMWrapper.h:
2823         (WebCore::isJSDOMWrapperType): Deleted.
2824         Remove unused predicate.
2825
2826         * bindings/scripts/IDLParser.pm:
2827         (parseType):
2828         Add missing support for nullable unions.
2829
2830         * bindings/scripts/test/JS/JSTestObj.cpp:
2831         * bindings/scripts/test/TestObj.idl:
2832         Add new tests for unions (both non-null and nullable) in dictionaries.
2833  
2834         * dom/ContainerNode.cpp:
2835         (WebCore::ContainerNode::append):
2836         (WebCore::ContainerNode::prepend):
2837         * dom/ContainerNode.h:
2838         * dom/Node.cpp:
2839         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
2840         (WebCore::Node::convertNodesOrStringsIntoNode):
2841         (WebCore::Node::before):
2842         (WebCore::Node::after):
2843         (WebCore::Node::replaceWith):
2844         * dom/Node.h:
2845         Add using declaration for NodeOrString and change it to use RefPtr<Node>.
2846
2847         * bindings/js/JSMessageEventCustom.cpp:
2848         (WebCore::handleInitMessageEvent):
2849         * dom/MessageEvent.cpp:
2850         (WebCore::MessageEvent::MessageEvent):
2851         (WebCore::MessageEvent::create):
2852         (WebCore::MessageEvent::initMessageEvent):
2853         (WebCore::MessageEvent::source):
2854         (WebCore::isValidSource): Deleted.
2855         * dom/MessageEvent.h:
2856         * dom/MessageEvent.idl:
2857         * page/DOMWindow.cpp:
2858         (WebCore::PostMessageTimer::event):
2859         Change MessageEvent's source to be a std::experimental::variant<RefPtr<DOMWindow>, RefPtr<MessagePort>>.
2860         For now, we only enforce this on setting, and leave the getter a EventTarget?, but that should not be
2861         observable, and will rectified in subsequent patches.
2862
2863 2016-10-15  Chris Dumez  <cdumez@apple.com>
2864
2865         Add support for reportValidity() on form and form control elements
2866         https://bugs.webkit.org/show_bug.cgi?id=163479
2867
2868         Reviewed by Darin Adler.
2869
2870         Add support for reportValidity() on form and form control elements:
2871         - https://html.spec.whatwg.org/#dom-form-reportvalidity
2872         - https://html.spec.whatwg.org/#dom-cva-reportvalidity
2873
2874         Firefox and Chrome already support this.
2875
2876         Demo: https://googlechrome.github.io/samples/report-validity/
2877
2878         No new tests, rebaselined existing tests.
2879
2880         * html/HTMLButtonElement.idl:
2881         * html/HTMLFieldSetElement.idl:
2882         * html/HTMLFormElement.idl:
2883         * html/HTMLInputElement.idl:
2884         * html/HTMLKeygenElement.idl:
2885         * html/HTMLObjectElement.idl:
2886         * html/HTMLOutputElement.idl:
2887         * html/HTMLSelectElement.idl:
2888         * html/HTMLTextAreaElement.idl:
2889         Add reportValidity() operation.
2890
2891         * html/HTMLFormControlElement.cpp:
2892         (WebCore::HTMLFormControlElement::checkValidity):
2893
2894         (WebCore::HTMLFormControlElement::reportValidity):
2895         Add implementation for reportValidity() for form control elements.
2896         First, it calls checkValidity() and returns early if there is no
2897         constraint violation. if the JS canceled the 'invalid' event
2898         fired by checkValidity(), then return early as well, as per the
2899         specification. If the element is focusable, we scroll to it,
2900         focus it and show the validation message. Otherwise, we log a
2901         error message to the console. The last part of the behavior
2902         matches what we already did in HTMLFormElement::validateInteractively()
2903         and complies with the behavior in the specification.
2904
2905         (WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
2906         Add utility function to scroll to the form control element, focus
2907         it and show its validation message. This code was moved from
2908         HTMLFormElement::validateInteractively() so that it could be reused
2909         in HTMLFormControlElement::reportValidity().
2910
2911         * html/HTMLFormControlElement.h:
2912         * html/HTMLFormElement.cpp:
2913         (WebCore::HTMLFormElement::validateInteractively):
2914         Move the early abort checks to the existing call site (prepareForSubmission)
2915         so that we can reuse this method for reportValidity().
2916
2917         (WebCore::HTMLFormElement::prepareForSubmission):
2918         Only call validateInteractively() if we really should validate. Those checks
2919         used to be in validateInteractively() but I moved them here so we could more
2920         easily reuse validateInteractively().
2921
2922         (WebCore::HTMLFormElement::checkValidity):
2923         (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
2924         Update Vector type to be a Vector of HTMLFormControlElement given that we
2925         only add HTMLFormControlElement objects to it and that it results it simpler
2926         code.
2927
2928         (WebCore::HTMLFormElement::reportValidity):
2929         Add implementation for reportValidity() for form elements. The
2930         implementation calls our already existing validateInteractively()
2931         method, as per the specification.
2932
2933         * html/HTMLFormElement.h:
2934
2935         * html/HTMLObjectElement.h:
2936         reportValidity() returns true unconditionally for object elements,
2937         similarly to checkValidity().
2938
2939 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
2940
2941         Sort the project file.
2942
2943         * WebCore.xcodeproj/project.pbxproj:
2944
2945 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
2946
2947         Implement serializer = { attribute }
2948         https://bugs.webkit.org/show_bug.cgi?id=163466
2949
2950         Reviewed by Darin Adler.
2951
2952         Fix the code generator to generate code for serializer = { attribute }.
2953         In IDLParser, extend domSerializable with flags for the 'inherit', 'getter' and
2954         'attribute' values (the first two are still unsupported). Fix parseSerializationPattern()
2955         to detect these; it needs to create the domSerializable() now. Basic support
2956         for isSerializableAttribute() is added (primitive types only).
2957         
2958         GenerateSerializerFunction is fixed to output code for the serializable attributes
2959         in the order specified in "serializer = {}", as specified in WebIDL.
2960         
2961         Removed custom serialization for ClientRect and PerformanceTiming.
2962         
2963         Other minor cleanup to always get $interfaceName from $interface->name, and to fix
2964         ObjectConstructor.h to be included as <runtime/ObjectConstructor.h>.
2965
2966         * CMakeLists.txt:
2967         * WebCore.xcodeproj/project.pbxproj:
2968         * bindings/js/JSBindingsAllInOne.cpp:
2969         * bindings/js/JSClientRectCustom.cpp: Removed.
2970         * bindings/js/JSPerformanceTimingCustom.cpp: Removed.
2971         * bindings/scripts/CodeGeneratorJS.pm:
2972         (GenerateImplementation):
2973         (GenerateSerializerFunction):
2974         * bindings/scripts/IDLParser.pm:
2975         (parseSerializerRest):
2976         (parseSerializationPattern):
2977         (parseSerializationAttributes):
2978         (isSerializableAttribute):
2979         (applyMemberList):
2980         * bindings/scripts/test/JS/JSTestNode.cpp:
2981         * bindings/scripts/test/JS/JSTestObj.cpp:
2982         (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
2983         * bindings/scripts/test/JS/JSTestSerialization.cpp: Added.
2984         * bindings/scripts/test/JS/JSTestSerialization.h: Added.
2985         * bindings/scripts/test/TestObj.idl:
2986         * bindings/scripts/test/TestSerialization.idl: Copied from Source/WebCore/dom/ClientRect.idl.
2987         * dom/ClientRect.idl:
2988         * page/PerformanceTiming.idl:
2989
2990 2016-10-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2991
2992         [GTK] Restore user agent quirk for Yahoo
2993         https://bugs.webkit.org/show_bug.cgi?id=163481
2994
2995         Reviewed by Carlos Garcia Campos.
2996
2997         finance.yahoo.com is sending a mobile version in response to our standard user agent.
2998
2999         * platform/gtk/UserAgentGtk.cpp:
3000         (WebCore::urlRequiresMacintoshPlatform):
3001
3002 2016-10-15  Chris Dumez  <cdumez@apple.com>
3003
3004         Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError
3005         https://bugs.webkit.org/show_bug.cgi?id=163472
3006
3007         Reviewed by Sam Weinig.
3008
3009         Setting HTMLMediaElement.volume to NaN or Inf should throw a TypeError:
3010         - https://html.spec.whatwg.org/#dom-media-volume
3011
3012         This is because the attribute is of type double (not unrestricted double in the IDL).
3013
3014         Chrome and Firefox agree with the specification. WebKit throws an IndexSizeErr instead.
3015
3016         No new tests, rebaselined existing test.
3017
3018         * html/HTMLMediaElement.idl:
3019
3020 2016-10-15  Zalan Bujtas  <zalan@apple.com>
3021
3022         CounterNode::resetRenderers is so inefficient.
3023         https://bugs.webkit.org/show_bug.cgi?id=163480
3024
3025         Reviewed by Simon Fraser.
3026
3027         CounterNode::resetRenderers() removes all the associated renderers from this CounterNode
3028         and sets the dirty bit on them.
3029         This patch does all that in a loop, instead of traversing the linked tree on each removal.
3030
3031         No change in functionality.
3032
3033         * rendering/CounterNode.cpp:
3034         (WebCore::CounterNode::CounterNode):
3035         (WebCore::CounterNode::~CounterNode):
3036         (WebCore::CounterNode::nextInPreOrderAfterChildren):
3037         (WebCore::CounterNode::lastDescendant):
3038         (WebCore::CounterNode::addRenderer): These assertions do not seem super useful.
3039         (WebCore::CounterNode::removeRenderer):
3040         (WebCore::CounterNode::resetRenderers):
3041         (WebCore::CounterNode::insertAfter):
3042         (WebCore::CounterNode::removeChild):
3043         * rendering/CounterNode.h:
3044         * rendering/RenderCounter.cpp:
3045         (WebCore::makeCounterNode):
3046         (WebCore::RenderCounter::RenderCounter):
3047         (WebCore::RenderCounter::~RenderCounter):
3048         (WebCore::RenderCounter::originalText):
3049         (WebCore::updateCounters):
3050         (WebCore::RenderCounter::invalidate): Deleted.
3051         * rendering/RenderCounter.h:
3052
3053 2016-10-15  Antoine Quint  <graouts@apple.com>
3054
3055         [Modern Media Controls] macOS inline controls
3056         https://bugs.webkit.org/show_bug.cgi?id=163444
3057         <rdar://problem/27989473>
3058
3059         Reviewed by Dean Jackson.
3060
3061         Introducing the new MacOSMediaControls and MacOSInlineMediaControls classes. MacOSMediaControls is a MediaControls subclass
3062         that adds specific buttons to the macOS platform and sets the layout traits to be macOS. This class has a new subclass,
3063         MacOSInlineMediaControls, which sets the layout traits to also include inline and implements custom layout to drop
3064         controls as necessary as the width of the controls varies. It also shows the volume slider when the mute button is hovered.
3065         
3066         Tests: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html
3067                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-constructor.html
3068                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles.html
3069                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html
3070                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles.html
3071                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility.html
3072                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html
3073                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html
3074                media/modern-media-controls/macos-media-controls/macos-media-controls.html
3075
3076         * Modules/modern-media-controls/controls/macos-inline-media-controls.css: Added.
3077         (.media-controls.mac.inline > .controls-bar):
3078         (.media-controls.mac.inline > .controls-bar > *):
3079         (.media-controls.mac.inline button):
3080         (.media-controls.mac.inline button:active):
3081         (.media-controls.mac.inline > .controls-bar button):
3082         (.media-controls.mac.inline > .controls-bar,):
3083         (.media-controls.mac.inline button.play-pause):
3084         (.media-controls.mac.inline button.skip-back):
3085         (.media-controls.mac.inline .scrubber.slider):
3086         (.media-controls.mac.inline button.mute):
3087         (.media-controls.mac.inline button.airplay):
3088         (.media-controls.mac.inline button.pip):
3089         (.media-controls.mac.inline button.tracks):
3090         (.media-controls.mac.inline button.fullscreen):
3091         (.media-controls.mac.inline .time-label):
3092         (.media-controls.mac.inline .volume-slider-container):
3093         (.media-controls.mac.inline .volume-slider-container:before):
3094         (.media-controls.mac.inline .volume.slider):
3095         * Modules/modern-media-controls/controls/macos-inline-media-controls.js: Added.
3096         (MacOSInlineMediaControls.prototype.layout):
3097         (MacOSInlineMediaControls.prototype.handleEvent):
3098         * Modules/modern-media-controls/controls/macos-media-controls.js: Added.
3099         (MacOSMediaControls):
3100
3101 2016-10-14  Antti Koivisto  <antti@apple.com>
3102
3103         100% CPU on homedepot.com page
3104         https://bugs.webkit.org/show_bug.cgi?id=163452
3105         <rdar://problem/28730708>
3106
3107         Reviewed by Simon Fraser.
3108
3109         The site has a keyframe animation on body. Currently this causes the animation to invalidate the
3110         style of the entire document.
3111
3112         Animations use SyntheticStyleChange to invalidate elements when animation progresses and currently
3113         that causes full subtree invalidation. However animation only ever affect individual elements and
3114         the normal style resolution mechanism should be able to deal with things like inheritance as needed.
3115
3116         Test: fast/animation/animation-style-update-size.html
3117
3118         * dom/Document.cpp:
3119         (WebCore::Document::recalcStyle):
3120         * dom/Document.h:
3121         (WebCore::Document::lastStyleUpdateSizeForTesting):
3122
3123             Testing support.
3124
3125         * style/StyleTreeResolver.cpp:
3126         (WebCore::Style::TreeResolver::resolveElement):
3127
3128             Don't force subtree style resolution for SyntheticStyleChange.
3129
3130         * style/StyleUpdate.h:
3131         (WebCore::Style::Update::size):
3132         * testing/Internals.cpp:
3133         (WebCore::Internals::lastStyleUpdateSize):
3134         * testing/Internals.h:
3135         * testing/Internals.idl:
3136
3137 2016-10-14  Chris Dumez  <cdumez@apple.com>
3138
3139         Setting HTMLMediaElement.muted to the same value should not fire a volume change event
3140         https://bugs.webkit.org/show_bug.cgi?id=163474
3141
3142         Reviewed by Eric Carlson.
3143
3144         Setting HTMLMediaElement.muted to the same value should not fire a volume
3145         change event:
3146         - https://html.spec.whatwg.org/#dom-media-muted
3147
3148         Chrome and Firefox agree with the specification.
3149
3150         No new tests, rebaselined existing test.
3151
3152         * html/HTMLMediaElement.cpp:
3153         (WebCore::HTMLMediaElement::setMuted):
3154
3155 2016-10-14  Dean Jackson  <dino@apple.com>
3156
3157         Add Display P3 ColorSpace
3158         https://bugs.webkit.org/show_bug.cgi?id=162880
3159         <rdar://problem/28598564>
3160
3161         Reviewed by Sam Weinig.
3162
3163         Re-landing with a version that hopefully compiles on El Capitan.
3164
3165         Add a new ColorSpace for Display P3.
3166
3167         This will be tested once the Color class can create
3168         objects that reference other color spaces.
3169
3170         * platform/graphics/ColorSpace.h:
3171         * platform/graphics/cg/GraphicsContextCG.cpp:
3172         (WebCore::displayP3ColorSpaceRef):
3173         * platform/graphics/cg/GraphicsContextCG.h:
3174         (WebCore::cachedCGColorSpace):
3175
3176 2016-10-14  Brent Fulgham  <bfulgham@apple.com>
3177
3178         [Win][Direct2D] Minor cleanups
3179         https://bugs.webkit.org/show_bug.cgi?id=162953
3180
3181         Reviewed by Dean Jackson.
3182
3183         Code cleanup. No change in behavior.
3184
3185         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3186         (WebCore::ImageDecoder::frameIsCompleteAtIndex):
3187         (WebCore::ImageDecoder::frameBytesAtIndex):
3188
3189 2016-10-14  Alex Christensen  <achristensen@webkit.org>
3190
3191         Fix CMake build.
3192
3193         * PlatformMac.cmake:
3194
3195 2016-10-14  Anders Carlsson  <andersca@apple.com>
3196
3197         Pass on networking settings to the PKPaymentRequest
3198         https://bugs.webkit.org/show_bug.cgi?id=163462
3199         rdar://problem/28567629
3200
3201         Reviewed by Dan Bernstein.
3202
3203         Add new SPI.
3204
3205         * platform/spi/cocoa/PassKitSPI.h:
3206
3207 2016-10-14  Dean Jackson  <dino@apple.com>
3208
3209         CSS parsing should use Color not RGBA32
3210         https://bugs.webkit.org/show_bug.cgi?id=163423
3211         <rdar://problem/28766903>
3212
3213         Reviewed by Simon Fraser.
3214
3215         Re-landing this after it was rolled out in https://trac.webkit.org/r207342.
3216
3217         In order to allow CSS to use the ExtendedColor variant of
3218         Color, we need to stop using RGBA32. This is a fairly big
3219         change that goes through all the places in the parser
3220         related to colors, and moves them from RGBA32 to Color.
3221
3222         No change in functionality, so covered by existing tests.
3223
3224         * WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
3225
3226         * css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
3227         rather than an unsigned int for colors.
3228         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3229         (WebCore::CSSPrimitiveValue::cleanup):
3230         (WebCore::CSSPrimitiveValue::getRGBColorValue):
3231         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
3232         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
3233         (WebCore::CSSPrimitiveValue::equals):
3234         * css/CSSPrimitiveValue.h: Move to Color* and also use some
3235         nullptrs.
3236         * css/CSSPrimitiveValueMappings.h:
3237         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
3238         constructor.
3239
3240         * css/CSSValuePool.cpp: Move to Color.
3241         (WebCore::CSSValuePool::CSSValuePool):
3242         (WebCore::CSSValuePool::createColorValue):
3243         * css/CSSValuePool.h: Change the ColorValueCache to a new type.
3244
3245         * css/StyleResolver.cpp: Move to Color.
3246         (WebCore::StyleResolver::colorFromPrimitiveValue):
3247         * css/parser/CSSParser.cpp:
3248         (WebCore::parseColorValue):
3249         (WebCore::CSSParser::parseColor):
3250         (WebCore::CSSParser::parseColorFromString):
3251         (WebCore::CSSParser::parseSystemColor):
3252         (WebCore::fastParseColorInternal):
3253         (WebCore::CSSParser::fastParseColor):
3254         (WebCore::CSSParser::parseColorFromValue):
3255         * css/parser/CSSParser.h:
3256         * css/parser/CSSParserFastPaths.cpp:
3257         (WebCore::fastParseColorInternal):
3258         (WebCore::CSSParserFastPaths::parseColor):
3259         * css/parser/CSSPropertyParserHelpers.cpp:
3260         (WebCore::CSSPropertyParserHelpers::consumeColor):
3261         * css/parser/SVGCSSParser.cpp:
3262         (WebCore::CSSParser::parseSVGValue):
3263         (WebCore::CSSParser::parseSVGPaint):
3264         (WebCore::CSSParser::parseSVGColor):
3265         * editing/EditingStyle.cpp:
3266         (WebCore::cssValueToColor):
3267         (WebCore::textColorFromStyle):
3268         (WebCore::backgroundColorFromStyle):
3269         (WebCore::rgbaBackgroundColorInEffect):
3270         (WebCore::EditingStyle::prepareToApplyAt):
3271         (WebCore::isTransparentColorValue):
3272         (WebCore::cssValueToRGBA): Deleted.
3273         * editing/cocoa/HTMLConverter.mm:
3274         (HTMLConverterCaches::colorPropertyValueForNode):
3275         * html/HTMLBodyElement.cpp:
3276         (WebCore::HTMLBodyElement::parseAttribute):
3277         * html/canvas/CanvasGradient.cpp:
3278         (WebCore::CanvasGradient::addColorStop):
3279         * html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
3280         remind myself to come back when colorWithOverrideAlpha has been updated.
3281         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
3282         (WebCore::CanvasRenderingContext2D::setFillStyle):
3283         (WebCore::CanvasRenderingContext2D::setShadowColor):
3284         (WebCore::CanvasRenderingContext2D::setShadow):
3285         * html/canvas/CanvasStyle.cpp:
3286         (WebCore::isCurrentColorString):
3287         (WebCore::parseColor):
3288         (WebCore::currentColor):
3289         (WebCore::parseColorOrCurrentColor):
3290         (WebCore::CanvasStyle::createFromString):
3291         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
3292         * html/canvas/CanvasStyle.h:
3293         * svg/SVGColor.cpp:
3294         (WebCore::SVGColor::colorFromRGBColorString):
3295
3296         * platform/graphics/Color.h: Add new constructors for the special
3297         empty and deleted Color values used in HashTables.
3298         (WebCore::Color::Color):
3299         (WebCore::Color::isHashTableDeletedValue):
3300         (WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
3301
3302         * platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
3303         (WTF::ColorHash::hash):
3304         (WTF::ColorHash::equal):
3305         (WTF::HashTraits<WebCore::Color>::emptyValue):
3306         (WTF::HashTraits<WebCore::Color>::constructDeletedValue):
3307         (WTF::HashTraits<WebCore::Color>::isDeletedValue):
3308
3309 2016-10-14  Brent Fulgham  <bfulgham@apple.com>
3310
3311         [Win][Direct2D] Implement basic SVG support
3312         https://bugs.webkit.org/show_bug.cgi?id=163349
3313
3314         Reviewed by Brent Fulgham.
3315
3316         Direct2D needs access to the target graphics context when generating bitmap
3317         images so that it can properly match pixel format and other settings.
3318
3319         Add implementations for a number of drawing primitives used in the SVG
3320         test cases. Correct some differences between CG and Direct2D for drawing
3321         different primitives.
3322
3323         No new tests. Tested by existing 'svg' tests.
3324
3325         * platform/graphics/BitmapImage.cpp:
3326        (WebCore::BitmapImage::frameImageAtIndex): Take optional target graphics
3327        context. Also pass the graphics context to the image decoder.
3328        (WebCore::BitmapImage::nativeImage): Accept an optional target context.
3329        (WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
3330        (WebCore::BitmapImage::draw): Pass target graphics context to the
3331        'frameImageAtIndex' method.
3332         * platform/graphics/BitmapImage.h:
3333         * platform/graphics/Image.h:
3334         * platform/graphics/ImageBuffer.cpp:
3335         (WebCore::ImageBuffer::create): Moved from header. Add create function that
3336         takes an optional GraphicsContext argument.
3337         * platform/graphics/ImageBuffer.h:
3338         * platform/graphics/ImageFrameCache.cpp: Add missing include needed to build
3339         under Direct2D.
3340         * platform/graphics/ImageSource.cpp:
3341         (WebCore::ImageSource::setDecoderTargetContext): Added.
3342         (WebCore::ImageSource::setRenderTarget): Deleted.
3343         * platform/graphics/ImageSource.h:
3344         * platform/graphics/Pattern.h:
3345         * platform/graphics/win/GraphicsContextDirect2D.cpp:
3346         (WebCore::GraphicsContextPlatformPrivate::endDraw): Log error state instead of crashing
3347         each time.
3348         (WebCore::GraphicsContext::drawEllipse): Ellipses are defined in D2D as a center, an
3349         X-radius, and a Y-radius.
3350         (WebCore::GraphicsContext::applyStrokePattern):
3351         (WebCore::GraphicsContext::applyFillPattern):
3352         (WebCore::GraphicsContext::clearRect): Use 'Clear' function if possible. Don't clear
3353         anything if the clear rect is outside the drawing area.
3354         (WebCore::GraphicsContext::strokeRect): Provide implementation (needed by SVG).
3355         (WebCore::GraphicsContext::platformFillEllipse): Ellipses are defined in D2D as
3356         a center, an X-radius, and a Y-radius.
3357         (WebCore::GraphicsContext::platformStrokeEllipse): Ditto.
3358         * platform/graphics/win/ImageBufferDirect2D.cpp:
3359         (WebCore::ImageBuffer::createCompatibleBuffer): Accept optional GraphicsContext argument.
3360         (WebCore::ImageBuffer::ImageBuffer): Ditto.
3361         * platform/graphics/win/ImageDecoderDirect2D.cpp:
3362         (WebCore::ImageDecoder::setTargetContext): Renamed from 'setRenderTarget'.
3363         (WebCore::ImageDecoder::createFrameImageAtIndex): Take optional GraphicsContext argument.
3364         (WebCore::ImageDecoder::setRenderTarget): Deleted.
3365         * platform/graphics/win/ImageDecoderDirect2D.h:
3366         * platform/graphics/win/ImageDirect2D.cpp:
3367         (WebCore::BitmapImage::setRenderTarget): Deleted.
3368         * platform/graphics/win/NativeImageDirect2D.cpp: Add missing include.
3369         * platform/graphics/win/PatternDirect2D.cpp: 
3370         (WebCore::Pattern::createPlatformPattern): Revise for new signature.
3371         * rendering/FilterEffectRenderer.cpp:
3372         (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Pass GraphicsContext
3373         to ImageBuffer constructor.
3374         (WebCore::FilterEffectRendererHelper::beginFilterEffect): Pass target context to
3375         filter when allocating backing store.
3376         * rendering/FilterEffectRenderer.h: Add GraphicsContext as argument to constructor.
3377         * rendering/RenderLayer.cpp:
3378         (WebCore::RenderLayer::hasFilterThatIsPainting): Supply GraphicsContext argument when
3379         building new FilterEffectRenderer and helper.
3380         (WebCore::RenderLayer::setupFilters): Ditto.
3381         * svg/graphics/SVGImage.cpp:
3382         (WebCore::SVGImage::nativeImageForCurrentFrame): Revise to take optional GraphicsContext
3383         argument.
3384         (WebCore::SVGImage::nativeImage): Ditto.
3385         * svg/graphics/SVGImage.h:
3386         * svg/graphics/SVGImageForContainer.cpp:
3387         (WebCore::SVGImageForContainer::nativeImageForCurrentFrame): Ditto.
3388         * svg/graphics/SVGImageForContainer.h:
3389
3390 2016-10-14  Chris Dumez  <cdumez@apple.com>
3391
3392         Unreviewed, rolling out r207319.
3393
3394         Regressed Dromaeo and may have caused crashes under
3395         GuardMalloc (rdar://problem/28780835)
3396
3397         Reverted changeset:
3398
3399         "[Web IDL] Add support for [SameObject] extended attribute"
3400         https://bugs.webkit.org/show_bug.cgi?id=163414
3401         http://trac.webkit.org/changeset/207319
3402
3403 2016-10-14  Anders Carlsson  <andersca@apple.com>
3404
3405         Clean up BackForwardClient
3406         https://bugs.webkit.org/show_bug.cgi?id=163454
3407
3408         Reviewed by Sam Weinig.
3409
3410         Remove iOS specific member functions that are only used from WebKit.
3411
3412         * history/BackForwardClient.h:
3413         * loader/EmptyClients.cpp:
3414
3415 2016-10-13  Anders Carlsson  <andersca@apple.com>
3416
3417         Move BackForwardList from WebCore to WebKitLegacy
3418         https://bugs.webkit.org/show_bug.cgi?id=163418
3419
3420         Reviewed by Tim Horton.
3421
3422         * CMakeLists.txt:
3423         * WebCore.xcodeproj/project.pbxproj:
3424         * history/BackForwardController.cpp:
3425         (WebCore::BackForwardController::BackForwardController):
3426         * history/BackForwardController.h:
3427         * loader/EmptyClients.cpp:
3428         (WebCore::fillWithEmptyClients):
3429         * page/Page.cpp:
3430         (WebCore::Page::Page):
3431
3432 2016-10-14  Manuel Rego Casasnovas  <rego@igalia.com>
3433
3434         [css-grid] Changing the argument on fit-content() doesn't cause the grid to be relayout
3435         https://bugs.webkit.org/show_bug.cgi?id=163434
3436
3437         Reviewed by Sergio Villar Senin.
3438
3439         When fit-content() was implemented a new attribute
3440         m_fitContentTrackBreadth was added to GridTrackSize.
3441         However we forgot to include it in the == operator implementation,
3442         so we were missing the changes on that value.
3443
3444         Now if you change the argument of a fit-content() track,
3445         the track size is properly recomputed.
3446
3447         Test: fast/css-grid-layout/grid-change-fit-content-argument.html
3448
3449         * rendering/style/GridTrackSize.h:
3450         (WebCore::GridTrackSize::operator==): Check m_fitContentTrackBreadth.
3451
3452 2016-10-14  Commit Queue  <commit-queue@webkit.org>
3453
3454         Unreviewed, rolling out r207317.
3455         https://bugs.webkit.org/show_bug.cgi?id=163448
3456
3457         This change caused an existing LayoutTest to fail on all
3458         platforms (Requested by ryanhaddad on #webkit).
3459
3460         Reverted changeset:
3461
3462         "CSS parsing should use Color not RGBA32"
3463         https://bugs.webkit.org/show_bug.cgi?id=163423
3464         http://trac.webkit.org/changeset/207317
3465
3466 2016-10-14  Antti Koivisto  <antti@apple.com>
3467
3468         Share inline stylesheets between shadow trees
3469         https://bugs.webkit.org/show_bug.cgi?id=163353
3470
3471         Reviewed by Ryosuke Niwa and Andreas Kling.
3472
3473         If shadow trees have identical inline stylesheets the data structures can be shared.
3474         In future this will also allow sharing style resolvers.
3475
3476         * css/CSSStyleSheet.cpp:
3477         (WebCore::CSSStyleSheet::createInline):
3478
3479             Move StyleSheetContents construction to the client.
3480
3481         * css/parser/CSSParserMode.h:
3482         (WebCore::CSSParserContextHash::hash):
3483         (WebCore::CSSParserContextHash::equal):
3484         (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
3485         (WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue):
3486         (WTF::HashTraits<WebCore::CSSParserContext>::emptyValue):
3487
3488             Make CSSParserContext hashable.
3489
3490         * dom/ExtensionStyleSheets.cpp:
3491         (WebCore::createExtensionsStyleSheet):
3492         (WebCore::ExtensionStyleSheets::pageUserSheet):
3493         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
3494
3495             Don't use CSSStyleSheet::createInline, these are not really inline stylesheets.
3496             Code cleanups.
3497
3498         * dom/InlineStyleSheetOwner.cpp:
3499         (WebCore::parserContextForForElement):
3500         (WebCore::makeInlineStyleSheetCacheKey):
3501         (WebCore::inlineStyleSheetCache):
3502
3503             Implement a simple cache for sharing stylesheets with identical text and context.
3504
3505         (WebCore::InlineStyleSheetOwner::createSheet):
3506         (WebCore::InlineStyleSheetOwner::clearCache):
3507         * dom/InlineStyleSheetOwner.h:
3508         * platform/MemoryPressureHandler.cpp:
3509         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
3510
3511 2016-10-14  Chris Dumez  <cdumez@apple.com>
3512
3513         [Mac] Allow throttling of background tabs that have media elements with no audible audio
3514         https://bugs.webkit.org/show_bug.cgi?id=163402
3515         <rdar://problem/28056151>
3516
3517         Reviewed by Gavin Barraclough.
3518
3519         Allow throttling of background tabs that have media elements with no audible audio.
3520         We were taking an media assertion from the PageThrottler as soon as there was a
3521         media element playing on the page. This prevented throttling of background tabs
3522         even if those media elements had no audible audio, which was unfortunate.
3523
3524         We now have more fine-grained rules for when HTMLMediaElement should take an
3525         assertion. I also added release logging to help debug such issues in the
3526         future.
3527
3528         * html/HTMLMediaElement.cpp:
3529         (WebCore::HTMLMediaElement::setMuted):
3530         (WebCore::HTMLMediaElement::updateVolume):
3531         (WebCore::HTMLMediaElement::updatePlayState):
3532         (WebCore::HTMLMediaElement::updateAudioAssertionState):
3533         (WebCore::HTMLMediaElement::effectiveMuted): Deleted.
3534         * html/HTMLMediaElement.h:
3535
3536 2016-10-14  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3537
3538         [Readable Streams API] Cleanup patch, fix small inconsistencies
3539         https://bugs.webkit.org/show_bug.cgi?id=163329
3540
3541         Reviewed by Youenn Fablet.
3542
3543         Cleanup patch, fixed 3 small inconsistences between implementation and spec.
3544
3545         No change in behaviour.
3546
3547         * Modules/streams/ReadableStream.idl: Added optional parameter in getReader.
3548         * Modules/streams/ReadableStreamDefaultController.js:
3549         (error): Call readableStreamDefaultControllerError instead of readableStreamError.
3550         * Modules/streams/ReadableStreamInternals.js: Added missing ASSERT in readableStreamDefaultControllerCallPullIfNeeded.
3551
3552 2016-10-14  Youenn Fablet  <youenn@apple.com>
3553
3554         http://trac.webkit.org/changeset/207330 broke Mac Windows build
3555         https://bugs.webkit.org/show_bug.cgi?id=163442
3556
3557         Unreviewed.
3558
3559         * platform/network/cf/ResourceRequestCFNet.cpp:
3560         (WebCore::toPlatformRequestCachePolicy): Do not explicitly use CFURLRequestCachePolicy enumeration values.
3561
3562 2016-10-14  Zan Dobersek  <zdobersek@igalia.com>
3563
3564         [Cairo] GraphicsContext3D::ImageExtractor fails to extract images
3565         https://bugs.webkit.org/show_bug.cgi?id=163439
3566
3567         Reviewed by Carlos Garcia Campos.
3568
3569         In the Cairo implementation of GraphicsContext3D::ImageExtractor,
3570         don't check for frame completeness at index 0. This information
3571         is now cached only after the frame for that index is decoded and
3572         marked as completed, which is done after this check.
3573
3574         Becuase of this the current check forces extractImage() to return
3575         early and abort WebGL texture uploads from image sources.
3576
3577         This bug was most likely exposed after the refactoring in r206481.
3578         https://trac.webkit.org/changeset/206481
3579
3580         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3581         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3582
3583 2016-10-14  Youenn Fablet  <youenn@apple.com>
3584
3585         MediaResourceLoader should use CachedResource::ressourceError to do CORS checks
3586         https://bugs.webkit.org/show_bug.cgi?id=163279
3587
3588         Reviewed by Darin Adler.
3589
3590         Covered by existing tests.
3591
3592         * loader/MediaResourceLoader.cpp:
3593         (WebCore::MediaResource::responseReceived): Making use of CachedResource::ressourceError to detect CORS failures.
3594         * loader/cache/CachedResourceLoader.cpp:
3595         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): Activating loader options checks
3596         before reusing the resource.
3597         (WebCore::isResourceSuitableForDirectReuse): Disabling direct reuse of MediaResource since reuse of raw
3598         resources does not work yet for media resources.
3599
3600 2016-10-14  Youenn Fablet  <youenn@apple.com>
3601
3602         Make NetworkCache aware of fetch cache mode
3603         https://bugs.webkit.org/show_bug.cgi?id=163332
3604
3605         Reviewed by Antti Koivisto.
3606
3607         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-cache-default-conditional.html
3608                imported/w3c/web-platform-tests/fetch/api/request/request-cache-default.html
3609                imported/w3c/web-platform-tests/fetch/api/request/request-cache-force-cache.html
3610                imported/w3c/web-platform-tests/fetch/api/request/request-cache-no-cache.html
3611                imported/w3c/web-platform-tests/fetch/api/request/request-cache-no-store.html
3612                imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached.html
3613                imported/w3c/web-platform-tests/fetch/api/request/request-cache-reload.html
3614
3615         * loader/cache/CachedResourceLoader.cpp:
3616         (WebCore::updateRequestAccordingCacheMode): Setting request cache policy according cache mode.
3617         Basically, these two are about the same.
3618         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Making use of cache policy instead of cache mode.
3619         * platform/network/ResourceRequestBase.h: Adding new cache policies, aligned with fetch cache modes.
3620         * platform/network/cf/ResourceRequestCFNet.cpp:
3621         (WebCore::toPlatformRequestCachePolicy): If policy is not supported by CFNetwork, fallback to ReloadIgnoringCacheData.
3622         This is the best approximate we might find.
3623         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
3624         (WebCore::ResourceRequest::doUpdateResourceRequest): Only updating cache policy, if cache policy is the default.
3625         * platform/network/cf/ResourceRequestCFNet.h:
3626         * platform/network/cocoa/ResourceRequestCocoa.mm: Doing the same modifications as for ResourceRequestCFNet.
3627         (WebCore::ResourceRequest::doUpdateResourceRequest):
3628         (WebCore::toPlatformRequestCachePolicy):
3629         (WebCore::ResourceRequest::doUpdatePlatformRequest):
3630
3631 2016-10-13  Youenn Fablet  <youenn@apple.com>
3632
3633         Binding generated code for private operations should assert for casted-this checks
3634         https://bugs.webkit.org/show_bug.cgi?id=163326
3635
3636         Reviewed by Darin Adler.
3637
3638         Covered by existing tests.
3639
3640         Private operations are not exposed to user scripts and are only called by built-in scripts or other WebKit-controlled code.
3641         The call sites already ensure that the caller is of the right type so there is no need to do that work twice.
3642
3643         Introducing a casted-this-error Assert mode for casted-this checks, which may be reused for other binding generated code.
3644         Updated binding generator to use that mode for private operations.
3645
3646         * bindings/js/JSDOMBinding.h:
3647         (WebCore::BindingCaller::callPromiseOperation):
3648         (WebCore::BindingCaller::callOperation):
3649         * bindings/scripts/CodeGeneratorJS.pm:
3650         (GenerateImplementation):
3651         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3652         (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
3653         * bindings/scripts/test/JS/JSTestObj.cpp:
3654         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
3655
3656 2016-10-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3657
3658         WebView and WebPage URLs not updated after URL is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
3659         https://bugs.webkit.org/show_bug.cgi?id=146306
3660
3661         Reviewed by Darin Adler.
3662
3663         Notify about the provisional URL change when new request set for main resource load in DocumentLoader has a
3664         different URL than the previous one.
3665
3666         * loader/DocumentLoader.cpp:
3667         (WebCore::DocumentLoader::setRequest):
3668
3669 2016-10-13  Youenn Fablet  <youenn@apple.com>
3670
3671         Update serializer and iterator binding generated code
3672         https://bugs.webkit.org/show_bug.cgi?id=163325
3673
3674         Reviewed by Darin Adler.
3675
3676         No change of behavior.
3677         Covered by existing tests and rebased binding generated code.
3678
3679         Making use of BindingCaller::callOperation within serializer and iterator operations.
3680         Refactored serializer code to use direct attribute getters.
3681
3682         * bindings/js/JSDOMIterator.h:
3683         (WebCore::iteratorCreate):
3684         (WebCore::iteratorForEach):
3685         * bindings/scripts/CodeGeneratorJS.pm:
3686         (GenerateSerializerFunction):
3687         (GenerateImplementationIterableFunctions):
3688         * bindings/scripts/test/JS/JSTestIterable.cpp:
3689         (WebCore::jsTestIterablePrototypeFunctionSymbolIteratorCaller):
3690         (WebCore::jsTestIterablePrototypeFunctionSymbolIterator):
3691         (WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
3692         (WebCore::jsTestIterablePrototypeFunctionEntries):
3693         (WebCore::jsTestIterablePrototypeFunctionKeysCaller):
3694         (WebCore::jsTestIterablePrototypeFunctionKeys):
3695         (WebCore::jsTestIterablePrototypeFunctionValuesCaller):
3696         (WebCore::jsTestIterablePrototypeFunctionValues):
3697         (WebCore::jsTestIterablePrototypeFunctionForEachCaller):
3698         (WebCore::jsTestIterablePrototypeFunctionForEach):
3699         * bindings/scripts/test/JS/JSTestNode.cpp:
3700         (WebCore::jsTestNodePrototypeFunctionSymbolIteratorCaller):
3701         (WebCore::jsTestNodePrototypeFunctionSymbolIterator):
3702         (WebCore::jsTestNodePrototypeFunctionEntriesCaller):
3703         (WebCore::jsTestNodePrototypeFunctionEntries):
3704         (WebCore::jsTestNodePrototypeFunctionKeysCaller):
3705         (WebCore::jsTestNodePrototypeFunctionKeys):
3706         (WebCore::jsTestNodePrototypeFunctionValuesCaller):
3707         (WebCore::jsTestNodePrototypeFunctionValues):
3708         (WebCore::jsTestNodePrototypeFunctionForEachCaller):
3709         (WebCore::jsTestNodePrototypeFunctionForEach):
3710         (WebCore::jsTestNodePrototypeFunctionToJSON):
3711         * bindings/scripts/test/JS/JSTestObj.cpp:
3712         (WebCore::jsTestObjPrototypeFunctionToJSON):
3713
3714 2016-10-13  Alex Christensen  <achristensen@webkit.org>
3715
3716         Fix API test after r207318.
3717         https://bugs.webkit.org/show_bug.cgi?id=162951
3718
3719         This fixes the API test WebKit2.PendingAPIRequestURL which asserted when trying to hash a null String.
3720
3721         * loader/DocumentLoader.cpp:
3722         (WebCore::isRemoteWebArchive):
3723         If the mimeType is a null String, it is not in the set webArchiveMIMETypes, so return false instead of hashing it.
3724
3725 2016-10-13  Alex Christensen  <achristensen@webkit.org>
3726
3727         Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
3728         https://bugs.webkit.org/show_bug.cgi?id=163413
3729
3730         Reviewed by Tim Horton.
3731
3732         This retains compatibility with the canonicalization Chrome, Firefox, and Safari with uppercase characters
3733         in the hosts of URLs with unrecognized schemes.  Safari treats such characters as the host, while Firefox
3734         and Chrome treat such characters as part of the path, starting with the "//" after the ':'
3735         Behavior of non-ASCII characters is inconsistent, and since we need to have a host, we should punycode-encode
3736         the host to be consistent with special schemes because percent-encoding hosts sometimes is inconsistent.
3737         
3738         This solution was proposed to the spec in https://github.com/whatwg/url/issues/148
3739
3740         Covered by updated API and layout tests.
3741
3742         * platform/URLParser.cpp:
3743         (WebCore::URLParser::parse):
3744         (WebCore::URLParser::percentDecode):
3745         (WebCore::URLParser::domainToASCII):
3746         (WebCore::URLParser::hasInvalidDomainCharacter):
3747         (WebCore::URLParser::parseHostAndPort):
3748         (WebCore::URLParser::formURLDecode):
3749         (WebCore::percentDecode): Deleted.
3750         (WebCore::domainToASCII): Deleted.
3751         (WebCore::hasInvalidDomainCharacter): Deleted.
3752         (WebCore::formURLDecode): Deleted.
3753         * platform/URLParser.h:
3754
3755 2016-10-13  Chris Dumez  <cdumez@apple.com>
3756
3757         [Web IDL] Add support for [SameObject] extended attribute
3758         https://bugs.webkit.org/show_bug.cgi?id=163414
3759
3760         Reviewed by Darin Adler.
3761
3762         Add support for [SameObject] Web IDL extended attribute:
3763         - https://heycam.github.io/webidl/#SameObject
3764
3765         Start using it on DOM / HTML attributes where the specification
3766         mandates it.
3767
3768         Test: js/dom/SameObject-support.html
3769
3770         * bindings/scripts/CodeGeneratorJS.pm:
3771         (ShouldCacheAttribute):
3772         (GenerateHeader):
3773         (GenerateImplementation):
3774         * bindings/scripts/IDLAttributes.txt:
3775         * dom/DataTransfer.idl:
3776         * dom/Document.idl:
3777         * dom/Element.idl:
3778         * dom/MutationRecord.idl:
3779         * dom/Node.idl:
3780         * dom/NodeIterator.idl:
3781         * dom/ParentNode.idl:
3782         * dom/TreeWalker.idl:
3783         * html/HTMLAnchorElement.idl:
3784         * html/HTMLAreaElement.idl:
3785         * html/HTMLButtonElement.idl:
3786         * html/HTMLDataListElement.idl:
3787         * html/HTMLDocument.idl:
3788         * html/HTMLElement.idl:
3789         * html/HTMLFieldSetElement.idl:
3790         * html/HTMLFormElement.idl:
3791         * html/HTMLIFrameElement.idl:
3792         * html/HTMLInputElement.idl:
3793         * html/HTMLKeygenElement.idl:
3794         * html/HTMLLinkElement.idl:
3795         * html/HTMLMapElement.idl:
3796         * html/HTMLMediaElement.idl:
3797         * html/HTMLMeterElement.idl:
3798         * html/HTMLOutputElement.idl:
3799         * html/HTMLProgressElement.idl:
3800         * html/HTMLSelectElement.idl:
3801         * html/HTMLTableElement.idl:
3802         * html/HTMLTableRowElement.idl:
3803         * html/HTMLTableSectionElement.idl:
3804         * html/HTMLTextAreaElement.idl:
3805         * page/Location.idl:
3806         * page/Navigator.idl:
3807
3808 2016-10-13  Andy Estes  <aestes@apple.com>
3809
3810         [iOS] Support Web Archive previews generated by QuickLook
3811         https://bugs.webkit.org/show_bug.cgi?id=162951
3812         <rdar://problem/28607920>
3813
3814         Reviewed by Brady Eidson.
3815
3816         QuickLook might generate a Web Archive preview for some resource types, but WebKit would
3817         refuse to load it due to the prohibition on loading remote Web Archives. Even though the
3818         original resource might be from a remote origin, the QuickLook-generated preview is a
3819         trusted local resource, so allow it to be loaded.
3820
3821         No test possible.
3822
3823         * loader/DocumentLoader.cpp:
3824         (WebCore::isRemoteWebArchive): Added. Moved the remote web archive check from
3825         continueAfterContentPolicy() to here, and added a check for responses containing the
3826         QuickLook preview protocol.
3827         (WebCore::DocumentLoader::continueAfterContentPolicy): Called isRemoteWebArchive().
3828
3829 2016-10-13  Dean Jackson  <dino@apple.com>
3830
3831         CSS parsing should use Color not RGBA32
3832         https://bugs.webkit.org/show_bug.cgi?id=163423
3833         <rdar://problem/28766903>
3834
3835         Reviewed by Simon Fraser.
3836
3837         In order to allow CSS to use the ExtendedColor variant of
3838         Color, we need to stop using RGBA32. This is a fairly big
3839         change that goes through all the places in the parser
3840         related to colors, and moves them from RGBA32 to Color.
3841
3842         No change in functionality, so covered by existing tests.
3843
3844         * WebCore.xcodeproj/project.pbxproj: Add the new ColorHash.h file.
3845
3846         * css/CSSPrimitiveValue.cpp: CSSPrimitiveValue now can hold a Color*
3847         rather than an unsigned int for colors.
3848         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3849         (WebCore::CSSPrimitiveValue::cleanup):
3850         (WebCore::CSSPrimitiveValue::getRGBColorValue):
3851         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
3852         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
3853         (WebCore::CSSPrimitiveValue::equals):
3854         * css/CSSPrimitiveValue.h: Move to Color* and also use some
3855         nullptrs.
3856         * css/CSSPrimitiveValueMappings.h:
3857         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add a new inline
3858         constructor.
3859
3860         * css/CSSValuePool.cpp: Move to Color.
3861         (WebCore::CSSValuePool::CSSValuePool):
3862         (WebCore::CSSValuePool::createColorValue):
3863         * css/CSSValuePool.h: Change the ColorValueCache to a new type.
3864
3865         * css/StyleResolver.cpp: Move to Color.
3866         (WebCore::StyleResolver::colorFromPrimitiveValue):
3867         * css/parser/CSSParser.cpp:
3868         (WebCore::parseColorValue):
3869         (WebCore::CSSParser::parseColor):
3870         (WebCore::CSSParser::parseColorFromString):
3871         (WebCore::CSSParser::parseSystemColor):
3872         (WebCore::fastParseColorInternal):
3873         (WebCore::CSSParser::fastParseColor):
3874         (WebCore::CSSParser::parseColorFromValue):
3875         * css/parser/CSSParser.h:
3876         * css/parser/CSSParserFastPaths.cpp:
3877         (WebCore::fastParseColorInternal):
3878         (WebCore::CSSParserFastPaths::parseColor):
3879         * css/parser/CSSPropertyParserHelpers.cpp:
3880         (WebCore::CSSPropertyParserHelpers::consumeColor):
3881         * css/parser/SVGCSSParser.cpp:
3882         (WebCore::CSSParser::parseSVGValue):
3883         (WebCore::CSSParser::parseSVGPaint):
3884         (WebCore::CSSParser::parseSVGColor):
3885         * editing/EditingStyle.cpp:
3886         (WebCore::cssValueToColor):
3887         (WebCore::textColorFromStyle):
3888         (WebCore::backgroundColorFromStyle):
3889         (WebCore::rgbaBackgroundColorInEffect):
3890         (WebCore::EditingStyle::prepareToApplyAt):
3891         (WebCore::isTransparentColorValue):
3892         (WebCore::cssValueToRGBA): Deleted.
3893         * editing/cocoa/HTMLConverter.mm:
3894         (HTMLConverterCaches::colorPropertyValueForNode):
3895         * html/HTMLBodyElement.cpp:
3896         (WebCore::HTMLBodyElement::parseAttribute):
3897         * html/canvas/CanvasGradient.cpp:
3898         (WebCore::CanvasGradient::addColorStop):
3899         * html/canvas/CanvasRenderingContext2D.cpp: Ditto, but leave a FIXME to
3900         remind myself to come back when colorWithOverrideAlpha has been updated.
3901         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
3902         (WebCore::CanvasRenderingContext2D::setFillStyle):
3903         (WebCore::CanvasRenderingContext2D::setShadowColor):
3904         (WebCore::CanvasRenderingContext2D::setShadow):
3905         * html/canvas/CanvasStyle.cpp:
3906         (WebCore::isCurrentColorString):
3907         (WebCore::parseColor):
3908         (WebCore::currentColor):
3909         (WebCore::parseColorOrCurrentColor):
3910         (WebCore::CanvasStyle::createFromString):
3911         (WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
3912         * html/canvas/CanvasStyle.h:
3913         * svg/SVGColor.cpp:
3914         (WebCore::SVGColor::colorFromRGBColorString):
3915
3916         * platform/graphics/Color.h: Add new constructors for the special
3917         empty and deleted Color values used in HashTables.
3918         (WebCore::Color::Color):
3919         (WebCore::Color::isHashTableDeletedValue):
3920         (WebCore::Color::asUint64): New accessor to get the raw uint64_t value.
3921
3922         * platform/graphics/ColorHash.h: Added. Implement the traits for a Color HashTable.
3923         (WTF::ColorHash::hash):
3924         (WTF::ColorHash::equal):
3925         (WTF::HashTraits<WebCore::Color>::emptyValue):
3926         (WTF::HashTraits<WebCore::Color>::constructDeletedValue):
3927         (WTF::HashTraits<WebCore::Color>::isDeletedValue):
3928
3929 2016-10-13  Nan Wang  <n_wang@apple.com>
3930
3931         AX: [Mac] better accessibility support for Summary elements
3932         https://bugs.webkit.org/show_bug.cgi?id=163367
3933         <rdar://problem/28745010>
3934
3935         Reviewed by Chris Fleizach.
3936
3937         Exposed summary elements as AXButton and used the text node's content
3938         as AXTitle. Also exposed the details parent's expanded status on the summary
3939         element, so that users would see it as a collapsed/expanded button.
3940
3941         Changes are covered in the modified tests.
3942
3943         * accessibility/AccessibilityObject.cpp:
3944         (WebCore::AccessibilityObject::parentObjectUnignored):
3945         (WebCore::AccessibilityObject::scrollViewAncestor):
3946         (WebCore::AccessibilityObject::headingElementForNode):
3947         (WebCore::AccessibilityObject::matchedParent):
3948         (WebCore::AccessibilityObject::isDescendantOfObject):
3949         (WebCore::AccessibilityObject::isInsideARIALiveRegion):
3950         (WebCore::AccessibilityObject::elementAccessibilityHitTest):
3951         (WebCore::AccessibilityObject::isExpanded):
3952         (WebCore::AccessibilityObject::isARIAHidden):
3953         (WebCore::AccessibilityObject::focusableAncestor):
3954         (WebCore::AccessibilityObject::editableAncestor):
3955         * accessibility/AccessibilityObject.h:
3956         (WebCore::AccessibilityObject::isSummary):
3957         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3958         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
3959         (-[WebAccessibilityObjectWrapper _accessibilityLandmarkAncestor]):
3960         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
3961         (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
3962         (-[WebAccessibilityObjectWrapper tableCellParent]):
3963         (-[WebAccessibilityObjectWrapper tableParent]):
3964         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
3965         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
3966         (-[WebAccessibilityObjectWrapper detailParentForSummaryObject:]):
3967         (-[WebAccessibilityObjectWrapper detailParentForObject:]):
3968         (matchedParent): Deleted.
3969         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3970         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
3971         (createAccessibilityRoleMap):
3972         (-[WebAccessibilityObjectWrapper roleDescription]):
3973         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3974
3975 2016-10-13  Zalan Bujtas  <zalan@apple.com>
3976
3977         [Clean RenderTree] LayoutTests/imported/blink/fast/table/crash-bad-child-table-continuation.html fails.
3978         https://bugs.webkit.org/show_bug.cgi?id=163399
3979
3980         Reviewed by David Hyatt.
3981
3982         When we try to insert a renderer before a child whose direct parent is a (anonymus) RenderTable, continuation logic
3983         should dismiss the RenderTable as the parent and find a more appropriate ancestor.
3984         RenderTables assumes a certain descendant tree structure which might not be available in the continuation.
3985
3986         Will be testable with webkit.org/b/162834
3987
3988         * rendering/RenderInline.cpp:
3989         (WebCore::canUseAsParentForContinuation):
3990         (WebCore::RenderInline::addChildToContinuation):
3991
3992 2016-10-13  Alex Christensen  <achristensen@webkit.org>
3993
3994         Disable URLParser for non-Safari iOS and Mac apps for now
3995         https://bugs.webkit.org/show_bug.cgi?id=163397
3996
3997         Reviewed by Tim Horton.
3998
3999         r207268 was an awful hack, and it was insufficient.
4000         Disable the URLParser for other apps for now.  Hopefully we can enable it everywhere soon.
4001
4002         No change in behavior for testing infrastructure.  
4003         Old URLs were well tested before making the switch, and nothing has changed for them.
4004
4005         * platform/URLParser.cpp:
4006         (WebCore::URLParser::parse):
4007         (WebCore::URLParser::parseHostAndPort):
4008         (WebCore::URLParser::setEnabled):
4009         (WebCore::URLParser::enabled):
4010         * platform/URLParser.h:
4011
4012 2016-10-13  Chris Dumez  <cdumez@apple.com>
4013
4014         Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*]
4015         https://bugs.webkit.org/show_bug.cgi?id=163390
4016
4017         Reviewed by Darin Adler.
4018
4019         Rename [ConstructorTemplate=*] to [LegacyConstructorTemplate=*] as the
4020         modern way of doing this is to use a constructor that takes in a
4021         dictionary. I am working on getting rid of this extended attribute
4022         entirely but the remaining uses require better support for union types.
4023
4024         * Modules/applepay/ApplePayValidateMerchantEvent.idl:
4025         * Modules/indexeddb/IDBVersionChangeEvent.idl:
4026         * Modules/mediastream/RTCTrackEvent.idl:
4027         * bindings/scripts/CodeGenerator.pm:
4028         (IsConstructorTemplate):
4029         * bindings/scripts/CodeGeneratorJS.pm:
4030         (GenerateConstructorDefinition):
4031         (IsConstructable):
4032         * bindings/scripts/IDLAttributes.txt:
4033         * dom/Event.idl:
4034         * dom/ProgressEvent.idl:
4035         * dom/UIEvent.idl:
4036         * html/track/TrackEvent.idl:
4037
4038 2016-10-13  Ryan Haddad  <ryanhaddad@apple.com>
4039
4040         Unreviewed, rolling out r207297.
4041
4042         This change broke the iOS build.
4043
4044         Reverted changeset:
4045
4046         "Disable URLParser for non-Safari iOS and Mac apps for now"
4047         https://bugs.webkit.org/show_bug.cgi?id=163397
4048         http://trac.webkit.org/changeset/207297
4049
4050 2016-10-13  Anders Carlsson  <andersca@apple.com>
4051
4052         Get rid of the HistoryItemVector typedef
4053         https://bugs.webkit.org/show_bug.cgi?id=163398
4054
4055         Reviewed by Beth Dakin.
4056
4057         Expand the HistoryitemVector typedef instead to make it more clear what types we are dealing with.
4058
4059         * history/BackForwardList.cpp:
4060         (WebCore::BackForwardList::backListWithLimit):
4061         (WebCore::BackForwardList::forwardListWithLimit):
4062         (WebCore::BackForwardList::entries):
4063         * history/BackForwardList.h:
4064         * history/HistoryItem.cpp:
4065         (WebCore::HistoryItem::children):
4066         * history/HistoryItem.h:
4067         * loader/HistoryController.cpp:
4068         (WebCore::HistoryController::currentFramesMatchItem):
4069
4070 2016-10-13  Antoine Quint  <graouts@apple.com>
4071
4072         [Modern Media Controls] MediaControls base class
4073         https://bugs.webkit.org/show_bug.cgi?id=163387
4074         <rdar://problem/28753955>
4075
4076         Reviewed by Dean Jackson.
4077
4078         Introducing the new MediaControls class which will serve as a basis for all media controls.
4079         We will introduce specific MediaControls subclasses for macOS inline, macOS fullscreen and
4080         iOS inline in future patches.
4081
4082         Tests: media/modern-media-controls/media-controls/media-controls-constructor.html
4083                media/modern-media-controls/media-controls/media-controls-placard.html
4084                media/modern-media-controls/media-controls/media-controls-start-button.html
4085
4086         * Modules/modern-media-controls/controls/media-controls.css: Added.
4087         (.media-controls,):
4088         * Modules/modern-media-controls/controls/media-controls.js: Added.
4089         (MediaControls.):
4090         (MediaControls.prototype.get showsStartButton):
4091         (MediaControls.prototype.set showsStartButton):
4092         (MediaControls.prototype.get showsPlacard):
4093         (MediaControls.prototype.showPlacard):
4094         (MediaControls.prototype.hidePlacard):
4095
4096 2016-10-13  Alex Christensen  <achristensen@webkit.org>
4097
4098         Disable URLParser for non-Safari iOS and Mac apps for now
4099         https://bugs.webkit.org/show_bug.cgi?id=163397
4100