aaedbdbc4159270692b5c25c8e332187c7853c6f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-01-30  Chris Dumez  <cdumez@apple.com>
2
3         Unreviewed, rolling out r195871.
4
5         Caused several layout tests to time out
6
7         Reverted changeset:
8
9         "Tab suspension code shouldn't use page cache cacheability
10         logic"
11         https://bugs.webkit.org/show_bug.cgi?id=153680
12         http://trac.webkit.org/changeset/195871
13
14 2016-01-30  Chris Dumez  <cdumez@apple.com>
15
16         Unreviewed, rebaseline bindings tests after r195904.
17
18         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
19         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
20         (WebCore::jsTestCustomNamedGetterConstructor):
21         (WebCore::setJSTestCustomNamedGetterConstructor):
22         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
23         (WebCore::JSTestEventTarget::getOwnPropertySlot):
24         (WebCore::jsTestEventTargetConstructor):
25         (WebCore::setJSTestEventTargetConstructor):
26         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
27         (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot):
28         (WebCore::jsTestOverrideBuiltinsConstructor):
29         (WebCore::setJSTestOverrideBuiltinsConstructor):
30
31 2016-01-30  Chris Dumez  <cdumez@apple.com>
32
33         [JS Bindings] prototype.constructor should be writable
34         https://bugs.webkit.org/show_bug.cgi?id=149412
35         <rdar://problem/22545096>
36
37         Reviewed by Darin Adler.
38
39         prototype.constructor should have the following properties:
40         { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
41
42         as per the Web IDL specification:
43         https://heycam.github.io/webidl/#interface-prototype-object
44
45         In WebKit, it is currently not writable. It is writable in Firefox.
46
47         This patch was first landed in r190085 but was rolled out for causing
48         crashes: <rdar://problem/22825602>. The issue was that even though we
49         marked constructor as writable, we failed to generate a setter for it.
50         This patch addresses the issue and the crash in <rdar://problem/22825602>
51         no longer occurs after this change. A regression test is also added for
52         this crash.
53
54         Tests:
55         fast/dom/HTMLDocument/constructor-setter-crash.html
56         fast/dom/prototype-constructor-setter.html
57
58         * bindings/scripts/CodeGeneratorJS.pm:
59         (GenerateAttributesHashTable):
60         (GenerateImplementation):
61         * bindings/scripts/IDLAttributes.txt:
62         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
63         (WebCore::setJSTestActiveDOMObjectConstructor):
64         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
65         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
66         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
67         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
68         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
69         (WebCore::setJSTestCustomNamedGetterConstructor):
70         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
71         (WebCore::setJSTestEventConstructorConstructor):
72         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
73         (WebCore::setJSTestEventTargetConstructor):
74         * bindings/scripts/test/JS/JSTestException.cpp:
75         (WebCore::setJSTestExceptionConstructor):
76         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
77         (WebCore::setJSTestGenerateIsReachableConstructor):
78         * bindings/scripts/test/JS/JSTestInterface.cpp:
79         (WebCore::setJSTestInterfaceConstructor):
80         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
81         (WebCore::setJSTestJSBuiltinConstructorConstructor):
82         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
83         (WebCore::setJSTestMediaQueryListListenerConstructor):
84         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
85         (WebCore::setJSTestNamedConstructorConstructor):
86         * bindings/scripts/test/JS/JSTestNode.cpp:
87         (WebCore::setJSTestNodeConstructor):
88         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
89         (WebCore::setJSTestNondeterministicConstructor):
90         * bindings/scripts/test/JS/JSTestObj.cpp:
91         (WebCore::setJSTestObjConstructor):
92         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
93         (WebCore::setJSTestOverloadedConstructorsConstructor):
94         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
95         (WebCore::setJSTestOverrideBuiltinsConstructor):
96         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
97         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
98         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
99         (WebCore::setJSTestTypedefsConstructor):
100         * bindings/scripts/test/JS/JSattribute.cpp:
101         (WebCore::setJSattributeConstructor):
102         * bindings/scripts/test/JS/JSreadonly.cpp:
103         (WebCore::setJSreadonlyConstructor):
104         * page/DOMWindow.idl:
105
106 2016-01-30  Chris Dumez  <cdumez@apple.com>
107
108         Move more 'constructor' properties to the prototype
109         https://bugs.webkit.org/show_bug.cgi?id=153667
110
111         Reviewed by Darin Adler.
112
113         Move more 'constructor' properties to the prototype. In particular, we
114         used to keep the 'constructor' on the instance for interfaces that have
115         an indexed / named property getter because our getOwnPropertySlot()
116         implementation used to be wrong for such interfaces.
117
118         However, getOwnPropertySlot() should be correct after r188590 so we
119         should now be able to move the 'constructor' up to the prototype for
120         these interfaces, as per the specification:
121         http://heycam.github.io/webidl/#interface-prototype-object
122
123         No new tests, already covered by existing tests.
124
125         * bindings/js/JSPluginElementFunctions.h:
126         (WebCore::pluginElementCustomGetOwnPropertySlot):
127         Add a null check for staticPropHashTable. It is now null because this
128         type no longer has any property on the instance now that 'constructor'
129         is on the prototype.
130
131         * bindings/scripts/CodeGeneratorJS.pm:
132         (ConstructorShouldBeOnInstance):
133
134 2016-01-29  Ada Chan  <adachan@apple.com>
135
136         Enable VIDEO_PRESENTATION_MODE only in Debug and Release builds on Mac
137         https://bugs.webkit.org/show_bug.cgi?id=153665
138
139         Reviewed by Dan Bernstein.
140
141         * Configurations/FeatureDefines.xcconfig:
142
143 2016-01-30  David Kilzer  <ddkilzer@apple.com>
144
145         [iOS] WebKit1 apps crash in ___ZN7WebCore16DiskCacheMonitorC2ERKNS_15ResourceRequestENS_9SessionIDEPK20_CFCachedURLResponse_block_invoke1
146         <http://webkit.org/b/153710>
147         <rdar://problem/23116706>
148
149         Reviewed by Darin Adler.
150
151         * loader/cocoa/DiskCacheMonitorCocoa.mm:
152         (WebCore::DiskCacheMonitor::DiskCacheMonitor):
153         - Fix race condition on iOS WebKit1 clients by calling the block
154           to cancel the DiskCacheMonitor on the WebThread, which is the
155           same thread where the CFCachedURLResponseCallBackBlock is
156           called.
157         - Removed whitespace to adhere to style.
158
159 2016-01-30  Ryosuke Niwa  <rniwa@webkit.org>
160
161         TouchList should be retargeted
162         https://bugs.webkit.org/show_bug.cgi?id=149592
163
164         Reviewed by Antti Koivisto.
165
166         Retarget touch target's using the same algorithm as the one used for related targets instead of
167         EventRelatedNodeResolver which is removed in this patch.
168
169         Also enable the retargeting on iOS.
170
171         Test: fast/shadow-dom/touch-event-ios.html
172
173         * dom/EventContext.cpp:
174         (WebCore::TouchEventContext::TouchEventContext):
175         (WebCore::TouchEventContext::handleLocalEvents):
176         (WebCore::TouchEventContext::checkReachability):
177         * dom/EventContext.h:
178         (WebCore::toTouchEventContext):
179         (WebCore::EventContext::isUnreachableNode):
180         * dom/EventDispatcher.cpp:
181         (WebCore::EventRelatedNodeResolver): Deleted.
182         (WebCore::EventPath::EventPath):
183         (WebCore::EventDispatcher::dispatchEvent): 
184         (WebCore::addRelatedNodeResolversForTouchList): Deleted.
185         (WebCore::EventPath::updateTouchLists): Deleted.
186         (WebCore::EventPath::setRelatedTarget): Removed superfluous UNUSED_PARAM since the argument is always used.
187         (WebCore::EventPath::retargetTouch): Extracted from updateTouchLists/setRelatedTarget. Clones Touch object
188         with the new target for each event context just like related targets.
189         (WebCore::EventPath::retargetTouchLists): Renamed from updateTouchLists. Calls retargetTouch on each Touch
190         object in each TouchList.
191         * dom/TouchEvent.h:
192
193 2016-01-30 Dave Hyatt  <hyatt@apple.com>
194
195         Support break-after, break-before and break-inside.
196         https://bugs.webkit.org/show_bug.cgi?id=148814
197
198         Reviewed by Dean Jackson.
199
200         New tests added in printing/, fast/multicol/, and fast/regions.
201
202         * css/CSSComputedStyleDeclaration.cpp:
203         (WebCore::convertToPageBreak):
204         (WebCore::convertToColumnBreak):
205         (WebCore::convertToRegionBreak):
206         For backwards compatibility, keep support for all the old properties in
207         computed style. This means we have to convert the break-* property values
208         into keywords that make sense for the legacy properties. This mainly
209         involves mapping "page", "column", "region" to "always" (similar rule for
210         the avoid-* versions as well).
211
212         (WebCore::ComputedStyleExtractor::propertyValue):
213         Add support for the three new break-* properties.
214
215         * css/CSSParser.cpp:
216         (WebCore::isValidKeywordPropertyAndValue):
217         (WebCore::isKeywordPropertyID):
218         (WebCore::CSSParser::parseValue):
219         Add support for the new break properties.
220
221         * css/CSSPrimitiveValueMappings.h:
222         (WebCore::CSSPrimitiveValue::operator BreakBetween):
223         (WebCore::CSSPrimitiveValue::operator BreakInside):
224         Add converters for the new BreakBetween and BreakInside enums. Remove
225         the EPageBreak enum, since it is no longer used.
226
227         * css/CSSPropertyNames.in:
228         * css/CSSValueKeywords.in:
229         Add the new properties and the new values supported by the properties
230         to the keywords lists.
231
232         * css/StyleBuilderConverter.h:
233         (WebCore::StyleBuilderConverter::convertFontSynthesis):
234         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
235         (WebCore::StyleBuilderConverter::convertPageBreakInside):
236         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
237         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
238         (WebCore::StyleBuilderConverter::convertRegionBreakBetween):
239         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
240         In order to map the legacy properties into the new break-* values
241         we have custom converter functions.
242
243         * rendering/RenderBlock.cpp:
244         (WebCore::RenderBlock::paintChild):
245         (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation):
246         (WebCore::RenderBlock::computeRegionRangeForBoxChild):
247         * rendering/RenderBlockFlow.cpp:
248         (WebCore::RenderBlockFlow::applyBeforeBreak):
249         (WebCore::RenderBlockFlow::applyAfterBreak):
250         Patch the block code to check the correct new break-* constants. For
251         avoidance, this means checking both the general avoid value and the
252         specific value (e.g., avoid-page). In place of "always", we check
253         the specific value (e.g., column) and then for page specifically, we
254         also treat "left", "right", "recto" and "verso" as "always break" for now.
255
256         * rendering/style/RenderStyle.cpp:
257         (WebCore::RenderStyle::changeRequiresLayout):
258         Make sure changes to the break properties trigger relayout.
259
260         * rendering/style/RenderStyle.h:
261         Add getters and setters for the break-* properties and remove all
262         occurrences of the legacy page, column and region values from the RenderStyle.
263
264         * rendering/style/RenderStyleConstants.cpp:
265         (WebCore::alwaysPageBreak):
266         We have a helper function here for mapping several constant values to "page".
267
268         * rendering/style/RenderStyleConstants.h:
269         Definitions of the new BreakBetween and BreakInside enums.
270
271         * rendering/style/StyleMultiColData.cpp:
272         (WebCore::StyleMultiColData::StyleMultiColData):
273         (WebCore::StyleMultiColData::operator==):
274         * rendering/style/StyleMultiColData.h:
275         Remove the column-specific break data.
276
277         * rendering/style/StyleRareNonInheritedData.cpp:
278         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
279         (WebCore::StyleRareNonInheritedData::operator==):
280         * rendering/style/StyleRareNonInheritedData.h:
281         Remove the region-specific break data and replace it with generic break
282         data that is now used by all three pagination models.
283
284 2016-01-29  Per Arne Vollan  <peavo@outlook.com>
285
286         [Win] Fix compile error.
287         https://bugs.webkit.org/show_bug.cgi?id=153646
288
289         Reviewed by Darin Adler.
290
291         * platform/text/win/LocaleWin.cpp:
292         (WebCore::LCIDFromLocaleInternal):
293
294 2016-01-29  Antti Koivisto  <antti@apple.com>
295
296         Tab suspension code shouldn't use page cache cacheability logic
297         https://bugs.webkit.org/show_bug.cgi?id=153680
298
299         Reviewed by Andreas Kling.
300
301         Most of PageCache::canCache() is unnecessary for tab suspension.
302
303         Also improve robustness.
304
305         * page/Page.cpp:
306         (WebCore::Page::setPageActivityState):
307         (WebCore::Page::setIsVisible):
308         (WebCore::Page::setIsVisibleInternal):
309         (WebCore::Page::setIsPrerender):
310         (WebCore::Page::canTabSuspend):
311
312             Include visibility test here.
313
314             Instead of calling PageCache::canCache() just check for each frame that
315             - that the document is loaded
316             - that active DOM objects allow suspension
317
318         (WebCore::Page::setIsTabSuspended):
319         (WebCore::Page::setTabSuspensionEnabled):
320         (WebCore::Page::updateTabSuspensionState):
321
322             Refactor for robustness.
323
324         (WebCore::Page::tabSuspensionTimerFired):
325
326             Call canTabSuspend, the result might have changed.
327
328         (WebCore::Page::scheduleTabSuspension): Deleted.
329         * page/Page.h:
330
331 2016-01-29  Ryosuke Niwa  <rniwa@webkit.org>
332
333         fast/shadow-dom/Element-interface-attachShadow.html fails on iOS
334         https://bugs.webkit.org/show_bug.cgi?id=153681
335
336         Reviewed by Antti Koivisto.
337
338         The bug was caused by canHaveUserAgentShadowRoot() returning false on a meter element since it's disabled on iOS.
339         Override HTMLUnknownElement's canHaveUserAgentShadowRoot to return false for compatbility on iOS.
340
341         * html/HTMLUnknownElement.h:
342         (WebCore::HTMLUnknownElement::canHaveUserAgentShadowRoot):
343
344 2016-01-29  Brady Eidson  <beidson@apple.com>
345
346         Modern IDB: Getting records for key ranges with null keys aren't properly handled in SQLite backend
347         https://bugs.webkit.org/show_bug.cgi?id=153666
348
349         Reviewed by Tim Horton.
350
351         No new tests (Two failing tests now pass).
352
353         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
354         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
355
356 2016-01-29  Simon Fraser  <simon.fraser@apple.com>
357
358         image-rendering: -webkit-optimize-contrast not working for background images
359         https://bugs.webkit.org/show_bug.cgi?id=97991
360
361         Reviewed by Darin Adler.
362         
363         Don't equate "pixelated" and "crisp-edges" values for image-rendering with low
364         quality scaling; they should map to InterpolationNone, not InterpolationLow.
365         
366         To support this change ImageQualityController to return a InterpolationQuality
367         from the renamed chooseInterpolationQuality(). If the returned value is not
368         InterpolationDefault, set the GraphicsContext image interpolation when drawing
369         images and image buffers.
370         
371         Remove the redundant "useLowQualityScale" from 
372
373         Test: fast/images/image-rendering-interpolation.html
374
375         * html/HTMLCanvasElement.cpp:
376         (WebCore::HTMLCanvasElement::paint):
377         * html/HTMLCanvasElement.h:
378         * page/DragController.cpp:
379         (WebCore::DragController::doImageDrag):
380         * platform/graphics/GraphicsContext.cpp:
381         (WebCore::GraphicsContext::drawImage):
382         (WebCore::GraphicsContext::drawTiledImage):
383         (WebCore::GraphicsContext::drawImageBuffer):
384         (WebCore::GraphicsContext::drawConsumingImageBuffer):
385         (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer): Deleted.
386         (WebCore::InterpolationQualityMaintainer::~InterpolationQualityMaintainer): Deleted.
387         * platform/graphics/GraphicsContext.h:
388         (WebCore::ImagePaintingOptions::ImagePaintingOptions):
389         (WebCore::ImagePaintingOptions::usesDefaultInterpolation):
390         (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer):
391         (WebCore::InterpolationQualityMaintainer::~InterpolationQualityMaintainer):
392         * platform/graphics/GraphicsTypes.h:
393         * platform/graphics/ImageBuffer.h:
394         * platform/graphics/cg/ImageBufferCG.cpp:
395         (WebCore::ImageBuffer::drawConsuming):
396         (WebCore::ImageBuffer::draw):
397         * rendering/ImageQualityController.cpp:
398         (WebCore::ImageQualityController::interpolationQualityFromStyle):
399         (WebCore::ImageQualityController::chooseInterpolationQuality):
400         (WebCore::ImageQualityController::ImageQualityController): Deleted.
401         (WebCore::ImageQualityController::shouldPaintAtLowQuality): Deleted.
402         * rendering/ImageQualityController.h:
403         * rendering/RenderBoxModelObject.cpp:
404         (WebCore::RenderBoxModelObject::chooseInterpolationQuality):
405         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
406         (WebCore::RenderBoxModelObject::shouldPaintAtLowQuality): Deleted.
407         * rendering/RenderBoxModelObject.h:
408         * rendering/RenderEmbeddedObject.cpp:
409         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
410         * rendering/RenderHTMLCanvas.cpp:
411         (WebCore::RenderHTMLCanvas::paintReplaced):
412         * rendering/RenderImage.cpp:
413         (WebCore::RenderImage::paintIntoRect):
414         * rendering/RenderSnapshottedPlugIn.cpp:
415         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
416         * rendering/style/RenderStyle.h:
417
418 2016-01-29  Brady Eidson  <beidson@apple.com>
419
420         Modern IDB: storage/indexeddb/modern/index-3.html fails.
421         https://bugs.webkit.org/show_bug.cgi?id=153661
422
423         Reviewed by Tim Horton.
424
425         No new tests (1 failing test now passes, others get closer).
426
427         When indexing a new record fails due to uniqueness constraints, remove all traces of the record.
428
429         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
430         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
431         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
432         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
433
434 2016-01-29  Brent Fulgham  <bfulgham@apple.com>
435
436         [WebGL] Check vertex array bounds before permitting a glDrawArrays to execute
437         https://bugs.webkit.org/show_bug.cgi?id=153643
438         <rdar://problem/23424456>
439
440         Reviewed by Dean Jackson.
441
442         Tested by fast/canvas/webgl/webgl-drawarrays-crash.html.
443
444         * html/canvas/WebGLRenderingContextBase.cpp:
445         (WebCore::WebGLRenderingContextBase::validateDrawArrays): Make sure that we have at
446         least one buffer bound to a program if a drawArray call with a non-zero range of
447         requested data is being made.
448         (WebCore::WebGLRenderingContextBase::validateDrawElements): Drive-by formatting fix.
449
450 2016-01-29  Brady Eidson  <beidson@apple.com>
451
452         Modern IDB: Fix logging that overwhelms python with strings of excessive length.
453         https://bugs.webkit.org/show_bug.cgi?id=153652
454
455         Reviewed by Tim Horton.
456
457         No new tests (Two skipped tests now pass).
458
459         * Modules/indexeddb/IDBKeyData.cpp:
460         (WebCore::IDBKeyData::loggingString): Limit the length of the string.
461         
462         * Modules/indexeddb/IDBKeyRangeData.cpp:
463         (WebCore::IDBKeyRangeData::loggingString): Limit the length of the string.
464
465 2016-01-29  Jer Noble  <jer.noble@apple.com>
466
467         Unreviewed Windows build fix; one more ResourceLoaderOptions call site which needs to
468         be updated after adding the CachingPolicy parameter.
469
470         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
471         (WebCore::WebCoreAVCFResourceLoader::startLoading):
472
473 2016-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
474
475         [GTK] Implement overlay scrollbars
476         https://bugs.webkit.org/show_bug.cgi?id=153405
477
478         Reviewed by Michael Catanzaro.
479
480         Add support for overlay scrollbars to GTK+ platform following the
481         same style and behavior than GtkScrolledWindow. They are only
482         available for GTK+ >= 3.19, but honoring the GTK_OVERLAY_SCROLLING
483         environment variable, so they could be disable at run time, except
484         when threaded compositor is enabled. A new ScrollAnimator class
485         has been added for GTK+ to implement overlay scrollbars and still
486         allow smooth scrolling when available.
487
488         * PlatformGTK.cmake: Add ScrollAnimatorGtk and stop building ScrollAnimatorSmooth.
489         * platform/ScrollAnimator.h:
490         (WebCore::ScrollAnimator::ScrollAnimator::mouseEnteredContentArea):
491         Remove const to allow the ScrollAnimator to be updated.
492         (WebCore::ScrollAnimator::ScrollAnimator::mouseExitedContentArea): Ditto.
493         (WebCore::ScrollAnimator::ScrollAnimator::mouseMovedInContentArea): Ditto.
494         (WebCore::ScrollAnimator::ScrollAnimator::contentAreaDidShow): Ditto.
495         (WebCore::ScrollAnimator::ScrollAnimator::contentAreaDidHide): Ditto.
496         * platform/Scrollbar.h:
497         (WebCore::Scrollbar::opacity): Get scrollbar opacity.
498         (WebCore::Scrollbar::setOpacity): Set scrollbar opacity.
499         * platform/gtk/ScrollAnimatorGtk.cpp: Added.
500         (WebCore::ScrollAnimator::create): Create a ScrollAnimatorGtk.
501         (WebCore::ScrollAnimatorGtk::ScrollAnimatorGtk):
502         (WebCore::ScrollAnimatorGtk::~ScrollAnimatorGtk):
503         (WebCore::ScrollAnimatorGtk::ensureSmoothScrollingAnimation):
504         Initialize the ScrollAnimationSmooth if it doesn't exist.
505         (WebCore::ScrollAnimatorGtk::scroll): Ensure we have a
506         ScrollAnimationSmooth if smooth scrolling is enabled. This also
507         fixes the problem of having to reload the page after changing the
508         smooth scrolling setting.
509         (WebCore::ScrollAnimatorGtk::scrollToOffsetWithoutAnimation):
510         (WebCore::ScrollAnimatorGtk::willEndLiveResize):
511         (WebCore::ScrollAnimatorGtk::didAddVerticalScrollbar): Register
512         the scrollbar if it's an overlay scrollbar and make it visible
513         without animating it. Start the hide animation.
514         (WebCore::ScrollAnimatorGtk::didAddHorizontalScrollbar): Ditto.
515         (WebCore::ScrollAnimatorGtk::willRemoveVerticalScrollbar):
516         Unregister the scrollbar if it was registered and resrt the
517         animation state if it was the only scrollbar.
518         (WebCore::ScrollAnimatorGtk::willRemoveHorizontalScrollbar): Ditto.
519         (WebCore::ScrollAnimatorGtk::updateOverlayScrollbarsOpacity): Update
520         the scrollbars opacity and invalidate the indicator.
521         (WebCore::easeOutCubic):
522         (WebCore::ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired):
523         Update the scrollbars opacity and schedule a next frame if the
524         animation didn't finish or start the hide animation otherwhise.
525         (WebCore::ScrollAnimatorGtk::showOverlayScrollbars): Start the
526         fade animation to show the scrollbars if needed.
527         (WebCore::ScrollAnimatorGtk::hideOverlayScrollbars): Start the
528         dafe animation to hide the scrollbars if needed.
529         (WebCore::ScrollAnimatorGtk::mouseEnteredContentArea): Call
530         showOverlayScrollbars().
531         (WebCore::ScrollAnimatorGtk::mouseExitedContentArea): Call
532         hideOverlayScrollbars().
533         (WebCore::ScrollAnimatorGtk::mouseMovedInContentArea): Call
534         showOverlayScrollbars().
535         (WebCore::ScrollAnimatorGtk::contentAreaDidShow): Ditto.
536         (WebCore::ScrollAnimatorGtk::contentAreaDidHide): Hide the
537         scrollbars without animations.
538         (WebCore::ScrollAnimatorGtk::notifyContentAreaScrolled): Call
539         showOverlayScrollbars().
540         (WebCore::ScrollAnimatorGtk::lockOverlayScrollbarStateToHidden):
541         Update the lock state and hide or show the scrollbars when locked
542         or unlocked.
543         * platform/gtk/ScrollAnimatorGtk.h: Added.
544         * platform/gtk/ScrollbarThemeGtk.cpp:
545         (WebCore::ScrollbarThemeGtk::backButtonRect): Pass
546         StyleContextMode to getOrCreateStyleContext depending on the
547         painting parameter.
548         (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
549         (WebCore::ScrollbarThemeGtk::trackRect): Ditto.
550         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Add
551         StyleContextMode parameter to add the hovering class
552         unconditionally when using overlay scrollbars in layout mode. In
553         paint mode we add the hovering clas only when the scrollbar is
554         hovered. This way we always claim the size of the scrollbar when
555         hovered to be able to show the full scrollbar when the mouse is
556         close enough to the indicator.
557         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk): Initialize
558         m_usesOverlayScrollbars.
559         (WebCore::ScrollbarThemeGtk::thumbRect): Pass the scrollbar to
560         getOrCreateStyleContext().
561         (WebCore::adjustRectAccordingToMargin): Fix the top margin.
562         (WebCore::ScrollbarThemeGtk::paintTrackBackground): Pass the
563         scrollbar and paint mode to getOrCreateStyleContext().
564         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): Ditto.
565         (WebCore::ScrollbarThemeGtk::paintThumb): Adjust the thumb
566         rectangle when overlay scrollbar is not hovered to its current
567         size, since we always claim the size of the scrollbar in hovered
568         mode.
569         (WebCore::ScrollbarThemeGtk::paintButton): Pass the scrollbar and
570         paint mode to getOrCreateStyleContext().
571         (WebCore::ScrollbarThemeGtk::paint): Take the scrollbar opacity
572         into account when rendering overlay scrollbars as indicators. Also
573         get the scrollbar opacity from the GTK+ theme and use a
574         transparency group when the global opacity is not full opaque.
575         (WebCore::ScrollbarThemeGtk::buttonSize): Pass the scrollbar to
576         getOrCreateStyleContext().
577         * platform/gtk/ScrollbarThemeGtk.h:
578         * platform/mac/ScrollAnimatorMac.h:
579         * platform/mac/ScrollAnimatorMac.mm:
580         (WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
581         (WebCore::ScrollAnimatorMac::mouseExitedContentArea):
582         (WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
583         (WebCore::ScrollAnimatorMac::contentAreaDidShow):
584         (WebCore::ScrollAnimatorMac::contentAreaDidHide):
585
586 2016-01-29  ChangSeok Oh  <changseok.oh@collabora.com>
587
588         [GStreamer] built-in media player doesn't update
589         https://bugs.webkit.org/show_bug.cgi?id=151816
590
591         Reviewed by Xabier Rodriguez-Calvar.
592
593         The timeline of audio controls in media document is not properly updated since it is assumed
594         that the controls are hidden as soon as playing. However, such full page audio always has
595         opacity : 1 declared by video:-webkit-full-page-media::-webkit-media-controls-panel.no-video.
596         i.e. it is not actually hidden. We can fix this by simply returning false for no-video media
597         in controlsAreHidden();
598
599         Test: media/audio-controls-timeline-in-media-document.html
600
601         * Modules/mediacontrols/mediaControlsBase.js:
602         (Controller.prototype.controlsAreAlwaysVisible):
603         (Controller.prototype.controlsAreHidden):
604
605 2016-01-29  Manuel Rego Casasnovas  <rego@igalia.com>
606
607         [css-grid] Store lines instead of tracks in GridResolvedPosition
608         https://bugs.webkit.org/show_bug.cgi?id=153592
609
610         Reviewed by Sergio Villar Senin.
611
612         Due to the new feature that allows to create implicit tracks before the
613         explicit ones, we will need to use lines instead of tracks in the
614         code to be able to implement it properly.
615
616         This is just a first simple patch using lines instead of tracks in
617         GridResolvedPosition. It modifies the code that was using it, as it was
618         considering that the resolvedFinalPosition was a track index and
619         not a line index.
620
621         So if we've an item positioned like:
622           grid-column: 2 / 5;
623           grid-row: 1 / span 2;
624
625         Before we were storing this information on the GridSpan:
626         * columns:
627           * resolvedInitialPosition: 1
628           * resolvedFinalPosition:  3
629         * rows:
630           * resolvedInitialPosition: 0
631           * resolvedFinalPosition:  1
632
633         And now we're storing:
634         * columns:
635           * resolvedInitialPosition: 1
636           * resolvedFinalPosition:  4
637         * rows:
638           * resolvedInitialPosition: 0
639           * resolvedFinalPosition:  2
640
641         No new tests, no change of behavior.
642
643         * css/CSSGridTemplateAreasValue.cpp:
644         (WebCore::stringForPosition):
645         * css/CSSParser.cpp:
646         (WebCore::CSSParser::parseGridTemplateAreasRow):
647         * css/StyleBuilderConverter.h:
648         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
649         * rendering/RenderGrid.cpp:
650         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
651         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
652         (WebCore::RenderGrid::ensureGridSize):
653         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
654         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
655         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
656         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
657         (WebCore::RenderGrid::columnAxisOffsetForChild):
658         (WebCore::RenderGrid::rowAxisOffsetForChild):
659         * rendering/RenderGrid.h:
660         * rendering/style/GridCoordinate.h:
661         (WebCore::GridSpan::GridSpan):
662         (WebCore::GridSpan::integerSpan):
663         (WebCore::GridSpan::end):
664         (WebCore::GridCoordinate::GridCoordinate):
665         * rendering/style/GridResolvedPosition.cpp:
666         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
667         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
668         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
669         (WebCore::resolveGridPositionAgainstOppositePosition):
670         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
671         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
672         (WebCore::resolveNamedGridLinePositionFromStyle): Deleted.
673         * rendering/style/GridResolvedPosition.h:
674
675 2016-01-28  Brady Eidson  <beidson@apple.com>
676
677         Modern IDB: SQLite backend mismanages key generator values.
678         https://bugs.webkit.org/show_bug.cgi?id=153625
679
680         Reviewed by Andy Estes.
681
682         No new tests (Many failing tests pass, a few get closer).
683
684         There's mixed assumptions about whether the value stored is the current value or the next value.
685
686         Fixing those assumptions fixes tests.
687         
688         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
689         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber): Store/retrieve the correct value.
690         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber): Ditto.
691         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber): Ditto.
692
693 2016-01-28  Joseph Pecoraro  <pecoraro@apple.com>
694
695         Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
696         https://bugs.webkit.org/show_bug.cgi?id=153500
697         <rdar://problem/24352458>
698
699         Reviewed by Timothy Hatcher.
700
701         * bindings/js/JSDOMWindowBase.cpp:
702         (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
703         (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
704         (WebCore::JSDOMWindowBase::supportsProfiling): Deleted.
705         * bindings/js/JSDOMWindowBase.h:
706         * bindings/js/JSWorkerGlobalScopeBase.cpp:
707         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
708         (WebCore::JSWorkerGlobalScopeBase::supportsProfiling): Deleted.
709         * bindings/js/JSWorkerGlobalScopeBase.h:
710         * inspector/InspectorController.h:
711         * inspector/InspectorController.cpp:
712         (WebCore::InspectorController::legacyProfilerEnabled):
713         (WebCore::InspectorController::setLegacyProfilerEnabled):
714         Be more explicit about enabling legacy profiling.
715
716         * inspector/InspectorTimelineAgent.cpp:
717         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
718         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): Deleted.
719         TimelineAgent doesn't need to recompile if using the sampling profiler.
720         This breaks console.profile, but console.profile should move to using
721         the sampling profiler as well.
722
723         (WebCore::InspectorTimelineAgent::startFromConsole):
724         (WebCore::InspectorTimelineAgent::stopFromConsole):
725         (WebCore::startProfiling): Deleted.
726         (WebCore::stopProfiling): Deleted.
727         Inlined the use once static functions.
728
729         * page/PageConsoleClient.cpp:
730         (WebCore::PageConsoleClient::profile):
731         (WebCore::PageConsoleClient::profileEnd):
732         Added FIXMEs for improving console.profile and profileEnd.
733
734         * testing/Internals.cpp:
735         (WebCore::Internals::resetToConsistentState):
736         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
737         (WebCore::Internals::setJavaScriptProfilingEnabled): Deleted.
738         * testing/Internals.h:
739         * testing/Internals.idl:
740         Be more explicit about enabling legacy profiling.
741
742 2016-01-28  Chris Dumez  <cdumez@apple.com>
743
744         Move attributes to the prototype for List types / and types with indexed/named property getters
745         https://bugs.webkit.org/show_bug.cgi?id=153599
746
747         Reviewed by Darin Adler.
748
749         Move attributes to the prototype for List types / and types with indexed/named property getters.
750
751         We used to keep them on the instance because:
752         1. Our GetOwnProperty lookup used to be in incorrect order for interfaces with indexed/named property getters.
753         -> This was fixed recently and we now match the specification and other browsers.
754         2. This used to regress performance when iterating over those list types
755         -> Local testing seems to show that this is no longer a regression (tested Speedometer and various related Bindings PerformanceTests).
756
757         No new tests, already covered by existing tests.
758
759         * bindings/scripts/CodeGeneratorJS.pm:
760         (InterfaceRequiresAttributesOnInstance): Deleted.
761         (AttributeShouldBeOnInstanceForCompatibility): Deleted.
762
763 2016-01-28  Antti Koivisto  <antti@apple.com>
764
765         Tab suspension code hits asserts
766              
767
768         Reviewed by Chris Dumez.
769
770         Enabling tab suspension and navigating around in a few tabs hits an assert in
771         ScriptExecutionContext::suspendActiveDOMObject. This is because suspend/resume reasons don't pair properly
772
773         * dom/Document.cpp:
774         (WebCore::Document::documentWillBecomeInactive):
775         (WebCore::Document::suspend):
776         (WebCore::Document::resume):
777
778             Provide the reason as argument.
779
780         * dom/Document.h:
781         * history/CachedFrame.cpp:
782         (WebCore::CachedFrameBase::restore):
783
784             No need to call resumeActiveDOMObjects/resumeScriptedAnimationControllerCallbacks explicitly as Document::resume does that.
785
786         (WebCore::CachedFrame::CachedFrame):
787         * loader/FrameLoader.cpp:
788         (WebCore::FrameLoader::commitProvisionalLoad):
789         * page/Page.cpp:
790         (WebCore::Page::canTabSuspend):
791         (WebCore::Page::setIsTabSuspended):
792
793 2016-01-28  Brady Eidson  <beidson@apple.com>
794
795         Modern IDB: Fix several more problems with object store changes during cursor iteration in SQLite backend.
796         https://bugs.webkit.org/show_bug.cgi?id=153616
797
798         Reviewed by Alex Christensen.
799
800         No new tests (A few failing tests pass, a few get closer).
801
802         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
803         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
804         
805         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
806         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
807         (WebCore::IDBServer::SQLiteIDBCursor::bindArguments):
808         
809         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
810         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
811
812 2016-01-28  Daniel Bates  <dabates@apple.com>
813
814         Cleanup: Make DedicatedWorkerThread::create() an inline template method
815         https://bugs.webkit.org/show_bug.cgi?id=153612
816
817         Reviewed by Andy Estes.
818
819         Make use of variadic template arguments and std::forward() to forward the arguments passed
820         from DedicatedWorkerThread::create() to DedicatedWorkerThread::DedicatedWorkerThread(). This
821         removes the need to duplicate code whenever we modify the parameter types or number of
822         parameters taken by DedicatedWorkerThread::DedicatedWorkerThread().
823
824         * workers/DedicatedWorkerThread.cpp:
825         (WebCore::DedicatedWorkerThread::create): Deleted.
826         * workers/DedicatedWorkerThread.h: Reorganized listing of member functions such that we
827         group the creation/constructor and destructor functions.
828         (WebCore::DedicatedWorkerThread::create): Modified to be an inline template with variadic
829         parameters that std::forward()s its arguments to DedicatedWorkerThread::DedicatedWorkerThread().
830
831 2016-01-28  Brady Eidson  <beidson@apple.com>
832
833         Modern IDB: SQLite backend doesn't handle mutation during cursor iteration.
834         https://bugs.webkit.org/show_bug.cgi?id=153614
835
836         Reviewed by Alex Christensen.
837
838         No new tests (A few failing tests pass, a few get closer).
839
840         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
841         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange): Call notifyCursorsOfChanges.
842         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Ditto.
843
844         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
845         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
846         (WebCore::IDBServer::SQLiteIDBCursor::~SQLiteIDBCursor):
847         * Modules/indexeddb/server/SQLiteIDBCursor.h:
848
849         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
850         (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor): Remember these transient backing 
851           store cursors so they can be notified of changes.
852         (WebCore::IDBServer::SQLiteIDBTransaction::closeCursor): Handle removing the cursor from the right set.
853         (WebCore::IDBServer::SQLiteIDBTransaction::notifyCursorsOfChanges):
854         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
855
856 2016-01-28  Brady Eidson  <beidson@apple.com>
857
858         Modern IDB: SQLite backend doesn't support deleting ranges with more than one key.
859         https://bugs.webkit.org/show_bug.cgi?id=153604
860
861         Reviewed by Andy Estes.
862
863         No new tests (A few failing tests pass, a few get closer).
864
865         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
866         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
867
868 2016-01-28  Alex Christensen  <achristensen@webkit.org>
869
870         Fix Windows build after r195774.
871
872         * platform/network/ParsedContentRange.cpp:
873
874 2016-01-28  Anders Carlsson  <andersca@apple.com>
875
876         Add an ArrayValue::get overload that returns a string
877         https://bugs.webkit.org/show_bug.cgi?id=153613
878
879         Reviewed by Tim Horton.
880
881         * bindings/js/ArrayValue.cpp:
882         (WebCore::ArrayValue::get):
883         * bindings/js/ArrayValue.h:
884
885 2016-01-28  Chris Dumez  <cdumez@apple.com>
886
887         EventHandler IDL attributes should be enumerable
888         https://bugs.webkit.org/show_bug.cgi?id=153595
889
890         Reviewed by Sam Weinig.
891
892         Most of our EventHandler IDL attributes were marked as [NotEnumerable]
893         but should not have been according to the specification:
894         - https://html.spec.whatwg.org/#globaleventhandlers
895         - https://html.spec.whatwg.org/#windoweventhandlers
896
897         Firefox and Chrome behave according to the specification.
898         This patch aligns our behavior.
899
900         No new tests, already covered by existing tests.
901
902         * dom/Document.idl:
903         * dom/GlobalEventHandlers.idl:
904         * page/WindowEventHandlers.idl:
905
906 2016-01-28  Jer Noble  <jer.noble@apple.com>
907
908         Windows build fix; PRId64 formatting macro for int64_t undefined, so provide Windows-specific alternative.
909
910         * platform/network/ParsedContentRange.cpp:
911
912 2016-01-28  ChangSeok Oh  <changseok.oh@collabora.com>
913
914         [ThreadedCompositor] Fix flickers happening on video when entering/leaving fullscreen.
915         https://bugs.webkit.org/show_bug.cgi?id=153585
916
917         Reviewed by Michael Catanzaro.
918
919         Video thumbnail flickers where threaded compositor is enabled. This is because
920         a content buffer is not set to a target layer which changes before swapBuffer.
921         This is a very rare case though, it happens where video size changes many times in a short period.
922
923         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
924         (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
925
926 2016-01-27  Jer Noble  <jer.noble@apple.com>
927
928         Allow CachedResourceLoader clients to opt out of the MemoryCache.
929         https://bugs.webkit.org/show_bug.cgi?id=153549
930
931         Reviewed by Darin Adler.
932
933         Add a flag to ResourceLoaderOptions which allow loader clients to opt out of having
934         resources stored in the MemoryCache. 
935
936         * loader/ResourceLoaderOptions.h:
937         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
938         (WebCore::ResourceLoaderOptions::cachingPolicy):
939
940         Existing clients will have to add the (default) AllowCaching flag when they create a
941         ResourceLoaderOptions object.
942
943         * loader/DocumentLoader.cpp:
944         (WebCore::DocumentLoader::startLoadingMainResource):
945         * loader/MediaResourceLoader.cpp:
946         (WebCore::MediaResourceLoader::start):
947         * loader/NetscapePlugInStreamLoader.cpp:
948         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
949         (WebCore::ResourceLoaderOptions::setCachingPolicy):
950         * loader/icon/IconLoader.cpp:
951         (WebCore::IconLoader::startLoading):
952         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
953         (WebCore::WebCoreAVFResourceLoader::startLoading):
954
955         Every time the CachedResource or CachedResourceLoader accesses the MemoryCache, check
956         to see whether the resource or the request have allowed caching before adding resources
957         to, removing resources from, or sourcing resource data from the MemoryCache.
958
959         * loader/cache/CachedResource.cpp:
960         (WebCore::CachedResource::~CachedResource):
961         (WebCore::CachedResource::failBeforeStarting):
962         (WebCore::CachedResource::addClientToSet):
963         (WebCore::CachedResource::removeClient):
964         (WebCore::CachedResource::setDecodedSize):
965         (WebCore::CachedResource::setEncodedSize):
966         (WebCore::CachedResource::didAccessDecodedData):
967         * loader/cache/CachedResource.h:
968         (WebCore::CachedResource::allowsCaching):
969         * loader/cache/CachedResourceLoader.cpp:
970         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
971         (WebCore::CachedResourceLoader::requestResource):
972         (WebCore::CachedResourceLoader::revalidateResource):
973         (WebCore::CachedResourceLoader::loadResource):
974         (WebCore::CachedResourceLoader::printPreloadStats):
975         (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
976         * loader/cache/CachedResourceRequest.h:
977         (WebCore::CachedResourceRequest::allowsCaching):
978
979 2016-01-28  Enrica Casucci  <enrica@apple.com>
980
981         Should avoid navigation for some data detector urls.
982         https://bugs.webkit.org/show_bug.cgi?id=153600
983
984         Reviewed by Tim Horton.
985
986         Adding helper function to decide whether the default action should be performed.
987
988         * editing/cocoa/DataDetection.h:
989         * editing/cocoa/DataDetection.mm:
990         (WebCore::DataDetection::shouldCancelDefaultAction):
991
992 2016-01-28  Dave Hyatt  <hyatt@apple.com>
993
994         Roll out r194555, as it introduced some bad regressions and was not
995         correct.
996
997         * rendering/RenderText.cpp:
998         (WebCore::RenderText::computePreferredLogicalWidths):
999
1000 2016-01-28  Brady Eidson  <beidson@apple.com>
1001
1002         Modern IDB: Index uniqueness broken in the SQLite backend.
1003         https://bugs.webkit.org/show_bug.cgi?id=153596
1004
1005         Reviewed by Alex Christensen.
1006
1007         No new tests (Many failing tests now pass, others improve).
1008
1009         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1010         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1011         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
1012         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
1013         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
1014         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
1015         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1016         (WebCore::IDBServer::SQLiteIDBBackingStore::updateIndexesForAddRecord): Deleted.
1017         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1018
1019 2016-01-08  Jer Noble  <jer.noble@apple.com>
1020
1021         Custom protocol loading through AVFoundation does not support byte-range requests.
1022         https://bugs.webkit.org/show_bug.cgi?id=152919
1023         <rdar://problem/23664657>
1024
1025         Reviewed by Alex Christensen.
1026
1027         Tests: http/tests/xmlhttprequest/blob-request-byte-range.html
1028                TestWebkitAPI/Tests/WebCore/ParsedContentRange.cpp
1029
1030         When loading data through the AVAssetResourceLoaderDelegateProtocol, AVFoundation will issue
1031         requests for specific byte-ranges by adding a "Range:" HTTP header to the NSURLRequest it
1032         passes to the delegate.  WebCore ignores this header, loads the entire resource, and replies
1033         to the callback with the requested subset of the entire resource.
1034
1035         For byte-range requests near the end of a resource, this is inefficient, as the entire
1036         resource up to, and including, the requested range must be loaded before any data can be
1037         returned. Explicitly handle byte-range requests by creating a CachedResourceRequest with the
1038         underlying NSURLRequest (which includes the "Range:" header) rather than just the request's
1039         URL. BlobResourceHandle must be modified to add the "Content-Range:" response header to the
1040         ResourceResponse. 
1041
1042         To facilitate both generating and parsing the "Content-Range:" header, add a new
1043         ParsedContentRange class for use by ResourceResponse and its clients. This class provides
1044         methods both for parsing a "Content-Range" header value string, and for generating the
1045         header value from elemental values.
1046
1047         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1048         (WebCore::WebCoreAVFResourceLoader::startLoading):
1049         (WebCore::WebCoreAVFResourceLoader::responseReceived):
1050         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
1051         * platform/network/BlobResourceHandle.cpp:
1052         (WebCore::BlobResourceHandle::BlobResourceHandle):
1053         (WebCore::BlobResourceHandle::didGetSize):
1054         (WebCore::BlobResourceHandle::seek):
1055         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
1056         * platform/network/BlobResourceHandle.h:
1057         * platform/network/HTTPHeaderNames.in:
1058         * platform/network/ParsedContentRange.cpp: Added.
1059         (WebCore::areContentRangeValuesValid):
1060         (WebCore::parseContentRange):
1061         (WebCore::ParsedContentRange::ParsedContentRange):
1062         (WebCore::ParsedContentRange::headerValue):
1063         * platform/network/ParsedContentRange.h: Added.
1064         (WebCore::ParsedContentRange::ParsedContentRange):
1065         (WebCore::ParsedContentRange::isValid):
1066         (WebCore::ParsedContentRange::firstBytePosition):
1067         (WebCore::ParsedContentRange::lastBytePosition):
1068         (WebCore::ParsedContentRange::instanceLength):
1069         * platform/network/ResourceResponseBase.cpp:
1070         (WebCore::ResourceResponseBase::updateHeaderParsedState):
1071         (WebCore::parseContentRangeInHeader):
1072         (WebCore::ResourceResponseBase::contentRange):
1073         * platform/network/ResourceResponseBase.h:
1074         * CMakeLists.txt:
1075         * WebCore.vcxproj/WebCore.vcxproj:
1076         * WebCore.vcxproj/WebCore.vcxproj.filters:
1077         * WebCore.xcodeproj/project.pbxproj:
1078
1079 2016-01-28  Chris Dumez  <cdumez@apple.com>
1080
1081         Storage interface's attributes / operations should be enumerable
1082         https://bugs.webkit.org/show_bug.cgi?id=153573
1083
1084         Reviewed by Darin Adler.
1085
1086         Storage interface's attributes / operations should be enumerable:
1087         - https://html.spec.whatwg.org/#the-storage-interface
1088
1089         Firefox matches the specification.
1090
1091         No new tests, already covered by existing test.
1092
1093         * storage/Storage.idl:
1094
1095 2016-01-26  Ada Chan  <adachan@apple.com>
1096
1097         Get WebVideoFullscreenManager and related classes to also compile for Mac platform
1098         with video presentation mode support.
1099         https://bugs.webkit.org/show_bug.cgi?id=153221
1100
1101         Reviewed by Eric Carlson.
1102
1103         No new tests, no actual behavior change with a stub implementation of WebVideoFullscreenInterfaceMac.
1104
1105         * WebCore.xcodeproj/project.pbxproj:
1106         Add PlatformView.h, WebVideoFullscreenChangeObserver.h, and WebVideoFullscreenInterfaceMac.h.
1107
1108         * html/HTMLMediaElement.cpp:
1109         (WebCore::HTMLMediaElement::HTMLMediaElement):
1110         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
1111         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction):
1112         * html/HTMLMediaElement.h:
1113         Enable the code that deals with the video fullscreen layer also for Mac platform with
1114         video presentation mode support.
1115
1116         * platform/cocoa/PlatformView.h:
1117         Header file for declaring the view types for each Cocoa platform.
1118
1119         * platform/cocoa/WebVideoFullscreenChangeObserver.h:
1120         (WebCore::WebVideoFullscreenChangeObserver::~WebVideoFullscreenChangeObserver):
1121         Interface declaration moved from WebVideoFullscreenInterfaceAVKit.h.
1122
1123         * platform/cocoa/WebVideoFullscreenInterface.h:
1124         Stop guarding the declaration of WebVideoFullscreenInterface to be iOS specific. It is now
1125         enabled for iOS and Mac platform with video presentation mode support.
1126
1127         * platform/cocoa/WebVideoFullscreenModel.h:
1128         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
1129         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
1130         Enable also for Mac platform with video presentation mode support.
1131         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
1132         Set the video fullscreen layer's anchor point to (0, 0) since we are not changing the position of
1133         the video layer on Mac.
1134
1135         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1136         Import WebVideoFullscreenChangeObserver.h now that the interface declaration has been moved to that file.
1137         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1138         Move the declaration of WebVideoFullscreenChangeObserver to a separate header.
1139         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1140         Import WebVideoFullscreenChangeObserver.h now that the interface declaration has been moved to that file.
1141
1142         * platform/mac/WebVideoFullscreenInterfaceMac.h: Added.
1143         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1144         (WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac):
1145         (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenModel):
1146         (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenChangeObserver):
1147         (WebCore::WebVideoFullscreenInterfaceMac::resetMediaState):
1148         (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
1149         (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
1150         (WebCore::WebVideoFullscreenInterfaceMac::setBufferedTime):
1151         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
1152         (WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions):
1153         (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
1154         (WebCore::WebVideoFullscreenInterfaceMac::setCanPlayFastReverse):
1155         (WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
1156         (WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
1157         (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback):
1158         (WebCore::WebVideoFullscreenInterfaceMac::setWirelessVideoPlaybackDisabled):
1159         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
1160         (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen):
1161         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen):
1162         (WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen):
1163         (WebCore::WebVideoFullscreenInterfaceMac::invalidate):
1164         (WebCore::WebVideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
1165         (WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):
1166         (WebCore::WebVideoFullscreenInterfaceMac::setMode):
1167         (WebCore::WebVideoFullscreenInterfaceMac::clearMode):
1168         (WebCore::WebVideoFullscreenInterfaceMac::mayAutomaticallyShowVideoPictureInPicture):
1169         (WebCore::WebVideoFullscreenInterfaceMac::applicationDidBecomeActive):
1170         (WebCore::supportsPictureInPicture):
1171         Add a stub implementation of WebVideoFullscreenInterfaceMac.
1172
1173 2016-01-28  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
1174
1175         [SVG] Add support for 'lighter' operator in feComposite
1176         https://bugs.webkit.org/show_bug.cgi?id=141376
1177
1178         Reviewed by Darin Adler.
1179
1180         Added new cases where needed to support the lighter (aka 'plus')
1181         Porter Duff operator in SVG Filter Effects.
1182         https://www.w3.org/TR/filter-effects/#valdef-operator-lighter
1183         Note that in the specification, no constant was added to the IDL for
1184         the lighter operator. 
1185
1186         Test: svg/filters/feCompositeOpaque.html
1187               svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js
1188
1189         * platform/graphics/filters/FEComposite.cpp:
1190         (WebCore::FEComposite::platformApplySoftware):
1191           Add case to support lighter.
1192         (WebCore::operator<<):
1193           Add case to support lighter for text stream operations.
1194         * platform/graphics/filters/FEComposite.h:
1195           Add case for lighter to CompositeOperationType enum.
1196         * svg/SVGFECompositeElement.h:
1197         (WebCore::SVGIDLEnumLimits<CompositeOperationType>::highestExposedEnumValue):
1198           Higest exposed value is arithmetic - do not expose lighter.
1199         (WebCore::SVGPropertyTraits<CompositeOperationType>::highestEnumValue):
1200           Highest possible value is now lighter.
1201         (WebCore::SVGPropertyTraits<CompositeOperationType>::toString):
1202           Add case to support lighter.
1203         (WebCore::SVGPropertyTraits<CompositeOperationType>::fromString):
1204           Add case to support lighter.
1205
1206 2016-01-28  Darin Adler  <darin@apple.com>
1207
1208         Remove equalIgnoringCase since all callers really wanted equalIgnoringASCIICase
1209         https://bugs.webkit.org/show_bug.cgi?id=153411
1210
1211         Reviewed by Ryosuke Niwa.
1212
1213         Tests: fast/media/media-query-non-ASCII-case-folding.html
1214                fast/dom/HTMLAnchorElement/anchor-non-ASCII-case-folding.html
1215                fast/xpath/xpath-non-ASCII-case-folding.html
1216
1217         No tests included that cover the minor behavior changes in Document::setDomain,
1218         CSPSource::schemeMatches, CSPSource::hostMatches, OriginAccessEntry::operator==,
1219         UserContentURLPattern::matches, UserContentURLPattern::matchesHost,
1220         ContentFilterUnblockHandler::canHandleRequest. Would like to add tests for those
1221         if possible, but it seems clear all are progressions.
1222
1223         For background on why this is the right thing to do in almost every case:
1224
1225         - MIME types are all ASCII and not case sensitive (details in RFC 2045)
1226           <http://tools.ietf.org/html/rfc2045>
1227         - case insensitive comparisons in HTML are all "ASCII case-insensitive"
1228           https://www.w3.org/TR/html/infrastructure.html#ascii-case-insensitive
1229         - same for CSS
1230
1231         * Modules/webdatabase/DatabaseAuthorizer.cpp:
1232         (WebCore::DatabaseAuthorizer::denyBasedOnTableName): Use equalIgnoringASCIICase.
1233         No change in behavior since the string we are comparing with is always
1234         "__WebKitDatabaseInfoTable__" in practice.
1235
1236         * accessibility/AccessibilityNodeObject.cpp:
1237         (WebCore::siblingWithAriaRole): Changed argument type to take a const char*,
1238         added some FIXMEs and use equalIgnoringCase. No change in behavior since the
1239         strings we are comparing with are "menu" and "menuitem".
1240         (WebCore::AccessibilityNodeObject::menuElementForMenuButton): Updated to pass
1241         arguments in reverse order.
1242         (WebCore::AccessibilityNodeObject::menuItemElementForMenu): Ditto.
1243
1244         * css/CSSParser.cpp:
1245         (WebCore::CSSParser::parseFontFaceValue): Use equalIgnoringASCIICase.
1246         No change in behavior because the property names are all ASCII constants.
1247
1248         * css/CSSParserValues.h: Removed unused equalIgnoringCase function.
1249
1250         * css/MediaQueryEvaluator.cpp:
1251         (WebCore::MediaQueryEvaluator::mediaTypeMatch): Use equalIgnoringASCIICase.
1252         Changes behavior: No non-ASCII case folding when matching media types.
1253         Covered by new test.
1254         (WebCore::MediaQueryEvaluator::mediaTypeMatchSpecific): Use equalIgnoringASCIICase.
1255         No change in behavior since the only string this is ever called with is "print".
1256
1257         * dom/DataTransfer.cpp:
1258         (WebCore::DataTransfer::hasFileOfType): Use equalIgnoringASCIICase.
1259         No change in behavior because local files will not have content types with
1260         non-ASCII characters in them. In the extremely unlikely case that this is incorrect,
1261         the change in behavior is a progression.
1262
1263         * dom/Document.cpp:
1264         (WebCore::Document::setDomain): Use equalIgnoringASCIICase.
1265         Changes behavior: Domains considered equal because of non-ASCII case folding
1266         would get through without an error before, and now will properly throw an exception.
1267
1268         * dom/Element.cpp:
1269         (WebCore::isStyleAttribute): Refactored into a helper function. Use
1270         equalLettersIgnoringASCIICase. No change in behavior.
1271         (WebCore::Element::synchronizeAttribute): Use isStyleAttribute.
1272
1273         * dom/TreeScope.cpp:
1274         (WebCore::TreeScope::findAnchor): Use equalIgnoringASCIICase.
1275         Changes behavior: Could go to an anchor and it would be considered a match because
1276         of non-ASCII case folding. Covered by new test.
1277
1278         * html/HiddenInputType.cpp:
1279         (WebCore::HiddenInputType::appendFormData): Use equalIgnoringASCIICase.
1280         No change in behavior: comparing with an ASCII literal.
1281         * html/canvas/WebGL2RenderingContext.cpp:
1282         (WebCore::WebGL2RenderingContext::getExtension): Ditto.
1283         * html/canvas/WebGLRenderingContext.cpp:
1284         (WebCore::WebGLRenderingContext::getExtension): Ditto.
1285
1286         * html/parser/CSSPreloadScanner.cpp:
1287         (WebCore::CSSPreloadScanner::emitRule): Use equalLettersIgnoringASCIICase and
1288         StringView to avoid needing a special ruleEqualIgnoringCase function.
1289         No change in behavior.
1290
1291         * inspector/InspectorNodeFinder.cpp:
1292         (WebCore::InspectorNodeFinder::matchesElement): Use equalIgnoringASCIICase.
1293         Changes behavior, but it's an inspector UI thing, not a web behavior thing,
1294         so I don't think a new regression test is needed.
1295
1296         * loader/HistoryController.cpp:
1297         (WebCore::HistoryController::currentItemShouldBeReplaced): Use
1298         equalIgnoringASCIICase. No change in behavior because we are comparing
1299         with "about:blank".
1300
1301         * loader/SubframeLoader.cpp:
1302         (WebCore::findPluginMIMETypeFromURL): Use equalIgnoringASCIICase.
1303         No change in behavior unless a plug-in claims an extension with non-ASCII
1304         characters. I don't think a new regression test is needed.
1305
1306         * loader/appcache/ApplicationCacheHost.cpp:
1307         (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache):
1308         Use equalIgnoringASCIICase. No change in behavior because both strings are
1309         protocols from URLs and we don't parse non-ASCII characters into protocol strings;
1310         non-ASCII are already encoding as punycode.
1311         * loader/appcache/ManifestParser.cpp:
1312         (WebCore::parseManifest): Ditto.
1313
1314         * page/ContentSecurityPolicy.cpp:
1315         (WebCore::isExperimentalDirectiveName): Added. Used by isDirectiveName.
1316         Uses equalLettersIgnoringASCIICase. No change in behavior.
1317         (WebCore::isDirectiveName): Use equalLettersIgnoringASCIICase.
1318         No change in behavior.
1319         (WebCore::isSourceListNone): Use equalLettersIgnoringASCIICase. No
1320         change in behavior.
1321         (WebCore::CSPSource::schemeMatches): Use equalLettersIgnoringASCIICase
1322         and equalIgnoringASCIICase. It's all about comparing URL protocols. The
1323         old code might have done something strange if someone specified a protocol
1324         with a non-ASCII character in it.
1325         (WebCore::CSPSource::hostMatches): Use equalIgnoringASCIICase.
1326         (WebCore::CSPSourceList::parseSource): Use equalLettersIgnoringASCIICase.
1327         No change in behavior.
1328         (WebCore::CSPDirectiveList::checkSourceAndReportViolation): Tweaked code
1329         to do less unnecessary String allocation.
1330         (WebCore::CSPDirectiveList::parseReflectedXSS): Use
1331         equalLettersIgnoringASCIICase. No change in behavior.
1332         (WebCore::CSPDirectiveList::addDirective): Ditto.
1333         (WebCore::ContentSecurityPolicy::reportUnsupportedDirective): Use
1334         equalLettersIgnoringASCIICase and remove unneeded global constant strings.
1335         No change in behavior.
1336         (WebCore::ContentSecurityPolicy::reportDirectiveAsSourceExpression):
1337         Tweak code to eliminate unneeded local.
1338         (WebCore::ContentSecurityPolicy::reportDuplicateDirective): Ditto.
1339         (WebCore::ContentSecurityPolicy::reportInvalidSourceExpression): Use
1340         equalLettersIgnoringASCIICase. No change in behavior.
1341
1342         * page/OriginAccessEntry.h:
1343         (WebCore::operator==): Use equalLettersIgnoringASCIICase.
1344
1345         * page/Performance.cpp:
1346         (WebCore::Performance::webkitGetEntriesByName): Use equalLettersIgnoringASCIICase.
1347         No change in behavior.
1348
1349         * page/UserContentURLPattern.cpp:
1350         (WebCore::UserContentURLPattern::matches): Use equalIgnoringASCIICase to match
1351         schemes.
1352         (WebCore::UserContentURLPattern::matchesHost): Use equalIgnoringASCIICase to
1353         match host names.
1354
1355         * platform/URL.cpp:
1356         (WebCore::URL::init): Use equalIgnoringASCIICase, and also use StringView to
1357         avoid having to allocate a second string just for comparison purposes. Should be
1358         better for efficiency with no change in behavior.
1359
1360         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
1361         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Use equalIgnoringASCIICase
1362         to compare hosts.
1363
1364         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
1365         (WebCore::PlatformSpeechSynthesisProviderEfl::voiceName): Use StringView and
1366         equalIgnoringASCIICase to compare language tags. No test needed because there are
1367         no language tags with non-ASCII characters in them.
1368
1369         * platform/graphics/FontCache.cpp:
1370         (WebCore::FontPlatformDataCacheKey::operator==): Changed to use the equal
1371         function from CaseFoldingHash. In a subsequent patch we will change this to be
1372         ASCIICaseFoldingHash since font names don't need to compare non-ASCII characters
1373         in a case folding manner, but for now preserve behavior.
1374         (WebCore::alternateFamilyName): Use equalLettersIgnoringASCIICase to avoid having
1375         to use a special familyNameEqualIgnoringCase function. This does mean there will
1376         be a null check and a length check that wasn't there before, but the actual
1377         comparison function will be tighter. Guessing it will be a wash. Also improved
1378         the comments and sorted the Windows cases in with the others. No behavior change.
1379
1380         * platform/graphics/FontCascade.cpp:
1381         (WebCore::operator==): Changed to use the equal function from CaseFoldingHash.
1382         Same rationale as above in FontPlatformDataCacheKey.
1383
1384         * platform/graphics/FontDescription.cpp:
1385         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
1386         equalIgnoringASCIICase to compare font family names. Only possible change in
1387         behavior would be if actual fonts with non-ASCII names but that were specified
1388         with different case in style sheets. Highly unlikely this exists.
1389
1390         * platform/graphics/MediaPlayer.cpp:
1391         (WebCore::MediaPlayer::supportsType): Use equalLettersIgnoringASCIICase.
1392         No change in behavior.
1393         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1394         (WebCore::keySystemIsSupported): Ditto.
1395
1396         * platform/graphics/freetype/FontCacheFreeType.cpp:
1397         (WebCore::isCommonlyUsedGenericFamily): Added.
1398         (WebCore::FontCache::createFontPlatformData): Moved code into the
1399         isCommonlyUsedGenericFamily helper and used equalIgnoringASCIICase.
1400
1401         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1402         (WebCore::FontCustomPlatformData::supportsFormat): Use
1403         equalLettersIgnoringASCIICase. No change in behavior.
1404         * platform/graphics/win/FontCacheWin.cpp:
1405         (WebCore::adjustedGDIFontWeight): Ditto.
1406         (WebCore::FontCache::createFontPlatformData): Ditto.
1407         * platform/graphics/win/FontCustomPlatformData.cpp:
1408         (WebCore::FontCustomPlatformData::supportsFormat): Ditto.
1409         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
1410         (WebCore::FontCustomPlatformData::supportsFormat): Ditto.
1411
1412         * platform/mac/PlatformSpeechSynthesizerMac.mm:
1413         (-[WebSpeechSynthesisWrapper speakUtterance:]): Use equalIgnoringASCIICase to
1414         compare languages. No change in behavior because languages have all-ASCII names.
1415
1416         * platform/network/CacheValidation.cpp:
1417         (WebCore::shouldUpdateHeaderAfterRevalidation): Use equalIgnoringASCIICase.
1418         No change in behavior since it's a fixed list of all ASCII headers.
1419         * platform/network/curl/ResourceHandleManager.cpp:
1420         (WebCore::isAppendableHeader): Ditto.
1421
1422         * platform/network/mac/ResourceHandleMac.mm:
1423         (WebCore::ResourceHandle::willSendRequest): Use equalIgnoringASCIICase.
1424         No change in behavior because HTTP methods are all ASCII letters.
1425
1426         * platform/text/mac/LocaleMac.mm:
1427         (WebCore::determineLocale): Use equalIgnoringASCIICase. No change in behavior
1428         because locale languages identifiers are all ASCII.
1429         * platform/text/win/LocaleWin.cpp:
1430         (WebCore::LCIDFromLocaleInternal): Ditto.
1431
1432         * svg/SVGToOTFFontConversion.cpp:
1433         (WebCore::SVGToOTFFontConverter::appendArabicReplacementSubtable):
1434         Use equalIgnoringASCIICase. No change in behavior because Arabic form attribute
1435         values are all ASCII.
1436
1437         * xml/XMLHttpRequest.cpp:
1438         (WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod): Use equalIgnoringASCIICase.
1439         No change in behavior because these are all fixed known ASCII HTTP method names.
1440
1441         * xml/XPathFunctions.cpp:
1442         (WebCore::XPath::FunLang::evaluate): Use equalIgnoringASCIICase. Changes behavior
1443         if specifying a non-ASCII character. Covered by new test.
1444
1445         * xml/XPathStep.cpp:
1446         (WebCore::XPath::nodeMatchesBasicTest): Use equalIgnoringASCIICase. Changes
1447         behavior if an element local name or XPath predicate has a non-ASCII character.
1448         Covered by new test.
1449
1450 2016-01-28  Zalan Bujtas  <zalan@apple.com>
1451
1452         Unexpected content wrapping at http://email.osh.com/H/2/v100000152474feb8ec7c1a1f4bbe5c7c0/HTML
1453         https://bugs.webkit.org/show_bug.cgi?id=153430
1454
1455         Reviewed by Simon Fraser.
1456
1457         Ensure that min/max preferred and computed widths never shrink while converting LayoutUnit to float and back.
1458
1459         Test: fast/table/fixed-size-table-with-fixed-size-content.html
1460
1461         * rendering/AutoTableLayout.cpp:
1462         (WebCore::AutoTableLayout::recalcColumn):
1463         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
1464         (WebCore::AutoTableLayout::layout):
1465         * rendering/RenderBlock.cpp:
1466         (WebCore::RenderBlock::computePreferredLogicalWidths): Deleted.
1467
1468 2016-01-28  Gwang Yoon Hwang  <yoon@igalia.com>
1469
1470         [GStreamer] Clean up includes and headers related with GStreamerGL
1471         https://bugs.webkit.org/show_bug.cgi?id=153590
1472
1473         Reviewed by Philippe Normand.
1474
1475         Remove gstglmemory from the including list and reorder includes to
1476         organize GSTREAMER_GL related headers. It violates style rules of the
1477         include order, but there is no clean way to include gst/gl/gl.h
1478         without violating it.
1479
1480         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1481         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1482
1483 2016-01-28  Gwang Yoon Hwang  <yoon@igalia.com>
1484
1485         [GStreamer] MediaPlayerPrivateGStreamerBase::handleSyncMessage leaks GstContext
1486         https://bugs.webkit.org/show_bug.cgi?id=153580
1487
1488         Reviewed by Philippe Normand.
1489
1490         When we creates GstContext using gst_context_new it increases refcount itself.
1491         And the refcount of GstContext is increased when it is passed to
1492         gst_element_set_context, also. Therefore We should unref GstContext after
1493         using it to prevent GstContext leaks.
1494
1495         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
1496         (WTF::adoptGRef): Added for GstContext.
1497         (WTF::refGPtr<GstContext>): Ditto
1498         (WTF::derefGPtr<GstContext>): Ditto
1499         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
1500         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1501         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1502         Use GRefPtr<GstContext> to handle currect refcounting
1503
1504 2016-01-27  Alex Christensen  <achristensen@webkit.org>
1505
1506         Fix clean CMake build after r195711.
1507
1508         * PlatformWin.cmake:
1509         Copy forwarding headers from the new directory to find ContentSecurityPolicy.h.
1510         This should fix EWS issues like the one seen in bug 153573.
1511
1512 2016-01-27  Chris Dumez  <cdumez@apple.com>
1513
1514         Expose ValidityState on the global Window object
1515         https://bugs.webkit.org/show_bug.cgi?id=153582
1516
1517         Reviewed by Antti Koivisto.
1518
1519         Expose ValidityState on the global Window object:
1520         https://html.spec.whatwg.org/#validitystate
1521
1522         Firefox and Chrome match the specification.
1523
1524         No new tests, already covered by existing tests.
1525
1526         * html/ValidityState.idl:
1527
1528 2016-01-27  Chris Dumez  <cdumez@apple.com>
1529
1530         Expose ApplicationCache on the global Window object
1531         https://bugs.webkit.org/show_bug.cgi?id=153578
1532
1533         Reviewed by Antti Koivisto.
1534
1535         Expose ApplicationCache on the global Window object as per:
1536         https://html.spec.whatwg.org/#the-storage-interface
1537
1538         Chrome follows the spec.
1539
1540         No new tests, already covered by existing test.
1541
1542         * loader/appcache/DOMApplicationCache.idl:
1543
1544 2016-01-27  Ryosuke Niwa  <rniwa@webkit.org>
1545
1546         REGRESSION(r190430): Assertion failure in Text::~Text()
1547         https://bugs.webkit.org/show_bug.cgi?id=153577
1548
1549         Reviewed by Antti Koivisto.
1550
1551         The bug was caused by destroyRenderTreeIfNeeded exiting early on all HTMLSlotElement as it lacks a render object.
1552         Fixed it by explicitly avoiding the early return when child is a HTMLSlotElement.
1553
1554         Test: fast/shadow-dom/slot-removal-crash-2.html
1555
1556         * dom/ContainerNode.cpp:
1557         (WebCore::destroyRenderTreeIfNeeded):
1558
1559 2016-01-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
1560
1561         Garbage is displayed when root svg element has mix-blend-mode set
1562         https://bugs.webkit.org/show_bug.cgi?id=150556
1563
1564         Reviewed by Darin Adler.
1565
1566         This bug happens when compositing on a CALayer and drawing on a transparent
1567         layer, so it happens with WK2 with <svg style="mix-blend-mode...">. And it
1568         can happen with WK1 also with <svg style="opacity=...;mix-blend-mode...">.
1569         But in both cases, the SVG root renderer should be the root of the render
1570         tree. So it happens only with the stand alone SVG documents.
1571
1572         SVGRenderContext::prepareToRenderSVGContent() ignores the opacity of
1573         the SVG root but it creates a transparent layer for the blend-mode.
1574
1575         But RenderLayer::beginTransparencyLayers() creates a transparent layer
1576         for opacity and it sets the blend-mode also.
1577
1578         The fix is to begin two transparent layers for the SVG root renderer: one
1579         for the opacity and the second for the blend-mode. The opacity transparent
1580         layer will be still managed by RenderLayer::beginTransparencyLayers(). While
1581         the blend-mode transparent layer will be managed by SVGRenderContext
1582         ::prepareToRenderSVGContent().
1583
1584         Tests: svg/css/mix-blend-mode-background-root.svg
1585                svg/css/mix-blend-mode-opacity-root.svg
1586
1587         * rendering/RenderLayer.cpp:
1588         (WebCore::RenderLayer::beginTransparencyLayers):
1589
1590 2016-01-27  Enrica Casucci  <enrica@apple.com>
1591
1592         Cache results of data detection in the UI process when load completes.
1593         https://bugs.webkit.org/show_bug.cgi?id=153560
1594
1595         Reviewed by Tim Horton.
1596
1597         Adding new FrameLoaderClient method to notify that data
1598         detection is complete and provide the results.
1599
1600         * loader/EmptyClients.h:
1601         * loader/FrameLoader.cpp:
1602         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1603         * loader/FrameLoaderClient.h:
1604
1605 2016-01-27  Daniel Bates  <dabates@apple.com>
1606
1607         Move ContentSecurityPolicy.{cpp, h} to its own directory
1608         https://bugs.webkit.org/show_bug.cgi?id=153527
1609         <rdar://problem/24359892>
1610
1611         Reviewed by Sam Weinig.
1612
1613         Move ContentSecurityPolicy.{cpp, h} from Source/WebCore/page to Source/WebCore/page/csp.
1614         This will facilitate separating out the policy support classes (e.g. CSPDirectiveList)
1615         into their own files to improve the hackability of this code.
1616
1617         * CMakeLists.txt:
1618         * WebCore.vcxproj/WebCore.vcxproj:
1619         * WebCore.vcxproj/WebCore.vcxproj.filters:
1620         * WebCore.xcodeproj/project.pbxproj:
1621         * page/csp/ContentSecurityPolicy.cpp: Renamed from Source/WebCore/page/ContentSecurityPolicy.cpp.
1622         * page/csp/ContentSecurityPolicy.h: Renamed from Source/WebCore/page/ContentSecurityPolicy.h.
1623
1624 2016-01-27  Brady Eidson  <beidson@apple.com>
1625
1626         Modern IDB: Incorrect handling of iterating cursors to their end.
1627         https://bugs.webkit.org/show_bug.cgi?id=153569
1628
1629         Reviewed by Alex Christensen.
1630
1631         No new tests (3 tests now pass, others are closer to passing).
1632
1633         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1634         (WebCore::IDBServer::SQLiteIDBCursor::advance):
1635         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
1636
1637 2016-01-27  Nan Wang  <n_wang@apple.com>
1638
1639         AX: Crash in AccessibilityTableColumn::headerObject
1640         https://bugs.webkit.org/show_bug.cgi?id=153553
1641         <rdar://problem/23196278>
1642
1643         Reviewed by Chris Fleizach.
1644
1645         Webkit was crashing sometimes when we asked for column headers of a table.
1646         The columns vector of the table was reset during the iteration when we
1647         were asking for the headerObject of each column. The column's addChildren()
1648         function calls elementRect() for each child cell and that sometimes causes 
1649         the parent table to reset its children.
1650         Fixed it by caching the columns vector and moving out the elementRect() logic
1651         from AccessibilityTalbeColumn::addChildren().  
1652
1653         * accessibility/AccessibilityTable.cpp:
1654         (WebCore::AccessibilityTable::columnHeaders):
1655         (WebCore::AccessibilityTable::rowHeaders):
1656         * accessibility/AccessibilityTableColumn.cpp:
1657         (WebCore::AccessibilityTableColumn::elementRect):
1658         (WebCore::AccessibilityTableColumn::headerObject):
1659         (WebCore::AccessibilityTableColumn::addChildren):
1660         * accessibility/AccessibilityTableColumn.h:
1661
1662 2016-01-27  Chris Dumez  <cdumez@apple.com>
1663
1664         Settings a reflected DOMString attribute to null should set it to the "null" string rather than the empty string
1665         https://bugs.webkit.org/show_bug.cgi?id=153504
1666         <rdar://problem/24353072>
1667
1668         Reviewed by Ryosuke Niwa.
1669
1670         Settings a reflected DOMString attribute to null should set it to the "null"
1671         string rather than the empty string:
1672         - https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes
1673         - http://heycam.github.io/webidl/#es-DOMString
1674         - http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring
1675
1676         Firefox and Chrome match the specification here.
1677
1678         This is causing a lot of W3C HTML reflection tests to fail on WebKit, e.g.:
1679         - http://w3c-test.org/html/dom/reflection-text.html
1680
1681         No new tests, already covered by existing tests.
1682
1683         * bindings/scripts/CodeGeneratorJS.pm:
1684         (JSValueToNative):
1685         Call toString() instead of valueToStringWithNullCheck() for reflected
1686         attributes. This way, null gets converted to the string "null", as
1687         expected, instead of a null String object.
1688
1689         * html/HTMLInputElement.idl:
1690         Dropping [TreatNullAs=NullString] IDL extended attribute for
1691         input.defaultValue, as this is not present in the specification:
1692         - https://html.spec.whatwg.org/#htmlinputelement
1693
1694         Without this change, assigning null to input.defaultValue would not
1695         set to to the "null" string, as is expected.
1696
1697         * html/HTMLTextAreaElement.idl:
1698         Dropping [TreatNullAs=NullString] IDL extended attribute for
1699         textArea.defaultValue, as this is not present in the specification:
1700         - https://html.spec.whatwg.org/#htmltextareaelement
1701
1702         Without this change, assigning null to textArea.defaultValue would not
1703         set to to the "null" string, as is expected.
1704
1705         * html/HTMLTitleElement.idl:
1706         Dropping [TreatNullAs=NullString] IDL extended attribute for
1707         title.text, as this is not present in the specification:
1708         - https://html.spec.whatwg.org/#htmltitleelement
1709
1710         Without this change, assigning null to title.text would not
1711         set to to the "null" string, as is expected.
1712
1713 2016-01-27  Simon Fraser  <simon.fraser@apple.com>
1714
1715         Support CSS3 Images values for the image-rendering property
1716         https://bugs.webkit.org/show_bug.cgi?id=153556
1717
1718         Reviewed by Dean Jackson.
1719
1720         CSS3 Images has the following values for image-rendering:
1721             auto, crisp-edges, pixelated
1722
1723         The old code supported:
1724             optimizeSpeed, optimizeQuality, -webkit-crisp-edges, -webkit-optimize-contrast
1725
1726         Add support for the new values without prefixes. Map -webkit-crisp-edges to crisp-edges,
1727         and -webkit-optimize-contrast to crisp-edges. Support pixelated which behaves like 
1728         crisp-edges (a low quality scale).
1729
1730         The spec says that optimizeQuality should behave like 'auto', but that would be
1731         a behavior change since ImageQualityController::shouldPaintAtLowQuality() currently
1732         uses it as a trigger to avoid low quality scaling, so don't change that for now.
1733
1734         No new tests, covered by fast/css/script-tests/image-rendering-parsing.js
1735
1736         * css/CSSParser.cpp:
1737         (WebCore::isValidKeywordPropertyAndValue):
1738         * css/CSSPrimitiveValueMappings.h:
1739         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1740         (WebCore::CSSPrimitiveValue::operator EImageRendering):
1741         * css/CSSValueKeywords.in:
1742         * rendering/ImageQualityController.cpp:
1743         (WebCore::ImageQualityController::shouldPaintAtLowQuality):
1744         * rendering/RenderHTMLCanvas.cpp:
1745         (WebCore::RenderHTMLCanvas::paintReplaced):
1746         * rendering/style/RenderStyleConstants.h:
1747         * rendering/style/StyleRareInheritedData.h: Need another bit.
1748
1749 2016-01-27  Anders Carlsson  <andersca@apple.com>
1750
1751         Add WebKitAdditions extension points to WebCore, WebKit and WebKitLegacy
1752         https://bugs.webkit.org/show_bug.cgi?id=153550
1753
1754         Reviewed by Sam Weinig.
1755
1756         * DerivedSources.make:
1757         Add the ability for WebKitAdditions to add events and event targets.
1758
1759         * WebCore.xcodeproj/project.pbxproj:
1760         Add new files.
1761
1762         * bindings/scripts/InFilesCompiler.pm:
1763         (initializeFromCommandLine):
1764         (compile):
1765         Handle multiple --input parameters.
1766
1767         * dom/EventNames.h:
1768         Handle adding more event names.
1769
1770         * loader/EmptyClients.cpp:
1771         (WebCore::fillWithEmptyClients):
1772         * page/MainFrame.cpp:
1773         (WebCore::MainFrame::MainFrame):
1774         * page/MainFrame.h:
1775         * page/PageConfiguration.h:
1776         Add extension points.
1777
1778         * platform/cocoa/WebKitAdditions.mm: Added.
1779         Import additions.
1780
1781 2016-01-27  Brady Eidson  <beidson@apple.com>
1782
1783         Modern IDB: Fix many Index tests.
1784         https://bugs.webkit.org/show_bug.cgi?id=153561
1785
1786         Reviewed by Alex Christensen.
1787
1788         No new tests (Many failing tests now pass).
1789
1790         * Modules/indexeddb/server/MemoryIndex.cpp:
1791         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange):
1792         
1793         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1794         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
1795         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
1796         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1797         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
1798         
1799         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1800         (WebCore::IDBServer::SQLiteIDBCursor::didComplete):
1801
1802 2016-01-27  Brady Eidson  <beidson@apple.com>
1803
1804         Modern IDB: Cursors are utterly broken in the SQLite backend.
1805         https://bugs.webkit.org/show_bug.cgi?id=153558
1806
1807         Reviewed by Alex Christensen.
1808
1809         No new tests (35 failures now pass, others improve).
1810
1811         - Fixes incorrect usage of Index cursors when ObjectStore cursors are intended.
1812         - Improves the state of getting the cursor value vs. reaching the end of a cursor.
1813
1814         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1815         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
1816         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
1817
1818         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1819         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
1820         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
1821         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1822
1823 2016-01-27  Chris Dumez  <cdumez@apple.com>
1824
1825         Getting / Setting property on prototype object must throw TypeError
1826         https://bugs.webkit.org/show_bug.cgi?id=153547
1827         <rdar://problem/24370650>
1828
1829         Reviewed by Ryosuke Niwa.
1830
1831         Gettingi / Setting property on prototype object must throw TypeError as per
1832         Web IDL specification:
1833         http://heycam.github.io/webidl/#dfn-attribute-getter (Step 2.4.2)
1834         http://heycam.github.io/webidl/#dfn-attribute-setter (Step 3.5)
1835
1836         Firefox and Chrome already throw a TypeError in this case, as per
1837         the specification. However, WebKit was returning null and merely
1838         logging a deprecation error message. This patch aligns our behavior
1839         with other browsers and the specification.
1840
1841         This patch also adds support for the [LenientThis] IDL extended
1842         attribute:
1843         http://heycam.github.io/webidl/#LenientThis
1844
1845         For [LenientThis] attributes, we do not throw a TypeError if the
1846         attribute getter / setter is called on an object which does not
1847         implement the expected interface, as per:
1848         http://heycam.github.io/webidl/#dfn-attribute-getter (Step 2.4.1)
1849         http://heycam.github.io/webidl/#dfn-attribute-setter (Step 3.5)
1850
1851         No new tests, already covered by existing tests.
1852
1853         * bindings/scripts/CodeGeneratorJS.pm:
1854         (GenerateImplementation):
1855         * bindings/scripts/IDLAttributes.txt:
1856         Add support for [LenientThis]:
1857         http://heycam.github.io/webidl/#LenientThis
1858
1859         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1860         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1861         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1862         * bindings/scripts/test/JS/JSTestInterface.cpp:
1863         * bindings/scripts/test/JS/JSTestNode.cpp:
1864         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1865         * bindings/scripts/test/JS/JSTestObj.cpp:
1866         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1867         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1868         * bindings/scripts/test/JS/JSattribute.cpp:
1869         * bindings/scripts/test/ObjC/DOMTestObj.h:
1870         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1871         Rebaseline bindings tests.
1872
1873         * bindings/scripts/test/TestObj.idl:
1874         Add coverage for [LenientThis] attributes.
1875
1876         * dom/Document.idl:
1877         Mark 'onreadystatechange' as [LenientThis] as per the HTML
1878         specification:
1879         https://html.spec.whatwg.org/#document
1880
1881         * dom/GlobalEventHandlers.idl:
1882         Mark 'onmouseeneter' / 'onmouseleave' as [LenientThis] as per the
1883         HTML specification:
1884         https://html.spec.whatwg.org/#globaleventhandlers
1885
1886 2016-01-27  Chris Dumez  <cdumez@apple.com>
1887
1888         window.atob() should ignore spaces in input
1889         https://bugs.webkit.org/show_bug.cgi?id=153522
1890         <rdar://problem/24357822>
1891
1892         Reviewed by Benjamin Poulain.
1893
1894         window.atob() should ignore spaces in input as per:
1895         - https://html.spec.whatwg.org/#dom-windowbase64-atob (Step 3)
1896
1897         Previously, WebKit would throw an exception and it was the only browser
1898         to do so. Firefox and Chrome behavior according to the specification.
1899
1900         This was causing us to fail 10 checks in the following W3C HTML test:
1901         http://w3c-test.org/html/webappapis/atob/base64.html
1902
1903         No new tests, updated existing test.
1904
1905         * page/DOMWindow.cpp:
1906         (WebCore::DOMWindow::atob):
1907         * page/Page.cpp:
1908         (WebCore::Page::userStyleSheetLocationChanged):
1909         * platform/network/DataURL.cpp:
1910         (WebCore::handleDataURL):
1911         * platform/network/DataURLDecoder.cpp:
1912         (WebCore::DataURLDecoder::decodeBase64):
1913
1914 2016-01-27  Ada Chan  <adachan@apple.com>
1915
1916         Move some logic related to the presentation mode button from mediaControlsiOS.js to mediaControlsApple.js
1917         https://bugs.webkit.org/show_bug.cgi?id=153476
1918
1919         Reviewed by Eric Carlson.
1920
1921         Also, add the necessary styles to support that control in mediaControlsApple.css.
1922
1923         * Modules/mediacontrols/mediaControlsApple.css:
1924         (video::-webkit-media-controls-panel.picture-in-picture):
1925         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
1926         (audio::-webkit-media-controls-wireless-playback-text-top.picture-in-picture):
1927         (audio::-webkit-media-controls-wireless-playback-text-bottom.picture-in-picture):
1928         (video::-webkit-media-controls-panel .picture-in-picture-button):
1929         Use the same mask image as iOS, but with a different size and a background color specified
1930         (since there's another rule that makes buttons within the panel have a transparent
1931         background color).
1932         (video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture):
1933
1934         * Modules/mediacontrols/mediaControlsApple.js:
1935         (Controller.prototype.addVideoListeners):
1936         (Controller.prototype.removeVideoListeners):
1937         Listen for (and stop listening for) the webkitpresentationmodechanged event if presentation
1938         mode is supported for this video element.
1939         (Controller.prototype.createControls):
1940         Add a class name to the pictureInPictureButton so we can query for it in the stylesheet.
1941         (Controller.prototype.configureInlineControls):
1942         Call updatePictureInPictureButton().
1943         (Controller.prototype.presentationMode):
1944         Moved from mediaControlsiOS.js.
1945         (Controller.prototype.isFullScreen):
1946         Ditto, with a bug fix to not call presentationMode(), since that method calls isFullScreen(),
1947         resulting in infinite recursion.
1948         (Controller.prototype.updatePictureInPictureButton):
1949         Ditto.
1950         (Controller.prototype.handlePresentationModeChange):
1951         Ditto.
1952         (Controller.prototype.handleFullscreenChange):
1953         Call handlePresentationModeChanged() if presentation mode is supported for this video element.
1954         (Controller.prototype.controlsAlwaysVisible):
1955         Ditto.
1956         (Controller.prototype.handlePictureInPictureButtonClicked):
1957         Ditto.
1958         * Modules/mediacontrols/mediaControlsiOS.js:
1959         (ControllerIOS.prototype.handlePresentationModeChange):
1960         Most logic has been moved to the same method in mediaControlsApple.js, except
1961         updating the style of the panelContainer, which doesn't exist in the Mac controls.
1962         (ControllerIOS.prototype.addVideoListeners): Deleted.
1963         (ControllerIOS.prototype.removeVideoListeners): Deleted.
1964         (ControllerIOS.prototype.presentationMode): Deleted.
1965         (ControllerIOS.prototype.isFullScreen): Deleted.
1966         (ControllerIOS.prototype.handlePictureInPictureButtonClicked): Deleted.
1967         (ControllerIOS.prototype.updatePictureInPictureButton): Deleted.
1968         (ControllerIOS.prototype.handleFullscreenChange): Deleted.
1969         (ControllerIOS.prototype.controlsAlwaysVisible): Deleted.
1970         Delete all code that's already handled in the Controller.
1971
1972 2016-01-26  Ada Chan  <adachan@apple.com>
1973
1974         Enable API related to the video fullscreen layer in MediaPlayerPrivateMediaSourceAVFObjC
1975         also on Mac platform with video presentation mode support.
1976         https://bugs.webkit.org/show_bug.cgi?id=153223
1977
1978         Reviewed by Jer Noble.
1979
1980         Reuse VideoFullscreenLayerManager to manage moving the video layer between the fullscreen
1981         layer and the inline layer depending on the current presentation mode.
1982
1983         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1984         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1985         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1986         Create m_videoFullscreenLayerManager.
1987         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformLayer):
1988         Return the video inline layer from the VideoFullscreenLayerManager.
1989         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer):
1990         Call VideoFullscreenLayerManager::setVideoLayer() with the m_sampleBufferDisplayLayer.
1991         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer):
1992         Call VideoFullscreenLayerManager::didDestroyVideoLayer().
1993         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
1994         Call VideoFullscreenLayerManager::setVideoFullscreenLayer().
1995         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenFrame):
1996         Call VideoFullscreenLayerManager::setVideoFullscreenFrame().
1997
1998 2016-01-27  Brady Eidson  <beidson@apple.com>
1999
2000         Modern IDB: SQLite backend doesn't update index records as object records are added.
2001         https://bugs.webkit.org/show_bug.cgi?id=153548
2002
2003         Reviewed by Alex Christensen.
2004
2005         No new tests (4 more tests pass, others improve).
2006
2007         * Modules/indexeddb/server/IDBBackingStore.h:
2008         
2009         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2010         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
2011         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2012         
2013         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2014         (WebCore::IDBServer::SQLiteIDBBackingStore::initializeVM):
2015         (WebCore::IDBServer::SQLiteIDBBackingStore::vm):
2016         (WebCore::IDBServer::SQLiteIDBBackingStore::globalObject):
2017         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
2018         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
2019         (WebCore::IDBServer::SQLiteIDBBackingStore::updateIndexesForAddRecord):
2020         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2021         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2022         
2023         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2024         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2025         
2026         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
2027
2028 2016-01-27  Ryosuke Niwa  <rniwa@webkit.org>
2029
2030         Add API to access closed shadowRoot in InjectedBundle
2031         https://bugs.webkit.org/show_bug.cgi?id=153533
2032
2033         Reviewed by Antti Koivisto.
2034
2035         Always return the shadow root in Element.shadowRootForBindings when the DOM wrapper world has
2036         shadowRootIsAlwaysOpen set to true. Also renamed bindingShadowRoot to shadowRootForBindings
2037         to be consistent.
2038
2039         * bindings/js/DOMWrapperWorld.h:
2040         (WebCore::DOMWrapperWorld::setShadowRootIsAlwaysOpen): Added.
2041         (WebCore::DOMWrapperWorld::shadowRootIsAlwaysOpen): Added.
2042         * dom/Element.cpp:
2043         (WebCore::Element::shadowRootForBindings): Renamed from bindingShadowRoot.
2044         * dom/Element.h:
2045         * dom/Element.idl:
2046
2047 2016-01-27  Zhuo Li  <zachli@apple.com>
2048
2049         Need ability to specify alternate image for AutoFill button in input fields.
2050         https://bugs.webkit.org/show_bug.cgi?id=153116.
2051         rdar://problem/23384854.
2052
2053         Reviewed by Darin Adler.
2054
2055         Add a new AutoFill button that can be shown in <input> elements.
2056
2057         Tests: fast/forms/auto-fill-button/input-contacts-auto-fill-button.html
2058                fast/forms/auto-fill-button/show-correct-auto-fill-button-when-auto-fill-button-type-changes.html
2059
2060         * css/html.css:
2061         (input::-webkit-contacts-auto-fill-button):
2062         (input::-webkit-contacts-auto-fill-button:hover):
2063         (input::-webkit-contacts-auto-fill-button:active):
2064         Add default style rules for the Contacts AutoFill button based on the ones used for
2065         Manual AutoFill button.
2066
2067         * html/HTMLInputElement.cpp:
2068         (WebCore::HTMLInputElement::setShowAutoFillButton):
2069         * html/HTMLInputElement.h:
2070         (WebCore::HTMLInputElement::autoFillButtonType):
2071         - Replace the boolean parameter with a new parameter to specify the type of the AutoFill button.
2072         - Declare a private variable to keep a record of the type of the current AutoFill
2073         button.
2074         (WebCore::HTMLInputElement::showAutoFillButton): Deleted.
2075
2076         * html/HTMLTextFormControlElement.h:
2077         Declare enum for AutoFill button type.
2078
2079         * html/TextFieldInputType.cpp:
2080         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
2081         (WebCore::isAutoFillButtonTypeChanged):
2082         (WebCore::TextFieldInputType::shouldDrawAutoFillButton): None means the AutoFill button is not
2083         enabled.
2084         (WebCore::TextFieldInputType::createAutoFillButton): Only create the AutoFill button
2085         if the type is expected.
2086         (WebCore::TextFieldInputType::updateAutoFillButton):
2087         Handle the case where AutoFill button type changes in the text field.
2088         * html/TextFieldInputType.h:
2089
2090         * testing/Internals.cpp:
2091         (WebCore::stringToAutoFillButtonType): Convert the string to AutoFill button type.
2092         (WebCore::Internals::setShowAutoFillButton): Add a new parameter to specify the type of the AutoFill button.
2093         * testing/Internals.h: Ditto.
2094         * testing/Internals.idl: Ditto.
2095
2096 2016-01-26  Ryosuke Niwa  <rniwa@webkit.org>
2097
2098         Add Node.treeRoot
2099         https://bugs.webkit.org/show_bug.cgi?id=153537
2100
2101         Reviewed by Antti Koivisto.
2102
2103         Exposed highestAncestor as Node.prototype.treeRoot, which was added to shadow DOM spec in
2104         https://github.com/w3c/webcomponents/commit/6864a40fe4efa8a737e78512e3c85319ddc5bf8b
2105
2106         See also:
2107         http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-node-interface
2108
2109         Test: fast/shadow-dom/Node-interface-treeRoot.html
2110
2111         * dom/Node.idl:
2112
2113 2016-01-26  Ryosuke Niwa  <rniwa@webkit.org>
2114
2115         Rename HTMLSlotElement.getDistributedNodes to getAssignedNodes
2116         https://bugs.webkit.org/show_bug.cgi?id=153534
2117
2118         Reviewed by Antti Koivisto.
2119
2120         Did the rename.
2121
2122         * html/HTMLSlotElement.idl:
2123
2124 2016-01-27  Tim Horton  <timothy_horton@apple.com>
2125
2126         Need to be able to specify MIME type for <attachment> without filename or handle
2127         https://bugs.webkit.org/show_bug.cgi?id=153552
2128         <rdar://problem/20145857>
2129
2130         Reviewed by Anders Carlsson.
2131
2132         Tests: fast/attachment/attachment-default-icon.html
2133                fast/attachment/attachment-type-attribute.html
2134
2135         * html/HTMLAttachmentElement.cpp:
2136         (WebCore::HTMLAttachmentElement::parseAttribute):
2137         Invalidate attachment when 'type' attribute changes.
2138
2139         (WebCore::HTMLAttachmentElement::attachmentType):
2140         * html/HTMLAttachmentElement.h:
2141         * platform/graphics/Icon.h:
2142         * platform/graphics/mac/IconMac.mm:
2143         (WebCore::Icon::createIconForUTI):
2144         (WebCore::Icon::createIconForMIMEType):
2145         Add Icon class methods to retrieve an icon given a UTI or MIME type.
2146
2147         * rendering/RenderThemeMac.mm:
2148         (WebCore::paintAttachmentIcon):
2149         Use the 'type' attribute (a MIME type) if we have one. Otherwise,
2150         use the filename. Lastly fall back to a plain file icon (using the root
2151         file UTI, public.data).
2152
2153 2016-01-27  Alexey Proskuryakov  <ap@apple.com>
2154
2155         Remove ENABLE_CURRENTSRC
2156         https://bugs.webkit.org/show_bug.cgi?id=153545
2157
2158         Reviewed by Simon Fraser.
2159
2160         * Configurations/FeatureDefines.xcconfig:
2161
2162 2016-01-26  Anders Carlsson  <andersca@apple.com>
2163
2164         Stop echoing echo commands to stdout
2165         https://bugs.webkit.org/show_bug.cgi?id=153531
2166
2167         Reviewed by Csaba Osztrogon√°c.
2168
2169         * DerivedSources.make:
2170
2171 2016-01-26  Jer Noble  <jer.noble@apple.com>
2172
2173         Calling video.controls=true during a scrub operation cancels scrub.
2174         https://bugs.webkit.org/show_bug.cgi?id=153494
2175
2176         Reviewed by Eric Carlson.
2177
2178         Test: media/media-controls-drag-timeline-set-controls-property.html
2179
2180         Verify that the video.controls attribute actually changed before tearing down and
2181         re-adding the media controls to the Shadow DOM.
2182
2183         * Modules/mediacontrols/mediaControlsApple.js:
2184         (Controller.prototype.handleControlsChange):
2185         (Controller.prototype.hasControls):
2186
2187 2016-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2188
2189         [GTK][EFL] Rename ScrollAnimationNone as ScrollAnimationSmooth
2190         https://bugs.webkit.org/show_bug.cgi?id=153481
2191
2192         Reviewed by Simon Fraser.
2193
2194         ScrollAnimationNone has always been used by EFL and GTK ports to
2195         implement smooth scrolling. I think it should be possible for
2196         other scroll animators to implement smooth scrolling or even
2197         implement other kind of scroll animations. For example, in the
2198         future I would like to have kinetic scrolling implemented for the
2199         GTK+ port to match all other GTK+ application and decide at
2200         runtime between different animations without having to use a
2201         different scroll animator class. So, this patch also moves the
2202         smooth scrolling animation implementation to its own class
2203         ScrollAnimationSmooth that impements an interface ScrollAnimation
2204         that could be used to implement other animations. This will allow
2205         the GTK+ port to add its own scroll animator class and still
2206         support smooth scrolling sharing the code with the
2207         ScrollAnimationSmooth.
2208
2209         * PlatformEfl.cmake: Add new files to compilation and remove ScrollAnimationNone.
2210         * PlatformGTK.cmake: Ditto.
2211         * platform/ScrollAnimation.h: Added.
2212         (WebCore::ScrollAnimation::serviceAnimation):
2213         (WebCore::ScrollAnimation::ScrollAnimation):
2214         * platform/ScrollAnimationSmooth.cpp: Added.
2215         (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
2216         (WebCore::ScrollAnimationSmooth::scroll):
2217         (WebCore::ScrollAnimationSmooth::stop):
2218         (WebCore::ScrollAnimationSmooth::updateVisibleLengths):
2219         (WebCore::ScrollAnimationSmooth::setCurrentPosition):
2220         (WebCore::ScrollAnimationSmooth::serviceAnimation):
2221         (WebCore::ScrollAnimationSmooth::~ScrollAnimationSmooth):
2222         (WebCore::curveAt):
2223         (WebCore::attackCurve):
2224         (WebCore::releaseCurve):
2225         (WebCore::coastCurve):
2226         (WebCore::curveIntegralAt):
2227         (WebCore::attackArea):
2228         (WebCore::releaseArea):
2229         (WebCore::getAnimationParametersForGranularity):
2230         (WebCore::ScrollAnimationSmooth::updatePerAxisData):
2231         (WebCore::ScrollAnimationSmooth::animateScroll):
2232         (WebCore::ScrollAnimationSmooth::animationTimerFired):
2233         (WebCore::ScrollAnimationSmooth::startNextTimer):
2234         (WebCore::ScrollAnimationSmooth::animationTimerActive):
2235         * platform/ScrollAnimationSmooth.h: Added.
2236         * platform/ScrollAnimator.cpp:
2237         (WebCore::ScrollAnimator::scroll):
2238         (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):
2239         (WebCore::ScrollAnimator::setCurrentPosition):
2240         (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset):
2241         (WebCore::ScrollAnimator::notifyPositionChanged):
2242         (WebCore::ScrollAnimator::scrollOffsetOnAxis):
2243         * platform/ScrollAnimator.h:
2244         (WebCore::ScrollAnimator::ScrollAnimator::currentPosition):
2245         * platform/ScrollAnimatorNone.cpp: Removed.
2246         * platform/ScrollAnimatorNone.h: Removed.
2247         * platform/ScrollAnimatorSmooth.cpp: Added.
2248         (WebCore::ScrollAnimator::create):
2249         (WebCore::ScrollAnimatorSmooth::ScrollAnimatorSmooth):
2250         (WebCore::ScrollAnimatorSmooth::~ScrollAnimatorSmooth):
2251         (WebCore::ScrollAnimatorSmooth::scroll):
2252         (WebCore::ScrollAnimatorSmooth::scrollToOffsetWithoutAnimation):
2253         (WebCore::ScrollAnimatorSmooth::cancelAnimations):
2254         (WebCore::ScrollAnimatorSmooth::serviceScrollAnimations):
2255         (WebCore::ScrollAnimatorSmooth::willEndLiveResize):
2256         (WebCore::ScrollAnimatorSmooth::didAddVerticalScrollbar):
2257         (WebCore::ScrollAnimatorSmooth::didAddHorizontalScrollbar):
2258         * platform/ScrollAnimatorSmooth.h: Added.
2259         * platform/mac/ScrollAnimatorMac.mm:
2260         (WebCore::ScrollAnimatorMac::immediateScrollToPosition):
2261         (WebCore::ScrollAnimatorMac::immediateScrollBy):
2262
2263 2016-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2264
2265         Overlay scrollbars should always use the whole contents
2266         https://bugs.webkit.org/show_bug.cgi?id=153352
2267
2268         Reviewed by Michael Catanzaro.
2269
2270         In case of having both horizontal and vertical scrollbars, the
2271         scrollbars respect the scroll corner. That looks good for legacy
2272         scrollbars that show the track, but with the overlay indicators
2273         it looks weird that the indicator stops so early before the end of
2274         the contents, giving the impression that there's something else to
2275         scroll. This happens because the scroll corner is transparent, so
2276         it's not obvious that's the scroll corner. It also happens with
2277         the text areas having a resizer. Legacy scrollbars take into
2278         account the resizer, which is good, but I expect overlay
2279         scrollbars to be rendered also over the resizer. The resizer takes
2280         precedence so you can still click and drag to resize the text area.
2281         In the case of main frame scrollbars we are indeed returning an
2282         empty rectangle from ScrollView::scrollCornerRect() when using
2283         overlay scrollbars, but when calculating the size of the
2284         scrollbars we are using the actual width/height instead of the
2285         occupied with/height. For other scrollbars
2286         RenderLayer::scrollCornerRect() is not checking whether scrollbars
2287         are overlay or not and we are always returning a scroll corner
2288         rectangle when scrollbars are present.
2289
2290         * platform/ScrollView.cpp:
2291         (WebCore::ScrollView::updateScrollbars): Use the occupied
2292         width/height when calculating the space the one scrollbar
2293         should leave for the other.
2294         * rendering/RenderLayer.cpp:
2295         (WebCore::RenderLayer::scrollCornerRect): Return an empty
2296         rectangle when using overlay scrollbars.
2297
2298 2016-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2299
2300         ScrollAnimator is not notified when mouse entered, moved or exited a RenderListBox
2301         https://bugs.webkit.org/show_bug.cgi?id=153398
2302
2303         Reviewed by Michael Catanzaro.
2304
2305         EvenHandler is checking whether the enclosing layer of a node is
2306         registered as scrollable area of its frame view. That doesn't work
2307         for list boxes, because they are the scrollable area
2308         themselves. Also when entering a list box the node under mouse is
2309         not usually the list box itself, but any of its children, a
2310         HTMLOptionElement or a HTMLOptGroupElement. Instead of comparing
2311         layers, we should find the enclosing scrollable area of the target
2312         elements and compare them to decide whether the mouse has entered,
2313         left or moved a scrollable area.
2314
2315         * page/EventHandler.cpp:
2316         (WebCore::enclosingScrollableArea): Return the enclosing
2317         scrollable area of the given node. If the node doesn't have a
2318         renderer, it traverses its parents. If the renderer is a
2319         RenderListBox it is returned, otherwhise the enclosing layer is
2320         returned.
2321         (WebCore::EventHandler::mouseMoved): Use enclosingScrollableArea.
2322         (WebCore::EventHandler::updateMouseEventTargetNode): Ditto.
2323
2324 2016-01-26  Sam Weinig  <sam@webkit.org>
2325
2326         Try touching DerivedSources.make to force rebuilding.
2327
2328         * DerivedSources.make:
2329         * page/DOMWindow.idl:
2330
2331 2016-01-26  Sam Weinig  <sam@webkit.org>
2332
2333         Try to force a rebuild.
2334
2335         * page/DOMWindow.idl:
2336
2337 2016-01-26  Chris Dumez  <cdumez@apple.com>
2338
2339         fast/history/page-cache-webdatabase-no-transaction-db.html flakily crashes
2340         https://bugs.webkit.org/show_bug.cgi?id=153525
2341
2342         Reviewed by Andreas Kling.
2343
2344         The test was crashing because DatabaseThread::hasPendingDatabaseActivity()
2345         was accessing m_openDatabaseSet from the main thread without any locking
2346         mechanism. This is an issue because m_openDatabaseSet is altered by the
2347         database thread.
2348
2349         No new tests, already covered by fast/history/page-cache-webdatabase-no-transaction-db.html.
2350
2351         * Modules/webdatabase/DatabaseThread.cpp:
2352         (WebCore::DatabaseThread::databaseThread):
2353         (WebCore::DatabaseThread::recordDatabaseOpen):
2354         (WebCore::DatabaseThread::recordDatabaseClosed):
2355         (WebCore::DatabaseThread::hasPendingDatabaseActivity):
2356         * Modules/webdatabase/DatabaseThread.h:
2357
2358 2016-01-26  Joseph Pecoraro  <pecoraro@apple.com>
2359
2360         Unreviewed CMake build fix after r195644.
2361
2362         * PlatformMac.cmake:
2363
2364 2016-01-26  Brady Eidson  <beidson@apple.com>
2365
2366         Modern IDB: Key generator support for SQLite backend.
2367         https://bugs.webkit.org/show_bug.cgi?id=153427
2368
2369         Reviewed by Alex Christensen.
2370
2371         No new tests (Existing failing tests now pass, others improved).
2372
2373         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2374         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
2375         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
2376         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
2377         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
2378         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
2379         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2380
2381 2016-01-26  Simon Fraser  <simon.fraser@apple.com>
2382
2383         Allow canvas to use display-list drawing for testing
2384         https://bugs.webkit.org/show_bug.cgi?id=153475
2385
2386         Reviewed by Dean Jackson.
2387
2388         Optionally have 2D <canvas> use display-list drawing, which is only enabled
2389         via Internals for now.
2390
2391         Support displayListAsText() and replayDisplayListAsText() on canvas, so we can
2392         use it to test playback optimizations. [Note that displayListAsText() always
2393         returns an empty string currently, because the display list is cleared when the
2394         canvas is painted to the page.]
2395
2396         Display list rendering is implemented by giving CanvasRenderingContext2D an
2397         optional DisplayListDrawingContext, which packages up a display list, recorder
2398         and recording context. The existing paintRenderingResultsToCanvas() is overridden
2399         to replay the recorded display list into the primary canvas context.
2400
2401         Tracked replay display lists are stored in a static map, keyed by the CanvasRenderingContext2D.
2402
2403         Test: displaylists/canvas-display-list.html
2404
2405         * html/HTMLCanvasElement.cpp:
2406         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
2407         (WebCore::HTMLCanvasElement::getContext):
2408         (WebCore::HTMLCanvasElement::paint):
2409         (WebCore::HTMLCanvasElement::setUsesDisplayListDrawing):
2410         (WebCore::HTMLCanvasElement::setTracksDisplayListReplay):
2411         (WebCore::HTMLCanvasElement::displayListAsText):
2412         (WebCore::HTMLCanvasElement::replayDisplayListAsText):
2413         * html/HTMLCanvasElement.h:
2414         * html/canvas/CanvasRenderingContext.h:
2415         * html/canvas/CanvasRenderingContext2D.cpp:
2416         (WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
2417         (WebCore::contextDisplayListMap):
2418         (WebCore::CanvasRenderingContext2D::~CanvasRenderingContext2D):
2419         (WebCore::CanvasRenderingContext2D::setTracksDisplayListReplay):
2420         (WebCore::CanvasRenderingContext2D::displayListAsText):
2421         (WebCore::CanvasRenderingContext2D::replayDisplayListAsText):
2422         (WebCore::CanvasRenderingContext2D::paintRenderingResultsToCanvas):
2423         (WebCore::CanvasRenderingContext2D::drawingContext):
2424         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D): Deleted.
2425         * html/canvas/CanvasRenderingContext2D.h:
2426         * testing/Internals.cpp:
2427         (WebCore::Internals::setElementUsesDisplayListDrawing):
2428         (WebCore::Internals::setElementTracksDisplayListReplay):
2429         (WebCore::Internals::displayListForElement):
2430         (WebCore::Internals::replayDisplayListForElement):
2431
2432 2016-01-26  Joseph Pecoraro  <pecoraro@apple.com>
2433
2434         Generalize ResourceUsageData gathering to be used outside of ResourceUsageOverlay
2435         https://bugs.webkit.org/show_bug.cgi?id=153509
2436         <rdar://problem/24354291>
2437
2438         Reviewed by Andreas Kling.
2439
2440         * CMakeLists.txt:
2441         * PlatformMac.cmake:
2442         * WebCore.xcodeproj/project.pbxproj:
2443         * page/Page.cpp:
2444         * page/Page.h:
2445         * page/Settings.cpp:
2446         * page/Settings.h:
2447         * page/ResourceUsageOverlay.cpp:
2448         * page/ResourceUsageOverlay.h:
2449         Add new files to the build and updated ENABLE flag name.
2450
2451         * page/ResourceUsageData.cpp: Added.
2452         (WebCore::ResourceUsageData::ResourceUsageData):
2453         * page/ResourceUsageData.h: Added.
2454         (WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
2455         Platform agnostic resource data that may be used by multiple clients,
2456         such as the ResourceUsageOverlay and later the Inspector.
2457
2458         * page/ResourceUsageThread.h: Added.
2459         * page/ResourceUsageThread.cpp: Added.
2460         (WebCore::ResourceUsageThread::ResourceUsageThread):
2461         (WebCore::ResourceUsageThread::singleton):
2462         (WebCore::ResourceUsageThread::addObserver):
2463         (WebCore::ResourceUsageThread::removeObserver):
2464         (WebCore::ResourceUsageThread::waitUntilObservers):
2465         (WebCore::ResourceUsageThread::notifyObservers):
2466         (WebCore::ResourceUsageThread::createThreadIfNeeded):
2467         (WebCore::ResourceUsageThread::threadCallback):
2468         (WebCore::ResourceUsageThread::threadBody):
2469         Platform agnostic resource usage thread that can be used to gather data
2470         into a ResourceUsageData struct on a background thread and notify observers
2471         on the main thread. Platforms need only implement ResourceUsageThread::platformThreadBody
2472         to populate the ResourceUsageData struct with data.
2473
2474         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2475         (WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo):
2476         (WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
2477         (WebCore::historicUsageData):
2478         (WebCore::appendDataToHistory):
2479         (WebCore::ResourceUsageOverlay::platformInitialize):
2480         (WebCore::ResourceUsageOverlay::platformDestroy):
2481         (WebCore::drawMemHistory):
2482         (WebCore::drawMemoryPie):
2483         (WebCore::ResourceUsageOverlay::platformDraw):
2484         Move CPU and memory resource usage calculations to ResourceUsageThread.
2485         The overlay adds itself as an observer, and builds its RingBuffer list
2486         of data from notifications from the ResourceUsageThread. Renamed
2487         some of the fields.
2488
2489         * page/cocoa/ResourceUsageThreadCocoa.mm: Added.
2490         (WebCore::vmPageSize):
2491         (WebCore::TagInfo::TagInfo):
2492         (WebCore::pagesPerVMTag):
2493         (WebCore::cpuUsage):
2494         (WebCore::categoryForVMTag):
2495         (WebCore::ResourceUsageThread::platformThreadBody):
2496         Extracted from ResourceUsageOverlayCocoa.
2497
2498         * page/scrolling/ScrollingThread.cpp:
2499         (WebCore::ScrollingThread::dispatch):
2500         Drive-by, don't call singleton again, we already have the result.
2501
2502 2016-01-26  Simon Fraser  <simon.fraser@apple.com>
2503
2504         Use initializers in HTMLCanvasElement
2505         https://bugs.webkit.org/show_bug.cgi?id=153472
2506
2507         Reviewed by Michael Catanzaro.
2508
2509         Use initializers, and re-order member variables for better packing.
2510
2511         * html/HTMLCanvasElement.cpp:
2512         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
2513         * html/HTMLCanvasElement.h:
2514
2515 2016-01-26  Chris Dumez  <cdumez@apple.com>
2516
2517         Setting HTMLInputElement.value to null to set its value to the empty string
2518         https://bugs.webkit.org/show_bug.cgi?id=153519
2519
2520         Reviewed by Ryosuke Niwa.
2521
2522         Setting HTMLInputElement.value to null to set its value to the empty string:
2523         - https://html.spec.whatwg.org/#htmlinputelement
2524         - http://heycam.github.io/webidl/#TreatNullAs
2525
2526         WebKit would previously unset the value attribute instead, which caused
2527         it to fallback to input.defaultValue if set.
2528
2529         Firefox and Chrome behave correctly.
2530
2531         Test: fast/dom/HTMLInputElement/input-value-set-null.html
2532
2533         * html/HTMLInputElement.cpp:
2534         (WebCore::HTMLInputElement::setValue):
2535
2536 2016-01-26  Anders Carlsson  <andersca@apple.com>
2537
2538         WebKitAdditions should be able to modify derived source rules
2539         https://bugs.webkit.org/show_bug.cgi?id=153514
2540
2541         Reviewed by Tim Horton.
2542
2543         * DerivedSources.make:
2544         Include WebCoreDerivedSourcesAdditions.make.
2545
2546         * WebCore.xcodeproj/project.pbxproj:
2547         Pass our WebKitAdditions paths as include paths to make.
2548
2549 2016-01-26  Chris Dumez  <cdumez@apple.com>
2550
2551         document.open() / write() should be prevented in beforeunload event handlers
2552         https://bugs.webkit.org/show_bug.cgi?id=153432
2553
2554         Reviewed by Ryosuke Niwa.
2555
2556         document.open() / write() should be prevented in beforeunload event handlers:
2557         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
2558         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
2559         - https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
2560         - https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document
2561
2562         Test: fast/frames/page-beforeunload-document-open.html
2563
2564         * loader/FrameLoader.cpp:
2565         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
2566
2567 2016-01-26  Chris Dumez  <cdumez@apple.com>
2568
2569         Add support for HTMLDataElement
2570         https://bugs.webkit.org/show_bug.cgi?id=153459
2571
2572         Reviewed by Ryosuke Niwa.
2573
2574         Add support for HTMLDataElement:
2575         https://html.spec.whatwg.org/multipage/semantics.html#the-data-element
2576
2577         Firefox already supports it.
2578
2579         No new tests, already covered by existing tests.
2580
2581         * CMakeLists.txt:
2582         * DerivedSources.cpp:
2583         * DerivedSources.make:
2584         * WebCore.vcxproj/WebCore.vcxproj:
2585         * WebCore.vcxproj/WebCore.vcxproj.filters:
2586         * WebCore.xcodeproj/project.pbxproj:
2587         * html/HTMLDataElement.cpp: Added.
2588         (WebCore::HTMLDataElement::create):
2589         (WebCore::HTMLDataElement::HTMLDataElement):
2590         * html/HTMLDataElement.h: Added.
2591         * html/HTMLDataElement.idl: Added.
2592         * html/HTMLElementsAllInOne.cpp:
2593         * html/HTMLTagNames.in:
2594
2595 2016-01-26  Commit Queue  <commit-queue@webkit.org>
2596
2597         Unreviewed, rolling out r195610.
2598         https://bugs.webkit.org/show_bug.cgi?id=153513
2599
2600         The test added with this change is timing out on almost every
2601         run (Requested by ryanhaddad on #webkit).
2602
2603         Reverted changeset:
2604
2605         "Calling video.controls=true during a scrub operation cancels
2606         scrub."
2607         https://bugs.webkit.org/show_bug.cgi?id=153494
2608         http://trac.webkit.org/changeset/195610
2609
2610 2016-01-26  Brady Eidson  <beidson@apple.com>
2611
2612         History.pushState causes intense memory pressure.
2613         https://bugs.webkit.org/show_bug.cgi?id=153435
2614
2615         Reviewed by Sam Weinig, Oliver Hunt, and Geoff Garen.
2616
2617         Tests: fast/loader/stateobjects/pushstate-frequency-iframe.html
2618                fast/loader/stateobjects/pushstate-frequency-with-user-gesture.html
2619                fast/loader/stateobjects/pushstate-frequency.html
2620                fast/loader/stateobjects/replacestate-frequency-iframe.html
2621                fast/loader/stateobjects/replacestate-frequency-with-user-gesture.html
2622                fast/loader/stateobjects/replacestate-frequency.html
2623                loader/stateobjects/pushstate-size-iframe.html
2624                loader/stateobjects/pushstate-size.html
2625                loader/stateobjects/replacestate-size-iframe.html
2626                loader/stateobjects/replacestate-size.html
2627
2628         Add restrictions on how frequently push/replaceState can be called,
2629         as well as how much of a cumulative payload they can deliver.
2630         
2631         * bindings/js/JSHistoryCustom.cpp:
2632         (WebCore::JSHistory::pushState):
2633         (WebCore::JSHistory::replaceState):
2634         
2635         * page/History.cpp:
2636         (WebCore::History::stateObjectAdded):
2637         * page/History.h:
2638
2639 2016-01-26  Anders Carlsson  <andersca@apple.com>
2640
2641         Add a Dictionary overload that returns an Optional result
2642         https://bugs.webkit.org/show_bug.cgi?id=153507
2643
2644         Reviewed by Tim Horton.
2645
2646         * bindings/js/Dictionary.h:
2647         (WebCore::Dictionary::get):
2648
2649 2016-01-26  Philip Rogers  <pdr@chromium.org>
2650
2651         Let SVG images not taint canvases except when containing foreignObjects
2652         https://bugs.webkit.org/show_bug.cgi?id=119639
2653
2654         Reviewed by Brent Fulgham.
2655
2656         r153876 caused SVG images to not taint canvases but the patch allowed
2657         for subimage resources. This can be a problem if a subimage (e.g., data
2658         uri image) contains a foreignObject which can violate security (e.g.,
2659         visited links).
2660
2661         This patch updates SVGImage::hasSingleSecurityOrigin to check if the
2662         image contains any foreignObjects or images that themselves contain
2663         foreignObjects. SVG images without foreignObjects are allowed to not
2664         taint canvases.
2665
2666         Canvas patterns are problematic because an animated SVG image can switch
2667         between tainting and not tainting the canvas. A FIXME has been added to
2668         solve this, and in the meantime we cause SVG images to taint patterns.
2669
2670         Tests: svg/as-image/svg-canvas-pattern-with-link-tainted.html
2671                svg/as-image/svg-canvas-svg-with-feimage-with-link-tainted.html
2672                svg/as-image/svg-canvas-svg-with-image-with-link-tainted.html
2673
2674         * html/canvas/CanvasPattern.cpp:
2675         (WebCore::CanvasPattern::CanvasPattern):
2676         (WebCore::CanvasPattern::~CanvasPattern):
2677         * svg/SVGFEImageElement.cpp:
2678         (WebCore::SVGFEImageElement::~SVGFEImageElement):
2679         (WebCore::SVGFEImageElement::hasSingleSecurityOrigin):
2680         (WebCore::SVGFEImageElement::clearResourceReferences):
2681         * svg/SVGFEImageElement.h:
2682         * svg/SVGImageElement.cpp:
2683         (WebCore::SVGImageElement::create):
2684         (WebCore::SVGImageElement::hasSingleSecurityOrigin):
2685         (WebCore::SVGImageElement::isSupportedAttribute):
2686         * svg/SVGImageElement.h:
2687         * svg/graphics/SVGImage.cpp:
2688         (WebCore::SVGImage::hasSingleSecurityOrigin):
2689
2690 2016-01-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2691
2692         CSSGrammar.y:1742.31-34: warning: unused value: $3
2693         https://bugs.webkit.org/show_bug.cgi?id=153462
2694
2695         Reviewed by Alex Christensen.
2696
2697         This warning indicates that we have a memory leak. From the bison manual:
2698
2699         "Right-hand side symbols of a rule that explicitly triggers a syntax error via YYERROR are
2700         not discarded automatically. As a rule of thumb, destructors are invoked only when user
2701         actions cannot manage the memory."
2702
2703         Arguably a design error, but that's how it is.
2704
2705         * css/CSSGrammar.y.in:
2706
2707 2016-01-26  Jer Noble  <jer.noble@apple.com>
2708
2709         Calling video.controls=true during a scrub operation cancels scrub.
2710         https://bugs.webkit.org/show_bug.cgi?id=153494
2711
2712         Reviewed by Eric Carlson.
2713
2714         Test: media/media-controls-drag-timeline-set-controls-property.html
2715
2716         Verify that the video.controls attribute actually changed before tearing down and
2717         re-adding the media controls to the Shadow DOM.
2718
2719         * Modules/mediacontrols/mediaControlsApple.js:
2720         (Controller.prototype.handleControlsChange):
2721         (Controller.prototype.hasControls):
2722
2723 2016-01-26  Jeremy Noble  <jer.noble@apple.com>
2724
2725         [EME][Mac] Crash in [AVStreamSession addStreamDataParser:]; uncaught exception
2726         https://bugs.webkit.org/show_bug.cgi?id=153495
2727
2728         Reviewed by Eric Carlson.
2729
2730         When AVContentKeySession is not available, fall back to pre-AVContentKeySession behavior;
2731         namely, immediately create an AVStreamSession object in
2732         willProvideContentKeyRequestInitializationData, rather than waiting for didProvide.
2733
2734         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2735         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
2736
2737 2016-01-26  Dean Jackson  <dino@apple.com>
2738
2739         [iOS] Documents without an explicit width should not get fast tapping
2740         https://bugs.webkit.org/show_bug.cgi?id=153465
2741         <rdar://problem/23962529>
2742
2743         Reviewed by Simon Fraser (and Wenson Hseih).
2744
2745         As the title says, documents that do not set a viewport should
2746         not get the fast click behaviour. There were complaints that we broke
2747         double-tap to scroll in ImageDocuments where the image was narrow and long.
2748
2749         The fix is to just keep a flag that tells the UI process if the
2750         width was explicit. However, it turns out that those ImageDocuments
2751         are given an explicit device-width, which is fine for scaling but
2752         really should behave as auto for fast tapping. So we also need
2753         to tell the UIProcess if the viewport arguments came from an
2754         ImageDocument.
2755
2756         Test: fast/events/ios/viewport-no-width-value-allows-double-tap.html
2757
2758         * dom/ViewportArguments.cpp:
2759         (WebCore::findSizeValue): Add a parameter that toggles a flag
2760         if the size was explicitly set.
2761         (WebCore::setViewportFeature): Remember if the width was
2762         explicit.
2763         * dom/ViewportArguments.h: Add a widthWasExplicit flag.
2764         (WebCore::ViewportArguments::operator==):
2765
2766 2016-01-25  Dave Hyatt  <hyatt@apple.com>
2767
2768         Speculative fixes for crashing in viewportChangeAffectedPicture
2769         https://bugs.webkit.org/show_bug.cgi?id=153450
2770
2771         Reviewed by Dean Jackson.
2772
2773         Don't attach any conditions to the removal of a picture element from
2774         the document's HashSet. This ensures that if the condition is ever
2775         wrong for any reason, we'll still remove the picture element on
2776         destruction.
2777
2778         Fix the media query evaluation to match the other evaluations (used by
2779         the preload scanner and HTMLImageElement). This includes using the
2780         document element's computed style instead of our own and also null
2781         checking the document element first. This is the likely cause of the
2782         crashes.
2783
2784         * html/HTMLPictureElement.cpp:
2785         (WebCore::HTMLPictureElement::~HTMLPictureElement):
2786         (WebCore::HTMLPictureElement::didMoveToNewDocument):
2787         (WebCore::HTMLPictureElement::viewportChangeAffectedPicture):
2788
2789 2016-01-26  Chris Dumez  <cdumez@apple.com>
2790
2791         Make sure a page is still PageCache-able after firing the 'pagehide' events
2792         https://bugs.webkit.org/show_bug.cgi?id=153449
2793
2794         Reviewed by Andreas Kling.
2795
2796         Make sure a page is still PageCache-able after firing the 'pagehide'
2797         events and abort if it isn't. This should improve robustness and it is
2798         easy for pagehide event handlers to do things that would make a Page no
2799         longer PageCache-able and this leads to bugs that are difficult to
2800         investigate.
2801
2802         To achieve this, the 'pagehide' event firing logic was moved out of the
2803         CachedFrame constructor. It now happens earlier in
2804         PageCache::addIfCacheable() after checking if the page is cacheable and
2805         before constructing the CachedPage / CachedFrames. After firing the
2806         'pagehide' event in PageCache::addIfCacheable(), we check again that
2807         the page is still cacheable and we abort early if it is not.
2808
2809         * history/CachedFrame.cpp:
2810         (WebCore::CachedFrame::CachedFrame):
2811         * history/PageCache.cpp:
2812         (WebCore::setInPageCache):
2813         (WebCore::firePageHideEventRecursively):
2814         (WebCore::PageCache::addIfCacheable):
2815         * history/PageCache.h:
2816         * loader/FrameLoader.cpp:
2817         (WebCore::FrameLoader::commitProvisionalLoad):
2818
2819 2016-01-26  Beth Dakin  <bdakin@apple.com>
2820
2821         Rubber-stamped by Tim Horton.
2822
2823         Add one more bit of SPI.
2824         * platform/spi/mac/NSSpellCheckerSPI.h:
2825
2826 2016-01-26  Olivier Blin  <olivier.blin@softathome.com>
2827
2828         Fix build with ENABLE_DEVICE_ORIENTATION on non-iOS platforms
2829         https://bugs.webkit.org/show_bug.cgi?id=153490
2830
2831         Reviewed by Michael Catanzaro.
2832
2833         This has been broken since r178702, which changed the Page
2834         argument from a pointer to a reference in logCanCachePageDecision().
2835
2836         No new tests since this is a build fix.
2837
2838         * history/PageCache.cpp:
2839         (WebCore::canCachePage):
2840
2841 2016-01-25  Ada Chan  <adachan@apple.com>
2842
2843         Move WebVideoFullscreenManager and related classes from iOS specific folders to cocoa folders
2844         https://bugs.webkit.org/show_bug.cgi?id=153473
2845
2846         Reviewed by Eric Carlson.
2847
2848         No new tests, just moving files.
2849
2850         * WebCore.xcodeproj/project.pbxproj:
2851         Update due to changes to the file locations.
2852         * platform/cocoa/WebVideoFullscreenModel.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModel.h.
2853         * platform/cocoa/WebVideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h.
2854         (WebCore::WebVideoFullscreenModelVideoElement::create):
2855         Fix a style error by moving the opening curly brace down one line.
2856         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm.
2857
2858 2016-01-26  Konstantin Tokarev  <annulen@yandex.ru>
2859
2860         Do not convert GlyphBufferAdvance to FloatSize
2861         https://bugs.webkit.org/show_bug.cgi?id=153429
2862
2863         GlyphBufferAdvance is not necessaryly convertible to FloatSize.
2864         Also, this code was doing extra work by transforming height value.
2865
2866         Reviewed by Antti Koivisto.
2867
2868         No new tests needed.
2869
2870         * rendering/svg/SVGTextRunRenderingContext.cpp:
2871         (WebCore::SVGGlyphToPathTranslator::extents):
2872
2873 2016-01-22  Ada Chan  <adachan@apple.com>
2874
2875         Enable API related to the video fullscreen layer in MediaPlayerPrivateAVFoundationObjC
2876         also on Mac with video presentation mode support.
2877         https://bugs.webkit.org/show_bug.cgi?id=153222
2878
2879         Reviewed by Eric Carlson.
2880
2881         No new tests. Covered by existing tests.
2882
2883         Introduce VideoFullscreenLayerManager to deal with the video layer when switching
2884         between inline and fullscreen mode. We'll reuse it in other MediaPlayerPrivateInterface
2885         implementations.
2886
2887         Now that MediaPlayerPrivateAVFoundationObjC's platform layer can be a WebVideoContainerLayer,
2888         this exposes a bug in PlatformCALayerCocoa::clone() where we assumed the platform layer
2889         is always an AVPlayerLayer if the PlatformCALayer's layer type is LayerTypeAVPlayerLayer.
2890         Add a helper method to get an AVPlayerLayer from a PlatformCALayerCocoa (which also handles
2891         WebVideoContainerLayer case) and use it in PlatformCALayerCocoa::clone().
2892
2893         * WebCore.xcodeproj/project.pbxproj:
2894         Add VideoFullscreenLayerManager to the project.
2895
2896         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2897         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2898         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2899         Create m_videoFullscreenLayerManager. The video inline layer, video fullscreen layer,
2900         and the video fullscreen frame are now managed by that class.
2901         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
2902         Just call VideoFullscreenLayerManager::setVideoLayer() to handle adding the video
2903         layer in either the inline or fullscreen layer.
2904         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
2905         Call VideoFullscreenLayerManager::didDestroyVideoLayer().
2906         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer):
2907         Get the video inline layer from VideoFullscreenLayerManager.
2908         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2909         Call VideoFullscreenLayerManager::setVideoFullscreenLayer().
2910         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
2911         Call VideoFullscreenLayerManager::setVideoFullscreenFrame().
2912         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
2913         Guard the iOS specific code properly.
2914         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
2915         Get the video fullscreen layer from VideoFullscreenLayerManager.
2916         (WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation):
2917         Ditto.
2918         (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
2919         Get the video fullscreen layer and video fullscreen frame from VideoFullscreenLayerManager.
2920         (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
2921         Get the video fullscreen layer from VideoFullscreenLayerManager.
2922
2923         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h: Added.
2924         (WebCore::VideoFullscreenLayerManager::videoInlineLayer):
2925         (WebCore::VideoFullscreenLayerManager::videoFullscreenLayer):
2926         (WebCore::VideoFullscreenLayerManager::videoFullscreenFrame):
2927         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm: Added.
2928         (-[WebVideoContainerLayer setBounds:]):
2929         (-[WebVideoContainerLayer setPosition:]):
2930         WebVideoContainerLayer was moved from MediaPlayerPrivateAVFoundationObjC.mm.
2931         (WebCore::VideoFullscreenLayerManager::create):
2932         (WebCore::VideoFullscreenLayerManager::VideoFullscreenLayerManager):
2933         (WebCore::VideoFullscreenLayerManager::setVideoLayer):
2934         Code moved from MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer().
2935         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
2936         Code moved from MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer().
2937         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenFrame):
2938         Code moved from MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame().
2939         (WebCore::VideoFullscreenLayerManager::didDestroyVideoLayer):
2940         Code moved from MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer().
2941
2942         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2943         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2944         (PlatformCALayerCocoa::clone):
2945         Use the new PlatformCALayerCocoa::avPlayerLayer() method to get the AVPlayerLayer from both the
2946         destination and source PlatformCALayers.
2947         (PlatformCALayerCocoa::avPlayerLayer):
2948         Return nil if the layer type is not LayerTypeAVPlayerLayer. Otherwise, return the
2949         platform layer if it is indeed an AVPlayerLayer. If not, it should be a WebVideoContainerLayer
2950         and we should return its sublayer which should be an AVPlayerLayer.
2951
2952 2016-01-26  Chris Dumez  <cdumez@apple.com>
2953
2954         First parameter to window.showModalDialog() should be mandatory
2955         https://bugs.webkit.org/show_bug.cgi?id=153436
2956
2957         Reviewed by Youenn Fablet.
2958
2959         Make window.showModalDialog()'s first parameter mandatory to match the
2960         last specification containing it:
2961         http://dev.w3.org/html5/spec-preview/user-prompts.html#dialogs-implemented-using-separate-documents
2962
2963         The new behavior also matches Firefox, while Chrome no longer supports
2964         this operation.
2965
2966         With this change, the W3C HTML test suite no longer hangs in the middle
2967         because it mistakenly pops up a modal dialog during testing.
2968
2969         Test: fast/dom/Window/showModalDialog-mandatory-parameter.html
2970
2971         * bindings/js/JSDOMWindowCustom.cpp:
2972         (WebCore::JSDOMWindow::showModalDialog):
2973
2974 2016-01-26  Eric Carlson  <eric.carlson@apple.com>
2975
2976         LayoutTest media/airplay-target-availability.html is flaky
2977         https://bugs.webkit.org/show_bug.cgi?id=153100
2978         <rdar://problem/24346796>
2979
2980         Reviewed by Daniel Bates.
2981
2982         No new tests, media/airplay-target-availability.html was updated
2983
2984         * Modules/mediasession/WebMediaSessionManager.cpp:
2985         (WebCore::WebMediaSessionManager::clientStateDidChange): Schedule a configuration scan if
2986           any of the config flags have changed.
2987         (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring): Update logging.
2988
2989 2016-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2990
2991         Main frame scrollbars not updated on hovering when using overlay scrollbars
2992         https://bugs.webkit.org/show_bug.cgi?id=153304
2993
2994         Reviewed by Michael Catanzaro.
2995
2996         Legacy scrollbars were fixed in r194155, but overlay scrollbars
2997         are not notified when they are hovered. This is because the layer
2998         hit test in RenderView::hitTest always returns true when using
2999         overlay scrollbars and we are returning early in such case,
3000         ignoring the HitTestRequest::AllowFrameScrollbars flag. So, in
3001         case of using overlay scrollbars we still need to check the
3002         RenderView scrollbars even when the layer hit test succeeded.
3003
3004         * rendering/RenderView.cpp:
3005         (WebCore::RenderView::hitTest):
3006
3007 2016-01-26  Daniel Bates  <dabates@apple.com>
3008
3009         LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html crashing
3010         https://bugs.webkit.org/show_bug.cgi?id=153250
3011         <rdar://problem/12172843>
3012         And
3013         <rdar://problem/24248040>
3014
3015         Reviewed by Alexey Proskuryakov.
3016
3017         Remove an incorrect assertion that the absolute URL associated with a protection space cannot
3018         contain consecutive forward slash (/) characters. A URL can contain consecutive forward slashes.
3019         This also makes the invariants for CredentialStorage::findDefaultProtectionSpaceForURL() symmetric
3020         with the invariants for WebCore::protectionSpaceMapKeyFromURL().
3021
3022         Tests: http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html
3023                http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html
3024
3025         * platform/network/CredentialStorage.cpp:
3026         (WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
3027
3028 2016-01-26  Daniel Bates  <dabates@apple.com>
3029
3030         Remove XMLHttpRequestException
3031         https://bugs.webkit.org/show_bug.cgi?id=102698
3032         <rdar://problem/24338476>
3033
3034         Reviewed by Chris Dumez.
3035
3036         Inspired by a patch by Erik Arvidsson.
3037
3038         As per <https://xhr.spec.whatwg.org> (21 January 2016) and <https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts> (25 January 2016)
3039         XMLHttpRequest and WorkerGlobalScope.importScripts() should throw a DOMException object instead
3040         of a XMLHttpRequestException object when a NetworkError, AbortError, or TimeoutError occur. This
3041         makes the behavior of WebKit more closely conform to these standards as well as the behavior of
3042         other browsers.
3043
3044         * CMakeLists.txt: Remove entries for XMLHttpRequestException.idl and XMLHttpRequestException.cpp.
3045         * DerivedSources.make: Remove entry for XMLHttpRequestException.idl.
3046         * WebCore.order: Remove exported symbols for XMLHttpRequestException.
3047         * WebCore.vcxproj/WebCore.vcxproj: Remove entries for JSXMLHttpRequestException.{cpp, h}, XMLHttpRequestException.{cpp, h}
3048         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
3049         * WebCore.xcodeproj/project.pbxproj: Ditto.
3050         * bindings/js/JSExceptionBase.cpp:
3051         (WebCore::toExceptionBase): Remove logic for XMLHttpRequestException.
3052         * dom/DOMExceptions.in: Remove entry for XMLHttpRequestException.
3053         * workers/WorkerGlobalScope.cpp:
3054         (WebCore::WorkerGlobalScope::importScripts): Throw DOMException.NETWORK_ERR instead of XMLHttpRequestException.NETWORK_ERR.
3055         * xml/XMLHttpRequest.cpp:
3056         (WebCore::XMLHttpRequest::createRequest): Ditto.
3057         (WebCore::XMLHttpRequest::didFail): Throw DOMException.ABORT_ERR instead of XMLHttpRequestException.ABORT_ERR.
3058         (WebCore::XMLHttpRequest::didReachTimeout): Throw DOMException.TIMEOUT_ERR instead of XMLHttpRequestException.TIMEOUT_ERR.
3059         * xml/XMLHttpRequestException.cpp: Removed.
3060         * xml/XMLHttpRequestException.h: Removed.
3061         * xml/XMLHttpRequestException.idl: Removed.
3062
3063 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3064
3065         WebCoreJSBuiltins do not use to do conditional include
3066         https://bugs.webkit.org/show_bug.cgi?id=153306
3067
3068         Reviewed by Alex Christensen.
3069
3070         Removing compilation guards as builtin generator adds them in the files themselves.
3071         Fixing MediaDevices.js to generate MEDIA_STREAM compilation guard.
3072
3073         No change in behavior.
3074
3075         * Modules/mediastream/MediaDevices.js: Changing @optional to @conditional.
3076         * Modules/mediastream/NavigatorUserMedia.js: Making it @conditional.
3077         * bindings/js/WebCoreJSBuiltins.cpp:
3078         * bindings/js/WebCoreJSBuiltins.h:
3079
3080 2016-01-25  Alex Christensen  <achristensen@webkit.org>
3081
3082         Fix internal Windows build
3083         https://bugs.webkit.org/show_bug.cgi?id=153469
3084
3085         Reviewed by Brent Fulgham.
3086
3087         * CMakeLists.txt:
3088         Pass the GPERF_EXECUTABLE that we found to perl scripts so they can use it instead of just calling gperf.
3089         This is needed for builds where gperf is not in the PATH.
3090         * DerivedSources.make:
3091         Pass "gperf" as the gperf command to retain existing functionality on mac.
3092         * bindings/scripts/preprocess-idls.pl:
3093         (CygwinPathIfNeeded):
3094         * bindings/scripts/preprocessor.pm:
3095         (applyPreprocessor):
3096         Add /cygdrive/c/cygwin/bin to the PATH before calling cygpath.
3097         This is needed for builds where we are using cygwin, but C:/cygwin/bin is not in the PATH.
3098         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
3099         * css/makeSelectorPseudoElementsMap.py:
3100         * css/makeprop.pl:
3101         * platform/network/create-http-header-name-table:
3102         Use the gperf executable passed in as a command line parameter if it is given.
3103
3104 2016-01-25  Simon Fraser  <simon.fraser@apple.com>
3105
3106         DisplayList items can log paths now
3107         https://bugs.webkit.org/show_bug.cgi?id=153417
3108
3109         Reviewed by Zalan Bujtas.
3110
3111         Now that Path supports TextStream logging, clean up its output a little and
3112         enable dumping of Paths in DisplayListItems.
3113
3114         * platform/graphics/Path.cpp:
3115         (WebCore::operator<<):
3116         * platform/graphics/displaylists/DisplayListItems.cpp:
3117         (WebCore::DisplayList::operator<<):
3118
3119 2016-01-25  Antti Koivisto  <antti@apple.com>
3120
3121         Fix the comment.
3122
3123         * rendering/style/RenderStyle.h:
3124
3125 2016-01-25  Enrica Casucci  <enrica@apple.com>
3126
3127         Add support for DataDetectors in WK (iOS).
3128         https://bugs.webkit.org/show_bug.cgi?id=152989
3129         rdar://problem/22855960
3130
3131         Reviewed by Tim Horton.
3132
3133         Adding new helper functions for data detection related tasks.
3134         The patch also fixes a bug when creating DOM ranges from DDQueryRange
3135         spanning multiple fragments.
3136
3137         * editing/cocoa/DataDetection.h:
3138         * editing/cocoa/DataDetection.mm:
3139         (WebCore::DataDetection::isDataDetectorLink):
3140         (WebCore::DataDetection::dataDetectorIdentifier):
3141         (WebCore::detectItemAtPositionWithRange):
3142         (WebCore::DataDetection::detectItemAroundHitTestResult):
3143         (WebCore::resultIsURL):
3144         (WebCore::removeResultLinksFromAnchor):
3145         (WebCore::searchForLinkRemovingExistingDDLinks):
3146         (WebCore::DataDetection::detectContentInRange):
3147
3148 2016-01-25  Myles C. Maxfield  <mmaxfield@apple.com>
3149
3150         Remove broken cache from CSSFontFaceSource
3151         https://bugs.webkit.org/show_bug.cgi?id=153440
3152
3153         Reviewed by Simon Fraser.
3154
3155         This cache has been broken since 2013 (r158085). Given we didn't notice a perf
3156         hit when it broke, and the fact it's been broken for years, it clearly isn't
3157         necessary.
3158
3159         https://bugs.webkit.org/show_bug.cgi?id=153414 consists of a fairly invasive
3160         change to CSSFontFaceSource; this patch includes a working version of this
3161         cache, along with an easy way to enable/disable it (to measure possible perf
3162         changes).
3163
3164         This patch is a short-term cleanup patch in the mean time until the above
3165         invasive change gets landed.
3166
3167         No new tests because there is no behavior (or performance!) change.
3168
3169         * css/CSSFontFaceSource.cpp:
3170         (WebCore::CSSFontFaceSource::font):
3171         (WebCore::CSSFontFaceSource::~CSSFontFaceSource): Deleted.
3172         (WebCore::CSSFontFaceSource::pruneTable): Deleted.
3173         (WebCore::CSSFontFaceSource::fontLoaded): Deleted.
3174         * css/CSSFontFaceSource.h:
3175
3176 2016-01-25  Sam Weinig  <sam@webkit.org>
3177
3178         Try to fix the simulator build.
3179
3180         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
3181
3182 2016-01-25  Sam Weinig  <sam@webkit.org>
3183
3184         Roll back in r195559 with a build fix.
3185
3186         * WebCore.xcodeproj/project.pbxproj:
3187         * editing/cocoa/DataDetection.mm:
3188         * platform/cocoa/DataDetectorsCoreSoftLink.mm: Added.
3189         * platform/cocoa/DataDetectorsCoreSoftLink.h: Added.
3190         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
3191
3192 2016-01-25  Commit Queue  <commit-queue@webkit.org>
3193
3194         Unreviewed, rolling out r195559.
3195         https://bugs.webkit.org/show_bug.cgi?id=153458
3196
3197         This change broke the iOS build (Requested by ryanhaddad on
3198         #webkit).
3199
3200         Reverted changeset:
3201
3202         "Fix the ASAN build."
3203         http://trac.webkit.org/changeset/195559
3204
3205 2016-01-25  Antti Koivisto  <antti@apple.com>
3206
3207         Resolving direction and writing mode properties should not mutate document
3208         https://bugs.webkit.org/show_bug.cgi?id=153446
3209
3210         Reviewed by Andreas Kling.
3211
3212         Replace directionSetOnDocumentElement/writingModeSetOnDocumentElement document flags them with style flags.
3213
3214         * css/StyleBuilderCustom.h:
3215         (WebCore::StyleBuilderCustom::applyValueDirection):
3216         (WebCore::StyleBuilderCustom::resetEffectiveZoom):
3217         (WebCore::StyleBuilderCustom::applyValueWebkitWritingMode):
3218         (WebCore::StyleBuilderCustom::applyValueWebkitTextOrientation):
3219         * css/StyleResolver.cpp:
3220         (WebCore::StyleResolver::styleForElement):
3221         * dom/Document.cpp:
3222         (WebCore::Document::Document):
3223         * dom/Document.h:
3224         (WebCore::Document::markers):
3225         (WebCore::Document::directionSetOnDocumentElement): Deleted.
3226         (WebCore::Document::writingModeSetOnDocumentElement): Deleted.
3227         (WebCore::Document::setDirectionSetOnDocumentElement): Deleted.
3228         (WebCore::Document::setWritingModeSetOnDocumentElement): Deleted.
3229         * rendering/RenderBox.cpp:
3230         (WebCore::RenderBox::styleDidChange):
3231         * rendering/style/RenderStyle.h:
3232         * style/StyleResolveForDocument.cpp:
3233         (WebCore::Style::resolveForDocument):
3234
3235 2016-01-25  Sam Weinig  <sam@webkit.org>
3236
3237         Fix the ASAN build.
3238
3239         * WebCore.xcodeproj/project.pbxproj:
3240         * editing/cocoa/DataDetection.mm:
3241         * platform/cocoa/DataDetectorsCoreSoftLink.mm: Added.
3242         * platform/cocoa/DataDetectorsCoreSoftLink.h: Added.
3243         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
3244
3245 2016-01-25  Alex Christensen  <achristensen@webkit.org>
3246
3247         [Win] Another build fix after r195545
3248
3249         * CMakeLists.txt:
3250         r195548 didn't change all the pre-builds back to post-builds.
3251
3252 2016-01-25  Alex Christensen  <achristensen@webkit.org>
3253
3254         [Win] Fix clean build after r195545.
3255
3256         * CMakeLists.txt:
3257         * PlatformWin.cmake:
3258         I got a little carried away.  WebCore already had a pre-build event.  It was correct before r195545.
3259
3260 2016-01-25  Beth Dakin  <bdakin@apple.com>
3261
3262         Handle soft spaces after accepted candidates
3263         https://bugs.webkit.org/show_bug.cgi?id=153331
3264         -and corresponding-
3265         rdar://problem/23958418
3266
3267         Reviewed by Darin Adler.
3268
3269         Candidates now come with built-in spaces, so we should not insert a space for 
3270         them.
3271         * editing/Editor.cpp:
3272         (WebCore::Editor::handleAcceptedCandidate):
3273
3274         New SPI to properly handle these soft spaces.
3275         * platform/spi/mac/NSSpellCheckerSPI.h:
3276
3277 2016-01-25  Alex Christensen  <achristensen@webkit.org>
3278
3279         [Win] Copy forwarding headers before building a project
3280         https://bugs.webkit.org/show_bug.cgi?id=153434
3281
3282         Reviewed by Brent Fulgham.
3283
3284         * CMakeLists.txt:
3285         * PlatformWin.cmake:
3286
3287 2016-01-25  Brady Eidson  <beidson@apple.com>
3288
3289         Modern IDB: Implement getIndexRecord in the SQLite backing store.
3290         https://bugs.webkit.org/show_bug.cgi?id=153425
3291
3292         Reviewed by Darin Adler.
3293
3294         No new tests (Some failures now pass, other failures progressed closer to passing).
3295
3296         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3297         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
3298
3299 2016-01-25  Eric Carlson  <eric.carlson@apple.com>
3300
3301         Media "ended" event incorrectly fires when currentTime is set
3302         https://bugs.webkit.org/show_bug.cgi?id=150348
3303         <rdar://problem/24247974>
3304
3305         Reviewed by Jer Noble.
3306
3307         Test: media/media-ended-fired-once.html
3308
3309         * html/HTMLMediaElement.cpp:
3310         (WebCore::HTMLMediaElement::invalidateCachedTime): Always mark m_cachedTime as invalid.
3311
3312 2016-01-25  Konstantin Tokarev  <annulen@yandex.ru>
3313
3314         Do not convert GlyphBufferAdvance to FloatSize
3315         https://bugs.webkit.org/show_bug.cgi?id=153421
3316
3317         Reviewed by Simon Fraser.
3318
3319         No new tests needed.
3320
3321         * platform/graphics/displaylists/DisplayListItems.cpp:
3322         (WebCore::DisplayList::DrawGlyphs::computeBounds):
3323
3324 2016-01-22  Ryosuke Niwa  <rniwa@webkit.org>
3325
3326         document.createElement should be able to create a custom element
3327         https://bugs.webkit.org/show_bug.cgi?id=153173
3328
3329         Reviewed by Darin Adler.
3330
3331         Added the support for constructing a custom element via document.createElement.
3332
3333         Extracted HTMLElementFactory::createKnownElement, which returns nullptr when the specified name doesn't match
3334         any builtin element instead of out of HTMLUnknownElement, out of HTMLElementFactory::createElement.
3335
3336         Test: fast/custom-elements/Document-createElement.html
3337
3338         * bindings/js/JSCustomElementInterface.cpp:
3339         (WebCore::JSCustomElementInterface::constructHTMLElement): Added. Constructs a custom element by invoking its
3340         constructor. We allow exceptions to be thrown by the constructor so the caller is responsible for checking
3341         any exceptions in the ExecState before preceeding if the returned value is null.
3342
3343         * bindings/js/JSCustomElementInterface.h:
3344         (WebCore::JSCustomElementInterface::constructSVGElement): Added.
3345         * bindings/js/JSElementCustom.cpp:
3346         (WebCore::toJSNewlyCreated): Exit early if the element is a custom element as the wrapper had already been
3347         created by super() call inside the custom element'c constructor.
3348
3349         * bindings/js/JSMainThreadExecState.h:
3350         (WebCore::JSMainThreadExecState):
3351         * bindings/js/JSMainThreadExecStateInstrumentation.h:
3352         (WebCore::JSMainThreadExecState::instrumentFunctionInternal): Generalized from instrumentFunctionCall so that
3353         we can use it for both call and construct.
3354         (WebCore::JSMainThreadExecState::instrumentFunctionCall): Specialized the above function for call.
3355         (WebCore::JSMainThreadExecState::instrumentFunctionConstruct): Ditto for construct.
3356
3357         * dom/CustomElementDefinitions.cpp:
3358         (WebCore::CustomElementDefinitions::findInterface): Added.
3359         * dom/CustomElementDefinitions.h:
3360
3361         * dom/Document.cpp:
3362         (WebCore::createHTMLElementWithNameValidation): Extracted from createElement.
3363         (WebCore::Document::createElementForBindings): Renamed from createElement. Specifies
3364         ShouldCreateCustomElement::Create to create a custom element before using fallback elements.
3365         * dom/Document.h:
3366         * dom/Document.idl:
3367
3368         * dom/Node.h:
3369         (WebCore::Node::isCustomElement): Added. This flag is used to identify a custom element.
3370         (WebCore::Node::setIsCustomElement): Added.
3371
3372         * dom/make_names.pl: Extracted createKnownElement from createElement for createHTMLElementWithNameValidation.
3373
3374         * inspector/InspectorCSSAgent.cpp:
3375         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Use qualified name object to instantiate
3376         a style element and set type content attribute.
3377         * inspector/InspectorDOMAgent.cpp:
3378         (WebCore::InspectorDOMAgent::setNodeName): Use createElementForBindings here since we might be creating an
3379         arbitrary element here. Also use RefPtr instead of raw pointers while mutating DOM for safety.
3380
3381 2016-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3382
3383         REGRESSION(r192773): [GTK] maps.google.com unresponsive/stalls since r192773
3384         https://bugs.webkit.org/show_bug.cgi?id=153194
3385
3386         Reviewed by Michael Catanzaro.
3387
3388         In r192773 we implemented the JavaScriptCore garbage collector
3389         timers for the GTK+ port. Those timers schedule sources in the
3390         current thread default main context, but JS web worker threads
3391         implementation doesn't use WTF::RunLoop, but its own WorkerRunLoop
3392         class that doesn't create a GMainContext for the new thread. This
3393         means that for web sites using workers, we are now doing garbage
3394         collection of worker VMs in the main thread which ends up in a
3395         deadlock at some point. We need to ensure that worker threads
3396         create a GMainContext and push it as the default one for the
3397         thread before the WorkerGlobalScope is created. This way when the
3398         worker Heap is created, the GC timers use the right context to
3399         schedule their sources. And then we need to check if there are
3400         sources pending in the thread main context on every worker run
3401         loop iteration.
3402
3403         * workers/WorkerRunLoop.cpp:
3404         (WebCore::WorkerRunLoop::runInMode):
3405         * workers/WorkerThread.cpp:
3406         (WebCore::WorkerThread::workerThread):
3407
3408 2016-01-25  Commit Queue  <commit-queue@webkit.org>
3409
3410         Unreviewed, rolling out r195533.
3411         https://bugs.webkit.org/show_bug.cgi?id=153423
3412
3413         It is again breaking builds of several ports (Requested by
3414         youenn on #webkit).
3415
3416         Reverted changeset:
3417
3418         "WebCoreJSBuiltins do not use to do conditional include"
3419         https://bugs.webkit.org/show_bug.cgi?id=153306
3420         http://trac.webkit.org/changeset/195533
3421
3422 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3423
3424         WebCoreJSBuiltins do not use to do conditional include
3425         https://bugs.webkit.org/show_bug.cgi?id=153306
3426
3427         Reviewed by Alex Christensen.
3428
3429         Removing compilation guards as builtin generator adds them in the files themselves.
3430         Fixing MediaDevices.js to generate MEDIA_STREAM compilation guard.
3431
3432         No change in behavior.
3433
3434         * Modules/mediastream/MediaDevices.js: Changing @optional to @conditional.
3435         * bindings/js/WebCoreJSBuiltins.cpp:
3436         * bindings/js/WebCoreJSBuiltins.h:
3437
3438 2016-01-25  Commit Queue  <commit-queue@webkit.org>
3439
3440         Unreviewed, rolling out r195531.
3441         https://bugs.webkit.org/show_bug.cgi?id=153420
3442
3443         It is breaking builds of several ports (Requested by youenn on
3444         #webkit).
3445
3446         Reverted changeset:
3447
3448         "WebCoreJSBuiltins do not use to do conditional include"
3449         https://bugs.webkit.org/show_bug.cgi?id=153306
3450         http://trac.webkit.org/changeset/195531
3451
3452 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3453
3454         WebCoreJSBuiltins do not use to do conditional include
3455         https://bugs.webkit.org/show_bug.cgi?id=153306
3456
3457         Reviewed by Alex Christensen.
3458
3459         Removing compilation guards as builtin generator adds them in the files themselves.
3460
3461         No change in behavior.
3462
3463         * bindings/js/WebCoreJSBuiltins.cpp:
3464         * bindings/js/WebCoreJSBuiltins.h:
3465
3466 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3467
3468         [Fetch API] Implement Fetch API Headers
3469         https://bugs.webkit.org/show_bug.cgi?id=152384
3470
3471         Reviewed by Darin Adler.
3472
3473         Adding Fetch Headers API as a wapper around HTTPHeaderMap.
3474
3475         Tests: imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html
3476                imported/w3c/web-platform-tests/fetch/api/headers/headers-casing.html
3477                imported/w3c/web-platform-tests/fetch/api/headers/headers-errors.html
3478                imported/w3c/web-platform-tests/fetch/api/headers/headers-idl.html
3479                imported/w3c/web-platform-tests/fetch/api/headers/headers-nameshake.html
3480                imported/w3c/web-platform-tests/fetch/api/headers/headers-normalize.html
3481                imported/w3c/web-platform-tests/fetch/api/headers/headers-structure.html
3482
3483         * CMakeLists.txt:
3484         * DerivedSources.cpp:
3485         * DerivedSources.make:
3486         * Modules/fetch/FetchHeaders.cpp: Added.
3487         (WebCore::FetchHeaders::initializeWith):
3488         (WebCore::isForbiddenHeaderName):
3489         (WebCore::isForbiddenResponseHeaderName):
3490         (WebCore::isSimpleHeader):
3491         (WebCore::canWriteHeader):
3492         (WebCore::FetchHeaders::append):
3493         (WebCore::FetchHeaders::remove):
3494         (WebCore::FetchHeaders::get):
3495         (WebCore::FetchHeaders::has):
3496         (WebCore::FetchHeaders::set):
3497         * Modules/fetch/FetchHeaders.h: Added.
3498         (WebCore::FetchHeaders::create):
3499         (WebCore::FetchHeaders::~FetchHeaders):
3500         (WebCore::FetchHeaders::internalHeaders):
3501         (WebCore::FetchHeaders::FetchHeaders):
3502         * Modules/fetch/FetchHeaders.idl: Added.
3503         * Modules/fetch/FetchHeaders.js: Added.
3504         (initializeFetchHeaders):
3505         * WebCore.xcodeproj/project.pbxproj:
3506         * bindings/js/WebCoreBuiltinNames.h:
3507         * bindings/js/WebCoreJSBuiltins.cpp:
3508         * bindings/js/WebCoreJSBuiltins.h:
3509         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
3510         (WebCore::JSBuiltinFunctions::fetchHeadersBuiltins):
3511         * platform/network/HTTPHeaderMap.cpp:
3512         (WebCore::HTTPHeaderMap::contains):
3513         (WebCore::HTTPHeaderMap::remove):
3514         * platform/network/HTTPHeaderMap.h:
3515
3516 2016-01-22  Sergio Villar Senin  <svillar@igalia.com>
3517
3518         [css-grid] grid shorthand must reset gap properties to their initial values
3519         https://bugs.webkit.org/show_bug.cgi?id=153354
3520
3521         Reviewed by Darin Adler.
3522
3523         Both 'grid-row-gap' & 'grid-column-gap' are considered reset-only subproperties of the
3524         'grid' shorthand meaning that, even thought the shorthand does not offer a way to set
3525         their values, it must in any case reset them to the initial ones.
3526
3527         * css/CSSParser.cpp:
3528         (WebCore::CSSParser::parseGridShorthand):
3529         * css/CSSPropertyNames.in:
3530
3531 2016-01-24  Brady Eidson  <beidson@apple.com>
3532
3533         Modern IDB: Implement deleteIndex and getCount for the SQLite backing store.
3534         https://bugs.webkit.org/show_bug.cgi?id=153415
3535
3536         Reviewed by Darin Adler.
3537
3538         No new tests (Handful of tests now pass, improvements on a handful of others).
3539
3540         * Modules/indexeddb/server/IDBBackingStore.h:
3541         
3542         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3543         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
3544         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3545         
3546         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3547         (WebCore::IDBServer::MemoryObjectStore::takeIndexByIdentifier):
3548         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
3549         (WebCore::IDBServer::MemoryObjectStore::deleteAllIndexes):
3550         (WebCore::IDBServer::MemoryObjectStore::takeIndexByName): Deleted.
3551         * Modules/indexeddb/server/MemoryObjectStore.h:
3552         
3553         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3554         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
3555         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
3556         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
3557         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3558         
3559         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
3560         (WebCore::IDBServer::SQLiteIDBCursor::maybeCreateBackingStoreCursor):
3561         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
3562         * Modules/indexeddb/server/SQLiteIDBCursor.h:
3563         
3564         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
3565         (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor):
3566         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
3567         
3568         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3569         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
3570         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
3571         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex):
3572         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3573         
3574         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3575         (WebCore::IDBObjectStoreInfo::deleteIndex):
3576         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
3577
3578 2016-01-24  Brady Eidson  <beidson@apple.com>
3579
3580         Unreviewed, speculative fix for:
3581         Modern IDB: Some IDB tests crash in ~SQLiteIDBBackingStore
3582         https://bugs.webkit.org/show_bug.cgi?id=153418
3583
3584         No new tests.
3585
3586         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3587         (WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore): Clear the global object
3588           before wiping out the VM.
3589
3590 2016-01-24  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3591
3592         Reduce PassRefPtr uses in dom - 4
3593         https://bugs.webkit.org/show_bug.cgi?id=153270
3594
3595         Reviewed by Darin Adler.
3596
3597         As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom.
3598
3599         * bindings/js/JSDeviceMotionEventCustom.cpp:
3600         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
3601         * dom/DeviceMotionData.cpp:
3602         (WebCore::DeviceMotionData::create):
3603         (WebCore::DeviceMotionData::DeviceMotionData):
3604         * dom/DeviceMotionData.h:
3605         * dom/Document.cpp:
3606         (WebCore::Document::setBodyOrFrameset):
3607         (WebCore::Document::setFocusedElement):
3608         (WebCore::Document::setDecoder):
3609         (WebCore::Document::pushCurrentScript):
3610         * dom/Document.h:
3611         * dom/Event.cpp:
3612         (WebCore::Event::cloneFor):
3613         * dom/Event.h:
3614         * dom/MouseEvent.cpp:
3615         (WebCore::MouseEvent::cloneFor):
3616         * dom/MouseEvent.h:
3617         * dom/NodeIterator.cpp:
3618         (WebCore::NodeIterator::NodePointer::NodePointer):
3619         (WebCore::NodeIterator::NodeIterator):
3620         * dom/NodeIterator.h:
3621         (WebCore::NodeIterator::create):
3622         * html/RadioInputType.cpp:
3623         (WebCore::RadioInputType::handleKeydownEvent):
3624         * platform/ios/DeviceMotionClientIOS.mm:
3625         (WebCore::DeviceMotionClientIOS::motionChanged):
3626         * xml/XSLTProcessor.cpp:
3627         (WebCore::XSLTProcessor::createDocumentFromSource):
3628
3629 2016-01-24  Myles C. Maxfield  <mmaxfield@apple.com>
3630
3631         [Font Loading] General cleanup
3632         https://bugs.webkit.org/show_bug.cgi?id=153403
3633
3634         Reviewed by Darin Adler.
3635
3636         It turns out that CSSFontFaceSource::m_hasExternalSVGFont exactly equals
3637         whether or not CSSFontFaceSource::m_font is a CachedSVGFont. Therefore,
3638         the variable is redundant.
3639
3640         In addition, it was being passed to functions on CSSFontFaceSource::m_font,
3641         which means it was always true inside the CachedSVGFont subclass and
3642         always false for the CachedFont. Therefore, there is no reason pass this
3643         variable to these functions because its value can be determined at
3644         authorship time.
3645
3646         No new tests because there is no behavior change.
3647
3648         * css/CSSFontFaceSource.cpp:
3649         (WebCore::CSSFontFaceSource::font):
3650         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.
3651         * css/CSSFontFaceSource.h:
3652         * css/CSSFontSelector.cpp:
3653         (WebCore::createFontFace):
3654         * loader/cache/CachedFont.cpp:
3655         (WebCore::CachedFont::ensureCustomFontData):
3656         (WebCore::CachedFont::createFont):
3657         * loader/cache/CachedFont.h:
3658         * loader/cache/CachedSVGFont.cpp:
3659         (WebCore::CachedSVGFont::createFont):
3660         (WebCore::CachedSVGFont::ensureCustomFontData):
3661         * loader/cache/CachedSVGFont.h:
3662         * platform/network/HTTPParsers.cpp:
3663         (WebCore::isValidHTTPToken):
3664         * xml/XMLHttpRequest.cpp:
3665         (WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod):
3666
3667 2016-01-24  Chris Dumez  <cdumez@apple.com>
3668
3669         An XMLDocument interface should be exposed on the global Window object
3670         https://bugs.webkit.org/show_bug.cgi?id=153378
3671         <rdar://problem/24315465>
3672
3673         Reviewed by Darin Adler.
3674
3675         Expose an XMLDocument interface on the global Window object, as per:
3676         - https://dom.spec.whatwg.org/#xmldocument
3677
3678         DOMImplementation.createDocument() now returns an XMLDocument instead
3679         of a Document, as per:
3680         - https://dom.spec.whatwg.org/#dom-domimplementation-createdocument
3681
3682         Previously, WebKit would alias XMLDocument to Document which caused
3683         some W3C tests to fail.
3684
3685         Chrome and Firefox already match the specification here.
3686
3687         No new tests, already covered by existing tests.
3688
3689         * CMakeLists.txt:
3690         * DerivedSources.cpp:
3691         * DerivedSources.make:
3692         * WebCore.vcxproj/WebCore.vcxproj:
3693         * WebCore.vcxproj/WebCore.vcxproj.filters:
3694         * WebCore.xcodeproj/project.pbxproj:
3695         * bindings/js/JSBindingsAllInOne.cpp:
3696         * bindings/js/JSDocumentCustom.cpp:
3697         (WebCore::createNewDocumentWrapper):
3698         * dom/DOMImplementation.cpp:
3699         (WebCore::DOMImplementation::createDocument):
3700         * dom/DOMImplementation.h:
3701         * dom/DOMImplementation.idl:
3702         * dom/Document.cpp:
3703         (WebCore::Document::cloneDocumentWithoutChildren):
3704         * dom/Document.h:
3705         (WebCore::Document::isXMLDocument):
3706         (WebCore::Document::create): Deleted.
3707         (WebCore::Document::createNonRenderedPlaceholder): Deleted.
3708         * dom/XMLDocument.h: Added.
3709         (WebCore::XMLDocument::create):
3710         (WebCore::XMLDocument::createXHTML):
3711         (WebCore::XMLDocument::XMLDocument):
3712         (isType):
3713         * dom/XMLDocument.idl: Added.
3714         * inspector/DOMPatchSupport.cpp:
3715         (WebCore::DOMPatchSupport::patchDocument):
3716         * inspector/InspectorDOMAgent.cpp:
3717         (WebCore::InspectorDOMAgent::setOuterHTML):
3718         * page/DOMWindow.idl:
3719         * page/PageSerializer.cpp:
3720         (WebCore::SerializerMarkupAccumulator::SerializerMarkupAccumulator):
3721         * svg/SVGDocument.cpp:
3722         (WebCore::SVGDocument::SVGDocument):
3723         * svg/SVGDocument.h:
3724         * svg/SVGDocument.idl:
3725         * xml/XMLHttpRequest.cpp:
3726         (WebCore::XMLHttpRequest::responseXML):
3727         * xml/XSLTProcessor.cpp:
3728         (WebCore::XSLTProcessor::createDocumentFromSource):
3729
3730 2016-01-24  Brady Eidson  <beidson@apple.com>
3731
3732         Modern IDB: Support IDBObjectStore.createIndex in the SQLite backing store.
3733         https://bugs.webkit.org/show_bug.cgi?id=153410
3734
3735         Reviewed by Darin Adler.
3736
3737         No new tests (Covered by unskipping many existing tests).
3738
3739         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3740         (WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
3741         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
3742         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
3743         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
3744         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3745
3746         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
3747         (WebCore::IDBServer::SQLiteIDBCursor::maybeCreateBackingStoreCursor):
3748         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
3749         * Modules/indexeddb/server/SQLiteIDBCursor.h:
3750
3751         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
3752         (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor):
3753         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
3754
3755 2016-01-24  Simon Fraser  <simon.fraser@apple.com>
3756
3757         Make the dumped display list representation a bit more compact
3758         https://bugs.webkit.org/show_bug.cgi?id=153409
3759
3760         Reviewed by Zalan Bujtas.
3761
3762         Don't make a group for every display list item.
3763
3764         * platform/graphics/displaylists/DisplayList.cpp:
3765         (WebCore::DisplayList::DisplayList::asText):
3766
3767 2016-01-24  Simon Fraser  <simon.fraser@apple.com>
3768
3769         Add testing for display list replay, and skip clipped-out items on replay
3770         https://bugs.webkit.org/show_bug.cgi?id=153408
3771
3772         Reviewed by Zalan Bujtas.
3773         
3774         Make it possible to save and serialize a DisplayList of Items which were
3775         actually applied on replay, so that replay-time optimizations can be tested.
3776         
3777         This exposes internals.setElementTracksDisplayListReplay() and
3778         internals.replayDisplayListForElement().
3779         
3780         Do a trivial replay-time optimization, which is to skip items whose extents are
3781         outside the replay clip.
3782
3783         Test: displaylists/replay-skip-clipped-rect.html
3784
3785         * platform/graphics/GraphicsLayer.cpp:
3786         (WebCore::GraphicsLayer::GraphicsLayer):
3787         * platform/graphics/GraphicsLayer.h:
3788         (WebCore::GraphicsLayer::setIsTrackingDisplayListReplay):
3789         (WebCore::GraphicsLayer::isTrackingDisplayListReplay):
3790         (WebCore::GraphicsLayer::replayDisplayListAsText):
3791         * platform/graphics/ca/GraphicsLayerCA.cpp:
3792         (WebCore::layerDisplayListMap): Use a singleton map to store the replay display lists
3793         to avoid bloating GraphicsLayerCA for test-only code. The map stores a pair of the
3794         replay list and a clip rect, which are both dumped. Dumping the clip rect ensures that
3795         we're reporting the replay for the correct tile in a test (since there will be a replay
3796         for each tile).
3797         (WebCore::GraphicsLayerCA::~GraphicsLayerCA):
3798         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
3799         (WebCore::GraphicsLayerCA::setIsTrackingDisplayListReplay):
3800         (WebCore::GraphicsLayerCA::replayDisplayListAsText):
3801         * platform/graphics/ca/GraphicsLayerCA.h:
3802         * platform/graphics/displaylists/DisplayList.h:
3803         (WebCore::DisplayList::DisplayList::appendItem):
3804         * platform/graphics/displaylists/DisplayListReplayer.cpp:
3805         (WebCore::DisplayList::Replayer::replay): In the unlikely event of tracking replays,
3806         allocate a new DisplayList and append to it items which actually get applied.
3807         * platform/graphics/displaylists/DisplayListReplayer.h:
3808         * rendering/RenderLayerBacking.cpp:
3809         (WebCore::RenderLayerBacking::setIsTrackingDisplayListReplay):
3810         (WebCore::RenderLayerBacking::replayDisplayListAsText):
3811         * rendering/RenderLayerBacking.h:
3812         * testing/Internals.cpp:
3813         (WebCore::Internals::setElementTracksDisplayListReplay):
3814         (WebCore::Internals::replayDisplayListForElement):
3815         * testing/Internals.h:
3816         * testing/Internals.idl:
3817
3818 2016-01-23  Wonchul Lee  <wonchul.lee@collabora.co.uk>
3819
3820         [GTK] Fix media controls displaying without controls attribute
3821         https://bugs.webkit.org/show_bug.cgi?id=152500
3822
3823         Media controls is not displayed without controls attribute by default
3824         when the video element has text track. It'll be displayed on fullscreen
3825         regardless of controls attribute.
3826
3827         Reviewed by Michael Catanzaro.
3828
3829         * Modules/mediacontrols/mediaControlsGtk.js:
3830         (ControllerGtk.prototype.shouldHaveControls):
3831         (ControllerGtk.prototype.reconnectControls):
3832         (ControllerGtk.prototype.removeControls):
3833         (ControllerGtk.prototype.configureControls): Deleted.
3834 2016-01-23  Alex Christensen  <achristensen@webkit.org>
3835
3836         Use credentials from a URL with NetworkSession like we did with ResourceHandle
3837         https://bugs.webkit.org/show_bug.cgi?id=153328
3838
3839         Reviewed by Alexey Proskuryakov.
3840
3841         This patch fixes at least http/tests/xmlhttprequest/basic-auth-credentials-escaping.html when using NetworkSession.
3842
3843         * platform/network/ProtectionSpaceBase.h:
3844         (WebCore::ProtectionSpaceBase::encodingRequiresPlatformData):
3845         * platform/network/ResourceRequestBase.h:
3846         Add some WEBCORE_EXPORT macros for functions that are now used in WebKit2.
3847
3848 2016-01-23  Brady Eidson  <beidson@apple.com>
3849
3850         Modern IDB: Implement clearing object stores and opening cursors in the SQLite backend.
3851         https://bugs.webkit.org/show_bug.cgi?id=153396
3852
3853         Reviewed by Alex Christensen.
3854
3855         No new tests (Some failing tests now pass, others improved).
3856
3857         Copy more LegacyIDB SQLite backend code over to the new SQLite backend.
3858         
3859         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3860         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
3861         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
3862         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
3863
3864 2016-01-22  Commit Queue  <commit-queue@webkit.org>
3865
3866         Unreviewed, rolling out r195493.
3867         https://bugs.webkit.org/show_bug.cgi?id=153397
3868
3869         Broke authenticaiton tests (leaks credentials) (Requested by
3870         ap on #webkit).
3871
3872         Reverted changeset:
3873
3874         "LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-
3875         unterminated.html crashing"
3876         https://bugs.webkit.org/show_bug.cgi?id=153250
3877         http://trac.webkit.org/changeset/195493
3878
3879 2016-01-20  Ryosuke Niwa  <rniwa@webkit.org>
3880
3881         HTMLElement::nodeName should not upper case non-ASCII characters
3882         https://bugs.webkit.org/show_bug.cgi?id=153231
3883
3884         Reviewed by Darin Adler.
3885
3886         Use the newly added convertToASCIIUppercase to generate the string for tagName and nodeName.
3887
3888         Test: fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document.html
3889
3890         * dom/QualifiedName.cpp:
3891         (WebCore::QualifiedName::localNameUpper): Use convertToASCIIUppercase.
3892         * html/HTMLElement.cpp:
3893         (WebCore::HTMLElement::nodeName): Use convertToASCIIUppercase.
3894
3895 2016-01-22  Brady Eidson  <beidson@apple.com>
3896
3897         Modern IDB: Disable simultaneous transactions in the SQLite backend for now.
3898         https://bugs.webkit.org/show_bug.cgi?id=153381
3899
3900         Reviewed by Alex Christensen.
3901
3902         No new tests (This resolves many of the currently crashing/asserting tests).
3903
3904         Right now we're porting the Legacy IDB SQLite backend to Modern IDB.
3905         
3906         The way the Legacy backend works is restricted to one transaction at a time.
3907         
3908         There's many tricks we can play to resolve this, but that task is better performed
3909         once all of the basic functionality is done.
3910         
3911         Fixing this limitation is covered by https://bugs.webkit.org/show_bug.cgi?id=153382
3912
3913         * Modules/indexeddb/server/IDBBackingStore.h: Add a "supports simultaneous transactions" getter.
3914         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3915         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3916         
3917         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3918         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
3919         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
3920         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
3921         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction): If the backing store does
3922           not support simultaneous transactions but there is a transaction in progress, return.
3923         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3924
3925 2016-01-22  Chris Dumez  <cdumez@apple.com>
3926
3927         document.charset should be an alias for document.characterSet
3928         https://bugs.webkit.org/show_bug.cgi?id=153367
3929
3930         Reviewed by Ryosuke Niwa.
3931
3932         document.charset should be an alias for document.characterSet:
3933         - https://dom.spec.whatwg.org/#dom-document-charset
3934
3935         It should also be read-only.
3936
3937         Chrome matches the specification.
3938
3939         No new tests, already covered by existing tests.
3940
3941         * dom/Document.h:
3942         * dom/Document.idl:
3943
3944 2016-01-22  Chris Dumez  <cdumez@apple.com>
3945
3946         Document.open / Document.write should be prevented while the document is being unloaded
3947         https://bugs.webkit.org/show_bug.cgi?id=153255
3948         <rdar://problem/22741293>
3949
3950         Reviewed by Ryosuke Niwa.
3951
3952         Document.open / Document.write should be prevented while the document
3953         is being unloaded, as per the HTML specification:
3954         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
3955         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
3956
3957         This patch is aligning our behavior with the specification and Firefox.
3958         Calling Document.open / Document.write during the document was being
3959         unloaded would cause us to crash as this was unexpected.
3960
3961         Tests: fast/frames/page-hide-document-open.html
3962                fast/frames/page-unload-document-open.html
3963
3964         * WebCore.xcodeproj/project.pbxproj:
3965         Add new IgnoreOpensDuringUnloadCountIncrementer.h header.
3966
3967         * dom/Document.cpp:
3968         (WebCore::Document::open):
3969         Abort if the document's ignore-opens-during-unload counter is greater
3970         than zero, as per:
3971         https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
3972
3973         (WebCore::Document::write):
3974         Abort if the insertion point is undefined and the document's
3975         ignore-opens-during-unload counter is greater than zero, as per:
3976         https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
3977
3978         * dom/Document.h:
3979         Add data member to maintain the document's ignore-opens-during-unload counter:
3980         https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
3981
3982         * dom/IgnoreOpensDuringUnloadCountIncrementer.h: Added.
3983         Add utility class to increment / decrement a document's
3984         ignore-opens-during-unload counter.
3985
3986         * history/CachedFrame.cpp:
3987         (WebCore::CachedFrame::CachedFrame):
3988         When a page goes into PageCache, we don't end up calling
3989         FrameLoader::detachChildren() so we need to increment the document's
3990         ignore-opens-during-unload counter before calling stopLoading() on each
3991         subframe.
3992
3993         * loader/FrameLoader.cpp:
3994         (WebCore::FrameLoader::detachChildren):
3995         detachChildren() will end up firing the pagehide / unload events in each
3996         child frame so we increment the parent frame's document's
3997         ignore-opens-during-unload counter. This behavior matches the text of:
3998         https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document
3999
4000         As per the spec, the document's ignore-opens-during-unload counter should
4001         be incremented before firing the pagehide / unload events at the document's
4002         Window object. It should be decremented only after firing the pagehide /
4003         unload events in each subframe. This is needed in case a subframe tries to
4004         call document.open / document.write on a parent frame's document, from its
4005         pagehide or unload handler.
4006
4007         (WebCore::FrameLoader::dispatchUnloadEvents):
4008         Increment the document's ignore-opens-during-unload counter before firing
4009         the pagehide / unload events and decrement it after. As per the spec, we
4010         are not supposed to decrement this early. We actually supposed to wait
4011         until the pagehide / unload events have been fired in all the subframes.
4012         For this reason, we take care of re-incrementing the document's
4013         ignore-opens-during-unload in detachChildren(), which will take care of
4014         firing the pagehide / unload in the subframes.
4015
4016 2016-01-22  Brady Eidson  <beidson@apple.com>
4017
4018         Modern IDB: Implement put, get, and delete records for the SQLite backend.
4019         https://bugs.webkit.org/show_bug.cgi?id=153375
4020
4021         Reviewed by Alex Christensen.
4022
4023         No new tests (Covered by many existing tests now passing).
4024
4025         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
4026         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
4027         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
4028         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
4029         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
4030         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
4031         * Modules/indexeddb/server/SQLiteIDBBackingStore.h: