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