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