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