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