Add WebCrypto to status page
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-12-03  Jonathan Davis  <jond@apple.com>
2
3         Add WebCrypto to status page
4         https://bugs.webkit.org/show_bug.cgi?id=151760
5
6         Reviewed by Timothy Hatcher.
7
8         * features.json:
9
10 2015-12-03  Keith Rollin  <krollin@apple.com>
11
12         [Win] fast/forms/HTMLOptionElement_label03.html failing on win7
13         https://bugs.webkit.org/show_bug.cgi?id=150909
14         rdar://problem/23539673
15
16         Reviewed by Darin Adler.
17
18         When returning text to be displayed, an <option> element will return
19         the value of a label attribute if it exists, or the text content as a
20         fallback. The failing test concerned the display of a <select>
21         element when it contained a sole <option> element that had a label
22         attribute set to a single space. When displayed, various
23         platform-specific bits of code will strip off the leading and trailing
24         whitespace. However, when WebKit would use this text to measure how
25         wide the <select> popup menu button should be, it would not strip off
26         spaces, leading to the calculated width being wider than necessary.
27         The approach taken to fix this is to strip whitespace in the label
28         attribute before it is returned from the <option> element.
29
30         No new tests. fast/forms/HTMLOptionElement_label03.html had been
31         marked as being expected to fail in TestExpectations; that test now
32         succeeds.
33
34         * html/HTMLOptionElement.cpp:
35         (WebCore::HTMLOptionElement::label):
36
37 2015-12-03  Sam Weinig  <sam@webkit.org>
38
39         Try to fix the Windows build.
40
41         * bindings/js/JSWorkerGlobalScopeBase.cpp:
42         (WebCore::JSWorkerGlobalScopeBase::javaScriptRuntimeFlags):
43         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
44
45 2015-12-03  Brady Eidson  <beidson@apple.com>
46
47         Modern IDB: storage/indexeddb/cursor-advance.html fails.
48         https://bugs.webkit.org/show_bug.cgi?id=151731
49
50         Reviewed by Alex Christensen.
51
52         No new tests (At least one failing test now passes).
53
54         * Modules/indexeddb/IDBCursor.h:
55         * Modules/indexeddb/IDBCursor.idl:
56         
57         * Modules/indexeddb/client/IDBCursorImpl.cpp:
58         (WebCore::IDBClient::IDBCursor::advance): Return a custom exception message for TypeError.
59         * Modules/indexeddb/client/IDBCursorImpl.h:
60         
61         * Modules/indexeddb/legacy/LegacyCursor.cpp:
62         (WebCore::LegacyCursor::advance):
63         * Modules/indexeddb/legacy/LegacyCursor.h:
64         
65         * bindings/js/JSDOMBinding.cpp:
66         (WebCore::createDOMException):
67         (WebCore::setDOMException):
68         * bindings/js/JSDOMBinding.h:
69         
70         * bindings/scripts/IDLAttributes.txt:
71         
72         * inspector/InspectorIndexedDBAgent.cpp:
73
74 2015-12-03  Brent Fulgham  <bfulgham@apple.com>
75
76         Allow JavaScript to iterate over plugins for local files
77         https://bugs.webkit.org/show_bug.cgi?id=151783
78         <rdar://problem/23692113>
79
80         Reviewed by Alexey Proskuryakov.
81
82         Test: http/tests/plugins/plugin-javascript-access.html
83               plugins/plugin-javascript-access.html
84
85         * page/Page.cpp:
86         (WebCore::Page::showAllPlugins): True if we set the debugging flag to show
87         all plugins, or if the document's origin is from a local file.
88         * page/Page.h:
89
90 2015-12-03  Jer Noble  <jer.noble@apple.com>
91
92         Unreviewed build-fix; missing include.
93
94         * html/HTMLVideoElement.cpp:
95
96 2015-12-03  Brady Eidson  <beidson@apple.com>
97
98         Modern IDB: storage/indexeddb/cursor-skip-deleted.html crashes.
99         https://bugs.webkit.org/show_bug.cgi?id=151794
100
101         Reviewed by Alex Christensen.
102
103         STL reverse_iterators are a tricky beast.
104         
105         They are implemented in terms of a normal forward iterator (called the "base" iterator),
106         and they decrement a copy of that iterator when dereferenced.
107             
108         So when monitoring deletes from  a std::set to check if we should invalidate our current 
109         reverse_iterator, we were incorrectly comparing the deleted key to the value pointed by the
110         reverse_iterator instead of its base iterator.
111         
112         Since the iterators in question are bidirectional, anyways, we can just use a single iterator
113         and either increment or decrement it as needed.
114         
115         No new tests (At least one failing (crashing) test now passes).
116
117         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
118         (WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
119         (WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
120         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
121         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
122         (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
123         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
124         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
125         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
126         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
127         (WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
128         (WebCore::IDBServer::MemoryObjectStoreCursor::firstForwardIteratorInRemainingRange): Deleted.
129         (WebCore::IDBServer::MemoryObjectStoreCursor::firstReverseIteratorInRemainingRange): Deleted.
130         (WebCore::IDBServer::MemoryObjectStoreCursor::hasIterators): Deleted.
131         (WebCore::IDBServer::MemoryObjectStoreCursor::hasValidPosition): Deleted.
132         (WebCore::IDBServer::MemoryObjectStoreCursor::clearIterators): Deleted.
133         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
134
135 2015-12-03  Per Arne Vollan  <peavo@outlook.com>
136
137         [WinCairo][MediaFoundation] Main thread can block when session is destroyed.
138         https://bugs.webkit.org/show_bug.cgi?id=151803
139
140         Reviewed by Alex Christensen.
141
142         Set flag to make sure that the scheduler thread stops when the session ends.
143
144         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
145         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler):
146         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue):
147         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate):
148         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
149         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopThread):
150
151 2015-12-03  Jer Noble  <jer.noble@apple.com>
152
153         [iOS] Fullscreen -> PiP should resume to Fullscreen, not inline
154         https://bugs.webkit.org/show_bug.cgi?id=150906
155
156         Reviewed by Simon Fraser.
157
158         When restoring the user interface when exiting PiP, we should return to Fullscreen if that
159         is where fullscreen was initiated from. Additionally, when we "auto-PiP" by backgrounding the
160         app in Fullscreen mode, we should "auto-un-PiP" when restoring the application to foreground.
161
162         Rather than have a separate method to request exiting fullscreen, entering standard fullscreen,
163         and switching to & from PiP, add a new method setFullscreenMode() which does all three.
164
165         * html/HTMLVideoElement.cpp:
166         (WebCore::presentationModeToFullscreenMode):
167         (WebCore::HTMLVideoElement::webkitSetPresentationMode):
168         (WebCore::HTMLVideoElement::setFullscreenMode):
169         * html/HTMLVideoElement.h:
170
171         Add methods to for clients to request a specific fullscreen mode, and to query whether
172         the page is currently visible.
173
174         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
175         (WebVideoFullscreenControllerContext::requestFullscreenMode):
176         (WebVideoFullscreenControllerContext::isVisible):
177         (WebVideoFullscreenControllerContext::requestExitFullscreen): Deleted.
178         * platform/ios/WebVideoFullscreenModel.h:
179         * platform/ios/WebVideoFullscreenModelVideoElement.h:
180         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
181         (WebVideoFullscreenModelVideoElement::requestFullscreenMode):
182         (WebVideoFullscreenModelVideoElement::isVisible):
183         (WebVideoFullscreenModelVideoElement::requestExitFullscreen): Deleted.
184
185         Track whether returning from PiP should enter fullscreen, or whether foregrounding the app
186         should cause PiP to return to fullscreen.
187
188         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
189         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
190         (-[WebAVPlayerLayer layoutSublayers]): Renamed from -setBounds:. -layoutSublayers is called
191             more consistently than -setBounds:, including when a sublayer is added to the layer.
192         (WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView): The PiP WebAVPlayerLayer's
193             modelVideoLayerFrame property may have been modified, so pass it back up to the fullscreen
194             layer when exiting PiP.
195         (WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Request fullscreen if we auto-PiPed.
196         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Only recreate owned objects if they did not already exist.
197         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): If we are in PiP mode, enter fullscreen by stopping PiP.
198         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): requestExitFullscreen() -> requestFullscreenMode().
199         (WebVideoFullscreenInterfaceAVKit::willStartPictureInPicture): Animate out the fullscreen window, if exiting Fullscreen -> PiP.
200         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Set m_shouldReturnToFullscreenAfterEnteringForeground if we auto-PiPed.
201         (WebVideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): requestExitFullscreen() -> requestFullscreenMode().
202         (WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture): If we are returning from PiP -> Fullscreen, do not hide the fullscreen window.
203         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture): If we are returning from PiP -> Fullscreen, show the controls and notify clients.
204         (WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): Animate in the fullscreen window, if returning from PiP -> Fullscreen.
205         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Set m_shouldReturnToFullscreenWhenStoppingPiP if we are entering PiP from Fullscreen.
206         * platform/spi/cocoa/AVKitSPI.h:
207
208 2015-12-02  Sam Weinig  <sam@webkit.org>
209
210         Promise callbacks should be called at microtask checkpoints
211         https://bugs.webkit.org/show_bug.cgi?id=147933
212
213         Reviewed by Chris Dumez.
214
215         - Re-names MicroTaskQueue and MicroTask to MicrotaskQueue and Microtask to match the spec language.
216         - Re-implements MicrotaskQueue and Microtask support suspended Microtasks (via the new KeepInQueue
217           result value a Microtask can have when running) and correct behavior when Microtasks are added to
218           the queue during a Microtask checkpoint.
219         - MicrotaskQueue now has a mainThreadQueue() static function, replacing the old singleton() function,
220           which can be used for the Document (non-Worker) Microtasks. For Workers, the a MicrotaskQueue 
221           can be separately allocated for each WorkerGlobalScope (though this was not done in this change).
222         - Adds a helper subclass of Microtask, ActiveDOMCallbackMicrotask, for Microtasks that are
223           per-ScriptExecutationContext, and need to act as ActiveDOMCallbacks.
224         - Re-implement Document (non-Worker) Promises on top of ActiveDOMCallbackMicrotask.
225         - Re-implement MutationObserver delivery on top of Microtask.
226
227         Layout Test:
228             fast/dom/microtask-promise-mutation-observer-order.html
229
230         * CMakeLists.txt:
231         * WebCore.vcxproj/WebCore.vcxproj:
232         * WebCore.xcodeproj/project.pbxproj:
233         * dom/DOMAllInOne.cpp:
234         Add new files.
235
236         * bindings/js/JSDOMWindowBase.cpp:
237         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
238         Switch to using ActiveDOMCallbackMicrotask/MicrotaskQueue rather than ScriptExecutionContext's Task mechanism
239         for JavaScriptCore tasks.
240
241         * bindings/js/JSMainThreadExecState.cpp:
242         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
243         Perform a microtask checkpoint rather than calling MutationObserver code explicitly now that mutation observers
244         use microtasks.
245
246         * dom/ActiveDOMCallbackMicrotask.cpp: Added.
247         (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
248         (WebCore::ActiveDOMCallbackMicrotask::~ActiveDOMCallbackMicrotask):
249         (WebCore::ActiveDOMCallbackMicrotask::run):
250         (WebCore::ActiveDOMCallbackMicrotask::contextDestroyed):
251         * dom/ActiveDOMCallbackMicrotask.h: Added.
252         Add a helper subclass of Microtask which behaves like a ActiveDOMCallback (e.g. supports suspension
253         and context destruction).
254
255         * dom/MicroTask.cpp: Renamed to Microtasks.cpp.
256         * dom/MicroTask.h: Renamed to Microtasks.h.
257         * dom/Microtasks.cpp: Renamed from Source/WebCore/dom/MicroTask.cpp.
258         (WebCore::Microtask::removeSelfFromQueue):
259         (WebCore::MicrotaskQueue::mainThreadQueue):
260         (WebCore::MicrotaskQueue::append):
261         (WebCore::MicrotaskQueue::remove):
262         (WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
263         (WebCore::MicroTaskQueue::singleton): Deleted.
264         (WebCore::MicroTaskQueue::queueMicroTask): Deleted.
265         (WebCore::MicroTaskQueue::runMicroTasks): Deleted.
266         * dom/Microtasks.h: Renamed from Source/WebCore/dom/MicroTask.h.
267         (WebCore::Microtask::~Microtask):
268         (WebCore::MicrotaskQueue::MicrotaskQueue):
269         (WebCore::MicrotaskQueue::~MicrotaskQueue):
270         (WebCore::MicroTask::~MicroTask): Deleted.
271         (WebCore::MicroTaskQueue::~MicroTaskQueue): Deleted.
272         (WebCore::MicroTaskQueue::MicroTaskQueue): Deleted.
273         Re-implement MicrotaskQueue and Microtask to support Microtask suspension (via the KeepInQueue result
274         value) and correct behavior when Microtasks are queued during checkpoints.
275
276         * dom/MutationObserver.cpp:
277         (WebCore::suspendedMutationObservers):
278         (WebCore::MutationObserverMicrotask::MutationObserverMicrotask):
279         (WebCore::MutationObserverMicrotask::~MutationObserverMicrotask):
280         (WebCore::MutationObserverMicrotask::run):
281         (WebCore::queueMutationObserverCompoundMicrotask):
282         (WebCore::MutationObserver::enqueueMutationRecord):
283         (WebCore::MutationObserver::setHasTransientRegistration):
284         * dom/MutationObserver.h:
285         Re-implement MutationObserver delivery on top of Microtasks.
286
287         * dom/ScriptRunner.cpp:
288         (WebCore::ScriptRunner::timerFired):
289         Remove unnecessary call to runMicroTasks().
290
291         * html/parser/HTMLScriptRunner.cpp:
292         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
293         (WebCore::HTMLScriptRunner::runScript):
294         Remove calls to MutationObserver::deliverAllMutations() now that the MicrotaskQueue will take care of it.
295
296         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
297         Remove unnecessary call to runMicroTasks().
298
299         * testing/Internals.cpp:
300         (WebCore::Internals::queueMicroTask):
301         Use ActiveDOMCallbackMicrotask rather than a custom test subclass.
302
303         * testing/MicroTaskTest.cpp: Removed.
304         * testing/MicroTaskTest.h: Removed.
305         Remove custom test subclass of Microtask, just use ActiveDOMCallbackMicrotask directly.
306
307 2015-12-03  Brady Eidson  <beidson@apple.com>
308
309         Add GetterRaisesExceptionWithMessage and SetterRaisesExceptionWithMessage to the code generator.
310         https://bugs.webkit.org/show_bug.cgi?id=151807
311
312         Reviewed by Alex Christensen.
313
314         No new tests (Covered by changes to existing bindings tests).
315
316         While we're at it, rework the existing 'RaisesExceptionWithMessage' concept to use a struct instead of
317         two separate variables to reduce complexity.
318         
319         * bindings/scripts/CodeGeneratorJS.pm:
320         (GenerateImplementation):
321         (GenerateImplementationFunctionCall):
322         (GenerateConstructorDefinition):
323         (GenerateParametersCheck): Deleted.
324         (GenerateReturnParameters): Deleted.
325         
326         * bindings/scripts/IDLAttributes.txt:
327         
328         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
329         (webkit_dom_test_obj_set_property):
330         (webkit_dom_test_obj_get_property):
331         (webkit_dom_test_obj_class_init):
332         (webkit_dom_test_obj_get_attr_with_getter_exception_with_message):
333         (webkit_dom_test_obj_set_attr_with_getter_exception_with_message):
334         (webkit_dom_test_obj_get_attr_with_setter_exception_with_message):
335         (webkit_dom_test_obj_set_attr_with_setter_exception_with_message):
336         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
337         
338         * bindings/scripts/test/JS/JSTestObj.cpp:
339         (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
340         (WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
341         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
342         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
343         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
344         * bindings/scripts/test/ObjC/DOMTestObj.h:
345         
346         * bindings/scripts/test/ObjC/DOMTestObj.mm:
347         (-[DOMTestObj attrWithGetterExceptionWithMessage]):
348         (-[DOMTestObj setAttrWithGetterExceptionWithMessage:]):
349         (-[DOMTestObj attrWithSetterExceptionWithMessage]):
350         (-[DOMTestObj setAttrWithSetterExceptionWithMessage:]):
351         
352         * bindings/scripts/test/TestObj.idl:
353         
354         * dom/ExceptionCode.h:
355
356 2015-12-03  Javier Fernandez  <jfernandez@igalia.com>
357
358         [css-grid] margin-left:auto and margin-top:auto discards the margin on opposite side
359         https://bugs.webkit.org/show_bug.cgi?id=151802
360
361         Reviewed by Sergio Villar Senin.
362
363         When resolving auto margins so that they use the available space, in the
364         corresponding axis, we must consider that there might be other specified
365         margins. Such margins must account to determine the actual available space.
366
367         Test: fast/css-grid-layout/grid-item-auto-margins-must-respect-specified-margins.html
368
369         * rendering/RenderGrid.cpp:
370         (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded):
371         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
372
373 2015-12-02  Antti Koivisto  <antti@apple.com>
374
375         Move ResourceLoadScheduler to WebKit1
376         https://bugs.webkit.org/show_bug.cgi?id=151743
377
378         Reviewed by Alex Christensen.
379
380         It is no longer used by WebKit2. Simplify the WebKit/WebCore interface.
381
382         * WebCore.xcodeproj/project.pbxproj:
383         * dom/ContainerNode.cpp:
384         * dom/Document.cpp:
385         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
386         * dom/Document.h:
387         * loader/DocumentLoader.h:
388         * loader/LoaderStrategy.cpp:
389         (WebCore::LoaderStrategy::~LoaderStrategy):
390         (WebCore::ResourceLoadSuspender::ResourceLoadSuspender):
391         (WebCore::ResourceLoadSuspender::~ResourceLoadSuspender):
392         (WebCore::LoaderStrategy::resourceLoadScheduler): Deleted.
393         (WebCore::LoaderStrategy::loadResourceSynchronously): Deleted.
394         (WebCore::LoaderStrategy::createBlobRegistry): Deleted.
395         (WebCore::LoaderStrategy::createPingHandle): Deleted.
396         * loader/LoaderStrategy.h:
397
398             Loading functions implemented on WebKit side move to pure virtual LoaderStrategy.
399
400         * loader/ResourceLoadScheduler.cpp: Removed.
401         * loader/ResourceLoadScheduler.h: Removed.
402
403             ResourceLoadScheduler moves to WebKit1 as WebResourceLoadScheduler.
404
405         * loader/ResourceLoader.cpp:
406         (WebCore::ResourceLoader::finishNetworkLoad):
407         (WebCore::ResourceLoader::setDefersLoading):
408         (WebCore::ResourceLoader::frameLoader):
409         (WebCore::ResourceLoader::willSwitchToSubstituteResource):
410         (WebCore::ResourceLoader::willSendRequestInternal):
411         * loader/archive/ArchiveResourceCollection.h:
412         * loader/cache/CachedResource.cpp:
413         (WebCore::CachedResource::load):
414         * loader/cache/CachedResourceLoader.cpp:
415         (WebCore::CachedResourceLoader::performPostLoadActions):
416         (WebCore::CachedResourceLoader::incrementRequestCount):
417         * platform/PlatformStrategies.h:
418         (WebCore::PlatformStrategies::pluginStrategy):
419         (WebCore::PlatformStrategies::blobRegistry):
420
421             Move BlobRegistry factory function here from LoaderStrategy as this allows network process to have null loaderStrategy.
422             (it could be renamed BlobStrategy for consistency later).
423
424         (WebCore::PlatformStrategies::PlatformStrategies):
425         * platform/network/BlobRegistry.cpp:
426         (WebCore::blobRegistry):
427         (WebCore::BlobRegistry::~BlobRegistry):
428         * platform/network/ResourceRequestBase.h:
429         * style/StyleResolveTree.cpp:
430         (WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler):
431         (WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):
432
433 2015-12-02  Myles C. Maxfield  <mmaxfield@apple.com>
434
435         Unify font-variant-* with font-variant shorthand
436         https://bugs.webkit.org/show_bug.cgi?id=149773
437
438         Reviewed by Darin Adler.
439
440         This patch makes font-variant a shorthand for the following properties:
441         font-variant-ligatures
442         font-variant-position
443         font-variant-caps
444         font-variant-numeric
445         font-variant-alternates
446         font-variant-east-asian
447
448         This is consistent with the CSS Fonts Level 3 spec.
449
450         This patch also migrates the "font" longhand to use the font-variant-caps
451         property.
452
453         Test: fast/text/font-variant-shorthand.html
454
455         * css/CSSComputedStyleDeclaration.cpp:
456         (WebCore::fontVariantEastAsianPropertyValue): Rename FontVariantEastAsian values.
457         (WebCore::fontVariantFromStyle): We must consult with the longhand properties to determine
458         font-variant computed style.
459         (WebCore::ComputedStyleExtractor::propertyValue): Don't put any-old font-variant-caps inside
460         the font shorthand.
461         * css/CSSFontSelector.cpp:
462         (WebCore::CSSFontSelector::addFontFaceRule): Guard against incorrect downcasts (due to inherit
463         of the new shorthand property).
464         * css/CSSParser.cpp: Parse font-variant as a shorthand. Also implement its "normal" and "none" values.
465         (WebCore::CSSParser::parseValue):
466         (WebCore::CSSParser::parseFont):
467         (WebCore::CSSParser::parseSystemFont):
468         (WebCore::CSSParser::parseFontVariantLigatures):
469         (WebCore::CSSParser::parseFontVariantNumeric):
470         (WebCore::CSSParser::parseFontVariantEastAsian):
471         (WebCore::CSSParser::parseFontVariant):
472         (WebCore::isValidKeywordPropertyAndValue): Deleted.
473         (WebCore::isKeywordPropertyID): Deleted.
474         * css/CSSParser.h:
475         * css/CSSPropertyNames.in: Turn font-variant into a shorthand property.
476         * css/FontVariantBuilder.h: Guard against incorrect downcasts. Also update for renamed
477         FontVariantEastAsian type.
478         (WebCore::applyValueFontVariantLigatures):
479         (WebCore::applyValueFontVariantNumeric):
480         (WebCore::applyValueFontVariantEastAsian):
481         * css/StyleProperties.cpp: Update to use the more specific property.
482         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit):
483         (WebCore::StyleProperties::fontValue):
484         (WebCore::StyleProperties::asText):
485         * css/StyleResolver.cpp: Ditto.
486         (WebCore::StyleResolver::isValidCueStyleProperty):
487         * editing/EditingStyle.cpp: Ditto.
488         * editing/cocoa/HTMLConverter.mm: Ditto.
489         (HTMLConverterCaches::propertyValueForNode):
490         (HTMLConverter::computedAttributesForElement):
491         * editing/ios/EditorIOS.mm: Ditto.
492         (WebCore::Editor::removeUnchangeableStyles):
493         * html/canvas/CanvasRenderingContext2D.cpp: Ditto.
494         (WebCore::CanvasRenderingContext2D::font):
495         (WebCore::CanvasRenderingContext2D::setFont):
496         * platform/graphics/FontCache.h: Removing duplicate cache key value.
497         (WebCore::FontDescriptionKey::makeFlagsKey):
498         * platform/graphics/FontCascade.cpp: Migrate to the new font-variant-caps from the old member variable.
499         (WebCore::FontCascade::glyphDataForCharacter):
500         * platform/graphics/FontCascade.h: Ditto.
501         (WebCore::FontCascade::isSmallCaps):
502         * platform/graphics/FontDescription.cpp: Ditto.
503         (WebCore::FontDescription::FontDescription):
504         * platform/graphics/FontDescription.h: Ditto.
505         (WebCore::FontCascadeDescription::equalForTextAutoSizing):
506         (WebCore::FontDescription::smallCaps): Deleted.
507         (WebCore::FontDescription::setSmallCaps): Deleted.
508         (WebCore::FontDescription::setIsSmallCaps): Deleted.
509         (WebCore::FontDescription::operator==): Deleted.
510         * platform/graphics/cocoa/FontCacheCoreText.cpp: Rename FontVariantEastAsianWidth.
511         (WebCore::computeFeatureSettingsFromVariants):
512         * platform/text/TextFlags.h: Ditto.
513         (WebCore::FontVariantSettings::operator==):
514         * rendering/RenderText.cpp: Migrage to the new font-variant-caps from the old member variable.
515         (WebCore::RenderText::widthFromCache):
516
517 2015-12-02  Alex Christensen  <achristensen@webkit.org>
518
519         Reduce size of ScriptElement
520         https://bugs.webkit.org/show_bug.cgi?id=151786
521
522         Reviewed by Andreas Kling.
523
524         * dom/ScriptElement.cpp:
525         (WebCore::ScriptElement::ScriptElement):
526         (WebCore::ScriptElement::requestScript):
527         * dom/ScriptElement.h:
528         Use callOnMainThread instead of a Timer to save memory on a timer that is rarely used.
529         Use bit fields for the boolean values to save another 8 bytes per ScriptElement.
530         This reduces sizeof(ScriptElement) from 168 to 48 bytes.
531
532 2015-12-02  Alex Christensen  <achristensen@webkit.org>
533
534         Asynchronously call onerror when a content blocker blocks ascript element's load
535         https://bugs.webkit.org/show_bug.cgi?id=151649
536
537         Reviewed by Brady Eidson.
538
539         Test: http/tests/contentextensions/script-onerror.html
540
541         * dom/ScriptElement.cpp:
542         (WebCore::ScriptElement::ScriptElement):
543         (WebCore::ScriptElement::requestScript):
544         * dom/ScriptElement.h:
545
546 2015-12-02  Jer Noble  <jer.noble@apple.com>
547
548         [iOS] Abrupt transition between Fullscreen -> PiP
549         https://bugs.webkit.org/show_bug.cgi?id=151719
550
551         Reviewed by Eric Carlson.
552
553         Follow-up to r192922: When moving from inline -> PiP, don't forget to hide the fullscreen
554         window once the PiP transition completes.
555
556         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
557         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):
558
559 2015-12-02  Commit Queue  <commit-queue@webkit.org>
560
561         Unreviewed, rolling out r192955.
562         https://bugs.webkit.org/show_bug.cgi?id=151776
563
564         A large number of the tests added with this change are failing
565         on Windows (Requested by ryanhaddad on #webkit).
566
567         Reverted changeset:
568
569         "[css border] border-image doesn't honor border-style"
570         https://bugs.webkit.org/show_bug.cgi?id=99922
571         http://trac.webkit.org/changeset/192955
572
573 2015-12-02  Yoav Weiss  <yoav@yoav.ws>
574
575         Fix preloader issue with srcdoc documents.
576         https://bugs.webkit.org/show_bug.cgi?id=151744
577
578         Reviewed by Ryosuke Niwa.
579
580         Make sure that PreloadRequest is resolving URLs based on the document's
581         baseURL() rather than using url() as the base URL, which is not how URLs
582         are resolved by the parser, and fails when document->url() diverges from
583         the document's base URL (e.g. in the case of srcdoc based documents).
584
585         Test: fast/preloader/iframe-srcdoc.html
586
587         * html/parser/HTMLResourcePreloader.cpp:
588         (WebCore::PreloadRequest::completeURL):
589
590 2015-12-02  Jer Noble  <jer.noble@apple.com>
591
592         Add a setting and restriction which will pause invisible autoplaying video
593         https://bugs.webkit.org/show_bug.cgi?id=151412
594
595         Reviewed by Eric Carlson.
596
597         Test: media/video-restricted-invisible-autoplay-not-allowed.html
598
599         Drive-by fix: m_autoplaying is reset in many places by calling pause() or play(), where those
600         calls did not originate from an explicit request to pause or play, e.g., during an interruption.
601         This causes m_autoplaying to be set to false, thus breaking resumption of autoplaying when the
602         interruption ends. Update PlatformMediaSession to remember its client's "autoplaying" state and
603         restore it when an interruption ends.
604
605         Add a means to register for viewport visibility notifications to FrameView, RenderView,
606         and RenderElement. Elements who wish to recieve these notifications must do so through their
607         renderer, and thus will have to re-register whenever a new renderer is attached.
608
609         Add a restriction to HTMLMediaElement which will pause autoplaying video when that video scrolls
610         out of the viewport, or is hidden with CSS.
611
612         Add a setting which controls whether that new restriction is set.
613
614         * dom/Element.h:
615         (WebCore::Element::isVisibleInViewportChanged): Add default empty virtual method.
616         * html/HTMLMediaElement.cpp:
617         (WebCore::HTMLMediaElement::HTMLMediaElement):
618         (WebCore::HTMLMediaElement::didMoveToNewDocument):
619         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache):
620         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
621         (WebCore::HTMLMediaElement::resumeAutoplaying):
622         (WebCore::mediaElementIsAllowedToAutoplay):
623         (WebCore::HTMLMediaElement::isVisibleInViewportChanged):
624         (WebCore::HTMLMediaElement::updateShouldAutoplay):
625         (WebCore::HTMLMediaElement::HTMLMediaElement): Set the new restriction based on the current Settings.
626         (WebCore::HTMLMediaElement::resumeAutoplaying): Continue autoplay, or begin playback.
627         (WebCore::HTMLMediaElement::didMoveToNewDocument): Update our autoplay state.
628         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
629         (WebCore::HTMLMediaElement::removedFrom): Ditto.
630         (WebCore::HTMLMediaElement::didAttachRenderers): Ditto.
631         (WebCore::HTMLMediaElement::didDetachRenderers): Ditto.
632         (WebCore::HTMLMediaElement::visibilityDidChange): Ditto.
633         (WebCore::HTMLMediaElement::willDetachRenderers): Unregister for visibility callbacks.
634         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Clear new restriction.
635         (WebCore::mediaElementIsAllowedToAutoplay): Check for autoplay requirements.
636         (WebCore::HTMLMediaElement::isVisibleInViewportChanged): Added, update our autoplay state.
637         (WebCore::HTMLMediaElement::updateShouldAutoplay): Set interruption if necessary, clear otherwise.
638         * html/HTMLMediaElement.h:
639         * html/MediaElementSession.cpp:
640         (WebCore::restrictionName): Added support for new restriction.
641         * html/MediaElementSession.h:
642         * page/FrameView.cpp:
643         (WebCore::FrameView::viewportContentsChanged): Update clients of viewport visibility.
644         * page/Settings.in:
645         * platform/audio/PlatformMediaSession.cpp:
646         (WebCore::stateName): Add new "Autoplay" state.
647         (WebCore::interruptionName): Added new interruption type.
648         (WebCore::PlatformMediaSession::beginInterruption): Set the m_interruptionType.
649         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying): Set the m_state to Autoplaying.
650         * platform/audio/PlatformMediaSession.h:
651         (WebCore::PlatformMediaSession::interruptionType): Added getter.
652         (WebCore::PlatformMediaSessionClient::resumeAutoplaying): Added default.
653         * platform/audio/PlatformMediaSessionManager.cpp:
654         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback): Only pause session if its state is playing.
655         * rendering/RenderElement.cpp:
656         (WebCore::RenderElement::RenderElement): Set new ivars.
657         (WebCore::RenderElement::~RenderElement): Unregister for callbacks if necessary.
658         (WebCore::RenderElement::registerForVisibleInViewportCallback): Register for callbacks from RenderView.
659         (WebCore::RenderElement::unregisterForVisibleInViewportCallback): Unregister from same.
660         (WebCore::RenderElement::visibleInViewportStateChanged): Notify Element if value has changed.
661         * rendering/RenderElement.h:
662         * rendering/RenderView.cpp:
663         (WebCore::RenderView::registerForVisibleInViewportCallback): Add renderer to list of callbacks.
664         (WebCore::RenderView::unregisterForVisibleInViewportCallback): Remove renderer from same.
665         (WebCore::RenderView::updateVisibleViewportRect): Walk renderers setting their visiblility based on the viewport visible rect.
666         * rendering/RenderView.h:
667         * testing/Internals.cpp:
668         (WebCore::Internals::setMediaElementRestrictions): Support new restriction.
669
670 2015-12-02  Brady Eidson  <beidson@apple.com>
671
672         Modern IDB: IDBTransaction::error is not exposed.
673         https://bugs.webkit.org/show_bug.cgi?id=151752
674
675         Reviewed by Alex Christensen.
676
677         No new tests (At least 3 failing tests now pass, plus changes to other faulty tests).
678
679         * Modules/indexeddb/client/IDBRequestImpl.cpp:
680         (WebCore::IDBClient::IDBRequest::dispatchEvent):
681         (WebCore::IDBClient::IDBRequest::uncaughtExceptionInEventHandler):
682         * Modules/indexeddb/client/IDBRequestImpl.h:
683         
684         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
685         (WebCore::IDBClient::IDBTransaction::error):
686         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
687         (WebCore::IDBClient::IDBTransaction::abort):
688         (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
689         * Modules/indexeddb/client/IDBTransactionImpl.h:
690
691 2015-12-02  Adenilson Cavalcanti  <cavalcantii@gmail.com>
692
693         [css border] border-image doesn't honor border-style
694         https://bugs.webkit.org/show_bug.cgi?id=99922
695
696         Reviewed by Simon Fraser.
697
698         Ensure that WebKit will be compliant to css-backgrounds spec where a
699         border with an image will only be rendered if there is a style defined.
700
701         Quote: "None: No border. Color and width are ignored (i.e., the border has width 0)".
702         Reference: http://www.w3.org/TR/css3-background/#border-style
703
704         From W3C discussion: "The fact that these properties set the style of the border is
705         normative". Reference: https://lists.w3.org/Archives/Public/www-style/2015Nov/0260.html
706
707         Test: fast/borders/border-image-should-not-display.html
708
709         * rendering/style/BorderData.h:
710         (WebCore::BorderData::hasBorder):
711         (WebCore::BorderData::borderLeftWidth):
712         (WebCore::BorderData::borderRightWidth):
713         (WebCore::BorderData::borderTopWidth):
714         (WebCore::BorderData::borderBottomWidth):
715         * rendering/style/BorderValue.h:
716         (WebCore::BorderValue::nonZero):
717         (WebCore::BorderValue::isVisible):
718
719 2015-12-02  Eric Carlson  <eric.carlson@apple.com>
720
721         [MediaStream] Implement MediaStreamTrack.getSettings()
722         https://bugs.webkit.org/show_bug.cgi?id=151727
723
724         Reviewed by Jer Noble.
725
726         MediaStreamTrack.getStates has been replaced by MediaStreamTrack.getSettings. 
727
728         Test: fast/mediastream/MediaStreamTrack-getSettings.html
729
730         * CMakeLists.txt: MediaSourceStates.* -> MediaSourceSettings.*.
731         * DerivedSources.make: No more MediaSourceStates.idl.
732         * Modules/mediastream/CapabilityRange.cpp: MediaSourceStates.* -> MediaSourceSettings.*.
733         * Modules/mediastream/MediaSourceSettings.cpp: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.cpp.
734         (WebCore::MediaSourceSettings::create):
735         (WebCore::MediaSourceSettings::MediaSourceSettings):
736         (WebCore::MediaSourceSettings::facingMode):
737         (WebCore::MediaSourceStates::create): Deleted.
738         (WebCore::MediaSourceStates::MediaSourceStates): Deleted.
739         (WebCore::MediaSourceStates::sourceType): Deleted.
740         (WebCore::MediaSourceStates::facingMode): Deleted.
741         * Modules/mediastream/MediaSourceSettings.h: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.h.
742
743         MediaSourceStates.* renamed to MediaSourceSettings.* and updated to new API.
744         * Modules/mediastream/MediaSourceStates.cpp: Removed.
745         * Modules/mediastream/MediaSourceStates.h: Removed.
746         * Modules/mediastream/MediaSourceStates.idl: Removed.
747
748         * Modules/mediastream/MediaStreamCapabilities.cpp:
749         (WebCore::MediaStreamCapabilities::sourceType): Return an empty vector for now, will be fixed
750           by the changes for https://bugs.webkit.org/show_bug.cgi?id=151728.
751         (WebCore::MediaStreamCapabilities::sourceId): RealtimeMediaSourceStates -> MediaSourceSettings.
752         (WebCore::MediaStreamCapabilities::facingMode): Ditto.
753
754         * Modules/mediastream/MediaStreamTrack.cpp:
755         (WebCore::MediaStreamTrack::getSettings): New.
756         (WebCore::MediaStreamTrack::getCapabilities): Don't modify states, just pass through whatever
757           private track returns.
758         (WebCore::MediaStreamTrack::trackSettingsChanged):
759         (WebCore::MediaStreamTrack::states): Deleted.
760         (WebCore::MediaStreamTrack::trackStatesChanged): Deleted.
761         * Modules/mediastream/MediaStreamTrack.h:
762         * Modules/mediastream/MediaStreamTrack.idl: MediaSourceStates -> MediaSourceSettings.
763
764         * Modules/webaudio/MediaStreamAudioSource.cpp:
765         (WebCore::MediaStreamAudioSource::settings):
766         (WebCore::MediaStreamAudioSource::states): Deleted.
767         * Modules/webaudio/MediaStreamAudioSource.h: MediaSourceStates -> MediaSourceSettings.
768
769         * WebCore.xcodeproj/project.pbxproj: MediaSourceStates.* -> MediaSourceSettings.*.
770
771         * bindings/js/JSMediaSourceStatesCustom.cpp: Removed.
772         * bindings/js/JSMediaStreamTrackCustom.cpp: Added.
773         (WebCore::JSMediaStreamTrack::getSettings): MediaSourceSettings is a generic dictionary so 
774           it has to be generated manually.
775
776         * platform/mediastream/MediaStreamPrivate.cpp:
777         (WebCore::MediaStreamPrivate::intrinsicSize): states -> settings.
778         (WebCore::MediaStreamPrivate::trackStatesChanged): Deleted.
779         * platform/mediastream/MediaStreamPrivate.h:
780
781         * platform/mediastream/MediaStreamTrackPrivate.cpp:
782         (WebCore::MediaStreamTrackPrivate::settings):
783         (WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
784         (WebCore::MediaStreamTrackPrivate::states): Deleted.
785         (WebCore::MediaStreamTrackPrivate::sourceStatesChanged): Deleted.
786         * platform/mediastream/MediaStreamTrackPrivate.h:
787
788         * platform/mediastream/RealtimeMediaSource.cpp:
789         (WebCore::RealtimeMediaSource::settingsDidChanged):
790         (WebCore::RealtimeMediaSource::statesDidChanged): Deleted.
791         * platform/mediastream/RealtimeMediaSource.h:
792
793         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
794         (WebCore::RealtimeMediaSourceCapabilities::facingModes): States -> Settings.
795         (WebCore::RealtimeMediaSourceCapabilities::addFacingMode): Ditto.
796         (WebCore::RealtimeMediaSourceCapabilities::sourceTypes): Deleted.
797         (WebCore::RealtimeMediaSourceCapabilities::setSourceType): Deleted.
798         (WebCore::RealtimeMediaSourceCapabilities::addSourceType): Deleted.
799
800         * platform/mediastream/RealtimeMediaSourceCenter.h: States -> Settings.
801         * platform/mediastream/RealtimeMediaSourceSettings.cpp: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.cpp.
802         (WebCore::RealtimeMediaSourceSettings::facingMode):
803         (WebCore::RealtimeMediaSourceStates::facingMode): Deleted.
804         (WebCore::RealtimeMediaSourceStates::sourceType): Deleted.
805
806         * platform/mediastream/RealtimeMediaSourceSettings.h: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.h.
807         * platform/mediastream/RealtimeMediaSourceStates.cpp: Removed.
808
809         * platform/mediastream/RealtimeMediaSourceStates.h: Removed.
810         * platform/mediastream/mac/AVAudioCaptureSource.h:
811         * platform/mediastream/mac/AVAudioCaptureSource.mm:
812         (WebCore::AVAudioCaptureSource::updateStates): Deleted.
813
814         * platform/mediastream/mac/AVCaptureDeviceManager.h:
815         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
816
817         * platform/mediastream/mac/AVMediaCaptureSource.h:
818         * platform/mediastream/mac/AVMediaCaptureSource.mm:
819         (WebCore::AVMediaCaptureSource::states): Deleted.
820
821         * platform/mediastream/mac/AVVideoCaptureSource.h:
822         * platform/mediastream/mac/AVVideoCaptureSource.mm:
823         (WebCore::AVVideoCaptureSource::updateStates): Deleted.
824
825         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
826
827         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
828
829         * platform/mock/MockRealtimeAudioSource.cpp:
830         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints):
831         (WebCore::MockRealtimeAudioSource::updateStates): Deleted.
832         * platform/mock/MockRealtimeAudioSource.h:
833
834         * platform/mock/MockRealtimeMediaSource.cpp:
835         (WebCore::MockRealtimeMediaSource::capabilities): Minor cleanup.
836         (WebCore::MockRealtimeMediaSource::settings):
837         (WebCore::MockRealtimeMediaSource::supportedConstraints):
838         (WebCore::MockRealtimeMediaSource::states): Deleted.
839         * platform/mock/MockRealtimeMediaSource.h:
840         (WebCore::MockRealtimeMediaSource::constraints):
841         (WebCore::MockRealtimeMediaSource::currentStates): Deleted.
842
843         * platform/mock/MockRealtimeVideoSource.cpp:
844         (WebCore::MockRealtimeVideoSource::updateSettings):
845         (WebCore::MockRealtimeVideoSource::initializeCapabilities):
846         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints):
847         (WebCore::MockRealtimeVideoSource::setFrameRate): states -> settings.
848         (WebCore::MockRealtimeVideoSource::setSize): Ditto.
849         (WebCore::MockRealtimeVideoSource::drawAnimation): Ditto.
850         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
851         (WebCore::MockRealtimeVideoSource::updateStates): Deleted.
852         (WebCore::MockRealtimeVideoSource::setFacingMode): Deleted.
853         * platform/mock/MockRealtimeVideoSource.h:
854
855 2015-11-30  David Hyatt  <hyatt@apple.com>
856
857         Implement the picture element.
858         https://bugs.webkit.org/show_bug.cgi?id=116963
859
860         Reviewed by Dean Jackson.
861
862         Added fast/picture tests.
863
864         * WebCore.xcodeproj/project.pbxproj:
865         Add HTMLPictureElement.* to the project.
866
867         * html/HTMLImageElement.cpp:
868         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
869         Remove the CURRENT_SRC ifdef.
870
871         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
872         New helper function that checks the <source> elements of a <picture> parent
873         for the best match.
874
875         (WebCore::HTMLImageElement::selectImageSource):
876         Pull out the process of image selection into its own function so that this can
877         be called from many places (to ensure that dynamic changes are reflected as elements
878         get changed, added or removed).
879
880         (WebCore::HTMLImageElement::parseAttribute):
881         Call selectImageSource when attributes change.
882
883         (WebCore::HTMLImageElement::insertedInto):
884         If inserted into a picture element, make sure to update the source.
885
886         * html/HTMLImageElement.h:
887         (WebCore::HTMLImageElement::currentSrc):
888         Remove the CURRENT_SRC ifdef.
889
890         * html/HTMLImageElement.idl:
891         Remove the CURRENT_SRC ifdef.
892
893         * html/HTMLPictureElement.cpp: Added.
894         (WebCore::HTMLPictureElement::HTMLPictureElement):
895         (WebCore::HTMLPictureElement::create):
896         (WebCore::HTMLPictureElement::sourcesChanged):
897         * html/HTMLPictureElement.h: Added.
898         The new picture element. Has a sourcesChanged() function that is invoked whenever anything
899         about the <source> elements changes.
900
901         * html/HTMLSourceElement.cpp:
902         (WebCore::HTMLSourceElement::insertedInto):
903         (WebCore::HTMLSourceElement::removedFrom):
904         (WebCore::HTMLSourceElement::parseAttribute):
905         Make sure to call sourcesChanged when new sources come and go or when attributes on
906         source elements change.
907
908         * html/HTMLSourceElement.h:
909         Added parseAttribute function so we can see when attributes change that force us to
910         do a dynamic update.
911
912         * html/HTMLTagNames.in:
913         Add the picture element.
914
915         * html/parser/HTMLSrcsetParser.h:
916         (WebCore::ImageCandidate::srcOrigin):
917         (WebCore::ImageCandidate::isEmpty):
918         Some helpers for picture parsing.
919
920 2015-12-02  Per Arne Vollan  <peavo@outlook.com>
921
922         [WinCairo][MediaFoundation] Video is not rendered correctly on some graphics cards.
923         https://bugs.webkit.org/show_bug.cgi?id=151757
924
925         Reviewed by Alex Christensen.
926
927         We need to make sure we use the same bitmap format as in the Direct3D surface
928         in video memory when copying surface data and rendering with Cairo.
929
930         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
931         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
932         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
933
934 2015-12-02  Brady Eidson  <beidson@apple.com>
935
936         Modern IDB: Get rid of IDBExceptionCode.
937         https://bugs.webkit.org/show_bug.cgi?id=151753
938
939         Reviewed by Alex Christensen.
940
941         No new tests (No change in behavior).
942
943         * Modules/indexeddb/client/IDBIndexImpl.cpp:
944         (WebCore::IDBClient::IDBIndex::count):
945         (WebCore::IDBClient::IDBIndex::doCount):
946         (WebCore::IDBClient::IDBIndex::get):
947         (WebCore::IDBClient::IDBIndex::doGet):
948         (WebCore::IDBClient::IDBIndex::getKey):
949         (WebCore::IDBClient::IDBIndex::doGetKey):
950         
951         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
952         (WebCore::IDBClient::IDBObjectStore::get):
953         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
954         (WebCore::IDBClient::IDBObjectStore::clear):
955         (WebCore::IDBClient::IDBObjectStore::createIndex):
956         (WebCore::IDBClient::IDBObjectStore::index):
957         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
958         (WebCore::IDBClient::IDBObjectStore::count):
959         (WebCore::IDBClient::IDBObjectStore::doCount):
960         
961         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
962         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort):
963         
964         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
965         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):
966         
967         * Modules/indexeddb/server/IndexValueStore.cpp:
968         (WebCore::IDBServer::IndexValueStore::addRecord):
969         
970         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
971         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
972         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
973         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
974         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
975         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
976         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
977         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
978         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
979         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
980         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
981         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
982         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
983         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
984         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
985         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
986         
987         * Modules/indexeddb/server/MemoryIndex.cpp:
988         (WebCore::IDBServer::MemoryIndex::putIndexKey):
989         
990         * Modules/indexeddb/server/MemoryObjectStore.cpp:
991         (WebCore::IDBServer::MemoryObjectStore::createIndex):
992         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
993         
994         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
995         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
996         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
997         
998         * Modules/indexeddb/shared/IDBError.cpp:
999         (WebCore::IDBError::IDBError):
1000         (WebCore::IDBError::name):
1001         (WebCore::IDBError::message):
1002         (WebCore::idbErrorName): Deleted.
1003         (WebCore::idbErrorDescription): Deleted.
1004         
1005         * Modules/indexeddb/shared/IDBError.h:
1006         (WebCore::IDBError::code):
1007         (WebCore::IDBError::isNull):
1008
1009 2015-12-02  Jiewen Tan  <jiewen_tan@apple.com>
1010
1011         Null dereference loading Blink layout test fast/loader/unload-mutation-crash.html
1012         https://bugs.webkit.org/show_bug.cgi?id=149305
1013         <rdar://problem/22747892>
1014
1015         Reviewed by Brent Fulgham.
1016
1017         Add an extra guard to replaceDocument() against rude JS in unload event handlers.
1018
1019         Test: fast/loader/unload-mutation-crash.html
1020
1021         * loader/DocumentWriter.cpp:
1022         (WebCore::DocumentWriter::replaceDocument):
1023         (WebCore::DocumentWriter::begin):
1024
1025 2015-12-02  Per Arne Vollan  <peavo@outlook.com>
1026
1027         [WinCairo] Compile error.
1028         https://bugs.webkit.org/show_bug.cgi?id=151742
1029
1030         Reviewed by Csaba Osztrogon√°c.
1031
1032         System font flag has moved from Font class to FontData class.
1033
1034         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
1035         (WebCore::Font::platformInit):
1036
1037 2015-12-01  Commit Queue  <commit-queue@webkit.org>
1038
1039         Unreviewed, rolling out r192894 and r192904.
1040         https://bugs.webkit.org/show_bug.cgi?id=151738
1041
1042         Crashes sometimes on Windows (Requested by litherum on
1043         #webkit).
1044
1045         Reverted changesets:
1046
1047         "[Win] Web fonts with small caps have excess whitespace with
1048         the complex text codepath"
1049         https://bugs.webkit.org/show_bug.cgi?id=151698
1050         http://trac.webkit.org/changeset/192894
1051
1052         "Test gardening after r192894"
1053         http://trac.webkit.org/changeset/192904
1054
1055 2015-12-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1056
1057         [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
1058         https://bugs.webkit.org/show_bug.cgi?id=150792
1059
1060         Reviewed by Saam Barati.
1061
1062         * Configurations/FeatureDefines.xcconfig:
1063
1064 2015-12-01  Commit Queue  <commit-queue@webkit.org>
1065
1066         Unreviewed, rolling out r192914.
1067         https://bugs.webkit.org/show_bug.cgi?id=151734
1068
1069         JSC tests for this change are failing on 32 and 64-bit bots
1070         (Requested by ryanhaddad on #webkit).
1071
1072         Reverted changeset:
1073
1074         "[ES6] Implement LLInt/Baseline Support for ES6 Generators and
1075         enable this feature"
1076         https://bugs.webkit.org/show_bug.cgi?id=150792
1077         http://trac.webkit.org/changeset/192914
1078
1079 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
1080
1081         [SVG -> OTF Converter] Force UnitsPerEm to 1000
1082         https://bugs.webkit.org/show_bug.cgi?id=151650
1083
1084         Reviewed by Antti Koivisto.
1085
1086         According to the Adobe Type 1 Font Format:
1087
1088         "Type 1 font programs generally use a 1000 to 1 scaling matrix
1089         for the definition of the relationship of character space unites
1090         to user space units."
1091
1092         Windows actually disregards the "unitsPerEm" value in the "head"
1093         table for some calculations, and hardcodes 1000 instead. In order
1094         to have consistent renderings on Windows and OS X, this patch
1095         forces all generated fonts to have a unitsPerEm of 1000, and
1096         appropriately scales all necessary values.
1097
1098         Test: svg/W3C-SVG-1.1/fonts-elem-03-b.svg
1099
1100         * svg/SVGToOTFFontConversion.cpp:
1101         (WebCore::SVGToOTFFontConverter::scaleUnitsPerEm):
1102         (WebCore::SVGToOTFFontConverter::appendHEADTable):
1103         (WebCore::SVGToOTFFontConverter::appendOS2Table):
1104         (WebCore::SVGToOTFFontConverter::appendVORGTable):
1105         (WebCore::SVGToOTFFontConverter::appendVHEATable):
1106         (WebCore::SVGToOTFFontConverter::appendVMTXTable):
1107         (WebCore::SVGToOTFFontConverter::addKerningPair):
1108         (WebCore::CFFBuilder::CFFBuilder):
1109         (WebCore::CFFBuilder::boundingBox):
1110         (WebCore::CFFBuilder::updateBoundingBox):
1111         (WebCore::CFFBuilder::unscaledLineTo):
1112         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
1113         (WebCore::SVGToOTFFontConverter::processGlyphElement):
1114         (WebCore::SVGToOTFFontConverter::appendLigatureGlyphs):
1115         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1116
1117 2015-12-01  Brady Eidson  <beidson@apple.com>
1118
1119         Give a more detailed message for TypeErrors that result from EnforceRange.
1120         https://bugs.webkit.org/show_bug.cgi?id=151725
1121
1122         Reviewed by Tim Horton.
1123
1124         No new tests (Covered by changes to existing tests).
1125
1126         * bindings/js/JSDOMBinding.cpp:
1127         (WebCore::rangeErrorString):
1128         (WebCore::enforceRange):
1129
1130 2015-12-01  Jer Noble  <jer.noble@apple.com>
1131
1132         [iOS] Abrupt transition between Fullscreen -> PiP
1133         https://bugs.webkit.org/show_bug.cgi?id=151719
1134
1135         Reviewed by Eric Carlson.
1136
1137         Rather than abruptly hiding the fullscreen window, explicitly exit fullscreen mode upon entering PiP.
1138
1139         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1140         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):
1141
1142 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
1143
1144         Give String and AtomicString an existingHash() function
1145         https://bugs.webkit.org/show_bug.cgi?id=151717
1146
1147         Reviewed by Andreas Kling.
1148
1149         No new tests because there is no behavior change.
1150
1151         * platform/graphics/Font.cpp:
1152         (WebCore::CharacterFallbackMapKeyHash::hash):
1153
1154 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
1155
1156         [Win] Build fix after r192895
1157
1158         Unreviewed.
1159
1160         * platform/graphics/FontPlatformData.h:
1161         (WebCore::FontPlatformData::isSystemFont):
1162         (WebCore::FontPlatformData::setIsSystemFont):
1163         * platform/graphics/win/SimpleFontDataCGWin.cpp:
1164         (WebCore::Font::platformInit):
1165         (WebCore::Font::platformWidthForGlyph):
1166
1167 2015-12-01  Alexey Proskuryakov  <ap@apple.com>
1168
1169         Update bindings test results after r192903.
1170
1171         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1172         (WebCore::JSTestEventConstructorConstructor::construct):
1173
1174 2015-12-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1175
1176         [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
1177         https://bugs.webkit.org/show_bug.cgi?id=150792
1178
1179         Reviewed by Saam Barati.
1180
1181         * Configurations/FeatureDefines.xcconfig:
1182
1183 2015-12-01  Brady Eidson  <beidson@apple.com>
1184
1185         Add "RaisesExceptionWithMessage" IDL attribute.
1186         https://bugs.webkit.org/show_bug.cgi?id=151720
1187
1188         Reviewed by Alex Christensen.
1189
1190         No new tests (Covered by changes to existing bindings tests).
1191
1192         * bindings/scripts/CodeGeneratorJS.pm:
1193         (GenerateImplementation):
1194         (GenerateParametersCheck):
1195         (GenerateReturnParameters):
1196         (GenerateImplementationFunctionCall):
1197         (GenerateConstructorDefinition):
1198         
1199         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1200         (webkit_dom_test_obj_method_with_exception_with_message):
1201         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1202         
1203         * bindings/scripts/test/JS/JSTestObj.cpp:
1204         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
1205         
1206         * bindings/scripts/test/ObjC/DOMTestObj.h:
1207         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1208         (-[DOMTestObj methodWithExceptionWithMessage]):
1209         
1210         * bindings/scripts/test/TestObj.idl:
1211
1212 2015-12-01  Darin Adler  <darin@apple.com>
1213
1214         Fix anomaly where isMouseEvent returns false for wheel events
1215         https://bugs.webkit.org/show_bug.cgi?id=151685
1216
1217         Reviewed by Alexey Proskuryakov.
1218
1219         Back three years ago when we made WheelEvent inherit from MouseEvent,
1220         someone decided that isMouseEvent should return false for the wheel events.
1221         An audit of all the callers of isMouseEvent indicated that in almost every
1222         case, it's better to return true, so this patch does that.
1223
1224         All the other call sites that were checking isMouseEvent, here and in the
1225         higher levels of WebKit, benefit from getting true even for wheel events.
1226
1227         * bindings/objc/DOMEvents.mm:
1228         (kitClass): Use eventInterface instead of isMouseEvent to create the appropriate
1229         wrapper class.
1230
1231         * bindings/scripts/CodeGeneratorJS.pm:
1232         (GenerateConstructorDefinition): Eliminated a peculiar search and replace
1233         mistake; "stateution" instead of "execution".
1234
1235         * dom/Node.cpp:
1236         (WebCore::Node::handleLocalEvents): Add an isWheelEvent check here so that we
1237         will not ignore wheel events. This preserves behavior. A FIXME questions whether
1238         that is the behavior we want.
1239
1240         * dom/WheelEvent.cpp:
1241         (WebCore::WheelEvent::isMouseEvent): Deleted. No need to override and return false.
1242         * dom/WheelEvent.h: Ditto.
1243
1244         * html/HTMLTextAreaElement.cpp:
1245         (WebCore::HTMLTextAreaElement::defaultEventHandler): Removed unneeded checks for
1246         drag events and wheel events; both are types of mouse event, and so a single
1247         isMouseEvent check takes care of all three of these.
1248         * html/TextFieldInputType.cpp:
1249         (WebCore::TextFieldInputType::forwardEvent): Ditto.
1250
1251 2015-12-01  Alex Christensen  <achristensen@webkit.org>
1252
1253         Use Optional for matrix inverses
1254         https://bugs.webkit.org/show_bug.cgi?id=151575
1255
1256         Reviewed by Myles C. Maxfield.
1257
1258         This patch should have no change in behavior.  Some unnecessary checks are removed.
1259         There are a few places where we are no longer multiplying by the identity matrix.
1260         This should remind future coders that not all matrices are invertible.
1261
1262         * css/WebKitCSSMatrix.cpp:
1263         (WebCore::WebKitCSSMatrix::inverse):
1264         (WebCore::WebKitCSSMatrix::translate):
1265         * html/canvas/CanvasRenderingContext2D.cpp:
1266         (WebCore::CanvasRenderingContext2D::restore):
1267         (WebCore::CanvasRenderingContext2D::scale):
1268         (WebCore::CanvasRenderingContext2D::rotate):
1269         (WebCore::CanvasRenderingContext2D::translate):
1270         (WebCore::CanvasRenderingContext2D::transform):
1271         (WebCore::CanvasRenderingContext2D::setTransform):
1272         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
1273         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
1274         * platform/graphics/GraphicsContext.cpp:
1275         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
1276         * platform/graphics/ShadowBlur.cpp:
1277         (WebCore::ShadowBlur::calculateLayerBoundingRect):
1278         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1279         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
1280         * platform/graphics/cg/ImageBufferCG.cpp:
1281         (WebCore::ImageBuffer::putByteArray):
1282         * platform/graphics/filters/Filter.h:
1283         (WebCore::Filter::setFilterScale):
1284         (WebCore::Filter::absoluteTransform):
1285         (WebCore::Filter::mapAbsolutePointToLocalPoint):
1286         (WebCore::Filter::renderingMode):
1287         (WebCore::Filter::setRenderingMode):
1288         * platform/graphics/texmap/TextureMapperLayer.cpp:
1289         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
1290         (WebCore::TextureMapperLayer::replicaTransform):
1291         (WebCore::TextureMapperLayer::setAnimatedFilters):
1292         (WebCore::TextureMapperLayer::mapScrollOffset):
1293         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1294         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
1295         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
1296         * platform/graphics/transforms/AffineTransform.cpp:
1297         (WebCore::AffineTransform::yScale):
1298         (WebCore::det):
1299         (WebCore::AffineTransform::isInvertible):
1300         (WebCore::AffineTransform::inverse):
1301         (WebCore::AffineTransform::det): Deleted.
1302         * platform/graphics/transforms/AffineTransform.h:
1303         * platform/graphics/transforms/TransformState.cpp:
1304         (WebCore::TransformState::mappedPoint):
1305         (WebCore::TransformState::mappedQuad):
1306         (WebCore::TransformState::mapQuad):
1307         (WebCore::TransformState::flattenWithTransform):
1308         * platform/graphics/transforms/TransformationMatrix.cpp:
1309         (WebCore::TransformationMatrix::isInvertible):
1310         (WebCore::TransformationMatrix::inverse):
1311         * platform/graphics/transforms/TransformationMatrix.h:
1312         * rendering/HitTestingTransformState.cpp:
1313         (WebCore::HitTestingTransformState::flattenWithTransform):
1314         (WebCore::HitTestingTransformState::mappedPoint):
1315         (WebCore::HitTestingTransformState::mappedQuad):
1316         (WebCore::HitTestingTransformState::mappedArea):
1317         (WebCore::HitTestingTransformState::boundsOfMappedArea):
1318         * rendering/PaintInfo.h:
1319         (WebCore::PaintInfo::applyTransform):
1320         * rendering/RenderLayer.cpp:
1321         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1322         (WebCore::RenderLayer::hitTestLayer):
1323         * rendering/svg/RenderSVGContainer.cpp:
1324         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
1325         * rendering/svg/RenderSVGForeignObject.cpp:
1326         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
1327         * rendering/svg/RenderSVGImage.cpp:
1328         (WebCore::RenderSVGImage::nodeAtFloatPoint):
1329         * rendering/svg/RenderSVGResourceClipper.cpp:
1330         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
1331         * rendering/svg/RenderSVGResourceFilter.cpp:
1332         (WebCore::RenderSVGResourceFilter::postApplyResource):
1333         * rendering/svg/RenderSVGRoot.cpp:
1334         (WebCore::RenderSVGRoot::nodeAtPoint):
1335         * rendering/svg/RenderSVGShape.cpp:
1336         (WebCore::RenderSVGShape::setupNonScalingStrokeContext):
1337         (WebCore::RenderSVGShape::nodeAtFloatPoint):
1338         (WebCore::RenderSVGShape::calculateStrokeBoundingBox):
1339         * rendering/svg/RenderSVGText.cpp:
1340         (WebCore::RenderSVGText::nodeAtFloatPoint):
1341         * rendering/svg/SVGRenderSupport.cpp:
1342         (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows):
1343         * rendering/svg/SVGRenderingContext.cpp:
1344         (WebCore::SVGRenderingContext::clipToImageBuffer):
1345         * svg/SVGLocatable.cpp:
1346         (WebCore::SVGLocatable::getTransformToElement):
1347         * svg/SVGMatrix.h:
1348         (WebCore::SVGMatrix::inverse):
1349         (WebCore::SVGMatrix::rotateFromVector):
1350
1351 2015-12-01  Tim Horton  <timothy_horton@apple.com>
1352
1353         Remove swipe snapshot before main document load if scroll position is already restored
1354         https://bugs.webkit.org/show_bug.cgi?id=151224
1355
1356         Reviewed by Darin Adler.
1357
1358         * loader/FrameLoaderClient.h:
1359         * loader/HistoryController.cpp:
1360         (WebCore::HistoryController::restoreScrollPositionAndViewState):
1361         Each time we try to restore the scroll position, see if the requested
1362         scroll position is something we can scroll to by going through ScrollView's
1363         scroll position constraint logic. If we can scroll there, tell our client
1364         (and eventually ViewGestureController) that we successfully restored the
1365         scroll position!
1366
1367 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
1368
1369         [iOS] Adjacent emoji overlap each other
1370         https://bugs.webkit.org/show_bug.cgi?id=151690
1371         <rdar://problem/23430453>
1372
1373         Reviewed by Simon Fraser.
1374
1375         This is a partial revert of r188737. It turns out that only CoreText gives correct
1376         glyph advances for emoji. In r188737, I reverted the special iOS emoji processing,
1377         but also removed the logic of using CoreText for emoji advances. This patch adds
1378         the m_isEmoji boolean back, so we can tell if we need to force
1379         platformWidthForGlyph() to use CoreText.
1380
1381         This patch also performs a little bit of cleanup by moving Font's m_isSystemFont
1382         to FontPlatformData where it belongs.
1383
1384         Test: fast/text/emoji-overlap.html
1385
1386         * platform/graphics/Font.cpp:
1387         (WebCore::fillGlyphPage): Removed unnecessary argument.
1388         (WebCore::Font::Font): Deleted.
1389         * platform/graphics/Font.h: Moved getters and booleans to FontPlatformData.
1390         (WebCore::Font::hasCustomTracking): Deleted.
1391         (WebCore::Font::isSystemFont): Deleted.
1392         * platform/graphics/FontPlatformData.cpp:
1393         (WebCore::FontPlatformData::FontPlatformData): Initialize new booleans.
1394         (WebCore::FontPlatformData::operator=): Ditto.
1395         * platform/graphics/FontPlatformData.h: Getters for new booleans.
1396         (WebCore::FontPlatformData::isSystemFont):
1397         (WebCore::FontPlatformData::hasCustomTracking):
1398         (WebCore::FontPlatformData::isEmoji):
1399         * platform/graphics/GlyphPage.h: Remove unnecessary argument.
1400         * platform/graphics/cocoa/FontCocoa.mm:
1401         (WebCore::advanceForColorBitmapFont): Return an Optional instead of using an out
1402         argument.
1403         (WebCore::canUseFastGlyphAdvanceGetter): Make sure that we use CoreText if we are
1404         using the Emoji font.
1405         (WebCore::Font::platformWidthForGlyph):
1406         (WebCore::Font::platformInit): Deleted.
1407         * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Deal with the new booleans.
1408         (WebCore::FontPlatformData::FontPlatformData):
1409         (WebCore::FontPlatformData::platformDataInit):
1410         (WebCore::FontPlatformData::platformDataAssign):
1411         (WebCore::FontPlatformData::setFont):
1412         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
1413         (WebCore::GlyphPage::fill): Removed unnecessary argument.
1414         * platform/graphics/mac/GlyphPageMac.cpp:
1415         (WebCore::shouldUseCoreText): Use a reference instead of a pointer.
1416         (WebCore::GlyphPage::fill): Removed unnecessary argument.
1417         * platform/graphics/win/FontCGWin.cpp:
1418         (WebCore::FontCascade::drawGlyphs): Update for new location of booleans.
1419         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
1420         (WebCore::GlyphPage::fill): Removed unnecessary argument.
1421         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
1422         (WebCore::GlyphPage::fill): Removed unnecessary argument.
1423         * platform/graphics/win/UniscribeController.cpp:
1424         (WebCore::UniscribeController::shapeAndPlaceItem): Update for new location of
1425         booleans.
1426
1427 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
1428
1429         [Win] Web fonts with small caps have excess whitespace with the complex text codepath
1430         https://bugs.webkit.org/show_bug.cgi?id=151698
1431
1432         Reviewed by Darin Adler.
1433
1434         When performing small-caps on OS X, we bake in the smaller font size into the platform's native font
1435         object. On Windows, we currently don't do that; instead, we just change some ancillary data inside
1436         the FontPlatformData, and our advance & drawing calculations are sensitive to this ancillary data.
1437         However, in the complex text codepath, Uniscribe only takes the native font object as input, and
1438         therefore operates with the wrong font size.
1439
1440         The solution is to bake the smaller font size into the native platform font on Windows, similar to
1441         OS X. It isn't clear why we didn't do this previously, but it seems like we weren't sure that
1442         Windows would select the correct font when we provide new selection criteria. However, for web fonts,
1443         we already use the same mechanism (CreateFontIndirect()) when we create the font in the first place;
1444         therefore, this scaled font request will always work as well.
1445
1446         Test: fast/text/small-caps-complex.html
1447
1448         * platform/graphics/win/SimpleFontDataWin.cpp:
1449         (WebCore::Font::platformCreateScaledFont): Deleted.
1450
1451 2015-12-01  Brady Eidson  <beidson@apple.com>
1452
1453         Modern IDB: storage/indexeddb/create-and-remove-object-store.html fails.
1454         https://bugs.webkit.org/show_bug.cgi?id=151704
1455
1456         Reviewed by Alex Christensen.
1457
1458         No new tests (At least one previously failing test now passes).
1459
1460         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1461         (WebCore::IDBClient::IDBDatabase::deleteObjectStore):
1462
1463 2015-12-01  Brady Eidson  <beidson@apple.com>
1464
1465         Modern IDB: storage/indexeddb/basics.html fails.
1466         https://bugs.webkit.org/show_bug.cgi?id=151694
1467
1468         Reviewed by Alex Christensen.
1469
1470         No new tests (At least one failing test now passes, and covered by changes to 3 previously incorrect tests).
1471
1472         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1473         (WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionWillFinish): Set the flag determining whether
1474           or not the request's transaction should be exposed to the DOM.
1475         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
1476         
1477         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1478         (WebCore::IDBClient::IDBRequest::result): Throw an exception if the request is not done.
1479         (WebCore::IDBClient::IDBRequest::error): Ditto.
1480         (WebCore::IDBClient::IDBRequest::transaction): Only return the transaction to the DOM if the flag says so.
1481         * Modules/indexeddb/client/IDBRequestImpl.h:
1482         
1483         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1484         (WebCore::IDBClient::IDBTransaction::abort):
1485         (WebCore::IDBClient::IDBTransaction::commit):
1486
1487 2015-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1488
1489         [GTK] ASSERTION FAILED: m_table running /webkit2/BackForwardList/navigation in Debug build
1490         https://bugs.webkit.org/show_bug.cgi?id=151700
1491
1492         Reviewed by Martin Robinson.
1493
1494         This happens when the frame notifies its observers that the page
1495         will be detached. The m_table that asserts is the
1496         FrameDestructionObserver HashSet. It happens when clearing the
1497         GObject DOM cache wrappers during frame destruction, and there's a
1498         Document object wrapped whose last reference is held by the DOM
1499         wrapper. In that case, the Document object is destroyed while the
1500         frame is being destroyed. Deleting the wrapper objects after the
1501         frame destruction fixes the crash.
1502
1503         * bindings/gobject/DOMObjectCache.cpp:
1504
1505 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1506
1507         [Streams API] pull function of tee should call readFromReadableStreamReader directly
1508         https://bugs.webkit.org/show_bug.cgi?id=151497
1509
1510         Reviewed by Darin Adler.
1511
1512         Covered by added test.
1513
1514         * Modules/streams/ReadableStreamInternals.js:
1515         (teeReadableStreamPullFunction): directly calling readFromReadableStreamReader.
1516
1517 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1518
1519         [Streams API] Clean-up JS built-in code using arrow functions
1520         https://bugs.webkit.org/show_bug.cgi?id=151489
1521
1522         Reviewed by Darin Adler.
1523
1524         Using arrow functions to remove need for _this.
1525         Made errorWritableStream take two parameters to simplify code and align it with the spec.
1526
1527         No change in behavior.
1528
1529         * Modules/streams/ReadableStream.js:
1530         (initializeReadableStream):
1531         * Modules/streams/WritableStream.js:
1532         (initializeWritableStream):
1533         (abort):
1534         (write):
1535         * Modules/streams/WritableStreamInternals.js:
1536         (errorWritableStream):
1537         (writableStreamAdvanceQueue):
1538         (closeWritableStream):
1539
1540 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1541
1542         [Streams API] teeReadableStream should not directly use stream.getReader()
1543         https://bugs.webkit.org/show_bug.cgi?id=151487
1544
1545         Reviewed by Darin Adler.
1546
1547         Covered by added test.
1548
1549         * Modules/streams/ReadableStreamInternals.js:
1550         (teeReadableStream): Create a @ReadableStreamReader instead of calling getReader() which may be disrupted by user scripts.
1551
1552 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1553
1554         [Streams API] streams should not directly use Number and related methods
1555         https://bugs.webkit.org/show_bug.cgi?id=151499
1556
1557         Reviewed by Darin Adler.
1558
1559         Covered by updated test.
1560
1561         Using @Number, @isFinite and @isNaN in place of Number, Number.isFinite and Number.isNaN.
1562
1563         * Modules/streams/ReadableStreamInternals.js:
1564         (enqueueInReadableStream):
1565         * Modules/streams/StreamInternals.js:
1566         (validateAndNormalizeQueuingStrategy):
1567         (enqueueValueWithSize):
1568
1569 2015-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1570
1571         Unreviewed. Fix GTK+ build after r192849.
1572
1573         * bindings/scripts/CodeGeneratorGObject.pm:
1574         (GenerateFunction):
1575         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
1576         (webkit_dom_test_interface_supplemental_method1):
1577         (webkit_dom_test_interface_supplemental_method2):
1578         (webkit_dom_test_interface_set_supplemental_str2):
1579         (webkit_dom_test_interface_get_supplemental_node):
1580         (webkit_dom_test_interface_set_supplemental_node):
1581
1582 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1583
1584         [Streams API] Remove use of @catch for exposed promises
1585         https://bugs.webkit.org/show_bug.cgi?id=151625
1586
1587         Reviewed by Darin Adler.
1588
1589         Promise @catch is calling "then" which may be controlled by user scripts.
1590         This patch simply replaces @catch by calling @then directly.
1591
1592         Covered by modified tests.
1593
1594         * Modules/streams/ReadableStream.js:
1595         (pipeTo):
1596         * Modules/streams/ReadableStreamInternals.js:
1597         (teeReadableStream):
1598
1599 2015-11-30  Jaehun Lim  <ljaehun.lim@samsung.com>
1600
1601         Unreviewed, fix build after r192848 and r192849
1602
1603         - Rename canSuspendForPageCache to canSuspendForDocumentSuspension
1604         - Use references instead of pointers
1605
1606         * Modules/battery/BatteryManager.cpp:
1607         (WebCore::BatteryManager::canSuspendForDocumentSuspension):
1608         (WebCore::BatteryManager::canSuspendForPageCache): Deleted.
1609         * Modules/battery/BatteryManager.h:
1610         * Modules/battery/NavigatorBattery.cpp:
1611         (WebCore::NavigatorBattery::webkitBattery):
1612         * Modules/battery/NavigatorBattery.h:
1613         * Modules/gamepad/deprecated/NavigatorGamepad.cpp:
1614         (WebCore::NavigatorGamepad::webkitGetGamepads):
1615         * Modules/gamepad/deprecated/NavigatorGamepad.h:
1616         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
1617         (WebCore::NavigatorContentUtils::registerProtocolHandler):
1618         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
1619         (WebCore::NavigatorContentUtils::unregisterProtocolHandler):
1620         * Modules/navigatorcontentutils/NavigatorContentUtils.h:
1621         * Modules/vibration/NavigatorVibration.cpp:
1622         (WebCore::NavigatorVibration::vibrate):
1623         * Modules/vibration/NavigatorVibration.h:
1624
1625 2015-11-30  Jiewen Tan  <jiewen_tan@apple.com>
1626
1627         Amazon.com Additional Information links aren't clickable
1628         https://bugs.webkit.org/show_bug.cgi?id=151401
1629         <rdar://problem/23454261>
1630
1631         Reviewed by Darin Adler.
1632
1633         The cause of this issue is that the painting order is different from the hittest order so we can end up
1634         with visible but unreachable content. To fix this, the executation flow of hittest has been reordered.
1635         According to the paint system, which renders the webpage from the bottom RenderLayer to the top, contents
1636         are rendered before floats. Hence, for the hittest, which determines the hitted location from top RenderLayer
1637         to the bottom, should do it reversedly. Now, hittest will first test floats then contents.
1638
1639         Test: fast/block/float/hit-test-on-overlapping-floats.html
1640
1641         * rendering/RenderBlock.cpp:
1642         (WebCore::RenderBlock::nodeAtPoint):
1643
1644 2015-11-30  Simon Fraser  <simon.fraser@apple.com>
1645
1646         Fix possible crash with animated layers in reflections
1647         https://bugs.webkit.org/show_bug.cgi?id=151689
1648         rdar://problem/23018612
1649
1650         Reviewed by Darin Adler.
1651
1652         Reflections create additional PlatformCALayers whose owner is set to the GraphicsLayerCA.
1653         Those PlatformCALayers need their owner pointer cleared out when the GraphicsLayerCA
1654         is destroyed.
1655         
1656         Tested by compositing/reflections/nested-reflection-transition.html
1657
1658         * platform/graphics/ca/GraphicsLayerCA.cpp:
1659         * platform/graphics/ca/GraphicsLayerCA.h:
1660
1661 2015-11-30  Brady Eidson  <beidson@apple.com>
1662
1663         Modern IDB: Iterating index cursors to a specific key is busted.
1664         https://bugs.webkit.org/show_bug.cgi?id=151684
1665
1666         Reviewed by Darin Adler.
1667
1668         No new tests (At least one failing test now passes).
1669
1670         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
1671         (WebCore::IDBServer::MemoryIndexCursor::iterate):
1672
1673 2015-11-30  Brady Eidson  <beidson@apple.com>
1674
1675         Modern IDB: ObjectStore cursors should not be able to iterate out of their range.
1676         https://bugs.webkit.org/show_bug.cgi?id=151683
1677
1678         Reviewed by Darin Adler.
1679
1680         No new tests (Covered by at least one failing test that now passes).
1681
1682         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1683         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
1684         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
1685
1686 2015-11-30  Anders Carlsson  <andersca@apple.com>
1687
1688         CTTE autogenerated bindings code
1689         https://bugs.webkit.org/show_bug.cgi?id=151682
1690
1691         Reviewed by Darin Adler.
1692
1693         Make sure that JS bindings pass a reference to the object when calling static member functions.
1694
1695         * Modules/gamepad/NavigatorGamepad.cpp:
1696         (WebCore::NavigatorGamepad::getGamepads):
1697         * Modules/gamepad/NavigatorGamepad.h:
1698         * Modules/geolocation/NavigatorGeolocation.cpp:
1699         (WebCore::NavigatorGeolocation::geolocation):
1700         * Modules/geolocation/NavigatorGeolocation.h:
1701         * Modules/mediasource/AudioTrackMediaSource.h:
1702         (WebCore::AudioTrackMediaSource::sourceBuffer):
1703         * Modules/mediasource/TextTrackMediaSource.h:
1704         (WebCore::TextTrackMediaSource::sourceBuffer):
1705         * Modules/mediasource/VideoTrackMediaSource.h:
1706         (WebCore::VideoTrackMediaSource::sourceBuffer):
1707         * Modules/mediastream/HTMLMediaElementMediaStream.cpp:
1708         (WebCore::HTMLMediaElementMediaStream::srcObject):
1709         (WebCore::HTMLMediaElementMediaStream::setSrcObject):
1710         * Modules/mediastream/HTMLMediaElementMediaStream.h:
1711         * Modules/mediastream/NavigatorMediaDevices.cpp:
1712         (WebCore::NavigatorMediaDevices::mediaDevices):
1713         * Modules/mediastream/NavigatorMediaDevices.h:
1714         * Modules/notifications/DOMWindowNotifications.cpp:
1715         (WebCore::DOMWindowNotifications::webkitNotifications):
1716         * Modules/notifications/DOMWindowNotifications.h:
1717         * Modules/notifications/Notification.cpp:
1718         (WebCore::Notification::Notification):
1719         * Modules/notifications/WorkerGlobalScopeNotifications.cpp:
1720         (WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
1721         * Modules/notifications/WorkerGlobalScopeNotifications.h:
1722         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
1723         (WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
1724         * Modules/speech/DOMWindowSpeechSynthesis.h:
1725         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
1726         (WebCore::DOMWindowWebDatabase::openDatabase):
1727         * Modules/webdatabase/DOMWindowWebDatabase.h:
1728         * bindings/scripts/CodeGeneratorJS.pm:
1729         (GenerateImplementation):
1730         (GenerateParametersCheck):
1731         * testing/Internals.cpp:
1732         (WebCore::Internals::enableMockSpeechSynthesizer):
1733
1734 2015-11-30  Katlyn Graff  <kgraff@apple.com>
1735
1736         Rename ActiveDOMObject/DOMWindow PageCacheSuspension code to support more reasons for suspension
1737         https://bugs.webkit.org/show_bug.cgi?id=151677
1738
1739         Reviewed by Ryosuke Niwa.
1740
1741         Simply a refactoring patch, so no new tests.
1742
1743         * Modules/encryptedmedia/MediaKeySession.cpp:
1744         (WebCore::MediaKeySession::canSuspendForDocumentSuspension):
1745         (WebCore::MediaKeySession::canSuspendForPageCache): Deleted.
1746         * Modules/encryptedmedia/MediaKeySession.h:
1747         * Modules/geolocation/Geolocation.cpp:
1748         (WebCore::Geolocation::canSuspendForDocumentSuspension):
1749         (WebCore::Geolocation::canSuspendForPageCache): Deleted.
1750         * Modules/geolocation/Geolocation.h:
1751         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1752         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension):
1753         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension):
1754         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForPageCache): Deleted.
1755         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromPageCache): Deleted.
1756         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
1757         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1758         (WebCore::IDBClient::IDBDatabase::canSuspendForDocumentSuspension):
1759         (WebCore::IDBClient::IDBDatabase::canSuspendForPageCache): Deleted.
1760         * Modules/indexeddb/client/IDBDatabaseImpl.h:
1761         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1762         (WebCore::IDBClient::IDBRequest::canSuspendForDocumentSuspension):
1763         (WebCore::IDBClient::IDBRequest::canSuspendForPageCache): Deleted.
1764         * Modules/indexeddb/client/IDBRequestImpl.h:
1765         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1766         (WebCore::IDBClient::IDBTransaction::canSuspendForDocumentSuspension):
1767         (WebCore::IDBClient::IDBTransaction::canSuspendForPageCache): Deleted.
1768         * Modules/indexeddb/client/IDBTransactionImpl.h:
1769         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
1770         (WebCore::LegacyDatabase::canSuspendForDocumentSuspension):
1771         (WebCore::LegacyDatabase::canSuspendForPageCache): Deleted.
1772         * Modules/indexeddb/legacy/LegacyDatabase.h:
1773         * Modules/indexeddb/legacy/LegacyRequest.cpp:
1774         (WebCore::LegacyRequest::canSuspendForDocumentSuspension):
1775         (WebCore::LegacyRequest::canSuspendForPageCache): Deleted.
1776         * Modules/indexeddb/legacy/LegacyRequest.h:
1777         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
1778         (WebCore::LegacyTransaction::canSuspendForDocumentSuspension):
1779         (WebCore::LegacyTransaction::canSuspendForPageCache): Deleted.
1780         * Modules/indexeddb/legacy/LegacyTransaction.h:
1781         * Modules/mediasource/MediaSource.cpp:
1782         (WebCore::MediaSource::canSuspendForDocumentSuspension):
1783         (WebCore::MediaSource::canSuspendForPageCache): Deleted.
1784         * Modules/mediasource/MediaSource.h:
1785         * Modules/mediasource/SourceBuffer.cpp:
1786         (WebCore::SourceBuffer::canSuspendForDocumentSuspension):
1787         (WebCore::SourceBuffer::canSuspendForPageCache): Deleted.
1788         * Modules/mediasource/SourceBuffer.h:
1789         * Modules/mediastream/MediaStreamTrack.cpp:
1790         (WebCore::MediaStreamTrack::canSuspendForDocumentSuspension):
1791         (WebCore::MediaStreamTrack::canSuspendForPageCache): Deleted.
1792         * Modules/mediastream/MediaStreamTrack.h:
1793         * Modules/mediastream/RTCDTMFSender.cpp:
1794         (WebCore::RTCDTMFSender::canSuspendForDocumentSuspension):
1795         (WebCore::RTCDTMFSender::canSuspendForPageCache): Deleted.
1796         * Modules/mediastream/RTCDTMFSender.h:
1797         * Modules/mediastream/RTCPeerConnection.cpp:
1798         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension):
1799         (WebCore::RTCPeerConnection::canSuspendForPageCache): Deleted.
1800         * Modules/mediastream/RTCPeerConnection.h:
1801         * Modules/notifications/DOMWindowNotifications.cpp:
1802         (WebCore::DOMWindowNotifications::disconnectFrameForDocumentSuspension):
1803         (WebCore::DOMWindowNotifications::reconnectFrameFromDocumentSuspension):
1804         (WebCore::DOMWindowNotifications::disconnectFrameForPageCache): Deleted.
1805         (WebCore::DOMWindowNotifications::reconnectFrameFromPageCache): Deleted.
1806         * Modules/notifications/DOMWindowNotifications.h:
1807         * Modules/notifications/Notification.cpp:
1808         (WebCore::Notification::canSuspendForDocumentSuspension):
1809         (WebCore::Notification::canSuspendForPageCache): Deleted.
1810         * Modules/notifications/Notification.h:
1811         * Modules/notifications/NotificationCenter.cpp:
1812         (WebCore::NotificationCenter::canSuspendForDocumentSuspension):
1813         (WebCore::NotificationCenter::canSuspendForPageCache): Deleted.
1814         * Modules/notifications/NotificationCenter.h:
1815         * Modules/webaudio/AudioContext.cpp:
1816         (WebCore::AudioContext::canSuspendForDocumentSuspension):
1817         (WebCore::AudioContext::canSuspendForPageCache): Deleted.
1818         * Modules/webaudio/AudioContext.h:
1819         * Modules/webdatabase/DatabaseContext.cpp:
1820         (WebCore::DatabaseContext::canSuspendForDocumentSuspension):
1821         (WebCore::DatabaseContext::canSuspendForPageCache): Deleted.
1822         * Modules/webdatabase/DatabaseContext.h:
1823         * Modules/websockets/WebSocket.cpp:
1824         (WebCore::WebSocket::canSuspendForDocumentSuspension):
1825         (WebCore::WebSocket::canSuspendForPageCache): Deleted.
1826         * Modules/websockets/WebSocket.h:
1827         * css/FontLoader.cpp:
1828         (WebCore::FontLoader::canSuspendForDocumentSuspension):
1829         (WebCore::FontLoader::canSuspendForPageCache): Deleted.
1830         * css/FontLoader.h:
1831         * dom/ActiveDOMObject.cpp:
1832         (WebCore::ActiveDOMObject::canSuspendForDocumentSuspension):
1833         (WebCore::ActiveDOMObject::canSuspendForPageCache): Deleted.
1834         * dom/ActiveDOMObject.h:
1835         * dom/Document.cpp:
1836         (WebCore::Document::~Document):
1837         * dom/ScriptExecutionContext.cpp:
1838         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForTabSuspension):
1839         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache): Deleted.
1840         * dom/ScriptExecutionContext.h:
1841         * fileapi/FileReader.cpp:
1842         (WebCore::FileReader::canSuspendForDocumentSuspension):
1843         (WebCore::FileReader::canSuspendForPageCache): Deleted.
1844         * fileapi/FileReader.h:
1845         * history/CachedFrame.cpp:
1846         (WebCore::CachedFrame::CachedFrame):
1847         * history/PageCache.cpp:
1848         (WebCore::canCacheFrame):
1849         * html/HTMLMarqueeElement.cpp:
1850         (WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension):
1851         (WebCore::HTMLMarqueeElement::canSuspendForPageCache): Deleted.
1852         * html/HTMLMarqueeElement.h:
1853         * html/HTMLMediaElement.cpp:
1854         (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension):
1855         (WebCore::HTMLMediaElement::canSuspendForPageCache): Deleted.
1856         * html/HTMLMediaElement.h:
1857         * html/HTMLSourceElement.cpp:
1858         (WebCore::HTMLSourceElement::canSuspendForDocumentSuspension):
1859         (WebCore::HTMLSourceElement::canSuspendForPageCache): Deleted.
1860         * html/HTMLSourceElement.h:
1861         * html/PublicURLManager.cpp:
1862         (WebCore::PublicURLManager::canSuspendForDocumentSuspension):
1863         (WebCore::PublicURLManager::canSuspendForPageCache): Deleted.
1864         * html/PublicURLManager.h:
1865         * html/canvas/WebGLRenderingContextBase.cpp:
1866         (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension):
1867         (WebCore::WebGLRenderingContextBase::canSuspendForPageCache): Deleted.
1868         * html/canvas/WebGLRenderingContextBase.h:
1869         * loader/FrameLoader.cpp:
1870         (WebCore::FrameLoader::clear):
1871         (WebCore::FrameLoader::open):
1872         * loader/appcache/DOMApplicationCache.cpp:
1873         (WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension):
1874         (WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension):
1875         (WebCore::DOMApplicationCache::disconnectFrameForPageCache): Deleted.
1876         (WebCore::DOMApplicationCache::reconnectFrameFromPageCache): Deleted.
1877         * loader/appcache/DOMApplicationCache.h:
1878         * page/DOMWindow.cpp:
1879         (WebCore::DOMWindow::DOMWindow):
1880         (WebCore::DOMWindow::~DOMWindow):
1881         (WebCore::DOMWindow::resetUnlessSuspendedForDocumentSuspension):
1882         (WebCore::DOMWindow::suspendForDocumentSuspension):
1883         (WebCore::DOMWindow::resumeFromDocumentSuspension):
1884         (WebCore::DOMWindow::disconnectDOMWindowProperties):
1885         (WebCore::DOMWindow::reconnectDOMWindowProperties):
1886         (WebCore::DOMWindow::resetUnlessSuspendedForPageCache): Deleted.
1887         (WebCore::DOMWindow::suspendForPageCache): Deleted.
1888         (WebCore::DOMWindow::resumeFromPageCache): Deleted.
1889         * page/DOMWindow.h:
1890         * page/DOMWindowExtension.cpp:
1891         (WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension):
1892         (WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension):
1893         (WebCore::DOMWindowExtension::disconnectFrameForPageCache): Deleted.
1894         (WebCore::DOMWindowExtension::reconnectFrameFromPageCache): Deleted.
1895         * page/DOMWindowExtension.h:
1896         * page/DOMWindowProperty.cpp:
1897         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
1898         (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
1899         (WebCore::DOMWindowProperty::disconnectFrameForPageCache): Deleted.
1900         (WebCore::DOMWindowProperty::reconnectFrameFromPageCache): Deleted.
1901         * page/DOMWindowProperty.h:
1902         * page/EventSource.cpp:
1903         (WebCore::EventSource::canSuspendForDocumentSuspension):
1904         (WebCore::EventSource::canSuspendForPageCache): Deleted.
1905         * page/EventSource.h:
1906         * page/SuspendableTimer.cpp:
1907         (WebCore::SuspendableTimer::canSuspendForDocumentSuspension):
1908         (WebCore::SuspendableTimer::canSuspendForPageCache): Deleted.
1909         * page/SuspendableTimer.h:
1910         * workers/Worker.cpp:
1911         (WebCore::Worker::canSuspendForDocumentSuspension):
1912         (WebCore::Worker::canSuspendForPageCache): Deleted.
1913         * workers/Worker.h:
1914         * xml/XMLHttpRequest.cpp:
1915         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension):
1916         (WebCore::XMLHttpRequest::canSuspendForPageCache): Deleted.
1917         * xml/XMLHttpRequest.h:
1918
1919 2015-11-30  Brady Eidson  <beidson@apple.com>
1920
1921         Modern IDB: "prevunique" cursors should point at the lowest primary key that matches, not the highest.
1922         https://bugs.webkit.org/show_bug.cgi?id=151675.
1923
1924         Reviewed by Darin Adler.
1925
1926         No new tests (Covered by at least one failing test that now passes, and updates to previously incorrect tests).
1927
1928         * Modules/indexeddb/server/IndexValueEntry.cpp:
1929         (WebCore::IDBServer::IndexValueEntry::reverseBegin): If CursorDuplicity is NoDuplicates, start at the lowest
1930           entry instead of the highest.
1931         (WebCore::IDBServer::IndexValueEntry::reverseFind):
1932         * Modules/indexeddb/server/IndexValueEntry.h:
1933         
1934         * Modules/indexeddb/server/IndexValueStore.cpp:
1935         (WebCore::IDBServer::IndexValueStore::reverseFind):
1936         (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
1937         (WebCore::IDBServer::IndexValueStore::Iterator::nextIndexEntry):
1938         * Modules/indexeddb/server/IndexValueStore.h:
1939         
1940         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
1941         (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
1942         (WebCore::IDBServer::MemoryIndexCursor::iterate):
1943         
1944         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
1945         (WebCore::IDBCursorInfo::duplicity):
1946         (WebCore::IDBCursorInfo::isDirectionNoDuplicate): Deleted.
1947         * Modules/indexeddb/shared/IDBCursorInfo.h:
1948
1949 2015-11-30  Jiewen Tan  <jiewen_tan@apple.com>
1950
1951         Null dereference loading Blink layout test http/tests/misc/detach-during-notifyDone.html
1952         https://bugs.webkit.org/show_bug.cgi?id=149309
1953         <rdar://problem/22748363>
1954
1955         Reviewed by Brent Fulgham.
1956
1957         A weird order of event execution introduced by the test case will kill the webpage in a
1958         subframe of the page while executing its |frame.loader().checkLoadCompleteForThisFrame()|.
1959         Therefore, any frames comes after the failing subframe will have no page. Check it before
1960         calling to those frames' |frame.loader().checkLoadCompleteForThisFrame()|, otherwise the
1961         assertion in |frame.loader().checkLoadCompleteForThisFrame()| will fail.
1962
1963         Test: http/tests/misc/detach-during-notifyDone.html
1964
1965         * loader/FrameLoader.cpp:
1966         (WebCore::FrameLoader::checkLoadComplete):
1967
1968 2015-11-30  Commit Queue  <commit-queue@webkit.org>
1969
1970         Unreviewed, rolling out r192819.
1971         https://bugs.webkit.org/show_bug.cgi?id=151681
1972
1973         This change broke existing layout tests on Windows (Requested
1974         by ryanhaddad on #webkit).
1975
1976         Reverted changeset:
1977
1978         "Unify font-variant-* with font-variant shorthand"
1979         https://bugs.webkit.org/show_bug.cgi?id=149773
1980         http://trac.webkit.org/changeset/192819
1981
1982 2015-11-30  Darin Adler  <darin@apple.com>
1983
1984         Use Optional instead of isNull out argument for nullable getters
1985         https://bugs.webkit.org/show_bug.cgi?id=151676
1986
1987         Reviewed by Anders Carlsson.
1988
1989         No behavior change, just cleaner code.
1990
1991         * Modules/geolocation/Coordinates.cpp:
1992         (WebCore::Coordinates::altitude): Return an Optional.
1993         (WebCore::Coordinates::altitudeAccuracy): Ditto.
1994         (WebCore::Coordinates::heading): Ditto.
1995         (WebCore::Coordinates::speed): Ditto.
1996         * Modules/geolocation/Coordinates.h: Ditto.
1997
1998         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
1999         (WebCore::IDBVersionChangeEvent::create): Added. The code before was calling
2000         through to Event::create, which is clearly not what was wanted. Also removed
2001         unneeded explicit destructor.
2002         * Modules/indexeddb/IDBVersionChangeEvent.h: Changed return type of newVersion
2003         to Optional and updated for above change.
2004
2005         * Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp:
2006         (WebCore::IDBClient::IDBVersionChangeEvent::newVersion): Changed to return
2007         an Optional.
2008         * Modules/indexeddb/client/IDBVersionChangeEventImpl.h: Removed unused
2009         default argument values; the event type one, at least, was clearly incorrect.
2010         Made more things private, got rid of unneeded destructor, marked class final
2011         instead of marking all functions final.
2012
2013         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp:
2014         (WebCore::LegacyVersionChangeEvent::newVersion): Same as above.
2015         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Ditto.
2016
2017         * Modules/mediastream/MediaTrackConstraints.cpp:
2018         (WebCore::MediaTrackConstraints::optional): Removed bogus bool value. If we
2019         come back to finish later we will have to implement optional return values
2020         for arrays in the JavaScript bindings generator, which should be straightforward.
2021         * Modules/mediastream/MediaTrackConstraints.h: Ditto.
2022
2023         * bindings/js/JSDOMBinding.h:
2024         (WebCore::toNullableJSNumber): Added. This function template is used for
2025         return values that are nullable numbers.
2026
2027         * bindings/scripts/CodeGeneratorGObject.pm:
2028         (GenerateFunction): Replaced some existing bogus code to handle nullables with
2029         new equally-bogus code that should be no worse and will compile.
2030
2031         * bindings/scripts/CodeGeneratorJS.pm:
2032         (GenerateImplementation): Removed old support for nullables.
2033         (NativeToJSValue): Added new support for nullable numbers.
2034
2035         * bindings/scripts/CodeGeneratorObjC.pm:
2036         (GenerateImplementation): Removed support for nullables. We almost certainly
2037         won't need it for Objective-C bindings.
2038
2039         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Updated.
2040         * bindings/scripts/test/JS/JSTestObj.cpp: Updated.
2041         * bindings/scripts/test/ObjC/DOMTestObj.mm: Updated.
2042
2043 2015-11-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2044
2045         Split platform-independent logic in AVCaptureDeviceManager out into a new class
2046         https://bugs.webkit.org/show_bug.cgi?id=151388
2047         <rdar://problem/23593980>
2048
2049         Reviewed by Eric Carlson.
2050
2051         To prepare for creating a MockCaptureDeviceManager to be able to test
2052         MediaDevices.getUserMedia, we create a platform-independent capture device manager
2053         which all platforms should extend and add platform-specific logic to.
2054
2055         The methods CaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints and
2056         CaptureDeviceManager::captureDeviceList should be overridden by each platform
2057         CaptureDeviceManager to respectively create a RealtimeMediaSource and return a list of
2058         capture devices. createMediaSourceForCaptureDeviceWithConstraints attempts to create
2059         a media source for a given device with some constraints; if the contraints cannot be
2060         satisfied, this returns null.
2061
2062         The refactored capture device manager also introduces the notion of a platform-
2063         independent capture session which may be extended by platform device managers for
2064         determining whether a given constraint name, value and media type is valid.
2065
2066         A platform-independent CaptureDeviceInfo now represents either the video or audio
2067         component of a capture device, but not both at once. This means a capture device that
2068         supports both video and audio will emit two separate capture devices.
2069
2070         No new tests, since there should be no behavior change.
2071
2072         * Modules/mediastream/CaptureDeviceInfo.h: Added.
2073         (WebCore::CaptureSessionInfo::~CaptureSessionInfo):
2074         (WebCore::CaptureSessionInfo::supportsVideoSize):
2075         (WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions):
2076         * Modules/mediastream/CaptureDeviceManager.cpp: Added.
2077         (CaptureDeviceManager::~CaptureDeviceManager):
2078         (CaptureDeviceManager::getSourcesInfo):
2079         (CaptureDeviceManager::captureDeviceFromDeviceID):
2080         (CaptureDeviceManager::verifyConstraintsForMediaType):
2081         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
2082         (CaptureDeviceManager::sourceWithUID):
2083         (CaptureDeviceManager::bestDeviceForFacingMode):
2084         (facingModeFromString):
2085         (CaptureDeviceManager::sessionSupportsConstraint):
2086         (CaptureDeviceManager::isSupportedFrameRate):
2087         * Modules/mediastream/CaptureDeviceManager.h: Added.
2088         (WebCore::CaptureDeviceManager::refreshCaptureDeviceList):
2089         (WebCore::CaptureDeviceManager::defaultCaptureSession):
2090         * WebCore.xcodeproj/project.pbxproj:
2091         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp: Added.
2092         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint):
2093         (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName):
2094         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsConstraint):
2095         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
2096         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2097         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2098         (WebCore::AVCaptureSessionInfo::AVCaptureSessionInfo):
2099         (WebCore::AVCaptureSessionInfo::supportsVideoSize):
2100         (WebCore::AVCaptureSessionInfo::bestSessionPresetForVideoDimensions):
2101         (WebCore::AVCaptureDeviceManager::captureDeviceList):
2102         (WebCore::shouldConsiderDeviceInDeviceList):
2103         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList):
2104         (WebCore::AVCaptureDeviceManager::AVCaptureDeviceManager):
2105         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
2106         (WebCore::AVCaptureDeviceManager::sourceWithUID):
2107         (WebCore::AVCaptureDeviceManager::getSourcesInfo):
2108         (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType):
2109         (WebCore::AVCaptureDeviceManager::defaultCaptureSession):
2110         (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint):
2111         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
2112         (WebCore::AVCaptureDeviceManager::deviceDisconnected):
2113         (WebCore::AVCaptureDeviceManager::isSupportedFrameRate):
2114         (WebCore::CaptureDevice:::m_enabled): Deleted.
2115         (WebCore::captureDeviceList): Deleted.
2116         (WebCore::captureDeviceFromDeviceID): Deleted.
2117         (WebCore::refreshCaptureDeviceList): Deleted.
2118         (WebCore::AVCaptureDeviceManager::bestSessionPresetForVideoSize): Deleted.
2119         (WebCore::AVCaptureDeviceManager::deviceSupportsFacingMode): Deleted.
2120         (WebCore::AVCaptureDeviceManager::bestDeviceForFacingMode): Deleted.
2121         (WebCore::AVCaptureDeviceManager::isValidConstraint): Deleted.
2122         (WebCore::AVCaptureDeviceManager::validConstraintNames): Deleted.
2123         (WebCore::AVCaptureDeviceManager::validFacingModes): Deleted.
2124         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2125         (WebCore::AVVideoCaptureSource::applyConstraints):
2126         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2127         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
2128         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
2129
2130 2015-11-30  Brady Eidson  <beidson@apple.com>
2131
2132         Modern IDB: Set the correct source on the IDBRequest for cursor updates
2133         https://bugs.webkit.org/show_bug.cgi?id=151665
2134
2135         Reviewed by Andy Estes.
2136
2137         No new tests (At least one existing failing test now passes).
2138
2139         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2140         (WebCore::IDBClient::IDBCursor::update):
2141         
2142         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2143         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate):
2144         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
2145         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2146         
2147         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2148         (WebCore::IDBClient::IDBRequest::IDBRequest):
2149         (WebCore::IDBClient::IDBRequest::setSource):
2150         * Modules/indexeddb/client/IDBRequestImpl.h:
2151
2152 2015-11-30  Tim Horton  <timothy_horton@apple.com>
2153
2154         Get rid of the legacy TextIndicatorWindow style
2155         https://bugs.webkit.org/show_bug.cgi?id=151674
2156
2157         Reviewed by Anders Carlsson.
2158
2159         * page/TextIndicator.h:
2160         * page/mac/TextIndicatorWindow.mm:
2161         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Deleted.
2162
2163 2015-11-30  Brady Eidson  <beidson@apple.com>
2164
2165         Modern IDB: Correct handling of cursors finishing iteration.
2166         https://bugs.webkit.org/show_bug.cgi?id=151664
2167
2168         Reviewed by Andy Estes.
2169
2170         No new tests (At least one previously failing test now passes).
2171
2172         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2173         (WebCore::IDBClient::IDBCursor::setGetResult):
2174         
2175         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2176         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
2177
2178 2015-11-30  Myles C. Maxfield  <mmaxfield@apple.com>
2179
2180         Unify font-variant-* with font-variant shorthand
2181         https://bugs.webkit.org/show_bug.cgi?id=149773
2182
2183         Reviewed by Darin Adler.
2184
2185         This patch makes font-variant a shorthand for the following properties:
2186         font-variant-ligatures
2187         font-variant-position
2188         font-variant-caps
2189         font-variant-numeric
2190         font-variant-alternates
2191         font-variant-east-asian
2192
2193         This is consistent with the CSS Fonts Level 3 spec.
2194
2195         This patch also migrates the "font" longhand to use the font-variant-caps
2196         property.
2197
2198         Test: fast/text/font-variant-shorthand.html
2199
2200         * css/CSSComputedStyleDeclaration.cpp:
2201         (WebCore::fontVariantEastAsianPropertyValue): Rename FontVariantEastAsian values.
2202         (WebCore::fontVariantFromStyle): We must consult with the longhand properties to determine
2203         font-variant computed style.
2204         (WebCore::ComputedStyleExtractor::propertyValue): Don't put any-old font-variant-caps inside
2205         the font shorthand.
2206         * css/CSSFontSelector.cpp:
2207         (WebCore::CSSFontSelector::addFontFaceRule): Guard against incorrect downcasts (due to inherit
2208         of the new shorthand property).
2209         * css/CSSParser.cpp: Parse font-variant as a shorthand. Also implement its "normal" and "none" values.
2210         (WebCore::CSSParser::parseValue):
2211         (WebCore::CSSParser::parseFont):
2212         (WebCore::CSSParser::parseSystemFont):
2213         (WebCore::CSSParser::parseFontVariantLigatures):
2214         (WebCore::CSSParser::parseFontVariantNumeric):
2215         (WebCore::CSSParser::parseFontVariantEastAsian):
2216         (WebCore::CSSParser::parseFontVariant):
2217         (WebCore::isValidKeywordPropertyAndValue): Deleted.
2218         (WebCore::isKeywordPropertyID): Deleted.
2219         * css/CSSParser.h:
2220         * css/CSSPropertyNames.in: Turn font-variant into a shorthand property.
2221         * css/FontVariantBuilder.h: Guard against incorrect downcasts. Also update for renamed
2222         FontVariantEastAsian type.
2223         (WebCore::applyValueFontVariantLigatures):
2224         (WebCore::applyValueFontVariantNumeric):
2225         (WebCore::applyValueFontVariantEastAsian):
2226         * css/StyleProperties.cpp: Update to use the more specific property.
2227         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit):
2228         (WebCore::StyleProperties::fontValue):
2229         (WebCore::StyleProperties::asText):
2230         * css/StyleResolver.cpp: Ditto.
2231         (WebCore::StyleResolver::isValidCueStyleProperty):
2232         * editing/EditingStyle.cpp: Ditto.
2233         * editing/cocoa/HTMLConverter.mm: Ditto.
2234         (HTMLConverterCaches::propertyValueForNode):
2235         (HTMLConverter::computedAttributesForElement):
2236         * editing/ios/EditorIOS.mm: Ditto.
2237         (WebCore::Editor::removeUnchangeableStyles):
2238         * html/canvas/CanvasRenderingContext2D.cpp: Ditto.
2239         (WebCore::CanvasRenderingContext2D::font):
2240         (WebCore::CanvasRenderingContext2D::setFont):
2241         * platform/graphics/FontCache.h: Removing duplicate cache key value.
2242         (WebCore::FontDescriptionKey::makeFlagsKey):
2243         * platform/graphics/FontCascade.cpp: Migrate to the new font-variant-caps from the old member variable.
2244         (WebCore::FontCascade::glyphDataForCharacter):
2245         * platform/graphics/FontCascade.h: Ditto.
2246         (WebCore::FontCascade::isSmallCaps):
2247         * platform/graphics/FontDescription.cpp: Ditto.
2248         (WebCore::FontDescription::FontDescription):
2249         * platform/graphics/FontDescription.h: Ditto.
2250         (WebCore::FontCascadeDescription::equalForTextAutoSizing):
2251         (WebCore::FontDescription::smallCaps): Deleted.
2252         (WebCore::FontDescription::setSmallCaps): Deleted.
2253         (WebCore::FontDescription::setIsSmallCaps): Deleted.
2254         (WebCore::FontDescription::operator==): Deleted.
2255         * platform/graphics/cocoa/FontCacheCoreText.cpp: Rename FontVariantEastAsianWidth.
2256         (WebCore::computeFeatureSettingsFromVariants):
2257         * platform/text/TextFlags.h: Ditto.
2258         (WebCore::FontVariantSettings::operator==):
2259         * rendering/RenderText.cpp: Migrage to the new font-variant-caps from the old member variable.
2260         (WebCore::RenderText::widthFromCache):
2261
2262 2015-11-30  Brady Eidson  <beidson@apple.com>
2263
2264         Modern IDB: After versionchange transactions abort, fire onerror on the original IDBOpenDBRequest.
2265         https://bugs.webkit.org/show_bug.cgi?id=151648
2266
2267         Reviewed by Andy Estes.
2268
2269         No new tests. Covered by at least one existing failing test which now passes, and many
2270         other tests updated to fix their incorrect behavior.
2271
2272         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2273         (WebCore::IDBClient::IDBDatabase::transaction):
2274         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
2275         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
2276         
2277         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2278         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort):
2279         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
2280         
2281         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2282         (WebCore::IDBClient::IDBTransaction::notifyDidAbort):
2283         (WebCore::IDBClient::IDBTransaction::didAbort):
2284         (WebCore::IDBClient::IDBTransaction::didCommit):
2285         * Modules/indexeddb/client/IDBTransactionImpl.h:
2286
2287 2015-11-30  Chris Dumez  <cdumez@apple.com>
2288
2289         location.origin is undefined in a web worker
2290         https://bugs.webkit.org/show_bug.cgi?id=151614
2291
2292         Reviewed by Darin Adler.
2293
2294         Expose location.origin to web workers, as per:
2295         https://html.spec.whatwg.org/multipage/workers.html#workerlocation
2296
2297         This behavior is consistent with the behavior of Firefox and Chrome.
2298
2299         Test: fast/workers/worker-location.html
2300
2301         * workers/WorkerLocation.cpp:
2302         (WebCore::WorkerLocation::origin):
2303         * workers/WorkerLocation.h:
2304         * workers/WorkerLocation.idl:
2305
2306 2015-11-30  Brady Eidson  <beidson@apple.com>
2307
2308         Modern IDB: Support updating cursor values when the object store uses inline keys.
2309         https://bugs.webkit.org/show_bug.cgi?id=151647
2310
2311         Reviewed by Andy Estes.
2312
2313         No new tests (At least two previously failing tests now pass and are unskipped).
2314
2315         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2316         (WebCore::IDBClient::IDBCursor::update): Use putForCursorUpdate() instead of put()
2317         
2318         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2319         (WebCore::IDBClient::IDBObjectStore::add):
2320         (WebCore::IDBClient::IDBObjectStore::put):
2321         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate): Use the flag to skip the inline-key check.
2322         (WebCore::IDBClient::IDBObjectStore::putOrAdd): Add a flag to skip the inline-key check.
2323         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2324
2325 2015-11-30  Brady Eidson  <beidson@apple.com>
2326
2327         Modern IDB: Resolve flaky GC-vs-wrapper issue with IDBOpenDBRequest.
2328         https://bugs.webkit.org/show_bug.cgi?id=151645
2329
2330         Reviewed by Andy Estes.
2331
2332         No new tests (Resolves flakiness with hundreds of existing IDB tests).
2333
2334         Do to improper management of the m_hasPendingActivity flag on IDBRequestImpl,
2335         the request wrapper for an IDBOpenDBRequest might be garbage collected in between the
2336         onUpgradeNeeded event and onSuccess event.
2337         
2338         This manifested as flakiness in many tests, some more than others.
2339         
2340         I tried to write a targeted 100% reproducible case manually forcing GC, but could not get
2341         the timing right.
2342         
2343         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2344         (WebCore::IDBClient::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
2345         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
2346         
2347         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2348         (WebCore::IDBClient::IDBRequest::dispatchEvent):
2349         (WebCore::IDBClient::IDBRequest::willIterateCursor):
2350         * Modules/indexeddb/client/IDBRequestImpl.h:
2351         (WebCore::IDBClient::IDBRequest::isOpenDBRequest):
2352
2353 2015-11-30  Per Arne Vollan  <peavo@outlook.com>
2354
2355         [WinCairo][MediaFoundation] Implement seek.
2356         https://bugs.webkit.org/show_bug.cgi?id=151609
2357
2358         Reviewed by Alex Christensen.
2359
2360         The methods maxTimeSeekable() and buffered() needs to be implemented.
2361
2362         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2363         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
2364         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
2365         (WebCore::MediaPlayerPrivateMediaFoundation::readyState):
2366         (WebCore::MediaPlayerPrivateMediaFoundation::maxTimeSeekable):
2367         (WebCore::MediaPlayerPrivateMediaFoundation::buffered):
2368         (WebCore::MediaPlayerPrivateMediaFoundation::didLoadingProgress):
2369         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::currentTime):
2370         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isActive):
2371         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2372         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::maxTimeLoaded):
2373
2374 2015-11-30  Brady Eidson  <beidson@apple.com>
2375
2376         Modern IDB: openCursor() fix resulting in at least 4 more passing tests.
2377         https://bugs.webkit.org/show_bug.cgi?id=151630
2378
2379         Reviewed by Andy Estes.
2380
2381         No new tests (At least 4 failing tests now pass, and 9 other incorrect tests updated).
2382
2383         * Modules/indexeddb/IDBGetResult.cpp:
2384         (WebCore::IDBGetResult::isolatedCopy):
2385         * Modules/indexeddb/IDBGetResult.h:
2386         (WebCore::IDBGetResult::IDBGetResult):
2387         (WebCore::IDBGetResult::isDefined):
2388
2389         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2390         (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor): If the IDBGetResult is undefined,
2391           do not expose the cursor as the result property of the IDBRequest.
2392
2393 2015-11-30  Brady Eidson  <beidson@apple.com>
2394
2395         Modern IDB: Support keyPath injection into object store records.
2396         https://bugs.webkit.org/show_bug.cgi?id=151640
2397
2398         Reviewed by Andy Estes.
2399
2400         No new tests (At least one existing failure now passes and is unskipped,
2401         while many other existing failures are now closer to passing).
2402
2403         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2404         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): Use the new UniqueIDBDatabase VM/ExecState.
2405         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): Ditto
2406         (WebCore::IDBServer::indexVM): Deleted.
2407         (WebCore::IDBServer::indexGlobalExec): Deleted.
2408         
2409         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2410         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
2411         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
2412         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): If appropriate, inject the key that will be used into
2413           the value before storing the record.
2414         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2415
2416         Add modern JSValue/ExecState& version of some binding utilities, for use today and in preparation of getting 
2417         rid of the DOMRequestState and Deprecated::ScriptValue versions later:
2418         * bindings/js/IDBBindingUtilities.cpp:
2419         (WebCore::idbKeyToJSValue):
2420         (WebCore::injectIDBKeyIntoScriptValue):
2421         (WebCore::deserializeIDBValueData):
2422         (WebCore::deserializeIDBValueDataToJSValue):
2423         * bindings/js/IDBBindingUtilities.h:
2424
2425 2015-11-25  Andy Estes  <aestes@apple.com>
2426
2427         [Content Filtering] Avoid creating a ContentFilter when loading the empty document
2428         https://bugs.webkit.org/show_bug.cgi?id=151615
2429
2430         Reviewed by Daniel Bates.
2431
2432         It's expensive to create the first ContentFilter since two frameworks must be soft-linked. There's no reason to
2433         pay this cost if we're just loading the empty document.
2434
2435         No new tests. It's not possible to write a test that would fail without this change since ContentFilter is not
2436         notified of empty document loads.
2437
2438         * loader/DocumentLoader.cpp:
2439         (WebCore::DocumentLoader::startLoadingMainResource): Don't initialize m_contentFilter until we know we aren't
2440         loading the empty document.
2441         (WebCore::DocumentLoader::DocumentLoader):
2442
2443 2015-11-29  Antoine Quint  <graouts@apple.com>
2444
2445         Browser does not fall back to SVG attribute value when CSS style value is invalid or not supported
2446         https://bugs.webkit.org/show_bug.cgi?id=147932
2447
2448         Reviewed by Dean Jackson.
2449
2450         Instead of returning an SVGPaint object of type SVG_PAINTTYPE_UNKNOWN when we encounter an SVG paint
2451         value that cannot be parsed, we now return `nullptr` which will cause that value to be ignored and
2452         let another paint value in the cascade be used instead. This is the same approach used for SVGColor.
2453         Since we're removing the only call site for `SVGPaint::createUnknown()`, we remove that function entirely.
2454
2455         Tests: svg/css/invalid-color-cascade.svg
2456                svg/css/invalid-paint-cascade.svg
2457
2458         * css/SVGCSSParser.cpp:
2459         (WebCore::CSSParser::parseSVGPaint):
2460         * svg/SVGPaint.h:
2461         (WebCore::SVGPaint::createUnknown): Deleted.
2462
2463 2015-11-29  Simon Fraser  <simon.fraser@apple.com>
2464
2465         Use SVGTransform::SVGTransformType instead of an unsigned short
2466         https://bugs.webkit.org/show_bug.cgi?id=151637
2467
2468         Reviewed by Brady Eidson.
2469
2470         Make 'type' more strongly typed.
2471
2472         * svg/SVGTransformable.cpp:
2473         (WebCore::SVGTransformable::parseTransformValue):
2474         (WebCore::parseAndSkipType):
2475         (WebCore::SVGTransformable::parseTransformType):
2476         (WebCore::SVGTransformable::parseTransformAttribute):
2477         * svg/SVGTransformable.h:
2478
2479 2015-11-27  Brady Eidson  <beidson@apple.com>
2480
2481         Modern IDB: Class-ify IDBGetResult making it impossible to get the data members wrong.
2482         https://bugs.webkit.org/show_bug.cgi?id=151627
2483
2484         Reviewed by Alexey Proskuryakov.
2485
2486         No new tests (No change in behavior).
2487
2488         * CMakeLists.txt:
2489         * WebCore.xcodeproj/project.pbxproj:
2490
2491         * Modules/indexeddb/IDBGetResult.cpp: Added.
2492         (WebCore::IDBGetResult::dataFromBuffer):
2493         (WebCore::IDBGetResult::isolatedCopy):
2494         * Modules/indexeddb/IDBGetResult.h:
2495         (WebCore::IDBGetResult::IDBGetResult):
2496         (WebCore::IDBGetResult::valueBuffer):
2497         (WebCore::IDBGetResult::keyData):
2498         (WebCore::IDBGetResult::primaryKeyData):
2499         (WebCore::IDBGetResult::keyPath):
2500         (WebCore::IDBGetResult::setValueBuffer):
2501         (WebCore::IDBGetResult::setKeyData):
2502         (WebCore::IDBGetResult::setPrimaryKeyData):
2503         (WebCore::IDBGetResult::setKeyPath):
2504         (WebCore::IDBGetResult::dataFromBuffer): Deleted.
2505         (WebCore::IDBGetResult::isolatedCopy): Deleted.
2506
2507         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2508         (WebCore::IDBClient::IDBCursor::setGetResult):
2509         * Modules/indexeddb/client/IDBCursorImpl.h:
2510
2511         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2512         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
2513
2514         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
2515         (WebCore::GetOperation::perform):
2516
2517         * Modules/indexeddb/server/IDBBackingStore.h:
2518
2519         * Modules/indexeddb/server/MemoryCursor.h:
2520
2521         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
2522         (WebCore::IDBServer::MemoryIndexCursor::currentData):
2523
2524         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2525         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
2526
2527         * platform/CrossThreadCopier.h:
2528
2529 2015-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2530
2531         [GTK] Do not use the WebCore garbage collector timer
2532         https://bugs.webkit.org/show_bug.cgi?id=151623
2533
2534         Reviewed by Martin Robinson.
2535
2536         Now that garbage collector timers have been implemented in
2537         JavaScriptCore for glib, we don't need to use another Timer in WebCore.
2538
2539         * bindings/js/GCController.cpp:
2540         (WebCore::GCController::garbageCollectSoon):
2541         (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
2542
2543 2015-11-18  Andy Estes  <aestes@apple.com>
2544
2545         [Content Filtering] Crash in DocumentLoader::notifyFinished() when allowing a media document to load
2546         https://bugs.webkit.org/show_bug.cgi?id=151433
2547         rdar://problem/23506594
2548
2549         Reviewed by Alexey Proskuryakov.
2550
2551         When the main resource of a media document commits, WebKit cancels its load since the plug-in or media engine
2552         will do its own loading. If content filtering is enabled, and the filter waits allow the load until the entire
2553         resource is downloaded, then ContentFilter will attempt to call DocumentLoader::notifyFinished() immediately
2554         after delivering the buffered resource data to DocumentLoader. However, delivering the data will have nulled out
2555         DocumentLoader's m_mainResource when the load was cancelled, leading to a crash in notifyFinished().
2556
2557         To resolve this, add a new Stopped state to ContentFilter. Set this state if DocumentLoader clears its main
2558         resource or detaches from its frame. If ContentFilter is in the Stopped state after calling
2559         DocumentLoader::dataReceived(), do not proceed to call DocumentLoader::notifyFinished().
2560
2561         Test: contentfiltering/allow-media-document.html
2562
2563         * loader/ContentFilter.cpp:
2564         (WebCore::ContentFilter::stopFilteringMainResource): Set m_state to Stopped. If m_mainResource is non-null,
2565         removed ContentFilter as a client and set m_mainResource to null.
2566         (WebCore::ContentFilter::notifyFinished): Stopped calling DocumentLoader::notifyFinished() if m_state is Stopped
2567         after calling DocumentLoader::dataReceived().
2568         * loader/ContentFilter.h:
2569         * loader/DocumentLoader.cpp:
2570         (WebCore::DocumentLoader::detachFromFrame): Called ContentFilter::stopFilteringMainResource() instead of setting
2571         m_contentFilter to null.
2572         (WebCore::DocumentLoader::clearMainResource): Ditto.
2573
2574 2015-11-25  Pranjal Jumde  <pjumde@apple.com>
2575
2576         Checks for buffer-overflows when reading characters from textRun
2577         https://bugs.webkit.org/show_bug.cgi?id=151055
2578         <rdar://problem/23251789>
2579
2580         Reviewed by Myles C. Maxfield.
2581
2582         Prevents an off by one error when adding the last font data to the GlyphBuffer.
2583
2584         * Source/WebCore/platform/graphics/WidthIterator.cpp:
2585         * Source/WebCore/platform/graphics/FontCascade.cpp:
2586
2587 2015-11-24  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2588
2589         [Streams API] Implement pipeTo method in readable Stream
2590         https://bugs.webkit.org/show_bug.cgi?id=151588
2591
2592         Reviewed by Darin Adler.
2593
2594         Implemented pipeTo method according to the reference implementation in the spec as the spec is not written
2595         yet. It can be found at https://github.com/whatwg/streams/blob/632b26a05f3106650b1ec91239ad5b012e6c64af/reference-implementation/lib/readable-stream.js#L75.
2596
2597         Tests: streams/pipe-to.html
2598                streams/reference-implementation/brand-checks.html
2599                streams/reference-implementation/pipe-through.html
2600                streams/reference-implementation/pipe-to.html
2601                streams/reference-implementation/pipe-to-options.html
2602                streams/reference-implementation/readable-stream-templated
2603
2604         * Modules/streams/ReadableStream.js:
2605         (doPipe): Internal function of pipeTo.
2606         (closeDest): Internal function of pipeTo.
2607         (abortDest): Internal function of pipeTo.
2608         (pipeTo): Implemented as per spec with some other internal functions as helpers.
2609
2610 2015-11-24  Antti Koivisto  <antti@apple.com>
2611
2612         REGRESSION (r190983): Non-element, non-text nodes should not be distributed to slots
2613         https://bugs.webkit.org/show_bug.cgi?id=151566
2614         rdar://problem/23430177
2615
2616         Reviewed by Zalan Bujtas.
2617
2618         We don't invalidate slot assignments except for text or element children. Fix by not
2619         not assigning other nodes to slots as it is not useful.
2620
2621         Test: fast/html/details-comment-crash.html
2622
2623         * dom/SlotAssignment.cpp:
2624         (WebCore::slotNameFromSlotAttribute):
2625         (WebCore::SlotAssignment::findAssignedSlot):
2626         (WebCore::SlotAssignment::assignSlots):
2627
2628 2015-11-23  David Kilzer  <ddkilzer@apple.com>
2629
2630         Hardening against CSSSelector double frees
2631         <http://webkit.org/b/56124>
2632         <rdar://problem/9119036>
2633
2634         Reviewed by Antti Koivisto.
2635
2636         Add some security assertions to catch this issue if it ever
2637         happens in Debug builds, and make changes in
2638         CSSSelector::~CSSSelector() and
2639         CSSSelectorList::deleteSelectors() to prevent obvious issues if
2640         they're ever called twice in Release builds.
2641
2642         No new tests because we don't know how to reproduce this.
2643
2644         * css/CSSSelector.cpp:
2645         (WebCore::CSSSelector::CSSSelector): Initialize
2646         m_destructorHasBeenCalled.
2647         * css/CSSSelector.h:
2648         (WebCore::CSSSelector::m_destructorHasBeenCalled): Add bitfield.
2649         (WebCore::CSSSelector::CSSSelector): Initialize
2650         m_destructorHasBeenCalled.
2651         (WebCore::CSSSelector::~CSSSelector): Add security assertion
2652         that this is never called twice.  Clear out any fields that
2653         would have caused us to dereference an object twice.
2654
2655         * css/CSSSelectorList.cpp:
2656         (WebCore::CSSSelectorList::deleteSelectors): Clear
2657         m_selectorArray when freeing the memory to which it was
2658         pointing.  This prevents re-entrancy issues or calling this
2659         method twice on the same thread.  Also restructure the for()
2660         loop to prevent calling CSSSelector::isLastInSelectorList()
2661         after CSSSelector::~CSSSelector() has been called (via CRBug
2662         241892).
2663
2664 2015-11-23  Brian Burg  <bburg@apple.com>
2665
2666         Web Inspector: inspector settings should not be shared between different inspection levels
2667         https://bugs.webkit.org/show_bug.cgi?id=151151
2668
2669         Reviewed by Timothy Hatcher.
2670
2671         InspectorController and InspectorFrontendClient should know how to compute their
2672         inspection levels, so that this level can be exposed to the Inspector frontend for
2673         preference disambiguation by inspection level.
2674
2675          - A Page with normal web content has an inspection level of 0.
2676          - The first Web Inspector has an inspection level of 1.
2677          - The second Web Inspector that inspects the Inspector has an inspection level of 2.
2678          - And so forth...
2679
2680         For local frontend clients (WK1 and the ProtocolTestStub), the inspection level of
2681         a Page computed as follows:
2682
2683         - If the page's inspector controller has no frontend client, then the Page
2684         is normal web content (level 0).
2685         - If the page's inspector controller has a frontend client, ask for its inspection level.
2686         A frontend client looks at the inspection level reported by inspected page's inspector
2687         controller and increments by one to account for the crossed inspection boundary.
2688
2689         No new tests, this is blocked by test infrastructure fixes (https://webkit.org/b/151573).
2690
2691         * inspector/InspectorController.cpp:
2692         (WebCore::InspectorController::inspectionLevel): Added.
2693         (WebCore::InspectorController::hasInspectorFrontendClient): Deleted.
2694         * inspector/InspectorController.h:
2695         * inspector/InspectorFrontendClient.h:
2696         * inspector/InspectorFrontendClientLocal.cpp:
2697         (WebCore::InspectorFrontendClientLocal::canAttachWindow): Check inspectionLevel().
2698         (WebCore::InspectorFrontendClientLocal::inspectionLevel): Added.
2699         * inspector/InspectorFrontendClientLocal.h:
2700         * inspector/InspectorFrontendHost.cpp:
2701         (WebCore::InspectorFrontendHost::inspectionLevel): Added.
2702         * inspector/InspectorFrontendHost.h:
2703         * inspector/InspectorFrontendHost.idl:
2704         * page/ContextMenuController.cpp:
2705         (WebCore::ContextMenuController::populate): Check inspectionLevel().
2706
2707 2015-11-20  Brian Burg  <bburg@apple.com>
2708
2709         Web Inspector: RemoteInspector should track targets and connections for remote automation
2710         https://bugs.webkit.org/show_bug.cgi?id=151042
2711
2712         Reviewed by Joseph Pecoraro.
2713
2714         Use the new RemoteControllableTarget API method names.
2715
2716         No new tests, no behavior change.
2717
2718         * page/PageDebuggable.cpp:
2719         (WebCore::PageDebuggable::connect):
2720         (WebCore::PageDebuggable::dispatchMessageFromRemote):
2721         (WebCore::PageDebuggable::dispatchMessageFromRemoteFrontend): Deleted.
2722         * page/PageDebuggable.h:
2723
2724 2015-11-23  Brady Eidson  <beidson@apple.com>
2725
2726         Modern IDB: Unskip all indexeddb/mozilla tests that pass.
2727         https://bugs.webkit.org/show_bug.cgi?id=151568
2728         
2729         Reviewed by Alex Christensen.
2730
2731         No new tests (Lots of skipped existing tests now pass).
2732
2733         * Modules/indexeddb/shared/IDBError.h:
2734
2735 2015-11-23  Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au>
2736
2737         Add WebCore namespace for generated bindings for supplemental method calls
2738         https://bugs.webkit.org/show_bug.cgi?id=151431
2739
2740         Reviewed by Alex Christensen.
2741
2742         Address build failures for generated supplemental method calls which are in the WebCore namespace. 
2743         The bindings are outside the WebCore namespace - so add WebCore namespace specifier where required.
2744
2745         * bindings/scripts/CodeGeneratorJS.pm:
2746         (GenerateHeader):
2747         (GenerateImplementation):
2748         (GenerateParametersCheck):
2749         * bindings/scripts/CodeGeneratorObjC.pm:
2750         (GenerateImplementation):
2751         * bindings/scripts/test/JS/JSTestInterface.cpp:
2752         (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
2753         (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
2754         (WebCore::jsTestInterfaceSupplementalStr1):
2755         (WebCore::jsTestInterfaceSupplementalStr2):
2756         (WebCore::jsTestInterfaceSupplementalNode):
2757         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
2758         (WebCore::setJSTestInterfaceSupplementalStr2):
2759         (WebCore::setJSTestInterfaceSupplementalNode):
2760         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
2761         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
2762         (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
2763         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
2764         (-[DOMTestInterface supplementalStr1]):
2765         (-[DOMTestInterface supplementalStr2]):
2766         (-[DOMTestInterface setSupplementalStr2:]):
2767         (-[DOMTestInterface supplementalStr3]):
2768         (-[DOMTestInterface setSupplementalStr3:]):
2769         (-[DOMTestInterface supplementalNode]):
2770         (-[DOMTestInterface setSupplementalNode:]):
2771         (-[DOMTestInterface builtinAttribute]):
2772         (-[DOMTestInterface setBuiltinAttribute:]):
2773         (-[DOMTestInterface supplementalMethod1]):
2774         (-[DOMTestInterface supplementalMethod2:objArg:]):
2775         (-[DOMTestInterface supplementalMethod3]):
2776         (-[DOMTestInterface supplementalMethod4]):
2777         (-[DOMTestInterface builtinFunction]):
2778
2779 2015-11-23  Brady Eidson  <beidson@apple.com>
2780
2781         Modern IDB: When a transaction is aborted, call onerror handlers for all in-progress requests.
2782         https://bugs.webkit.org/show_bug.cgi?id=151550
2783
2784         Reviewed by Alex Christensen.
2785
2786         Test: storage/indexeddb/modern/abort-requests-cancelled.html
2787               storage/indexeddb/modern/idbtransaction-objectstore-failures.html (with changes)
2788               storage/indexeddb/modern/index-5.html (with changes)
2789               Various (currently skipped) legacy IDB tests.
2790
2791         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2792         (WebCore::IDBClient::IDBDatabase::transaction):
2793         (WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction):
2794         (WebCore::IDBClient::IDBDatabase::didStartTransaction):
2795         (WebCore::IDBClient::IDBDatabase::willCommitTransaction):
2796         (WebCore::IDBClient::IDBDatabase::didCommitTransaction):
2797         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
2798         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
2799         (WebCore::IDBClient::IDBDatabase::didCommitOrAbortTransaction):
2800         
2801         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2802         (WebCore::IDBClient::IDBTransaction::abort):
2803         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):
2804         (WebCore::IDBClient::IDBTransaction::didCreateObjectStoreOnServer):
2805         (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
2806         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
2807         (WebCore::IDBClient::IDBTransaction::didDeleteObjectStoreOnServer):
2808         (WebCore::IDBClient::IDBTransaction::didDeleteIndexOnServer):
2809         (WebCore::IDBClient::IDBTransaction::immediateAbort): Deleted.
2810         (WebCore::IDBClient::IDBTransaction::abortOnServer): Deleted.
2811         * Modules/indexeddb/client/IDBTransactionImpl.h:
2812         
2813         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2814         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
2815         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
2816         
2817         * Modules/indexeddb/shared/IDBError.cpp:
2818         (WebCore::idbErrorName):
2819         (WebCore::idbErrorDescription):
2820         * Modules/indexeddb/shared/IDBError.h:
2821         
2822         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2823         (WebCore::IDBResourceIdentifier::loggingString):
2824         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2825
2826 2015-11-23  Brady Eidson  <beidson@apple.com>
2827
2828         Modern IDB: Unskip storage/indexeddb/mozilla/global-data.html.
2829         https://bugs.webkit.org/show_bug.cgi?id=151557
2830
2831         Reviewed by Alex Christensen.
2832
2833         No new tests (Unskipping existing test storage/indexeddb/mozilla/global-data.html).
2834
2835         - Reworking some invalid ASSERTS
2836         - Actually opening pending open-database-requests after a version change transaction completes
2837         - Allow starting new transactions when the version change transaction has *started* finishing, 
2838           but before it finishes finishing.
2839
2840         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2841         (WebCore::IDBClient::IDBDatabase::transaction):
2842         
2843         * Modules/indexeddb/client/IDBTransactionImpl.h:
2844         
2845         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2846         (WebCore::IDBServer::MemoryObjectStore::~MemoryObjectStore):
2847         
2848         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2849         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded): Deleted.
2850         
2851         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2852         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
2853         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
2854         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
2855         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2856
2857 2015-11-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2858
2859         Remove DOMPromiseWithCallback
2860         https://bugs.webkit.org/show_bug.cgi?id=151565
2861
2862         Reviewed by Eric Carlson.
2863
2864         DOMPromiseWithCallback is no longer used as WebCore JS built-ins are used to the cases where DOMPromiseWithCallback made sense.
2865
2866         No change in behavior.
2867
2868         * Modules/mediastream/MediaDevices.h: Moved from DOMPromiseWithCallback to DOMPromise since the API is now called by JS built-ins.
2869         * bindings/js/JSDOMPromise.h:
2870         (WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback): Deleted.
2871         (WebCore::DOMPromiseIteratorWithCallback::DOMPromiseIteratorWithCallback): Deleted.
2872         (WebCore::Error>::resolve): Deleted.
2873         (WebCore::Error>::reject): Deleted.
2874         (WebCore::Error>::resolveEnd): Deleted.
2875
2876 2015-11-23  Brian Burg  <bburg@apple.com>
2877
2878         Web Inspector: when inspecting the inspector, add the inspection level to the title bar
2879         https://bugs.webkit.org/show_bug.cgi?id=151555
2880
2881         Reviewed by Timothy Hatcher.
2882
2883         * English.lproj/Localizable.strings: add new localized string for alternate inspector title.
2884
2885 2015-11-23  Zan Dobersek  <zdobersek@igalia.com>
2886
2887         [GStreamer] No need to assert the pipeline's bus presence in MediaPlayerPrivateGStreamerBase dtor
2888         https://bugs.webkit.org/show_bug.cgi?id=151558
2889
2890         Reviewed by Carlos Garcia Campos.
2891
2892         In the MediaPlayerPrivateGStreamerBase destructor, there's some leftover code
2893         that acquires a reference to the GStreamer pipeline's bus object and then
2894         just asserts that it's not null. Not very useful, so remove it.
2895
2896         Also use nullptr to null out the m_player member.
2897
2898         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2899         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2900
2901 2015-11-17  Sergio Villar Senin  <svillar@igalia.com>
2902
2903         ASSERTION FAILED: freeSpace >= 0 in WebCore::RenderGrid::computeTrackSizesForDirection
2904         https://bugs.webkit.org/show_bug.cgi?id=151254
2905
2906         Reviewed by Darin Adler.
2907
2908         When in quirks mode, abnormally huge margins could lead to
2909         negative computations of available logical sizes. We could add
2910         an !document.inQuirksMode() check in the assertion but since
2911         negative freeSpace values are valid (i.e. the condition is not
2912         really part of the contract and everything will work as
2913         expected) I've decided to simply remove it.
2914
2915         Test: fast/css-grid-layout/grid-quirks-mode-huge-margin-crash.html
2916
2917         * rendering/RenderGrid.cpp:
2918         (WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.
2919
2920 2015-11-22  Myles C. Maxfield  <mmaxfield@apple.com>
2921
2922         Font selection should not consult font-variant property
2923         https://bugs.webkit.org/show_bug.cgi?id=151537
2924
2925         Reviewed by Simon Fraser.
2926
2927         In section 4.7 of the CSS Fonts Level 3 spec, it says "[The font-variant and
2928         font-feature-settings] do not affect font selection."
2929
2930         All the other browsers (Chrome, Firefox, and Edge) all obey the spec here. We
2931         are the only one who misbehaves. This patch aligns our behavior with the other
2932         browsers.
2933
2934         Test: fast/text/font-selection-font-variant.html
2935
2936         * css/CSSFontSelector.cpp:
2937         (WebCore::computeTraitsMask): Deleted.
2938         (WebCore::compareFontFaces): Deleted.
2939         (WebCore::CSSFontSelector::getFontFace): Deleted.
2940         * css/CSSParser.cpp:
2941         (WebCore::isValidKeywordPropertyAndValue):
2942         (WebCore::isKeywordPropertyID):
2943         (WebCore::CSSParser::createFontFaceRule):
2944         (WebCore::CSSParser::CSSParser): Deleted.
2945         (WebCore::CSSParser::parseValue): Deleted.
2946         (WebCore::CSSParser::parseDeclaration): Deleted.
2947         (WebCore::CSSParser::clearProperties): Deleted.
2948         (WebCore::CSSParser::parseFontVariant): Deleted.
2949         (WebCore::CSSParser::createStyleRule): Deleted.
2950         (WebCore::CSSParser::deleteFontFaceOnlyValues): Deleted.
2951         * css/CSSParser.h:
2952         * platform/graphics/FontDescription.cpp:
2953         (WebCore::FontDescription::traitsMask): Deleted.
2954         * platform/graphics/win/FontCacheWin.cpp:
2955         (WebCore::traitsInFamilyEnumProc):
2956         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2957         (WebCore::toTraitsMask):
2958         * platform/text/TextFlags.h:
2959
2960 2015-11-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2961
2962         Unreviewed, rolling out r192727.
2963
2964         It made the selections transparent again and broke
2965         /webkit2/WebKitWebView/snapshot
2966
2967         Reverted changeset:
2968
2969         "[GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor,
2970         et. al. should not clobber state of cached GtkStyleContexts"
2971         https://bugs.webkit.org/show_bug.cgi?id=151533
2972         http://trac.webkit.org/changeset/192727
2973
2974 2015-11-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2975
2976         [GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor, et. al. should not clobber state of cached GtkStyleContexts
2977         https://bugs.webkit.org/show_bug.cgi?id=151533
2978
2979         Reviewed by Carlos Garcia Campos.
2980
2981         platformActiveSelectionBackgroundColor(), platformInactiveSelectionBackgroundColor(), etc.
2982         are const functions intended only to return a color used for painting, but since r174929
2983         they also change the state of the cached style contexts we use for GTK_TYPE_ENTRY and
2984         GTK_TYPE_TREE_VIEW. That's wrong; those style contexts should not have any state set. This
2985         could cause theme colors returned by those GtkStyleContexts to change unexpectedly,
2986         depending on whether the state is explicitly set before each use, or whether the theme
2987         actually uses the states.
2988
2989         This didn't cause any regression only because every place using these style contexts
2990         explicitly sets the state of the style contexts before use. In fact, the GtkTreeView style
2991         context is not used anywhere else, and the GtkEntry style context is only used in
2992         paintTextField, which does set the state before use (and then reverts it using
2993         save/restore), so this cannot have broken anything in practice. But it's a landmine waiting
2994         for the next programmer to trip it.
2995
2996         Fix this with a gtk_style_context_save()/gtk_style_context_restore() pair.
2997
2998         * rendering/RenderThemeGtk.cpp:
2999         (WebCore::styleColor):
3000
3001 2015-11-21  Myles C. Maxfield  <mmaxfield@apple.com>
3002
3003         Tiny cleanup in ComplexTextController::collectComplexTextRuns()
3004         https://bugs.webkit.org/show_bug.cgi?id=151534
3005
3006         Reviewed by Zalan Bujtas.
3007
3008         The isMissingGlyph boolean is completely unnecessary. Its entire
3009         responsiblity is duplicated by the "font" pointer.
3010
3011         No new tests because there is no behavior change.
3012
3013         * platform/graphics/mac/ComplexTextController.cpp:
3014         (WebCore::ComplexTextController::collectComplexTextRuns):
3015
3016 == Rolled over to ChangeLog-2015-11-21 ==