Validate the BCP47-ness of the language string passed to TrackBase::setLanguage()
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-01-04  John Wilander  <wilander@apple.com>
2
3         Validate the BCP47-ness of the language string passed to TrackBase::setLanguage()
4         https://bugs.webkit.org/show_bug.cgi?id=123926
5
6         Reviewed by Jer Noble.
7
8         Test: media/media-source/only-bcp47-language-tags-accepted-as-valid.html
9
10         * html/HTMLMediaElement.cpp:
11         (WebCore::HTMLMediaElement::configureTextTrackGroup):
12             Log message now includes the valid BCP 47 language too.
13         (WebCore::HTMLMediaElement::setSelectedTextTrack):
14             Now sets preferred language to the valid BCP 47 language.
15         * html/track/TextTrack.cpp:
16         (WebCore::TextTrack::setLanguage):
17             Removed fixme and aligned comments with new behavior.
18         * html/track/TrackBase.cpp:
19         (WebCore::TrackBase::TrackBase):
20             Initializes m_validBCP47Language with language parameter.
21         (WebCore::isValidBCP47LanguageTag):
22             New convenience function.
23         (WebCore::TrackBase::setLanguage):
24             Sets m_validBCP47Language if the incoming tag is valid.
25             Produces a console warning if the tag is invalid.
26             The member m_language is set to the incoming tag regardless.
27         (WebCore::TrackBase::validBCP47Language):
28             New getter for valid language tag. To be used internally.
29         * html/track/TrackBase.h:
30             New AtomicString member m_validBCP47Language.
31         (WebCore::TrackBase::setLanguage): Deleted.
32         * html/track/VideoTrack.cpp:
33         (WebCore::VideoTrack::setLanguage):
34             Removed fixme and aligned comments with new behavior.
35         * page/CaptionUserPreferences.cpp:
36         (WebCore::trackDisplayName):
37             Now uses the getter for BCP 47 language.
38         (WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore):
39             Now uses the getter for BCP 47 language.
40         * page/CaptionUserPreferencesMediaAF.cpp:
41         (WebCore::buildDisplayStringForTrackBase):
42             Now uses the getter for BCP 47 language.
43         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore):
44             Now uses the getter for BCP 47 language.
45         (WebCore::textTrackCompare):
46             Now uses the getter for BCP 47 language.
47         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu):
48             Now uses the getter for BCP 47 language.
49
50 2017-01-04  Joseph Pecoraro  <pecoraro@apple.com>
51
52         Web Inspector: Cross Origin importScripts() scripts lack source URL, causes issues with Inspector showing Resource
53         https://bugs.webkit.org/show_bug.cgi?id=165569
54         <rdar://problem/29607569>
55
56         Reviewed by Youenn Fablet.
57
58         Test: http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html
59
60         * Modules/fetch/FetchLoader.cpp:
61         (WebCore::FetchLoader::start):
62         * loader/DocumentThreadableLoader.cpp:
63         (WebCore::DocumentThreadableLoader::didReceiveResponse):
64         * loader/ThreadableLoader.cpp:
65         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
66         * loader/ThreadableLoader.h:
67         * loader/WorkerThreadableLoader.cpp:
68         (WebCore::LoaderTaskOptions::LoaderTaskOptions):
69         Add a new ThreadableLoader option to avoid filtering the response.
70
71         * workers/WorkerScriptLoader.cpp:
72         (WebCore::WorkerScriptLoader::loadSynchronously):
73         (WebCore::WorkerScriptLoader::loadAsynchronously):
74         Disable filtering of the response. This is an internal load, we
75         don't want to filter data that would be valuable later.
76
77 2017-01-03  Sam Weinig  <sam@webkit.org>
78
79         Remove final custom binding from IDBRequest
80         https://bugs.webkit.org/show_bug.cgi?id=166671
81
82         Reviewed by Alex Christensen.
83
84         * CMakeLists.txt:
85         * WebCore.xcodeproj/project.pbxproj:
86         Remove JSIDBRequestCustom.cpp
87
88         * bindings/js/JSIDBRequestCustom.cpp: Removed.
89
90         * Modules/indexeddb/IDBRequest.cpp:
91         (WebCore::IDBRequest::IDBRequest):
92         (WebCore::IDBRequest::~IDBRequest):
93         (WebCore::IDBRequest::result):
94         (WebCore::IDBRequest::setSource):
95         (WebCore::IDBRequest::sourceObjectStoreIdentifier):
96         (WebCore::IDBRequest::sourceIndexIdentifier):
97         (WebCore::IDBRequest::requestedIndexRecordType):
98         (WebCore::IDBRequest::setResult):
99         (WebCore::IDBRequest::setResultToStructuredClone):
100         (WebCore::IDBRequest::setResultToUndefined):
101         (WebCore::IDBRequest::resultCursor):
102         (WebCore::IDBRequest::willIterateCursor):
103         (WebCore::IDBRequest::didOpenOrIterateCursor):
104         (WebCore::IDBRequest::source): Deleted.
105         (WebCore::IDBRequest::clearResult): Deleted.
106         * Modules/indexeddb/IDBRequest.h:
107         (WebCore::IDBRequest::source):
108         (WebCore::IDBRequest::cursorResult): Deleted.
109         (WebCore::IDBRequest::databaseResult): Deleted.
110         (WebCore::IDBRequest::scriptResult): Deleted.
111         Replace multiple member variables with Variants for source and result. Add a result
112         member function that properly sets an exception if not "done".
113
114         * Modules/indexeddb/IDBRequest.idl:
115         Remove CustomGetter annotation and add type.
116
117         * bindings/generic/IDLTypes.h:
118         (WebCore::IDLAny::nullValue):
119         (WebCore::IDLAny::isNullValue):
120         (WebCore::IDLAny::extractValueFromNullable):
121         * bindings/js/JSDOMConvert.h:
122         (WebCore::Converter<IDLAny>::convert):
123         Flesh out IDLAny to be implemented as a Strong<Unknown> when used in aggregate types,
124         but still work with JSValue when passing as a parameter.
125
126         * inspector/InspectorIndexedDBAgent.cpp:
127         Update for new return value of IDBRequest::result().
128
129 2017-01-04  Tim Horton  <timothy_horton@apple.com>
130
131         Provide a setting for clients to always prefer low-power WebGL
132         https://bugs.webkit.org/show_bug.cgi?id=166675
133         <rdar://problem/29834093>
134
135         Reviewed by Dan Bernstein.
136
137         No new tests; as noted in r204664, we don't know how to reliably test
138         automatic graphics switching. One could use the manual test introduced
139         in that commit; after this commit, with the setting switched on, on a
140         dual-GPU machine that is actively using integrated graphics, that test
141         should return the same result for both contexts.
142
143         * page/Settings.in:
144         Add a setting to prefer low-power WebGL.
145
146         * html/canvas/WebGLRenderingContextBase.cpp:
147         (WebCore::WebGLRenderingContextBase::create):
148         If said setting is enabled, set preferLowPowerToHighPerformance.
149
150 2017-01-03  Ryosuke Niwa  <rniwa@webkit.org>
151
152         label element with tabindex >= 0 is not focusable
153         https://bugs.webkit.org/show_bug.cgi?id=102780
154         <rdar://problem/29796608>
155
156         Reviewed by Darin Adler.
157
158         Fixed the bug by removing the override for HTMLLabelElement::isFocusable which always returned false.
159
160         This is a behavior from r5532 but it doesn't match the latest HTML specification or that of Chrome
161         and Firefox.
162
163         Also fixed an existing bug in HTMLLabelElement::focus and HTMLLegendElement::focus which focused
164         the associated form control when there is one even if the element itself is focusable. Without this fix,
165         traversing from control with shift+tab would break since focusing the label would move the focus back
166         to the input element inside the label element.
167
168         Finally, fixed a bug in HTMLLegendElement::focus that we can call inFocus without updating layout first.
169
170         The fix was inspired by https://chromium.googlesource.com/chromium/src/+/085ad8697b1be50c4f93e296797a25a43a79bcfb
171
172         Test: fast/events/focus-label-legend-elements-with-tabindex.html
173
174         * html/HTMLLabelElement.cpp:
175         (WebCore::HTMLLabelElement::focus):
176         (WebCore::HTMLLabelElement::isFocusable): Deleted.
177         * html/HTMLLabelElement.h:
178         * html/HTMLLegendElement.cpp:
179         (WebCore::HTMLLegendElement::focus):
180
181 2017-01-03  Tim Horton  <timothy_horton@apple.com>
182
183         NSSpellChecker's recordResponse isn't called for unseen automatic corrections
184         https://bugs.webkit.org/show_bug.cgi?id=166450
185         <rdar://problem/29447824>
186
187         Reviewed by Darin Adler.
188
189         Test: editing/mac/spelling/accept-unseen-candidate-records-acceptance.html
190
191         * editing/AlternativeTextController.cpp:
192         (WebCore::AlternativeTextController::recordAutocorrectionResponse):
193         (WebCore::AlternativeTextController::recordAutocorrectionResponseReversed): Deleted.
194         * editing/AlternativeTextController.h:
195         Add recordAutocorrectionResponse, which takes a AutocorrectionResponseType, instead of having
196         a function specifically for reverted autocorrections. Also, get rid of the unnecessary indirection
197         of the private overload of recordAutocorrectionResponseReversed, since there's only one caller.
198
199         * editing/Editor.cpp:
200         (WebCore::Editor::markAndReplaceFor):
201         Call recordAutocorrectionResponse with Accepted when performing an auto-autocorrection.
202
203         (WebCore::Editor::changeBackToReplacedString):
204         Adopt recordAutocorrectionResponse.
205
206         * page/AlternativeTextClient.h:
207         Add an "AutocorrectionAccepted" response type.
208
209 2017-01-03  Nan Wang  <n_wang@apple.com>
210
211         AX: Focus should jump into modal dialogs when one appears
212         https://bugs.webkit.org/show_bug.cgi?id=166670
213
214         Reviewed by Chris Fleizach.
215
216         Added a timer to let focus jump into a modal dialog if the web
217         author didn't handle the focus movement.
218
219         Test: accessibility/mac/aria-modal-auto-focus.html
220
221         * accessibility/AXObjectCache.cpp:
222         (WebCore::AXObjectCache::AXObjectCache):
223         (WebCore::AXObjectCache::~AXObjectCache):
224         (WebCore::firstFocusableChild):
225         (WebCore::AXObjectCache::focusAriaModalNode):
226         (WebCore::AXObjectCache::focusAriaModalNodeTimerFired):
227         (WebCore::AXObjectCache::handleAriaModalChange):
228         * accessibility/AXObjectCache.h:
229         (WebCore::AXObjectCache::focusAriaModalNode):
230
231 2017-01-03  Andy Estes  <aestes@apple.com>
232
233         Rename SharedBufferMac.mm to SharedBufferCocoa.mm
234         https://bugs.webkit.org/show_bug.cgi?id=166666
235
236         Reviewed by Tim Horton.
237
238         * PlatformMac.cmake:
239         * WebCore.xcodeproj/project.pbxproj:
240         * platform/cocoa/SharedBufferCocoa.mm: Renamed from Source/WebCore/platform/mac/SharedBufferMac.mm.
241
242 2017-01-03  Sam Weinig  <sam@webkit.org>
243
244         Re-implement ExceptionOr on top of WTF::Expected
245         https://bugs.webkit.org/show_bug.cgi?id=166668
246
247         Reviewed by Alex Christensen.
248
249         As a first step towards using WTF::Expected instead of ExceptionOr,
250         use Expected as an implementation detail, rather than Variant/std::optional. 
251
252         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
253         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
254         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
255         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
256         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
257         Add missing #include of Variant.h
258
259         * dom/ExceptionOr.h:
260         (WebCore::ExceptionOr<ReturnType>::ExceptionOr):
261         (WebCore::ExceptionOr<ReturnType>::hasException):
262         (WebCore::ExceptionOr<ReturnType>::releaseException):
263         (WebCore::ExceptionOr<ReturnType>::releaseReturnValue):
264         (WebCore::ExceptionOr<void>::ExceptionOr):
265         (WebCore::ExceptionOr<void>::hasException):
266         (WebCore::ExceptionOr<void>::releaseException):
267         Re-implement on top of Expected.
268
269 2017-01-03  Chris Dumez  <cdumez@apple.com>
270
271         Make setting Event's cancelBubble to false a no-op
272         https://bugs.webkit.org/show_bug.cgi?id=166018
273
274         Reviewed by Ryosuke Niwa.
275
276         Align behavior of Event.cancelBubble with the latest DOM specification:
277         - https://dom.spec.whatwg.org/#dom-event-cancelbubble
278
279         Setting it to true sets the 'stop propagation' flag to true and setting
280         it to false is now a no-op.
281
282         Tests: imported/w3c/web-platform-tests/dom/events/Event-cancelBubble.html
283                imported/w3c/web-platform-tests/dom/events/Event-dispatch-bubble-canceled.html
284                imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-cancelBubble.html
285
286         * Modules/indexeddb/IDBEventDispatcher.cpp:
287         (WebCore::IDBEventDispatcher::dispatch):
288         * dom/Event.h:
289         (WebCore::Event::cancelBubble):
290         (WebCore::Event::setCancelBubble):
291         * dom/EventDispatcher.cpp:
292         (WebCore::dispatchEventInDOM):
293
294 2017-01-03  Jer Noble  <jer.noble@apple.com>
295
296         Check for the existence of AVSampleBufferAudioRenderer.h before redeclaring AVSampleBufferAudioRenderer
297         https://bugs.webkit.org/show_bug.cgi?id=166421
298         <rdar://problem/29782862>
299
300         Reviewed by Dan Bernstein.
301
302         Follow up after r210099; fix the __has_include directive to include the framework and fix the #import inside #if.
303
304         * platform/spi/mac/AVFoundationSPI.h:
305
306 2017-01-03  Andreas Kling  <akling@apple.com>
307
308         REGRESSION(r210226): fast/history/back-from-page-with-focused-iframe.html crashes under GuardMalloc
309         <https://webkit.org/b/166657>
310         <rdar://problem/29848806>
311
312         Reviewed by Antti Koivisto.
313
314         The problem was that tearDownRenderers() would cause commit Widget hierarchy updates
315         before returning, which is just before Document clears its m_renderView pointer.
316         This led to an awkward callback into Page::setActivityState() which ended up trying
317         to clear the selection inside a partially dead render tree.
318
319         Fix this by adding a WidgetHierarchyUpdatesSuspensionScope to Document::destroyRenderTree()
320         which ensures that Widget updates don't happen until after Document::m_renderView is cleared.
321
322         * dom/Document.cpp:
323         (WebCore::Document::destroyRenderTree):
324
325 2017-01-03  Andreas Kling  <akling@apple.com>
326
327         Placeholder style mechanism leaks CSSFontSelector for first Document styled.
328         <https://webkit.org/b/166652>
329
330         Reviewed by Antti Koivisto.
331
332         The placeholder style is used when we're resolving style for a non-rendered
333         element, or any element before stylesheets have loaded.
334
335         An old optimization had us reusing the same style each time, which meant that
336         since it was initialized with a font selector the first time, it kept that
337         font selector alive forever.
338
339         As we have to clone the style anyway, fix this by just making a new style
340         each time, using the current document's font selector.
341
342         * style/StyleTreeResolver.cpp:
343         (WebCore::Style::makePlaceholderStyle):
344         (WebCore::Style::TreeResolver::TreeResolver):
345         (WebCore::Style::TreeResolver::styleForElement):
346         (WebCore::Style::ensurePlaceholderStyle): Deleted.
347         (WebCore::Style::isPlaceholderStyle): Deleted.
348         * style/StyleTreeResolver.h:
349
350 2017-01-03  Carlos Alberto Lopez Perez  <clopez@igalia.com>
351
352         A floating element within <li> overlaps with the marker
353         https://bugs.webkit.org/show_bug.cgi?id=166528
354
355         Reviewed by Zalan Bujtas.
356
357         Merged from Blink (patch by trobhogan@gmail.com):
358         https://crrev.com/c896e79e5ba348d7ed87438cd3a19d0176f3036d
359         https://crbug.com/548616
360
361         Establish a list marker's offset before floats have been added to its line.
362
363         Computing the offset for a list marker after the rest of the objects on the line
364         it is on have been laid out, means it will avoid floats it ought not to.
365
366         Instead, compute the offset when laying out the marker and cache it for use later.
367
368         Tests: fast/lists/list-marker-before-float-nested-rtl.html
369                fast/lists/list-marker-before-float-nested.html
370                fast/lists/list-marker-before-float-rtl.html
371                fast/lists/list-marker-before-float.html
372
373         * rendering/RenderListItem.cpp:
374         (WebCore::RenderListItem::positionListMarker):
375         * rendering/RenderListMarker.cpp:
376         (WebCore::RenderListMarker::RenderListMarker):
377         (WebCore::RenderListMarker::layout):
378         * rendering/RenderListMarker.h:
379
380 2017-01-03  Per Arne Vollan  <pvollan@apple.com>
381
382         [Win] Some xmlhttprequest tests are failing.
383         https://bugs.webkit.org/show_bug.cgi?id=166638
384
385         Reviewed by Darin Adler.
386
387         The tests are failing because the request timeout is set to zero.
388         When the timeout is set to zero, we should use the default timeout.
389
390         * platform/network/cf/ResourceRequestCFNet.cpp:
391         (WebCore::ResourceRequest::doUpdatePlatformRequest):
392         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
393
394 2017-01-02  Yusuke Suzuki  <utatane.tea@gmail.com>
395
396         Unreviewed, follow-up fix for r210227
397         https://bugs.webkit.org/show_bug.cgi?id=166586
398
399         Suggested in the above bug.
400
401         * bindings/scripts/StaticString.pm:
402         (GenerateStrings):
403
404 2017-01-02  Yusuke Suzuki  <utatane.tea@gmail.com>
405
406         Use StaticStringImpl instead of StaticASCIILiteral
407         https://bugs.webkit.org/show_bug.cgi?id=166586
408
409         Reviewed by Darin Adler.
410
411         * bindings/scripts/StaticString.pm:
412         (GenerateStrings):
413
414 2017-01-02  Andreas Kling  <akling@apple.com>
415
416         Drop the render tree for documents in the page cache.
417         <https://webkit.org/b/121798>
418
419         Reviewed by Antti Koivisto.
420
421         To save memory and reduce complexity, have documents tear down their render tree
422         when entering the page cache. I've wanted to do this for a long time and it seems
423         like we can actually do it now.
424
425         This patch will enable a number of clean-ups since it's no longer valid for renderers
426         to exist while the document is in page cache.
427
428         * dom/Document.cpp:
429         (WebCore::Document::destroyRenderTree): Remove assertion that we're not in the page cache
430         since we will now be tearing down render trees right as they enter the page cache.
431
432         * dom/PageCache.cpp:
433         (WebCore::destroyRenderTree):
434         (WebCore::PageCache::addIfCacheable): Tear down the render tree right before setting
435         the in-cache flag. The render tree is destroyed in bottom-up order to ensure that the
436         main frame renderers die last.
437
438         * history/CachedFrame.cpp:
439         (WebCore::CachedFrameBase::restore):
440         * page/FrameView.h:
441         * page/FrameView.cpp:
442         (WebCore::FrameView::didRestoreFromPageCache): Update the scollable area set after restoring
443         a frame from the page cache. This dirties the scrolling tree, which was covered by tests.
444
445         * page/animation/AnimationBase.cpp:
446         (WebCore::AnimationBase::setNeedsStyleRecalc):
447         * page/animation/AnimationController.cpp:
448         (WebCore::AnimationController::cancelAnimations): Make these no-ops if called
449         while the render tree is being torn down. This fixes some assertion failures
450         on layout tests and avoids pointless style invalidation.
451
452 2017-01-02  Andreas Kling  <akling@apple.com>
453
454         Discard media controls JS/CSS caches under memory pressure.
455         <https://webkit.org/b/166639>
456
457         Reviewed by Antti Koivisto.
458
459         Add a RenderTheme::purgeCaches() virtual and teach the iOS and macOS implementations
460         to drop their cached media controls JS/CSS strings there. The strings are only cleared
461         if nothing else is referencing them, which gives us a decent "weak cache" behavior.
462
463         This sheds ~300kB memory on iOS with the current media controls.
464
465         * page/MemoryRelease.cpp:
466         (WebCore::releaseNoncriticalMemory):
467         * rendering/RenderTheme.h:
468         (WebCore::RenderTheme::purgeCaches):
469         * rendering/RenderThemeIOS.h:
470         * rendering/RenderThemeIOS.mm:
471         (WebCore::RenderThemeIOS::purgeCaches):
472         * rendering/RenderThemeMac.h:
473         * rendering/RenderThemeMac.mm:
474         (WebCore::RenderThemeMac::purgeCaches):
475
476 2017-01-02  Carlos Garcia Campos  <cgarcia@igalia.com>
477
478         [GTK] Since the memory pressure relief has been activated, my disk has a high usage and the desktop stalls
479         https://bugs.webkit.org/show_bug.cgi?id=164052
480
481         Reviewed by Michael Catanzaro.
482
483         Check how much memory is freed by the memory pressure handler and wait for a long time if we didn't free that
484         much.
485
486         * platform/linux/MemoryPressureHandlerLinux.cpp:
487         (WebCore::MemoryPressureHandler::EventFDPoller::EventFDPoller):
488
489 2017-01-02  Chris Fleizach  <cfleizach@apple.com>
490
491         AX: Expose block quote level to iOS API
492         https://bugs.webkit.org/show_bug.cgi?id=166629
493         <rdar://problem/29834793>
494
495         Reviewed by Darin Adler.
496
497         Expose the blockquote level to iOS Accessbility API.
498         Change the return type of blockquote level to unsigned.
499
500         Test: accessibility/ios-simulator/blockquote-level.html
501
502         * accessibility/AccessibilityObject.cpp:
503         (WebCore::AccessibilityObject::blockquoteLevel):
504         * accessibility/AccessibilityObject.h:
505         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
506         (-[WebAccessibilityObjectWrapper accessibilityBlockquoteLevel]):
507         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
508         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
509
510 2017-01-01  Jeff Miller  <jeffm@apple.com>
511
512         Update user-visible copyright strings to include 2017
513         https://bugs.webkit.org/show_bug.cgi?id=166278
514
515         Reviewed by Dan Bernstein.
516
517         * Info.plist:
518
519 2017-01-01  Zan Dobersek  <zdobersek@igalia.com>
520
521         GraphicsContextCairo: setMiterLimit() is missing the DisplayListRecorder diversion
522         https://bugs.webkit.org/show_bug.cgi?id=166539
523
524         Reviewed by Michael Catanzaro.
525
526         * platform/graphics/cairo/GraphicsContextCairo.cpp:
527         (WebCore::GraphicsContext::setMiterLimit): Call the setMiterLimit() method on the
528         m_displayListRecorder object when the GraphicsContext object is in recording mode.
529
530 2017-01-01  Zan Dobersek  <zdobersek@igalia.com>
531
532         Clean up GraphicsContext3D forward declarations, header inclusion
533         https://bugs.webkit.org/show_bug.cgi?id=166537
534
535         Reviewed by Alex Christensen.
536
537         Remove two unnecessary GraphicsContext3D forward declarations from the
538         EmptyClients and ChromeClient header files, and remove the unnecessary
539         GraphicsContext3D.h header inclusion from RenderLayerBacking.
540
541         No changes in behavior.
542
543         * loader/EmptyClients.h:
544         * page/ChromeClient.h:
545         * rendering/RenderLayerBacking.cpp:
546
547 2016-12-31  Michael Catanzaro  <mcatanzaro@igalia.com>
548
549         SecurityOrigin::create triplet constructor does not canonicalize port
550         https://bugs.webkit.org/show_bug.cgi?id=166624
551
552         Reviewed by Daniel Bates.
553
554         It is currently possible to create two different unequal SecurityOrigin objects that
555         represent the same security origin. The SecurityOrigin create functions that take URL and
556         String parameters convert the port to nullopt if it is the default port for the protocol,
557         but the separate protocol/host/port constructor doesn't. Change it to parallel the other
558         constructors.
559
560         * page/SecurityOrigin.cpp:
561         (WebCore::SecurityOrigin::create):
562         * page/SecurityOrigin.h: Export isSameOriginAs for use by tests.
563
564 2016-12-25  Darin Adler  <darin@apple.com>
565
566         Remove setDOMException and a few custom bindings
567         https://bugs.webkit.org/show_bug.cgi?id=166002
568
569         Reviewed by Sam Weinig.
570
571         * CMakeLists.txt: Removed JSFileReaderCustom.cpp.
572
573         * WebCore.xcodeproj/project.pbxproj: Removed JSFileReaderCustom.cpp.
574
575         * bindings/js/CallbackFunction.cpp:
576         (WebCore::checkFunctionOnlyCallback): Use throwTypeMismatchError instead
577         of calling setDOMException with TYPE_MISMATCH_ERR.
578
579         * bindings/js/JSBindingsAllInOne.cpp: Removed JSFileReaderCustom.cpp.
580
581         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
582         (WebCore::JSCSSStyleDeclaration::putDelegate): Pass a throw scope in to
583         propagateException.
584
585         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
586         (WebCore::JSCryptoAlgorithmDictionary::parseAlgorithmIdentifier):
587         Renamed from getAlgorithmIdentifier. Got rid of bool return value, instead
588         use a conventional return value and conventional JavaScript exception
589         handling. Added a ThrowScope argument.
590         (WebCore::optionalHashAlgorithm): Added. Returns an optional hash algorithm.
591         Also makes the same changes as above, conventional exception handling and
592         ThrowScope argument.
593         (WebCore::requiredHashAlgorithm): Added. Like the above but throws an
594         exception if the algorithm is omitted.
595         (WebCore::getHashAlgorithm): Deleted. Replaced by the two functions above.
596         (WebCore::createAesCbcParams): Updated for above changes.
597         (WebCore::createHmacParams): Ditto.
598         (WebCore::createHmacKeyParams): Ditto.
599         (WebCore::createRsaKeyGenParams): Ditto.
600         (WebCore::createRsaOaepParams): Ditto.
601         (WebCore::createRsaSsaParams): Ditto.
602         (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt): Added
603         a ThrowScope argument, and changed to use throwNotSupportedError instead
604         of setDOMException with NOT_SUPPORTED_ERROR.
605         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt): Ditto.
606         (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign): Ditto.
607         (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify):
608         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest): Ditto.
609         (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey): Ditto.
610         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey): Ditto.
611         (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits): Ditto.
612         (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): Ditto.
613         (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey): Ditto.
614         * bindings/js/JSCryptoAlgorithmDictionary.h: Updated for the above changes.
615
616         * bindings/js/JSCryptoOperationData.cpp:
617         (WebCore::cryptoOperationDataFromJSValue): Got rid of bool return value and
618         instead use a conventional return value and conventional JS exception handling.
619         Added a ThrowScope argument.
620         * bindings/js/JSCryptoOperationData.h: Updated for the above.
621
622         * bindings/js/JSCustomXPathNSResolver.cpp:
623         (WebCore::JSCustomXPathNSResolver::create): Use ExceptionOr.
624         (WebCore::JSCustomXPathNSResolver::JSCustomXPathNSResolver): Take a VM&
625         rather than an ExecState*.
626         * bindings/js/JSCustomXPathNSResolver.h: Updated for the changes above.
627         Also marked class final and fixed indentation.
628
629         * bindings/js/JSDOMBinding.cpp:
630         (WebCore::createDOMException): Updated comment.
631         (WebCore::throwDOMException): Deleted.
632         (WebCore::propagateException): Deleted non-inline overload that does not take
633         a throw scope, now that all callers pass a throw scope.
634         (WebCore::setDOMExceptionSlow): Deleted.
635         (WebCore::setDOMException): Deleted.
636         (WebCore::throwNotSupportedError): Added.
637         (WebCore::throwDOMSyntaxError): Added.
638         (WebCore::throwDataCloneError): Added.
639         (WebCore::throwIndexSizeError): Added.
640         (WebCore::throwTypeMismatchError): Added.
641         * bindings/js/JSDOMBinding.h: Updated for the additions and removals
642         above. Also grouped the standard DOM exception throwing functions separately
643         from the special ones for getters and setters, and sorted them alphabetically.
644
645         * bindings/js/JSDataCueCustom.cpp:
646         (WebCore::createJSDataCue): Added, helper function for the below.
647         (WebCore::constructJSDataCue): Tightened and tweaked a bit.
648
649         * bindings/js/JSFileReaderCustom.cpp: Removed.
650
651         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
652         (WebCore::JSHTMLOptionsCollection::setLength): Use throwIndexSizeError instead
653         of setDOMException with INDEX_SIZE_ERR.
654         * bindings/js/JSHTMLSelectElementCustom.cpp:
655         (WebCore::selectElementIndexSetter): Use throwTypeMismatchError instead of
656         setDOMExceptoin with TYPEMISMATCH_ERR.
657
658         * bindings/js/JSIDBRequestCustom.cpp:
659         (WebCore::JSIDBRequest::result): Pass a throw scope in to
660         propagateException.
661
662         * bindings/js/JSSQLResultSetRowListCustom.cpp:
663         (WebCore::JSSQLResultSetRowList::item): Use throwTypeMismatchError and
664         throwIndexSizeError instead of setDOMException with TYPE_MISMATCH_ERR and
665         INDEX_ERR. This required adding a throw scope.
666
667         * bindings/js/JSSQLTransactionCustom.cpp:
668         (WebCore::JSSQLTransaction::executeSql): Use throwDOMSyntaxError and
669         throwTypeMismatchError instead of setDOMException with SYNTAX_ERR and
670         TYPE_MISMATCH_ERR.
671
672         * bindings/js/JSStorageCustom.cpp:
673         (WebCore::JSStorage::nameGetter): Pass a throw scope in to
674         propagateException.
675
676         * bindings/js/JSSubtleCryptoCustom.cpp:
677         (WebCore::normalizeCryptoAlgorithmParameters): Use throwNotSupportedError
678         instead of setDOMException with NOT_SUPPORTED_ERR.
679         (WebCore::createAlgorithm): Deleted.
680         (WebCore::supportExportKeyThrow): Added ThrowScope argument and use
681         throwNotSupportedError instead of setDOMException with NOT_SUPPORTED_ERR.
682         (WebCore::jsSubtleCryptoFunctionEncryptPromise): Updated for above changes,
683         throwing a not supported exception at this level rather than in a helper.
684         (WebCore::jsSubtleCryptoFunctionDecryptPromise): Ditto.
685         (WebCore::jsSubtleCryptoFunctionSignPromise): Ditto.
686         (WebCore::jsSubtleCryptoFunctionVerifyPromise): Ditto.
687         (WebCore::jsSubtleCryptoFunctionDigestPromise): Ditto.
688         (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise): Ditto.
689         (WebCore::jsSubtleCryptoFunctionImportKeyPromise): Ditto.
690         (WebCore::jsSubtleCryptoFunctionExportKeyPromise): Ditto.
691         (WebCore::jsSubtleCryptoFunctionWrapKeyPromise): Ditto.
692         (WebCore::jsSubtleCryptoFunctionUnwrapKeyPromise): Ditto.
693
694         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
695         (WebCore::createAlgorithmFromJSValue): Got rid of bool return value and
696         instead use a conventional return value and conventional JS exception handling.
697         Added a ThrowScope argument.
698         (WebCore::cryptoKeyFormatFromJSValue): Ditto.
699         (WebCore::cryptoKeyUsagesFromJSValue): Ditto.
700         (WebCore::JSWebKitSubtleCrypto::encrypt): Updated for above changes.
701         (WebCore::JSWebKitSubtleCrypto::decrypt): Ditto.
702         (WebCore::JSWebKitSubtleCrypto::sign): Ditto.
703         (WebCore::JSWebKitSubtleCrypto::verify): Ditto.
704         (WebCore::JSWebKitSubtleCrypto::digest): Ditto.
705         (WebCore::JSWebKitSubtleCrypto::generateKey): Ditto.
706         (WebCore::JSWebKitSubtleCrypto::importKey): Ditto.
707         (WebCore::JSWebKitSubtleCrypto::exportKey): Ditto.
708         (WebCore::JSWebKitSubtleCrypto::wrapKey): Ditto.
709         (WebCore::JSWebKitSubtleCrypto::unwrapKey): Ditto.
710
711         * bindings/js/JSXMLHttpRequestCustom.cpp:
712         (WebCore::JSXMLHttpRequest::send): Pass a throw scope in to
713         propagateException.
714         (WebCore::JSXMLHttpRequest::responseText): Ditto.
715
716         * bindings/js/JSXPathNSResolverCustom.cpp:
717         (WebCore::JSXPathNSResolver::toWrapped): Updated since
718         JSCustomXPathNSResolver::create now uses ExceptionOr.
719
720         * bindings/js/SerializedScriptValue.cpp:
721         (WebCore::maybeThrowExceptionIfSerializationFailed): Updated to take
722         a reference instead of a pointer. Fixed the handling of success to be
723         simpler; no need to check the code twice. Use throwDataCloneError instead
724         of setDOMException with DATA_CLONE_ERR.
725         (WebCore::SerializedScriptValue::create): Updated for above.
726         (WebCore::SerializedScriptValue::deserialize): Ditto.
727
728         * bindings/js/StructuredClone.cpp:
729         (WebCore::structuredCloneArrayBuffer): Use throwDataCloneError instead of
730         setDOMException with DATA_CLONE_ERR.
731         (WebCore::structuredCloneArrayBufferView): Ditto.
732
733         * crypto/CryptoAlgorithmParametersDeprecated.h: Removed unneeded empty
734         constructor.
735         * crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Ditto,
736         moving initialization to where the data member is defined.
737         * crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Ditto.
738         * crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Ditto.
739
740         * fileapi/FileReader.cpp:
741         (WebCore::FileReader::result): Added. Returns a combination of optional
742         and variant that matches what the ID specifies. Moved the code from the
743         two following functions in here.
744         (WebCore::FileReader::arrayBufferResult): Deleted.
745         (WebCore::FileReader::stringResult): Deleted.
746         * fileapi/FileReader.h: Updated for the above.
747         * fileapi/FileReader.idl: Removed [Custom] from the result attribute and
748         declared it with the type mentioned in the specification, a nullable union.
749
750 2016-12-30  Darin Adler  <darin@apple.com>
751
752         Remove PassRefPtr use from the "dom" directory, related cleanup
753         https://bugs.webkit.org/show_bug.cgi?id=166569
754
755         Reviewed by Alex Christensen.
756
757         * CMakeLists.txt: Removed DocumentMarker.cpp.
758         * WebCore.xcodeproj/project.pbxproj: Ditto.
759
760         * bindings/js/JSPopStateEventCustom.cpp:
761         (WebCore::JSPopStateEvent::state): Pass ExecState by reference.
762
763         * dom/CharacterData.cpp:
764         (WebCore::CharacterData::dispatchModifiedEvent): Use auto.
765
766         * dom/DOMAllInOne.cpp: Removed DocumentMarker.cpp.
767
768         * dom/DOMNamedFlowCollection.cpp:
769         (WebCore::DOMNamedFlowCollection::DOMNamedFlowCollection): Updated to take
770         ownership of the passed in vector.
771         (WebCore::DOMNamedFlowCollection::create): Moved here from header.
772         (WebCore::DOMNamedFlowCollection::~DOMNamedFlowCollection): Moved here so we
773         don't need to include "WebKitNamedFlow.h" in the header.
774         (WebCore::DOMNamedFlowCollection::item): Rewrote to use Vector.
775         (WebCore::DOMNamedFlowCollection::namedItem): Rewrote to use a HashSet that
776         we build from the Vector. Uses a set of hash functions defined right here.
777         Note that the privor version of this class had incorrect use of ListHashSet
778         with safeToCompareToEmptyOrDeleted inaccurately set to true.
779         (WebCore::DOMNamedFlowCollection::supportedPropertyNames): Added this.
780         Old version just had an empty placeholder.
781         * dom/DOMNamedFlowCollection.h: Changed to no longer use ListHashSet, not
782         the right data structure for this. Removed incorrect use of "long" and
783         made some other simplifications.
784         * dom/DOMNamedFlowCollection.idl: Changed return types of item and namedItem
785         to accurately reflect the fact that they return null when the index or name
786         not found in the collection.
787
788         * dom/DataTransfer.h: Remove indentation. Remove unimplemented
789         incorrect declarations of items for ENABLE(DATA_TRANSFER_ITEMS).
790         Will be added back when someone implements that feature, or perhaps
791         ENABLE(DATA_TRANSFER_ITEMS) should be entirely removed for now?
792
793         * dom/DataTransferItem.h: Changed return type for getAsFile to
794         RefPtr. Again, part of ENABLE(DATA_TRANSFER_ITEMS), so dead code for now.
795
796         * dom/Document.cpp:
797         (WebCore::canonicalizedTitle): Removed incorrect comment claiming we
798         convert control characters to spaces. Simplified logic, removing two
799         extra loops. Changed to work on just a String rather than StringWithDirection.
800         (WebCore::Document::updateTitle): Updated to call the function above.
801         Also updated since StringWithDirection is now a struct instead of a class.
802         Call displayBuffer on the encoding directly instead of calling a member
803         function named displayBufferModifiedByEncoding.
804         (WebCore::Document::updateTitleFromTitleElement): Updated since
805         StringWithDirection is now a struct.
806         (WebCore::Document::setTitle): Removed code that unnecessarily calls
807         updateTitle twice; once indirectly by calling setTextContent on the
808         title elmeent and once by directly calling updateTitle.
809         (WebCore::Document::setWindowAttributeEventListener): Take a RefPtr&&.
810         (WebCore::Document::statePopped): Take a Ref&&.
811         (WebCore::Document::displayStringModifiedByEncoding): Deleted unused overload.
812         (WebCore::Document::displayBufferModifiedByEncodingInternal): Deleted.
813         (WebCore::Document::requestAnimationFrame): Take a Ref&&.
814         * dom/Document.h: Updated for changes above. Also changed the title function
815         to return a const String& to slightly cut down on reference count churn.
816         (WebCore::Document::displayBufferModifiedByEncoding): Deleted.
817
818         * dom/DocumentMarker.cpp: Removed.
819         * dom/DocumentMarker.h: Reworked the DocumentMarker class to use a variant
820         instead of a separate reference counted DocumentMarkerDetails object.
821
822         * dom/DocumentMarkerController.cpp:
823         (WebCore::DocumentMarkerController::addMarkerToNode): Changed argument
824         type to DocumentMarker::Data&&.
825         (DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
826         clearDetails -> clearData
827         (DocumentMarkerController::showMarkers): activeMatch -> isActiveMatch
828         * dom/DocumentMarkerController.h: Updated for the above.
829
830         * dom/DocumentParser.h: Fixed incorrect reference to PassRefPtr in a comment.
831
832         * dom/Element.cpp:
833         (WebCore::Element::willModifyAttribute): Use auto.
834
835         * dom/Event.cpp:
836         (WebCore::Event::isDragEvent): Deleted. Unused.
837         (WebCore::Event::cloneFor): Deleted. Unused function left over from the
838         start of an implementation of seamless frames.
839         * dom/Event.h: Updated for the above.
840
841         * dom/EventContext.cpp: Tweaked blank lines.
842         * dom/EventContext.h: Removed unnecessary includes and forward declarations.
843         Changed setRelatedTarget to take a raw pointer instead of PassRefPtr since
844         callers aren't passing ownership. Moved TouchEventContext::touchList body
845         out of the class definition since it's a bit long. Deleted unused
846         toTouchEventContext functions. FIxed incorrect comment.
847
848         * dom/MessageEvent.cpp:
849         (WebCore::MessageEvent::initMessageEvent): Removed unused overload.
850         * dom/MessageEvent.h: Updated for above. Also changed the
851         dataAsSerializedScriptValue function to return a raw pointer instead of
852         PassRefPtr since it is not passing ownership.
853
854         * dom/MouseEvent.cpp:
855         (WebCore::MouseEvent::create): Use raw pointer instead of PassRefPtr for
856         data transfer and related target arguments.
857         (WebCore::MouseEvent::MouseEvent): Ditto. Also use IntPoint instead of
858         separate ints for the various X/Y pairs.
859         (WebCore::MouseEvent::initMouseEvent): Take a raw pointer for event target.
860         (WebCore::MouseEvent::isDragEvent): Reformatted, sorted alphabetically,
861         added comment about why this function probably needs to go.
862         (WebCore::adjustedClientX): Deleted.
863         (WebCore::adjustedClientY): Deleted.
864         (WebCore::MouseEvent::cloneFor): Deleted.
865         * dom/MouseEvent.h: Updated for the above. Also made more functions private
866         and final and initialized more of the data members.
867
868         * dom/MutationEvent.cpp:
869         (WebCore::MutationEvent::MutationEvent): Pass related node as a raw pointer.
870         (WebCore::MutationEvent::initMutationEvent): Ditto.
871         * dom/MutationEvent.h: Updated for the above. Fixed indentation. Removed
872         unnecessary explicit destructor; default generated one is fine. Initialize
873         m_attrChange in the class definition.
874
875         * dom/MutationObserver.cpp:
876         (WebCore::MutationObserver::observe): Pass reference.
877         (WebCore::MutationObserver::disconnect): Call unregisterMutationObserver
878         directly instead of calling unregisterAndDelete.
879
880         * dom/MutationObserverInterestGroup.cpp:
881         (WebCore::MutationObserverInterestGroup::MutationObserverInterestGroup):
882         Take an rvalue reference to the HashMap and use move.
883         (WebCore::MutationObserverInterestGroup::createIfNeeded): Updated to call
884         registeredMutationObservers.
885         * dom/MutationObserverInterestGroup.h: Updated for the above.
886
887         * dom/MutationObserverRegistration.cpp:
888         (WebCore::MutationObserverRegistration::MutationObserverRegistration):
889         Take a reference to the observer instead of PassRefPtr. Also take a
890         refererence to the node rather than a pointer.
891         (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
892         Updated to use references instead of pointers.
893         (WebCore::MutationObserverRegistration::clearTransientRegistrations): Ditto.
894         (WebCore::MutationObserverRegistration::unregisterAndDelete): Deleted.
895         (WebCore::MutationObserverRegistration::shouldReceiveMutationFrom): Ditto.
896         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet): Ditto.
897         * dom/MutationObserverRegistration.h: Updated for above changes. Also added
898         a node member function. Changed m_observer to a Ref and m_node to a reference.
899         Removed the NodeHashSet typedef.
900
901         * dom/NamedFlowCollection.cpp:
902         (WebCore::NamedFlowCollection::createCSSOMSnapshot): Pass a vector of Ref
903         instead of a vector of raw pointers and pass it as an rvalue reference so
904         it can be taken over by the named flow collection wrapper.
905
906         * dom/Node.cpp:
907         (WebCore::Node::mutationObserverRegistry): Use auto and nullptr.
908         (WebCore::Node::transientMutationObserverRegistry): Ditto.
909         (WebCore::collectMatchingObserversForMutation): Use references instead of pointers.
910         (WebCore::Node::registeredMutationObservers): Changed to return a map instead of
911         filling one in and renamed to remove "get" from name.
912         (WebCore::Node::registerMutationObserver): Use references instead of pointers.
913         (WebCore::Node::unregisterMutationObserver): Ditto.
914         (WebCore::Node::registerTransientMutationObserver): Ditto.
915         (WebCore::Node::unregisterTransientMutationObserver): Ditto.
916         (WebCore::Node::notifyMutationObserversNodeWillDetach): Ditto.
917         * dom/Node.h: Updated for the above.
918
919         * dom/PopStateEvent.cpp:
920         (WebCore::PopStateEvent::PopStateEvent): Use RefPtr&& instead of PassRefPtr.
921         (WebCore::PopStateEvent::create): Use a raw pointer instead of PassRefPtr.
922         (WebCore::PopStateEvent::trySerializeState): Take a reference to ExecState.
923         * dom/PopStateEvent.h: Updated for the above.
924
925         * dom/Position.cpp:
926         (WebCore::Position::Position): Take a raw pointer instead of PassRefPtr.
927         (WebCore::Position::moveToPosition): Ditto.
928         * dom/Position.h: Updated for the above, also changed createLegacyEditingPosition
929         in the same way and got rid of the LegacyEditingPosition class.
930
931         * dom/Range.cpp:
932         (WebCore::Range::Range): Changed startContainer and endContainer to RefPtr<Node>&&.
933         Later this needs to be changed more, but for now this keeps code changes to a minimum.
934         (WebCore::Range::create): Changed startContainer and endContainer to Node*.
935         * dom/Range.h: Updated for the above.
936
937         * dom/ScopedEventQueue.cpp:
938         (WebCore::ScopedEventQueue::dispatchEvent): Removed a comment that talks about
939         PassRefPtr, and simplified the code since the comment is no longer valid.
940
941         * dom/ScriptExecutionContext.cpp:
942         (WebCore::ScriptExecutionContext::PendingException::PendingException):
943         Take a RefPtr&& instead of a PassRefPtr.
944         (WebCore::ScriptExecutionContext::ScriptExecutionContext): Moved initialization
945         of all the data members up to the class definition.
946         (WebCore::ScriptExecutionContext::sanitizeScriptError): Use ASCIILiteral.
947         (WebCore::ScriptExecutionContext::reportException): Use WTFMove when passing
948         arguments to the PendingException constructor and using a value from the
949         PendingException just before destroying it.
950
951         * dom/ScriptExecutionContext.h: Changed addTimeout to take a reference rather
952         than a PassRefPtr to the timer. Callers were not passing ownership. Also
953         initialize all the data members here in the class definition.
954
955         * dom/ScriptedAnimationController.cpp:
956         (WebCore::ScriptedAnimationController::registerCallback): Take a Ref&&.
957         * dom/ScriptedAnimationController.h: Updated for the above.
958
959         * dom/SimulatedClick.cpp:
960         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent): Updated since MouseEvent
961         constructor arguments changed to use IntPoint.
962         * dom/WheelEvent.cpp:
963         (WebCore::WheelEvent::WheelEvent): Ditto. Also removed some unneeded initializers
964         now that the header does more.
965         (WebCore::WheelEvent::initWheelEvent): Tweaed style a bit.
966         (WebCore::WheelEvent::initWebKitWheelEvent): Deleted. Moved to the header since it's
967         just an inline that forwards to initWheelEvent.
968         * dom/WheelEvent.h: Updated for the above.
969
970         * dom/make_event_factory.pl:
971         (generateImplementation): Use RefPtr instead of PassRefPtr. A couple other tweaks.
972
973         * editing/AlternativeTextController.cpp:
974         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Use the data
975         insetad of details.
976         (WebCore::AlternativeTextController::removeDictationAlternativesForMarker):
977         Ditto, also changed to take reference instead of pointer.
978         (WebCore::AlternativeTextController::dictationAlternativesForMarker): Ditto.
979         (WebCore::AlternativeTextController::applyDictationAlternative): Ditto.
980         * editing/AlternativeTextController.h: Updated for the above.
981
982         * editing/ApplyBlockElementCommand.cpp:
983         (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
984         Updated since Position now takes a raw pointer.
985         * editing/ApplyStyleCommand.cpp:
986         (WebCore::ApplyStyleCommand::joinChildTextNodes): Ditto.
987         * editing/CompositeEditCommand.cpp:
988         (WebCore::CompositeEditCommand::replaceSelectedTextInNode): Ditto.
989         (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring): Ditto.
990
991         * editing/DictationCommand.cpp:
992         (WebCore::DictationMarkerSupplier::addMarkersToTextNode): Updated to use the
993         DictationData struct.
994
995         * editing/Editor.cpp:
996         (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Pass a reference.
997         (WebCore::Editor::dictationAlternativesForMarker): Take a reference.
998         * editing/Editor.h: Updated for the above.
999
1000         * editing/InsertTextCommand.cpp:
1001         (WebCore::InsertTextCommand::performOverwrite): Updated since Position now takes
1002         a raw pointer.
1003         (WebCore::InsertTextCommand::doApply): Ditto.
1004         (WebCore::InsertTextCommand::insertTab): Ditto.
1005         * editing/ReplaceSelectionCommand.cpp:
1006         (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition): Ditto.
1007
1008         * html/HTMLTitleElement.cpp:
1009         (WebCore::HTMLTitleElement::computedTextWithDirection): Updated since
1010         StringWithDirection is now a struct.
1011
1012         * loader/FrameLoader.cpp:
1013         (WebCore::FrameLoader::submitForm): Use Ref&& for the form submission.
1014         (WebCore::FrameLoader::receivedFirstData): Updated for change to StringWithDirection.
1015         (WebCore::FrameLoader::commitProvisionalLoad):
1016         (WebCore::FrameLoader::didBeginDocument): Pass a reference.
1017         (WebCore::FrameLoader::loadURLIntoChildFrame): Pass a Ref to loadArchive.
1018         (WebCore::FrameLoader::loadArchive): Take a Ref&& for the archive.
1019         (WebCore::FrameLoader::loadInSameDocument): Take a raw pointer for the
1020         serialized script value state object. No one was passing ownership.
1021         But pass it along to statePopped as a Ref since we need to pass ownership
1022         of the null value, at least for now.
1023         (WebCore::FrameLoader::loadFrameRequest): Take a raw pointer for form state.
1024         No one was passing ownership.
1025         (WebCore::FrameLoader::loadURL): Ditto.
1026         (WebCore::FrameLoader::load): Ditto.
1027         (WebCore::FrameLoader::loadWithNavigationAction): Ditto.
1028         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
1029         (WebCore::FrameLoader::loadPostRequest): Ditto.
1030         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): Ditto.
1031         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Ditto.
1032         * loader/FrameLoader.h: Updated for the above and to remove an unneeded forward
1033         declaration of StringWithDirection, which is not used here.
1034
1035         * loader/FrameLoaderClient.h: Updated forward declaration of StringWithDirection.
1036         Also sorted the others and removed unneeded conditionals.
1037
1038         * loader/HistoryController.cpp:
1039         (WebCore::HistoryController::setCurrentItemTitle): Updated to use struct.
1040         (WebCore::HistoryController::initializeItem): Ditto.
1041         * loader/HistoryController.h: Updated forward declaration of StringWithDirection.
1042
1043         * loader/PolicyCallback.cpp:
1044         (WebCore::PolicyCallback::PolicyCallback): Deleted. Default works fine.
1045         (WebCore::PolicyCallback::~PolicyCallback): Ditto.
1046         (WebCore::PolicyCallback::set): Take a raw pointer to form state.
1047         * loader/PolicyCallback.h: Use raw pointer for form state.
1048
1049         * loader/PolicyChecker.cpp:
1050         (WebCore::PolicyChecker::checkNavigationPolicy): Take a raw pointer for form state.
1051         (WebCore::PolicyChecker::checkNewWindowPolicy): Ditto.
1052         * loader/PolicyChecker.h: Updated for the above.
1053
1054         * page/DOMTimer.cpp:
1055         (WebCore::DOMTimer::DOMTimer): Pass reference to addTimeout function.
1056
1057         * page/DOMWindow.cpp:
1058         (WebCore::DOMWindow::requestAnimationFrame): Use Ref&& for callback.
1059         (WebCore::DOMWindow::webkitRequestAnimationFrame): Ditto.
1060         (WebCore::DOMWindow::cancelAnimationFrame): Tweak coding style.
1061         * page/DOMWindow.h: Updated for the above.
1062
1063         * platform/PlatformWheelEvent.h: Use pragma once. Tweaked header indentation.
1064         Simplified constructors by initializing data members.
1065
1066         * platform/text/StringWithDirection.h: Use pragma once. Use struct instead of class.
1067
1068         * rendering/HitTestResult.cpp:
1069         (WebCore::HitTestResult::dictationAlternatives): Pass a reference.
1070
1071         * rendering/InlineTextBox.cpp:
1072         (WebCore::InlineTextBox::paintTextMatchMarker): activeMatch -> isActiveMatch
1073
1074 2016-12-30  Darin Adler  <darin@apple.com>
1075
1076         Remove PassRefPtr use from the "css" directory, related cleanup
1077         https://bugs.webkit.org/show_bug.cgi?id=166628
1078
1079         Reviewed by Alex Christensen.
1080
1081         * css/CSSCalculationValue.cpp:
1082         (WebCore::CSSCalcBinaryOperation::create): Take RefPtr&& instead of PassRefPtr.
1083         Also added some checks for null. Code here is really inconsistent about null;
1084         probably should change from RefPtr to Ref at some point.
1085         (WebCore::CSSCalcBinaryOperation::createSimplified): Ditto.
1086         (WebCore::CSSCalcBinaryOperation::CSSCalcBinaryOperation): Take Ref&& instead
1087         of PassRefPtr.
1088
1089         * css/CSSCrossfadeValue.cpp:
1090         (WebCore::subimageKnownToBeOpaque): Take a reference instead of a pointer.
1091         (WebCore::CSSCrossfadeValue::SubimageObserver::SubimageObserver): Moved here
1092         from the header, and renamed.
1093         (WebCore::CSSCrossfadeValue::SubimageObserver::imageChanged): Ditto.
1094         (WebCore::CSSCrossfadeValue::CSSCrossfadeValue): Moved here from the header.
1095         (WebCore::CSSCrossfadeValue::create): Ditto.
1096         (WebCore::CSSCrossfadeValue::~CSSCrossfadeValue): Updated for data member name change.
1097         (WebCore::CSSCrossfadeValue::fixedSize): Take a reference. Also rewrote size math to
1098         take advantage of FloatSize multiplication and addition operators.
1099         (WebCore::CSSCrossfadeValue::knownToBeOpaque): Take a reference.
1100         (WebCore::CSSCrossfadeValue::loadSubimages): Set m_subimagesAreReady rather than
1101         calling setReady on the subimage observer.
1102         (WebCore::CSSCrossfadeValue::image): Return a raw pointer rather than a RefPtr.
1103         Take a reference instead of a pointer.
1104         (WebCore::CSSCrossfadeValue::crossfadeChanged): Removed unused rect argument.
1105         Rewrote to use modern for loop.
1106         * css/CSSCrossfadeValue.h: Updated for above changes.
1107
1108         * css/CSSGradientValue.cpp:
1109         (WebCore::createGradient): Added. Helper so the function below can use Ref rather
1110         than RefPtr, and it's also nice to factor out this "poor man's virtual function".
1111         (WebCore::CSSGradientValue::image): Take a reference rather than a pointer.
1112         (WebCore::clone): Added. Helper like createGradient above.
1113         (WebCore::CSSGradientValue::gradientWithStylesResolved): Take a reference rather
1114         than a pointer. Simplified by using the helper above.
1115         (WebCore::CSSGradientValue::knownToBeOpaque): Removed unused argument. Rewrote to
1116         use a modern for loop.
1117         * css/CSSGradientValue.h: Updated for above changes.
1118
1119         * css/CSSImageGeneratorValue.cpp: Moved the CachedGeneratedImage class in here
1120         from the header. Also changed it to use const and Ref.
1121         (WebCore::CSSImageGeneratorValue::addClient): Take a reference rather than a pointer.
1122         (WebCore::CSSImageGeneratorValue::removeClient): Ditto.
1123         (WebCore::CSSImageGeneratorValue::cachedImageForSize): Updated since image now returns
1124         a reference rather than a pointer.
1125         (WebCore::CSSImageGeneratorValue::saveCachedImageForSize): Take a reference rather
1126         than PassRefPtr.
1127         (WebCore::CSSImageGeneratorValue::image): Take a reference rather than a pointer.
1128         (WebCore::CSSImageGeneratorValue::fixedSize): Ditto.
1129         (WebCore::CSSImageGeneratorValue::knownToBeOpaque): Ditto.
1130         * css/CSSImageGeneratorValue.h: Updated for above changes.
1131
1132         * css/CSSValuePool.cpp:
1133         (WebCore::CSSValuePool::createFontFaceValue): Return a RefPtr rather than PassRefPtr.
1134         * css/CSSValuePool.h: Updated for the above.
1135
1136         * css/StyleBuilderConverter.h: Change convertStyleImage and convertShapeValue to
1137         return RefPtr instead of PassRefPtr.
1138
1139         * css/StyleBuilderCustom.h:
1140         (WebCore::StyleBuilderCustom::applyValueContent): Since gradientWithStylesResolved
1141         returns a Ref now, no need to dereference it any more. This also removes reference
1142         count churn since we are now passing a Ref temporary to a Ref&&.
1143         * css/StyleResolver.cpp:
1144         (WebCore::StyleResolver::styleImage): Ditto.
1145
1146         * platform/graphics/GradientImage.cpp:
1147         (WebCore::GradientImage::GradientImage): Pass generator as a reference rather than
1148         as a PassRefPtr.
1149         (WebCore::GradientImage::draw): Updated since m_gradient is now a Ref rather than
1150         a RefPtr.
1151         (WebCore::GradientImage::drawPattern): Ditto.
1152         * platform/graphics/GradientImage.h: Updated for the above changes. Make things
1153         private rather than protected since this class is final.
1154
1155         * rendering/style/StyleGeneratedImage.cpp:
1156         (WebCore::StyleGeneratedImage::imageSize): Pass renderer as a reference. Later, we
1157         should change the interface to this function, too.
1158         (WebCore::StyleGeneratedImage::addClient): Ditto.
1159         (WebCore::StyleGeneratedImage::removeClient): Ditto.
1160         (WebCore::StyleGeneratedImage::image): Ditto.
1161         (WebCore::StyleGeneratedImage::knownToBeOpaque): Ditto.
1162
1163 2016-12-30  Olivier Blin  <olivier.blin@softathome.com>
1164
1165         [EFL] fix buffer over-read in RenderThemeEfl::mediaControlsStyleSheet()
1166         https://bugs.webkit.org/show_bug.cgi?id=166622
1167
1168         Reviewed by Gyuyoung Kim.
1169
1170         This has been detected by a charactersAreAllASCII() assert failure.
1171         Initially in WebKitForWayland (WPE), but the code was likely borrowed from EFL.
1172
1173         This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet().
1174         mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string.
1175         It is thus incorrect to use StringImpl::createFromLiteral() that calls
1176         strlen() to get the string length.
1177
1178         The String::ConstructFromLiteral constructor can not be used, since it
1179         skips the last character.
1180
1181         * rendering/RenderThemeEfl.cpp:
1182         (WebCore::RenderThemeEfl::mediaControlsStyleSheet):
1183         Explicitely pass the size to the String constructor.
1184
1185 2016-12-30  Commit Queue  <commit-queue@webkit.org>
1186
1187         Unreviewed, rolling out r210206.
1188         https://bugs.webkit.org/show_bug.cgi?id=166621
1189
1190         Crashes on macOS PLT (Requested by kling on #webkit).
1191
1192         Reverted changeset:
1193
1194         "Drop the render tree for documents in the page cache."
1195         https://bugs.webkit.org/show_bug.cgi?id=121798
1196         http://trac.webkit.org/changeset/210206
1197
1198 2016-12-28  Sergio Villar Senin  <svillar@igalia.com>
1199
1200         [css-grid] Isolate instrinsic size computation from layout
1201         https://bugs.webkit.org/show_bug.cgi?id=166530
1202
1203         Reviewed by Darin Adler.
1204
1205         This is the last patch of the items placement data refactoring. By using a different Grid
1206         instance in computeIntrinsicLogicalWidths we effectively isolate the intrinsic size
1207         computation from the layout. They are now using different data structures so they don't
1208         interfere each other.
1209
1210         This also means that we no longer reuse the placement of items done in the intrinsic size
1211         computation. That shouldn't be a big issue once we make m_grid persistent on RenderGrid.
1212
1213         Last but not least, this patch finally removes the ugly const_cast's we had in
1214         computeIntrinsicLogicalWidths() as we no longer modify the internal state of RenderGrid.
1215
1216         Tests: fast/css-grid-layout/grid-auto-repeat-intrinsic.html
1217                fast/css-grid-layout/grid-change-intrinsic-size-with-auto-repeat-tracks.html
1218
1219         * rendering/RenderGrid.cpp:
1220         (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Use a new instance of Grid.
1221         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat): Fixed a missing m_grid -> grid
1222         rename.
1223         (WebCore::RenderGrid::placeItemsOnGrid): Constify it. It nows repositions the items if the
1224         number of auto repeat tracks has changed.
1225         * rendering/RenderGrid.h:
1226
1227 2016-12-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1228
1229         [GTK] Improve user agent construction
1230         https://bugs.webkit.org/show_bug.cgi?id=142074
1231
1232         Reviewed by Carlos Garcia Campos.
1233
1234         Using the macOS quirk rather than the Chrome quirk for Google domains was a mistake: it
1235         broke Hangouts in a different way than the Chrome quirk, and also prevents use of the nice
1236         Earth mode on Google Maps. Google is making it really hard to develop a sane quirk.
1237         Eventually I settled on the combination of two quirks: (1) Firefox browser, and (2) Linux
1238         x86_64 platform. See the bug for full discussion on why these quirks are the best way to
1239         make Google domains work properly in WebKit. This is an extremely sad state of affairs, but
1240         I'm confident it is the best option. Note this effectively includes a rollout of r210168.
1241
1242         Also, fix a bug that caused an extra space to be inserted in the middle of the user agent.
1243
1244         * platform/UserAgentQuirks.cpp:
1245         (WebCore::isGoogle):
1246         (WebCore::urlRequiresFirefoxBrowser):
1247         (WebCore::urlRequiresMacintoshPlatform):
1248         (WebCore::urlRequiresLinuxDesktopPlatform):
1249         (WebCore::UserAgentQuirks::quirksForURL):
1250         (WebCore::UserAgentQuirks::stringForQuirk):
1251         (WebCore::UserAgentQuirks::firefoxRevisionString):
1252         * platform/UserAgentQuirks.h:
1253         * platform/gtk/UserAgentGtk.cpp:
1254         (WebCore::buildUserAgentString):
1255
1256 2016-12-30  Andreas Kling  <akling@apple.com>
1257
1258         Drop the render tree for documents in the page cache.
1259         <https://webkit.org/b/121798>
1260
1261         Reviewed by Darin Adler.
1262
1263         To save memory and reduce complexity, have documents tear down their render tree
1264         when entering the page cache. I've wanted to do this for a long time and it seems
1265         like we can actually do it now.
1266
1267         This patch will enable a number of clean-ups since it's no longer valid for renderers
1268         to exist while the document is in page cache.
1269
1270         * dom/Document.cpp:
1271         (WebCore::Document::destroyRenderTree): Remove assertion that we're not in the page cache
1272         since we will now be tearing down render trees right as they enter the page cache.
1273
1274         (WebCore::Document::setPageCacheState): Tear down the render tree right before setting
1275         the in-cache flag. From now on, there should not exist render objects for documents in
1276         the page cache.
1277
1278         * history/CachedFrame.cpp:
1279         (WebCore::CachedFrameBase::restore):
1280         * page/FrameView.h:
1281         * page/FrameView.cpp:
1282         (WebCore::FrameView::didRestoreFromPageCache): Update the scollable area set after restoring a
1283         frame from the page cache. This dirties the scrolling tree, which was covered by tests.
1284
1285         * page/animation/AnimationBase.cpp:
1286         (WebCore::AnimationBase::setNeedsStyleRecalc): Make this a no-op if the render tree is being
1287         torn down. This fixes assertions firing on animation tests.
1288
1289 2016-12-29  Chris Fleizach  <cfleizach@apple.com>
1290
1291         AX: Need to expose frames to iOS Accessibility
1292         https://bugs.webkit.org/show_bug.cgi?id=166571
1293         <rdar://problem/29823724>
1294
1295         Reviewed by Darin Adler.
1296
1297         To support navigation by frame for VoiceOver on iOS, we need to expose the frame ancestor. 
1298
1299         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1300         (-[WebAccessibilityObjectWrapper _accessibilityFrameAncestor]):
1301
1302 2016-12-09  Sergio Villar Senin  <svillar@igalia.com>
1303
1304         [css-grid] Move Grid into GridSizingData
1305         https://bugs.webkit.org/show_bug.cgi?id=165654
1306
1307         Reviewed by Darin Adler.
1308
1309         The grid track sizing algorithm has been using the m_grid attribute from RenderGrid to
1310         compute the sizes of the tracks unconditionally. However the goal is to make it work against
1311         a generic instance of the Grid class, so that the intrinsic size computation and the layout
1312         processes could be effectively decoupled.
1313
1314         Instead of passing the Grid as a new argument to all the track sizing algorithm methods we
1315         leverage the existence of GridSizingData which is already passed to all of them. This data
1316         structure holds from now on a reference to the Grid instance so that the track sizing
1317         algorithm could use it.
1318
1319         No new tests as this is a refactoring.
1320
1321         * rendering/RenderGrid.cpp:
1322         (WebCore::RenderGrid::GridSizingData::GridSizingData):
1323         (WebCore::RenderGrid::GridSizingData::grid):
1324         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
1325         (WebCore::RenderGrid::computeTrackSizesForDirection):
1326         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
1327         (WebCore::RenderGrid::layoutBlock):
1328         (WebCore::RenderGrid::guttersSize):
1329         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
1330         (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
1331         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
1332         (WebCore::RenderGrid::computeFlexSizedTracksGrowth):
1333         (WebCore::RenderGrid::computeFlexFactorUnitSize):
1334         (WebCore::RenderGrid::findFlexFactorUnitSize):
1335         (WebCore::RenderGrid::rawGridTrackSize):
1336         (WebCore::RenderGrid::gridTrackSize):
1337         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks):
1338         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1339         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
1340         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
1341         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
1342         (WebCore::RenderGrid::trackSizesForComputedStyle):
1343         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
1344         (WebCore::RenderGrid::layoutGridItems):
1345         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1346         (WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):
1347         (WebCore::RenderGrid::gridAreaBreadthForChild):
1348         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
1349         (WebCore::RenderGrid::populateGridPositionsForDirection):
1350         (WebCore::RenderGrid::columnAxisOffsetForChild):
1351         (WebCore::RenderGrid::rowAxisOffsetForChild):
1352         (WebCore::RenderGrid::findChildLogicalPosition):
1353         (WebCore::RenderGrid::numTracks):
1354         (WebCore::RenderGrid::paintChildren):
1355         * rendering/RenderGrid.h:
1356
1357 2016-12-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1358
1359         [GTK] Improve user agent construction
1360         https://bugs.webkit.org/show_bug.cgi?id=142074
1361
1362         Reviewed by Carlos Garcia Campos.
1363
1364         Use the macOS rather than the Chrome quirk for Google domains, to avoid problems with
1365         Google Calendar and Google Maps.
1366
1367         * platform/UserAgentQuirks.cpp:
1368         (WebCore::urlRequiresChromeBrowser):
1369         (WebCore::urlRequiresMacintoshPlatform):
1370
1371 2016-12-26  Zalan Bujtas  <zalan@apple.com>
1372
1373         ASSERTION FAILED: !rect.isEmpty() in WebCore::GraphicsContext::drawRect
1374         https://bugs.webkit.org/show_bug.cgi?id=163461
1375
1376         Reviewed by Darin Adler.
1377
1378         Make sure we don't paint empty rects.
1379
1380         Test: fast/lists/assert-on-empty-list-marker.html
1381
1382         * rendering/RenderListMarker.cpp:
1383         (WebCore::RenderListMarker::paint):
1384
1385 2016-12-25  Chris Fleizach  <cfleizach@apple.com>
1386
1387         AX: Headers of table not read by VoiceOver
1388         https://bugs.webkit.org/show_bug.cgi?id=158693
1389         <rdar://problem/26771065>
1390
1391         Reviewed by Darin Adler.
1392
1393         If a table cell header is hidden, by pushing off screen then the content won't be accessible.
1394         It seems that unless specifically requested (such as using aria-hidden), we should try to return
1395         that table cell header.
1396
1397         Test: accessibility/hidden-th-still-column-header.html
1398
1399         * accessibility/AccessibilityTableColumn.cpp:
1400         (WebCore::AccessibilityTableColumn::headerObjectForSection):
1401
1402 2016-12-25  Yusuke Suzuki  <utatane.tea@gmail.com>
1403
1404         Propagate the source origin as much as possible
1405         https://bugs.webkit.org/show_bug.cgi?id=166348
1406
1407         Reviewed by Darin Adler.
1408
1409         * bindings/js/CachedScriptSourceProvider.h:
1410         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
1411         * bindings/js/JSLazyEventListener.cpp:
1412         (WebCore::JSLazyEventListener::initializeJSFunction):
1413         * bindings/js/ScriptSourceCode.h:
1414         (WebCore::ScriptSourceCode::ScriptSourceCode):
1415         * bridge/NP_jsobject.cpp:
1416         (_NPN_Evaluate):
1417         * bridge/objc/WebScriptObject.mm:
1418         (-[WebScriptObject evaluateWebScript:]):
1419
1420 2016-12-24  Sam Weinig  <sam@webkit.org>
1421
1422         [WebIDL] Remove (most) custom bindings for the IndexedDB code
1423         https://bugs.webkit.org/show_bug.cgi?id=166451
1424
1425         Reviewed by Darin Adler.
1426
1427         Removes the custom bindings for all but one attribute (IDBRequest.result) in
1428         the IndexedDB code.
1429         - Adds a new WebIDL extension type, IDBKey, to represent the complex key conversion
1430           rules IndexedDB specifies.
1431         - Replaces custom bindings for IDBCursor.source with use of a union.
1432         - Replaces custom enum type checking for IDBCursor.direction with a WebIDL enum.
1433         - Replaces custom code generation for IDBKeyPaths with a union.
1434
1435         * CMakeLists.txt:
1436         * DerivedSources.make:
1437         * WebCore.xcodeproj/project.pbxproj:
1438         Add new files.
1439
1440         * Modules/indexeddb/IDBCursor.cpp:
1441         (WebCore::IDBCursor::source):
1442         (WebCore::IDBCursor::direction):
1443         (WebCore::IDBCursor::directionNext): Deleted.
1444         (WebCore::IDBCursor::directionNextUnique): Deleted.
1445         (WebCore::IDBCursor::directionPrev): Deleted.
1446         (WebCore::IDBCursor::directionPrevUnique): Deleted.
1447         (WebCore::IDBCursor::stringToDirection): Deleted.
1448         (WebCore::IDBCursor::directionToString): Deleted.
1449         * Modules/indexeddb/IDBCursor.h:
1450         (WebCore::IDBCursor::objectStore): Deleted.
1451         (WebCore::IDBCursor::index): Deleted.
1452         Replace custom enum checking with direct use of the enum, letting the generator
1453         handle the checks. Also adds source function which returns a Variant.
1454
1455         * Modules/indexeddb/IDBCursor.idl:
1456         Remove custom annotation and use correct types.
1457
1458         * Modules/indexeddb/IDBCursorDirection.h: Added.
1459         * Modules/indexeddb/IDBCursorDirection.idl: Added.
1460
1461         * Modules/indexeddb/IDBIndex.cpp:
1462         (WebCore::IDBIndex::openCursor):
1463         (WebCore::IDBIndex::openKeyCursor):
1464         * Modules/indexeddb/IDBIndex.h:
1465         * Modules/indexeddb/IDBIndex.idl:
1466         * Modules/indexeddb/IDBObjectStore.cpp:
1467         (WebCore::IDBObjectStore::openCursor):
1468         (WebCore::IDBObjectStore::openKeyCursor):
1469         * Modules/indexeddb/IDBObjectStore.h:
1470         * Modules/indexeddb/IDBObjectStore.idl:
1471         Replace Strings with IDBCursorDirection enums.
1472
1473         * Modules/indexeddb/IDBKeyRange.idl:
1474         Remove annotation and use new IDBKey extension type.
1475
1476         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1477         (WebCore::IDBOpenDBRequest::onSuccess):
1478         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
1479         (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
1480         Use ReadyState enum in place of the old m_isDone boolean.
1481
1482         * Modules/indexeddb/IDBRequest.cpp:
1483         (WebCore::IDBRequest::IDBRequest):
1484         (WebCore::IDBRequest::error):
1485         (WebCore::IDBRequest::source):
1486         (WebCore::IDBRequest::dispatchEvent):
1487         (WebCore::IDBRequest::willIterateCursor):
1488         (WebCore::IDBRequest::completeRequestAndDispatchEvent):
1489         (WebCore::IDBRequest::readyState): Deleted.
1490         * Modules/indexeddb/IDBRequest.h:
1491         (WebCore::IDBRequest::readyState):
1492         (WebCore::IDBRequest::isDone):
1493         (WebCore::IDBRequest::objectStoreSource): Deleted.
1494         (WebCore::IDBRequest::indexSource): Deleted.
1495         (WebCore::IDBRequest::cursorSource): Deleted.
1496         * Modules/indexeddb/IDBRequest.idl:
1497         Replace the readyState String with a enum, and the custom source binding with a
1498         source function that returns a Variant.
1499
1500         * Modules/indexeddb/IndexedDB.h:
1501         Add the missing values to CursorDirection to make it comply with the IDL definition.
1502
1503         * bindings/generic/IDLTypes.h:
1504         * bindings/js/JSDOMConvert.h:
1505         (WebCore::JSConverter<IDLIDBKey<T>>::convert):
1506         Add new extension type IDLIDBKey.
1507
1508         * bindings/js/JSIDBCursorCustom.cpp:
1509         (WebCore::JSIDBCursor::source): Deleted.
1510         * bindings/js/JSIDBRequestCustom.cpp:
1511         (WebCore::JSIDBRequest::source): Deleted.
1512         Remove custom bindings.
1513
1514         * bindings/scripts/CodeGenerator.pm:
1515         (IsBuiltinType):
1516         * bindings/scripts/CodeGeneratorJS.pm:
1517         (GetBaseIDLType):
1518         (NativeToJSValueDOMConvertNeedsState):
1519         (NativeToJSValueDOMConvertNeedsGlobalObject):
1520         (NativeToJSValue):
1521         Add support for IDBKey, and remove custom code for IndexedDB in core conversion logic.
1522
1523         * bindings/scripts/IDLAttributes.txt:
1524         Remove now unused ImplementationReturnType attribute.
1525
1526         * inspector/InspectorIndexedDBAgent.cpp:
1527         Update to work with new functions taking enums rather than strings.
1528
1529 2016-12-23  Simon Fraser  <simon.fraser@apple.com>
1530
1531         REGRESSION (r209299): Selection is broken when you zoom in webpage using trackpad
1532         https://bugs.webkit.org/show_bug.cgi?id=166472
1533         rdar://problem/29675551
1534
1535         Reviewed by Tim Horton.
1536
1537         r209299 broke autoscroll in zoomed pages because it changed RenderLayer::scrollRectToVisible()
1538         to shrink viewRect by page scale. This is incorrect for all callers of scrollRectToVisible, since
1539         the "absoluteRect" passed in is actually in zoomed document coordinates for all the callers I tested.
1540
1541         This code is also fixed to account for headers and footers. getRectToExpose() takes rectangles
1542         in "scroll view contents" coordinates (i.e. including header, and zoomed document), so doesn't need
1543         the separate visibleRectRelativeToDocument parameter.
1544
1545         Tests: fast/events/autoscroll-main-document.html
1546                fast/events/autoscroll-when-zoomed.html
1547                fast/events/drag-select-when-zoomed-with-header.html
1548                fast/events/drag-select-when-zoomed.html
1549                fast/scrolling/scroll-to-anchor-zoomed-header.html
1550
1551         * rendering/RenderLayer.cpp:
1552         (WebCore::RenderLayer::scrollRectToVisible):
1553         (WebCore::RenderLayer::getRectToExpose):
1554         * rendering/RenderLayer.h:
1555
1556 2016-12-24  Zalan Bujtas  <zalan@apple.com>
1557
1558         RenderBlockFlow::moveFloatsTo does not move floats.
1559         https://bugs.webkit.org/show_bug.cgi?id=166467
1560
1561         Reviewed by Darin Adler.
1562
1563         RenderBlockFlow::moveFloatsTo name is misleading. Floats are not moved from "this" to
1564         the new RenderBlockFlow parent, but rather they are copied so that overhanging floats
1565         don't get lost.
1566
1567         Covered by existing tests.
1568
1569         * rendering/FloatingObjects.cpp:
1570         (WebCore::FloatingObject::cloneForNewParent):
1571         (WebCore::FloatingObject::unsafeClone): Deleted.
1572         * rendering/FloatingObjects.h:
1573         * rendering/RenderBlockFlow.cpp:
1574         (WebCore::RenderBlockFlow::addFloatsToNewParent):
1575         (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo):
1576         (WebCore::RenderBlockFlow::moveFloatsTo): Deleted.
1577         * rendering/RenderBlockFlow.h:
1578         * rendering/RenderRubyBase.cpp:
1579         (WebCore::RenderRubyBase::mergeChildrenWithBase):
1580         * rendering/RenderRubyBase.h:
1581         * rendering/RenderRubyRun.cpp:
1582         (WebCore::RenderRubyRun::removeChild):
1583
1584 2016-12-23  Andreas Kling  <akling@apple.com>
1585
1586         REGRESSION(r209865): Crash when navigating back to some pages with compositing layers.
1587         <https://webkit.org/b/166469>
1588         <rdar://problem/29109053>
1589
1590         Reviewed by Darin Adler.
1591
1592         Remove the old WK1-era clear/restoreBackingStores optimization from the page cache.
1593         When enabling it on non-iOS platforms, we started hitting lots of assertions,
1594         and none of our memory tests showed any significant improvement anyway.
1595
1596         Test: compositing/page-cache-back-crash.html
1597
1598         * history/CachedFrame.cpp:
1599         (WebCore::CachedFrameBase::CachedFrameBase):
1600         (WebCore::CachedFrameBase::restore):
1601         (WebCore::CachedFrame::CachedFrame):
1602         * history/CachedFrame.h:
1603         * page/FrameView.cpp:
1604         (WebCore::FrameView::restoreBackingStores): Deleted.
1605         * page/FrameView.h:
1606
1607 2016-12-23  Sam Weinig  <sam@webkit.org>
1608
1609         Add missing std::optional to ApplePayPaymentRequest.lineItems
1610         https://bugs.webkit.org/show_bug.cgi?id=166468
1611
1612         Reviewed by Alexey Proskuryakov.
1613
1614         No functional change, but is more consistent.
1615
1616         * Modules/applepay/ApplePayPaymentRequest.h:
1617         Remove unnecessary #include of <heap/Strong.h>, add std::optional to lineItems.
1618
1619         * Modules/applepay/ApplePaySession.cpp:
1620         (WebCore::convertAndValidate):
1621         Update to deal with optional line items, remove unnecessary comment.
1622
1623         * Modules/applepay/ApplePaySession.h:
1624         Remove unneeded forward declarations.
1625
1626 2016-12-22  Sam Weinig  <sam@webkit.org>
1627
1628         [WebIDL] Remove custom bindings for WebSQL code
1629         https://bugs.webkit.org/show_bug.cgi?id=166441
1630
1631         Reviewed by Darin Adler.
1632
1633         - Replace custom variant type SQLValue with a type alias of a Variant.
1634         - Use the newly representable SQLValue to remove custom bindings for 
1635           SQLResultSetRowList::item and SQLTransaction::executeSql.
1636
1637         * CMakeLists.txt:
1638         * WebCore.xcodeproj/project.pbxproj:
1639         * bindings/js/JSBindingsAllInOne.cpp:
1640         * bindings/js/JSSQLResultSetRowListCustom.cpp: Removed.
1641         * bindings/js/JSSQLTransactionCustom.cpp: Removed.
1642         * platform/sql/SQLValue.cpp: Removed.
1643         Remove files.
1644
1645         * Modules/webdatabase/SQLResultSetRowList.cpp:
1646         (WebCore::SQLResultSetRowList::length):
1647         (WebCore::SQLResultSetRowList::item):
1648         * Modules/webdatabase/SQLResultSetRowList.h:
1649         * Modules/webdatabase/SQLResultSetRowList.idl:
1650         Sink the implementation of item() into the implementation. Use a
1651         record type to bridge to javascript.
1652
1653         * Modules/webdatabase/SQLStatement.cpp:
1654         (WebCore::SQLStatement::SQLStatement):
1655         * Modules/webdatabase/SQLStatement.h:
1656         Update to take arguments by rvalue reference.
1657
1658         * Modules/webdatabase/SQLTransaction.cpp:
1659         (WebCore::SQLTransaction::executeSql):
1660         * Modules/webdatabase/SQLTransaction.h:
1661         * Modules/webdatabase/SQLTransaction.idl:
1662         Remove custom annotation, and update signature to match the IDL.
1663
1664         * Modules/webdatabase/SQLTransactionBackend.cpp:
1665         * Modules/webdatabase/SQLTransactionBackend.h:
1666         Remove unneeded #includes of SQLValue.h
1667
1668         * bindings/js/JSDOMConvert.h:
1669         (WebCore::Converter<IDLNull>::convert):
1670         (WebCore::JSConverter<IDLNull>::convert):
1671         Implement conversion for the null type so it can be used in the SQLValue union.
1672
1673         * inspector/InspectorDatabaseAgent.cpp:
1674         * platform/sql/SQLiteStatement.cpp:
1675         (WebCore::SQLiteStatement::bindValue):
1676         (WebCore::SQLiteStatement::getColumnValue):
1677         * platform/sql/SQLiteStatement.h:
1678         Replace old switch with a WTF::switchOn that operates on the new variant.
1679
1680         * platform/sql/SQLValue.h:
1681         (WebCore::SQLValue::SQLValue): Deleted.
1682         (WebCore::SQLValue::type): Deleted.
1683         Replace implementation with a Variant.
1684
1685 2016-12-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1686
1687         [GTK] GLES build broken since r208997
1688         https://bugs.webkit.org/show_bug.cgi?id=166455
1689
1690         Unreviewed. Fix the preprocessor guards here; this code is incompatible with GLES2.
1691
1692         Looks like it's been broken for a month. Typical!
1693
1694         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1695         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
1696
1697 2016-12-23  Zan Dobersek  <zdobersek@igalia.com>
1698
1699         [EME][GStreamer] Enable various code paths for ENCRYPTED_MEDIA
1700         https://bugs.webkit.org/show_bug.cgi?id=166054
1701
1702         Reviewed by Xabier Rodriguez-Calvar.
1703
1704         Add ENABLE_ENCRYPTED_MEDIA build guards in various places in GStreamer
1705         code to enable decryption-related GStreamer elements and the proper
1706         decryptor handling in AppendPipeline.
1707
1708         * platform/GStreamer.cmake:
1709         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1710         * platform/graphics/gstreamer/GStreamerUtilities.h:
1711         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1712         (WebCore::registerWebKitGStreamerElements):
1713         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1714         Only call needKey() if LEGACY_ENCRYPTED_MEDIA is enabled, since this is
1715         the way the legacy EME system expects to be notified of key necessity.
1716         It's very likely ENCRYPTED_MEDIA will do this differently.
1717         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
1718         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h:
1719         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1720         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
1721         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1722         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1723         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1724         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
1725         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1726
1727 2016-12-23  Ryosuke Niwa  <rniwa@webkit.org>
1728
1729         Eliminate the use of lastChild in TextIterator
1730         https://bugs.webkit.org/show_bug.cgi?id=166456
1731
1732         Reviewed by Antti Koivisto.
1733
1734         Just use the node we just existed in TextIterator::exitNode and in emitting additional new line
1735         to eliminate the use of Node::lastChild.
1736
1737         Also initialize member variables in the declaration instead of the constructor to modernize the code.
1738
1739         * editing/TextIterator.cpp:
1740         (WebCore::TextIterator::TextIterator):
1741         (WebCore::TextIterator::advance):
1742         (WebCore::TextIterator::exitNode):
1743         * editing/TextIterator.h:
1744
1745 2016-12-22  Andy Estes  <aestes@apple.com>
1746
1747         Reduce QuickLook.h include overhead
1748         https://bugs.webkit.org/show_bug.cgi?id=166454
1749
1750         Reviewed by Andreas Kling.
1751
1752         * dom/Document.cpp: Included QuickLook.h for QLPreviewProtocol().
1753         * loader/DocumentLoader.cpp:
1754         (WebCore::DocumentLoader::setQuickLookHandle): Moved from DocumentLoader.h to here.
1755         * loader/DocumentLoader.h: Stopped including QuickLook.h and forward-declared
1756         QuickLookHandle.
1757         (WebCore::DocumentLoader::setQuickLookHandle): Moved definition out-of-line since it
1758         requires QuickLookHandle to be a complete type.
1759         * loader/ios/QuickLook.h: Updated to use #pragma once. Cleaned up includes and forward
1760         declarations.
1761         * platform/network/ResourceHandle.cpp: Included QuickLook.h so that QuickLookHandle is a
1762         complete type in the ResourceHandle constructor.
1763         * platform/network/ResourceHandle.h: Stopped including QuickLook.h and forward-declared
1764         QuickLookHandle.
1765         (WebCore::ResourceHandle::setQuickLookHandle): Moved definition out-of-line since it
1766         requires QuickLookHandle to be a complete type.
1767         * platform/network/mac/ResourceHandleMac.mm:
1768         (WebCore::ResourceHandle::setQuickLookHandle): Moved from ResourceHandle.h to here.
1769         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Included QuickLook.h for
1770         QuickLookHandle.
1771
1772 2016-12-22  Andy Estes  <aestes@apple.com>
1773
1774         [iOS] Move QuickLook from WebCore/platform to WebCore/loader
1775         https://bugs.webkit.org/show_bug.cgi?id=166449
1776
1777         Reviewed by Darin Adler.
1778
1779         QuickLook.mm knows about ResourceLoader, so it's a layering violation to have it in
1780         platform/. Move it to loader/ios/.
1781
1782         * WebCore.xcodeproj/project.pbxproj:
1783         * loader/ios/QuickLook.h: Renamed from Source/WebCore/platform/network/ios/QuickLook.h.
1784         * loader/ios/QuickLook.mm: Renamed from Source/WebCore/platform/network/ios/QuickLook.mm.
1785
1786 2016-12-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1787
1788         Unreviewed, fix unused parameter warning in GLES build
1789
1790         Looks like it's been here since 2012. Impressive!
1791
1792         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1793         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
1794
1795 2016-12-22  Alex Christensen  <achristensen@webkit.org>
1796
1797         Move GraphicsContext3DWin to GraphicsContext3DOpenGLES
1798         https://bugs.webkit.org/show_bug.cgi?id=166425
1799
1800         Reviewed by Tim Horton.
1801
1802         Move code which is GLES-specific not Windows-specific to the GLES-specific file
1803         so I can use it on Cocoa, with a temporary PLATFORM macro that I plan to remove once
1804         all platforms use ANGLE's GLES implementation. There is another copy of this code in
1805         GraphicsContext3DCairo, which will also be united with this code here soon.
1806         Also remove the PlatformCALayerWin, which was never used for anything.
1807
1808         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1809         (WebCore::GraphicsContext3D::create):
1810         (WebCore::GraphicsContext3D::GraphicsContext3D):
1811         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1812         (WebCore::GraphicsContext3D::setContextLostCallback):
1813         (WebCore::GraphicsContext3D::setErrorMessageCallback):
1814         (WebCore::GraphicsContext3D::makeContextCurrent):
1815         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary):
1816         (WebCore::GraphicsContext3D::platformGraphicsContext3D):
1817         (WebCore::GraphicsContext3D::platformTexture):
1818         (WebCore::GraphicsContext3D::isGLES2Compliant):
1819         (WebCore::GraphicsContext3D::platformLayer):
1820         * platform/graphics/win/GraphicsContext3DWin.cpp: Removed.
1821         * PlatformMac.cmake:
1822         Include the egl directory.  I'll need this, too, once Mac starts using ANGLE's EGL implementation.
1823
1824 2016-12-22  Brent Fulgham  <bfulgham@apple.com>
1825
1826         Nested calls to setDocument can omit firing 'unload' events
1827         https://bugs.webkit.org/show_bug.cgi?id=166422
1828         <rdar://problem/29763012>
1829
1830         Reviewed by Alex Christensen.
1831
1832         Test: fast/loader/nested-document-handling.html
1833
1834         Only allow a single document change to be taking place during a given runloop cycle.
1835
1836         * bindings/js/ScriptController.cpp:
1837         (WebCore::ScriptController::executeIfJavaScriptURL): Block script changing the document
1838         when we are in the middle of changing the document.
1839         * page/Frame.cpp:
1840         (WebCore::Frame::setDocument): Keep track of document change state.
1841         * page/Frame.h:
1842
1843 2016-12-22  Tim Horton  <timothy_horton@apple.com>
1844
1845         TileGrid creates new cohorts even when not using temporarilyRetainTileCohorts mode
1846         https://bugs.webkit.org/show_bug.cgi?id=166440
1847
1848         Reviewed by Simon Fraser.
1849
1850         No new tests.
1851
1852         * platform/graphics/ca/TileGrid.cpp:
1853         (WebCore::TileGrid::revalidateTiles):
1854         If we are not temporarily retaining unparented tile cohorts (e.g. on
1855         iOS WebKit2), instead immediately removing all tiles that would go into
1856         the new cohort, avoid starting the cohort at all.
1857
1858 2016-12-22  Zalan Bujtas  <zalan@apple.com>
1859
1860         Do not destroy the RenderNamedFlowFragment as leftover anonymous block.
1861         https://bugs.webkit.org/show_bug.cgi?id=166436
1862         rdar://problem/29772233
1863
1864         Reviewed by Simon Fraser.
1865
1866         When as the result of certain style change, the generated anonymous block is not needed anymore, we
1867         move its descendants up to the parent and destroy the generated box. While RenderNamedFlowFragment is a generated
1868         block, the cleanup code should just ignore it the same way we ignore boxes like multicolumn, mathml etc. 
1869
1870         Test: fast/regions/flow-fragment-as-anonymous-block-crash.html
1871
1872         * rendering/RenderObject.h:
1873         (WebCore::RenderObject::isAnonymousBlock):
1874
1875 2016-12-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1876
1877         CSS Scroll Snap does not work if scrollbar is hidden
1878         https://bugs.webkit.org/show_bug.cgi?id=160442
1879         <rdar://problem/23317034>
1880
1881         Reviewed by Simon Fraser.
1882
1883         Currently, the only reason scroll snapping works in overflow scrolling containers without forcing layout is
1884         because we would initialize the scrolling container's ScrollAnimator in the process of updating scrollbars. If
1885         there are no scrollbars to render, we won't bother creating a ScrollAnimator. Without an existing
1886         ScrollAnimator, ScrollableArea::updateScrollSnapState will simply bail instead of setting up the scroll snap
1887         state. Instead, we should take setting a non-empty vector of scroll offsets on the ScrollableArea as a cue that
1888         the ScrollableArea also needs a ScrollAnimator, and initialize it there if necessary.
1889
1890         Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-hidden-scrollbars.html
1891
1892         * platform/ScrollableArea.cpp:
1893         (WebCore::ScrollableArea::setHorizontalSnapOffsets):
1894         (WebCore::ScrollableArea::setVerticalSnapOffsets):
1895
1896 2016-12-22  Daniel Bates  <dabates@apple.com>
1897
1898         Bypass pop-up blocker from cross-origin or sandboxed frame
1899         https://bugs.webkit.org/show_bug.cgi?id=166290
1900         <rdar://problem/29742039>
1901
1902         Reviewed by Darin Adler.
1903
1904         Tests: fast/events/popup-blocked-from-sandboxed-frame-via-window-open-named-sibling-frame.html
1905                fast/events/popup-blocked-from-sandboxed-frame-via-window-open-named-sibling-frame2.html
1906                fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame.html
1907
1908         * page/DOMWindow.cpp:
1909         (WebCore::DOMWindow::open): Use FrameLoader::findFrameForNavigation() to find the
1910         target frame to navigate with respect to the active document just as we do in WebCore::createWindow().
1911
1912 2016-12-22  Andy Estes  <aestes@apple.com>
1913
1914         Make WebCore::EditorInsertAction an enum class
1915         https://bugs.webkit.org/show_bug.cgi?id=166424
1916
1917         Reviewed by Brent Fulgham.
1918
1919         * editing/AlternativeTextController.cpp:
1920         (WebCore::AlternativeTextController::applyDictationAlternative):
1921         * editing/Editor.cpp:
1922         (WebCore::Editor::pasteAsPlainTextWithPasteboard):
1923         (WebCore::Editor::shouldInsertText):
1924         (WebCore::Editor::insertTextWithoutSendingTextEvent):
1925         (WebCore::Editor::insertLineBreak):
1926         (WebCore::Editor::insertParagraphSeparator):
1927         (WebCore::Editor::markMisspellingsAfterTypingToWord):
1928         (WebCore::Editor::markAndReplaceFor):
1929         (WebCore::Editor::changeBackToReplacedString):
1930         (WebCore::Editor::transpose):
1931         (WebCore::Editor::handleAcceptedCandidate):
1932         * editing/EditorInsertAction.h:
1933         (): Deleted.
1934         * editing/gtk/EditorGtk.cpp:
1935         (WebCore::Editor::pasteWithPasteboard):
1936         * editing/ios/EditorIOS.mm:
1937         (WebCore::Editor::pasteWithPasteboard):
1938         (WebCore::Editor::replaceSelectionWithAttributedString):
1939         * editing/mac/EditorMac.mm:
1940         (WebCore::Editor::pasteWithPasteboard):
1941         (WebCore::Editor::replaceNodeFromPasteboard):
1942         (WebCore::Editor::replaceSelectionWithAttributedString):
1943         * editing/win/EditorWin.cpp:
1944         (WebCore::Editor::pasteWithPasteboard):
1945         * page/ContextMenuController.cpp:
1946         (WebCore::insertUnicodeCharacter):
1947         (WebCore::ContextMenuController::contextMenuItemSelected):
1948         * page/DragController.cpp:
1949         (WebCore::DragController::concludeEditDrag):
1950
1951 2016-12-22  Jer Noble  <jer.noble@apple.com>
1952
1953         Only include those parts of AVFoundation.framework which are strictly needed.
1954         https://bugs.webkit.org/show_bug.cgi?id=166423
1955
1956         Reviewed by Eric Carlson.
1957
1958         * Modules/plugins/QuickTimePluginReplacement.mm:
1959         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1960         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
1961         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
1962         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1963         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1964         * platform/mac/SerializedPlatformRepresentationMac.mm:
1965         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
1966         * platform/mac/WebVideoFullscreenController.mm:
1967         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1968         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1969         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1970         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1971
1972 2016-12-22  Jer Noble  <jer.noble@apple.com>
1973
1974         NULL-deref CRASH in WebCore::PlatformMediaSession::mediaType
1975         https://bugs.webkit.org/show_bug.cgi?id=166407
1976
1977         Reviewed by Darin Adler.
1978
1979         In r207688, we added a facility in PlatformMediaSessionManager for safely walking through a
1980         list of PlatformMediaSessions by replacing entries of deleted sessions with nullptr. We now
1981         need to use those new iteration falicities in MediaSessionManageriOS.
1982
1983         In addition to the existing iterators, add one which takes a predicate, and returns the first
1984         session which matches the predicate, or nullptr, if none do.
1985
1986         * platform/audio/PlatformMediaSessionManager.cpp:
1987         (WebCore::PlatformMediaSessionManager::findSession):
1988         (WebCore::PlatformMediaSessionManager::anyOfSessions):
1989         * platform/audio/PlatformMediaSessionManager.h:
1990         (WebCore::PlatformMediaSessionManager::sessions): Deleted.
1991         * platform/audio/ios/MediaSessionManagerIOS.mm:
1992         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
1993         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession):
1994         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
1995         (WebCore::MediaSessionManageriOS::applicationDidEnterBackground):
1996         (WebCore::MediaSessionManageriOS::applicationWillEnterForeground):
1997
1998 2016-12-22  Jer Noble  <jer.noble@apple.com>
1999
2000         Muted media element playback should not interrupt other audio playback
2001         https://bugs.webkit.org/show_bug.cgi?id=166347
2002
2003         Reviewed by Eric Carlson.
2004
2005         Test: TestWebKitAPI/WebKit/ios/AudioSessionCategoryIOS.mm
2006
2007         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
2008         (PlatformMediaSessionManager::updateSessionState):
2009
2010 2016-12-22  Jer Noble  <jer.noble@apple.com>
2011
2012         Check for the existence of AVSampleBufferAudioRenderer.h before redeclaring AVSampleBufferAudioRenderer
2013         https://bugs.webkit.org/show_bug.cgi?id=166421
2014
2015         Reviewed by Eric Carlson.
2016
2017         * platform/spi/mac/AVFoundationSPI.h:
2018
2019 2016-12-22  Eric Carlson  <eric.carlson@apple.com>
2020
2021         AVPlayerLayer isn't available on every system
2022         https://bugs.webkit.org/show_bug.cgi?id=166399
2023
2024         Reviewed by Jer Noble.
2025
2026         No new tests, prevents a crash that can't be reproduced on a test system.
2027
2028         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Use SOFT_LINK_CLASS_OPTIONAL.
2029
2030 2016-12-21  Tim Horton  <timothy_horton@apple.com>
2031
2032         TileGrid revalidates tiles twice during flush, first with wrong visible rect
2033         https://bugs.webkit.org/show_bug.cgi?id=166406
2034
2035         Reviewed by Simon Fraser.
2036
2037         No new tests; existing tests cover this code, this is just a perf win,
2038         specifically reducing the amount of layer churn during zooming.
2039
2040         * platform/graphics/ca/TileGrid.cpp:
2041         (WebCore::TileGrid::setScale):
2042         Schedule a revalidation, which will happen later in the same flush,
2043         instead of doing it immediately. Doing it immediately is problematic,
2044         because we're currently in the middle of a GraphicsLayer tree flush,
2045         and don't have the complete picture of the new state yet. We're guaranteed
2046         to get the new scale *before* the flush calls revalidateTiles.
2047
2048 2016-12-21  Tim Horton  <timothy_horton@apple.com>
2049
2050         TileGrid creates new tiles when there are recyclable tiles about to be removed
2051         https://bugs.webkit.org/show_bug.cgi?id=166408
2052
2053         Reviewed by Simon Fraser.
2054
2055         No new tests; existing tests cover this code, this is just a perf win,
2056         specifically reducing the amount of layer churn during zooming.
2057
2058         * platform/graphics/ca/TileGrid.cpp:
2059         (WebCore::TileGrid::revalidateTiles):
2060         Remove all the tiles that will be removed first, then add new tiles.
2061         Strictly ordering it this way means that tiles will be removed, go into
2062         the LayerPool, then be pulled back out of the LayerPool to sit in the
2063         newly-covered areas. Previously, we would sometimes make new layers
2064         for newly-covered areas, and then remove unneeded but otherwise recyclable
2065         tiles, which would then just go sit in the LayerPool (and often get
2066         pruned, wastefully).
2067
2068 2016-12-21  Eric Carlson  <eric.carlson@apple.com>
2069
2070         [MediaStream] Update media-stream-event-constructor test
2071         https://bugs.webkit.org/show_bug.cgi?id=166398
2072
2073         Reviewed by Jer Noble.
2074
2075         No new tests, updated existing test.
2076
2077         * Modules/mediastream/MediaStreamEvent.idl: Mark eventInitDict as optional.
2078
2079 2016-12-21  Jiewen Tan  <jiewen_tan@apple.com>
2080
2081         WebKit should set Original URL of a download request correctly
2082         https://bugs.webkit.org/show_bug.cgi?id=166394
2083         <rdar://problem/25391382>
2084
2085         Reviewed by Alex Christensen.
2086
2087         WebKit should set Original URL of a download request correctly if the download
2088         is initiated by clicking on a link with target=_blank.
2089
2090         Manually tested as the requested test infrastructure doesn't exist yet. We need actual
2091         loading process for API test such that we could simulate the real situation which
2092         PolicyDownload is only set when we receive responds. Currently we can only set
2093         PolicyDownload in a NavigationDelegate when the load starts. Hence we cannot simulate
2094         the following process: load starts -> PolicyUse -> creates a new WebView ->
2095         respond receives -> PolicyDownload -> downloads.
2096
2097         * loader/FrameLoader.cpp:
2098         (WebCore::FrameLoader::setOriginalURLForDownloadRequest):
2099
2100 2016-12-21  Sam Weinig  <sam@webkit.org>
2101
2102         [WebIDL] Remove custom binding for ErrorEvent
2103         https://bugs.webkit.org/show_bug.cgi?id=166345
2104
2105         Reviewed by Anders Carlsson.
2106
2107         * CMakeLists.txt:
2108         * WebCore.xcodeproj/project.pbxproj:
2109         * bindings/js/JSBindingsAllInOne.cpp:
2110         * bindings/js/JSErrorEventCustom.cpp: Removed.
2111         Remove JSErrorEventCustom.cpp
2112
2113         * ForwardingHeaders/heap/HandleTypes.h: Added.
2114         Add forwarding header for HandleTypes.h
2115
2116         * bindings/js/JSErrorHandler.cpp:
2117         (WebCore::JSErrorHandler::handleEvent):
2118         Switch to using JSDOMConvert and call the updated name for the error getter.
2119
2120         * bindings/js/ScriptController.h:
2121         * bindings/js/SerializedScriptValue.h:
2122         Remove unnecessary forward declaration of ScriptValue.
2123
2124         * bindings/js/WorkerScriptController.cpp:
2125         (WebCore::WorkerScriptController::evaluate):
2126         * dom/ScriptExecutionContext.cpp:
2127         (WebCore::ScriptExecutionContext::sanitizeScriptError):
2128         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
2129         * dom/ScriptExecutionContext.h:
2130         * workers/WorkerMessagingProxy.cpp:
2131         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
2132         Update type that sanitizeScriptError takes from a ScriptValue to a Strong<Unknown>.
2133
2134         * bindings/scripts/CodeGeneratorJS.pm:
2135         (GenerateCallWith):
2136         * bindings/scripts/IDLAttributes.txt:
2137         Add a new extended attributes option for the CallWith, GlobalObject, that passes the global object.
2138
2139         * dom/ErrorEvent.cpp:
2140         (WebCore::ErrorEvent::ErrorEvent):
2141         (WebCore::ErrorEvent::error):
2142         (WebCore::ErrorEvent::trySerializeError):
2143         (WebCore::ErrorEvent::sanitizedErrorValue): Deleted.
2144         * dom/ErrorEvent.h:
2145         Store a Strong<Unknown> directly, rather than a ScriptValue. Rename sanitizedErrorValue to 
2146         just error to match the IDL.
2147
2148         * dom/ErrorEvent.idl:
2149         Remove CustomGetter.
2150
2151 2016-12-21  Ryosuke Niwa  <rniwa@webkit.org>
2152
2153         Modernize findPlainText
2154         https://bugs.webkit.org/show_bug.cgi?id=166299
2155
2156         Reviewed by Sam Weinig.
2157
2158         Modernized findPlainText by merging the static version of it into it
2159         and extracting the main nested loop out as findPlainTextOffset.
2160
2161         No new tests since there should be no behavioral change.
2162
2163         * editing/TextIterator.cpp:
2164         (WebCore::findPlainTextOffset):
2165         (WebCore::findPlainText):
2166
2167 2016-12-21  John Wilander  <wilander@apple.com>
2168
2169         Switch to a blacklist model for restricted Accept headers in simple CORS requests
2170         https://bugs.webkit.org/show_bug.cgi?id=166363
2171
2172         Reviewed by Alex Christensen.
2173
2174         Updated existing tests.
2175
2176         * platform/network/HTTPParsers.cpp:
2177         (WebCore::isDelimiterCharacter):
2178             Convenience function for checking delimiter characters according to:
2179             https://tools.ietf.org/html/rfc7230#section-3.2.6 
2180         (WebCore::isValidAcceptHeaderValue):
2181             Now uses WebCore::isDelimiterCharacter() to blacklist delimiter characters
2182             instead of a whitelist of accepted non-alphanumeric characters.
2183
2184 2016-12-21  Beth Dakin  <bdakin@apple.com>
2185
2186         Holding down on candidates in the TouchBar should show panel on screen
2187         https://bugs.webkit.org/show_bug.cgi?id=166367
2188         -and corresponding-
2189         <rdar://problem/28479236>
2190
2191         Reviewed by Tim Horton.
2192
2193         Expose the version of setCandidates: that takes a rect.
2194         * platform/spi/cocoa/NSTouchBarSPI.h:
2195
2196 2016-12-21  Michael Catanzaro  <mcatanzaro@igalia.com>
2197
2198         Extensions3DOpenGL[ES] constructor should not be explicit
2199         https://bugs.webkit.org/show_bug.cgi?id=166296
2200
2201         Reviewed by Darin Adler.
2202
2203         These constructors used to only have one parameter. Now they have two and they're both
2204         mandatory.
2205
2206         * platform/graphics/opengl/Extensions3DOpenGL.h:
2207         * platform/graphics/opengl/Extensions3DOpenGLES.h:
2208
2209 2016-12-21  Eric Carlson  <eric.carlson@apple.com>
2210
2211         [MediaStream] MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer can be called before it has a media stream
2212         https://bugs.webkit.org/show_bug.cgi?id=166344
2213         <rdar://problem/29763143>
2214
2215         Reviewed by Jer Noble.
2216
2217         There is a very narrow window during which a MediaStream player can be asked for its layer 
2218         before it has a steam, resulting in a NULL dereference and crash. Don't do that.
2219
2220         Unable to reproduce.
2221
2222         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2223         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer):
2224
2225 2016-12-21  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2226
2227         [Readable Streams API] Fix test in readableByteStreamCallPullIfNeeded
2228         https://bugs.webkit.org/show_bug.cgi?id=166312
2229
2230         Reviewed by Youenn Fablet.
2231
2232         Add a new function to evaluate if calling a pull function is
2233         required as per specification.
2234
2235         No new test required.
2236
2237         * Modules/streams/ReadableByteStreamInternals.js:
2238         (readableByteStreamControllerShouldCallPull): Added.
2239         (readableByteStreamControllerCallPullIfNeeded):
2240
2241 2016-12-21  Simon Fraser  <simon.fraser@apple.com>
2242
2243         Fixed bars are positioned incorrectly when there are header and footer banners
2244         https://bugs.webkit.org/show_bug.cgi?id=166302
2245         rdar://problem/29727145
2246
2247         Reviewed by Tim Horton.
2248         
2249         The computation of the visual viewport was wrong in the presence of header and footer
2250         banners. It needs to take into account the fact that "visibleContentRect" applies to the
2251         scroll view contents, which includes header and footer (unscaled), and the potentially scaled
2252         document, and we need to return a rectangle in unscaled document coordinates.
2253         
2254         Make a static method in FrameView to do this computation, and call it from FrameView::visualViewportRect()
2255         and ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition().
2256         
2257         layoutViewportForScrollPosition() is only called on Mac, so remove the #ifdeffing related to scaling, 
2258         and pass in an unscaled scroll position.
2259
2260         Test: fast/visual-viewport/zoomed-fixed-header-and-footer.html
2261
2262         * page/FrameView.cpp:
2263         (WebCore::FrameView::updateLayoutViewport):
2264         (WebCore::FrameView::maxStableLayoutViewportOrigin):
2265         (WebCore::FrameView::visibleDocumentRect):
2266         (WebCore::FrameView::visualViewportRect):
2267         * page/FrameView.h:
2268         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2269         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
2270         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2271         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2272
2273 2016-12-21  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2274
2275         [CMake] Remove remaining INDIE_UI related entries.
2276         https://bugs.webkit.org/show_bug.cgi?id=165881
2277
2278         Unreviewed.
2279
2280         * CMakeLists.txt:
2281
2282 2016-12-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2283
2284         [Cairo] Conditional jump or move depends on uninitialised value(s)
2285         https://bugs.webkit.org/show_bug.cgi?id=166058
2286
2287         Reviewed by Michael Catanzaro.
2288
2289         Initialize x and y members of cairo_glyph_t struct before passing it to cairo_glyph_path.
2290
2291         * platform/graphics/cairo/FontCairo.cpp:
2292         (WebCore::CairoGlyphToPathTranslator::path):
2293
2294 2016-12-20  Myles C. Maxfield  <mmaxfield@apple.com>
2295
2296         Skia lighter wght variation looks bolder than regular
2297         https://bugs.webkit.org/show_bug.cgi?id=165948
2298
2299         Reviewed by Antti Koivisto.
2300
2301         Test: fast/text/variations/default-value.html
2302
2303         This patch inspects the font's information regarding variations. It uses this information
2304         to work around a bug in CoreText where default variation values were not getting applied.
2305         This workaround is placed behind a version check and the macro name
2306         "WORKAROUND_CORETEXT_VARIATIONS_DEFAULT_VALUE_BUG" so we know to delete it whenever
2307         possible. It also uses the minimum and maximum supported values for the axis to clamp our
2308         variation values to the closest supported point, which is in line with a recent edit to
2309         the fonts spec:
2310         https://github.com/w3c/csswg-drafts/commit/52b802ac38619286a30662dceb71b8a29fa72f42
2311         This clamping behavior also revealed another bug in CoreText, which was worked around
2312         behind another version check and macro name WORKAROUND_CORETEXT_VARIATIONS_EXTENTS_BUG so
2313         we know to delete it whenever possible.
2314
2315         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2316         (WebCore::defaultVariationValues):
2317         (WebCore::preparePlatformFont):
2318
2319 2016-12-20  Tim Horton  <timothy_horton@apple.com>
2320
2321         Remove a duplicate reference to ScrollingMomentumCalculatorMac.h in the Xcode project
2322
2323         Rubber-stamped by Sam Weinig.
2324
2325         * WebCore.xcodeproj/project.pbxproj:
2326
2327 2016-12-20  Tim Horton  <timothy_horton@apple.com>
2328
2329         Remove a duplicate reference to ScrollingMomentumCalculatorMac.mm in the Xcode project
2330
2331         Rubber-stamped by Sam Weinig.
2332
2333         * WebCore.xcodeproj/project.pbxproj:
2334
2335 2016-12-20  Alex Christensen  <achristensen@webkit.org>
2336
2337         Remove initEvent quirk
2338         https://bugs.webkit.org/show_bug.cgi?id=166284
2339
2340         Reviewed by Dan Bernstein.
2341
2342         We added this quirk in r207908 and expanded it in r209946 and r210034.
2343         Many web compatibility issues have been found, which leads us to believe that many more exist.
2344         This reverts the behavior to match how it was before r203848.
2345         This change was proposed to the spec in https://github.com/whatwg/dom/issues/387
2346
2347         * dom/Event.cpp:
2348         (WebCore::Event::initEventForBindings): Deleted.
2349         * dom/Event.h:
2350         * dom/Event.idl:
2351         * platform/RuntimeApplicationChecks.h:
2352         * platform/RuntimeApplicationChecks.mm:
2353         (WebCore::IOSApplication::isBaiduNuomi): Deleted.
2354         (WebCore::IOSApplication::isAutoNaviAMap): Deleted.
2355         (WebCore::IOSApplication::isFlipboard): Deleted.
2356
2357 2016-12-20  JF Bastien  <jfbastien@apple.com>
2358
2359         INDIE_UI: fix cmake build
2360         https://bugs.webkit.org/show_bug.cgi?id=166288
2361
2362         Reviewed by Mark Lam.
2363
2364         Bug #165881 didn't remove a file from cmake.
2365
2366         * PlatformMac.cmake:
2367
2368 2016-12-20  Alex Christensen  <achristensen@webkit.org>
2369
2370         Fix clean Windows build after r210029
2371         https://bugs.webkit.org/show_bug.cgi?id=165881
2372
2373         * DerivedSources.cpp:
2374
2375 2016-12-20  Brent Fulgham  <bfulgham@apple.com>
2376
2377         Address some style problems found by static analysis
2378         https://bugs.webkit.org/show_bug.cgi?id=165975
2379
2380         Reviewed by Alex Christensen.
2381
2382         Correct the const-correctness of functions that are implemented using stricter
2383         const declarations.
2384
2385         Avoid passing large ANGLE data structures through the ANGLEWebKitBridge methods.
2386
2387         * inspector/InspectorCSSAgent.h: Declare the method overrides properly to match
2388         the stricter const declarations in the implementation files.
2389         * inspector/InspectorDOMAgent.h: Ditto.
2390         * inspector/InspectorPageAgent.h: Ditto.
2391         * inspector/InspectorTimelineAgent.h: Ditto.
2392         * inspector/PageDebuggerAgent.h: Ditto.
2393         * platform/graphics/ANGLEWebKitBridge.cpp:
2394         (WebCore::ANGLEWebKitBridge::setResources): Pass by const reference.
2395         * platform/graphics/ANGLEWebKitBridge.h:
2396         (WebCore::ANGLEWebKitBridge::getResources): Return a const reference.
2397         * platform/mediastream/RealtimeMediaSource.cpp:
2398         (WebCore::RealtimeMediaSource::selectSettings): Use a lambda that takes
2399         a const reference, rather than copying the maps while searching.
2400
2401 2016-12-20  Sam Weinig  <sam@webkit.org>
2402
2403         [WebIDL] Remove custom binding for WorkerGlobalScope::importScripts
2404         https://bugs.webkit.org/show_bug.cgi?id=166243
2405
2406         Reviewed by Alex Christensen.
2407
2408         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2409         (WebCore::JSWorkerGlobalScope::importScripts): Deleted.
2410         * workers/WorkerGlobalScope.idl:
2411         Import scripts can now be trivially generated.
2412
2413 2016-12-20  Zalan Bujtas  <zalan@apple.com>
2414
2415         SVG elements should inherit the root's flow thread state.
2416         https://bugs.webkit.org/show_bug.cgi?id=166173
2417         rdar://problem/29704862
2418
2419         Reviewed by Simon Fraser.
2420
2421         When the <svg> is not part of the multicolumn context (out of flow positioning), its descendants should not be in the flow either.
2422
2423         Test: fast/multicol/svg-inside-multicolumn.html
2424
2425         * rendering/RenderObject.cpp:
2426         (WebCore::RenderObject::computedFlowThreadState):
2427         * rendering/RenderObject.h:
2428         (WebCore::RenderObject::isProgress):
2429         (WebCore::RenderObject::isRenderSVGBlock):
2430         * rendering/svg/RenderSVGBlock.h:
2431
2432 2016-12-20  Alex Christensen  <achristensen@webkit.org>
2433
2434         Fix yet another app that uses initEvent with fewer than 3 parameters
2435         https://bugs.webkit.org/show_bug.cgi?id=166257
2436         <rdar://problem/29420268>
2437
2438         Reviewed by Sam Weinig.
2439
2440         * dom/Event.cpp:
2441         (WebCore::Event::initEventForBindings):
2442         * platform/RuntimeApplicationChecks.h:
2443         * platform/RuntimeApplicationChecks.mm:
2444         (WebCore::IOSApplication::isAutoNaviAMap):
2445         AutoNavi amap has content that uses initEvent with one parameter. This quirk is needed here, too.
2446
2447 2016-12-20  Dean Jackson  <dino@apple.com>
2448
2449         Remove INDIE_UI
2450         https://bugs.webkit.org/show_bug.cgi?id=165881
2451         <rdar://problem/29672532>
2452
2453         Reviewed by Simon Fraser.
2454
2455         The Indie UI work has been discontinued.
2456
2457         * Configurations/FeatureDefines.xcconfig:
2458         * Modules/indieui/UIRequestEvent.cpp: Removed.
2459         * Modules/indieui/UIRequestEvent.h: Removed.
2460         * Modules/indieui/UIRequestEvent.idl: Removed.
2461         * WebCore.xcodeproj/project.pbxproj:
2462         * dom/Element.cpp:
2463         (WebCore::Element::setUIActions): Deleted.
2464         (WebCore::Element::UIActions): Deleted.
2465         * dom/Element.h:
2466         * dom/Element.idl:
2467         * dom/EventNames.in:
2468         * dom/Node.cpp:
2469         (WebCore::Node::dispatchUIRequestEvent): Deleted.
2470         * dom/Node.h:
2471
2472 2016-12-20  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2473
2474         [Readable Streams API] Implement readableByteStreamControllerCallPullIfNeeded()
2475         https://bugs.webkit.org/show_bug.cgi?id=166022
2476
2477         Reviewed by Youenn Fablet.
2478
2479         Implemented readableByteStreamControllerCallPullIfNeeded(). This function is
2480         in particular called when a new ReadableByteStreamController is created; hence,
2481         ReadableByteStreamController constructor has been updated.
2482
2483         Added 3 tests to check behaviour in case of success/failure of the start and pull functions
2484         associated to the underlyingByteSource.
2485
2486         * Modules/streams/ReadableByteStreamInternals.js:
2487         (privateInitializeReadableByteStreamController): Updated handling of underlyingByteSource
2488         start function (especially with call to readableByteStreamControllerCallPullIfNeeded).
2489         (isReadableStreamBYOBReader): Added.
2490         (readableStreamHasBYOBReader): Added.
2491         (readableStreamHasDefaultReader): Added.
2492         (readableByteStreamControllerCallPullIfNeeded): Added.
2493         * Modules/streams/ReadableStreamInternals.js:
2494         (privateInitializeReadableStreamDefaultController): Added missing asserts.
2495         * bindings/js/WebCoreBuiltinNames.h: Added readIntoRequests.
2496
2497 2016-12-20  Sam Weinig  <sam@webkit.org>
2498
2499         [DataCue] Un-prefix DataCue and remove custom bindings
2500         https://bugs.webkit.org/show_bug.cgi?id=166087
2501
2502         Reviewed by Eric Carlson.
2503
2504         * CMakeLists.txt:
2505         * WebCore.xcodeproj/project.pbxproj:
2506         * bindings/js/JSBindingsAllInOne.cpp:
2507         * bindings/js/JSDataCueCustom.cpp: Removed.
2508         Remove JSDataCueCustom.cpp
2509
2510         * bindings/js/JSTextTrackCueCustom.cpp:
2511         (WebCore::toJSNewlyCreated):
2512         Remove out of date comment.
2513
2514         * bindings/scripts/CodeGeneratorJS.pm:
2515         (GenerateConstructorDefinition):
2516         Update constructor generation code to use JSDOMConvert.
2517
2518         * html/track/DataCue.cpp:
2519         (WebCore::DataCue::DataCue):
2520         (WebCore::DataCue::~DataCue):
2521         (WebCore::DataCue::data):
2522         (WebCore::DataCue::setData):
2523         (WebCore::DataCue::cueContentsMatch):
2524         (WebCore::DataCue::value):
2525         (WebCore::DataCue::setValue):
2526         (WebCore::DataCue::valueOrNull):
2527         * html/track/DataCue.h:
2528         * html/track/DataCue.idl:
2529         * platform/SerializedPlatformRepresentation.h:
2530         Remove DATACUE_VALUE define from web exposed classes, so the interface can
2531         be the same on all platforms. Platforms that don't support DATACUE_VALUE will
2532         just never have any value. Also remove custom annotations.
2533
2534 2016-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2535
2536         Implement the updated port/area-based Scroll Snap Module Level 1 Spec
2537         https://bugs.webkit.org/show_bug.cgi?id=165317
2538         <rdar://problem/29490956>
2539
2540         Reviewed by Dean Jackson.
2541
2542         Implements the changes drafted in the latest iteration of the Scroll Snap Module Level 1 spec, which uses a
2543         snap-area and snap-port-based method for determining snap positions in a scroll snapping container.
2544         Additionally, removes the now-obsolete and prefixed implementation of the scroll snap spec and refactors all
2545         affected layout tests to use the new CSS properties. Also adds new layout tests covering some behaviors detailed
2546         in the new version of the spec, such as scroll snapping with transformed child elements.
2547
2548         See below for more detailed descriptions of the changes.
2549
2550         Tests: css3/scroll-snap/scroll-snap-2d-change-axis-type.html
2551                css3/scroll-snap/scroll-snap-2d-offsets-computed-independently.html
2552                css3/scroll-snap/scroll-snap-children-with-scroll-snap-margin.html
2553                css3/scroll-snap/scroll-snap-children-with-transforms.html
2554                css3/scroll-snap/scroll-snap-positions-mainframe.html
2555                css3/scroll-snap/scroll-snap-positions-overflow-resize.html
2556                css3/scroll-snap/scroll-snap-positions.html
2557                css3/scroll-snap/scroll-snap-style-changed-align.html
2558                css3/scroll-snap/scroll-snap-with-scroll-padding.html
2559
2560         * WebCore.xcodeproj/project.pbxproj:
2561         * css/CSSCalculationValue.cpp:
2562         (WebCore::hasDoubleValue):
2563
2564         Removed use of length repeat.
2565
2566         * css/CSSComputedStyleDeclaration.cpp:
2567         (WebCore::valueForScrollSnapType):
2568         (WebCore::valueForScrollSnapAlignment):
2569         (WebCore::ComputedStyleExtractor::propertyValue):
2570         (WebCore::scrollSnapDestination): Deleted.
2571         (WebCore::scrollSnapPoints): Deleted.
2572         (WebCore::scrollSnapCoordinates): Deleted.
2573
2574         Removed helper functions used to create CSS values for scroll snap coordinates and destination, and added
2575         helpers for computed scroll snap type (a combination of axis and strictness values) as well as scroll snap align
2576         (an alignment value per axis).
2577
2578         * css/CSSPrimitiveValue.cpp:
2579         (WebCore::isValidCSSUnitTypeForDoubleConversion):
2580         (WebCore::isStringType):
2581         (WebCore::CSSPrimitiveValue::cleanup):
2582         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
2583         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
2584         (WebCore::CSSPrimitiveValue::equals):
2585
2586         Removed usages of the length repeat type, since repeat(*) is no longer being used anywhere.
2587
2588         * css/CSSPrimitiveValue.h:
2589         * css/CSSPrimitiveValueMappings.h:
2590         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2591         (WebCore::CSSPrimitiveValue::operator ScrollSnapStrictness):
2592         (WebCore::CSSPrimitiveValue::operator ScrollSnapAxis):
2593         (WebCore::CSSPrimitiveValue::operator ScrollSnapAxisAlignType):
2594         (WebCore::CSSPrimitiveValue::operator ScrollSnapType): Deleted.
2595
2596         Added CSSPrimitiveValue mappings to ScrollSnapAxisAlignType, ScrollSnapStrictness, and ScrollSnapAxis. Removed
2597         the old ScrollSnapType mapping.
2598
2599         * css/CSSProperties.json:
2600
2601         Replaced the old scroll snap CSS properties with the new ones. Note that scroll-snap-margin and scroll-padding
2602         have 4 shorthands each, for the individual top/bottom/left/right values.
2603
2604         * css/CSSValueKeywords.in:
2605
2606         Added CSS keywords {x, y}, which are necessary to support the new scroll snapping properties.
2607
2608         * css/LengthRepeat.h: Removed.
2609
2610         Removed LengthRepeat entirely. This represented the `repeat(<length>)` CSS value, which was only used for the
2611         scroll-snap-points-x and scroll-snap-points-y values.
2612
2613         * css/StyleBuilderConverter.h:
2614         (WebCore::StyleBuilderConverter::convertScrollSnapType):
2615         (WebCore::StyleBuilderConverter::convertScrollSnapAlign):
2616         (WebCore::StyleBuilderConverter::parseSnapCoordinate): Deleted.
2617         (WebCore::StyleBuilderConverter::convertScrollSnapPoints): Deleted.
2618         (WebCore::StyleBuilderConverter::convertSnapCoordinatePair): Deleted.
2619         (WebCore::StyleBuilderConverter::convertScrollSnapCoordinates): Deleted.
2620
2621         Added helper functions to convert scroll snap type and scroll snap alignment from parsed CSS values to their
2622         primary representation in WebCore as ScrollSnapType and ScrollSnapAlign. These methods assume that the given
2623         CSS values have successfully cleared the parsing step and are represented as CSSValueLists or length 1 or 2.
2624
2625         * css/StyleBuilderCustom.h:
2626         (WebCore::StyleBuilderCustom::applyInitialWebkitScrollSnapPointsX): Deleted.
2627         (WebCore::StyleBuilderCustom::applyInheritWebkitScrollSnapPointsX): Deleted.
2628         (WebCore::StyleBuilderCustom::applyInitialWebkitScrollSnapPointsY): Deleted.
2629         (WebCore::StyleBuilderCustom::applyInheritWebkitScrollSnapPointsY): Deleted.
2630         * css/StyleProperties.cpp:
2631         (WebCore::StyleProperties::getPropertyValue):
2632         (WebCore::StyleProperties::asText):
2633
2634         Adds support for the scroll-snap-margin and scroll-padding.
2635
2636         * css/parser/CSSParser.cpp:
2637         (WebCore::isValidKeywordPropertyAndValue):
2638         (WebCore::CSSParser::parseValue):
2639         (WebCore::isScrollSnapAxisAlign):
2640         (WebCore::isScrollSnapStrictness):
2641         (WebCore::CSSParser::parseScrollSnapAlign):
2642         (WebCore::CSSParser::parseScrollSnapType):
2643         (WebCore::CSSParser::parseNonElementSnapPoints): Deleted.
2644         (WebCore::CSSParser::parseScrollSnapPositions): Deleted.
2645         (WebCore::CSSParser::parseScrollSnapDestination): Deleted.
2646         (WebCore::CSSParser::parseScrollSnapCoordinate): Deleted.
2647         * css/parser/CSSParser.h:
2648
2649         Removed references to LengthRepeat, and added support for parsing new scroll snapping properties. Scroll snap
2650         margin and scroll padding, along with their shorthands, are parsed using the same helper functions as normal
2651         margin and padding. For type and align, I added new helper functions that build up lists of 1 or 2
2652         CSSPrimitiveValues for each of the properties.
2653
2654         Parsing scroll-snap-align is straightforward -- we either have one or two values in the set {none, start,
2655         center, end}. For scroll-snap-type, we allow a single axis value {x, y, inline, block, both}, or a single
2656         strictness value {none, proximity, mandatory}, or an axis value followed by a non-'none' strictness (i.e. either
2657         proximity or mandatory).
2658
2659         * css/parser/CSSParserFastPaths.cpp:
2660         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2661         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2662         * css/parser/CSSParserValues.cpp:
2663         (WebCore::CSSParserValue::createCSSValue):
2664
2665         Removed references to LengthRepeat.
2666
2667         * css/parser/CSSPropertyParser.cpp:
2668         (WebCore::CSSPropertyParser::parseSingleValue):
2669         (WebCore::CSSPropertyParser::parseShorthand):
2670         (WebCore::consumeSnapPointCoordinateList): Deleted.
2671         (WebCore::consumeScrollSnapCoordinate): Deleted.
2672         (WebCore::consumeScrollSnapDestination): Deleted.
2673         (WebCore::consumeScrollSnapPoints): Deleted.
2674         (WebCore::consumeScrollSnapAlign):
2675         (WebCore::consumeScrollSnapType):
2676         (WebCore::CSSPropertyParser::parseSingleValue):
2677
2678         Added parsing for the longhand properties of scroll-snap-margin and scroll-padding, which use the existing
2679         consumeLength and consumeLengthOrPercent helpers, respectively. Removed code for parsing scroll snap
2680         coordinates, destinations and points. Added parsing logic for align and type.
2681
2682         * page/scrolling/AxisScrollSnapOffsets.cpp:
2683         (WebCore::computeScrollSnapPortOrAreaRect):
2684         (WebCore::computeScrollSnapAlignOffset):
2685         (WebCore::snapOffsetsToString):
2686         (WebCore::snapPortOrAreaToString):
2687         (WebCore::updateSnapOffsetsForScrollableArea):
2688         (WebCore::appendChildSnapOffsets): Deleted.
2689         (WebCore::destinationOffsetForViewSize): Deleted.
2690         (WebCore::updateFromStyle): Deleted.
2691         (WebCore::styleUsesElements): Deleted.
2692
2693         Overhauled updateSnapOffsetsForScrollableArea to work with the new scroll snapping model. In the new way of
2694         computing scroll snap offsets, we:
2695
2696         Compute the scroll container's scroll snap port, which is the padding box inset by the scroll padding
2697         For each child with snap positions (i.e. scroll-snap-align is not none on both axes)
2698           Compute the child's scroll snap area, which is the bounding box of the transformed border box
2699             If the container snaps along the horizontal axis and the snap area contributes a horizontal snap offset:
2700               Emit the distance from the alignment offset in the horizontal of the snap port to the corresponding offset
2701               in the snap area as a snap position.
2702             If the container snaps along the vertical axis and the snap area contributes a vertical snap offset:
2703               Emit the distance from the alignment offset in the vertical of the snap port to the corresponding offset
2704               in the snap area as a snap position.
2705         For the snap offsets in each axis, if there is at least one snap offset:
2706           Clamp the offsets to the min and max scroll offsets
2707           Ensure that the offsets are sorted and do not contain duplicated offsets
2708
2709         * platform/cocoa/ScrollController.mm:
2710         (WebCore::ScrollController::updateScrollSnapState):
2711
2712         Clear out the ScrollController's snap offsets and state along an axis when its ScrollableArea no longer has snap
2713         offsets in that axis.
2714
2715         * rendering/RenderBox.cpp:
2716         (WebCore::RenderBox::styleWillChange):
2717         (WebCore::RenderBox::willBeRemovedFromTree):
2718         * rendering/RenderLayerModelObject.cpp:
2719         (WebCore::scrollSnapContainerRequiresUpdateForStyleUpdate):
2720         (WebCore::RenderLayerModelObject::styleDidChange):
2721         * rendering/RenderView.cpp:
2722         (WebCore::RenderView::registerBoxWithScrollSnapPositions):
2723         (WebCore::RenderView::unregisterBoxWithScrollSnapPositions):
2724         (WebCore::RenderView::registerBoxWithScrollSnapCoordinates): Deleted.
2725         (WebCore::RenderView::unregisterBoxWithScrollSnapCoordinates): Deleted.
2726         * rendering/RenderView.h:
2727
2728         Tweaked the scroll snap child registration logic. registerBoxWithScrollSnapCoordinates is renamed to
2729         unregisterBoxWithScrollSnapPositions, since the notion of scroll snap coordinates no longer exists, and instead
2730         of checking if the list of scroll snap coordinates is empty for the absence of scroll positions, we instead
2731         check for a computed scroll snap align that is not none on both axes.
2732
2733         * rendering/style/RenderStyle.cpp:
2734         (WebCore::RenderStyle::initialScrollSnapType):
2735         (WebCore::RenderStyle::initialScrollSnapAlign):
2736         (WebCore::RenderStyle::scrollSnapArea):
2737         (WebCore::RenderStyle::scrollSnapPort):
2738         (WebCore::RenderStyle::scrollSnapType):
2739         (WebCore::RenderStyle::scrollPadding):
2740         (WebCore::RenderStyle::scrollPaddingTop):
2741         (WebCore::RenderStyle::scrollPaddingBottom):
2742         (WebCore::RenderStyle::scrollPaddingLeft):
2743         (WebCore::RenderStyle::scrollPaddingRight):
2744         (WebCore::RenderStyle::scrollSnapAlign):
2745         (WebCore::RenderStyle::scrollSnapMargin):
2746         (WebCore::RenderStyle::scrollSnapMarginTop):
2747         (WebCore::RenderStyle::scrollSnapMarginBottom):
2748         (WebCore::RenderStyle::scrollSnapMarginLeft):
2749         (WebCore::RenderStyle::scrollSnapMarginRight):
2750         (WebCore::RenderStyle::setScrollSnapType):
2751         (WebCore::RenderStyle::setScrollPaddingTop):
2752         (WebCore::RenderStyle::setScrollPaddingBottom):
2753         (WebCore::RenderStyle::setScrollPaddingLeft):
2754         (WebCore::RenderStyle::setScrollPaddingRight):
2755         (WebCore::RenderStyle::setScrollSnapAlign):
2756         (WebCore::RenderStyle::setScrollSnapMarginTop):
2757         (WebCore::RenderStyle::setScrollSnapMarginBottom):
2758         (WebCore::RenderStyle::setScrollSnapMarginLeft):
2759         (WebCore::RenderStyle::setScrollSnapMarginRight):
2760         (WebCore::RenderStyle::initialScrollSnapDestination): Deleted.
2761         (WebCore::RenderStyle::initialScrollSnapCoordinates): Deleted.
2762         (WebCore::RenderStyle::scrollSnapPointsX): Deleted.
2763         (WebCore::RenderStyle::scrollSnapPointsY): Deleted.
2764         (WebCore::RenderStyle::scrollSnapDestination): Deleted.
2765         (WebCore::RenderStyle::scrollSnapCoordinates): Deleted.
2766         (WebCore::RenderStyle::setScrollSnapPointsX): Deleted.
2767         (WebCore::RenderStyle::setScrollSnapPointsY): Deleted.
2768         (WebCore::RenderStyle::setScrollSnapDestination): Deleted.
2769         (WebCore::RenderStyle::setScrollSnapCoordinates): Deleted.
2770         * rendering/style/RenderStyle.h:
2771         (WebCore::RenderStyle::initialScrollSnapMargin):
2772         (WebCore::RenderStyle::initialScrollPadding):
2773         (WebCore::RenderStyle::scrollSnapType): Deleted.
2774         (WebCore::RenderStyle::setScrollSnapType): Deleted.
2775         (WebCore::RenderStyle::initialScrollSnapType): Deleted.
2776         (WebCore::RenderStyle::initialScrollSnapPointsX): Deleted.
2777         (WebCore::RenderStyle::initialScrollSnapPointsY): Deleted.
2778
2779         Added boilerplate code for returning various new scroll snap style properties, and removed similar code for
2780         handling the old scroll snap properties.
2781
2782         * rendering/style/RenderStyleConstants.h:
2783
2784         Added three new enum classes:
2785         - ScrollSnapStrictness represents the strictness of scroll snapping along one or both axes
2786         - ScrollSnapAxis designates the axes along which scroll snapping should occur
2787         - ScrollSnapAxisAlignType indicates which offsets along the x or y axes of the snap port and snap area should be
2788           used to compute the snap position emitted by a snap area.
2789
2790         * rendering/style/StyleRareNonInheritedData.cpp:
2791         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2792         (WebCore::StyleRareNonInheritedData::operator==):
2793         * rendering/style/StyleRareNonInheritedData.h:
2794
2795         Replaces the StyleScrollSnapPoints object (which, confusingly, was in charge of storing both the scroll
2796         container's and child elements' scroll snap styles) with StyleScrollSnapPort and StyleScrollSnapArea objects,
2797         which keep track of the style properties on the scroll container and the child element, respectively.
2798
2799         * rendering/style/StyleScrollSnapPoints.h:
2800         (WebCore::operator==):
2801         (WebCore::StyleScrollSnapPort::copy):
2802         (WebCore::StyleScrollSnapPort::StyleScrollSnapPort):
2803         (WebCore::StyleScrollSnapArea::copy):
2804         (WebCore::StyleScrollSnapArea::StyleScrollSnapArea):
2805         * rendering/style/StyleScrollSnapping.h: Added.
2806         (WebCore::operator!=):
2807         (WebCore::StyleScrollSnapPort::create):
2808         (WebCore::StyleScrollSnapArea::create):
2809         (WebCore::StyleScrollSnapArea::hasSnapPosition):
2810
2811         Overhauled StyleScrollSnapPoints, breaking the logic here into two classes: StyleScrollSnapPort for the scroll
2812         container, handling the properties `scroll-snap-type` and `scroll-padding` and StyleScrollSnapArea for child
2813         elements, handling the properties `scroll-snap-align` and `scroll-snap-margin`. The ScrollSnapType itself is
2814         composed of an axis value and a strictness, while a ScrollSnapAlign keeps track of the alignment modes in each
2815         axis. By default, these are initialized to {Both, None} and {None, None}, respectively. The rest of the logic is
2816         boilerplate code for comparing these style objects to one another and copying style representations.
2817
2818         * testing/Internals.cpp:
2819         (WebCore::Internals::scrollSnapOffsets):
2820
2821         Perform a layout on the document if needed before returning the list of computed snap offsets. The absence of
2822         this layout pass was causing some layout tests in css3/scroll-snap/ to flake when testing that programmatic
2823         changes to the scroll snap style properties change the computed snap offsets.
2824
2825 2016-12-19  Dean Jackson  <dino@apple.com>
2826
2827         Use ENABLE() in place of ENABLE_CSS_SELECTORS_LEVEL4
2828         https://bugs.webkit.org/show_bug.cgi?id=166043
2829         <rdar://problems/29743655>
2830
2831         Reviewed by Alex Christensen.
2832
2833         This doesn't compile unless the ENABLE_CSS_SELECTORS_LEVEL4 is defined.
2834
2835         * css/SelectorChecker.cpp:
2836         (WebCore::SelectorChecker::matchRecursively):
2837         * css/SelectorFilter.cpp:
2838         (WebCore::SelectorFilter::collectIdentifierHashes):
2839         * css/parser/CSSSelectorParser.cpp:
2840         (WebCore::isOnlyPseudoClassFunction):
2841         (WebCore::CSSSelectorParser::consumePseudo):
2842         (WebCore::CSSSelectorParser::consumeCombinator):
2843         * cssjit/SelectorCompiler.cpp:
2844         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
2845
2846 2016-12-20  Yusuke Suzuki  <utatane.tea@gmail.com>
2847
2848         Unreviewed, attempt to fix Windows Debug build part 2
2849         https://bugs.webkit.org/show_bug.cgi?id=166035
2850
2851         Ensured that this patch passes the build on the GTK port.
2852
2853         * rendering/RenderElement.cpp:
2854         * rendering/RenderElement.h:
2855
2856 2016-12-20  Yusuke Suzuki  <utatane.tea@gmail.com>
2857
2858         Unreviewed, fix Windows Debug build
2859         https://bugs.webkit.org/show_bug.cgi?id=166035
2860
2861         The size of SameSizeAsRenderElement should be in sync with sizeof(RenderElement).
2862
2863         * rendering/RenderElement.cpp:
2864
2865 2016-12-20  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2866
2867         WebRTC: RTCPeerConnection constructor argument should be optional
2868         https://bugs.webkit.org/show_bug.cgi?id=164057
2869
2870         Reviewed by Youenn Fablet.
2871
2872         Modify RTCPeerConnection JSBuiltin constructor to allow RTCPeerConfiguration
2873         argument to be optional.
2874
2875         Update existing tests.
2876
2877         * Modules/mediastream/RTCPeerConnection.js:
2878         (initializeRTCPeerConnection):
2879
2880 2016-12-19  Yusuke Suzuki  <utatane.tea@gmail.com>
2881
2882         [ES6] Enable ES6 Modules
2883         https://bugs.webkit.org/show_bug.cgi?id=165849
2884
2885         Reviewed by Geoffrey Garen.
2886
2887         * dom/ScriptElement.cpp:
2888         (WebCore::ScriptElement::determineScriptType):
2889         * html/parser/HTMLPreloadScanner.cpp:
2890         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2891         * page/Settings.in:
2892
2893 2016-12-17  Sam Weinig  <sam@webkit.org>
2894
2895         Remove a few trivial custom bindings
2896         https://bugs.webkit.org/show_bug.cgi?id=165999
2897
2898         Reviewed by Simon Fraser.
2899
2900         * CMakeLists.txt:
2901         * bindings/js/JSBindingsAllInOne.cpp:
2902         Remove files.
2903
2904         * WebCore.xcodeproj/project.pbxproj:
2905         Move custom bindings that only exist for GC or wrapping reasons
2906         to their own group, so we can focus on the ones with custom functions.
2907
2908         * bindings/js/JSDataTransferCustom.cpp: Removed.
2909         * bindings/js/JSTrackEventCustom.cpp: Removed.
2910
2911         * dom/DataTransfer.cpp:
2912         (WebCore::DataTransfer::types):
2913         Remove incorrect comment and use a more concise empty initialization syntax.
2914
2915         * dom/DataTransfer.idl:
2916         Update IDL to remove [Custom] annotation and match spec better.
2917
2918         * html/track/TrackEvent.cpp:
2919         (WebCore::convertToTrackEventTrack):
2920         (WebCore::TrackEvent::TrackEvent):
2921         * html/track/TrackEvent.h:
2922         Switch to store the Track in a Variant to make the binding easier.
2923
2924         * html/track/TrackEvent.idl:
2925         Remove [CustomGetter] annotation.
2926
2927 2016-12-19  Zalan Bujtas  <zalan@apple.com>
2928
2929         Do not position detached list item marker.
2930         https://bugs.webkit.org/show_bug.cgi?id=166035
2931         <rdar://problem/29175235>
2932
2933         Reviewed by Simon Fraser.
2934
2935         In certain (non-reproducible) cases, the list item marker can get detached from the tree
2936         during layout and when in RenderListItem::positionListMarker() we dereference the marker's parent, we crash.
2937         In addition to the null check, this patch adds an ASSERTION to catch such cases early on.
2938
2939         Unable to reproduce.
2940
2941         * rendering/RenderBoxModelObject.cpp:
2942         (WebCore::RenderBoxModelObject::moveChildTo):
2943         * rendering/RenderElement.cpp:
2944         (WebCore::RenderElement::removeChildInternal):
2945         * rendering/RenderElement.h:
2946         * rendering/RenderListItem.cpp:
2947         (WebCore::RenderListItem::layout):
2948         (WebCore::RenderListItem::positionListMarker):
2949         * rendering/RenderListItem.h:
2950         * rendering/RenderListMarker.h:
2951
2952 2016-12-19  Gavin Barraclough  <barraclough@apple.com>
2953
2954         [CSS Parser] Enable CSS Deferred Parsing
2955         https://bugs.webkit.org/show_bug.cgi?id=165869
2956
2957         Unreviewed rollout – looks like this regressed performance.
2958
2959         * css/parser/CSSParserMode.h:
2960         * page/Settings.in:
2961
2962 2016-12-18  Brent Fulgham  <bfulgham@apple.com>
2963
2964         Side effects while restting form elements
2965         https://bugs.webkit.org/show_bug.cgi?id=165959
2966         <rdar://problem/29705967>
2967
2968         Reviewed by Anders Carlsson.
2969
2970         JavaScript logic can run while resetting FormElement objects. This can
2971         lead to unintended side-effets and other unwanted behavior. We should
2972         protect these elements during the reset.
2973
2974         Test: fast/html/form-mutate.html
2975
2976         * html/HTMLFormElement.cpp:
2977         (WebCore::HTMLFormElement::HTMLFormElement): Switch to C++11 initialization.
2978         (WebCore::HTMLFormElement::reset): Protect elements until the reset
2979         operation is finished.
2980         (WebCore::HTMLFormElement::resetAssociatedFormControlElements): Added to share
2981         code with 'resumeFromDocument'.
2982         (WebCore::HTMLFormElement::resumeFromDocument): Protect elements until the
2983         reset operation is finished.
2984
2985 2016-12-19  Commit Queue  <commit-queue@webkit.org>
2986
2987         Unreviewed, rolling out r209983.
2988         https://bugs.webkit.org/show_bug.cgi?id=166024
2989
2990         There's intent to support persistent-usage-record (Requested
2991         by zdobersek on #webkit).
2992
2993         Reverted changeset:
2994
2995         "[EME] Remove MediaKeySessionType::persistent-usage-record"
2996         https://bugs.webkit.org/show_bug.cgi?id=166012
2997         http://trac.webkit.org/changeset/209983
2998
2999 2016-12-19  Sam Weinig  <sam@webkit.org>
3000
3001         Move custom files / callback objects into their respective groups.
3002
3003         Rubber-stamped by Simon Fraser.
3004
3005         * WebCore.xcodeproj/project.pbxproj:
3006
3007 2016-12-19  Sam Weinig  <sam@webkit.org>
3008
3009         [WebIDL] Remove custom binding for the named Image constructor
3010         https://bugs.webkit.org/show_bug.cgi?id=166023
3011
3012         Reviewed by Alex Christensen.
3013
3014         * bindings/js/JSBindingsAllInOne.cpp:
3015         * CMakeLists.txt:
3016         * WebCore.xcodeproj/project.pbxproj:
3017         Remove JSImageConstructor.
3018
3019         * bindings/js/JSImageConstructor.cpp: Removed.
3020         * bindings/js/JSImageConstructor.h: Removed.
3021         
3022         * bindings/js/JSDOMWindowCustom.cpp:
3023         (WebCore::JSDOMWindow::image): Deleted.
3024         * page/DOMWindow.idl:
3025         Remove custom getter for the constructor.
3026
3027         * html/HTMLImageElement.idl:
3028         Add NamedConstructor annotation.
3029
3030 2016-12-19  Antti Koivisto  <antti@apple.com>
3031
3032         Remove RenderObject::requiresForcedStyleRecalcPropagation
3033         https://bugs.webkit.org/show_bug.cgi?id=166021
3034
3035         Reviewed by Andreas Kling.
3036
3037         It is not called. It also makes no sense architecturally.
3038
3039         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
3040         * html/shadow/mac/ImageControlsRootElementMac.cpp:
3041         * rendering/RenderButton.h:
3042         * rendering/RenderFileUploadControl.h:
3043         * rendering/RenderListItem.h:
3044         * rendering/RenderMedia.h:
3045         * rendering/RenderMenuList.h:
3046         * rendering/RenderMeter.h:
3047         * rendering/RenderObject.h:
3048         (WebCore::RenderObject::requiresForcedStyleRecalcPropagation): Deleted.
3049         * rendering/RenderProgress.h:
3050         * rendering/RenderSlider.h:
3051         * rendering/RenderTextControl.h:
3052         * style/RenderTreeUpdater.cpp:
3053         (WebCore::RenderTreeUpdater::updateElementRenderer):
3054
3055             This is the only call site. Combination
3056
3057                 update.change == Style::NoChange && parent().styleChange == Style::Force
3058
3059             is impossible ('Force' inherits) so requiresForcedStyleRecalcPropagation doesn't ever even get called.
3060
3061 2016-12-19  Zan Dobersek  <zdobersek@igalia.com>
3062
3063         [EME] Remove MediaKeySessionType::persistent-usage-record
3064         https://bugs.webkit.org/show_bug.cgi?id=166012
3065
3066         Reviewed by Xabier Rodriguez-Calvar.
3067
3068         Remove the "persistent-usage-record" value from the MediaKeySessionType.
3069         This was removed from the spec as an at-risk feature.
3070         https://github.com/w3c/encrypted-media/issues/353
3071
3072         No non-imported tests need to be updated. This is still present in the
3073         tests imported from the W3C's web-platform-tests repository, but the
3074         tests haven't yet been updated upstream.
3075
3076         * Modules/encryptedmedia/CDM.cpp:
3077         (WebCore::CDM::isPersistentType):
3078         * Modules/encryptedmedia/MediaKeySessionType.h:
3079         * Modules/encryptedmedia/MediaKeySessionType.idl:
3080
3081 2016-12-19  Miguel Gomez  <magomez@igalia.com>
3082
3083         [GTK] GLXBadFBConfig error when creating an OpenGL context
3084         https://bugs.webkit.org/show_bug.cgi?id=165200
3085
3086         Reviewed by Carlos Garcia Campos.
3087
3088         glXCreateContextAttribsARB causes a GLXBadFBConfig X error when it's not able to provide the
3089         OpenGL version >= 3.2 we are requesting. Due to this, the app crashes instead of falling back to
3090         the legacy path.
3091         The patch modifies GLX context creation using a XErrorTrapper, so the first time a context is created
3092         we don't crash if OpenGL >= 3.2 is not available.
3093         If the gotten context is not valid, we fall back to whatever version glXCreateContextAttribsARB is
3094         able to provide.
3095         The legacy glXCreateContext is only used if the GLX_ARB_create_context extension is not available.
3096
3097         Covered by existent tests.
3098
3099         * platform/graphics/glx/GLContextGLX.cpp:
3100         (WebCore::tryCreateGLXARBContext):
3101         (WebCore::GLContextGLX::createWindowContext):
3102         (WebCore::GLContextGLX::createPbufferContext):
3103
3104 2016-12-18  Brady Eidson  <beidson@apple.com>
3105
3106         IndexedDB 2.0: Prefetch cursor records in the server.
3107         https://bugs.webkit.org/show_bug.cgi?id=166014
3108
3109         Reviewed by Andy Estes.
3110
3111         No new tests (Covered by existing LayoutTests and PerformanceTests).
3112
3113         This patch implements the followng:
3114         1 - After a backing store cursor completes a fetch in the server, it will schedule the next fetch 
3115             even before the client requests one. It will do this up to a limited number of prefetches.
3116         2 - Once a client request to advance the cursor comes in, we'll work our way through prefetched
3117             records instead of reading anything from disk, which might then cause us to continue prefetch.
3118         3 - If any changes to the object store occur, it will throw away all previously fetched records
3119             (There's room for future improvement here)
3120
3121         * Modules/indexeddb/server/IDBBackingStore.h:
3122         
3123         * Modules/indexeddb/server/IDBServer.cpp:
3124         (WebCore::IDBServer::IDBServer::postDatabaseTask):
3125         
3126         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3127         
3128         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3129         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
3130         (WebCore::IDBServer::SQLiteIDBBackingStore::prefetchCursor):
3131         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3132         
3133         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
3134         (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
3135         (WebCore::IDBServer::SQLiteIDBCursor::prefetch):
3136         (WebCore::IDBServer::SQLiteIDBCursor::advance):
3137         * Modules/indexeddb/server/SQLiteIDBCursor.h:
3138         
3139         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3140         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
3141         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
3142         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
3143         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3144
3145 2016-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3146
3147         Changing text direction fires input events with null inputTypes and no data
3148         https://bugs.webkit.org/show_bug.cgi?id=166007
3149         <rdar://problem/29557205>
3150
3151         Reviewed by Sam Weinig.
3152
3153         Adds support for the "formatSetInlineTextDirection" input type, triggered when using the context menu on Mac in
3154         an editable area (for both plain and rich text cases) to change paragraph direction. To do this, we add cases
3155         for EditActionSetWritingDirection in inputTypeNameForEditingAction and inputEventDataForEditingStyleAndAction.
3156
3157         When changing text direction for a plaintext editable element, we have logic in Editor::setBaseWritingDirection
3158         that sets the focused element's dir attribute to the requested value (ltr or rtl). We add similar hooks here to
3159         dispatch input events and handle preventing default.
3160
3161         Test: fast/events/before-input-events-prevent-text-direction.html
3162
3163         * editing/EditCommand.cpp:
3164         (WebCore::inputTypeNameForEditingAction):
3165
3166         Handle the EditActionSetWritingDirection case.
3167
3168         * editing/Editor.cpp:
3169         (WebCore::inputEventDataForEditingStyleAndAction):
3170         (WebCore::Editor::applyParagraphStyle):
3171
3172         Include input event data when dispatching an input event here.
3173
3174         (WebCore::Editor::setBaseWritingDirection):
3175         * testing/Internals.cpp:
3176         (WebCore::Internals::setBaseWritingDirection):
3177         * testing/Internals.h:
3178         * testing/Internals.idl:
3179
3180         Introduce an internal testing support hook for setting base writing direction (the same codepath taken when
3181         using the context menu to change paragraph direction). Currently, using testRunner.execCommand creates and
3182         applies style with an additional `unicode-bidi` attribute, and appears to also be intentionally disabled for
3183         plaintext editable elements.
3184
3185 2016-12-17  Simon Fraser  <simon.fraser@apple.com>
3186
3187         Build fix: linking WebCore was failing: you can't export inline functions.
3188
3189         * css/DeprecatedCSSOMPrimitiveValue.cpp:
3190         (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType):
3191         (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue):
3192         (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue):
3193         (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue):
3194         (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue):
3195         * css/DeprecatedCSSOMPrimitiveValue.h:
3196         (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType): Deleted.
3197         (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue): Deleted.
3198         (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue): Deleted.
3199         (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue): Deleted.
3200         (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue): Deleted.
3201
3202 2016-12-16  Dave Hyatt  <hyatt@apple.com>
3203
3204         [CSS Values] Make separate wrapper classes for the deprecated CSS Values OM
3205         https://bugs.webkit.org/show_bug.cgi?id=165968
3206
3207         Reviewed by Andreas Kling.
3208
3209         This patch changes the CSS OM for values to use distinct wrapper
3210         classes instead of cloning the existing classes. By actually wrapping
3211         values instead of cloning, we are freed up to change our CSS value hierarchy
3212         however we'd like (such as changing to match the new CSS Values OM that
3213         is coming soon).
3214
3215         All of the CSS Values wrapper classes are prefixed with "DeprecatedCSSOM"
3216         to reflect our desire (ultimately) to remove this API from our tree. We're
3217         the only ones that support it, and it's not used on the Web, but it is part
3218         of the WebKitLegacy API and might be used internally.
3219
3220         * CMakeLists.txt:
3221         * DerivedSources.cpp:
3222         * DerivedSources.make:
3223         * WebCore.xcodeproj/project.pbxproj:
3224         * bindings/js/DOMWrapperWorld.h:
3225         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3226         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
3227         * bindings/js/JSCSSValueCustom.cpp:
3228         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
3229         (WebCore::JSDeprecatedCSSOMValueOwner::finalize):
3230         (WebCore::toJSNewlyCreated):
3231         (WebCore::toJS):
3232         (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots): Deleted.
3233         (WebCore::JSCSSValueOwner::finalize): Deleted.
3234         * css/CSSComputedStyleDeclaration.cpp:
3235         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
3236         * css/CSSComputedStyleDeclaration.h:
3237         * css/CSSGridLineNamesValue.cpp:
3238         (WebCore::CSSGridLineNamesValue::cloneForCSSOM): Deleted.
3239         * css/CSSGridLineNamesValue.h:
3240         * css/CSSImageSetValue.cpp:
3241         (WebCore::CSSImageSetValue::cloneForCSSOM): Deleted.
3242         * css/CSSImageSetValue.h:
3243         * css/CSSImageValue.cpp:
3244         (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):
3245         (WebCore::CSSImageValue::cloneForCSSOM): Deleted.
3246         * css/CSSImageValue.h:
3247         * css/CSSPrimitiveValue.cpp:
3248         (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):
3249         (WebCore::CSSPrimitiveValue::cloneForCSSOM): Deleted.
3250         * css/CSSPrimitiveValue.h:
3251         * css/CSSPrimitiveValue.idl: Removed.
3252         * css/CSSStyleDeclaration.h:
3253         * css/CSSStyleDeclaration.idl:
3254         * css/CSSValue.cpp:
3255         (WebCore::CSSValue::traverseSubresources):
3256         (WebCore::CSSValue::equals):
3257         (WebCore::CSSValue::cssText):
3258         (WebCore::CSSValue::destroy):
3259         (WebCore::CSSValue::createDeprecatedCSSOMWrapper):
3260         (): Deleted.
3261         (WebCore::CSSValue::cloneForCSSOM): Deleted.
3262         * css/CSSValue.h:
3263         (WebCore::CSSValue::CSSValue):
3264         (WebCore::CSSValue::setCssText): Deleted.
3265         (WebCore::CSSValue::isCSSOMSafe): Deleted.
3266         (WebCore::CSSValue::isSubtypeExposedToCSSOM): Deleted.
3267         * css/CSSValue.idl: Removed.
3268         * css/CSSValueList.cpp:
3269         (WebCore::CSSValueList::cloneForCSSOM): Deleted.
3270         * css/CSSValueList.h:
3271         (WebCore::CSSValueList::separator):
3272         * css/CSSValueList.idl: Removed.
3273         * css/Counter.h:
3274         * css/Counter.idl: Removed.
3275         * css/DeprecatedCSSOMCounter.h: Added.
3276         * css/DeprecatedCSSOMCounter.idl: Copied from Source/WebCore/css/Counter.idl.
3277         * css/DeprecatedCSSOMPrimitiveValue.cpp: Added.
3278         (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
3279         (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
3280         (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):
3281         * css/DeprecatedCSSOMPrimitiveValue.h: Added.
3282         (WebCore::DeprecatedCSSOMPrimitiveValue::create):
3283         (WebCore::DeprecatedCSSOMPrimitiveValue::equals):
3284         (WebCore::DeprecatedCSSOMPrimitiveValue::cssValueType):
3285         (WebCore::DeprecatedCSSOMPrimitiveValue::cssText):
3286         (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType):
3287         (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue):
3288         (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue):
3289         (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue):
3290         (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue):
3291         (WebCore::DeprecatedCSSOMPrimitiveValue::stringValue):
3292         (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):
3293         * css/DeprecatedCSSOMPrimitiveValue.idl: Copied from Source/WebCore/css/CSSPrimitiveValue.idl.
3294         * css/DeprecatedCSSOMRGBColor.h: Added.
3295         * css/DeprecatedCSSOMRGBColor.idl: Copied from Source/WebCore/css/RGBColor.idl.
3296         * css/DeprecatedCSSOMRect.h: Added.
3297         * css/DeprecatedCSSOMRect.idl: Copied from Source/WebCore/css/Rect.idl.
3298         * css/DeprecatedCSSOMValue.cpp: Added.
3299         (WebCore::compareCSSOMValues):
3300         (WebCore::DeprecatedCSSOMValue::equals):
3301         (WebCore::DeprecatedCSSOMValue::destroy):
3302         (WebCore::DeprecatedCSSOMValue::cssValueType):
3303         (WebCore::DeprecatedCSSOMValue::cssText):
3304         * css/DeprecatedCSSOMValue.h: Added.
3305         (WebCore::DeprecatedCSSOMValue::deref):
3306         (WebCore::DeprecatedCSSOMValue::setCssText):
3307         (WebCore::DeprecatedCSSOMValue::operator==):
3308         (WebCore::DeprecatedCSSOMValue::isComplexValue):
3309         (WebCore::DeprecatedCSSOMValue::isPrimitiveValue):
3310         (WebCore::DeprecatedCSSOMValue::isValueList):
3311         (WebCore::DeprecatedCSSOMValue::classType):
3312         (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
3313         (WebCore::DeprecatedCSSOMValue::~DeprecatedCSSOMValue):
3314         (WebCore::DeprecatedCSSOMComplexValue::create):
3315         (WebCore::DeprecatedCSSOMComplexValue::equals):
3316         (WebCore::DeprecatedCSSOMComplexValue::cssText):
3317         (WebCore::DeprecatedCSSOMComplexValue::cssValueType):
3318         (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):
3319         * css/DeprecatedCSSOMValue.idl: Copied from Source/WebCore/css/CSSValue.idl.
3320         * css/DeprecatedCSSOMValueList.cpp: Added.
3321         (WebCore::DeprecatedCSSOMValueList::equals):
3322         (WebCore::DeprecatedCSSOMValueList::cssText):
3323         * css/DeprecatedCSSOMValueList.h: Added.
3324         (WebCore::DeprecatedCSSOMValueList::create):
3325         (WebCore::DeprecatedCSSOMValueList::cssValueType):
3326         (WebCore::DeprecatedCSSOMValueList::length):
3327         (WebCore::DeprecatedCSSOMValueList::item):
3328         (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):
3329         * css/DeprecatedCSSOMValueList.idl: Copied from Source/WebCore/css/CSSValueList.idl.
3330         * css/LengthRepeat.h:
3331         * css/PropertySetCSSStyleDeclaration.cpp:
3332         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
3333         (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
3334         (WebCore::StyleRuleCSSStyleDeclaration::didMutate):
3335         (WebCore::InlineCSSStyleDeclaration::didMutate):
3336         (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): Deleted.
3337         * css/PropertySetCSSStyleDeclaration.h:
3338         * css/RGBColor.cpp:
3339         (WebCore::RGBColor::red): Deleted.
3340         (WebCore::RGBColor::green): Deleted.
3341         (WebCore::RGBColor::blue): Deleted.
3342         (WebCore::RGBColor::alpha): Deleted.
3343         * css/RGBColor.h:
3344         * css/RGBColor.idl: Removed.
3345         * css/Rect.h:
3346         (WebCore::RectBase::RectBase):
3347         * css/Rect.idl: Removed.
3348         * svg/SVGElement.cpp:
3349         (WebCore::SVGElement::getPresentationAttribute):
3350         * svg/SVGElement.h:
3351         * svg/SVGElement.idl:
3352
3353 2016-12-17  Philippe Normand  <pnormand@igalia.com>
3354
3355         Unreviewed, rollout r209860 OWR player shouldn't be selected for normal video playback
3356
3357         * platform/GStreamer.cmake:
3358         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
3359         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
3360         (WebCore::MediaPlayerPrivateGStreamerOwr::play):
3361         (WebCore::MediaPlayerPrivateGStreamerOwr::pause):
3362         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
3363         (WebCore::MediaPlayerPrivateGStreamerOwr::stop):
3364         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded):
3365         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
3366         (WebCore::MediaPlayerPrivateGStreamerOwr::setSize):
3367         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
3368         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
3369         (WebCore::MediaEndpointOwr::createMutedRemoteSource):
3370         * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
3371         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
3372         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
3373         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
3374         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
3375         * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.
3376
3377 2016-12-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3378
3379         warning: the compiler can assume that the address of 'thisObject' will always evaluate to 'true' [-Waddress] in WebCore::JSHTMLDocument::getOwnPropertySlot
3380         https://bugs.webkit.org/show_bug.cgi?id=165987
3381
3382         Reviewed by Mark Lam.
3383
3384         Work around the warning by passing the JSObject pointer this function receives directly to
3385         ASSERT_GC_OBJECT_INHERITS, instead of casting it to a reference and then taking the address
3386         of that, to avoid the -Waddress warning.
3387
3388         * bindings/js/JSHTMLDocumentCustom.cpp:
3389         (WebCore::JSHTMLDocument::getOwnPropertySlot):
3390
3391 2016-12-17  Jer Noble  <jer.noble@apple.com>
3392
3393         Add implementation for navigator.requestMediaKeySystemAccess()
3394         https://bugs.webkit.org/show_bug.cgi?id=165850
3395
3396         Reviewed by Eric Carlson.
3397
3398         Test: media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html
3399
3400         Add an implementation of NavigatorEME::requestMediaKeySystemAccess() as well as the CDM
3401         object on which it depends.
3402
3403         * Modules/encryptedmedia/CDM.cpp: Added.
3404         (WebCore::cdmFactories):
3405         (WebCore::createCDMPrivateForKeySystem):
3406         (WebCore::CDM::registerCDMFactory):
3407         (WebCore::CDM::unregisterCDMFactory):
3408         (WebCore::CDM::supportsKeySystem):
3409         (WebCore::CDM::create):
3410         (WebCore::CDM::CDM):
3411         (WebCore::CDM::getSupportedConfiguration):
3412         (WebCore::CDM::doSupportedConfigurationStep):
3413         (WebCore::CDM::isPersistentType):