Use larger tiles when possible to reduce per-tile painting overhead
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
2
3         Use larger tiles when possible to reduce per-tile painting overhead
4         https://bugs.webkit.org/show_bug.cgi?id=154985
5
6         Reviewed by Zalan Bujtas.
7
8         r197541 inadvertently missed FrameView changes that push scrollability data
9         onto the TiledBacking, so didn't actually change behavior (hence the 512x512 tiles
10         in the failing tests).
11
12         Also remove m_tileSizeAtLastRevalidate from TileGrid; it's replaced by a simpler test.
13
14         * page/FrameView.cpp:
15         (WebCore::FrameView::addedOrRemovedScrollbar):
16         * platform/graphics/ca/TileGrid.cpp:
17         (WebCore::TileGrid::revalidateTiles):
18         (WebCore::TileGrid::TileGrid): Deleted.
19         * platform/graphics/ca/TileGrid.h:
20
21 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
22
23         Use BoxExtent instead of EdgeSet in TileController
24         https://bugs.webkit.org/show_bug.cgi?id=155040
25
26         Reviewed by Zalan Bujtas.
27
28         Remove EdgeSet, which was very similar to the existing BoxExtent, and use BoxExtent
29         in TileController.
30
31         * WebCore.xcodeproj/project.pbxproj:
32         * platform/graphics/EdgeSet.h: Removed.
33         (WebCore::EdgeSet::EdgeSet): Deleted.
34         (WebCore::EdgeSet::top): Deleted.
35         (WebCore::EdgeSet::setTop): Deleted.
36         (WebCore::EdgeSet::right): Deleted.
37         (WebCore::EdgeSet::setRight): Deleted.
38         (WebCore::EdgeSet::bottom): Deleted.
39         (WebCore::EdgeSet::setBottom): Deleted.
40         (WebCore::EdgeSet::left): Deleted.
41         (WebCore::EdgeSet::setLeft): Deleted.
42         (WebCore::EdgeSet::operator==): Deleted.
43         (WebCore::EdgeSet::operator!=): Deleted.
44         * platform/graphics/ca/TileController.cpp:
45         (WebCore::TileController::setHasMargins):
46         * platform/graphics/ca/TileController.h:
47
48 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
49
50         [WK2] Gather resource load statistics
51         https://bugs.webkit.org/show_bug.cgi?id=154278
52         <rdar://problem/24702892>
53
54         Reviewed by Andy Estes.
55
56         Tested (now under WK2) by http/tests/navigation/statistics.html
57
58         Split part of the ResourceLoadObserver into a new class (ResourceLoadStatisticsStore)
59         that manages the collection of ResourceLoadStatistic objects, and that can be used
60         in the UIProcess without touching various WebProcess-specific WebCore classes.
61
62         Have the WebProcess only fire a message to the UIProcess if data has been modified. Otherwise,
63         no messages should be sent. When new data is encountered, start a 5 second timer. If more
64         data is found during this delay, just accumulate it. When the timer fires, all data is sent
65         and the timer stops until a new batch of data arrives.
66
67         * CMakeLists.txt: Add the new ResourceLoadStatisticsStore class.
68         * WebCore.xcodeproj/project.pbxproj: Adjust visibility of ResourceLoadStatistics header,
69         and add new ResourceLoadStatisticsStore class.
70         * loader/ResourceLoadObserver.cpp:
71         (WebCore::ResourceLoadObserver::setResourceLoadStatisticsEnabled): Deleted.
72         (WebCore::ResourceLoadObserver::resourceLoadStatisticsEnabled): Deleted.
73         (WebCore::ResourceLoadObserver::setStatisticsStore): Added.
74         (WebCore::ResourceLoadObserver::logFrameNavigation): Tell the ResourceLoadStatisticsStore to fire its 'data changed'
75         handler if necessary.
76         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
77         (WebCore::ResourceLoadObserver::logUserInteraction): Ditto.
78         (WebCore::ResourceLoadObserver::statisticsForOrigin): Use new ResourceLoadStatisticsStore.
79         (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
80         (WebCore::ResourceLoadObserver::resourceStatisticsForPrimaryDomain): Deleted.
81         (WebCore::ResourceLoadObserver::writeDataToDisk): Deleted.
82         (WebCore::ResourceLoadObserver::setStatisticsStorageDirectory): Deleted.
83         (WebCore::ResourceLoadObserver::persistentStoragePath): Deleted.
84         (WebCore::ResourceLoadObserver::readDataFromDiskIfNeeded): Deleted.
85         (WebCore::ResourceLoadObserver::createDecoderFromDisk): Deleted.
86         (WebCore::ResourceLoadObserver::writeEncoderToDisk): Deleted.
87         * loader/ResourceLoadObserver.h:
88         * loader/ResourceLoadStatistics.cpp:
89         (WebCore::ResourceLoadStatistics::encode): Get rid of unneeded argument.
90         (WebCore::ResourceLoadStatistics::decode): Ditto.
91         (WebCore::mergeHashCountedSet): Added helper function.
92         (WebCore::ResourceLoadStatistics::merge): Added.
93         * loader/ResourceLoadStatistics.h:
94         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
95         * loader/ResourceLoadStatisticsStore.cpp: Added.
96         (WebCore::ResourceLoadStatisticsStore::create):
97         (WebCore::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
98         (WebCore::ResourceLoadStatisticsStore::isPrevalentResource):
99         (WebCore::ResourceLoadStatisticsStore::resourceStatisticsForPrimaryDomain):
100         (WebCore::ResourceLoadStatisticsStore::writeDataToDisk):
101         (WebCore::ResourceLoadStatisticsStore::setStatisticsStorageDirectory):
102         (WebCore::ResourceLoadStatisticsStore::persistentStoragePath):
103         (WebCore::ResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
104         (WebCore::ResourceLoadStatisticsStore::createDecoderFromDisk):
105         (WebCore::ResourceLoadStatisticsStore::writeEncoderToDisk):
106         (WebCore::ResourceLoadStatisticsStore::statisticsForOrigin):
107         (WebCore::ResourceLoadStatisticsStore::takeStatistics):
108         (WebCore::ResourceLoadStatisticsStore::mergeStatistics):
109         (WebCore::ResourceLoadStatisticsStore::setNotificationCallback):
110         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler):
111         * loader/ResourceLoadStatisticsStore.h: Added.
112
113 2016-03-04  Konstantin Tokarev  <annulen@yandex.ru>
114
115         Added missing override specifiers under Source/WebCore.
116         https://bugs.webkit.org/show_bug.cgi?id=155021
117
118         Reviewed by Michael Catanzaro.
119
120         No new tests needed.
121
122         * bridge/NP_jsobject.cpp:
123         * css/CSSStyleSheet.cpp:
124         * dom/MutationObserver.cpp:
125         * editing/DictationCommand.cpp:
126         * editing/EditingStyle.cpp:
127         * loader/EmptyClients.cpp:
128         * loader/SinkDocument.cpp:
129         * page/DOMWindow.cpp:
130         * page/animation/CSSPropertyAnimation.cpp:
131         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
132         Also added #if(SOUP) guard to
133         ResourceHandleStreamingClient::getOrCreateReadBuffer
134         because it is not an overridden method otherwise.
135         * platform/text/LineEnding.cpp:
136         * xml/parser/XMLDocumentParserLibxml2.cpp:
137
138 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
139
140         Max out timer throttling immediately for pre-render pages
141         https://bugs.webkit.org/show_bug.cgi?id=155038
142
143         Reviewed by Chris Dumez.
144
145         If a hidden page has never been visible, no need to gently ramp into throttling - treat it
146         the same as a page that has been viewed, but has been in the background for a long time.
147
148         Why? The throttling mechanism scales with the amount of background work by shifting the
149         limit - once all background pages have maxed out the limit, they should no longer be burden
150         of the system. However the mechanism doesn't currently do anything to accelerate towards
151         the limit based on the number of pages in the ramp up phase, and ramp up duration is
152         proportional to limit (so ramping up to a high limit takes a long time). So if you quickly
153         create a large number of hidden pages the system may be under excessive load for a while,
154         as we slowly ramp up to a limit that will adequately constrain resource consumption.
155         In cases where a large number of hidden pages are rapidly generated, many likely remain in
156         the pre-render state, so this mitigation should typically help.
157
158         * page/Page.cpp:
159         (WebCore::Page::updateDOMTimerAlignmentInterval):
160             - if m_isPrerender then m_timerAlignmentInterval is set to the limit.
161         (WebCore::Page::setIsPrerender):
162             - When this changes updateDOMTimerAlignmentInterval().
163
164 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
165
166         Unify determination of page timer alignment
167         https://bugs.webkit.org/show_bug.cgi?id=155031
168
169         Reviewed by Chris Dumez.
170
171         Currently this is scattered throughout Page - sites that call setDOMTimerAlignmentInterval have
172         to determine the correct alignment interval. Instead, replace setDOMTimerAlignmentInterval with
173         updateDOMTimerAlignmentInterval, and unify the policy decision here.
174
175         * page/Page.cpp:
176         (WebCore::Page::setTimerThrottlingState):
177             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
178               Also, to simplify always record the timestamp when the state changes.
179         (WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
180             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
181         (WebCore::Page::updateDOMTimerAlignmentInterval):
182             - Was setDOMTimerAlignmentInterval, now determines the new alignment value.
183         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
184             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
185         (WebCore::Page::setDOMTimerAlignmentInterval): Deleted.
186             - Removed, became updateDOMTimerAlignmentInterval.
187         * page/Page.h:
188             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
189               m_timerThrottlingEnabledTime -> m_timerThrottlingStateLastChangedTime
190
191 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
192
193         Fix crash seen in iOS simulator tests
194         https://bugs.webkit.org/show_bug.cgi?id=155030
195
196         Reviewed by Tim Horton.
197
198         owningGraphicsLayer() can be null when the tileSizeChangeTimer fires, so null check
199         it and return, as we do for the tileRevalidationTimer.
200
201         * platform/graphics/ca/TileController.cpp:
202         (WebCore::TileController::tileSizeChangeTimerFired):
203
204 2016-03-04  Alex Christensen  <achristensen@webkit.org>
205
206         Remove vcxproj build system
207         https://bugs.webkit.org/show_bug.cgi?id=154388
208
209         Rubber-stamped by Brent Fulgham.
210
211         * WebCore.vcxproj/WebCore.submit.sln: Removed.
212         * WebCore.vcxproj/WebCore.vcxproj: Removed.
213         * WebCore.vcxproj/WebCore.vcxproj.filters: Removed.
214         * WebCore.vcxproj/WebCoreCFNetwork.props: Removed.
215         * WebCore.vcxproj/WebCoreCG.props: Removed.
216         * WebCore.vcxproj/WebCoreCURL.props: Removed.
217         * WebCore.vcxproj/WebCoreCairo.props: Removed.
218         * WebCore.vcxproj/WebCoreCommon.props: Removed.
219         * WebCore.vcxproj/WebCoreDebug.props: Removed.
220         * WebCore.vcxproj/WebCoreDebugWinCairo.props: Removed.
221         * WebCore.vcxproj/WebCoreGenerated.make: Removed.
222         * WebCore.vcxproj/WebCoreGenerated.vcxproj: Removed.
223         * WebCore.vcxproj/WebCoreGenerated.vcxproj.filters: Removed.
224         * WebCore.vcxproj/WebCoreGeneratedCommon.props: Removed.
225         * WebCore.vcxproj/WebCoreGeneratedDebug.props: Removed.
226         * WebCore.vcxproj/WebCoreGeneratedDebugWinCairo.props: Removed.
227         * WebCore.vcxproj/WebCoreGeneratedProduction.props: Removed.
228         * WebCore.vcxproj/WebCoreGeneratedRelease.props: Removed.
229         * WebCore.vcxproj/WebCoreGeneratedReleaseWinCairo.props: Removed.
230         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make: Removed.
231         * WebCore.vcxproj/WebCoreGeneratedWinCairoCommon.props: Removed.
232         * WebCore.vcxproj/WebCoreIncludeCommon.props: Removed.
233         * WebCore.vcxproj/WebCoreMediaQT.props: Removed.
234         * WebCore.vcxproj/WebCorePostBuild.cmd: Removed.
235         * WebCore.vcxproj/WebCorePreBuild.cmd: Removed.
236         * WebCore.vcxproj/WebCoreProduction.props: Removed.
237         * WebCore.vcxproj/WebCoreQuartzCore.props: Removed.
238         * WebCore.vcxproj/WebCoreRelease.props: Removed.
239         * WebCore.vcxproj/WebCoreReleaseWinCairo.props: Removed.
240         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Removed.
241         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Removed.
242         * WebCore.vcxproj/WebCoreTestSupportCommon.props: Removed.
243         * WebCore.vcxproj/WebCoreTestSupportDebug.props: Removed.
244         * WebCore.vcxproj/WebCoreTestSupportDebugWinCairo.props: Removed.
245         * WebCore.vcxproj/WebCoreTestSupportProduction.props: Removed.
246         * WebCore.vcxproj/WebCoreTestSupportRelease.props: Removed.
247         * WebCore.vcxproj/WebCoreTestSupportReleaseWinCairo.props: Removed.
248         * WebCore.vcxproj/build-generated-files.pl: Removed.
249         * WebCore.vcxproj/copyForwardingHeaders.cmd: Removed.
250         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd: Removed.
251         * WebCore.vcxproj/migrate-scripts.pl: Removed.
252
253 2016-03-04  Brady Eidson  <beidson@apple.com>
254
255         Remove use of deprecated sqlite3_expired
256         https://bugs.webkit.org/show_bug.cgi?id=155025
257
258         Reviewed by Tim Horton.
259
260         Since we exclusively use sqlite3_prepare_v2 and don't use sqlite3_prepare,
261         manually checking for expired statements is not necessary.
262
263         * platform/sql/SQLiteStatement.cpp:
264         (WebCore::SQLiteStatement::isExpired): Null check the statement, but don't bother
265           with sqlite3_expired.
266
267 2016-03-04  Daniel Bates  <dabates@apple.com>
268
269         Move CryptoDigest to WebCore/platform
270         https://bugs.webkit.org/show_bug.cgi?id=155008
271         <rdar://problem/24969787>
272
273         Reviewed by Brent Fulgham.
274
275         CryptoDigest provides a platform-independent interface for interacting with platform-
276         specific cryptographic hashing services. We currently make use of this code as part
277         of the implementation of Web Crypto. This code will also be beneficial as part of
278         implementing support for Content Security Policy inline script and inline stylesheet
279         hashes. We should move CryptoDigest to WebCore/platform to convey that it a general
280         purpose platform abstraction.
281
282         * CMakeLists.txt: Add include directory WebCore/platform/crypto.
283         * PlatformEfl.cmake: Add file platform/crypto/gnutls/CryptoDigestGnuTLS.cpp and
284         remove file crypto/gnutls/CryptoDigestGnuTLS.cpp.
285         * PlatformGTK.cmake: Ditto.
286         * PlatformMac.cmake: Add file platform/crypto/mac/CryptoDigestMac.cpp and
287         remove file crypto/mac/CryptoDigestMac.cpp.
288         * WebCore.xcodeproj/project.pbxproj:
289         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
290         (WebCore::CryptoAlgorithmSHA1::digest): Substitute "CryptoDigest::Algorithm" for "CryptoAlgorithmIdentifier".
291         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
292         (WebCore::CryptoAlgorithmSHA224::digest): Ditto.
293         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
294         (WebCore::CryptoAlgorithmSHA256::digest): Ditto.
295         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
296         (WebCore::CryptoAlgorithmSHA384::digest): Ditto.
297         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
298         (WebCore::CryptoAlgorithmSHA512::digest): Ditto.
299         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
300         (WebCore::getCryptoDigestAlgorithm): Converts a CryptoAlgorithmIdentifier enumerator to a
301         CryptoDigest::Algorithm enumerator, if applicable.
302         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Write in terms of WebCore::getCryptoDigestAlgorithm().
303         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Ditto.
304         * platform/crypto/CryptoDigest.h: Renamed from Source/WebCore/crypto/CryptoDigest.h. Also added enum CryptoDigest::Algorithm
305         and changed constructor to take this enum.
306         * platform/crypto/gnutls/CryptoDigestGnuTLS.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoDigestGnuTLS.cpp.
307         (WebCore::CryptoDigest::CryptoDigest): Substitute "CryptoDigest::Algorithm" for "CryptoAlgorithmIdentifier".
308         (WebCore::CryptoDigest::~CryptoDigest): Ditto.
309         (WebCore::CryptoDigest::create): Ditto.
310         (WebCore::CryptoDigest::addBytes): Ditto.
311         (WebCore::CryptoDigest::computeHash): Ditto.
312         * platform/crypto/mac/CryptoDigestMac.cpp: Renamed from Source/WebCore/crypto/mac/CryptoDigestMac.cpp.
313         (WebCore::toSHA1Context): Ditto.
314         (WebCore::toSHA224Context): Ditto.
315         (WebCore::toSHA256Context): Ditto.
316         (WebCore::toSHA384Context): Ditto.
317         (WebCore::toSHA512Context): Ditto.
318         (WebCore::CryptoDigest::CryptoDigest): Ditto.
319         (WebCore::CryptoDigest::~CryptoDigest): Ditto.
320         (WebCore::CryptoDigest::create): Ditto.
321         (WebCore::CryptoDigest::addBytes): Ditto.
322         (WebCore::CryptoDigest::computeHash): Ditto.
323
324 2016-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
325
326         Whitespace causes font-variant: all-small-caps to synthesize
327         https://bugs.webkit.org/show_bug.cgi?id=155004
328         <rdar://problem/24630796>
329
330         Reviewed by Darin Adler.
331
332         Many fonts (such as Avenir Next) don't report to support whitespace characters under
333         smcp or c2sc. Previously, we were using this as a signal to synthesize small caps
334         instead of true small caps. However, a better solution is for whitespace to never
335         cause synthesis with all-small-caps.
336
337         Test: fast/text/all-small-caps-whitespace.html
338
339         * platform/graphics/mac/ComplexTextController.cpp:
340         (WebCore::shouldSynthesize):
341         (WebCore::ComplexTextController::collectComplexTextRuns):
342
343 2016-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
344
345         [iOS] Crash during font loading when injected bundle cancels load
346         https://bugs.webkit.org/show_bug.cgi?id=155001
347
348         Reviewed by Tim Horton.
349
350         If a injected bundle cancels the load, the fontLoaded() callback will be
351         called twice. We can simply detect this condition.
352
353         Test: CancelLoading.CancelFontSubresource API test
354
355         * css/CSSFontFaceSource.cpp:
356         (WebCore::CSSFontFaceSource::fontLoaded):
357
358 2016-03-03  Ada Chan  <adachan@apple.com>
359
360         The visibility of the airplay menu also depends on whether there's a custom menu item.
361         https://bugs.webkit.org/show_bug.cgi?id=154987
362
363         Reviewed by Darin Adler.
364
365         * html/HTMLMediaElement.cpp:
366         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
367
368 2016-03-04  Timothy Hatcher  <timothy@apple.com>
369
370         Inform WebKit and WebCore if a page is controlled by automation.
371
372         https://bugs.webkit.org/show_bug.cgi?id=154991
373         rdar://problem/24965784
374
375         Reviewed by Joseph Pecoraro.
376
377         * page/Page.h:
378         (WebCore::Page::isControlledByAutomation): Added.
379         (WebCore::Page::setControlledByAutomation): Added.
380
381 2016-03-03  Antti Koivisto  <antti@apple.com>
382
383         ComposedTreeIterator may traverse slotted nodes multiple times
384         https://bugs.webkit.org/show_bug.cgi?id=154983
385
386         Reviewed by Ryosuke Niwa.
387
388         Traversal of slotted nodes can escape to real siblings. Those siblings are then traversed again as slotted nodes.
389
390         Test: fast/shadow-dom/composed-tree-slots.html
391
392         * dom/ComposedTreeIterator.cpp:
393         (WebCore::ComposedTreeIterator::initializeContextStack):
394         (WebCore::ComposedTreeIterator::traverseNextInShadowTree):
395         (WebCore::ComposedTreeIterator::traverseNextLeavingContext):
396         (WebCore::ComposedTreeIterator::advanceInSlot):
397         * dom/ComposedTreeIterator.h:
398         (WebCore::ComposedTreeIterator::Context::Context):
399
400             Include end iterator to the context.
401             For slotted nodes set it up to point to the next sibling of the node.
402
403         (WebCore::ComposedTreeIterator::context):
404         (WebCore::ComposedTreeIterator::traverseNextSkippingChildren):
405
406 2016-03-04  Andreas Kling  <akling@apple.com>
407
408         Drop DocumentSharedObjectPool immediately when going into PageCache.
409         <https://webkit.org/b/154986>
410
411         Reviewed by Antti Koivisto.
412
413         The DocumentSharedObjectPool is a weirdly efficient little optimization
414         that deduplicates ElementData during the first 10s of a Document's lifetime.
415         While it's up, every ElementData created will persist so it can be used for
416         deduplication.
417
418         If a Document goes into the PageCache while its shared object pool is still
419         alive, we can just kill it right away. This will sometimes allow us to free
420         a bunch of ElementData sooner.
421
422         * dom/Document.cpp:
423         (WebCore::Document::Document):
424         (WebCore::Document::setInPageCache):
425         (WebCore::Document::clearSharedObjectPool):
426         (WebCore::Document::sharedObjectPoolClearTimerFired): Deleted.
427         * dom/Document.h:
428
429 2016-03-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
430
431         Remove PassRefPtr from ThreadableLoader and relatives
432         https://bugs.webkit.org/show_bug.cgi?id=154966
433
434         Reviewed by Darin Adler.
435
436         Covered by existing tests.
437
438         * loader/DocumentThreadableLoader.cpp:
439         (WebCore::DocumentThreadableLoader::create):
440         * loader/DocumentThreadableLoader.h:
441         * loader/ThreadableLoader.cpp:
442         (WebCore::ThreadableLoader::create):
443         * loader/ThreadableLoader.h:
444         * loader/WorkerThreadableLoader.cpp:
445         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
446         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
447         * loader/WorkerThreadableLoader.h:
448
449 2016-03-03  Ryosuke Niwa  <rniwa@webkit.org>
450
451         Let XCode have its own way and also sort the file.
452
453         * WebCore.xcodeproj/project.pbxproj:
454
455 2016-03-03  Chris Dumez  <cdumez@apple.com>
456
457         Regression(r196770): Unable to use HipChat Mac app
458         https://bugs.webkit.org/show_bug.cgi?id=154999
459         <rdar://problem/24931959>
460
461         Reviewed by Darin Adler.
462
463         r196770 made [Unforgeable] operations such as Location.reload()
464         non-writable as per the Web IDL specification. As a result,
465         trying to set such properties will be ignored in non-strict
466         mode and will throw an exception is strict mode. This also matches
467         Firefox and Chrome.
468
469         However, this broke the HipChat Mac App (the Web App seems fine)
470         because it sets Location.reload() and is using strict mode, therefore
471         causing an exception to be thrown.
472
473         This patch adds a quirk to JSLocation::putDelegate() which disable
474         strict mode when we detect that the application is HipChat. As a
475         result, we no longer throw when HipChat tries to set Location.reload
476         and the application is able to connect again.
477
478         * bindings/js/JSLocationCustom.cpp:
479         (WebCore::JSLocation::putDelegate):
480         Add a quirk which disables strict mode if the application is HipChat.
481
482         * platform/RuntimeApplicationChecks.cpp:
483         (WebCore::mainBundleIdentifier):
484         Extract this from mainBundleIsEqualTo() so it can be shared with
485         applicationBundleIdentifier().
486
487         (WebCore::applicationBundleIdentifier):
488         Returns the application bundle identifier, which is a static variable.
489         For the WebContent / Networking processes, the application bundle
490         identifier gets set to the UIProcess bundle identifier upon
491         initialization. If unset, we fall back to using mainBundleIdentifier()
492         which will do the right thing for the WK2 UIProcess and WK1.
493
494         (WebCore::mainBundleIsEqualTo):
495         Extract part of the code to mainBundleIdentifier() to better share
496         code.
497
498         (WebCore::applicationIsHipChat):
499         Add utility function that checks if the application is HipChat. This
500         will do the right thing whether it is called from the UIProcess, the
501         WebProcess or the UIProcess.
502
503         (WebCore::setApplicationBundleIdentifier):
504         Add utility function to set the application bundle identifier. It gets
505         called with the UIProcess bundle identifier by the NetworkProcess and
506         the WebProcess upon initialization.
507
508         * platform/RuntimeApplicationChecks.h:
509
510 2016-03-03  Keith Miller  <keith_miller@apple.com>
511
512         JSArrayBuffers should be collected less aggressively
513         https://bugs.webkit.org/show_bug.cgi?id=154982
514
515         Reviewed by Geoffrey Garen.
516
517         We are currently too aggressive in our collection of ArrayBuffer wrappers.
518         There are three cases where we need to avoid collecting ArrayBuffer wrappers.
519         1. If the wrapper has custom properties.
520         2. If the wrapper is a subclass of ArrayBuffer.
521         3. If the wrapper is in a WeakMap/WeakSet.
522
523         Currently, we only pass the first case in WebCore and none in the jsc CLI.
524         This patch removes some optimizations that cause us to collect when we
525         should not. Namely, always skipping the object unless it has custom
526         properties. Additionally, in the case of subclassing, we also need a way
527         for custom JSArrayBuffer objects to register themselves as the wrapper for
528         an ArrayBuffer class.
529
530         Finally, this patch removes an unnecessary ref() and deref() of
531         ArrayBuffer objects during the creation/destruction of the wrapper.
532         Since an ArrayBuffer object's GC lifetime will be at least as long
533         as the lifetime of the wrapper we are creating for it we don't need
534         to ref() and deref() the ArrayBuffer object. This lifetime is
535         guaranteed because ArrayBuffer objects are both GCed and refcounted
536         and any new wrapper will visit the ArrayBuffer object as long as the
537         wrapper is still alive.
538
539         Test: js/arraybuffer-wrappers.html
540
541         * bindings/js/JSDOMBinding.h:
542         (WebCore::toJS):
543         * bindings/js/WebCoreTypedArrayController.cpp:
544         (WebCore::WebCoreTypedArrayController::registerWrapper):
545         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
546         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots): Deleted.
547         * bindings/js/WebCoreTypedArrayController.h:
548
549 2016-03-03  Simon Fraser  <simon.fraser@apple.com>
550
551         Use larger tiles when possible to reduce per-tile painting overhead
552         https://bugs.webkit.org/show_bug.cgi?id=154985
553         rdar://problem/23635219
554
555         Reviewed by Tim Horton.
556
557         There's no reason to use lots of 512x512 tiles on a non-scrollable page. We can reduce
558         per-tile painting overhead by using one big tile. On vertically scrolling pages, we
559         can also use wide tiles to reduce tile-crossing when painting. Have FrameView tell
560         the TiledBacking about scrollability, allowing TileController to make tile size decisions.
561
562         Change the "giant tile" code path to just return whether Settings says we're in giant
563         tile mode, so that tile size decisions can be made in TileController.
564
565         TileController now stores a single margin size, and a per-edge margin flag rather than a size
566         per edge. It computes tile size based on scrollability, but adjusts tile size with some 
567         hysteresis to avoid size thrashing for content that frequently resizes the document (e.g.
568         some performance tests).
569
570         TileGrid stores a copy of the tile size, so that it remains unchanged from one revalidate
571         to the next, and the grid can detect when the tile size changes, since it needs to throw away
572         all tiles in that case.
573
574         Tests: tiled-drawing/tile-size-both-scrollable.html
575                tiled-drawing/tile-size-horizontally-scrollable.html
576                tiled-drawing/tile-size-unscrollable.html
577                tiled-drawing/tile-size-vertically-scrollable.html
578
579         * WebCore.xcodeproj/project.pbxproj:
580         * page/FrameView.cpp:
581         (WebCore::FrameView::addedOrRemovedScrollbar):
582         (WebCore::FrameView::willStartLiveResize): Tell the tile backing when live resize starts and stops.
583         (WebCore::FrameView::willEndLiveResize):
584         * platform/graphics/EdgeSet.h: Added. Template class that just stores some value
585         per edge.
586         (WebCore::EdgeSet::EdgeSet):
587         (WebCore::EdgeSet::top):
588         (WebCore::EdgeSet::setTop):
589         (WebCore::EdgeSet::right):
590         (WebCore::EdgeSet::setRight):
591         (WebCore::EdgeSet::bottom):
592         (WebCore::EdgeSet::setBottom):
593         (WebCore::EdgeSet::left):
594         (WebCore::EdgeSet::setLeft):
595         (WebCore::EdgeSet::operator==):
596         (WebCore::EdgeSet::operator!=):
597         * platform/graphics/GraphicsLayerClient.h: Rather than have the client return the
598         tile size, have it return whether we're in giant tile mode.
599         (WebCore::GraphicsLayerClient::useGiantTiles):
600         (WebCore::GraphicsLayerClient::tileSize): Deleted.
601         * platform/graphics/TiledBacking.h:
602         (WebCore::defaultTileSize): Deleted.
603         * platform/graphics/ca/GraphicsLayerCA.cpp:
604         (WebCore::GraphicsLayerCA::platformCALayerUseGiantTiles):
605         (WebCore::GraphicsLayerCA::platformCALayerTileSize): Deleted.
606         * platform/graphics/ca/GraphicsLayerCA.h:
607         * platform/graphics/ca/PlatformCALayerClient.h:
608         (WebCore::PlatformCALayerClient::platformCALayerUseGiantTiles):
609         (WebCore::PlatformCALayerClient::platformCALayerTileSize): Deleted.
610         * platform/graphics/ca/TileController.cpp:
611         (WebCore::TileController::TileController):
612         (WebCore::TileController::setScrollability):
613         (WebCore::TileController::willStartLiveResize):
614         (WebCore::TileController::didEndLiveResize):
615         (WebCore::TileController::tileSize):
616         (WebCore::TileController::setHasMargins):
617         (WebCore::TileController::setMarginSize):
618         (WebCore::TileController::hasMargins):
619         (WebCore::TileController::hasHorizontalMargins):
620         (WebCore::TileController::hasVerticalMargins):
621         (WebCore::TileController::topMarginHeight):
622         (WebCore::TileController::bottomMarginHeight):
623         (WebCore::TileController::leftMarginWidth):
624         (WebCore::TileController::rightMarginWidth):
625         (WebCore::TileController::setTileMargins): Deleted.
626         * platform/graphics/ca/TileController.h:
627         * platform/graphics/ca/TileGrid.cpp:
628         (WebCore::TileGrid::TileGrid):
629         (WebCore::TileGrid::setNeedsDisplayInRect):
630         (WebCore::TileGrid::rectForTileIndex):
631         (WebCore::TileGrid::getTileIndexRangeForRect):
632         (WebCore::TileGrid::removeAllTiles):
633         (WebCore::TileGrid::revalidateTiles):
634         * platform/graphics/ca/TileGrid.h:
635         (WebCore::TileGrid::tileSize):
636         * rendering/RenderLayerBacking.cpp:
637         (WebCore::RenderLayerBacking::setTiledBackingHasMargins):
638         (WebCore::RenderLayerBacking::useGiantTiles):
639         (WebCore::RenderLayerBacking::tileSize): Deleted.
640         * rendering/RenderLayerBacking.h:
641
642 2016-03-03  Ryosuke Niwa  <rniwa@webkit.org>
643
644         Disallow custom elements inside a window-less documents
645         https://bugs.webkit.org/show_bug.cgi?id=154944
646         <rdar://problem/24944875>
647
648         Reviewed by Antti Koivisto.
649
650         Disallow custom elements inside a window-less documents such as the shared inert document of template elements
651         and the ones created by DOMImplementation.createDocument and DOMImplementation.createHTMLDocument.
652
653         Throw NotSupportedError in defineCustomElement when it's called in such a document as discussed in:
654         https://github.com/w3c/webcomponents/issues/369
655
656         Tests: fast/custom-elements/parser/parser-constructs-custom-element-in-document-write.html
657                fast/custom-elements/parser/parser-uses-registry-of-owner-document.html
658
659         * bindings/js/JSDOMBinding.cpp:
660         (WebCore::throwNotSupportedError): Added.
661         * bindings/js/JSDOMBinding.h:
662         * bindings/js/JSDocumentCustom.cpp:
663         (WebCore::JSDocument::defineCustomElement): Throw NotSupportedError when the context object's document doesn't
664         have a browsing context (i.e. window-less).
665         * html/parser/HTMLDocumentParser.cpp:
666         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Replaced a FIXME with an assertion now that we
667         disallow instantiation of custom elements inside a template element.
668
669 2016-03-03  Alex Christensen  <achristensen@webkit.org>
670
671         Move SPI to CFNetworkSPI.h
672         https://bugs.webkit.org/show_bug.cgi?id=154992
673
674         Reviewed by Andy Estes.
675
676         * platform/spi/cf/CFNetworkSPI.h:
677
678 2016-03-03  Alex Christensen  <achristensen@webkit.org>
679
680         Use CredentialStorage with NetworkSession
681         https://bugs.webkit.org/show_bug.cgi?id=154939
682
683         Reviewed by Darin Adler.
684
685         This makes the credential-based http tests pass when using NetworkSession.
686
687         * platform/network/CredentialBase.h:
688         (WebCore::CredentialBase::encodingRequiresPlatformData):
689         * platform/network/CredentialStorage.h:
690         WEBCORE_EXPORT more things that are newly used in WebKit2.
691
692 2016-03-03  Zalan Bujtas  <zalan@apple.com>
693
694         Subpixel rendering: Make collapsed borders painting subpixel aware.
695         https://bugs.webkit.org/show_bug.cgi?id=154980
696
697         Reviewed by David Hyatt.
698
699         This patch enables collapsed borders with odd pixel width paint on subpixel position.
700         Currently borders with odd pixels are split at integral position so that border-width: 3px;
701         paints 1px on the left(top) and 2px on the right(bottom) side. With this patch
702         we paint 1.5px on both sides(on 2x display).
703
704         Test: fast/table/hidpi-collapsed-border-with-odd-pixel-width.html
705
706         * rendering/RenderTableCell.cpp:
707         (WebCore::RenderTableCell::paintCollapsedBorders):
708
709 2016-03-03  Dave Hyatt  <hyatt@apple.com>
710
711         Add support for the "last" value of hanging-punctuation
712         https://bugs.webkit.org/show_bug.cgi?id=154977
713
714         Reviewed by Darin Adler and Simon Fraser.
715
716         New tests in fast/text.
717
718         This patch adds support for the new "last" value and also fixes up both
719         "first" and "last" to work with leading and trailing whitespace that ends
720         up getting collapsed away.
721
722         * rendering/RenderBlockFlow.cpp:
723         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
724         * rendering/RenderBlockLineLayout.cpp:
725         (WebCore::inlineAncestorHasStartBorderPaddingOrMargin):
726         (WebCore::inlineAncestorHasEndBorderPaddingOrMargin):
727         (WebCore::isLastInFlowRun):
728         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
729         * rendering/RenderText.cpp:
730         (WebCore::isHangablePunctuationAtLineEnd):
731         (WebCore::RenderText::hangablePunctuationStartWidth):
732         (WebCore::RenderText::hangablePunctuationEndWidth):
733         (WebCore::RenderText::firstCharacterIndexStrippingSpaces):
734         (WebCore::RenderText::lastCharacterIndexStrippingSpaces):
735         (WebCore::RenderText::trimmedPrefWidths):
736         * rendering/RenderText.h:
737         * rendering/line/BreakingContext.h:
738         (WebCore::BreakingContext::handleText):
739
740 2016-03-03  Andy Estes  <aestes@apple.com>
741
742         Adopt CFNetwork storage partitioning SPI
743         https://bugs.webkit.org/show_bug.cgi?id=154957
744         rdar://problem/23614620
745
746         Reviewed by Darin Adler.
747
748         Adopt CFNetwork SPI for creating storage partitions. If Settings::cookieStoragePartitioningEnabled() is true,
749         create cookie storage partitions for third-party contexts. This feature is disabled by default.
750
751         No new tests. Test support is tracked by <https://webkit.org/b/154958>.
752
753         * page/Settings.cpp:
754         (WebCore::Settings::setCookieStoragePartitioningEnabled): Controls whether storage partitioning for cookies is enabled.
755         * page/Settings.h:
756         (WebCore::Settings::cookieStoragePartitioningEnabled):
757         * platform/network/NetworkStorageSession.h:
758         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
759         (WebCore::cookieStoragePartition): Computes a storage partition identifier by determining the top
760         privately-controlled domain of the cookie's first-party (main frame document) URL, then determining whether the
761         cookie's document hostname is a subdomain of it. If is is not, the first-party top domain is the partition name.
762         Otherwise, there is no partition name.
763         * platform/network/mac/CookieJarMac.mm:
764         (WebCore::applyPartitionToCookies): Returns a deep copy of the given cookie array after adding a storage
765         partition property to each copied cookie.
766         (WebCore::cookiesInPartitionForURL): Returns cookies for the partition computed by the given URLs. If no
767         partition can be determined, nil is returned.
768         (WebCore::cookiesForURL): Returns cookiesInPartitionForURL() if non-nil, otherwise returns wkHTTPCookiesForURL().
769         (WebCore::cookiesForSession): Started calling cookiesForURL().
770         (WebCore::setCookiesFromDOM): Called applyPartitionToCookies() if a partition can be computed from the given URLs.
771         (WebCore::getRawCookies): Started calling cookiesForURL().
772         * platform/network/mac/ResourceHandleMac.mm:
773         (WebCore::ResourceHandle::createNSURLConnection): Computed the storage partition identifier for the new request.
774         If non-empty, set it as a property on the NSURLRequest where CFNetwork knows to find it.
775         * platform/spi/cf/CFNetworkSPI.h: Declare new SPI for building with the public SDK.
776
777 2016-03-03  Manuel Rego Casasnovas  <rego@igalia.com>
778
779         [css-grid] Fix order of grid shorthands in CSSPropertyNames.in
780         https://bugs.webkit.org/show_bug.cgi?id=154915
781
782         Reviewed by Darin Adler.
783
784         The order of columns and rows in grid and grid-template shorthands
785         has been swapped recently (r196906 & r196934).
786         However the order was not updated in CSSPropertyNames.in file.
787
788         * css/CSSPropertyNames.in:
789
790 2016-03-03  Alexey Proskuryakov  <ap@apple.com>
791
792         AllInOne build fix.
793
794         * rendering/RenderFlexibleBox.cpp:
795         * rendering/RenderGrid.cpp:
796         Don't have two static functions with the same name.
797
798 2016-03-03  Chris Dumez  <cdumez@apple.com>
799
800         Drop [TreatNullAs=EmptyString] from URL interface attributes
801         https://bugs.webkit.org/show_bug.cgi?id=154951
802
803         Reviewed by Darin Adler.
804
805         Drop [TreatNullAs=EmptyString] from URL interface attributes to match
806         the specification:
807         - https://url.spec.whatwg.org/#api
808
809         Firefox and Chrome both already follow the specification and convert
810         null to the "null" string.
811
812         No new tests, already covered by existing tests.
813
814         * html/URLUtils.idl:
815
816 2016-03-03  Miguel Gomez  <magomez@igalia.com>
817
818         [TextureMapper] Use RGBA format for textures attached to framebuffers
819         https://bugs.webkit.org/show_bug.cgi?id=154965
820
821         Reviewed by Žan Doberšek.
822
823         Use RGBA format when allocating textures that will be used as framebuffer
824         attachments. This means adding a new flag to BitmapTexture and modifying
825         BitmapTextureGL to use the appropriate format according to the flag. Also,
826         BitmapTexturePool needs to use two vectors to handle both types of textures
827         separately, as we want to avoid constantly switching the format of a reused
828         texture.
829
830         No new tests since the behavior change is covered by existing tests.
831
832         * platform/graphics/texmap/BitmapTexture.h: Add new flag.
833         * platform/graphics/texmap/BitmapTextureGL.cpp:
834         (WebCore::BitmapTextureGL::BitmapTextureGL): Receive flags on constructor and use RGBA
835         when the FBOAttachment flag is enabled.
836         (WebCore::BitmapTextureGL::applyFilters): Use FBOAttachemt flag to request a texture.
837         * platform/graphics/texmap/BitmapTextureGL.h: Add flags to the constructor.
838         * platform/graphics/texmap/BitmapTexturePool.cpp: Add a new vector of textures to hold
839         those in RGBA format.
840         (WebCore::BitmapTexturePool::acquireTexture): Return a texture for the usage specified
841         in the incoming flags.
842         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired): Release textures from
843         both vectors.
844         (WebCore::BitmapTexturePool::createTexture): Pass the usage flag when creating a new
845         texture.
846         * platform/graphics/texmap/BitmapTexturePool.h: Add new texture vector and add flags to
847         the needed headers.
848         * platform/graphics/texmap/TextureMapper.cpp:
849         (WebCore::TextureMapper::acquireTextureFromPool): Pass the received flags to the BitmapTexturePool.
850         * platform/graphics/texmap/TextureMapperLayer.cpp:
851         (WebCore::TextureMapperLayer::paintIntoSurface): Use FBOAttachemt flag to request a texture.
852
853 2016-03-03  Javier Fernandez  <jfernandez@igalia.com>
854
855         [CSS Box Alignment] New CSS Value 'normal' for Content Alignment
856         https://bugs.webkit.org/show_bug.cgi?id=154282
857
858         Reviewed by David Hyatt.
859
860         The Box Alignment specification defines a new value 'normal' to be used
861         as default for the different layout models, which will define the
862         specific behavior for each case. This patch adds a new CSS value in the
863         parsing logic and adapts the Content Alignment properties to the new
864         value.
865
866         The 'auto' value is no longer valid and the Computed Value will be
867         always the specified value. Hence, I removed the StyleResolver logic
868         because is not required now; the specific behavior of the 'normal'
869         value will be resolved at layout time.
870
871         Computed value of both align-content and justify-content is the
872         specified value, we don't have to resolve any 'auto' value now.
873
874         Additionally, this patch updates the layout logic as well, for both
875         Flexbox and Grid layout models.
876
877         No new tests, since we only need to rebaseline those test cases
878         affected by the new default computed value.
879
880         * css/CSSComputedStyleDeclaration.cpp:
881         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
882         (WebCore::ComputedStyleExtractor::propertyValue):
883         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Deleted.
884         (WebCore::CSSComputedStyleDeclaration::copyProperties): Deleted.
885         (WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
886         (WebCore::isFlexOrGrid): Deleted.
887         (WebCore::ComputedStyleExtractor::customPropertyValue): Deleted.
888         * css/CSSParser.cpp:
889         (WebCore::CSSParser::parseContentDistributionOverflowPosition):
890         * css/CSSPrimitiveValueMappings.h:
891         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
892         (WebCore::CSSPrimitiveValue::operator ContentPosition):
893         * rendering/RenderFlexibleBox.cpp:
894         (WebCore::normalValueBehavior):
895         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
896         (WebCore::RenderFlexibleBox::layoutColumnReverse):
897         (WebCore::RenderFlexibleBox::alignFlexLines):
898         (WebCore::alignContentSpaceBetweenChildren): Deleted.
899         * rendering/RenderGrid.cpp:
900         (WebCore::normalValueBehavior):
901         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
902         (WebCore::RenderGrid::columnAxisOffsetForChild):
903         (WebCore::RenderGrid::rowAxisOffsetForChild):
904         (WebCore::resolveContentDistributionFallback):
905         (WebCore::contentDistributionOffset):
906         (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
907         * rendering/style/RenderStyle.cpp:
908         (WebCore::resolvedContentAlignmentPosition):
909         (WebCore::resolvedContentAlignmentDistribution):
910         (WebCore::RenderStyle::resolvedJustifyContentPosition):
911         (WebCore::RenderStyle::resolvedJustifyContentDistribution):
912         (WebCore::RenderStyle::resolvedAlignContentPosition):
913         (WebCore::RenderStyle::resolvedAlignContentDistribution):
914         * rendering/style/RenderStyle.h:
915         * rendering/style/RenderStyleConstants.h:
916
917 2016-03-03  Antti Koivisto  <antti@apple.com>
918
919         Slider thumb style should not depend on renderers
920         https://bugs.webkit.org/show_bug.cgi?id=154961
921
922         Reviewed by Andreas Kling.
923
924         Currently slider thumb pseudo id is computed based on host element renderer.
925         Style is the input for building a render tree and should be computable without having one.
926
927         * html/shadow/SliderThumbElement.cpp:
928         (WebCore::SliderThumbElement::hostInput):
929         (WebCore::SliderThumbElement::customStyleForRenderer):
930
931             Compute pseudo id based on the host style.
932             Return nullptr so style recalc will otherwise proceed normally.
933
934         (WebCore::SliderThumbElement::shadowPseudoId):
935         (WebCore::SliderThumbElement::cloneElementWithoutAttributesAndChildren):
936         (WebCore::SliderContainerElement::SliderContainerElement):
937         (WebCore::SliderContainerElement::create):
938         (WebCore::SliderContainerElement::createElementRenderer):
939         (WebCore::SliderContainerElement::customStyleForRenderer):
940
941             Here too.
942
943         (WebCore::SliderContainerElement::shadowPseudoId):
944         (WebCore::sliderThumbShadowPseudoId): Deleted.
945         (WebCore::mediaSliderThumbShadowPseudoId): Deleted.
946         * html/shadow/SliderThumbElement.h:
947
948 2016-03-03  Manuel Rego Casasnovas  <rego@igalia.com>
949
950         [css-grid] Simplify method to resolve auto-placed items
951         https://bugs.webkit.org/show_bug.cgi?id=154911
952
953         Reviewed by Sergio Villar Senin.
954
955         Refactor the method to resolve auto-placed items
956         as we're only interested in knowing the span size.
957
958         Adapt the calls to use the span size instead of a GridSpan.
959
960         No new tests, no change of behavior.
961
962         * rendering/RenderGrid.cpp:
963         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
964         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
965         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
966         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
967         * rendering/style/GridResolvedPosition.cpp:
968         (WebCore::GridResolvedPosition::spanSizeForAutoPlacedItem):
969         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
970         Renamed to spanSizeForAutoPlacedItem().
971         * rendering/style/GridResolvedPosition.h:
972
973 2016-03-02  Chris Dumez  <cdumez@apple.com>
974
975         HTMLFormElement's named property getter does not return a RadioNodelist
976         https://bugs.webkit.org/show_bug.cgi?id=154949
977
978         Reviewed by Ryosuke Niwa.
979
980         HTMLFormElement's named property getter should return a RadioNodeList
981         when there are several matches:
982         https://html.spec.whatwg.org/multipage/forms.html#the-form-element
983
984         Previously, WebKit returned a generic NodeList. As a result, users
985         cannot create a white-and-gold hat in the MAKE A HAT GREAT AGAIN
986         section at:
987         https://www.washingtonpost.com/news/the-fix/wp/2015/10/06/hey-lets-all-make-our-own-donald-trump-hats/
988
989         Chrome and Firefox already match the specification. Edge will soon.
990
991         Test: fast/dom/HTMLFormElement/named-property-getter-radionodelist.html
992
993         * bindings/js/JSHTMLFormElementCustom.cpp:
994         (WebCore::JSHTMLFormElement::nameGetter):
995
996 2016-03-02  Chris Dumez  <cdumez@apple.com>
997
998         Drop [TreatNullAs=LegacyNullString] from HTMLBaseElement.href
999         https://bugs.webkit.org/show_bug.cgi?id=154952
1000
1001         Reviewed by Ryosuke Niwa.
1002
1003         Drop [TreatNullAs=LegacyNullString] from HTMLBaseElement.href as this
1004         does not match the specification:
1005         - https://html.spec.whatwg.org/multipage/semantics.html#the-base-element
1006
1007         Firefox and Chrome both convert null to the string "null".
1008
1009         No new tests, updated the following existing test:
1010         fast/dom/HTMLBaseElement/href-attribute-resolves-with-respect-to-document.html
1011
1012         * html/HTMLBaseElement.idl:
1013
1014 2016-03-02  Zalan Bujtas  <zalan@apple.com>
1015
1016         Paint table borders on empty cells even in quirks mode.
1017         https://bugs.webkit.org/show_bug.cgi?id=154928
1018
1019         Reviewed by David Hyatt.
1020
1021         Enable border painting for empty cells unless 'empty-cells: hide' is set. 
1022         This is inline with FF and Chrome behaviour.
1023
1024         Test: fast/table/border-on-empty-table-cells-quirks-mode.html
1025
1026         * rendering/RenderTableCell.cpp:
1027         (WebCore::RenderTableCell::paintBoxDecorations):
1028
1029 2016-03-02  Ryosuke Niwa  <rniwa@webkit.org>
1030
1031         HTML parser instantiates a custom element inside a template element with a wrong owner document
1032         https://bugs.webkit.org/show_bug.cgi?id=154936
1033
1034         Reviewed by Chris Dumez.
1035
1036         The bug was caused by our implementation following the old spec which didn't create a appropriate template
1037         contents owner document [1] for a document without a browsing context. The new spec no longer has this clause,
1038         and we should be always creating the appropriate template contents owner document unless the document itself
1039         is an appropriate template contents owner document for another document (comes up in nested template elements).
1040
1041         No new tests since the behavior change is covered by existing tests.
1042
1043         [1] https://html.spec.whatwg.org/#appropriate-template-contents-owner-document
1044
1045         * dom/Document.h:
1046         (WebCore::Document::templateDocument):
1047
1048 2016-03-02  Gavin Barraclough  <barraclough@apple.com>
1049
1050         PageThrottler should apply hysteresis to media activity
1051         https://bugs.webkit.org/show_bug.cgi?id=154940
1052
1053         Reviewed by Ryosuke Niwa.
1054
1055         Currently PageThrottler keeps a track of audible plugin activity and HTML media element
1056         activity separately. Audible plugin activity also gets an extra 5s hysteresis applied,
1057         so that after audio playback has completed there is a chance to queue up more audio
1058         before timer throttling kicks in. HTML audio does not get this grace. Funnel both
1059         together into a single activity flag, such that the hysteresis is applied to both.
1060
1061         * page/PageThrottler.cpp:
1062         (WebCore::PageThrottler::PageThrottler):
1063         (WebCore::m_mediaActivityHysteresis):
1064             - PageActivityState::AudiblePlugin -> PageActivityState::MediaActivity.
1065         (WebCore::m_mediaActivityCounter):
1066             - when m_mediaActivityCounter value changes call mediaActivityCounterChanged().
1067         (WebCore::PageThrottler::mediaActivityCounterChanged):
1068             - Drive PageActivityState::MediaActivity indirectly via m_mediaActivityHysteresis,
1069               such that a 5s hysteresis is applied.
1070         * page/PageThrottler.h:
1071             - Removed AudiblePlugin (merged in with MediaActivity).
1072         (WebCore::PageThrottler::pluginDidEvaluateWhileAudioIsPlaying):
1073             - m_audiblePluginHysteresis.impulse -> m_mediaActivityHysteresis.impulse.
1074
1075 2016-03-01  Ada Chan  <adachan@apple.com>
1076
1077         Update the media element's presentation mode properly after going in and out of full screen via the Full Screen API
1078         https://bugs.webkit.org/show_bug.cgi?id=154834
1079
1080         Reviewed by Simon Fraser.
1081
1082         * dom/Document.cpp:
1083         (WebCore::Document::webkitWillEnterFullScreenForElement):
1084         * dom/Element.cpp:
1085         (WebCore::Element::willBecomeFullscreenElement):
1086         * dom/Element.h:
1087         (WebCore::Element::ancestorWillEnterFullscreen):
1088         * html/HTMLMediaElement.cpp:
1089         (WebCore::HTMLMediaElement::enterFullscreen):
1090         If the Full Screen API is enabled and this media element is entering a mode other than standard
1091         full screen, see if it's currently contained in a full screen element. If so, exit full screen.
1092         (WebCore::HTMLMediaElement::willBecomeFullscreenElement):
1093         If this media element is going to standard full screen, update its presentation mode. If
1094         this media element also supports presentation mode and it currently has a presentation mode
1095         that's not standard full screen, exit that presentation mode directly without animation.
1096         (WebCore::HTMLMediaElement::willStopBeingFullscreenElement):
1097         Set the presentation mode back to inline unless it's already changed to a different
1098         presentation mode.
1099         * html/HTMLMediaElement.h:
1100         * html/HTMLVideoElement.cpp:
1101         (WebCore::HTMLVideoElement::ancestorWillEnterFullscreen):
1102         Reset this video element's presentation state to inline if its ancestor is going to full screen.
1103         (WebCore::HTMLVideoElement::exitToFullscreenModeWithoutAnimationIfPossible):
1104         If the fullscreen mode the video element is exiting from is supported, exit that mode to the new mode.
1105         * html/HTMLVideoElement.h:
1106         * page/ChromeClient.h:
1107         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1108         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1109         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
1110
1111 2016-03-02  Brady Eidson  <beidson@apple.com>
1112
1113         Modern IDB: Close UniqueIDBDatabases once they become unused.
1114         https://bugs.webkit.org/show_bug.cgi?id=154922
1115
1116         Reviewed by Alex Christensen.
1117
1118         Tests: storage/indexeddb/modern/256-open-databases.html
1119                storage/indexeddb/modern/exceed-open-file-limit.html
1120
1121         Without this change, attempts to open a 256th database in the DatabaseProcess will fail on Mac.
1122         
1123         Due to SQLite journal files, this limit could come up as early as 128 databases if they are all
1124         in active use.
1125         
1126         This is because launchd - by default - limits xpc services to having 256 open file handles by default.
1127         
1128         While we should explore raising the limit, we should also close databases we no longer need.
1129         
1130         * Modules/indexeddb/server/IDBBackingStore.h:
1131
1132         * Modules/indexeddb/server/IDBServer.cpp:
1133         (WebCore::IDBServer::IDBServer::closeUniqueIDBDatabase):
1134         (WebCore::IDBServer::IDBServer::deleteUniqueIDBDatabase): Deleted.
1135         * Modules/indexeddb/server/IDBServer.h:
1136
1137         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1138         (WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
1139
1140         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1141         (WebCore::IDBServer::MemoryIDBBackingStore::getOrEstablishDatabaseInfo):
1142         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1143
1144         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1145         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1146         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1147
1148         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1149         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1150         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
1151         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): Handle the case where opening
1152           the backing store failed by firing an error event instead of pretending everything is okay.
1153         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
1154         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1155         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
1156         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
1157         (WebCore::IDBServer::UniqueIDBDatabase::isCurrentlyInUse):
1158         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired): If the database is not
1159           currently in use, close it.
1160         (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted):
1161         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1162         (WebCore::IDBServer::UniqueIDBDatabase::deletePending): Deleted.
1163
1164         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1165         (WebCore::IDBObjectStoreInfo::isolatedCopy): Actually get this right.
1166
1167 2016-03-02  Gavin Barraclough  <barraclough@apple.com>
1168
1169         Disable timer throttling increases for visually idle / active pages.
1170         https://bugs.webkit.org/show_bug.cgi?id=154935
1171
1172         Reviewed by Chris Dumez.
1173
1174         Currently any page that is visually idle can timer throttle, and all are eligible for throttling
1175         allow throttling to increase.
1176
1177         Instead, still allow any visually idle page to timer throttle, but only allow increasing in those
1178         that are fully hidden & inactive (no page loading or media activity).
1179
1180         * page/Page.cpp:
1181         (WebCore::Page::setTimerThrottlingState):
1182             - Updated policy per commet above.
1183         (WebCore::Page::setPageActivityState):
1184         (WebCore::Page::setIsVisible):
1185             - We now may need to updated timer throttling when these change.
1186
1187 2016-03-02  Konstantin Tokarev  <annulen@yandex.ru>
1188
1189         [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
1190         https://bugs.webkit.org/show_bug.cgi?id=154651
1191
1192         Reviewed by Alex Christensen.
1193
1194         No new tests needed.
1195
1196         * CMakeLists.txt: Moved shared code to WEBKIT_FRAMEWORK macro.
1197
1198 2016-03-02  Dave Hyatt  <hyatt@apple.com>
1199
1200         Add support for the "first" value of the hanging-punctuation property.
1201         https://bugs.webkit.org/show_bug.cgi?id=154919
1202
1203         Reviewed by Simon Fraser.
1204
1205         New tests added in fast/text.
1206
1207         Implement the "first" value for hanging-punctuation as described here:
1208         https://drafts.csswg.org/css-text-3/#propdef-hanging-punctuation
1209
1210         * rendering/RenderBlockFlow.cpp:
1211         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
1212         Update the preferred logical width computation to factor in hanging punctuation.
1213         This check is similar to the text-indent logic in that we only want to do it for
1214         the first formatted line.
1215
1216         * rendering/RenderBlockFlow.h:
1217         (WebCore::RenderBlockFlow::simpleLineLayout):
1218         Make sure to turn off simple line layout when hanging punctuation is present. Eventually
1219         it should be feasible to support this in simple line layout, but since the full line
1220         layout model has to work with it anyway, we are starting there.
1221
1222         * rendering/RenderBlockLineLayout.cpp:
1223         (WebCore::inlineAncestorHasStartBorderPaddingOrMargin):
1224         (WebCore::isLastInFlowRun):
1225         Helper functions that are needed to determine whether or not we're allowed to apply
1226         hanging punctuation "first" to a text run.
1227
1228         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1229         This function manipulates logicalLeft and availableWidth when hanging punctuation
1230         is present to shift the line as needed and to expand the availableWidth of the line.
1231
1232         * rendering/RenderText.cpp:
1233         (WebCore::isHangablePunctuationAtLineStart):
1234         (WebCore::isHangablePunctuationAtLineEnd):
1235         (WebCore::RenderText::hangablePunctuationStartWidth):
1236         (WebCore::RenderText::trimmedPrefWidths):
1237         * rendering/RenderText.h:
1238         RenderText has a helper function for handing back the hangable punctuation width. This
1239         is used everywhere line layout wants to apply that offset. There are also helper functions
1240         that detect whether the character is a hangable punctuation character.
1241
1242         * rendering/SimpleLineLayout.cpp:
1243         (WebCore::SimpleLineLayout::canUseForWithReason):
1244         (WebCore::SimpleLineLayout::printReason):
1245         Turn off simple line layout when hanging punctuation is enabled.
1246
1247         * rendering/line/BreakingContext.h:
1248         (WebCore::BreakingContext::handleText):
1249         Modified to expand the available width when hanging punctuation is present so that we
1250         know we have more room on the line.
1251
1252         * rendering/line/LineWidth.h:
1253         (WebCore::LineWidth::isFirstLine):
1254         Add an accessor for whether or not we're the first line.
1255
1256 2016-03-01  Ryosuke Niwa  <rniwa@webkit.org>
1257
1258         Make HTML parser construct custom elements
1259         https://bugs.webkit.org/show_bug.cgi?id=154908
1260         <rdar://problem/24923735>
1261
1262         Reviewed by Antti Koivisto.
1263
1264         Added the support for instantiating custom elements inside the parser. Based on Jan F2F discussion,
1265         the HTML parser is going to synchronously construct custom elements. When a custom element constructor
1266         throws, the HTML parser creates a HTMLUnknownElement instead.
1267
1268         In our implementation, we pause the parser completely and construct custom elements using the same
1269         mechanism used to run author scripts. It's possible that we may want to apply some optimizations to
1270         to make custom element construction but it's probably a good idea to get semantics right first.
1271
1272         Tests: fast/custom-elements/parser/parser-constructs-custom-elements.html
1273                fast/custom-elements/parser/parser-fallsback-to-unknown-element.html
1274                fast/custom-elements/parser/parser-sets-attributes-and-children.html
1275                fast/custom-elements/parser/parser-uses-constructed-element.html
1276
1277         * bindings/js/JSCustomElementInterface.cpp:
1278         (WebCore::JSCustomElementInterface::constructElement): Added ShouldClearException as an argument
1279         to be used by the HTML parser since the parser can't re-throw to anywhere or fail parsing.
1280
1281         * bindings/js/JSCustomElementInterface.h:
1282         (WebCore::JSCustomElementInterface::ShouldClearException): Added.
1283
1284         * dom/Document.cpp:
1285         (WebCore::createHTMLElementWithNameValidation): Do not clear the exception here since createElement
1286         must re-throw the exception thrown by a custom element constructor.
1287         (WebCore::Document::createElementForBindings):
1288
1289         * dom/make_names.pl:
1290         (printFactoryCppFile): Added ConstructorFunctionMapEntry which contains the constructor function
1291         as well as the qualified name.
1292         (printFactoryHeaderFile): Added a variant of createKnownElement and createElement that takes
1293         AtomicString instead of QualifiedName.
1294
1295         * html/parser/HTMLConstructionSite.cpp:
1296         (WebCore::setAttributes): Added a variant that takes Vector<Attribute>.
1297         (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface): Added. Returns a
1298         custom element interface when the element doesn't match any builtin element and there is a custom
1299         element definition that matches the specified name.
1300         (WebCore::HTMLConstructionSite::insertCustomElement): Added. Like insertElement but also sets the
1301         attributes on the newly created custom element.
1302         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Extracted from
1303         createHTMLElement. When customElementInterface is not nullptr, we optionally find the custom
1304         element interface and return nullptr.
1305         (WebCore::HTMLConstructionSite::createHTMLElement):
1306         * html/parser/HTMLConstructionSite.h:
1307
1308         * html/parser/HTMLDocumentParser.cpp:
1309         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Create a custom element when there
1310         is a pending custom element to create (i.e. m_customElementToConstruct is not empty).
1311         (WebCore::HTMLDocumentParser::isWaitingForScripts):
1312
1313         * html/parser/HTMLStackItem.h:
1314         (WebCore::HTMLStackItem::create): Added a variant used for custom elements.
1315         (WebCore::HTMLStackItem::HTMLStackItem): Ditto.
1316
1317         * html/parser/HTMLTreeBuilder.cpp:
1318         (WebCore::CustomElementConstructionData::CustomElementConstructionData): Added. It needs to be in
1319         the cpp file to avoid introducing more header dependencies in HTMLTreeBuilder.h.
1320         (WebCore::CustomElementConstructionData::~CustomElementConstructionData): Ditto.
1321         (WebCore::HTMLTreeBuilder::processStartTagForInBody): Use insertGenericHTMLElement when creating
1322         a generic element that could be custom elements.
1323         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement): Added. Create and insert a new element
1324         or set m_customElementToConstruct so that the HTMLDocumentParser will create a custom element later.
1325         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement): Added. Called by HTMLDocumentParser
1326         when it finishes creating a new custom element.
1327
1328         * html/parser/HTMLTreeBuilder.h:
1329         (WebCore::HTMLTreeBuilder::takeCustomElementConstructionData): Added.
1330         (WebCore::HTMLTreeBuilder::hasParserBlockingScriptWork): Renamed from hasParserBlockingScript.
1331         Checks the existence of m_customElementToConstruct as well as m_scriptToProcess.
1332
1333 2016-03-02  Zalan Bujtas  <zalan@apple.com>
1334
1335         Use IndentTextOrNot instead of passing isFirstLine/shouldIndentText as bool.
1336         https://bugs.webkit.org/show_bug.cgi?id=154628
1337
1338         Reviewed by Simon Fraser.
1339
1340         No change in behaviour.
1341
1342         * rendering/RenderBlock.cpp:
1343         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
1344         (WebCore::RenderBlock::logicalLeftSelectionOffset):
1345         (WebCore::RenderBlock::logicalRightSelectionOffset):
1346         * rendering/RenderBlock.h:
1347         (WebCore::RenderBlock::availableLogicalWidthForLineInRegion):
1348         (WebCore::RenderBlock::logicalRightOffsetForLineInRegion):
1349         (WebCore::RenderBlock::logicalLeftOffsetForLineInRegion):
1350         (WebCore::RenderBlock::startOffsetForLineInRegion):
1351         (WebCore::RenderBlock::endOffsetForLineInRegion):
1352         (WebCore::RenderBlock::availableLogicalWidthForLine):
1353         (WebCore::RenderBlock::logicalRightOffsetForLine):
1354         (WebCore::RenderBlock::logicalLeftOffsetForLine):
1355         (WebCore::RenderBlock::startOffsetForLine):
1356         (WebCore::RenderBlock::endOffsetForLine):
1357         * rendering/RenderBlockFlow.cpp:
1358         (WebCore::RenderBlockFlow::getClearDelta):
1359         * rendering/RenderBlockLineLayout.cpp:
1360         (WebCore::updateLogicalInlinePositions):
1361         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1362         (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
1363         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
1364         (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
1365         * rendering/RenderBox.cpp:
1366         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
1367         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
1368         * rendering/RenderDeprecatedFlexibleBox.cpp:
1369         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
1370         * rendering/RenderListItem.cpp:
1371         (WebCore::RenderListItem::positionListMarker):
1372         * rendering/RootInlineBox.cpp:
1373         (WebCore::RootInlineBox::selectionTop):
1374         (WebCore::RootInlineBox::selectionBottom):
1375         * rendering/SimpleLineLayout.cpp:
1376         (WebCore::SimpleLineLayout::canUseForWithReason):
1377         (WebCore::SimpleLineLayout::updateLineConstrains):
1378         * rendering/line/LineBreaker.cpp:
1379         (WebCore::LineBreaker::skipLeadingWhitespace):
1380         * rendering/line/LineWidth.cpp:
1381         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
1382         (WebCore::availableWidthAtOffset):
1383         * rendering/line/LineWidth.h:
1384         (WebCore::LineWidth::shouldIndentText):
1385
1386 2016-03-02  Beth Dakin  <bdakin@apple.com>
1387
1388         Add support for playbackControlsManager
1389         https://bugs.webkit.org/show_bug.cgi?id=154742
1390         -and corresponding-
1391         rdar://problem/23833753
1392
1393         Reviewed by Jer Noble.
1394
1395         Make AVKitSPI.h private so that it can be used from other projects.
1396         * WebCore.xcodeproj/project.pbxproj:
1397
1398         Right now, set up a controls manager for a video when it starts playing. In 
1399         the future, this is something that should be handled by the 
1400         PlatformMediaSessionManager since we only want a controls for the 
1401         currentSession.
1402         * html/HTMLMediaElement.cpp:
1403         (WebCore::HTMLMediaElement::playInternal):
1404
1405         New function setUpVideoControlsManager.
1406         * page/ChromeClient.h:
1407
1408         Make these CoreMedia functions available on Mac and iOS instead of just iOS.
1409         * platform/cf/CoreMediaSoftLink.cpp:
1410         * platform/cf/CoreMediaSoftLink.h:
1411
1412         This patch fleshes out an implementation for a bunch of these interface 
1413         functions since they need to communicate to the playbackControlsManager. This 
1414         is also where the playbackControlsManager lives.
1415         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1416
1417         Define an interface and implementation for WebPlaybackControlsManager.
1418         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1419         (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
1420         (-[WebPlaybackControlsManager isSeeking]):
1421         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
1422         (-[WebPlaybackControlsManager audioMediaSelectionOptions]):
1423         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
1424         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
1425         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
1426         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
1427         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
1428         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
1429
1430         Relay this information to the playbackControlsManager.
1431         (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
1432         (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
1433         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
1434         (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
1435         (WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
1436         (WebCore::WebVideoFullscreenInterfaceMac::playBackControlsManager):
1437         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
1438
1439         New SPI needed.
1440         * platform/spi/cocoa/AVKitSPI.h:
1441         * platform/spi/mac/AVFoundationSPI.h:
1442
1443 2016-03-02  Gavin Barraclough  <barraclough@apple.com>
1444
1445         Add Page::TimerThrottlingState
1446         https://bugs.webkit.org/show_bug.cgi?id=154926
1447
1448         Reviewed by Chris Dumez.
1449
1450         Hidden page timer throttling is currently a boolean state, indicated by whether the Optional
1451         m_timerThrottlingEnabledTime is in a set/unset state. When enabled, the increasing mechanism
1452         may or may not be enabled, this is controlled directly by the setting.
1453
1454         Refactor to add an enum tracking timer throttling being in one of three states - disabled,
1455         enabled, or enabled-increasing. This cleans things up, and will enabled up to introduce a
1456         dynamic policy for when enabled-throttling is enabled. (Behavior is unchanged in this patch.)
1457
1458         * page/Page.cpp:
1459         (WebCore::Page::Page):
1460         (WebCore::Page::setIsVisuallyIdleInternal):
1461         (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged):
1462             - setTimerThrottlingEnabled -> updateTimerThrottlingState.
1463         (WebCore::Page::updateTimerThrottlingState):
1464             - policy decision (currently enabled if visually-idle) was scattered across
1465               all call sites to setTimerThrottlingState. Unify in one place.
1466         (WebCore::Page::setTimerThrottlingState):
1467             - Was setTimerThrottlingEnabled.
1468         (WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
1469         (WebCore::Page::setDOMTimerAlignmentInterval):
1470         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
1471             - updated to check m_timerThrottlingState.
1472         (WebCore::Page::setTimerThrottlingEnabled): Deleted.
1473             - This became updateTimerThrottlingState.
1474         * page/Page.h:
1475         (WebCore::Page::timerThrottlingEnabled): Deleted.
1476             - Removed, it's easy enough now to just check m_timerThrottlingState.
1477
1478 2016-03-02  Chris Dumez  <cdumez@apple.com>
1479
1480         Align HTMLInputElement.maxLength with the specification
1481         https://bugs.webkit.org/show_bug.cgi?id=154906
1482
1483         Reviewed by Ryosuke Niwa.
1484
1485         Align HTMLInputElement.maxLength with the specification:
1486         - https://html.spec.whatwg.org/multipage/forms.html#dom-input-maxlength
1487         - https://html.spec.whatwg.org/multipage/forms.html#attr-input-maxlength
1488
1489         In particular, the following Web-facing change was made:
1490         - HTMLInputElement.maxLength returns -1 instead of 524288 when
1491           the corresponding content attribute is missing, cannot be parsed
1492           or out of range (i.e. negative), as per:
1493           - https://html.spec.whatwg.org/multipage/infrastructure.html#limited-to-only-non-negative-numbers
1494
1495         Note that HTMLTextAreaElement.maxLength was already returning -1 in
1496         this case.
1497
1498         The new behavior matches Firefox. Chrome however, still seems to
1499         return 524288.
1500
1501         Note that we keep using 524288 as a maximum maxLength internally for
1502         performance reasons. However, we stop exposing this arbitrary value to
1503         the Web as this is an internal limitation.
1504
1505         No new tests, already covered by existing tests.
1506
1507         * html/HTMLInputElement.cpp:
1508         (WebCore::HTMLInputElement::HTMLInputElement):
1509         Initialize m_maxLength to -1 initially, instead of 524288.
1510
1511         (WebCore::HTMLInputElement::tooLong):
1512         Call effectiveMaxLength() instead of maxLength(), which no longer
1513         exists. effectiveMaxLength() makes sure of returning a value in
1514         the range [0, 524288].
1515
1516         (WebCore::HTMLInputElement::parseAttribute):
1517
1518         (WebCore::HTMLInputElement::effectiveMaxLength):
1519         Split maxLength() into maxLengthForBindings() and effectiveMaxLength().
1520         effectiveMaxLength() returns a value in the range [0, 524288], while
1521         maxLengthForBindings() returns values in the range [-1, 2147483647].
1522
1523         (WebCore::HTMLInputElement::setMaxLength): Deleted.
1524         The implementation was moved to the parent class so that it can be
1525         shared with HTMLTextAreaElement.
1526
1527         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
1528         Rename for clarity.
1529
1530         * html/HTMLTextAreaElement.cpp:
1531         (WebCore::HTMLTextAreaElement::parseAttribute):
1532         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
1533         Cache the parsed maxLength when the content attribute changes, similarly
1534         to what is already done in HTMLInputElement.
1535
1536         (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
1537         (WebCore::HTMLTextAreaElement::validationMessage):
1538         (WebCore::HTMLTextAreaElement::tooLong):
1539         Call effectiveMaxLength() instead of maxLength() which no longer exists.
1540         effectiveMaxLength() returns a cached value and is therefore a lot more
1541         efficient.
1542
1543         * html/HTMLTextAreaElement.h:
1544         * html/HTMLTextAreaElement.idl:
1545         * html/HTMLTextFormControlElement.cpp:
1546         (WebCore::HTMLTextFormControlElement::setMaxLengthForBindings):
1547         This was moved up from HTMLInputElement / HTMLTextAreaElement to avoid code
1548         duplication.
1549
1550         * html/HTMLTextFormControlElement.h:
1551
1552         * html/InputType.cpp:
1553         (WebCore::InputType::validationMessage):
1554         * html/TextFieldInputType.cpp:
1555         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
1556         Call HTMLInputElement::effectiveMaxLength() instead of
1557         HTMLInputElement::maxLength() which no longer exists.
1558
1559 2016-03-02  Commit Queue  <commit-queue@webkit.org>
1560
1561         Unreviewed, rolling out r197434 and r197436.
1562         https://bugs.webkit.org/show_bug.cgi?id=154921
1563
1564         This change caused a LayoutTest assertion in debug (Requested
1565         by ryanhaddad on #webkit).
1566
1567         Reverted changesets:
1568
1569         "Extend CSSFontSelector's lifetime to be longer than the
1570         Document's lifetime"
1571         https://bugs.webkit.org/show_bug.cgi?id=154101
1572         http://trac.webkit.org/changeset/197434
1573
1574         "Unreviewed build fix after r197434."
1575         http://trac.webkit.org/changeset/197436
1576
1577 2016-03-02  Zalan Bujtas  <zalan@apple.com>
1578
1579         Subpixel layout: Enable vertical/horizontal subpixel spacing for tables.
1580         https://bugs.webkit.org/show_bug.cgi?id=154899
1581
1582         Reviewed by Simon Fraser.
1583
1584         This patch enables authors to specify device pixel values for table border spacing.
1585         (see border-spacing)
1586
1587         Test: fast/table/hidpi-vertical-and-horizontal-spacing.html
1588
1589         * css/CSSPropertyNames.in:
1590         * page/animation/CSSPropertyAnimation.cpp:
1591         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1592         * rendering/RenderTable.cpp:
1593         (WebCore::RenderTable::offsetLeftForColumn):
1594         (WebCore::RenderTable::offsetWidthForColumn):
1595         (WebCore::RenderTable::RenderTable): Deleted.
1596         * rendering/RenderTable.h:
1597         * rendering/style/RenderStyle.cpp:
1598         (WebCore::RenderStyle::horizontalBorderSpacing):
1599         (WebCore::RenderStyle::verticalBorderSpacing):
1600         (WebCore::RenderStyle::setHorizontalBorderSpacing):
1601         (WebCore::RenderStyle::setVerticalBorderSpacing):
1602         * rendering/style/RenderStyle.h:
1603         * rendering/style/StyleInheritedData.h:
1604
1605 2016-03-02  Chris Dumez  <cdumez@apple.com>
1606
1607         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use WTF::Optional
1608         https://bugs.webkit.org/show_bug.cgi?id=154845
1609
1610         Reviewed by Darin Adler.
1611
1612         Take into consideration review comments made after landing r197389.
1613
1614         * html/HTMLElement.cpp:
1615         (WebCore::HTMLElement::parseBorderWidthAttribute):
1616         (WebCore::HTMLElement::parseAttribute):
1617         * html/HTMLInputElement.cpp:
1618         * html/HTMLInputElement.h:
1619         * html/HTMLTextAreaElement.cpp:
1620         (WebCore::HTMLTextAreaElement::maxLength):
1621         * html/ImageInputType.cpp:
1622         (WebCore::ImageInputType::height):
1623         (WebCore::ImageInputType::width):
1624         * html/parser/HTMLParserIdioms.cpp:
1625         (WebCore::parseHTMLNonNegativeInteger):
1626         * html/parser/HTMLParserIdioms.h:
1627         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
1628         (WebCore::limitToOnlyHTMLNonNegative):
1629         * svg/SVGElement.cpp:
1630         (WebCore::SVGElement::parseAttribute):
1631
1632 2016-03-01  Ryosuke Niwa  <rniwa@webkit.org>
1633
1634         Unreviewed. Remove the "Partial Support" status from web components since shadow DOM and custom elements
1635         are in active development.
1636
1637         * features.json:
1638
1639 2016-03-01  Ryosuke Niwa  <rniwa@webkit.org>
1640
1641         Unreviewed. Update the feature status for custom elements API.
1642
1643         * features.json:
1644
1645 2016-02-26  Ryosuke Niwa  <rniwa@webkit.org>
1646
1647         Contents inside a shadow host with a negative tabindex should not be tab focusable
1648         https://bugs.webkit.org/show_bug.cgi?id=154769
1649
1650         Reviewed by Antti Koivisto.
1651
1652         Contents inside a shadow host with a negative tabindex content attribute should not be included in
1653         the sequential focus navigation order as discussed on https://github.com/w3c/webcomponents/issues/399.
1654
1655         Test: fast/shadow-dom/negative-tabindex-on-shadow-host.html
1656
1657         * dom/Element.cpp:
1658         (WebCore::Element::tabIndexSetExplicitly): Added.
1659         * dom/Element.h:
1660         * page/FocusController.cpp:
1661         (WebCore::shadowAdjustedTabIndex): Renamed from adjustedTabIndex. Return 0 when tabindex content attribute
1662         is not explicitly set since element.tabIndex() would return -1 for HTML elements in such case.
1663         (WebCore::isFocusableOrHasShadowTreeWithoutCustomFocusLogic): Renamed from shouldVisit.
1664         (WebCore::FocusController::findElementWithExactTabIndex):
1665         (WebCore::nextElementWithGreaterTabIndex):
1666         (WebCore::previousElementWithLowerTabIndex):
1667         (WebCore::FocusController::nextFocusableElement):
1668         (WebCore::FocusController::previousFocusableElement):
1669
1670 2016-03-01  Michael Saboff  <msaboff@apple.com>
1671
1672         REGRESSION (r197426): Missed adding unicode parameter to call to Yarr::parse() in URLFilterParser::addPattern()
1673         https://bugs.webkit.org/show_bug.cgi?id=154898
1674
1675         Reviewed by Saam Barati.
1676
1677         This is a fix for the API tests after r197426.
1678
1679         Added missing bool unicode parameter of "false".
1680
1681         * contentextensions/URLFilterParser.cpp:
1682         (WebCore::ContentExtensions::URLFilterParser::addPattern):
1683
1684 2016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
1685
1686         Unreviewed build fix after r197434.
1687
1688         Unreviewed
1689
1690         * css/SourceSizeList.cpp:
1691         (WebCore::parseSizesAttribute):
1692
1693 2016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
1694
1695         Small-caps non-BMP characters are garbled in the complex text codepath
1696         https://bugs.webkit.org/show_bug.cgi?id=154875
1697
1698         Reviewed by Michael Saboff.
1699
1700         We were assuming that all characters able to be capitalized are in BMP. This is not true.
1701
1702         Test: fast/text/complex-small-caps-non-bmp-capitalize.html
1703
1704         * platform/graphics/mac/ComplexTextController.cpp:
1705         (WebCore::capitalized):
1706         (WebCore::ComplexTextController::collectComplexTextRuns):
1707
1708 2016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
1709
1710         Extend CSSFontSelector's lifetime to be longer than the Document's lifetime
1711         https://bugs.webkit.org/show_bug.cgi?id=154101
1712
1713         Reviewed by Darin Adler.
1714
1715         Rather than destroying the Document's CSSFontSelector, instead, the object should
1716         live for the lifetime of the document, and it should instead be asked to clear its
1717         contents.
1718
1719         This is important for the CSS Font Loading API, where the identity of objects the
1720         CSSFontSelector references needs to persist throughout the lifetime of the
1721         Document. This patch represents the first step to implementing this correctly.
1722         The second step is for the CSSFontSelector to perform a diff instead of a
1723         wholesale clear of its contents. Once this is done, font loading objects can
1724         survive through a call to Document::clearStyleResolver().
1725
1726         This patch gives the CSSFontSelector two states: building underway and building not
1727         underway. The state is building underway in between calls to clearStyleResolver()
1728         and when the style resolver gets built back up. Otherwise, the state is building
1729         not underway. Because of this new design, creation of all FontFace objects can be
1730         postponed until a state transition from building underway to building not underway.
1731         A subsequent patch will perform the diff at this point. An ASSERT() makes sure that
1732         we never service a font lookup request while Building.
1733
1734         No new tests because there is no behavior change.
1735
1736         * css/CSSFontFaceSet.cpp:
1737         (WebCore::CSSFontFaceSet::clear):
1738         * css/CSSFontSelector.cpp:
1739         (WebCore::CSSFontSelector::buildStarted):
1740         (WebCore::CSSFontSelector::buildCompleted):
1741         (WebCore::CSSFontSelector::addFontFaceRule):
1742         (WebCore::CSSFontSelector::fontRangesForFamily):
1743         (WebCore::CSSFontSelector::CSSFontSelector): Deleted.
1744         (WebCore::CSSFontSelector::clearDocument): Deleted.
1745         * css/CSSFontSelector.h:
1746         * css/StyleResolver.cpp:
1747         (WebCore::StyleResolver::appendAuthorStyleSheets):
1748         * dom/Document.cpp:
1749         (WebCore::Document::Document):
1750         (WebCore::Document::~Document):
1751         (WebCore::Document::clearStyleResolver):
1752         (WebCore::Document::fontSelector): Deleted.
1753         * dom/Document.h:
1754         (WebCore::Document::fontSelector):
1755
1756 2016-03-01  Alexey Proskuryakov  <ap@apple.com>
1757
1758         Update Xcode project for InstallAPI
1759         https://bugs.webkit.org/show_bug.cgi?id=154896
1760         rdar://problem/24825992
1761
1762         Patch by Daniel Dunbar, reviewed by me.
1763
1764         * Configurations/WebCore.xcconfig:
1765         * WebCore.xcodeproj/project.pbxproj:
1766
1767 2016-03-01  Ada Chan  <adachan@apple.com>
1768
1769         One more attempt to fix the build.
1770
1771         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1772         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
1773
1774 2016-03-01  Ada Chan  <adachan@apple.com>
1775
1776         Attempt to fix the internal build.
1777
1778         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1779         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
1780
1781 2016-02-29  Ada Chan  <adachan@apple.com>
1782
1783         Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
1784         https://bugs.webkit.org/show_bug.cgi?id=154823
1785
1786         Reviewed by Tim Horton.
1787
1788         * Modules/mediasession/WebMediaSessionManager.cpp:
1789         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
1790         (WebCore::WebMediaSessionManager::customPlaybackActionSelected):
1791         Call customPlaybackActionSelected() on the client that requested the picker.
1792         * Modules/mediasession/WebMediaSessionManager.h:
1793         * Modules/mediasession/WebMediaSessionManagerClient.h:
1794         * dom/Document.cpp:
1795         (WebCore::Document::showPlaybackTargetPicker):
1796         (WebCore::Document::customPlaybackActionSelected):
1797         * dom/Document.h:
1798         * html/HTMLMediaElement.cpp:
1799         (WebCore::HTMLMediaElement::customPlaybackActionSelected):
1800         (WebCore::HTMLMediaElement::playbackTargetPickerCustomActionName):
1801         * html/HTMLMediaElement.h:
1802         * html/MediaElementSession.cpp:
1803         (WebCore::MediaElementSession::showPlaybackTargetPicker):
1804         (WebCore::MediaElementSession::customPlaybackActionSelected):
1805         * html/MediaElementSession.h:
1806         * page/ChromeClient.h:
1807         * page/Page.cpp:
1808         (WebCore::Page::showPlaybackTargetPicker):
1809         (WebCore::Page::customPlaybackActionSelected):
1810         * page/Page.h:
1811         * platform/audio/PlatformMediaSession.h:
1812         (WebCore::PlatformMediaSessionClient::customPlaybackActionSelected):
1813         * platform/graphics/MediaPlaybackTargetClient.h:
1814         * platform/graphics/MediaPlaybackTargetPicker.cpp:
1815         (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
1816         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
1817         * platform/graphics/MediaPlaybackTargetPicker.h:
1818         (WebCore::MediaPlaybackTargetPicker::Client::customPlaybackActionSelected):
1819         (WebCore::MediaPlaybackTargetPicker::customPlaybackActionSelected):
1820         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
1821         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1822         Update the forward declaration of AVOutputDeviceMenuController's showMenuForRect method.
1823         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
1824         Call the new version of showMenuForRect if available.
1825         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1826         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1827         (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback):
1828         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
1829         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
1830         * platform/mock/MediaPlaybackTargetPickerMock.h:
1831         * platform/spi/cocoa/AVKitSPI.h:
1832         Updated with the new version of showMenuForRect.
1833
1834 2016-03-01  Daniel Bates  <dabates@apple.com>
1835
1836         com.apple.WebKit.Networking.Development crashes in WebCore::formOpen()
1837         https://bugs.webkit.org/show_bug.cgi?id=154682
1838         <rdar://problem/23550269>
1839
1840         Reviewed by Brent Fulgham.
1841
1842         Speculative fix for a race condition when opening the stream for the next form data element.
1843         Calling CFReadStreamOpen(s) in WebCore::openNextStream() can cause stream s to be closed and
1844         deallocated before CFReadStreamOpen(s) returns.
1845
1846         When WebCore::openNextStream() is called it closes and deallocates the current stream and
1847         then opens a new stream for the next form data element. Calling CFReadStreamOpen() in
1848         WebCore::openNextStream() can lead to WebCore::openNextStream() being re-entered via
1849         WebCore::formEventCallback() from another thread. One example when this can occur is when
1850         the stream being opened has no data (i.e. WebCore::formEventCallback() is called
1851         back with event type kCFStreamEventEndEncountered).
1852
1853         I have been unable to reproduce this crash. We know that it occurs from crash reports.
1854
1855         * platform/network/cf/FormDataStreamCFNet.cpp:
1856         (WebCore::closeCurrentStream): Assert that we had acquired a lock to close the stream.
1857         (WebCore::advanceCurrentStream): Assert that we had acquired a lock to advance the stream.
1858         (WebCore::openNextStream): Acquire a lock before we open the next stream to ensure that
1859         exactly one thread executes this critical section at a time.
1860         (WebCore::formFinalize): Acquire a lock before we close the current stream.
1861         (WebCore::formClose): Ditto.
1862
1863 2016-03-01  Michael Saboff  <msaboff@apple.com>
1864
1865         ASSERT in platform/graphics/mac/ComplexTextController.cpp::capitalize()
1866         https://bugs.webkit.org/show_bug.cgi?id=154875
1867
1868         Reviewed by Myles C. Maxfield.
1869
1870         Change an ASSERT to verify that uper casing a character doesn't change its size.
1871
1872         Test: fast/text/regress-154875.html
1873
1874         * platform/graphics/mac/ComplexTextController.cpp:
1875         (WebCore::capitalized):
1876
1877 2016-03-01  Gavin Barraclough  <barraclough@apple.com>
1878
1879         Timer alignment in separate web processes should not all sync up to the same point.
1880         https://bugs.webkit.org/show_bug.cgi?id=154878
1881
1882         Reviewed by Chris Dumez.
1883
1884         For any given WebContent process it is desirable that timers are synchronized to a single
1885         alignment point, but if all WebContent processes align to the same point then there may
1886         be a thundering herd of processes waking up.
1887
1888         * page/DOMTimer.cpp:
1889         (WebCore::DOMTimer::alignedFireTime):
1890             - align to a randomized point.
1891
1892 2016-03-01  Alex Christensen  <achristensen@webkit.org>
1893
1894         Reduce size of internal windows build output
1895         https://bugs.webkit.org/show_bug.cgi?id=154763
1896
1897         Reviewed by Brent Fulgham.
1898
1899         * WebCore.vcxproj/WebCore.proj:
1900
1901 2016-03-01  Andreas Kling  <akling@apple.com>
1902
1903         REGRESSION (r154616): Accelerated drawing is off during the initial load
1904         <https://webkit.org/b/123812>
1905
1906         Reviewed by Tim Horton.
1907
1908         Robustify the hey-the-Settings-changed callbacks in Page to handle document-less frames.
1909         This is needed because now Settings are changed even before the main Frame has a Document.
1910
1911         * page/Page.cpp:
1912         (WebCore::networkStateChanged):
1913         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
1914         (WebCore::Page::takeAnyMediaCanStartListener):
1915         (WebCore::Page::setMediaVolume):
1916         (WebCore::Page::setPageScaleFactor):
1917         (WebCore::Page::invalidateStylesForAllLinks):
1918         (WebCore::Page::invalidateStylesForLink):
1919         (WebCore::Page::dnsPrefetchingStateChanged):
1920         (WebCore::Page::storageBlockingStateChanged):
1921         (WebCore::Page::setMuted):
1922         (WebCore::Page::captionPreferencesChanged):
1923         (WebCore::Page::setSessionID):
1924         (WebCore::Page::setPlaybackTarget):
1925         (WebCore::Page::playbackTargetAvailabilityDidChange):
1926         (WebCore::Page::setShouldPlayToPlaybackTarget):
1927         * page/Settings.cpp:
1928         (WebCore::setImageLoadingSettings):
1929
1930 2016-03-01  Commit Queue  <commit-queue@webkit.org>
1931
1932         Unreviewed, rolling out r197056.
1933         https://bugs.webkit.org/show_bug.cgi?id=154870
1934
1935         broke win ews (Requested by alexchristensen on #webkit).
1936
1937         Reverted changeset:
1938
1939         "[cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK."
1940         https://bugs.webkit.org/show_bug.cgi?id=154651
1941         http://trac.webkit.org/changeset/197056
1942
1943 2016-03-01  Brady Eidson  <beidson@apple.com>
1944
1945         Modern IDB: Possible crash deallocating IDBDatabaseInfo/IDBObjectStoreInfo/IDBIndexInfo.
1946         https://bugs.webkit.org/show_bug.cgi?id=154860
1947
1948         Reviewed by Alex Christensen.
1949
1950         Covered by existing tests.
1951
1952         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1953         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
1954         (WebCore::IDBDatabaseInfo::isolatedCopy):
1955         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1956
1957         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
1958         (WebCore::IDBTransactionInfo::isolatedCopy): If there's an IDBDatabaseInfo to copy,  that
1959           copy needs to be isolated.
1960
1961 2016-03-01  Tim Horton  <timothy_horton@apple.com>
1962
1963         Expose MediaElement and VideoElement to the Objective-C DOM bindings
1964         https://bugs.webkit.org/show_bug.cgi?id=154830
1965
1966         Reviewed by Sam Weinig.
1967
1968         * Modules/mediasession/HTMLMediaElementMediaSession.idl:
1969         * Modules/mediastream/HTMLMediaElementMediaStream.idl:
1970         * html/HTMLMediaElement.idl:
1971         * html/HTMLVideoElement.idl:
1972         Avoid Objective-C bindings for various extraneous bits, like MediaSource and MediaSession,
1973         to avoid exposing way more than we need to.
1974
1975         * WebCore.xcodeproj/project.pbxproj:
1976         Add a bunch of Derived Sources.
1977
1978 2016-03-01  Antti Koivisto  <antti@apple.com>
1979
1980         Text control shadow element style shouldn't depend on renderers
1981         https://bugs.webkit.org/show_bug.cgi?id=154855
1982
1983         Reviewed by Andreas Kling.
1984
1985         Currently the code for computing style for text control shadow elements lives in render tree.
1986         Style is the input for building a render tree and should be computable without having one.
1987
1988         Fix by moving virtual createInnerTextStyle() from RenderTextControl hierarchy to the DOM side
1989         HTMLTextFormControlElement hierarchy.
1990
1991         * dom/Element.cpp:
1992         (WebCore::Element::didDetachRenderers):
1993         (WebCore::Element::customStyleForRenderer):
1994
1995             Also pass shadow host style as it is needed for text controls.
1996
1997         * dom/Element.h:
1998         * dom/PseudoElement.cpp:
1999         (WebCore::PseudoElement::clearHostElement):
2000         (WebCore::PseudoElement::customStyleForRenderer):
2001         * dom/PseudoElement.h:
2002         * html/HTMLInputElement.cpp:
2003         (WebCore::HTMLInputElement::setRangeText):
2004         (WebCore::HTMLInputElement::createInnerTextStyle):
2005         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
2006         * html/HTMLInputElement.h:
2007         * html/HTMLTextAreaElement.cpp:
2008         (WebCore::HTMLTextAreaElement::willRespondToMouseClickEvents):
2009         (WebCore::HTMLTextAreaElement::createInnerTextStyle):
2010         * html/HTMLTextAreaElement.h:
2011         * html/HTMLTextFormControlElement.cpp:
2012         (WebCore::HTMLTextFormControlElement::directionForFormData):
2013         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle):
2014         * html/HTMLTextFormControlElement.h:
2015         (WebCore::HTMLTextFormControlElement::cachedSelectionDirection):
2016         * html/shadow/TextControlInnerElements.cpp:
2017         (WebCore::TextControlInnerElement::create):
2018         (WebCore::TextControlInnerElement::customStyleForRenderer):
2019         (WebCore::TextControlInnerTextElement::renderer):
2020         (WebCore::TextControlInnerTextElement::customStyleForRenderer):
2021         * html/shadow/TextControlInnerElements.h:
2022         * rendering/RenderTextControl.cpp:
2023         (WebCore::RenderTextControl::styleDidChange):
2024         (WebCore::RenderTextControl::textBlockLogicalHeight):
2025         (WebCore::RenderTextControl::adjustInnerTextStyle): Deleted.
2026         * rendering/RenderTextControl.h:
2027         * rendering/RenderTextControlMultiLine.cpp:
2028         (WebCore::RenderTextControlMultiLine::baselinePosition):
2029         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
2030         (WebCore::RenderTextControlMultiLine::createInnerTextStyle): Deleted.
2031
2032             createInnerTextStyle moves to HTMLTextAreaElement::createInnerTextStyle
2033
2034         * rendering/RenderTextControlMultiLine.h:
2035         * rendering/RenderTextControlSingleLine.cpp:
2036         (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
2037
2038             Remove m_desiredInnerTextLogicalHeight cache. It doesn't work, it is never valid when hit.
2039
2040         (WebCore::RenderTextControlSingleLine::layout):
2041         (WebCore::RenderTextControlSingleLine::styleDidChange):
2042         (WebCore::RenderTextControlSingleLine::computeControlLogicalHeight):
2043         (WebCore::RenderTextControlSingleLine::textShouldBeTruncated):
2044         (WebCore::RenderTextControlSingleLine::createInnerTextStyle): Deleted.
2045         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Deleted.
2046
2047             - createInnerTextStyle moves to HTMLInputElement::createInnerTextStyle
2048             - createInnerBlockStyle moves to TextControlInnerElement::customStyleForRenderer
2049
2050         * rendering/RenderTextControlSingleLine.h:
2051         (WebCore::RenderTextControlSingleLine::centerContainerIfNeeded):
2052         (WebCore::RenderTextControlSingleLine::containerElement):
2053         * style/StyleTreeResolver.cpp:
2054         (WebCore::Style::TreeResolver::styleForElement):
2055         * svg/SVGElement.cpp:
2056         (WebCore::SVGElement::synchronizeSystemLanguage):
2057         (WebCore::SVGElement::customStyleForRenderer):
2058         * svg/SVGElement.h:
2059
2060 2016-03-01  Manuel Rego Casasnovas  <rego@igalia.com>
2061
2062         [css-grid] Get rid of GridResolvedPosition
2063         https://bugs.webkit.org/show_bug.cgi?id=154818
2064
2065         Reviewed by Darin Adler.
2066
2067         GridResolvedPosition was a small class just wrapping a unsigned.
2068         In the future it should actually wrap an integer,
2069         as we want to support implicit tracks before the explicit grid.
2070
2071         The class itself is not providing any benefit,
2072         so we can get rid of it and store directly 2 unsigned in GridSpan.
2073
2074         This will make simpler future changes related to this task.
2075
2076         We keep the class just as a utility for the methods
2077         that deal with the positions resolution.
2078         But it should be renamed in a follow-up patch.
2079
2080         No new tests, no change of behavior.
2081
2082         * css/CSSGridTemplateAreasValue.cpp:
2083         (WebCore::stringForPosition):
2084         * css/CSSParser.cpp:
2085         (WebCore::CSSParser::parseGridTemplateAreasRow):
2086         * css/StyleBuilderConverter.h:
2087         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
2088         * rendering/RenderGrid.cpp:
2089         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2090         (WebCore::RenderGrid::findFlexFactorUnitSize):
2091         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks):
2092         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
2093         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2094         (WebCore::RenderGrid::insertItemIntoGrid):
2095         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2096         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
2097         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2098         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2099         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2100         (WebCore::RenderGrid::gridAreaBreadthForChild):
2101         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
2102         (WebCore::RenderGrid::columnAxisOffsetForChild):
2103         (WebCore::RenderGrid::rowAxisOffsetForChild):
2104         * rendering/style/GridCoordinate.h:
2105         (WebCore::GridSpan::definiteGridSpan):
2106         (WebCore::GridSpan::integerSpan):
2107         (WebCore::GridSpan::resolvedInitialPosition):
2108         (WebCore::GridSpan::resolvedFinalPosition):
2109         (WebCore::GridSpan::GridSpanIterator::GridSpanIterator):
2110         (WebCore::GridSpan::GridSpanIterator::operator*):
2111         (WebCore::GridSpan::GridSpanIterator::operator++):
2112         (WebCore::GridSpan::GridSpanIterator::operator!=):
2113         (WebCore::GridSpan::begin):
2114         (WebCore::GridSpan::end):
2115         (WebCore::GridSpan::GridSpan):
2116         * rendering/style/GridResolvedPosition.cpp:
2117         (WebCore::resolveNamedGridLinePositionFromStyle):
2118         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
2119         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
2120         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
2121         (WebCore::resolveGridPositionAgainstOppositePosition):
2122         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
2123         (WebCore::resolveGridPositionFromStyle):
2124         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
2125         * rendering/style/GridResolvedPosition.h:
2126         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
2127         (WebCore::GridResolvedPosition::operator*): Deleted.
2128         (WebCore::GridResolvedPosition::operator++): Deleted.
2129         (WebCore::GridResolvedPosition::operator==): Deleted.
2130         (WebCore::GridResolvedPosition::operator!=): Deleted.
2131         (WebCore::GridResolvedPosition::operator<): Deleted.
2132         (WebCore::GridResolvedPosition::operator>): Deleted.
2133         (WebCore::GridResolvedPosition::operator<=): Deleted.
2134         (WebCore::GridResolvedPosition::operator>=): Deleted.
2135         (WebCore::GridResolvedPosition::toInt): Deleted.
2136         (WebCore::GridResolvedPosition::next): Deleted.
2137         (WebCore::GridResolvedPosition::prev): Deleted.
2138
2139 2016-03-01  Andreas Kling  <akling@apple.com>
2140
2141         MemoryCache::forEachResource() should guard resources across function invocation.
2142         <https://webkit.org/b/154846>
2143
2144         Reviewed by Antti Koivisto.
2145
2146         It occurred to me that we should protect the CachedResources from being
2147         deleted while invoking the custom function here, lest we create a giant footgun.
2148
2149         * loader/cache/MemoryCache.cpp:
2150         (WebCore::MemoryCache::forEachResource):
2151
2152 2016-03-01  Csaba Osztrogonác  <ossy@webkit.org>
2153
2154         [Mac][cmake] One more unreviewed speculative buildfix after r197375. Just for fun.
2155
2156         * PlatformMac.cmake:
2157
2158 2016-03-01  Csaba Osztrogonác  <ossy@webkit.org>
2159
2160         [Mac][cmake] Unreviewed speculative buildfix after r197375. Just for fun.
2161
2162         * PlatformMac.cmake:
2163
2164 2016-03-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2165
2166         [Fetch API] Support Request and Response blob() when body data is a blob
2167         https://bugs.webkit.org/show_bug.cgi?id=154820
2168
2169         Reviewed by Darin Adler.
2170
2171         Adding support for returning the same Blob that is stored in Body in case JS blob() is called.
2172         Adding support for Blob creation when data is stored as text.
2173         Updated JSDOMBinding and JSDOMPromise to return a JS ArrayBuffer for Vector<char> as well as Vector<unsigned char>.
2174
2175         Covered by added tests.
2176
2177         * Modules/fetch/FetchBody.cpp:
2178         (WebCore::FetchBody::arrayBuffer):
2179         (WebCore::FetchBody::blob):
2180         (WebCore::FetchBody::extractFromText):
2181         * Modules/fetch/FetchBody.h:
2182         * bindings/js/JSDOMBinding.h:
2183         (WebCore::toJS):
2184         * bindings/js/JSDOMPromise.h:
2185         (WebCore::DeferredWrapper::resolve): Deleted.
2186
2187 2016-02-29  Chris Dumez  <cdumez@apple.com>
2188
2189         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use WTF::Optional
2190         https://bugs.webkit.org/show_bug.cgi?id=154845
2191
2192         Reviewed by Ryosuke Niwa.
2193
2194         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use
2195         WTF::Optional.
2196
2197         * dom/Element.cpp:
2198         (WebCore::Element::getIntegralAttribute):
2199         (WebCore::Element::getUnsignedIntegralAttribute):
2200         (WebCore::Element::setUnsignedIntegralAttribute): Deleted.
2201         * html/HTMLElement.cpp:
2202         (WebCore::HTMLElement::parseBorderWidthAttribute):
2203         (WebCore::HTMLElement::parseAttribute):
2204         * html/HTMLInputElement.cpp:
2205         (WebCore::HTMLInputElement::parseMaxLengthAttribute):
2206         * html/HTMLInputElement.h:
2207         * html/HTMLOListElement.cpp:
2208         (WebCore::HTMLOListElement::parseAttribute):
2209         * html/HTMLTextAreaElement.cpp:
2210         (WebCore::HTMLTextAreaElement::maxLength):
2211         * html/ImageInputType.cpp:
2212         (WebCore::ImageInputType::height):
2213         (WebCore::ImageInputType::width):
2214         * html/parser/HTMLParserIdioms.cpp:
2215         (WebCore::parseHTMLIntegerInternal):
2216         (WebCore::parseHTMLInteger):
2217         (WebCore::parseHTMLNonNegativeInteger):
2218         * html/parser/HTMLParserIdioms.h:
2219         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
2220         (WebCore::limitToOnlyHTMLNonNegative):
2221         * svg/SVGElement.cpp:
2222         (WebCore::SVGElement::parseAttribute):
2223
2224 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2225
2226         TextureMapperGL: simplify TransformationMatrix copies in draw(), beginClip()
2227         https://bugs.webkit.org/show_bug.cgi?id=154791
2228
2229         Reviewed by Carlos Garcia Campos.
2230
2231         In both functions, the passed-in model-view matrix is first copied, multiplied
2232         against a rect-to-rect TransformationMatrix, and then assigned into a local
2233         TransformationMatrix variable, which causes another copy due to the multiply()
2234         function returning a reference to the modified object.
2235
2236         To avoid the last copy, first copy the model-view matrix into a local variable,
2237         and multiply the rect-to-rect TransformationMatrix into the new object afterwards.
2238
2239         * platform/graphics/texmap/TextureMapperGL.cpp:
2240         (WebCore::TextureMapperGL::draw):
2241         (WebCore::TextureMapperGL::beginClip):
2242
2243 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2244
2245         ImageBufferCairo should support OpenGL ES 2 configurations
2246         https://bugs.webkit.org/show_bug.cgi?id=154790
2247
2248         Reviewed by Carlos Garcia Campos.
2249
2250         When building with OpenGL ES 2 and with accelerated 2D canvas support,
2251         the GLES2 header should be included instead of the OpenGLShims.h header.
2252
2253         The glTexParameterf() calls targeting GL_TEXTURE_WRAP_S and
2254         GL_TEXTURE_WRAP_T parameters should use the GL_CLAMP_TO_EDGE value.
2255         GL_CLAMP isn't available in OpenGL ES 2 and was dropped in OpenGL 3.
2256
2257         * platform/graphics/cairo/ImageBufferCairo.cpp:
2258         (WebCore::ImageBufferData::createCairoGLSurface):
2259
2260 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2261
2262         TextureMapperGL: beginPainting() should handle the PaintingMirrored value in PaintFlags
2263         https://bugs.webkit.org/show_bug.cgi?id=154789
2264
2265         Reviewed by Carlos Garcia Campos.
2266
2267         * platform/graphics/texmap/TextureMapperGL.cpp:
2268         (WebCore::TextureMapperGL::beginPainting): The ClipStack should be reset with
2269         a Y-axis mode that corresponds to the presence of the PaintingMirrored value in
2270         the passed-in PaintFlags argument. If present, the default Y-axis mode should be
2271         used, and the inverted Y-axis otherwise.
2272
2273 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2274
2275         CoordinatedGraphicsLayer should override the inherited TextureMapperPlatformLayer::Client methods
2276         https://bugs.webkit.org/show_bug.cgi?id=154788
2277
2278         Reviewed by Carlos Garcia Campos.
2279
2280         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2281         Add the override specifiers for the two methods that are inherited
2282         from the TextureMapperPlatformLayer::Client interface.
2283
2284 2016-02-29  Simon Fraser  <simon.fraser@apple.com>
2285
2286         Remove the experimental feature of antialiased font dilation
2287         https://bugs.webkit.org/show_bug.cgi?id=154843
2288
2289         Reviewed by Zalan Bujtas.
2290         
2291         Remove the "antialiased font dilation" code path, and related prefs.
2292
2293         * page/Settings.cpp:
2294         (WebCore::Settings::Settings): Deleted.
2295         (WebCore::Settings::setAntialiasedFontDilationEnabled): Deleted.
2296         * page/Settings.h:
2297         (WebCore::Settings::antialiasedFontDilationEnabled): Deleted.
2298         * platform/graphics/FontCascade.cpp:
2299         (WebCore::FontCascade::setAntialiasedFontDilationEnabled): Deleted.
2300         (WebCore::FontCascade::antialiasedFontDilationEnabled): Deleted.
2301         * platform/graphics/FontCascade.h:
2302         * platform/graphics/GraphicsContext.cpp:
2303         (WebCore::GraphicsContextStateChange::changesFromState): Deleted.
2304         (WebCore::GraphicsContextStateChange::accumulate): Deleted.
2305         (WebCore::GraphicsContextStateChange::apply): Deleted.
2306         (WebCore::GraphicsContextStateChange::dump): Deleted.
2307         (WebCore::GraphicsContext::setAntialiasedFontDilationEnabled): Deleted.
2308         * platform/graphics/GraphicsContext.h:
2309         (WebCore::GraphicsContextState::GraphicsContextState): Deleted.
2310         (WebCore::GraphicsContext::antialiasedFontDilationEnabled): Deleted.
2311         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2312         (PlatformCALayer::drawLayerContents): Deleted.
2313         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2314         (WebCore::dilationSizeForTextColor): Deleted.
2315         (WebCore::FontCascade::drawGlyphs): Deleted.
2316         * platform/graphics/displaylists/DisplayList.cpp:
2317         (WebCore::DisplayList::DisplayList::shouldDumpForFlags): Deleted.
2318
2319 2016-02-29  Jer Noble  <jer.noble@apple.com>
2320
2321         Refactor CoreVideo API access into their own classes so code can be re-used.
2322         https://bugs.webkit.org/show_bug.cgi?id=154544
2323
2324         Reviewed by Eric Carlson.
2325
2326         In order for common CoreVideo code paths to be re-used in other classes, pull those paths
2327         out of MediaPlayerPrivateAVFoundationObjC and into re-usable clasess.
2328
2329         * WebCore.xcodeproj/project.pbxproj:
2330         * platform/cf/CoreMediaSoftLink.cpp:
2331         * platform/cf/CoreMediaSoftLink.h:
2332         * platform/cocoa/CoreVideoSoftLink.cpp: Added.
2333         * platform/cocoa/CoreVideoSoftLink.h: Added.
2334         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2335         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2336         (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):
2337         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2338         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture):
2339         (WebCore::CVPixelBufferGetBytePointerCallback): Deleted.
2340         (WebCore::CVPixelBufferReleaseBytePointerCallback): Deleted.
2341         (WebCore::CVPixelBufferReleaseInfoCallback): Deleted.
2342         (WebCore::createImageFromPixelBuffer): Deleted.
2343         (WebCore::enumToStringMap): Deleted.
2344         * platform/graphics/cv/PixelBufferConformerCV.cpp: Added.
2345         (WebCore::PixelBufferConformerCV::PixelBufferConformerCV):
2346         (WebCore::CVPixelBufferGetBytePointerCallback):
2347         (WebCore::CVPixelBufferReleaseBytePointerCallback):
2348         (WebCore::CVPixelBufferReleaseInfoCallback):
2349         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
2350         * platform/graphics/cv/PixelBufferConformerCV.h: Added.
2351         * platform/graphics/cv/TextureCacheCV.h: Added.
2352         (WebCore::TextureCacheCV::context):
2353         * platform/graphics/cv/TextureCacheCV.mm: Added.
2354         (WebCore::TextureCacheCV::create):
2355         (WebCore::TextureCacheCV::TextureCacheCV):
2356         (WebCore::TextureCacheCV::textureFromImage):
2357         * platform/graphics/cv/VideoTextureCopierCV.cpp: Added.
2358         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV):
2359         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV):
2360         (WebCore::enumToStringMap):
2361         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
2362         * platform/graphics/cv/VideoTextureCopierCV.h: Added.
2363         (WebCore::VideoTextureCopierCV::context):
2364         * platform/mediastream/mac/AVVideoCaptureSource.mm: Move SOFT_LINK declarations into CoreVideoSoftLink.h/cpp.
2365
2366 2016-02-29  Chris Dumez  <cdumez@apple.com>
2367
2368         Use WTF::Optional for HTMLOListElement::m_start
2369         https://bugs.webkit.org/show_bug.cgi?id=154824
2370
2371         Reviewed by Andreas Kling.
2372
2373         Use WTF::Optional for HTMLOListElement::m_start.
2374
2375         * html/HTMLOListElement.cpp:
2376         (WebCore::HTMLOListElement::parseAttribute):
2377         * html/HTMLOListElement.h:
2378
2379 2016-02-29  Gavin Barraclough  <barraclough@apple.com>
2380
2381         RefCounter<T>::Event -> RefCounterEvent
2382         https://bugs.webkit.org/show_bug.cgi?id=154767
2383
2384         Reviewed by Darin Adler.
2385
2386         RefCounter<T>::Event is kinda verbose to use, and there is no need for this
2387         to be specific to a particular typeof RefCounter. Move the enum class up to
2388         the top level & rename to RefCounterEvent.
2389
2390         * page/PageThrottler.cpp:
2391         (WebCore::PageThrottler::PageThrottler):
2392         (WebCore::m_audiblePluginHysteresis):
2393         (WebCore::m_mediaActivityCounter):
2394         (WebCore::m_pageLoadActivityCounter):
2395         * platform/VNodeTracker.cpp:
2396         (WebCore::VNodeTracker::singleton):
2397         (WebCore::VNodeTracker::VNodeTracker):
2398         (WebCore::m_lastWarningTime):
2399
2400 2016-02-29  Chris Dumez  <cdumez@apple.com>
2401
2402         Use HTML parsing rules for textarea.maxLength
2403         https://bugs.webkit.org/show_bug.cgi?id=154805
2404
2405         Reviewed by Andreas Kling.
2406
2407         Use HTML parsing rules for textarea.maxLength:
2408         - https://html.spec.whatwg.org/multipage/forms.html#dom-textarea-maxlength
2409         - https://html.spec.whatwg.org/multipage/infrastructure.html#limited-to-only-non-negative-numbers
2410
2411         No new tests, already covered by existing test.
2412
2413         * html/HTMLTextAreaElement.cpp:
2414         (WebCore::HTMLTextAreaElement::maxLength):
2415
2416 2016-02-29  Chris Dumez  <cdumez@apple.com>
2417
2418         Align td.rowSpan / td.colSpan with the specification
2419         https://bugs.webkit.org/show_bug.cgi?id=154803
2420
2421         Reviewed by Darin Adler.
2422
2423         Align td.rowSpan / td.colSpan with the specification:
2424         - https://html.spec.whatwg.org/multipage/tables.html#htmltablecellelement
2425         - https://html.spec.whatwg.org/multipage/tables.html#dom-tdth-colspan
2426         - https://html.spec.whatwg.org/multipage/tables.html#dom-tdth-rowspan
2427
2428         In particular, the following changes were made:
2429         - Change type from 'long' to 'unsigned long'.
2430         - Use HTML rules for parsing unsigned integers:
2431           - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers
2432         - Use 1 as default value when the input value is out of range instead
2433           of 0 when setting.
2434         - rowspan is still clamped to [1, 8190] internally but we now expose the
2435           unclamped value to JS as this is an internal restriction. The same is
2436           done for a colSpan value of 0, we expose 0 to the Web but clamp to 1
2437           internally.
2438
2439         No new tests, already covered by existing test.
2440
2441         * html/HTMLTableCellElement.cpp:
2442         (WebCore::HTMLTableCellElement::colSpan):
2443         (WebCore::HTMLTableCellElement::rowSpan):
2444         (WebCore::HTMLTableCellElement::rowSpanForBindings):
2445         (WebCore::HTMLTableCellElement::setColSpan):
2446         (WebCore::HTMLTableCellElement::setRowSpanForBindings):
2447         (WebCore::HTMLTableCellElement::axis): Deleted.
2448         (WebCore::HTMLTableCellElement::headers): Deleted.
2449         * html/HTMLTableCellElement.h:
2450         * html/HTMLTableCellElement.idl:
2451
2452 2016-02-29  Chris Dumez  <cdumez@apple.com>
2453
2454         [Web IDL] Add support for [TreatNullAs=EmptyString] and use it
2455         https://bugs.webkit.org/show_bug.cgi?id=154654
2456
2457         Reviewed by Darin Adler.
2458
2459         Add support for [TreatNullAs=EmptyString] standard Web IDL extended
2460         attribute:
2461         - http://heycam.github.io/webidl/#TreatNullAs
2462
2463         This replaces the WebKit-specific [TreatNullAs=NullString] IDL
2464         extended attribute. Instead of passing a null String() to the
2465         implementation, emptyString() is passed.
2466
2467         This patch does not cause any web-exposed behavior change. For
2468         case where switching from NullString to EmptyString would change
2469         the behavior (or require changes to the implementation), the old
2470         IDL attribute was kept. However, it was renamed to
2471         [TreatNullAs=LegacyNullString] to discourage its use in new code.
2472         Eventually, this legacy IDL attribute should go away entirely.
2473
2474         [TreatNullAs=EmptyString] should only be used when it is present
2475         in the corresponding specification. Note that there are a lot of
2476         places where we use [TreatNullAs=EmptyString] in our IDL where it
2477         does not match the specification. I have added FIXME comments for
2478         those so we can clean them up later.
2479
2480         No new tests, no web-exposed behavior change.
2481
2482         * Modules/mediastream/RTCPeerConnection.idl:
2483         No behavior change because this is not implemented.
2484
2485         * bindings/js/JSDOMBinding.cpp:
2486         (WebCore::valueToStringTreatingNullAsEmptyString):
2487         * bindings/js/JSDOMBinding.h:
2488         Add new function to convert a JSValue into a String while treating
2489         null as the empty string.
2490
2491         * bindings/scripts/CodeGeneratorJS.pm:
2492         (JSValueToNative):
2493         * bindings/scripts/IDLAttributes.txt:
2494         - Add support for [TreatNullAs=EmptyString].
2495         - Rename NullString to LegacyNullString to discourage its use.
2496
2497         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2498         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2499         * bindings/scripts/test/JS/JSTestObj.cpp:
2500         * bindings/scripts/test/ObjC/DOMTestObj.h:
2501         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2502         * bindings/scripts/test/TestObj.idl:
2503         Add bindings tests coverage for [TreatNullAs=EmptyString].
2504
2505         * css/CSSStyleDeclaration.idl:
2506         * dom/CharacterData.idl:
2507         * dom/DOMImplementation.idl:
2508         * dom/Document.idl:
2509         * dom/Element.idl:
2510         * dom/ShadowRoot.idl:
2511         * html/HTMLOutputElement.idl:
2512         * html/HTMLScriptElement.idl:
2513         * html/URLUtils.idl:
2514         * svg/SVGAngle.idl:
2515         * svg/SVGLength.idl:
2516         Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString].
2517         There is not behavior change because the implementation does
2518         not distinguish the null string from the empty string.
2519
2520         * html/HTMLBaseElement.idl:
2521         * html/HTMLButtonElement.idl:
2522         * html/HTMLFormElement.idl:
2523         * html/HTMLMediaElement.idl:
2524         * html/HTMLSelectElement.idl:
2525         * svg/SVGElement.idl:
2526         * svg/SVGScriptElement.idl:
2527         Rename [TreatNullAs=NullString] to [TreatNullAs=LegacyNullString],
2528         no behavior change.
2529
2530         * html/HTMLDocument.idl:
2531         - dir and *Color: Rename [TreatNullAs=NullString] to
2532           [TreatNullAs=LegacyNullString].
2533         - designMode: Drop [TreatNullAs=NullString] as per the specification:
2534           - https://html.spec.whatwg.org/multipage/dom.html#the-document-object
2535           null now gets converted to "null" instead of the null String but this
2536           does not change behavior because the implementation only recognizes
2537           "on" / "off" / others. So we still end up using inherit mode when
2538           set to null.
2539
2540         * html/HTMLElement.idl:
2541         - Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString] for
2542           innerText / outerText. Does not change behavior because the
2543           implementation does not distinguishes.
2544         - Drop [TreatNullAs=NullString] from contentEditable to match the spec:
2545           - https://html.spec.whatwg.org/multipage/interaction.html#elementcontenteditable
2546           This does not change behavior because the implementation will the a SyntaxError
2547           wether a null String or the string "null" is passed.
2548
2549         * html/HTMLFrameElement.idl:
2550         Drop [TreatNullAs=NullString] from location attribute. This does not
2551         change behavior because the attribute is using a custom setter.
2552
2553         * html/HTMLInputElement.idl:
2554         - formEnctype / formMethod / autocapitalize: Rename [TreatNullAs=NullString] to
2555           [TreatNullAs=LegacyNullString].
2556         - value: Rename [TreatNullAs=NullString] to Rename [TreatNullAs=EmptyString], which
2557           does not change behavior because the implementation does not distinguish. Also
2558           drop the extended attribute for non-JS bindings as it has no impact.
2559
2560         * html/HTMLMediaElement.cpp:
2561         (WebCore::HTMLMediaElement::setMediaGroup):
2562         Drop redundant group.isNull() check as group.isEmpty() already checks for null.
2563
2564         * html/HTMLScriptElement.cpp:
2565         (WebCore::HTMLScriptElement::setText):
2566         Drop useless .impl() call as we have a String and the method requires a String
2567         as input.
2568
2569         * html/HTMLTextAreaElement.cpp:
2570         (WebCore::HTMLTextAreaElement::setValueCommon):
2571         Use emptyString() instead of "" as it is slightly more efficient.
2572
2573         * html/HTMLTextAreaElement.idl:
2574         - value: Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString]. No
2575           behavior change because the implementation does not distinguish.
2576         - autocapitalize: Rename [TreatNullAs=NullString] to [TreatNullAs=LegacyNullString].
2577
2578         * html/canvas/CanvasRenderingContext2D.idl:
2579         - globalCompositeOperation / repetitionType: Use [TreatNullAs=EmptyString] instead of
2580           [TreatNullAs=NullString]. No behavior change because the implementation does not
2581           distinguish.
2582         - lineCap / lineJoin: Drop the [TreatNullAs=NullString] to match the spec:
2583           - https://html.spec.whatwg.org/multipage/scripting.html#canvaspathdrawingstyles
2584           There is no behavior change because those are string enumerations and the value
2585           is not recognized either way (String() or String("null")).
2586         - shadowColor: Drop the [TreatNullAs=NullString] to match the spec:
2587           - https://html.spec.whatwg.org/multipage/scripting.html#canvasshadowstyles
2588           No behavior change because this is not a valid color either way.
2589
2590 2016-02-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2591
2592         Refactor FetchBody constructors
2593         https://bugs.webkit.org/show_bug.cgi?id=154721
2594
2595         Reviewed by Sam Weinig and Darin Adler.
2596
2597         Covered by existing tests.
2598
2599         * Modules/fetch/FetchBody.cpp:
2600         (WebCore::FetchBody::extract): Renamed from "fromJSValue"
2601         (WebCore::FetchBody::extractFromBody): Renamed from "fromRequestBody" and making use of move constructor.
2602         * Modules/fetch/FetchBody.h:
2603         (WebCore::FetchBody::FetchBody): Making default constructor public and removing empty static method.
2604         * Modules/fetch/FetchRequest.cpp:
2605         (WebCore::buildBody):
2606         * Modules/fetch/FetchResponse.cpp:
2607         (WebCore::FetchResponse::error):
2608         (WebCore::FetchResponse::redirect):
2609         (WebCore::FetchResponse::initializeWith):
2610         * Modules/fetch/FetchResponse.h:
2611         (WebCore::FetchResponse::create):
2612
2613 2016-02-28  Antti Koivisto  <antti@apple.com>
2614
2615         ::slotted doesn't work in nested shadow trees
2616         https://bugs.webkit.org/show_bug.cgi?id=154765
2617         <rdar://problem/24870995>
2618
2619         Reviewed by Ryosuke Niwa.
2620
2621         See https://github.com/w3c/webcomponents/issues/331#issuecomment-189191593
2622
2623         Test: fast/shadow-dom/css-scoping-shadow-slotted-nested.html
2624
2625         * css/ElementRuleCollector.cpp:
2626         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
2627
2628         Collect ::slotted rules from all the nested shadow trees instead of just the host's.
2629
2630 2016-02-28  Chris Dumez  <cdumez@apple.com>
2631
2632         Parse HTMLOLElement.start as per the HTML spec
2633         https://bugs.webkit.org/show_bug.cgi?id=154802
2634
2635         Reviewed by Andreas Kling.
2636
2637         Parse HTMLOLElement.start as per the HTML spec:
2638         - https://html.spec.whatwg.org/multipage/semantics.html#dom-ol-start
2639         - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-integers
2640
2641         No new tests, already covered by existing test.
2642
2643         * html/HTMLOListElement.cpp:
2644         (WebCore::HTMLOListElement::parseAttribute):
2645
2646 2016-02-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2647
2648         Reduce uses of PassRefPtr in indexeddb
2649         https://bugs.webkit.org/show_bug.cgi?id=154273
2650
2651         Reviewed by Darin Adler.
2652
2653         No new tests, no behavior changes.
2654
2655         * Modules/indexeddb/IDBDatabaseError.h:
2656         (WebCore::IDBDatabaseError::create):
2657         * Modules/indexeddb/IDBKeyData.cpp:
2658         (WebCore::IDBKeyData::maybeCreateIDBKey):
2659         * Modules/indexeddb/IDBKeyData.h:
2660         * Modules/indexeddb/IDBKeyRange.cpp:
2661         (WebCore::IDBKeyRange::create):
2662         (WebCore::IDBKeyRange::IDBKeyRange):
2663         (WebCore::IDBKeyRange::only):
2664         (WebCore::IDBKeyRange::lowerBound):
2665         (WebCore::IDBKeyRange::upperBound):
2666         (WebCore::IDBKeyRange::bound):
2667         * Modules/indexeddb/IDBKeyRange.h:
2668         (WebCore::IDBKeyRange::create):
2669         (WebCore::IDBKeyRange::lower):
2670         (WebCore::IDBKeyRange::upper):
2671         (WebCore::IDBKeyRange::lowerBound):
2672         (WebCore::IDBKeyRange::upperBound):
2673         (WebCore::IDBKeyRange::bound):
2674         * Modules/indexeddb/IDBKeyRangeData.cpp:
2675         (WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange):
2676         * Modules/indexeddb/IDBKeyRangeData.h:
2677         * Modules/indexeddb/IDBServerConnection.h:
2678         * Modules/indexeddb/legacy/IDBCallbacks.h:
2679         * Modules/indexeddb/legacy/IDBCursorBackend.cpp:
2680         (WebCore::IDBCursorBackend::continueFunction):
2681         * Modules/indexeddb/legacy/IDBCursorBackend.h:
2682         * Modules/indexeddb/legacy/IDBCursorBackendOperations.h:
2683         (WebCore::CursorIterationOperation::create):
2684         (WebCore::CursorIterationOperation::CursorIterationOperation):
2685         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
2686         (WebCore::GetOperation::perform):
2687         (WebCore::PutOperation::perform):
2688         * Modules/indexeddb/legacy/LegacyCursor.cpp:
2689         (WebCore::LegacyCursor::continueFunction):
2690         * Modules/indexeddb/legacy/LegacyCursor.h:
2691         * Modules/indexeddb/legacy/LegacyFactory.h:
2692         (WebCore::LegacyFactory::create):
2693         * Modules/indexeddb/legacy/LegacyRequest.cpp:
2694         (WebCore::LegacyRequest::onSuccess):
2695         * Modules/indexeddb/legacy/LegacyRequest.h:
2696         * inspector/InspectorIndexedDBAgent.cpp:
2697
2698 2016-02-28  Tim Horton  <timothy_horton@apple.com>
2699
2700         Switch to application/vnd.apple.folder for <attachment> folder special-case
2701         https://bugs.webkit.org/show_bug.cgi?id=154786
2702         <rdar://problem/24416632>
2703
2704         Reviewed by Anders Carlsson.
2705
2706         No new tests, adjusted an existing test to cover this.
2707
2708         * rendering/RenderThemeMac.mm:
2709         (WebCore::iconForAttachment):
2710         Add a second folder MIME type.
2711
2712 2016-02-28  Tim Horton  <timothy_horton@apple.com>
2713
2714         Variables can resolve to the wrong value when elements differ in nothing but inherited variable value
2715         https://bugs.webkit.org/show_bug.cgi?id=154785
2716
2717         Reviewed by Antti Koivisto.
2718
2719         Test: fast/css/variables/avoid-matched-property-cache.html
2720
2721         * css/StyleResolver.cpp:
2722         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
2723         Disable the matched property cache when a value is variable-dependent, because
2724         they can resolve to inherited values, and the matched property cache could
2725         end up copying the wrong value from another similarly-styled element.
2726
2727 2016-02-28  Konstantin Tokarev  <annulen@yandex.ru>
2728
2729         SVGToOTFFontConversion.cpp does not compile with libstdc++ 4.8
2730         https://bugs.webkit.org/show_bug.cgi?id=154794
2731
2732         Reviewed by Michael Catanzaro.
2733
2734         No new tests needed.
2735
2736         * svg/SVGToOTFFontConversion.cpp:
2737         (WebCore::SVGToOTFFontConverter::appendLigatureSubtable): Added const
2738         qualifiers.
2739
2740 2016-02-27  Chris Dumez  <cdumez@apple.com>
2741
2742         Prevent cross-origin access to Location.assign() / Location.reload()
2743         https://bugs.webkit.org/show_bug.cgi?id=154779
2744
2745         Reviewed by Darin Adler.
2746
2747         Prevent cross-origin access to Location.assign() / Location.reload()
2748         to match the latest specification:
2749         - https://html.spec.whatwg.org/multipage/browsers.html#crossoriginproperties-(-o-)
2750
2751         Firefox and Chrome already prevent this but WebKit allowed it.
2752
2753         No new tests, already covered by existing tests.
2754
2755         * bindings/js/JSLocationCustom.cpp:
2756         (WebCore::JSLocation::getOwnPropertySlotDelegate):
2757         (WebCore::JSLocation::putDelegate): Deleted.
2758
2759 2016-02-27  Andy VanWagoner  <thetalecrafter@gmail.com>
2760
2761         Intl.Collator uses POSIX locale (detected by js/intl-collator.html on iOS Simulator)
2762         https://bugs.webkit.org/show_bug.cgi?id=152448
2763
2764         Reviewed by Darin Adler.
2765
2766         Pass defaultLanguage from Language.h to the globalObjectMethodTable to
2767         ensure Intl objects can be initialized with the correct default locale.
2768
2769         * bindings/js/JSDOMWindowBase.cpp:
2770         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2771
2772 2016-02-27  Chris Dumez  <cdumez@apple.com>
2773
2774         Align HTMLMarqueeElement.scrollAmount / scrollDelay with the specification
2775         https://bugs.webkit.org/show_bug.cgi?id=154781
2776
2777         Reviewed by Darin Adler.
2778
2779         Align HTMLMarqueeElement.scrollAmount / scrollDelay with the
2780         specification:
2781         - https://www.w3.org/TR/html5/obsolete.html#the-marquee-element-0
2782
2783         In particular:
2784         - The attributes should have unsigned long type
2785         - We should not throw for negative values
2786         - Values should be in the range [0, 2147483647] as per:
2787         - https://html.spec.whatwg.org/multipage/infrastructure.html#reflect
2788
2789         No new tests, already covered by existing tests.
2790
2791         * html/HTMLMarqueeElement.cpp:
2792         (WebCore::HTMLMarqueeElement::scrollAmount):
2793         (WebCore::HTMLMarqueeElement::setScrollAmount):
2794         (WebCore::HTMLMarqueeElement::scrollDelay):
2795         (WebCore::HTMLMarqueeElement::setScrollDelay):
2796         (WebCore::HTMLMarqueeElement::loop): Deleted.
2797         * html/HTMLMarqueeElement.h:
2798         * html/HTMLMarqueeElement.idl:
2799
2800 2016-02-27  Commit Queue  <commit-queue@webkit.org>
2801
2802         Unreviewed, rolling out r197204, r197207, r197211, r197217,
2803         r197218, and r197219.
2804         https://bugs.webkit.org/show_bug.cgi?id=154780
2805
2806         Caused crashes in WebVideoFullscreenManagerProxy (Requested by
2807         ap on #webkit).
2808
2809         Reverted changesets:
2810
2811         "Add support for playbackControlsManager"
2812         https://bugs.webkit.org/show_bug.cgi?id=154742
2813         http://trac.webkit.org/changeset/197204
2814
2815         "Attempted build fix."
2816         http://trac.webkit.org/changeset/197207
2817
2818         "Attempted build fix."
2819         http://trac.webkit.org/changeset/197211
2820
2821         "Attempted 32-bit build fix."
2822         http://trac.webkit.org/changeset/197217
2823
2824         "Another 32-bit build fix."
2825         http://trac.webkit.org/changeset/197218
2826
2827         "32-bit!!!"
2828         http://trac.webkit.org/changeset/197219
2829
2830 2016-02-27  Chris Dumez  <cdumez@apple.com>
2831
2832         Optimize parseHTMLInteger()
2833         https://bugs.webkit.org/show_bug.cgi?id=154772
2834
2835         Reviewed by Ryosuke Niwa.
2836
2837         Optimize parseHTMLInteger() a bit now that it is used a lot more and
2838         that it has decent API test coverage. In particular, we now:
2839         - Avoid using a StringBuilder for the digits.
2840         - Get rid of a is8Bit() branch.
2841         - Only traverse the input string once.
2842
2843         * html/parser/HTMLParserIdioms.cpp:
2844         (WebCore::parseHTMLIntegerInternal):
2845         (WebCore::parseHTMLInteger):
2846         (WebCore::parseHTMLNonNegativeInteger): Deleted.
2847
2848 2016-02-27  Andreas Kling  <akling@apple.com>
2849
2850         [iOS] Discard decoded image data on top-level navigation.
2851         <https://webkit.org/b/154776>
2852
2853         Reviewed by Anders Carlsson.
2854
2855         Add a mechanism that destroys decoded data for all CachedImages and invoke it
2856         when performing a top-level navigation on iOS.
2857
2858         This substantially reduces the ImageIO contribution to our peak memory footprint.
2859
2860         It would be even better if we could mark these images volatile during the transition
2861         but we currently don't have framework support for such machinations.
2862
2863         * loader/FrameLoader.cpp:
2864         (WebCore::FrameLoader::commitProvisionalLoad):
2865         * loader/cache/MemoryCache.cpp:
2866         (WebCore::MemoryCache::forEachResource):
2867         (WebCore::MemoryCache::destroyDecodedDataForAllImages):
2868         * loader/cache/MemoryCache.h:
2869
2870 2016-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2871
2872         Network cache: old pages returned by disk cache on history navigation after session is restored
2873         https://bugs.webkit.org/show_bug.cgi?id=153230
2874
2875         Reviewed by Chris Dumez.
2876
2877         Add a flag to HistoryItem to mark them as restored from session
2878         and use it from the FrameLoader to not change the policy request
2879         when navigating to a history item that was restored from session,
2880         except for iOS port.
2881
2882         * history/HistoryItem.h:
2883         (WebCore::HistoryItem::setWasRestoredFromSession):
2884         (WebCore::HistoryItem::wasRestoredFromSession):
2885         * loader/FrameLoader.cpp:
2886         (WebCore::FrameLoader::loadDifferentDocumentItem):
2887
2888 2016-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2889
2890         Remove unused private field from WEBPImageDecoder
2891
2892         Unreviewed.
2893
2894         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2895         (WebCore::WEBPImageDecoder::WEBPImageDecoder):
2896         * platform/image-decoders/webp/WEBPImageDecoder.h:
2897
2898 2016-02-26  Chris Dumez  <cdumez@apple.com>
2899
2900         Fix the behavior of reflecting IDL attributes of type unsigned long
2901         https://bugs.webkit.org/show_bug.cgi?id=154771
2902
2903         Reviewed by Ryosuke Niwa.
2904
2905         Fix the behavior of reflecting IDL attributes of type unsigned long to
2906         align with the specification:
2907         - https://html.spec.whatwg.org/multipage/infrastructure.html#reflecting-content-attributes-in-idl-attributes
2908         - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers
2909
2910         Firefox and Chrome already follow the specification.
2911
2912         There were several issues with our implementation, which are all
2913         addressed in this patch:
2914         - Upon getting, the value returned must be in the range 0 to 2147483647.
2915           Otherwise, we must return the default value (0 unless specified
2916           otherwise). We previously returned values in the range 0 to 4294967295
2917           instead.
2918         - Upon setting, we must set the content attribute to the default value
2919           (0 unless specified otherwise) if the input value is not in the range
2920           0 to 2147483647. We previously allowed values in the range 0 to
2921           4294967295 instead.
2922         - "-0" was not recognized as a valid unsigned integer
2923
2924         Test: fast/dom/reflect-unsigned-long.html
2925
2926         * dom/Element.cpp:
2927         (WebCore::Element::setUnsignedIntegralAttribute):
2928         Update setUnsignedIntegralAttribute() to limit the input value in the
2929         0 to 2147483647 range, as per the HTML specification. This method is
2930         called by the bindings implementation of reflecting attributes setters.
2931
2932         * html/parser/HTMLParserIdioms.cpp:
2933         (WebCore::parseHTMLNonNegativeInteger):
2934         Update parseHTMLNonNegativeInteger() to call parseHTMLInteger() instead
2935         of duplicating most of its code and fail if the value returned is
2936         negative. This matches the algorithm in the specification:
2937         - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers
2938
2939         This has 2 behavior changes:
2940         1. "-0" is now correctly parsed as 0.
2941         2. The returned values are in the range 0 to 2147483647.
2942
2943         * html/parser/HTMLParserIdioms.h:
2944         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
2945         (WebCore::limitToOnlyHTMLNonNegative):
2946         Drop the checks for "<= 2147483647" and replace with an assertion
2947         now that parseHTMLNonNegativeInteger() already returned values in
2948         the right range.
2949
2950 2016-02-26  Zalan Bujtas  <zalan@apple.com>
2951
2952         REGRESSION (188611): Search field Cancel button should not overlap search text on extensions page.
2953         https://bugs.webkit.org/show_bug.cgi?id=154692
2954         <rdar://problem/22840453>
2955
2956         Reviewed by Brent Fulgham.
2957
2958         Adjust the cancel button position using the actual size of the cancel button.
2959
2960         When the input box and the font height trigger different cancel button sizes, we need to readjust
2961         the rectangle returned by cancelButtonRectForBounds.
2962         This fixes both the mispositioned cancel button and the squared off icon when the input field is zoomed all the way in.
2963
2964         Covered by existing tests.
2965
2966         * rendering/RenderThemeMac.mm:
2967         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2968         (WebCore::RenderThemeMac::cancelButtonSizes): Update button size.
2969
2970 2016-02-26  Brady Eidson  <beidson@apple.com>
2971
2972         Modern IDB: New database versions are never committed to SQLite.
2973         <rdar://problem/24860952> and https://bugs.webkit.org/show_bug.cgi?id=154741
2974         
2975         Modern IDB: If a database handle is not open, files are not actually deleted from disk
2976         https://bugs.webkit.org/show_bug.cgi?id=154756
2977
2978         Reviewed by Alex Christensen.
2979
2980         Tested by API test "IndexedDBPersistence"
2981
2982         * Modules/indexeddb/server/IDBServer.cpp:
2983         (WebCore::IDBServer::IDBServer::deleteDatabase): If there's not an open handle to the database, create one.
2984
2985         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2986         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction): If a version change transaction, actually
2987           set the new version on disk.
2988         
2989         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2990         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
2991         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore): If there is no open backing store, create one.
2992           This is necessary to both read the current database version, and to actually delete the file on disk.
2993         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore): If necessary, manufacture a "most recently
2994           deleted database info" from the version returned by deleteBackingStore.
2995         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2996
2997 2016-02-26  Chris Dumez  <cdumez@apple.com>
2998
2999         Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger
3000         https://bugs.webkit.org/show_bug.cgi?id=154714
3001
3002         Reviewed by Darin Adler.
3003
3004         Export a couple more symbols for API testing.
3005
3006         * html/parser/HTMLParserIdioms.h:
3007
3008 2016-02-26  Beth Dakin  <bdakin@apple.com>
3009
3010         32-bit!!!
3011
3012         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
3013         (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
3014
3015 2016-02-26  Beth Dakin  <bdakin@apple.com>
3016
3017         Another 32-bit build fix.
3018
3019         * platform/spi/cocoa/AVKitSPI.h:
3020
3021 2016-02-26  Beth Dakin  <bdakin@apple.com>
3022
3023         Attempted 32-bit build fix.
3024
3025         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
3026         (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
3027
3028 2016-02-26  Commit Queue  <commit-queue@webkit.org>
3029
3030         Unreviewed, rolling out r197160.
3031         https://bugs.webkit.org/show_bug.cgi?id=154757
3032
3033         This change causes editing/mac/attributed-string/font-
3034         size.html to fail on El Capitan WK1 (Requested by ryanhaddad
3035         on #webkit).
3036
3037         Reverted changeset:
3038
3039         "Font size computed style is innaccurate"
3040         https://bugs.webkit.org/show_bug.cgi?id=154705
3041         http://trac.webkit.org/changeset/197160
3042
3043 2016-02-26  Gavin Barraclough  <barraclough@apple.com>
3044
3045         Page TimerAlignmentIntervalIncrease mechanism should have upper limit
3046         https://bugs.webkit.org/show_bug.cgi?id=154744
3047
3048         Reviewed by Geoff Garen.
3049
3050         There would be diminishing returns from throttling timers in background pages infinitely.
3051         Add a heuristic to limit appropriately.
3052
3053         Keep track of the current limit, and make the increase time take this into account.
3054
3055         * page/Page.cpp:
3056         (WebCore::Page::setTimerThrottlingEnabled):
3057             - When timer throttling is disabled visit all timers to resume.
3058         (WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
3059             - Track the maximum alignment interval, and call setDOMTimerAlignmentInterval
3060               to ensure m_timerAlignmentInterval is updated in accordance with the new limit.
3061         (WebCore::Page::setDOMTimerAlignmentInterval):
3062             - When the timer alignemnt interval changes update the increase timer.
3063         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
3064             - Apply limit.
3065         * page/Page.h:
3066         (WebCore::Page::timerThrottlingEnabled):
3067             - Accessor for readability.
3068
3069 2016-02-26  Beth Dakin  <bdakin@apple.com>
3070
3071         Attempted build fix.
3072
3073         * platform/spi/cocoa/AVKitSPI.h:
3074
3075 2016-02-26  Beth Dakin  <bdakin@apple.com>
3076
3077         Add support for playbackControlsManager
3078         https://bugs.webkit.org/show_bug.cgi?id=154742
3079         -and corresponding-
3080         rdar://problem/23833753
3081
3082         Reviewed by Jer Noble.
3083
3084         Make AVKitSPI.h private so that it can be used from other projects.
3085         * WebCore.xcodeproj/project.pbxproj:
3086
3087         Right now, set up a controls manager for a video when it starts playing. In 
3088         the future, this is something that should be handled by the 
3089         PlatformMediaSessionManager since we only want a controls for the 
3090         currentSession.
3091         * html/HTMLMediaElement.cpp:
3092         (WebCore::HTMLMediaElement::playInternal):
3093
3094         New function setUpVideoControlsManager.
3095         * page/ChromeClient.h:
3096
3097         Make these CoreMedia functions available on Mac and iOS instead of just iOS.
3098         * platform/cf/CoreMediaSoftLink.cpp:
3099         * platform/cf/CoreMediaSoftLink.h:
3100
3101         This patch fleshes out an implementation for a bunch of these interface 
3102         functions since they need to communicate to the playbackControlsManager. This 
3103         is also where the playbackControlsManager lives.
3104         * platform/mac/WebVideoFullscreenInterfaceMac.h:
3105
3106         Define an interface and implementation for WebPlaybackControlsManager.
3107         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
3108         (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
3109         (-[WebPlaybackControlsManager isSeeking]):
3110         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
3111         (-[WebPlaybackControlsManager audioMediaSelectionOptions]):
3112         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
3113         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
3114         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
3115         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
3116         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
3117         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
3118
3119         Relay this information to the playbackControlsManager.
3120         (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
3121         (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
3122         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
3123         (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
3124         (WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
3125         (WebCore::WebVideoFullscreenInterfaceMac::playBackControlsManager):
3126         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
3127
3128         New SPI needed.
3129         * platform/spi/cocoa/AVKitSPI.h:
3130         * platform/spi/mac/AVFoundationSPI.h:
3131
3132 2016-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
3133
3134         <g> wrapping <symbol> causes display of hidden <symbol>
3135         https://bugs.webkit.org/show_bug.cgi?id=154576
3136
3137         Reviewed by Darin Adler.
3138         
3139         The SVGSymbolElement is allowed in the shadow tree of an SVGUseElement
3140         only if it subtree root element. Any descendant SVGSymbolElement should
3141         be removed from the subtree because it is a hidden container. If the cloned
3142         subtree includes an SVGUseElement which references an SVGSymbolElement,
3143         the same rule will be applied to the descendant SVGUseElement. The goal
3144         is to remove all the descendant SVGSymbolElements from the cloned target
3145         because these SVGSymbolElements will be expanded to SVGSVGElements and
3146         hence become visible.
3147
3148         * svg/SVGUseElement.cpp:
3149         (WebCore::disassociateAndRemoveClones): A helper function which removes
3150         cloned SVGElements and their subtrees from their parents and disassociate
3151         them from their originals.
3152         
3153         (WebCore::removeDisallowedElementsFromSubtree): Use disassociateAndRemoveClones().
3154         
3155         (WebCore::removeSymbolElementsFromSubtree): Removes all the descendant
3156         SVGSymbolElements from the cloned subtree. It does not remove the root
3157         element itself if it is an SVGSymbolElement because this one will be
3158         expanded to an SVGSVGElement which is exactly what we need.
3159         
3160         (WebCore::SVGUseElement::cloneTarget): Call removeSymbolElementsFromSubtree()
3161         to remove the descendant SVGSymbolElements from the cloned subtree before
3162         appending it to the container shadow root.
3163
3164 2016-02-26  Olivier Blin  <olivier.blin@softathome.com>
3165
3166         Initialize LocaleICU data members in header
3167         https://bugs.webkit.org/show_bug.cgi?id=154731
3168
3169         Reviewed by Michael Catanzaro.
3170
3171         LocaleICU data members should be initialized in the header, to
3172         avoid conditional initialization lines in the constructor, as
3173         suggested by Darin in bug 154484.
3174
3175         * platform/text/LocaleICU.cpp:
3176         (WebCore::LocaleICU::LocaleICU): Deleted.
3177         * platform/text/LocaleICU.h:
3178
3179 2016-02-26  Brady Eidson  <beidson@apple.com>
3180
3181         Modern IDB: Using existing database info from SQLite backing store is busted.
3182         <rdar://problem/24848143> and https://bugs.webkit.org/show_bug.cgi?id=154735
3183
3184         Reviewed by Alex Christensen.
3185
3186         No new tests.
3187         
3188         Reproducing the bug requires having a known database on disk *before* launching the DatabaseProcess to
3189         read in the existing IDBDatabaseInfo.
3190         
3191         Our automated infrastructure currently has no way of testing this.
3192
3193         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3194         (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
3195         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3196         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo): Do the optional migrate on
3197           the IndexRecords table here; *every* time we open a SQLite backing store.
3198         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo): Deleted.
3199         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
3200         (WebCore::IDBDatabaseInfo::isolatedCopy): Copy the entire object, not just name/version.
3201
3202 2016-02-25  Gavin Barraclough  <barraclough@apple.com>
3203
3204         RefCounter value changed callback should be called on all changes (not just zero edge).
3205         https://bugs.webkit.org/show_bug.cgi?id=154699
3206
3207         Reviewed by Anders Carlsson.
3208
3209         RefCounter currently only triggers a callback when the count goes from zero
3210         to non-zero and vice-versa. Change that, to be useful to more clients.
3211
3212         * page/PageThrottler.cpp:
3213         (WebCore::PageThrottler::PageThrottler):
3214             - Updated for change in RefCounter callback siganture.
3215         * platform/VNodeTracker.cpp:
3216         (WebCore::VNodeTracker::VNodeTracker):
3217             - Can now use RefCounter callback to trigger checkPressureState().
3218         (WebCore::VNodeTracker::pressureWarningTimerFired):
3219             - RefCounter count is now a size_t (%d -> %ul).
3220         * platform/VNodeTracker.h:
3221             - simplified VNodeTracker::token() [no longer needs to call checkPressureState()].
3222
3223 2016-02-26  Andreas Kling  <akling@apple.com>
3224
3225         Remove unused CFNetwork disk cache mmap optimization in WebKit2.
3226         <https://webkit.org/b/154727>
3227
3228         Reviewed by Darin Adler.
3229
3230         Remove some now-unused SPI.
3231
3232         * platform/spi/cf/CFNetworkSPI.h:
3233
3234 2016-02-26  Commit Queue  <commit-queue@webkit.org>
3235
3236         Unreviewed, rolling out r197167.
3237         https://bugs.webkit.org/show_bug.cgi?id=154730
3238
3239         This change broke the Mac build (Requested by ryanhaddad on
3240         #webkit).
3241
3242         Reverted changeset:
3243
3244         "REGRESSION (188611): Search field Cancel button should not
3245         overlap search text on extensions page."
3246         https://bugs.webkit.org/show_bug.cgi?id=154692
3247         http://trac.webkit.org/changeset/197167
3248
3249 2016-02-26  Martin Robinson  <mrobinson@igalia.com>
3250
3251         Remove libqcms support
3252         https://bugs.webkit.org/show_bug.cgi?id=154707
3253
3254         Reviewed by Žan Doberšek.
3255
3256         No new tests. This change simply removes dead code.
3257
3258         * platform/image-decoders/ImageDecoder.h: Remove QCMS support.
3259         (WebCore::ImageDecoder::qcmsOutputDeviceProfile): Deleted.
3260         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Remove QCMS support.
3261         (WebCore::JPEGImageReader::JPEGImageReader): Deleted.
3262         (WebCore::JPEGImageReader::close): Deleted.
3263         (WebCore::JPEGImageReader::decode): Deleted.
3264         (WebCore::JPEGImageReader::colorTransform): Deleted.
3265         (WebCore::JPEGImageReader::createColorTransform): Deleted.
3266         (WebCore::JPEGImageDecoder::outputScanlines): Deleted.
3267         * platform/image-decoders/png/PNGImageDecoder.cpp: Remove QCMS support.
3268         (WebCore::PNGImageReader::PNGImageReader): Deleted.
3269         (WebCore::PNGImageReader::close): Deleted.
3270         (WebCore::PNGImageReader::rowBuffer): Deleted.
3271         (WebCore::PNGImageReader::createRowBuffer): Deleted.
3272         (WebCore::PNGImageReader::colorTransform): Deleted.
3273         (WebCore::PNGImageReader::createColorTransform): Deleted.
3274         (WebCore::PNGImageDecoder::headerAvailable): Deleted.
3275         (WebCore::PNGImageDecoder::rowAvailable): Deleted.
3276         (WebCore::PNGImageDecoder::frameComplete): Deleted.
3277         * platform/image-decoders/webp/WEBPImageDecoder.cpp: Remove QCMS support.
3278         (WebCore::WEBPImageDecoder::decode): Remove QCMS support.
3279         (WebCore::WEBPImageDecoder::WEBPImageDecoder): Deleted.
3280         (WebCore::WEBPImageDecoder::clear): Deleted.
3281         (WebCore::WEBPImageDecoder::createColorTransform): Deleted.
3282         (WebCore::WEBPImageDecoder::readColorProfile): Deleted.
3283         (WebCore::WEBPImageDecoder::applyColorProfile): Deleted.
3284         * platform/image-decoders/webp/WEBPImageDecoder.h: Remove QCMS support.
3285         (WebCore::WEBPImageDecoder::colorTransform): Deleted.
3286
3287 2016-02-26  Zalan Bujtas  <zalan@apple.com>
3288
3289         RenderTheme::controlSize* methods should take const RenderStyle&.
3290         https://bugs.webkit.org/show_bug.cgi?id=154708
3291
3292         Reviewed by Darin Adler.
3293
3294         No change in functionality.
3295
3296         * rendering/RenderTheme.h:
3297         (WebCore::RenderTheme::minimumMenuListSize):
3298         (WebCore::RenderTheme::popupInternalPaddingLeft):
3299         (WebCore::RenderTheme::popupInternalPaddingRight):
3300         (WebCore::RenderTheme::popupInternalPaddingTop):
3301         (WebCore::RenderTheme::popupInternalPaddingBottom):
3302         * rendering/RenderThemeMac.h:
3303         * rendering/RenderThemeMac.mm:
3304         (WebCore::RenderThemeMac::controlSizeForFont):
3305         (WebCore::RenderThemeMac::sizeForFont):
3306         (WebCore::RenderThemeMac::sizeForSystemFont):
3307         (WebCore::RenderThemeMac::controlSizeForSystemFont):
3308         (WebCore::RenderThemeMac::minimumProgressBarHeight):
3309         (WebCore::RenderThemeMac::popupInternalPaddingLeft):
3310         (WebCore::RenderThemeMac::popupInternalPaddingRight):
3311         (WebCore::RenderThemeMac::popupInternalPaddingTop):
3312         (WebCore::RenderThemeMac::popupInternalPaddingBottom):
3313         (WebCore::RenderThemeMac::minimumMenuListSize):
3314
3315 2016-02-26  Zalan Bujtas  <zalan@apple.com>
3316
3317         REGRESSION (188611): Search field Cancel button should not overlap search text on extensions page.
3318         https://bugs.webkit.org/show_bug.cgi?id=154692
3319         <rdar://problem/22840453>
3320
3321         Reviewed by Brent Fulgham.
3322
3323         Adjust the cancel button position using the actual size of the cancel button.
3324
3325         When the input box and the font height trigger different cancel button sizes, we need to readjust
3326         the rectangle returned by cancelButtonRectForBounds.
3327         This fixes both the mispositioned cancel button and the squared off icon when the input field is zoomed all the way in.
3328
3329         Covered by existing tests.
3330
3331         * rendering/RenderThemeMac.mm:
3332         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
3333         (WebCore::RenderThemeMac::cancelButtonSizes): Update button size.
3334
3335 2016-02-25  Antti Koivisto  <antti@apple.com>
3336
3337         Implement ::slotted pseudo element
3338         https://bugs.webkit.org/show_bug.cgi?id=149441
3339         <rdar://problem/22731987>
3340
3341         Reviewed by Andreas Kling.
3342
3343         Based on latest in https://github.com/w3c/webcomponents/issues/331
3344
3345         * css/CSSGrammar.y.in:
3346
3347             Parse ::slotted.
3348
3349         * css/CSSParser.cpp:
3350         (WebCore::CSSParser::detectFunctionTypeToken):
3351         * css/CSSParserValues.cpp:
3352         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
3353         (WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector):
3354
3355             Tokenize ::slotted.
3356
3357         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
3358         * css/CSSParserValues.h:
3359         * css/CSSSelector.cpp:
3360         (WebCore::CSSSelector::pseudoId):
3361         * css/CSSSelector.h:
3362         * css/ElementRuleCollector.cpp:
3363         (WebCore::ElementRuleCollector::matchAuthorRules):
3364         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
3365         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
3366
3367             Match ::slotted selector.
3368
3369         (WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
3370
3371             Collect ::slotted rules that may apply to an element in a slot.
3372
3373         (WebCore::ElementRuleCollector::matchUserRules):
3374         (WebCore::ElementRuleCollector::matchUARules):
3375         (WebCore::findSlottedPseudoElementSelector):
3376         (WebCore::ElementRuleCollector::ruleMatches):
3377         * css/ElementRuleCollector.h:
3378         * css/RuleSet.cpp:
3379         (WebCore::RuleSet::addRule):
3380
3381             Collect ::slotted rules.
3382
3383         (WebCore::RuleSet::shrinkToFit):
3384         * css/RuleSet.h:
3385         (WebCore::RuleSet::hostPseudoClassRules):
3386         (WebCore::RuleSet::slottedPseudoElementRules):
3387         (WebCore::RuleSet::focusPseudoClassRules):
3388         (WebCore::RuleSet::universalRules):
3389         * css/SelectorChecker.cpp:
3390         (WebCore::SelectorChecker::checkOne):
3391         * style/StyleSharingResolver.cpp:
3392         (WebCore::Style::SharingResolver::resolve):
3393
3394             Disable style sharing for children of shadow host. They may be affected by the shadow tree style
3395             which is not considered in style sharing checks.
3396
3397 2016-02-25  Myles C. Maxfield  <mmaxfield@apple.com>
3398
3399         Font size computed style is innaccurate
3400         https://bugs.webkit.org/show_bug.cgi?id=154705
3401         <rdar://problem/23474068>
3402
3403         Reviewed by Timothy Hatcher.
3404
3405         Safari rounds the font size value reported to getComputedStyle(). Neither Firefox
3406         nor Chrome do this.
3407
3408         Covered by existing tests.
3409
3410         * css/CSSComputedStyleDeclaration.cpp:
3411         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
3412         (WebCore::fontSizeFromStyle):
3413
3414 2016-02-25  Chris Dumez  <cdumez@apple.com>
3415
3416         [Web IDL] Mark DOMString parameters as nullable when they should be
3417         https://bugs.webkit.org/show_bug.cgi?id=154666
3418
3419         Reviewed by Darin Adler.
3420
3421         Mark DOMString parameters as nullable when they should be. We previously
3422         emulated nullable DOMString attributes by using:
3423         [TreatNullAs=NullString, TreatUndefinedAs=NullString]
3424         However, this was non-standard and very verbose. Also, developers would
3425         sometimes forget the [TreatUndefinedAs=NullString] part and the behavior
3426         would end up being wrong for undefined.
3427