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