createElement should not lowercase non-ASCII characters
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-01-14  Ryosuke Niwa  <rniwa@webkit.org>
2
3         createElement should not lowercase non-ASCII characters
4         https://bugs.webkit.org/show_bug.cgi?id=153114
5
6         Reviewed by Alex Christensen.
7
8         According to step 2 in https://dom.spec.whatwg.org/#dom-document-createelement, document.createElement should not
9         lowercase non-ASCII letters, and this is also what Firefox does. Match that behavior by lowercasing the tag name
10         by convertToASCIILowercase() instead of lower() in createElement.
11
12         Also merged HTMLDocument::createElement into Document::createElement for simplicity and avoid duplicating
13         the call to isValidName and setting a DOM exception.
14
15         No new tests since the behavior change is covered by the existing W3C tests.
16
17         * dom/Document.cpp:
18         (WebCore::Document::createElement): Create a HTML element with ASCII-lowercased tag name inside a HTML document.
19         * dom/Document.h:
20         * html/HTMLDocument.cpp:
21         (WebCore::addLocalNameToSet):
22         (WebCore::HTMLDocument::createElement): Merged into Document::createElement.
23         * html/HTMLDocument.h:
24
25 2016-01-14  Brady Eidson  <beidson@apple.com>
26
27         Modern IDB: Support opening and deleting SQLite databases on disk.
28         https://bugs.webkit.org/show_bug.cgi?id=153084
29
30         Reviewed by Alex Christensen, Sam Weinig and Andy Estes (oh my!).
31
32         No new tests (Infrastructure, no testable change in behavior).
33
34         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
35         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
36         * Modules/indexeddb/IDBDatabaseIdentifier.h:
37
38         * Modules/indexeddb/server/IDBServer.cpp:
39         (WebCore::IDBServer::IDBServer::create):
40         (WebCore::IDBServer::IDBServer::IDBServer):
41         (WebCore::IDBServer::IDBServer::createBackingStore):
42         * Modules/indexeddb/server/IDBServer.h:
43
44         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
45         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
46         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
47         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
48         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
49
50         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
51         (WebCore::InProcessIDBServer::create):
52         (WebCore::InProcessIDBServer::InProcessIDBServer):
53         * Modules/indexeddb/shared/InProcessIDBServer.h:
54
55 2016-01-14  Myles C. Maxfield  <mmaxfield@apple.com>
56
57         Mixing Content Blocking of fonts and display:none rules causes battery drain
58         https://bugs.webkit.org/show_bug.cgi?id=153051
59         <rdar://problem/23187709>
60
61         Reviewed by Alex Christensen.
62
63         If we have applied a rule before and we are not applying it again, don't
64         resolve the style again.
65
66         Test: http/tests/contentextensions/font-display-none-repeated-layout.html
67
68         * contentextensions/ContentExtensionStyleSheet.cpp:
69         (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
70         * contentextensions/ContentExtensionStyleSheet.h:
71         * dom/ExtensionStyleSheets.cpp:
72         (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
73
74 2016-01-14  Ryosuke Niwa  <rniwa@webkit.org>
75
76         Add document.defineCustomElement
77         https://bugs.webkit.org/show_bug.cgi?id=153092
78
79         Reviewed by Chris Dumez.
80
81         Added document.defineCustomElement and added a constructor to HTMLElement which can be called
82         as "super" in a subclass of HTMLElement. This is a prototype of new custom elements API and
83         willfully violates the current specification at http://w3c.github.io/webcomponents/spec/custom/
84
85         Each author defined class can define multiple elements using distinct tag names. In such cases,
86         the super call must specify the tag name. e.g.
87
88         class SomeCustomElement extends HTMLElement { constructor(name) { super(name); } }
89         document.defineCustomElement('some-custom-element', SomeCustomElement);
90         document.defineCustomElement('other-custom-element', SomeCustomElement);
91         new SomeCustomElement('some-custom-element');
92
93         When a class is associated with exactly one tag name, the argument can be omitted. e.g.
94
95         class AnotherCustomElement extends HTMLElement {}
96         document.defineCustomElement('another-custom-element', AnotherCustomElement);
97         new AnotherCustomElement();
98
99         We allow only subclassing of HTMLElement and only in (X)HTML namespace.
100
101         Tests: fast/custom-elements/Document-defineCustomElement.html
102                fast/custom-elements/HTMLElement-constructor.html
103
104         * CMakeLists.txt:
105         * WebCore.xcodeproj/project.pbxproj:
106
107         * bindings/js/JSCustomElementInterface.cpp: Added. Abstracts an author-defined class associated
108         with a custom element. It's a Active DOM object and lives until the associated document dies.
109         (WebCore::JSCustomElementInterface::JSCustomElementInterface):
110         (WebCore::JSCustomElementInterface::~JSCustomElementInterface):
111         * bindings/js/JSCustomElementInterface.h: Added.
112         (WebCore::JSCustomElementInterface::create):
113         (WebCore::JSCustomElementInterface::scriptExecutionContext):
114         (WebCore::JSCustomElementInterface::constructor):
115
116         * bindings/js/JSDocumentCustom.cpp:
117         (WebCore::JSDocument::defineCustomElement): Added. Define a custom element by associating a tag
118         name with an author defined JS class after validating arguments.
119
120         * bindings/js/JSHTMLElementCustom.cpp:
121         (WebCore::constructJSHTMLElement): Added. Look up the tag name based on new.target if one is not
122         specified. If a tag name is specified, check that new.target is associated with the tag name.
123
124         * dom/CustomElementDefinitions.cpp: Added.
125         (WebCore::CustomElementDefinitions::checkName): Added. Restricts tag names similarly to
126         http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type
127         (WebCore::CustomElementDefinitions::defineElement): Added. Associates a JS class with a tag name.
128         (WebCore::CustomElementDefinitions::findInterface): Added. Finds a JS class by a tag name.
129         (WebCore::CustomElementDefinitions::findName): Added. Finds a tag name by a JS class.
130         * dom/CustomElementDefinitions.h: Added.
131         (WebCore::CustomElementDefinitions::CustomElementInfo): Added.
132
133         * dom/Document.cpp:
134         (WebCore::Document::ensureCustomElementDefinitions): Added.
135         * dom/Document.h:
136         (WebCore::Document::customElementDefinitions): Added.
137
138         * dom/Document.idl:
139         * html/HTMLElement.idl:
140
141 2016-01-14  Simon Fraser  <simon.fraser@apple.com>
142
143         Remove workaround for rdar://problem/23623670
144         https://bugs.webkit.org/show_bug.cgi?id=153107
145         rdar://problem/23633319
146
147         Reviewed by Tim Horton.
148
149         Remove the code that uses IOSurfaceAcceleratorTransformSurface() when copying from
150         back-to-front buffer, now that CGIOSurfaceContextCreate()-code path works correctly.
151
152         * platform/graphics/cocoa/IOSurface.h:
153         * platform/graphics/cocoa/IOSurface.mm:
154         (IOSurface::ensurePlatformContext):
155         (IOSurface::copyToSurface): Deleted.
156
157 2016-01-14  Beth Dakin  <bdakin@apple.com>
158
159         WK1 and WK2 should share more candidate request code
160         https://bugs.webkit.org/show_bug.cgi?id=153108
161
162         Reviewed by Simon Fraser.
163
164         requestCandidatesForSelection() does not need to be exposed as an 
165         EditorClient function. WK1 can just call invoke this code from the existing 
166         respondToChangedSelection EditorClient function, which is what WK2 does.
167         * editing/Editor.cpp:
168         (WebCore::Editor::respondToChangedSelection):
169         * loader/EmptyClients.h:
170         * page/EditorClient.h:
171         (WebCore::EditorClient::supportsGlobalSelection):
172
173 2016-01-14  Beth Dakin  <bdakin@apple.com>
174
175         WK2: Request completion candidates when needed
176         https://bugs.webkit.org/show_bug.cgi?id=153040
177         -and corresponding-
178         rdar://problem/24155631
179
180         Reviewed by Enrica Casucci and Tim Horton.
181
182         Helper functions for stringForCandidateRequest() and 
183         handleAcceptedCandidate()
184         * editing/Editor.cpp:
185         (WebCore::candidateRangeForSelection):
186         (WebCore::candidateWouldReplaceText):
187
188         Request candidates for the word that is currently being typed so long as the 
189         candidate would replace that word. Otherwise, use String().
190         (WebCore::Editor::stringForCandidateRequest):
191
192         When a candidate has been accepted, insert the text.
193         (WebCore::Editor::handleAcceptedCandidate):
194         * editing/Editor.h:
195
196 2016-01-14  Daniel Bates  <dabates@apple.com>
197
198         Disallow use of Geolocation service from unique origins
199         https://bugs.webkit.org/show_bug.cgi?id=153102
200         <rdar://problem/23055645>
201
202         Reviewed by Alexey Proskuryakov.
203
204         Tests: fast/dom/Geolocation/dataURL-getCurrentPosition.html
205                fast/dom/Geolocation/dataURL-watchPosition.html
206                fast/dom/Geolocation/srcdoc-getCurrentPosition.html
207                fast/dom/Geolocation/srcdoc-watchPosition.html
208                http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html
209                http/tests/security/sandboxed-iframe-geolocation-watchPosition.html
210
211         * Modules/geolocation/Geolocation.cpp:
212         (WebCore::Geolocation::securityOrigin): Convenience function to get the SecurityOrigin object
213         associated with this script execution context.
214         (WebCore::Geolocation::startRequest): Notify requester POSITION_UNAVAILABLE when requested
215         from a document with a unique origin.
216         * Modules/geolocation/Geolocation.h:
217         * page/SecurityOrigin.h:
218         (WebCore::SecurityOrigin::canRequestGeolocation): Added.
219
220 2016-01-14  Daniel Bates  <dabates@apple.com>
221
222         [XSS Auditor] Extract attribute truncation logic and formalize string canonicalization
223         https://bugs.webkit.org/show_bug.cgi?id=152874
224
225         Reviewed by Brent Fulgham.
226
227         Derived from Blink patch (by Tom Sepez <tsepez@chromium.org>):
228         <https://src.chromium.org/viewvc/blink?revision=176339&view=revision>
229
230         Extract the src-like and script-like attribute truncation logic into independent functions
231         towards making it more straightforward to re-purpose this logic. Additionally, formalize the
232         concept of string canonicalization as a member function that consolidates the process of
233         decoding URL escape sequences, truncating the decoded string (if applicable), and removing
234         characters that are considered noise.
235
236         * html/parser/XSSAuditor.cpp:
237         (WebCore::truncateForSrcLikeAttribute): Extracted from XSSAuditor::decodedSnippetForAttribute().
238         (WebCore::truncateForScriptLikeAttribute): Ditto.
239         (WebCore::XSSAuditor::init): Write in terms of XSSAuditor::canonicalize().
240         (WebCore::XSSAuditor::filterCharacterToken): Updated to make use of formalized canonicalization methods.
241         (WebCore::XSSAuditor::filterScriptToken): Ditto.
242         (WebCore::XSSAuditor::filterObjectToken): Ditto.
243         (WebCore::XSSAuditor::filterParamToken): Ditto.
244         (WebCore::XSSAuditor::filterEmbedToken): Ditto.
245         (WebCore::XSSAuditor::filterAppletToken): Ditto.
246         (WebCore::XSSAuditor::filterFrameToken): Ditto.
247         (WebCore::XSSAuditor::filterInputToken): Ditto.
248         (WebCore::XSSAuditor::filterButtonToken): Ditto.
249         (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected): Ditto.
250         (WebCore::XSSAuditor::eraseAttributeIfInjected): Updated code to use early return style and avoid an unnecessary string
251         comparison when we know that a src attribute was injected.
252         (WebCore::XSSAuditor::canonicalizedSnippetForTagName): Renamed; formerly known as XSSAuditor::decodedSnippetForName(). Updated
253         to make use of XSSAuditor::canonicalize().
254         (WebCore::XSSAuditor::snippetFromAttribute): Renamed; formerly known as XSSAuditor::decodedSnippetForAttribute(). Moved
255         truncation logic from here to WebCore::truncateFor{Script, Src}LikeAttribute.
256         (WebCore::XSSAuditor::canonicalize): Added.
257         (WebCore::XSSAuditor::canonicalizedSnippetForJavaScript): Added.
258         (WebCore::canonicalize): Deleted.
259         (WebCore::XSSAuditor::decodedSnippetForName): Deleted.
260         (WebCore::XSSAuditor::decodedSnippetForAttribute): Deleted.
261         (WebCore::XSSAuditor::decodedSnippetForJavaScript): Deleted.
262         * html/parser/XSSAuditor.h: Define enum class for the various attribute truncation styles.
263
264 2016-01-14  Daniel Bates  <dabates@apple.com>
265
266         [XSS Auditor] Partial bypass when web server collapses path components
267         https://bugs.webkit.org/show_bug.cgi?id=152872
268
269         Reviewed by Brent Fulgham.
270
271         Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
272         <https://src.chromium.org/viewvc/blink?revision=167610&view=revision>
273
274         Test: http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html
275
276         * html/parser/XSSAuditor.cpp:
277         (WebCore::isNonCanonicalCharacter):
278         (WebCore::XSSAuditor::init):
279         (WebCore::XSSAuditor::decodedSnippetForName):
280         (WebCore::XSSAuditor::decodedSnippetForAttribute):
281         (WebCore::XSSAuditor::decodedSnippetForJavaScript):
282         (WebCore::fullyDecodeString): Deleted.
283
284 2016-01-14  Beth Dakin  <bdakin@apple.com>
285
286         imported/blink/editing/text-iterator/read-past-cloned-first-letter.html 
287         crashes
288         https://bugs.webkit.org/show_bug.cgi?id=153104
289         -and corresponding-
290         rdar://problem/24155631
291
292         Reviewed by Simon Fraser.
293
294         Though we merged the Blink test, we never merged Blink patch that fixed this 
295         bug. So this is a merge of https://github.com/ChromiumWebApps/blink/commit/5a0d23d4368c661f621364339fde66b41ef019e5
296         * editing/TextIterator.cpp:
297         (WebCore::SimplifiedBackwardsTextIterator::handleFirstLetter):
298
299 2016-01-14  Zalan Bujtas  <zalan@apple.com>
300
301         ASSERTION FAILED: !newRelayoutRoot.container() || !newRelayoutRoot.container()->needsLayout() in WebCore::FrameView::scheduleRelayoutOfSubtree
302         https://bugs.webkit.org/show_bug.cgi?id=151605#c1
303
304         Reviewed by David Hyatt.
305
306         Do not let RenderMultiColumnSet/RenderFlowThread mark ancestors dirty while updating scrollbars
307         for overflow content. While updating scrollbars, we only layout descendants so marking parents dirty
308         is unnecessary and could lead to an invalid dirty state.
309
310         Test: fast/multicol/body-stuck-with-dirty-bit-with-columns.html
311
312         * rendering/RenderBlockFlow.cpp:
313         (WebCore::RenderBlockFlow::layoutSpecialExcludedChild):
314         * rendering/RenderFlowThread.cpp:
315         (WebCore::RenderFlowThread::invalidateRegions):
316         * rendering/RenderFlowThread.h:
317         * rendering/RenderMultiColumnSet.cpp:
318         (WebCore::RenderMultiColumnSet::prepareForLayout):
319
320 2016-01-14  Dave Hyatt  <hyatt@apple.com>
321
322         Avoid downloading the wrong image for <picture> elements.
323         https://bugs.webkit.org/show_bug.cgi?id=153027
324
325         Reviewed by Dean Jackson.
326
327         Added test in fast/picture.
328
329         * html/HTMLImageElement.cpp:
330         (WebCore::HTMLImageElement::HTMLImageElement):
331         (WebCore::HTMLImageElement::~HTMLImageElement):
332         (WebCore::HTMLImageElement::createForJSConstructor):
333         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
334         (WebCore::HTMLImageElement::insertedInto):
335         (WebCore::HTMLImageElement::removedFrom):
336         (WebCore::HTMLImageElement::pictureElement):
337         (WebCore::HTMLImageElement::setPictureElement):
338         (WebCore::HTMLImageElement::width):
339         * html/HTMLImageElement.h:
340         (WebCore::HTMLImageElement::hasShadowControls):
341         * html/HTMLPictureElement.h:
342         * html/parser/HTMLConstructionSite.cpp:
343         (WebCore::HTMLConstructionSite::createHTMLElement):
344         * html/parser/HTMLPreloadScanner.cpp:
345         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
346
347         Images that are built underneath a <picture> element are now connected
348         to that picture element via a setPictureNode call from the parser. This
349         ensures that the correct <source> elements are examined before checking the image.
350
351         This connection between images and their picture owners is handled using a static
352         HashMap in HTMLImageElement. This connection is made both from the parser and from
353         DOM insertions, and the map is queried now instead of looking directly at the
354         image's parentNode().
355
356 2016-01-14  Commit Queue  <commit-queue@webkit.org>
357
358         Unreviewed, rolling out r195002.
359         https://bugs.webkit.org/show_bug.cgi?id=153098
360
361         Crashes many/most editing tests (Requested by ap on #webkit).
362
363         Reverted changeset:
364
365         "WK2: Request completion candidates when needed"
366         https://bugs.webkit.org/show_bug.cgi?id=153040
367         http://trac.webkit.org/changeset/195002
368
369 2016-01-14  Martin Robinson  <mrobinson@igalia.com>
370
371         [GTK] [EFL] Hyphenation can never work in practice due to requirements on lang tags
372         https://bugs.webkit.org/show_bug.cgi?id=147310
373
374         Reviewed by Michael Catanzaro.
375
376         Test: platform/gtk/fast/text/hyphenate-flexible-locales.html
377
378         * platform/text/hyphen/HyphenationLibHyphen.cpp: Make locale matching for dictionary
379         selection a lot looser by matching case insensitively, matching multiple dictionaries
380         when only the language is specified, and ignoring the difference between '_' and '-' in
381         the locale name.
382         (WebCore::scanDirectoryForDicionaries): Now produce HashMap of Vectors instead of a single
383         path for each locale. Also add alternate entries to handle different ways of specifying
384         the locale.
385         (WebCore::scanTestDictionariesDirectoryIfNecessary): Update to handle the difference
386         in HashMap type.
387         (WebCore::availableLocales): Ditto.
388         (WebCore::canHyphenate): Also look for the lowercased version of the locale.
389         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey):
390         Key on the dictionary path now so that we can load more than one dictionary per locale.
391         (WebCore::lastHyphenLocation): Iterate through each matched dictionary in turn.
392
393 2016-01-14  Per Arne Vollan  <peavo@outlook.com>
394
395         [Win] Remove workarounds for fixed bugs in fmod and pow.
396         https://bugs.webkit.org/show_bug.cgi?id=153071
397
398         Reviewed by Brent Fulgham.
399
400         Compile fix, help MSVC pick correct pow overload.
401
402         * rendering/shapes/BoxShape.cpp:
403         (WebCore::adjustRadiusForMarginBoxShape):
404
405 2016-01-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
406
407         Fix problems with cross-origin redirects
408         https://bugs.webkit.org/show_bug.cgi?id=116075
409
410         Reviewed by Daniel Bates.
411
412         Merging https://chromium.googlesource.com/chromium/blink/+/7ea774e478f84f355748108d2aaabca15355d512 by Ken Russell
413         Same origin redirect responses leading to cross-origin requests were checked as cross-origin redirect responses.
414         Introduced ClientRequestedCredentials to manage whether credentials are needed or not in the cross-origin request.
415
416         In addition to Blink patch, it was needed to update some loaders with the newly introduced ClientRequestedCredentials parameter.
417         Added the clearing of "Accept-Encoding" header from cross-origin requests as Mac HTTP network layer is adding it for same-origin requests.
418
419         Test: http/tests/xmlhttprequest/access-control-and-redirects-async-same-origin.html
420
421         * loader/DocumentLoader.cpp:
422         (WebCore::DocumentLoader::startLoadingMainResource): Added new security parameter (from Blink patch).
423         * loader/DocumentThreadableLoader.cpp:
424         (WebCore::DocumentThreadableLoader::redirectReceived): Updated checks so that same origin redirections are not treated as cross origin redirections (from Blink patch).
425         * loader/MediaResourceLoader.cpp:
426         (WebCore::MediaResourceLoader::start):
427         * loader/NetscapePlugInStreamLoader.cpp:
428         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): Added new security parameter.
429         * loader/ResourceLoaderOptions.h:
430         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Added new security parameter (from Blink patch).
431         (WebCore::ResourceLoaderOptions::credentialRequest):
432         (WebCore::ResourceLoaderOptions::setCredentialRequest):
433         * loader/cache/CachedResourceLoader.cpp:
434         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Ditto.
435         (WebCore::CachedResourceLoader::defaultCachedResourceOptions): Ditto.
436         * loader/icon/IconLoader.cpp:
437         (WebCore::IconLoader::startLoading): Added new security parameter.
438         * page/EventSource.cpp:
439         (WebCore::EventSource::connect): Added new security parameter (from Blink patch).
440         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
441         (WebCore::WebCoreAVCFResourceLoader::startLoading): Added new security parameter.
442         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
443         (WebCore::WebCoreAVFResourceLoader::startLoading): Ditto.
444         * platform/network/ResourceHandleTypes.h: Added new security parameter constants (from Blink patch).
445         * platform/network/ResourceRequestBase.cpp:
446         (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding): Function to remove "Accept-Encoding" header.
447         * platform/network/ResourceRequestBase.h: Ditto.
448         * xml/XMLHttpRequest.cpp:
449         (WebCore::XMLHttpRequest::createRequest): Added new security parameter.
450
451 2016-01-13  Myles C. Maxfield  <mmaxfield@apple.com>
452
453         Addressing more post-review comments after r194566
454
455         Unreviewed.
456
457         No new tests because there is no behavior change.
458
459         * platform/text/mac/TextBreakIteratorInternalICUMac.mm:
460         (WebCore::topLanguagePreference):
461
462 2016-01-13  Alex Christensen  <achristensen@webkit.org>
463
464         Implement custom protocols when using NetworkSession
465         https://bugs.webkit.org/show_bug.cgi?id=153078
466
467         Reviewed by Andy Estes.
468
469         No new tests, but this makes the WebKit2CustomProtocolsTest api tests pass when using NetworkSession.
470
471         * WebCore.xcodeproj/project.pbxproj:
472         Make NSURLConnectionSPI.h private so we can include it from within WebKit2.
473
474 2016-01-13  Brent Fulgham  <bfulgham@apple.com>
475
476         Cross-protocol, cross-site scripting (XPSS) using HTML forms
477         https://bugs.webkit.org/show_bug.cgi?id=153017
478         <rdar://problem/5873254>
479
480         Reviewed by David Kilzer.
481
482         * loader/DocumentLoader.cpp:
483         (WebCore::DocumentLoader::responseReceived): If response HTTP version is 0.9,
484         sandbox against script execution and plugins.
485         * loader/ResourceLoader.cpp:
486         (WebCore::ResourceLoader::didReceiveResponse): Ditto.
487         * loader/SubresourceLoader.cpp:
488         (WebCore::SubresourceLoader::didReceiveResponse): Ditto.
489         * platform/network/ResourceResponseBase.cpp:
490         (WebCore::ResourceResponseBase::adopt): Update for HTTP version.
491         (WebCore::ResourceResponseBase::copyData): Ditto.
492         (WebCore::ResourceResponseBase::httpVersion): Added.
493         (WebCore::ResourceResponseBase::setHTTPVersion): Ditto.
494         * platform/network/ResourceResponseBase.h:
495         (WebCore::ResourceResponseBase::encode): Update for HTTP version.
496         (WebCore::ResourceResponseBase::decode): Ditto.
497         * platform/network/cf/ResourceResponseCFNet.cpp:
498         (WebCore::ResourceResponse::platformLazyInit): Capture HTTP version.
499         * platform/network/cocoa/ResourceResponseCocoa.mm:
500         (WebCore::ResourceResponse::platformLazyInit): Ditto.
501
502 2016-01-13  Beth Dakin  <bdakin@apple.com>
503
504         WK2: Request completion candidates when needed
505         https://bugs.webkit.org/show_bug.cgi?id=153040
506         -and corresponding-
507         rdar://problem/24155631
508
509         Reviewed by Enrica Casucci.
510
511         Helper functions for stringForCandidateRequest() and 
512         handleAcceptedCandidate()
513         * editing/Editor.cpp:
514         (WebCore::candidateRangeForSelection):
515         (WebCore::candidateWouldReplaceText):
516
517         Request candidates for the word that is currently being typed so long as the 
518         candidate would replace that word. Otherwise, use String().
519         (WebCore::Editor::stringForCandidateRequest):
520
521         When a candidate has been accepted, insert the text.
522         (WebCore::Editor::handleAcceptedCandidate):
523         * editing/Editor.h:
524
525 2016-01-13  Myles C. Maxfield  <mmaxfield@apple.com>
526
527         Addressing post-review comments after r194566
528
529         Unreviewed.
530
531         No new tests because there is no behavior difference.
532
533         * platform/text/mac/TextBreakIteratorInternalICUMac.mm:
534         (WebCore::textBreakLocalePreference):
535         (WebCore::topLanguagePreference):
536         (WebCore::getSearchLocale):
537         (WebCore::getTextBreakLocale):
538         (WebCore::canonicalLanguageIdentifier): Deleted.
539
540 2016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
541
542         formaction must return document's address when formaction is missing
543         https://bugs.webkit.org/show_bug.cgi?id=148874
544
545         Reviewed by Chris Dumez.
546
547         Fixed the bug by falling back to document.url() when the attribute is not set or is empty in formAction getter.
548
549         Test: fast/forms/formaction-attribute-with-empty-value.html
550
551         * html/HTMLButtonElement.idl:
552         * html/HTMLFormControlElement.cpp:
553         (WebCore::HTMLFormControlElement::formAction): Added.
554         (WebCore::HTMLFormControlElement::setFormAction): Added.
555         * html/HTMLFormControlElement.h:
556         * html/HTMLInputElement.idl:
557
558 2016-01-13  Chris Dumez  <cdumez@apple.com>
559
560         Unreviewed, rolling out r194900.
561
562         Roll back in as this did not actually regress PLT
563
564         Reverted changeset:
565
566         "Unreviewed, rolling out r194826."
567         https://bugs.webkit.org/show_bug.cgi?id=153020
568         http://trac.webkit.org/changeset/194900
569
570 2016-01-13  Konstantin Tokarev  <annulen@yandex.ru>
571
572         Removed empty #if block from Font.h
573         https://bugs.webkit.org/show_bug.cgi?id=153067
574
575         Reviewed by Alex Christensen.
576
577         No new tests needed.
578
579         * platform/graphics/Font.h:
580         (WebCore::Font::scriptCache): Deleted.
581
582 2016-01-13  Michael Catanzaro  <mcatanzaro@igalia.com>
583
584         [GTK] Consistently use virtual and override specifiers in ScrollbarThemeGtk
585         https://bugs.webkit.org/show_bug.cgi?id=153076
586
587         Reviewed by Alex Christensen.
588
589         No behavior change.
590
591         * platform/gtk/ScrollbarThemeGtk.h:
592
593 2016-01-13  Daniel Bates  <dabates@apple.com>
594
595         Cleanup: XSS Auditor should avoid re-evaluating the parsed script tag
596         https://bugs.webkit.org/show_bug.cgi?id=152870
597
598         Reviewed by Brent Fulgham.
599
600         Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
601         <https://src.chromium.org/viewvc/blink?revision=154354&view=revision>
602
603         Although the XSS Auditor caches the decoded start tag of a script as an optimization to
604         avoid decoding it again when filtering the character data of the script, it is sufficient
605         to cache whether the HTTP response contains the decoded start tag of a script. This
606         avoids both decoding the start tag of a script and determining whether the HTTP response
607         contains it again when filtering the character data of the script. Moreover, this removes
608         the need to cache a string object.
609
610         * html/parser/XSSAuditor.cpp:
611         (WebCore::XSSAuditor::filterCharacterToken):
612         (WebCore::XSSAuditor::filterScriptToken):
613         * html/parser/XSSAuditor.h:
614
615 2016-01-13  Commit Queue  <commit-queue@webkit.org>
616
617         Unreviewed, rolling out r194963.
618         https://bugs.webkit.org/show_bug.cgi?id=153079
619
620         This change causes ASan tests to crash and exit early
621         (Requested by ryanhaddad on #webkit).
622
623         Reverted changeset:
624
625         "Fragmentation-free allocator for timeless and/or coupled
626         allocations."
627         https://bugs.webkit.org/show_bug.cgi?id=152696
628         http://trac.webkit.org/changeset/194963
629
630 2016-01-13  Daniel Bates  <dabates@apple.com>
631
632         [XSS Auditor] Do not include trailing comment characters in JavaScript snippets
633         https://bugs.webkit.org/show_bug.cgi?id=152873
634
635         Reviewed by Brent Fulgham.
636
637         Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
638         <https://src.chromium.org/viewvc/blink?view=rev&revision=169967>
639
640         Test: http/tests/security/xssAuditor/script-tag-with-injected-comment.html
641
642         * html/parser/XSSAuditor.cpp:
643         (WebCore::XSSAuditor::decodedSnippetForJavaScript):
644
645 2016-01-13  Adam Bergkvist  <adam.bergkvist@ericsson.com>
646
647         WebRTC: Add support for RTCRtpSender.replaceTrack()
648         https://bugs.webkit.org/show_bug.cgi?id=153063
649
650         Reviewed by Eric Carlson.
651
652         Add the API and infrastructure to support RTCRtpSender.replaceTrack(). The platform is
653         reached through the RTCPeerConnection object that created the RTCRtpSender via a client
654         interface.
655
656         Test: fast/mediastream/RTCRtpSender-replaceTrack.html
657
658         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
659         (WebCore::MediaEndpointPeerConnection::replaceTrack):
660         * Modules/mediastream/MediaEndpointPeerConnection.h:
661         * Modules/mediastream/PeerConnectionBackend.h:
662         * Modules/mediastream/RTCPeerConnection.cpp:
663         (WebCore::RTCPeerConnection::addTrack):
664         (WebCore::RTCPeerConnection::removeTrack):
665         (WebCore::RTCPeerConnection::replaceTrack):
666         * Modules/mediastream/RTCPeerConnection.h:
667         * Modules/mediastream/RTCRtpSender.cpp:
668         (WebCore::RTCRtpSender::RTCRtpSender):
669         (WebCore::RTCRtpSender::replaceTrack):
670         * Modules/mediastream/RTCRtpSender.h:
671         (WebCore::RTCRtpSenderClient::~RTCRtpSenderClient):
672         (WebCore::RTCRtpSender::create):
673         (WebCore::RTCRtpSender::trackId):
674         (WebCore::RTCRtpSender::stop):
675         * Modules/mediastream/RTCRtpSender.idl:
676
677 2016-01-13  Brady Eidson  <beidson@apple.com>
678
679         Modern IDB: A few cursor tests are flaky because JS wrappers are GC'ed.
680         https://bugs.webkit.org/show_bug.cgi?id=153038
681
682         Reviewed by Alex Christensen.
683
684         No new tests (Couldn't write a test that was any more reliable than "flaky", so fixing the existing flaky tests will do).
685
686         And IDBCursor has an associated IDBRequest that is re-used each time the IDBCursor iterates.
687         
688         The normal ActiveDOMObject approach to prevent the IDBRequest's wrapper from being garbage collected was not good enough
689         because, while the IDBRequest may not currently be waiting on any activity, as long as its associated IDBCursor is still
690         reachable then the request might be reused in the future.
691         
692         Fortunately there's an IDL allowance for "one object keeping another alive during GC" and that's JSCustomMarkFunction
693         combined with GenerateIsReachable.
694         
695         Applying those to IDBCursor and IDBRequest fix this handily.
696         
697         * CMakeLists.txt:
698         * WebCore.xcodeproj/project.pbxproj:
699
700         * Modules/indexeddb/IDBCursor.h:
701         (WebCore::IDBCursor::isModernCursor):
702         * Modules/indexeddb/IDBCursor.idl:
703         
704         * Modules/indexeddb/IDBRequest.idl:
705         
706         * Modules/indexeddb/client/IDBCursorImpl.cpp:
707         (WebCore::IDBClient::IDBCursor::advance):
708         (WebCore::IDBClient::IDBCursor::continueFunction):
709         (WebCore::IDBClient::IDBCursor::uncheckedIterateCursor):
710         (WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor): Deleted. Fixed the typo of this name.
711         * Modules/indexeddb/client/IDBCursorImpl.h:
712         
713         * bindings/js/JSIDBCursorCustom.cpp: Added.
714         (WebCore::JSIDBCursor::visitAdditionalChildren):
715
716 2016-01-13  Zalan Bujtas  <zalan@apple.com>
717
718         Get text drawing working with display lists.
719         https://bugs.webkit.org/show_bug.cgi?id=152957
720
721         Reviewed by Simon Fraser.
722
723         This patch enables text drawing for display lists.
724
725         * platform/graphics/FontCascade.cpp:
726         (WebCore::FontCascade::drawGlyphBuffer):
727         * platform/graphics/FontCascade.h:
728         * platform/graphics/GraphicsContext.cpp:
729         (WebCore::GraphicsContext::drawGlyphs):
730         (WebCore::GraphicsContext::drawText): Deleted.
731         * platform/graphics/cocoa/FontCascadeCocoa.mm:
732         (WebCore::FontCascade::drawGlyphs):
733         * platform/graphics/displaylists/DisplayListItems.cpp:
734         (WebCore::DisplayList::DrawGlyphs::apply):
735
736 2016-01-13  Zalan Bujtas  <zalan@apple.com>
737
738         Simple line layout: Add support for word-break property.
739         https://bugs.webkit.org/show_bug.cgi?id=153054
740
741         Reviewed by Antti Koivisto.
742
743         This patch enables word-break property for simple line layout.
744         (https://drafts.csswg.org/css-text-3/#propdef-word-break)
745
746         word-break: normal and keep-all -> existing, non-(force)breaking behaviour.
747                     break-all -> breaks words when needed.
748
749         Covered by existing tests like fast/text/word-break.html
750
751         * rendering/SimpleLineLayout.cpp:
752         (WebCore::SimpleLineLayout::createLineRuns):
753         (WebCore::SimpleLineLayout::canUseForStyle): Deleted.
754         (WebCore::SimpleLineLayout::printReason): Deleted.
755         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
756         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
757         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextTextFragment):
758         * rendering/SimpleLineLayoutTextFragmentIterator.h:
759         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
760         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
761         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isBreakable): Deleted.
762         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
763
764 2016-01-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
765
766         Reference cycle between SVGPathElement and SVGPathSegWithContext leaks Document
767         https://bugs.webkit.org/show_bug.cgi?id=151810
768
769         Reviewed by Darin Adler.
770
771         Break the reference cycle between SVGPathElement and SVGPathSegWithContext
772         by changing the back-pointer to be a WeakPtr pointer instead of having it
773         RefPtr. Make sure the SVGPathSegWithContext derived classes handle correctly
774         the case when the SVGPathElement back-pointer is deleted.
775
776         Also change the SVGPathElement argument to the SVGPathSeg creation functions
777         and constructors to be a const reference instead of having it as a pointer
778         since SVGPathElement is the class factory for all these classes.
779
780         * svg/SVGPathElement.cpp:
781         (WebCore::SVGPathElement::SVGPathElement):
782         (WebCore::SVGPathElement::createSVGPathSegClosePath):
783         (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
784         (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
785         (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
786         (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
787         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
788         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
789         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
790         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
791         (WebCore::SVGPathElement::createSVGPathSegArcAbs):
792         (WebCore::SVGPathElement::createSVGPathSegArcRel):
793         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
794         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
795         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
796         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
797         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
798         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
799         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
800         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
801         (WebCore::SVGPathElement::isSupportedAttribute):
802         * svg/SVGPathElement.h:
803         * svg/SVGPathSegArc.h:
804         (WebCore::SVGPathSegArc::SVGPathSegArc):
805         * svg/SVGPathSegArcAbs.h:
806         (WebCore::SVGPathSegArcAbs::create):
807         (WebCore::SVGPathSegArcAbs::SVGPathSegArcAbs):
808         * svg/SVGPathSegArcRel.h:
809         (WebCore::SVGPathSegArcRel::create):
810         (WebCore::SVGPathSegArcRel::SVGPathSegArcRel):
811         * svg/SVGPathSegClosePath.h:
812         (WebCore::SVGPathSegClosePath::create):
813         (WebCore::SVGPathSegClosePath::SVGPathSegClosePath):
814         * svg/SVGPathSegCurvetoCubic.h:
815         (WebCore::SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic):
816         * svg/SVGPathSegCurvetoCubicAbs.h:
817         (WebCore::SVGPathSegCurvetoCubicAbs::create):
818         (WebCore::SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs):
819         * svg/SVGPathSegCurvetoCubicRel.h:
820         (WebCore::SVGPathSegCurvetoCubicRel::create):
821         (WebCore::SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel):
822         * svg/SVGPathSegCurvetoCubicSmooth.h:
823         (WebCore::SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth):
824         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
825         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
826         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs):
827         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
828         (WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
829         (WebCore::SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel):
830         * svg/SVGPathSegCurvetoQuadratic.h:
831         (WebCore::SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic):
832         * svg/SVGPathSegCurvetoQuadraticAbs.h:
833         (WebCore::SVGPathSegCurvetoQuadraticAbs::create):
834         (WebCore::SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs):
835         * svg/SVGPathSegCurvetoQuadraticRel.h:
836         (WebCore::SVGPathSegCurvetoQuadraticRel::create):
837         (WebCore::SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel):
838         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
839         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
840         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs):
841         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
842         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
843         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel):
844         * svg/SVGPathSegLinetoAbs.h:
845         (WebCore::SVGPathSegLinetoAbs::create):
846         (WebCore::SVGPathSegLinetoAbs::SVGPathSegLinetoAbs):
847         * svg/SVGPathSegLinetoHorizontal.h:
848         (WebCore::SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal):
849         * svg/SVGPathSegLinetoHorizontalAbs.h:
850         (WebCore::SVGPathSegLinetoHorizontalAbs::create):
851         (WebCore::SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs):
852         * svg/SVGPathSegLinetoHorizontalRel.h:
853         (WebCore::SVGPathSegLinetoHorizontalRel::create):
854         (WebCore::SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel):
855         * svg/SVGPathSegLinetoRel.h:
856         (WebCore::SVGPathSegLinetoRel::create):
857         (WebCore::SVGPathSegLinetoRel::SVGPathSegLinetoRel):
858         * svg/SVGPathSegLinetoVertical.h:
859         (WebCore::SVGPathSegLinetoVertical::SVGPathSegLinetoVertical):
860         * svg/SVGPathSegLinetoVerticalAbs.h:
861         (WebCore::SVGPathSegLinetoVerticalAbs::create):
862         (WebCore::SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs):
863         * svg/SVGPathSegLinetoVerticalRel.h:
864         (WebCore::SVGPathSegLinetoVerticalRel::create):
865         (WebCore::SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel):
866         * svg/SVGPathSegMovetoAbs.h:
867         (WebCore::SVGPathSegMovetoAbs::create):
868         (WebCore::SVGPathSegMovetoAbs::SVGPathSegMovetoAbs):
869         * svg/SVGPathSegMovetoRel.h:
870         (WebCore::SVGPathSegMovetoRel::create):
871         (WebCore::SVGPathSegMovetoRel::SVGPathSegMovetoRel):
872         * svg/SVGPathSegWithContext.h:
873         (WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
874         (WebCore::SVGPathSegWithContext::animatedProperty):
875         (WebCore::SVGPathSegWithContext::contextElement):
876         (WebCore::SVGPathSegWithContext::setContextAndRole):
877         (WebCore::SVGPathSegWithContext::commitChange):
878         (WebCore::SVGPathSegSingleCoordinate::setY):
879         (WebCore::SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate):
880         * svg/properties/SVGPathSegListPropertyTearOff.cpp:
881         (WebCore::SVGPathSegListPropertyTearOff::clearContextAndRoles):
882         (WebCore::SVGPathSegListPropertyTearOff::replaceItem):
883         (WebCore::SVGPathSegListPropertyTearOff::removeItem):
884
885 2016-01-13  Andreas Kling  <akling@apple.com>
886
887         Use BumpArena for style sheet object tree.
888         <https://webkit.org/b/152696>
889
890         Reviewed by Antti Koivisto.
891
892         Give each StyleSheetContents its own BumpArena, and plumb it down through CSSParser
893         to allocate StyleRule, StyleProperties and CSSSelectorList's selector arrays there.
894
895         This basically means that most objects that make up a given style sheet will end up
896         in one (or a few) contiguous region(s) of memory, instead of being scattered all
897         over the malloc heap.
898
899         In the common case (no CSSOM manipulation), the lifetimes of these objects are very
900         predictable: everything tends to die when the StyleSheetContents dies.
901         This dramatically improves space-efficiency in those cases, and allows us to return
902         contiguous chunks of memory to the system once a style sheet is no longer needed.
903
904         One-off CSS parses that don't work within a StyleSheetContents context will have
905         their StyleRules & co allocated out of the global BumpArena.
906
907         Bonus: give SelectorQueryCache a dedicated BumpArena as well, since it has very
908         predictable lifetime.
909
910         * css/CSSGrammar.y.in:
911         * css/CSSKeyframesRule.h:
912         (WebCore::StyleRuleKeyframes::create):
913         * css/CSSParser.cpp:
914         (WebCore::CSSParser::createStyleProperties):
915         (WebCore::CSSParser::createMediaRule):
916         (WebCore::CSSParser::createSupportsRule):
917         (WebCore::CSSParser::createKeyframesRule):
918         (WebCore::CSSParser::setArena):
919         (WebCore::CSSParser::arena):
920         (WebCore::CSSParser::createStyleRule):
921         (WebCore::CSSParser::createFontFaceRule):
922         (WebCore::CSSParser::createPageRule):
923         (WebCore::CSSParser::createRegionRule):
924         (WebCore::CSSParser::createViewportRule):
925         * css/CSSParser.h:
926         * css/CSSParserValues.cpp:
927         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
928         (WebCore::CSSParserSelector::adoptSelectorVector):
929         * css/CSSParserValues.h:
930         * css/CSSSelectorList.cpp:
931         (WebCore::CSSSelectorList::CSSSelectorList):
932         (WebCore::CSSSelectorList::adoptSelectorVector):
933         (WebCore::CSSSelectorList::deleteSelectors):
934         * css/CSSSelectorList.h:
935         * css/StyleProperties.cpp:
936         (WebCore::ImmutableStyleProperties::create):
937         (WebCore::StyleProperties::immutableCopyIfNeeded):
938         * css/StyleProperties.h:
939         * css/StyleRule.cpp:
940         (WebCore::StyleRule::create):
941         (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
942         (WebCore::StyleRuleRegion::StyleRuleRegion):
943         * css/StyleRule.h:
944         (WebCore::StyleRule::create):
945         (WebCore::StyleRule::parserAdoptSelectorVector):
946         (WebCore::StyleRuleFontFace::create):
947         (WebCore::StyleRulePage::create):
948         (WebCore::StyleRulePage::parserAdoptSelectorVector):
949         (WebCore::StyleRuleMedia::create):
950         (WebCore::StyleRuleSupports::create):
951         (WebCore::StyleRuleRegion::create):
952         (WebCore::StyleRuleViewport::create):
953         * css/StyleSheetContents.cpp:
954         (WebCore::StyleSheetContents::StyleSheetContents):
955         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
956         (WebCore::StyleSheetContents::parseStringAtPosition):
957         * css/StyleSheetContents.h:
958         * dom/SelectorQuery.cpp:
959         (WebCore::SelectorQueryCache::SelectorQueryCache):
960         (WebCore::SelectorQueryCache::add):
961         * dom/SelectorQuery.h:
962         * svg/SVGFontFaceElement.cpp:
963         (WebCore::SVGFontFaceElement::SVGFontFaceElement):
964
965 2016-01-13  YongGeol Jung  <yg48.jung@samsung.com>
966
967         [TexMap] BitmapTextureGL is not released while scene is updated continuously.
968         https://bugs.webkit.org/show_bug.cgi?id=152524
969
970         Reviewed by Žan Doberšek.
971
972         This patch fixes two issues.
973         First, m_releaseUnusedTexturesTimer is not fired if scene is updated within 0.5s continuously.
974         In this case, BitmapTexturePool will not remove texture even if texture is not used for long time.
975         Second, m_releaseUnusedTexturesTimer is triggered by acquireTexture function only.
976         So, if next scene does not need to use BitmapTexture, remained textures in pool will not removed.
977
978         No new tests needed.
979
980         * platform/graphics/texmap/BitmapTexturePool.cpp:
981         (WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures):
982         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
983
984 2016-01-13  Youenn Fablet  <youenn.fablet@crf.canon.fr>
985
986         [Streams API] Refactor builtin internals to prepare support for streams API in worker
987         https://bugs.webkit.org/show_bug.cgi?id=152535
988
989         Reviewed by Darin Adler.
990
991         Moving the code that links internal functions to the GlobalObject in WebCoreJSBuiltinInternals.cpp.
992         This file should be generated by the builtin generator once refactoring is done.
993         This code is located in JSBuiltinInternalFunctions::initialize.
994
995         Adding private controller and reader constructors to the JS DOM constructor map so that they do not get garbage collected.
996
997         No change in behavior, except that private builtins are usable in workers (but not actually used).
998
999         * CMakeLists.txt:
1000         * WebCore.vcxproj/WebCore.vcxproj:
1001         * WebCore.xcodeproj/project.pbxproj:
1002         * bindings/js/JSDOMGlobalObject.cpp:
1003         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
1004         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1005         (WebCore::JSDOMGlobalObject::finishCreation):
1006         (WebCore::JSDOMGlobalObject::visitChildren):
1007         * bindings/js/JSDOMGlobalObject.h:
1008         * bindings/js/JSDOMWindowBase.cpp:
1009         (WebCore::JSDOMWindowBase::finishCreation):
1010         (WebCore::JSDOMWindowBase::visitChildren):
1011         * bindings/js/JSDOMWindowBase.h:
1012         * bindings/js/WebCoreJSBuiltinInternals.cpp: Added.
1013         (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
1014         (WebCore::JSBuiltinInternalFunctions::visit):
1015         (WebCore::JSBuiltinInternalFunctions::initialize):
1016         * bindings/js/WebCoreJSBuiltinInternals.h:
1017
1018 2016-01-13  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1019
1020         [EFL] Fix wrong return value of paintThemePart in RenderThemeEfl
1021         https://bugs.webkit.org/show_bug.cgi?id=153058
1022
1023         Reviewed by Carlos Garcia Campos.
1024
1025         To return false in paint functions in RenderThemeEfl means that it is supported though,
1026         paintThemePart has returned false even when failing to get image cache of theme.
1027
1028         * rendering/RenderThemeEfl.cpp:
1029         (WebCore::RenderThemeEfl::paintThemePart):
1030
1031 2016-01-12  Andy Estes  <aestes@apple.com>
1032
1033         [Content Filtering] forEachContentFilterUntilBlocked should accept a lambda by rvalue reference
1034         https://bugs.webkit.org/show_bug.cgi?id=153057
1035
1036         Reviewed by Dan Bernstein.
1037
1038         No new tests. No change in behavior.
1039
1040         Instead of having ContentFilter::forEachContentFilterUntilBlocked() take a std::function, just have it take an
1041         rvalue reference to the lambda its passed.
1042
1043         * loader/ContentFilter.cpp:
1044         (WebCore::ContentFilter::forEachContentFilterUntilBlocked):
1045         * loader/ContentFilter.h:
1046
1047 2016-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1048
1049         [GTK] Fix return value of some paint methods in RenderThemeGtk
1050         https://bugs.webkit.org/show_bug.cgi?id=153015
1051
1052         Reviewed by Michael Catanzaro.
1053
1054         The bool value returned by paint methods in RenderTheme means
1055         whether the appearance is supported or not, so we should return
1056         true when not supported (so we didn't paint anything) and false
1057         when supported (so we actually painted the theme part).
1058
1059         * rendering/RenderThemeGtk.cpp:
1060         (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
1061         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
1062         (WebCore::RenderThemeGtk::paintMediaButton):
1063         (WebCore::RenderThemeGtk::paintMediaMuteButton):
1064         (WebCore::RenderThemeGtk::paintMediaPlayButton):
1065         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
1066         (WebCore::RenderThemeGtk::paintMediaVolumeSliderContainer): Deleted.
1067         * rendering/RenderThemeGtk.h:
1068
1069 2016-01-12  Andy Estes  <aestes@apple.com>
1070
1071         [Content Filtering] De-virtualize PlatformContentFilter::{needsMoreData, didBlockData}()
1072         https://bugs.webkit.org/show_bug.cgi?id=153052
1073
1074         Reviewed by Andreas Kling.
1075
1076         No new tests. No change in behavior.
1077
1078         Instead of having virtual functions that each platform content filter implement in terms of their own state,
1079         store the state in the base class so that these functions can be non-virtual. Teach each subclass to update the
1080         base class state appropriately.
1081
1082         * loader/ContentFilter.h:
1083         * platform/PlatformContentFilter.h:
1084         (WebCore::PlatformContentFilter::needsMoreData):
1085         (WebCore::PlatformContentFilter::didBlockData):
1086         * platform/cocoa/NetworkExtensionContentFilter.h:
1087         * platform/cocoa/NetworkExtensionContentFilter.mm:
1088         (WebCore::NetworkExtensionContentFilter::willSendRequest):
1089         (WebCore::NetworkExtensionContentFilter::responseReceived):
1090         (WebCore::NetworkExtensionContentFilter::handleDecision):
1091         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Deleted.
1092         (WebCore::NetworkExtensionContentFilter::needsMoreData): Deleted.
1093         (WebCore::NetworkExtensionContentFilter::didBlockData): Deleted.
1094         * platform/cocoa/ParentalControlsContentFilter.h:
1095         * platform/cocoa/ParentalControlsContentFilter.mm:
1096         (WebCore::ParentalControlsContentFilter::responseReceived):
1097         (WebCore::ParentalControlsContentFilter::updateFilterState):
1098         (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Deleted.
1099         (WebCore::ParentalControlsContentFilter::needsMoreData): Deleted.
1100         (WebCore::ParentalControlsContentFilter::didBlockData): Deleted.
1101         * platform/spi/cocoa/NEFilterSourceSPI.h:
1102         * testing/MockContentFilter.cpp:
1103         (WebCore::MockContentFilter::willSendRequest):
1104         (WebCore::MockContentFilter::maybeDetermineStatus):
1105         (WebCore::MockContentFilter::needsMoreData): Deleted.
1106         (WebCore::MockContentFilter::didBlockData): Deleted.
1107         * testing/MockContentFilter.h:
1108
1109 2016-01-12  Andy Estes  <aestes@apple.com>
1110
1111         Address missed review feedback after r194950.
1112
1113         * platform/cocoa/NetworkExtensionContentFilter.mm:
1114         (WebCore::NetworkExtensionContentFilter::initialize): Renamed the NetworkExtension dispatch queue.
1115
1116 2016-01-08  Andy Estes  <aestes@apple.com>
1117
1118         [Content Filtering] Lazily load platform frameworks
1119         https://bugs.webkit.org/show_bug.cgi?id=152881
1120         rdar://problem/23270886
1121
1122         Reviewed by Brady Eidson.
1123
1124         On Cocoa platforms, ContentFilter soft-links two frameworks that perform the underlying filtering operations.
1125         There is a one-time cost associated with the soft-linking, and the current design requires all clients to pay
1126         this cost whether or not they ever load a resource that is subject to filtering.
1127
1128         Addressed this by deferring the loading of frameworks until it is known that a resource will require filtering.
1129         It is rather simple to defer the soft-linking at the PlatformContentFilter level, but doing this alone would
1130         mean that every CachedRawResourceClient callback would be routed through ContentFilter, even in the very common
1131         case where both platform content filters are disabled. This is because checking if a platform content filter is
1132         enabled involves loading its framework, so creating a ContentFilter (which DocumentLoader will add as the
1133         CachedRawResource client in place of itself) cannot be avoided by checking that all its platform content filters
1134         are disabled.
1135
1136         Resolved this by inverting the relationship between ContentFilter and DocumentLoader. Instead of ContentFilter
1137         being the CachedRawResource's client and forwarding callbacks to DocumentLoader when one or more platform
1138         filters are enabled, DocumentLoader is now always the client and it forwards callbacks to ContentFilter.
1139         ContentFilter then returns a boolean value indicating whether or not DocumentLoader should proceed with each
1140         callback.
1141
1142         New API test: ContentFiltering.LazilyLoadPlatformFrameworks
1143
1144         * loader/ContentFilter.cpp:
1145         (WebCore::ContentFilter::create): Renamed from createIfEnabled(). Since the enabled check causes frameworks to
1146         be loaded, the check is skipped here and all types are always created.
1147         (WebCore::ContentFilter::continueAfterWillSendRequest): Renamed from willSendRequest(). Renamed requestCopy to
1148         originalRequest, and only created it for logging purposes. Since the copy was only used for logging purposes,
1149         request is now modified directly. Returned false if request is null.
1150         (WebCore::ContentFilter::continueAfterResponseReceived): Renamed from responseReceived(). Stopped asserting that
1151         resource is non-null, since it will be null in the case of substitute data loads. Stopped asserting that m_state
1152         is not Initialized, since that state was removed and the function can now be called in all states. Only logged
1153         if m_state is Filtering. Returned false if m_state is Blocked.
1154         (WebCore::ContentFilter::continueAfterDataReceived): Renamed from dataReceived(). Stopped asserting that
1155         resource is non-null and that m_state is Initialized, and moved the logging, for the same reasons as above.
1156         Returned false if m_state is Filtering or Blocked.
1157         (WebCore::ContentFilter::continueAfterNotifyFinished): Renamed from notifyFinished(). Stopped asserting that
1158         resource is non-null and that m_state is not Initialized, and moved the logging, for the same reasons as above.
1159         If m_state is not Blocked at this point, set m_state to Allowed in order for deliverResourceData() to not get
1160         caught in continueAfterDataReceived(). Returned false if m_state is Blocked or Stopped after delivering data.
1161         (WebCore::ContentFilter::createIfEnabled): Renamed to create().
1162         (WebCore::ContentFilter::~ContentFilter): Stopped removing ourself as m_mainResource's client.
1163         (WebCore::ContentFilter::willSendRequest): Renamed to continueAfterWillSendRequest().
1164         (WebCore::ContentFilter::startFilteringMainResource): Stopped adding ourself as m_mainResource's client. Stopped
1165         asserting that m_state is not Initialized and instead returned early if m_state is not Stopped.
1166         (WebCore::ContentFilter::stopFilteringMainResource): Stopped removing ourself as m_mainResource's client.
1167         (WebCore::ContentFilter::responseReceived): Renamed to continueAfterResponseReceived().
1168         (WebCore::ContentFilter::dataReceived): Renamed to continueAfterDataReceived().
1169         (WebCore::ContentFilter::redirectReceived): Removed. DocumentLoader now calls continueAfterWillSendRequest()
1170         directly on redirects.
1171         (WebCore::ContentFilter::notifyFinished): Renamed to continueAfterNotifyFinished().
1172         (WebCore::ContentFilter::didDecide): Instead of calling DocumentLoader::contentFilterDidDecide(), called
1173         DocumentLoader::contentFilterDidBlock() when m_state is Blocked.
1174         (WebCore::ContentFilter::deliverResourceData): Asserted that m_state is Allowed.
1175         * loader/ContentFilter.h: Stopped inheriting from CachedRawResourceClient. Redeclared the
1176         CachedRawResourceClient virtual functions as the continue* functions mentioned above. Made State enum private
1177         and removed Initialized. Initialized m_state to Stopped and removed its getter.
1178         (WebCore::ContentFilter::type): Returned a ContentFilter::Type that does not include an enabled function.
1179         * loader/DocumentLoader.cpp:
1180         (WebCore::DocumentLoader::notifyFinished): Returned early if ContentFilter::continueAfterNotifyFinished()
1181         returned false.
1182         (WebCore::DocumentLoader::willSendRequest): Called ContentFilter::continueAfterWillSendRequest() even for
1183         redirects, since ContentFilter is no longer a CachedRawResourceClient and so will no longer receive
1184         redirectReceived(). Returned early if continueAfterWillSendRequest() returns false.
1185         (WebCore::DocumentLoader::responseReceived): Returned early if ContentFilter::continueAfterResponseReceived()
1186         returned false.
1187         (WebCore::DocumentLoader::dataReceived): Ditto for ContentFilter::continueAfterDataReceived().
1188         (WebCore::DocumentLoader::startLoadingMainResource): Called ContentFilter::create(), not createIfEnabled().
1189         (WebCore::DocumentLoader::becomeMainResourceClient): Called ContentFilter::startFilteringMainResource() even if
1190         m_state is not Initialized. Added ourself as a client of m_mainResource unconditionally.
1191         (WebCore::DocumentLoader::contentFilterDidBlock): Renamed from contentFilterDidDecide. Removed assertions and
1192         the early return when m_state is Allowed, since the state is guaranteed to be Blocked.
1193         (WebCore::DocumentLoader::contentFilterDidDecide): Renamed to contentFilterDidBlock.
1194         * platform/cocoa/NetworkExtensionContentFilter.h: Moved definition of HAVE_NETWORK_EXTENSION to Platform.h so
1195         that this file doesn't need to become a Private header. Made enabled() private, and declared initialize().
1196         * platform/cocoa/NetworkExtensionContentFilter.mm:
1197         (WebCore::NetworkExtensionContentFilter::initialize): Added a function to lazily initialize the object.
1198         (WebCore::NetworkExtensionContentFilter::willSendRequest): For the modern NEFilterSource, checked if it is
1199         enabled only after checking if the request is HTTP(S). If both checks pass, then called initialize().
1200         (WebCore::NetworkExtensionContentFilter::responseReceived): Ditto for the legacy NEFilterSource.
1201         * platform/cocoa/ParentalControlsContentFilter.h: Made enabled() private.
1202         * platform/cocoa/ParentalControlsContentFilter.mm:
1203         (WebCore::ParentalControlsContentFilter::responseReceived): Checked if WebFilterEvaluator is enabled only after
1204         checking if the response is from a protocol that can be handled.
1205         * testing/MockContentFilter.cpp:
1206         (WebCore::MockContentFilter::willSendRequest): Immediately set m_status to Status::Allowed if !enabled().
1207         * testing/MockContentFilter.h: Made enabled() private.
1208
1209 2016-01-12  Commit Queue  <commit-queue@webkit.org>
1210
1211         Unreviewed, rolling out r194926 and r194928.
1212         https://bugs.webkit.org/show_bug.cgi?id=153048
1213
1214         This change is causing LayoutTest crashes (Requested by
1215         ryanhaddad on #webkit).
1216
1217         Reverted changesets:
1218
1219         "Avoid downloading the wrong image for <picture> elements."
1220         https://bugs.webkit.org/show_bug.cgi?id=153027
1221         http://trac.webkit.org/changeset/194926
1222
1223         "Avoid downloading the wrong image for <picture> elements."
1224         https://bugs.webkit.org/show_bug.cgi?id=153027
1225         http://trac.webkit.org/changeset/194928
1226
1227 2016-01-11  Dean Jackson  <dino@apple.com>
1228
1229         [iOS] Antialiasing doesn't work in WebGL
1230         https://bugs.webkit.org/show_bug.cgi?id=153000
1231         <rdar://problem/9165531>
1232
1233         Reviewed by Alex Christensen.
1234
1235         WebGL has supported platform antialiasing since
1236         the beginning, but we never hooked it up for iOS
1237         because it used a slightly different extension.
1238
1239         Test: fast/canvas/webgl/antialiasing-enabled.html
1240
1241         * platform/graphics/mac/GraphicsContext3DMac.mm:
1242         (WebCore::GraphicsContext3D::endPaint): Resolve the multisampling
1243         buffer once we're done painting.
1244         (WebCore::GraphicsContext3D::~GraphicsContext3D): We never created
1245         the m_compositorTexture RenderBuffer on iOS, so no point deleting
1246         it.
1247
1248         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1249         (WebCore::Extensions3DOpenGL::supportsExtension): The iOS extension
1250         has a slightly different name.
1251         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1252         (WebCore::GraphicsContext3D::reshapeFBOs): Make sure to create the
1253         multisample buffer with the correct format.
1254         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): We
1255         need to remember what our bound frame buffer is when we
1256         enter this call, and restore it afterwards. In the middle we can
1257         discard our multisample read buffer once we have resolved it
1258         into the normal framebuffer.
1259
1260 2016-01-12  Daniel Bates  <dabates@apple.com>
1261
1262         XSS Auditor should navigate to empty substitute data on full page block
1263         https://bugs.webkit.org/show_bug.cgi?id=152868
1264         <rdar://problem/18658448>
1265
1266         Reviewed by David Kilzer and Andy Estes.
1267
1268         Derived from Blink patch (by Tom Sepez <tsepez@chromium.org>):
1269         <https://src.chromium.org/viewvc/blink?view=rev&revision=179240>
1270
1271         Test: http/tests/security/xssAuditor/block-does-not-leak-that-page-was-blocked-using-empty-data-url.html
1272
1273         * html/parser/XSSAuditorDelegate.cpp:
1274         (WebCore::XSSAuditorDelegate::didBlockScript): Modified to call NavigationScheduler::schedulePageBlock().
1275         * loader/NavigationScheduler.cpp:
1276         (WebCore::ScheduledPageBlock::ScheduledPageBlock): Added.
1277         (WebCore::NavigationScheduler::schedulePageBlock): Navigate to empty substitute data with
1278         the same URL as the originating document.
1279         * loader/NavigationScheduler.h:
1280
1281 2016-01-12  Dave Hyatt  <hyatt@apple.com>
1282
1283         Avoid downloading the wrong image for <picture> elements.
1284         https://bugs.webkit.org/show_bug.cgi?id=153027
1285
1286         Reviewed by Dean Jackson.
1287
1288         I was unable to write a reliable test for this feature (I welcome suggestions regarding
1289         how this could be tested).
1290
1291         * html/HTMLImageElement.cpp:
1292         (WebCore::HTMLImageElement::HTMLImageElement):
1293         (WebCore::HTMLImageElement::~HTMLImageElement):
1294         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
1295         (WebCore::HTMLImageElement::insertedInto):
1296         (WebCore::HTMLImageElement::removedFrom):
1297         (WebCore::HTMLImageElement::pictureNode):
1298         (WebCore::HTMLImageElement::setPictureNode):
1299         * html/HTMLImageElement.h:
1300         * html/parser/HTMLConstructionSite.cpp:
1301         (WebCore::HTMLConstructionSite::createHTMLElement):
1302
1303         Images that are built underneath a <picture> element are now connected
1304         to that picture element via a setPictureNode call from the parser. This
1305         ensures that the correct <source> elements are examined before checking the image.
1306
1307         This connection between images and their picture owners is handled using a static
1308         HashMap in HTMLImageElement. This connection is made both from the parser and from
1309         DOM insertions, and the map is queried now instead of looking directly at the
1310         image's parentNode().
1311
1312         Also note the change to pass the document element's computed style in for media
1313         query evaluation. Just as with the preload scanner, the image's style can't be
1314         used as it has not been determined yet.
1315
1316 2016-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
1317
1318         Cleanup in font loading code
1319         https://bugs.webkit.org/show_bug.cgi?id=153023
1320
1321         Reviewed by Zalan Bujtas.
1322
1323         See detailed notes below.
1324
1325         No new tests because there is no behavior change.
1326
1327         * css/CSSFontFace.cpp:
1328         (WebCore::CSSFontFace::isLoaded): Deleted. Never called.
1329         * css/CSSFontFace.h: Ditto.
1330         * css/CSSFontFaceSource.cpp:
1331         (WebCore::CSSFontFaceSource::font): No need to use a helper
1332         isLoaded() function.
1333         (WebCore::CSSFontFaceSource::isLoaded): Deleted. Unnecessary.
1334         * css/CSSFontFaceSource.h:
1335         * css/CSSFontFaceSrcValue.cpp:
1336         (WebCore::CSSFontFaceSrcValue::cachedFont): Un-indent code.
1337         * css/CSSFontSelector.cpp:
1338         (WebCore::registerLocalFontFacesForFamily): constructFamilyFontFaces()
1339         always returns an empty Vector. Therefore, the function of this function
1340         is to perform the ancillary processing related to the case where the Faces
1341         don't already exist. Renames the function and removes the empty vector
1342         return.
1343         (WebCore::CSSFontSelector::addFontFaceRule): Update for
1344         registerLocalFontFacesForFamily().
1345         (WebCore::FontFaceComparator::FontFaceComparator): Instead of using a static,
1346         construct a wrapper class around the comparator.
1347         (WebCore::FontFaceComparator::operator()): Ditto.
1348         (WebCore::CSSFontSelector::getFontFace): Un-indent code and update to use
1349         FontFaceComparator.
1350         (WebCore::CSSFontSelector::fallbackFontAt): Migrate off PassRefPtr.
1351         (WebCore::constructFamilyFontFaces): Deleted.
1352         (WebCore::compareFontFaces): Deleted.
1353         (WebCore::CSSFontSelector::resolvesFamilyFor): Deleted. Never called.
1354         * css/CSSFontSelector.h:
1355         * css/CSSSegmentedFontFace.cpp:
1356         (WebCore::CSSSegmentedFontFace::isValid): Deleted.
1357         (WebCore::CSSSegmentedFontFace::fontRanges): Cache negative validity results.
1358         * css/CSSSegmentedFontFace.h:
1359         * platform/graphics/FontCascade.h:
1360         (WebCore::FontCascade::fontSelector): Use nullptr.
1361         * platform/graphics/FontSelector.h:
1362
1363 2016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
1364
1365         Add a build flag for custom element
1366         https://bugs.webkit.org/show_bug.cgi?id=153005
1367
1368         Reviewed by Alex Christensen.
1369
1370         Added a build flag for enabling custom elements.
1371
1372         * Configurations/FeatureDefines.xcconfig:
1373
1374 2016-01-12  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1375
1376         WebRTC: Update RTCPeerConnection.add/removeTrack() and add test
1377         https://bugs.webkit.org/show_bug.cgi?id=153010
1378
1379         Reviewed by Eric Carlson.
1380
1381         RTCPeerConnection.add/removeTrack() are not fully spec compliant yet, since that would
1382         require support for RTCRtpTransceiver which is a new work-in-progress feature. Use
1383         Vector, instead of map, for senders and receivers since nothing is removed from these
1384         sets anymore.
1385
1386         Test: fast/mediastream/RTCPeerConnection-add-removeTrack.html
1387
1388         * Modules/mediastream/RTCPeerConnection.cpp:
1389         (WebCore::RTCPeerConnection::addTrack):
1390         (WebCore::RTCPeerConnection::removeTrack):
1391         (WebCore::RTCPeerConnection::queuedCreateOffer): Deleted.
1392         * Modules/mediastream/RTCPeerConnection.h:
1393         * Modules/mediastream/RTCRtpSender.cpp:
1394         (WebCore::RTCRtpSender::RTCRtpSender):
1395         * Modules/mediastream/RTCRtpSender.h:
1396         (WebCore::RTCRtpSender::create):
1397         (WebCore::RTCRtpSender::mediaStreamIds):
1398
1399 2016-01-12  Brady Eidson  <beidson@apple.com>
1400
1401         Modern IDB: Check in empty SQLite backing store implementation.
1402         https://bugs.webkit.org/show_bug.cgi?id=153022
1403
1404         Reviewed by Alex Christensen.
1405
1406         No new tests (No change in behavior).
1407
1408         Just to get the implementation files in the tree, this backing store currently does nothing
1409         other than return errors for every operation.
1410
1411         * CMakeLists.txt:
1412         * WebCore.xcodeproj/project.pbxproj:
1413
1414         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Added.
1415         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
1416         (WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
1417         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1418         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
1419         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
1420         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
1421         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
1422         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
1423         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
1424         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1425         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
1426         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
1427         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
1428         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1429         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
1430         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1431         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
1432         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
1433         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
1434         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
1435         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
1436         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
1437         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
1438         * Modules/indexeddb/server/SQLiteIDBBackingStore.h: Added.
1439
1440 2016-01-12  Brady Eidson  <beidson@apple.com>
1441
1442         Modern IDB: storage/indexeddb/dont-wedge.html is flaky.
1443         https://bugs.webkit.org/show_bug.cgi?id=152892
1444
1445         Reviewed by Alex Christensen.
1446
1447         No new tests (Reenabled existing test).
1448
1449         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1450         (WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
1451         * Modules/indexeddb/client/IDBConnectionToServer.h:
1452         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1453
1454         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1455         (WebCore::IDBClient::IDBOpenDBRequest::requestCompleted): If the database was opened
1456           or an upgrade transaction was started, but the script execution context is already
1457           stopped, immediately message back to the server so it doesn't wedge.
1458
1459         * Modules/indexeddb/server/IDBServer.cpp:
1460         (WebCore::IDBServer::IDBServer::abortOpenAndUpgradeNeeded):
1461         * Modules/indexeddb/server/IDBServer.h:
1462
1463         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1464         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abortWithoutCallback):
1465         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
1466
1467         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1468         (WebCore::InProcessIDBServer::abortOpenAndUpgradeNeeded):
1469         * Modules/indexeddb/shared/InProcessIDBServer.h:
1470
1471 2016-01-12  Commit Queue  <commit-queue@webkit.org>
1472
1473         Unreviewed, rolling out r194826.
1474         https://bugs.webkit.org/show_bug.cgi?id=153020
1475
1476         Appears to have regressed PLT (Requested by kling on #webkit).
1477
1478         Reverted changeset:
1479
1480         "Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
1481         cont'd"
1482         https://bugs.webkit.org/show_bug.cgi?id=152902
1483         http://trac.webkit.org/changeset/194826
1484
1485 2016-01-12  Antti Koivisto  <antti@apple.com>
1486
1487         Don't reuse memory cache entries with different charset
1488         https://bugs.webkit.org/show_bug.cgi?id=110031
1489         rdar://problem/13666418
1490
1491         Reviewed by Andreas Kling.
1492
1493         Test: fast/loader/cache-encoding.html
1494
1495         * loader/cache/CachedResourceLoader.cpp:
1496         (WebCore::CachedResourceLoader::requestResource):
1497         (WebCore::logResourceRevalidationDecision):
1498         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
1499
1500             Pass full CachedResourceRequest to the function.
1501             If charset differs don't reuse the cache entry.
1502
1503         * loader/cache/CachedResourceLoader.h:
1504
1505 2016-01-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1506
1507         Use a pointer instead of PassRefPtr in AbstractView argument of UIEvent class
1508         https://bugs.webkit.org/show_bug.cgi?id=152829
1509
1510         Reviewed by Darin Adler.
1511
1512         As a step to reduce uses of PassRefPtr, UIEvent class doesn't need to use PassRefPtr for AbstractView argument.
1513         Nobody hands us ownership when making one of these objects.
1514
1515         * dom/FocusEvent.cpp:
1516         (WebCore::FocusEvent::FocusEvent):
1517         * dom/FocusEvent.h:
1518         * dom/KeyboardEvent.cpp:
1519         (WebCore::KeyboardEvent::KeyboardEvent):
1520         * dom/MouseEvent.cpp:
1521         (WebCore::MouseEvent::create):
1522         (WebCore::MouseEvent::MouseEvent):
1523         (WebCore::MouseEvent::initMouseEvent):
1524         (WebCore::SimulatedMouseEvent::create):
1525         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
1526         * dom/MouseEvent.h:
1527         * dom/MouseRelatedEvent.cpp:
1528         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
1529         * dom/MouseRelatedEvent.h:
1530         * dom/TextEvent.cpp:
1531         (WebCore::TextEvent::create):
1532         (WebCore::TextEvent::createForPlainTextPaste):
1533         (WebCore::TextEvent::createForFragmentPaste):
1534         (WebCore::TextEvent::createForDrop):
1535         (WebCore::TextEvent::createForDictation):
1536         (WebCore::TextEvent::TextEvent):
1537         (WebCore::TextEvent::initTextEvent):
1538         * dom/TextEvent.h:
1539         * dom/TouchEvent.cpp:
1540         (WebCore::TouchEvent::TouchEvent):
1541         (WebCore::TouchEvent::initTouchEvent):
1542         * dom/TouchEvent.h:
1543         * dom/UIEvent.cpp:
1544         (WebCore::UIEvent::UIEvent):
1545         (WebCore::UIEvent::initUIEvent):
1546         * dom/UIEvent.h:
1547         (WebCore::UIEvent::create):
1548         (WebCore::UIEvent::view):
1549         * dom/UIEventWithKeyState.h:
1550         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
1551
1552 2016-01-12  Csaba Osztrogonác  <ossy@webkit.org>
1553
1554         Fix unused-private-field warnings in DisplayListItems.h
1555         https://bugs.webkit.org/show_bug.cgi?id=153012
1556
1557         Reviewed by Michael Catanzaro.
1558
1559         * platform/graphics/displaylists/DisplayListItems.cpp:
1560         (WebCore::DisplayList::DrawNativeImage::DrawNativeImage):
1561         * platform/graphics/displaylists/DisplayListItems.h:
1562
1563 2016-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1564
1565         Unreviewed. Fix isRecording condition logic in GraphicsContext::roundToDevicePixels after r194816.
1566
1567         This looks like a typo introduced in r194816, we want to return early logging
1568         a message when isRecording() returns true.
1569
1570         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1571         (WebCore::GraphicsContext::roundToDevicePixels):
1572         * platform/graphics/cg/GraphicsContextCG.cpp:
1573         (WebCore::GraphicsContext::roundToDevicePixels):
1574
1575 2016-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1576
1577         Inconsistencies in main resource load delegates when loading from history
1578         https://bugs.webkit.org/show_bug.cgi?id=150927
1579
1580         Reviewed by Michael Catanzaro.
1581
1582         When restoring a page from the page cache, even though there
1583         isn't an actual load of resources, we are still emitting the load
1584         delegates to let the API layer know there are contents being
1585         loaded in the web view. This makes the page cache restoring
1586         transparent for the API layer. However, when restoring a page from
1587         the cache, all the delegates are emitted after the load is
1588         committed. This is not consistent with real loads, where we first
1589         load the main resource and once we get a response we commit the
1590         load. This inconsistency is problematic if the API layer expects
1591         to always have a main resource with a response when the load is
1592         committed. This is the case of the GTK+ port, for example. So,
1593         this patch ensures that when a page is restored from the page
1594         cache, the main resource load delegates that are emitted until a
1595         response is received in normal loads, are emitted before the load
1596         is committed.
1597
1598         Test: http/tests/loading/main-resource-delegates-on-back-navigation.html
1599
1600         * loader/FrameLoader.cpp:
1601         (WebCore::FrameLoader::commitProvisionalLoad): When loading from
1602         the page cache, send delegate messages up to didReceiveResponse
1603         for the main resource before the load is committed, and the
1604         remaining messages afterwards.
1605
1606 2016-01-09  Andy Estes  <aestes@apple.com>
1607
1608         [Cocoa] Add SPI to opt out a URL scheme from the memory cache
1609         https://bugs.webkit.org/show_bug.cgi?id=152950
1610         rdar://problem/24066652
1611
1612         Reviewed by Tim Horton.
1613
1614         Added a list of schemes to SchemeRegistry whose resources should always be revalidated. Taught CachedResource to
1615         return a freshness lifetime of 0 for these resources, unless the scheme is one that should be cached indefinitely.
1616
1617         New API test: WebKit2.AlwaysRevalidatedURLSchemes
1618
1619         * loader/cache/CachedResource.cpp:
1620         (WebCore::shouldCacheSchemeIndefinitely): Moved from SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely().
1621         (WebCore::CachedResource::freshnessLifetime): For a scheme that should not be cached indefinitely, return 0 if
1622         that scheme should always be revalidated according to SchemeRegistry.
1623         * platform/SchemeRegistry.cpp:
1624         (WebCore::alwaysRevalidatedSchemes):
1625         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
1626         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme):
1627         (WebCore::SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely): Moved to WebCore::shouldCacheSchemeIndefinitely().
1628         There was no reason for this to be in SchemeRegistry.
1629         * platform/SchemeRegistry.h:
1630
1631 2016-01-11  Brady Eidson  <beidson@apple.com>
1632
1633         Modern IDB: storage/indexeddb/index-multientry.html fails under GuardMalloc/ASAN.
1634         https://bugs.webkit.org/show_bug.cgi?id=152990
1635
1636         Reviewed by Alex Christensen.
1637
1638         No new tests (Covered by re-enabling existing test).
1639
1640         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1641         (WebCore::IDBClient::IDBRequest::dispatchEvent): Use String::utf8() instead of AtomicString::characters8() for
1642           the format string, as the latter fails under ASAN.
1643           
1644         * Modules/indexeddb/server/IndexValueStore.cpp:
1645         (WebCore::IDBServer::IndexValueStore::removeEntriesWithValueKey): We can't save off pointers to IDBKeyDatas
1646           used as keys in the map, because the moment we start mutating the map the keys can be rehashed, invalidating
1647           our pointers. Save off the IDBKeyDatas by value instead.
1648
1649 2016-01-11  Joseph Pecoraro  <pecoraro@apple.com>
1650
1651         Web Inspector: Migrate Page Timeline recording to ScriptProfiler
1652         https://bugs.webkit.org/show_bug.cgi?id=152727
1653
1654         Reviewed by Brian Burg.
1655
1656         Test: inspector/script-profiler/event-type-Other.html
1657
1658         This now shares the JavaScript profiling code between JSContext and Page
1659         inspection. It also moves forward splitting the Page's Timeline domain
1660         into smaller components that can be turned on/off individually.
1661
1662         * bindings/js/JSCallbackData.cpp:
1663         (WebCore::JSCallbackData::invokeCallback):
1664         * bindings/js/JSErrorHandler.cpp:
1665         (WebCore::JSErrorHandler::handleEvent):
1666         * bindings/js/JSEventListener.cpp:
1667         (WebCore::JSEventListener::handleEvent):
1668         * bindings/js/JSMainThreadExecState.h:
1669         (WebCore::JSMainThreadExecState::profiledCall):
1670         (WebCore::JSMainThreadExecState::profiledEvaluate):
1671         * bindings/js/JSMutationCallback.cpp:
1672         (WebCore::JSMutationCallback::call):
1673         * bindings/js/ScheduledAction.cpp:
1674         (WebCore::ScheduledAction::executeFunctionInContext):
1675         * bindings/js/ScriptController.cpp:
1676         (WebCore::ScriptController::evaluateInWorld):
1677         * bindings/objc/WebScriptObject.mm:
1678         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1679         (-[WebScriptObject evaluateWebScript:]):
1680         Identify entry points into JSC that we want to profile for the frontend.
1681         These were nearly all already classified for the Timeline. We added missing
1682         support for ErrorHandlers (window.onerror handler functions).
1683
1684         * inspector/InspectorTimelineAgent.cpp:
1685         (WebCore::InspectorTimelineAgent::didCallFunction):
1686         (WebCore::InspectorTimelineAgent::didEvaluateScript):
1687         (WebCore::startProfiling): Deleted.
1688         (WebCore::stopProfiling): Deleted.
1689         (WebCore::InspectorTimelineAgent::willCallFunction): Deleted.
1690         (WebCore::InspectorTimelineAgent::willEvaluateScript): Deleted.
1691         * inspector/InspectorTimelineAgent.h:
1692         TimelineAgent no longer needs to start/stop the Legacy Profiler
1693         since ScriptProfiler will automatically do that for us. Delete
1694         all code associated with that. There is still an open question
1695         regarding `console.profile` and `console.profileEnd` that
1696         starts/stops the profiler.
1697
1698 2016-01-11  Anders Carlsson  <andersca@apple.com>
1699
1700         Get rid of CFMakeCollectable, it is a no-op
1701         https://bugs.webkit.org/show_bug.cgi?id=152988
1702
1703         Reviewed by Sam Weinig.
1704
1705         * platform/mac/WebCoreNSURLExtras.mm:
1706         (WebCore::URLByTruncatingOneCharacterBeforeComponent):
1707         (WebCore::URLByRemovingComponentAndSubsequentCharacter):
1708
1709 2016-01-11  Commit Queue  <commit-queue@webkit.org>
1710
1711         Unreviewed, rolling out r194866.
1712         https://bugs.webkit.org/show_bug.cgi?id=152986
1713
1714         This change broke the mac build (Requested by ryanhaddad on
1715         #webkit).
1716
1717         Reverted changeset:
1718
1719         "[Cocoa] Add SPI to opt out a URL scheme from the memory
1720         cache"
1721         https://bugs.webkit.org/show_bug.cgi?id=152950
1722         http://trac.webkit.org/changeset/194866
1723
1724 2016-01-11  Zalan Bujtas  <zalan@apple.com>
1725
1726         Padding added to table-cell element after font-size change.
1727         https://bugs.webkit.org/show_bug.cgi?id=152796
1728
1729         Reviewed by David Hyatt.
1730
1731         Do not include intrinsicPaddingBefore value while figuring out the height of a row.
1732         In RenderTableSection::calcRowLogicalHeight() we are interested in the height of the content
1733         without the additional padding (normal padding is included).
1734
1735         Test: fast/table/table-baseline-grows.html
1736
1737         * rendering/RenderTableSection.cpp:
1738         (WebCore::RenderTableSection::calcRowLogicalHeight):
1739
1740 2016-01-11  Andy Estes  <aestes@apple.com>
1741
1742         [Cocoa] Add SPI to opt out a URL scheme from the memory cache
1743         https://bugs.webkit.org/show_bug.cgi?id=152950
1744         rdar://problem/24066652
1745
1746         Reviewed by Tim Horton.
1747
1748         Added a list of schemes to SchemeRegistry whose resources should always be revalidated. Taught CachedResource to
1749         return a freshness lifetime of 0 for these resources, unless the scheme is one that should be cached indefinitely.
1750
1751         New API test: WebKit2.AlwaysRevalidatedURLSchemes
1752
1753         * loader/cache/CachedResource.cpp:
1754         (WebCore::shouldCacheSchemeIndefinitely): Moved from SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely().
1755         (WebCore::CachedResource::freshnessLifetime): For a scheme that should not be cached indefinitely, return 0 if
1756         that scheme should always be revalidated according to SchemeRegistry.
1757         * platform/SchemeRegistry.cpp:
1758         (WebCore::alwaysRevalidatedSchemes):
1759         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
1760         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme):
1761         (WebCore::SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely): Moved to WebCore::shouldCacheSchemeIndefinitely().
1762         There was no reason for this to be in SchemeRegistry.
1763         * platform/SchemeRegistry.h:
1764
1765 2016-01-11  Dave Hyatt  <hyatt@apple.com>
1766
1767         Picture element needs to work with the preload scanner and select the correct
1768         source element instead of loading the image.
1769         https://bugs.webkit.org/show_bug.cgi?id=152983
1770
1771         Reviewed by Dean Jackson.
1772
1773         Added new tests in http/tests/loading.
1774
1775         * html/parser/HTMLPreloadScanner.cpp:
1776         (WebCore::TokenPreloadScanner::tagIdFor):
1777         (WebCore::TokenPreloadScanner::initiatorFor):
1778         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
1779         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
1780         (WebCore::TokenPreloadScanner::StartTagScanner::processImageAndScriptAttribute):
1781         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
1782         (WebCore::TokenPreloadScanner::StartTagScanner::resourceType):
1783         (WebCore::TokenPreloadScanner::scan):
1784         * html/parser/HTMLPreloadScanner.h:
1785         (WebCore::TokenPreloadScanner::setPredictedBaseElementURL):
1786         (WebCore::TokenPreloadScanner::inPicture):
1787
1788 2016-01-11  Brady Eidson  <beidson@apple.com>
1789
1790         Modern IDB: storage/indexeddb/key-generator.html fails.
1791         https://bugs.webkit.org/show_bug.cgi?id=152981
1792
1793         Reviewed by Alex Christensen.
1794
1795         No new tests (One failing test now passes, and one test's results get a progression).
1796
1797         * Modules/indexeddb/server/IDBBackingStore.h:
1798         
1799         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1800         (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber): Throw an error if the current
1801           value is already over 2^53.
1802         (WebCore::IDBServer::MemoryIDBBackingStore::revertGeneratedKeyNumber):
1803         (WebCore::IDBServer::MemoryIDBBackingStore::maybeUpdateKeyGeneratorNumber): Handle double -> uint64_t
1804           conversions properly when calculating the next key.
1805         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1806         
1807         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1808         (WebCore::IDBServer::ScopeGuard::ScopeGuard): Add this utility class to call a function 
1809           any time it goes out of scope.
1810         (WebCore::IDBServer::ScopeGuard::~ScopeGuard):
1811         (WebCore::IDBServer::ScopeGuard::enable):
1812         (WebCore::IDBServer::ScopeGuard::disable):
1813         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Revert the key generator value if
1814           the put/add operation ends in error.
1815
1816 2016-01-11  Brady Eidson  <beidson@apple.com>
1817
1818         Modern IDB: storage/indexeddb/lazy-index-population.html fails.
1819         https://bugs.webkit.org/show_bug.cgi?id=152976
1820
1821         Reviewed by Alex Christensen.
1822
1823         No new tests (At least one failing test now passes).
1824
1825         We were restoring objectstores/indexes incorrectly on transaction abort.
1826
1827         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1828         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
1829         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1830         (WebCore::IDBServer::MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort):
1831
1832 2016-01-11  Brady Eidson  <beidson@apple.com>
1833
1834         Modern IDB: Make MemoryIndex and MemoryObjectStore RefCounted.
1835         https://bugs.webkit.org/show_bug.cgi?id=152966
1836
1837         Reviewed by Alex Christensen.
1838
1839         No new tests (Refactor, no change in behavior)
1840
1841         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1842         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexDeleted):
1843         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreDeleted):
1844         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
1845         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1846         
1847         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1848         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
1849         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
1850         (WebCore::IDBServer::MemoryIDBBackingStore::restoreObjectStoreForVersionChangeAbort):
1851         (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
1852         (WebCore::IDBServer::MemoryIDBBackingStore::takeObjectStoreByName):
1853         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1854         
1855         * Modules/indexeddb/server/MemoryIndex.cpp:
1856         (WebCore::IDBServer::MemoryIndex::create):
1857         * Modules/indexeddb/server/MemoryIndex.h:
1858         
1859         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1860         (WebCore::IDBServer::MemoryObjectStore::create):
1861         (WebCore::IDBServer::MemoryObjectStore::createIndex):
1862         (WebCore::IDBServer::MemoryObjectStore::maybeRestoreDeletedIndex):
1863         (WebCore::IDBServer::MemoryObjectStore::takeIndexByName):
1864         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
1865         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForDeleteRecord):
1866         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
1867         (WebCore::IDBServer::MemoryObjectStore::registerIndex):
1868         * Modules/indexeddb/server/MemoryObjectStore.h:
1869
1870 2016-01-11  Andreas Kling  <akling@apple.com>
1871
1872         Fix other builds after my MSVC build fix. :-|
1873
1874         * css/StyleResolver.cpp:
1875
1876 2016-01-11  Andreas Kling  <akling@apple.com>
1877
1878         Fix MSVC build after r194848.
1879
1880         Since MSVC refuses to recognize the friendship between LazyNeverDestroyed
1881         and some CSS*Value classes, make their constructors public in MSVC builds.
1882
1883         Added FIXME's to make it look extra gross.
1884
1885         * css/CSSInheritedValue.h:
1886         (WebCore::CSSInheritedValue::create): Deleted.
1887         * css/CSSInitialValue.h:
1888         * css/CSSPrimitiveValue.h:
1889         * css/CSSRevertValue.h:
1890         (WebCore::CSSRevertValue::create): Deleted.
1891         * css/CSSUnsetValue.h:
1892         (WebCore::CSSUnsetValue::create): Deleted.
1893         * css/StyleResolver.cpp:
1894         (WebCore::StyleResolver::applyProperty):
1895
1896 2016-01-11  Andreas Kling  <akling@apple.com>
1897
1898         CSSValuePool should use nonfragmented storage for eternal caches.
1899         <https://webkit.org/b/152960>
1900
1901         Reviewed by Antti Koivisto.
1902
1903         Store all of the common cached CSS value objects in contiguous arrays
1904         instead of lazily allocating them on the heap.
1905
1906         This reduces heap fragmentation (win) and removes indirection (win)
1907
1908         * css/CSSInheritedValue.h:
1909         * css/CSSInitialValue.h:
1910         * css/CSSPrimitiveValue.h:
1911         * css/CSSRevertValue.h:
1912         * css/CSSUnsetValue.h:
1913         * css/CSSValuePool.cpp:
1914         (WebCore::CSSValuePool::CSSValuePool):
1915         (WebCore::CSSValuePool::createIdentifierValue):
1916         (WebCore::CSSValuePool::createColorValue):
1917         (WebCore::CSSValuePool::createValue):
1918         (WebCore::CSSValuePool::drain): Deleted.
1919         * css/CSSValuePool.h:
1920         (WebCore::CSSValuePool::createInheritedValue):
1921         (WebCore::CSSValuePool::createImplicitInitialValue):
1922         (WebCore::CSSValuePool::createExplicitInitialValue):
1923         (WebCore::CSSValuePool::createUnsetValue):
1924         (WebCore::CSSValuePool::createRevertValue):
1925
1926 2016-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1927
1928         [GTK] Cleanup RenderThemeGtk
1929         https://bugs.webkit.org/show_bug.cgi?id=152888
1930
1931         Reviewed by Michael Catanzaro.
1932
1933         Use a common path for GTK+ 3.19 and previous versions, simplifying
1934         the code and removing a lot of ifdefs.
1935
1936          - createStyleContext() now receives a theme part enum value, and
1937            an optional parent GtkStyleContext. It encapsulates all the
1938            differences between GTK+ 3.19 and previous version leaving the
1939            rendering code common and free of ifdefs.
1940          - Stock icons support have been removed, simplifying the code
1941            that now always renders symbolic icons, updating the colors
1942            depending on the current state.
1943          - Media button and colors have been removed, because they are
1944            unused now that we render the media controls with CSS.
1945          - ComboBox separators support has also been removed. In GTK+ 3.19
1946            combo boxes no longer have separators and most of the GTK+
1947            themes don't use the either, so it's better to simple not render
1948            them anymore in WebKit either.
1949          - Code to paint caps lock indicator has been removed too, since
1950            caps lock indicator is now shadow dom and automatically
1951            rendered by WebCore.
1952
1953         * rendering/RenderThemeGtk.cpp:
1954         (WebCore::createStyleContext):
1955         (WebCore::loadThemedIcon):
1956         (WebCore::gtkIconStateFlags):
1957         (WebCore::RenderThemeGtk::adjustRepaintRect):
1958         (WebCore::setToggleSize):
1959         (WebCore::paintToggle):
1960         (WebCore::RenderThemeGtk::setCheckboxSize):
1961         (WebCore::RenderThemeGtk::paintCheckbox):
1962         (WebCore::RenderThemeGtk::setRadioSize):
1963         (WebCore::RenderThemeGtk::paintRadio):
1964         (WebCore::RenderThemeGtk::paintButton):
1965         (WebCore::getComboBoxMetrics):
1966         (WebCore::RenderThemeGtk::popupInternalPaddingLeft):
1967         (WebCore::RenderThemeGtk::popupInternalPaddingRight):
1968         (WebCore::RenderThemeGtk::popupInternalPaddingTop):
1969         (WebCore::RenderThemeGtk::popupInternalPaddingBottom):
1970         (WebCore::RenderThemeGtk::paintMenuList):
1971         (WebCore::RenderThemeGtk::paintTextField):
1972         (WebCore::adjustSearchFieldIconStyle):
1973         (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
1974         (WebCore::paintIcon):
1975         (WebCore::paintEntryIcon):
1976         (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
1977         (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
1978         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
1979         (WebCore::RenderThemeGtk::shouldHaveCapsLockIndicator):
1980         (WebCore::RenderThemeGtk::paintSliderTrack):
1981         (WebCore::RenderThemeGtk::paintSliderThumb):
1982         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
1983         (WebCore::RenderThemeGtk::paintProgressBar):
1984         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
1985         (WebCore::paintSpinArrowButton):
1986         (WebCore::RenderThemeGtk::paintInnerSpinButton):
1987         (WebCore::styleColor):
1988         (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
1989         (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
1990         (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
1991         (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
1992         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor):
1993         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor):
1994         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor):
1995         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor):
1996         (WebCore::RenderThemeGtk::systemColor):
1997         (WebCore::RenderThemeGtk::paintMediaButton):
1998         (WebCore::RenderThemeGtk::paintMediaFullscreenButton):
1999         (WebCore::RenderThemeGtk::paintMediaMuteButton):
2000         (WebCore::RenderThemeGtk::paintMediaPlayButton):
2001         (WebCore::RenderThemeGtk::paintMediaSeekBackButton):
2002         (WebCore::RenderThemeGtk::paintMediaSeekForwardButton):
2003         (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
2004         * rendering/RenderThemeGtk.h:
2005
2006 2016-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2007
2008         [GTK] Cleanup ScrollbarThemeGtk
2009         https://bugs.webkit.org/show_bug.cgi?id=152830
2010
2011         Reviewed by Michael Catanzaro.
2012
2013         Use a common path for GTK+ 3.19 and previous versions, simplifying
2014         the code and removing a lot of ifdefs. Use always a new
2015         GtkStyleContext, but when painting cache the newly created one so
2016         all paint methods use that one. We were also caching some theme
2017         properties assuming they don't change unless the theme changes,
2018         but some of them can have different values depending on the state,
2019         for example, when hovered or pressed. Those properties are now
2020         only cached when we create a new GtkStyleContext.
2021         The method updateScrollbarsFrameThickness() has also been removed,
2022         since the Scrollbar constructor already initializes the frame rect
2023         using the scrollbarThickness(). This method was not doing anything
2024         anyway, since that was called on the constructor of the theme,
2025         when there were no scrollbars registered. This also means we no
2026         longer need to track registered/unregistered scrollbars.
2027
2028         * platform/gtk/ScrollbarThemeGtk.cpp:
2029         (WebCore::ScrollbarThemeGtk::backButtonRect): Use the cached
2030         GtkStyleContext and properties or create a new.
2031         (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
2032         (WebCore::ScrollbarThemeGtk::trackRect): Ditto.
2033         (WebCore::orientationStyleClass):
2034         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Create a
2035         new GtkStyleContext for the scrollbar if there isn't a cached
2036         one. Also initialize the properties that depend on the state.
2037         (WebCore::createChildStyleContext): Create a new GtkStyleContext
2038         from a parent one.
2039         (WebCore::ScrollbarThemeGtk::updateThemeProperties): Get the
2040         properties that can only change when the theme changes.
2041         (WebCore::ScrollbarThemeGtk::thumbRect): Use the cached
2042         GtkStyleContext and properties or create a new.
2043         (WebCore::adjustRectAccordingToMargin): Use always the
2044         GtkStyleContext state instead of receiving it and setting it again.
2045         (WebCore::ScrollbarThemeGtk::paintTrackBackground): Get or create
2046         a GtkStyleContext for the scrollbar and create a child one for the trough.
2047         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): Use the
2048         cached GtkStyleContext or create a new one.
2049         (WebCore::ScrollbarThemeGtk::paintThumb): Get or create a
2050         GtkStyleContext for the scrollbar and create a child ones for
2051         trough and slider.
2052         (WebCore::ScrollbarThemeGtk::paintButton): Get or create a
2053         GtkStyleContext for the scrollbar and create a child one for the button.
2054         (WebCore::ScrollbarThemeGtk::paint): Create a GtkStyleContext and
2055         cache it temporarily using TemporaryChange until the method finishes.
2056         (WebCore::ScrollbarThemeGtk::scrollbarThickness): Use the cached
2057         GtkStyleContext and properties or create a new.
2058         (WebCore::ScrollbarThemeGtk::buttonSize): Ditto.
2059         * platform/gtk/ScrollbarThemeGtk.h:
2060
2061 2016-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
2062
2063         [SVG -> OTF Converter] Parsing failures cause use of incomplete fonts
2064         https://bugs.webkit.org/show_bug.cgi?id=152772
2065         <rdar://problem/24043104>
2066
2067         Reviewed by Simon Fraser.
2068
2069         Originally, if we fail to parse a glyph, we would simply skip the glyph. However, this means that
2070         we will create an incomplete font without all the necessary glyphs. This causes very distressing
2071         text where all the occurances of a particular letter are missing. Instead, we should treat the
2072         entire font as invalid.
2073
2074         Test: fast/text/svg-font-invalid-glyph-path-failure.html
2075
2076         * css/CSSFontFaceSource.cpp:
2077         (WebCore::CSSFontFaceSource::font):
2078         * loader/cache/CachedSVGFont.cpp:
2079         (WebCore::CachedSVGFont::ensureCustomFontData):
2080         * svg/SVGToOTFFontConversion.cpp:
2081         (WebCore::SVGToOTFFontConverter::error):
2082         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
2083         (WebCore::SVGToOTFFontConverter::processGlyphElement):
2084         (WebCore::convertSVGToOTFFont):
2085         * svg/SVGToOTFFontConversion.h:
2086
2087 2016-01-10  Andreas Kling  <akling@apple.com>
2088
2089         Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL cont'd
2090         <https://webkit.org/b/152902>
2091
2092         Reviewed by Andy Estes.
2093
2094         Convert some more of the remaining clients to use NeverDestroyed.
2095
2096         * html/track/VTTRegion.cpp:
2097         (WebCore::VTTRegion::textTrackCueContainerShadowPseudoId):
2098         (WebCore::VTTRegion::textTrackRegionShadowPseudoId):
2099         * svg/properties/SVGAnimatedPropertyMacros.h:
2100
2101 2016-01-09  Simon Fraser  <simon.fraser@apple.com>
2102
2103         Hook up display-list drawing in GraphicsLayerCA
2104         https://bugs.webkit.org/show_bug.cgi?id=152946
2105
2106         Reviewed by Zalan Bujtas.
2107
2108         Have GraphicsLayerCA hold a DisplayList. If enabled, do a display-list record
2109         in GraphicsLayerCA::recursiveCommitChanges(), and a playback in GraphicsLayerCA::platformCALayerPaintContents().
2110         
2111         GraphicsLayerCA needs to maintain a m_hasEverPainted flag to know to do a full record
2112         at first paint (when there are no dirty rects).
2113         
2114         Plumb 'isUsingDisplayListDrawing' through to TileGrid via PlatformCALayer{Client}
2115         so that we can decorate the tile paint counters with an outline.
2116         
2117         Have RenderLayerCompositor push the displayListDrawingEnabled state down through
2118         RenderLayerBackings to GraphicsLayers.
2119         
2120         Convert RenderLayerCompositor to use initializers.
2121
2122         * platform/graphics/GraphicsLayer.cpp:
2123         (WebCore::GraphicsLayer::GraphicsLayer):
2124         * platform/graphics/GraphicsLayer.h:
2125         (WebCore::GraphicsLayer::usesDisplayListDrawing):
2126         (WebCore::GraphicsLayer::setUsesDisplayListDrawing):
2127         * platform/graphics/ca/GraphicsLayerCA.cpp:
2128         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2129         (WebCore::GraphicsLayerCA::setUsesDisplayListDrawing):
2130         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2131         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
2132         (WebCore::GraphicsLayerCA::updateDrawsContent):
2133         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
2134         * platform/graphics/ca/GraphicsLayerCA.h:
2135         * platform/graphics/ca/PlatformCALayer.cpp:
2136         (WebCore::PlatformCALayer::drawRepaintIndicator):
2137         * platform/graphics/ca/PlatformCALayerClient.h:
2138         (WebCore::PlatformCALayerClient::isUsingDisplayListDrawing):
2139         * platform/graphics/ca/TileGrid.cpp:
2140         (WebCore::TileGrid::platformCALayerShowRepaintCounter):
2141         (WebCore::TileGrid::isUsingDisplayListDrawing):
2142         * platform/graphics/ca/TileGrid.h:
2143         * platform/graphics/displaylists/DisplayList.h: Sadly need to include DisplayListItems.h
2144         to get things to compile. I wasn't able to avoid this even when making functions non-inline.
2145         * rendering/RenderLayerBacking.cpp:
2146         (WebCore::RenderLayerBacking::createGraphicsLayer):
2147         * rendering/RenderLayerCompositor.cpp:
2148         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
2149         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
2150         * rendering/RenderLayerCompositor.h:
2151
2152 2016-01-09  Zalan Bujtas  <zalan@apple.com>
2153
2154         REGRESSION (r194426): First email field is not autofilled on amazon.com
2155         https://bugs.webkit.org/show_bug.cgi?id=152945
2156         <rdar://problem/24082914>
2157
2158         Reviewed by Simon Fraser.
2159
2160         r194426 missed marking the m_layoutRoot for layout while converting to full layout (it only marked the new layout root).
2161
2162         Test: fast/forms/multiple-subtree-layout-failure.html
2163
2164         * page/FrameView.cpp:
2165         (WebCore::FrameView::scheduleRelayoutOfSubtree):
2166
2167 2016-01-09  Dan Bernstein  <mitz@apple.com>
2168
2169         [Cocoa] Allow overriding the frameworks directory independently of using a staging install path
2170         https://bugs.webkit.org/show_bug.cgi?id=152926
2171
2172         Reviewed by Tim Horton.
2173
2174         Introduce a new build setting, WK_OVERRIDE_FRAMEWORKS_DIR. When not empty, it determines
2175         where the frameworks are installed. Setting USE_STAGING_INSTALL_PATH to YES sets
2176         WK_OVERRIDE_FRAMEWORKS_DIR to $(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari.
2177
2178         Account for the possibility of WK_OVERRIDE_FRAMEWORKS_DIR containing spaces.
2179
2180         * Configurations/WebCore.xcconfig:
2181         - Replace STAGED_FRAMEWORKS_SEARCH_PATH in FRAMEWORK_SEARCH_PATHS with
2182           WK_OVERRIDE_FRAMEWORKS_DIR and add quotes to account for spaces.
2183         - Define WEBCORE_FRAMEWORKS_DIR and PRODUCTION_FRAMEWORKS_DIR based on
2184           WK_OVERRIDE_FRAMEWORKS_DIR.
2185
2186         * WebCore.xcodeproj/project.pbxproj: Work around make’s inability to handle spaces in paths
2187           by creating a symlink to JAVASCRIPTCORE_PRIVATE_HEADERS_DIR under BUILT_PRODUCTS_DIR and
2188           using the symlink as the value of JavaScriptCore_SCRIPTS_DIR.
2189
2190 2016-01-09  Andreas Kling  <akling@apple.com>
2191
2192         Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
2193         <https://webkit.org/b/152902>
2194
2195         Reviewed by Anders Carlsson.
2196
2197         Mostly mechanical conversion to NeverDestroyed throughout WebCore.
2198
2199         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
2200         (WebCore::stringForPlaybackTargetAvailability):
2201         * Modules/indexeddb/IDBCursor.cpp:
2202         (WebCore::IDBCursor::directionNext):
2203         (WebCore::IDBCursor::directionNextUnique):
2204         (WebCore::IDBCursor::directionPrev):
2205         (WebCore::IDBCursor::directionPrevUnique):
2206         * Modules/indexeddb/IDBTransaction.cpp:
2207         (WebCore::IDBTransaction::modeReadOnly):
2208         (WebCore::IDBTransaction::modeReadWrite):
2209         (WebCore::IDBTransaction::modeVersionChange):
2210         (WebCore::IDBTransaction::modeReadOnlyLegacy):
2211         (WebCore::IDBTransaction::modeReadWriteLegacy):
2212         * Modules/indexeddb/legacy/LegacyRequest.cpp:
2213         (WebCore::LegacyRequest::readyState):
2214         * Modules/mediacontrols/MediaControlsHost.cpp:
2215         (WebCore::MediaControlsHost::automaticKeyword):
2216         (WebCore::MediaControlsHost::forcedOnlyKeyword):
2217         (WebCore::MediaControlsHost::alwaysOnKeyword):
2218         (WebCore::MediaControlsHost::externalDeviceType):
2219         * Modules/mediasource/MediaSource.cpp:
2220         (WebCore::MediaSource::openKeyword):
2221         (WebCore::MediaSource::closedKeyword):
2222         (WebCore::MediaSource::endedKeyword):
2223         (WebCore::MediaSource::streamEndedWithError):
2224         * Modules/plugins/QuickTimePluginReplacement.mm:
2225         (WebCore::quickTimePluginReplacementScript):
2226         (WebCore::QuickTimePluginReplacement::supportsMimeType):
2227         (WebCore::QuickTimePluginReplacement::supportsFileExtension):
2228         * Modules/speech/SpeechSynthesis.cpp:
2229         (WebCore::SpeechSynthesis::boundaryEventOccurred):
2230         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2231         (WebCore::cssPropertyIDForJSCSSPropertyName):
2232         * bridge/c/c_instance.cpp:
2233         (JSC::Bindings::globalExceptionString):
2234         * css/MediaList.cpp:
2235         (WebCore::addResolutionWarningMessageToConsole):
2236         * css/StyleSheetContents.cpp:
2237         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2238         * dom/ChildListMutationScope.cpp:
2239         (WebCore::accumulatorMap):
2240         * dom/DOMImplementation.cpp:
2241         (WebCore::isSupportedSVG10Feature):
2242         (WebCore::isSupportedSVG11Feature):
2243         * dom/Document.cpp:
2244         (WebCore::Document::readyState):
2245         * dom/Element.cpp:
2246         (WebCore::Element::webkitRegionOverset):
2247         * dom/EventDispatcher.cpp:
2248         (WebCore::EventDispatcher::dispatchSimulatedClick):
2249         * dom/InlineStyleSheetOwner.cpp:
2250         (WebCore::isValidCSSContentType):
2251         * dom/MutationObserver.cpp:
2252         (WebCore::activeMutationObservers):
2253         (WebCore::suspendedMutationObservers):
2254         * dom/MutationRecord.cpp:
2255         * dom/PseudoElement.cpp:
2256         (WebCore::pseudoElementTagName):
2257         (WebCore::PseudoElement::pseudoElementNameForEvents):
2258         * dom/QualifiedName.cpp:
2259         (WebCore::qualifiedNameCache):
2260         (WebCore::nullQName):
2261         * dom/ScriptElement.cpp:
2262         (WebCore::isLegacySupportedJavaScriptLanguage):
2263         (WebCore::ScriptElement::notifyFinished):
2264         * editing/ApplyStyleCommand.cpp:
2265         (WebCore::styleSpanClassString):
2266         * editing/MarkupAccumulator.cpp:
2267         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
2268         * editing/ReplaceSelectionCommand.cpp:
2269         (WebCore::isInterchangeNewlineNode):
2270         (WebCore::isInterchangeConvertedSpaceSpan):
2271         * editing/htmlediting.cpp:
2272         (WebCore::nonBreakingSpaceString):
2273         * editing/markup.cpp:
2274         (WebCore::StyledMarkupAccumulator::styleNodeCloseTag):
2275         (WebCore::createMarkupInternal):
2276         * fileapi/Blob.cpp:
2277         (WebCore::BlobURLRegistry::registry):
2278         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2279         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
2280         * html/DateInputType.cpp:
2281         (WebCore::DateInputType::createStepRange):
2282         * html/DateTimeInputType.cpp:
2283         (WebCore::DateTimeInputType::createStepRange):
2284         * html/DateTimeLocalInputType.cpp:
2285         (WebCore::DateTimeLocalInputType::createStepRange):
2286         * html/EmailInputType.cpp:
2287         (WebCore::isValidEmailAddress):
2288         * html/FormController.cpp:
2289         (WebCore::FormKeyGenerator::formKey):
2290         (WebCore::formStateSignature):
2291         * html/HTMLAnchorElement.cpp:
2292         (WebCore::rootEditableElementMap):
2293         * html/HTMLButtonElement.cpp:
2294         (WebCore::HTMLButtonElement::formControlType):
2295         * html/HTMLFieldSetElement.cpp:
2296         (WebCore::HTMLFieldSetElement::formControlType):
2297         * html/HTMLFrameOwnerElement.h:
2298         (WebCore::SubframeLoadingDisabler::disabledSubtreeRoots):
2299         * html/HTMLKeygenElement.cpp:
2300         (WebCore::HTMLKeygenElement::formControlType):
2301         * html/HTMLLinkElement.cpp:
2302         (WebCore::linkLoadEventSender):
2303         * html/HTMLMediaElement.cpp:
2304         (WebCore::documentToElementSetMap):
2305         * html/HTMLObjectElement.cpp:
2306         (WebCore::isRecognizedTagName):
2307         * html/HTMLOptGroupElement.cpp:
2308         (WebCore::HTMLOptGroupElement::formControlType):
2309         * html/HTMLOutputElement.cpp:
2310         (WebCore::HTMLOutputElement::formControlType):
2311         * html/HTMLPlugInElement.cpp:
2312         (WebCore::registeredPluginReplacements):
2313         * html/HTMLPlugInImageElement.cpp:
2314         (WebCore::titleText):
2315         (WebCore::subtitleText):
2316         (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay):
2317         * html/HTMLSelectElement.cpp:
2318         (WebCore::HTMLSelectElement::formControlType):
2319         * html/HTMLStyleElement.cpp:
2320         (WebCore::styleLoadEventSender):
2321         * html/HTMLTextAreaElement.cpp:
2322         (WebCore::HTMLTextAreaElement::formControlType):
2323         * html/HTMLTextFormControlElement.cpp:
2324         (WebCore::directionString):
2325         * html/ImageInputType.cpp:
2326         (WebCore::ImageInputType::appendFormData):
2327         * html/InputTypeNames.cpp:
2328         (WebCore::InputTypeNames::button):
2329         (WebCore::InputTypeNames::checkbox):
2330         (WebCore::InputTypeNames::color):
2331         (WebCore::InputTypeNames::date):
2332         (WebCore::InputTypeNames::datetime):
2333         (WebCore::InputTypeNames::datetimelocal):
2334         (WebCore::InputTypeNames::email):
2335         (WebCore::InputTypeNames::file):
2336         (WebCore::InputTypeNames::hidden):
2337         (WebCore::InputTypeNames::image):
2338         (WebCore::InputTypeNames::month):
2339         (WebCore::InputTypeNames::number):
2340         (WebCore::InputTypeNames::password):
2341         (WebCore::InputTypeNames::radio):
2342         (WebCore::InputTypeNames::range):
2343         (WebCore::InputTypeNames::reset):
2344         (WebCore::InputTypeNames::search):
2345         (WebCore::InputTypeNames::submit):
2346         (WebCore::InputTypeNames::telephone):
2347         (WebCore::InputTypeNames::text):
2348         (WebCore::InputTypeNames::time):
2349         (WebCore::InputTypeNames::url):
2350         (WebCore::InputTypeNames::week):
2351         * html/MediaController.cpp:
2352         (playbackStateWaiting):
2353         (playbackStatePlaying):
2354         (playbackStateEnded):
2355         * html/MonthInputType.cpp:
2356         (WebCore::MonthInputType::createStepRange):
2357         * html/NumberInputType.cpp:
2358         (WebCore::NumberInputType::createStepRange):
2359         * html/RangeInputType.cpp:
2360         (WebCore::RangeInputType::createStepRange):
2361         * html/StepRange.cpp:
2362         (WebCore::StepRange::acceptableError):
2363         (WebCore::StepRange::alignValueForStep):
2364         (WebCore::StepRange::stepMismatch):
2365         * html/TimeInputType.cpp:
2366         (WebCore::TimeInputType::createStepRange):
2367         * html/WeekInputType.cpp:
2368         (WebCore::WeekInputType::createStepRange):
2369         * html/canvas/CanvasRenderingContext2D.cpp:
2370         (WebCore::CanvasRenderingContext2D::getImageData):
2371         * html/parser/XSSAuditor.cpp:
2372         (WebCore::XSSAuditor::init):
2373         (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
2374         * html/shadow/MediaControlElements.cpp:
2375         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
2376         (WebCore::getMediaControlTimeRemainingDisplayElementShadowPseudoId):
2377         (WebCore::getMediaControlCurrentTimeDisplayElementShadowPseudoId):
2378         * html/shadow/MeterShadowElement.cpp:
2379         (WebCore::MeterInnerElement::MeterInnerElement):
2380         (WebCore::MeterValueElement::valuePseudoId):
2381         * html/shadow/MeterShadowElement.h:
2382         * html/shadow/SliderThumbElement.cpp:
2383         (WebCore::sliderThumbShadowPseudoId):
2384         (WebCore::mediaSliderThumbShadowPseudoId):
2385         (WebCore::SliderContainerElement::shadowPseudoId):
2386         * html/track/AudioTrack.cpp:
2387         (WebCore::AudioTrack::alternativeKeyword):
2388         (WebCore::AudioTrack::descriptionKeyword):
2389         (WebCore::AudioTrack::mainKeyword):
2390         (WebCore::AudioTrack::mainDescKeyword):
2391         (WebCore::AudioTrack::translationKeyword):
2392         (WebCore::AudioTrack::commentaryKeyword):
2393         * html/track/TextTrack.cpp:
2394         (WebCore::TextTrack::subtitlesKeyword):
2395         (WebCore::TextTrack::captionsKeyword):
2396         (WebCore::TextTrack::descriptionsKeyword):
2397         (WebCore::TextTrack::chaptersKeyword):
2398         (WebCore::TextTrack::metadataKeyword):
2399         (WebCore::TextTrack::forcedKeyword):
2400         (WebCore::TextTrack::disabledKeyword):
2401         (WebCore::TextTrack::hiddenKeyword):
2402         (WebCore::TextTrack::showingKeyword):
2403         * html/track/TextTrackCue.h:
2404         (WebCore::TextTrackCue::cueShadowPseudoId):
2405         * html/track/VTTCue.cpp:
2406         (WebCore::startKeyword):
2407         (WebCore::middleKeyword):
2408         (WebCore::endKeyword):
2409         (WebCore::leftKeyword):
2410         (WebCore::rightKeyword):
2411         (WebCore::verticalGrowingLeftKeyword):
2412         (WebCore::verticalGrowingRightKeyword):
2413         (WebCore::VTTCueBox::vttCueBoxShadowPseudoId):
2414         (WebCore::VTTCue::cueBackdropShadowPseudoId):
2415         (WebCore::VTTCue::determineTextDirection):
2416         (WebCore::VTTCue::markFutureAndPastNodes):
2417         * html/track/VTTRegion.cpp:
2418         (WebCore::VTTRegion::scroll):
2419         (WebCore::VTTRegion::setScroll):
2420         (WebCore::VTTRegion::parseSettingValue):
2421         (WebCore::VTTRegion::textTrackCueContainerScrollingClass):
2422         * html/track/VideoTrack.cpp:
2423         (WebCore::VideoTrack::alternativeKeyword):
2424         (WebCore::VideoTrack::captionsKeyword):
2425         (WebCore::VideoTrack::mainKeyword):
2426         (WebCore::VideoTrack::signKeyword):
2427         (WebCore::VideoTrack::subtitlesKeyword):
2428         (WebCore::VideoTrack::commentaryKeyword):
2429         * html/track/WebVTTElement.cpp:
2430         (WebCore::nodeTypeToTagName):
2431         * html/track/WebVTTElement.h:
2432         * html/track/WebVTTParser.cpp:
2433         (WebCore::WebVTTParser::collectMetadataHeader):
2434         * inspector/InspectorCSSAgent.cpp:
2435         (WebCore::computePseudoClassMask):
2436         * inspector/InspectorPageAgent.cpp:
2437         (WebCore::InspectorPageAgent::sourceMapURLForResource):
2438         * inspector/InspectorStyleSheet.cpp:
2439         (WebCore::selectorsFromSource):
2440         * inspector/PageDebuggerAgent.cpp:
2441         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
2442         * loader/ImageLoader.cpp:
2443         (WebCore::ImageLoader::notifyFinished):
2444         * loader/TextTrackLoader.cpp:
2445         (WebCore::TextTrackLoader::corsPolicyPreventedLoad):
2446         * loader/cache/CachedResourceRequest.cpp:
2447         (WebCore::CachedResourceRequest::initiatorName):
2448         * loader/icon/IconDatabase.cpp:
2449         (WebCore::IconDatabase::defaultDatabaseFilename):
2450         * page/CaptionUserPreferences.cpp:
2451         (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride):
2452         * page/CaptionUserPreferencesMediaAF.cpp:
2453         (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS):
2454         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
2455         * page/ContentSecurityPolicy.cpp:
2456         (WebCore::CSPDirectiveList::allowJavaScriptURLs):
2457         (WebCore::CSPDirectiveList::allowInlineEventHandlers):
2458         (WebCore::CSPDirectiveList::allowInlineScript):
2459         (WebCore::CSPDirectiveList::allowInlineStyle):
2460         (WebCore::CSPDirectiveList::allowEval):
2461         (WebCore::ContentSecurityPolicy::reportUnsupportedDirective):
2462         * page/DOMWindow.cpp:
2463         (WebCore::windowsWithUnloadEventListeners):
2464         (WebCore::windowsWithBeforeUnloadEventListeners):
2465         * page/EventHandler.cpp:
2466         (WebCore::EventHandler::dragState):
2467         (WebCore::focusDirectionForKey):
2468         * page/Frame.cpp:
2469         (WebCore::createRegExpForLabels):
2470         * page/NavigatorBase.cpp:
2471         (WebCore::NavigatorBase::platform):
2472         * page/PageVisibilityState.cpp:
2473         (WebCore::pageVisibilityStateString):
2474         * page/SecurityPolicy.cpp:
2475         (WebCore::originAccessMap):
2476         * page/UserContentURLPattern.cpp:
2477         (WebCore::UserContentURLPattern::parse):
2478         * page/animation/CSSPropertyAnimation.cpp:
2479         (WebCore::shadowForBlending):
2480         * page/animation/CompositeAnimation.cpp:
2481         (WebCore::CompositeAnimation::updateKeyframeAnimations):
2482         * platform/Cursor.cpp:
2483         (WebCore::pointerCursor):
2484         (WebCore::crossCursor):
2485         (WebCore::handCursor):
2486         (WebCore::moveCursor):
2487         (WebCore::verticalTextCursor):
2488         (WebCore::cellCursor):
2489         (WebCore::contextMenuCursor):
2490         (WebCore::aliasCursor):
2491         (WebCore::zoomInCursor):
2492         (WebCore::zoomOutCursor):
2493         (WebCore::copyCursor):
2494         (WebCore::noneCursor):
2495         (WebCore::progressCursor):
2496         (WebCore::noDropCursor):
2497         (WebCore::notAllowedCursor):
2498         (WebCore::iBeamCursor):
2499         (WebCore::waitCursor):
2500         (WebCore::helpCursor):
2501         (WebCore::eastResizeCursor):
2502         (WebCore::northResizeCursor):
2503         (WebCore::northEastResizeCursor):
2504         (WebCore::northWestResizeCursor):
2505         (WebCore::southResizeCursor):
2506         (WebCore::southEastResizeCursor):
2507         (WebCore::southWestResizeCursor):
2508         (WebCore::westResizeCursor):
2509         (WebCore::northSouthResizeCursor):
2510         (WebCore::eastWestResizeCursor):
2511         (WebCore::northEastSouthWestResizeCursor):
2512         (WebCore::northWestSouthEastResizeCursor):
2513         (WebCore::columnResizeCursor):
2514         (WebCore::rowResizeCursor):
2515         (WebCore::middlePanningCursor):
2516         (WebCore::eastPanningCursor):
2517         (WebCore::northPanningCursor):
2518         (WebCore::northEastPanningCursor):
2519         (WebCore::northWestPanningCursor):
2520         (WebCore::southPanningCursor):
2521         (WebCore::southEastPanningCursor):
2522         (WebCore::southWestPanningCursor):
2523         (WebCore::westPanningCursor):
2524         (WebCore::grabCursor):
2525         (WebCore::grabbingCursor):
2526         * platform/Language.cpp:
2527         (WebCore::preferredLanguagesOverride):
2528         * platform/LocalizedStrings.cpp:
2529         (WebCore::truncatedStringForLookupMenuItem):
2530         * platform/MIMETypeRegistry.cpp:
2531         (WebCore::mediaMIMETypeMap):
2532         (WebCore::defaultMIMEType):
2533         * platform/SchemeRegistry.cpp:
2534         (WebCore::localURLSchemes):
2535         (WebCore::displayIsolatedURLSchemes):
2536         (WebCore::secureSchemes):
2537         (WebCore::schemesWithUniqueOrigins):
2538         (WebCore::emptyDocumentSchemes):
2539         (WebCore::schemesForbiddenFromDomainRelaxation):
2540         (WebCore::canDisplayOnlyIfCanRequestSchemes):
2541         (WebCore::notAllowingJavascriptURLsSchemes):
2542         (WebCore::schemesAllowingLocalStorageAccessInPrivateBrowsing):
2543         (WebCore::schemesAllowingDatabaseAccessInPrivateBrowsing):
2544         (WebCore::CORSEnabledSchemes):
2545         (WebCore::ContentSecurityPolicyBypassingSchemes):
2546         * platform/ScrollbarTheme.cpp:
2547         (WebCore::ScrollbarTheme::theme):
2548         * platform/URL.cpp:
2549         (WebCore::blankURL):
2550         * platform/animation/Animation.cpp:
2551         (WebCore::Animation::initialName):
2552         * platform/audio/AudioSession.cpp:
2553         (WebCore::AudioSession::sharedSession):
2554         * platform/audio/AudioSession.h:
2555         * platform/audio/HRTFElevation.cpp:
2556         (WebCore::getConcatenatedImpulseResponsesForSubject):
2557         * platform/audio/ios/AudioDestinationIOS.cpp:
2558         (WebCore::audioDestinations):
2559         * platform/graphics/GraphicsLayer.cpp:
2560         (WebCore::repaintRectMap):
2561         * platform/graphics/ImageBuffer.cpp:
2562         (WebCore::ImageBuffer::transformColorSpace):
2563         * platform/graphics/MediaPlayer.cpp:
2564         (WebCore::applicationOctetStream):
2565         (WebCore::textPlain):
2566         (WebCore::codecs):
2567         * platform/graphics/ShadowBlur.cpp:
2568         (WebCore::ScratchBuffer::singleton):
2569         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2570         (WebCore::playerToPrivateMap):
2571         * platform/graphics/filters/SourceAlpha.cpp:
2572         (WebCore::SourceAlpha::effectName):
2573         * platform/graphics/filters/SourceGraphic.cpp:
2574         (WebCore::SourceGraphic::effectName):
2575         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2576         (WebCore::mimeCommonTypesCache):
2577         (WebCore::mimeModernTypesCache):
2578         * platform/ios/CursorIOS.cpp:
2579         (WebCore::cursor):
2580         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
2581         (WebCore::tileControllerMemoryHandler):
2582         * platform/ios/WebCoreMotionManager.mm:
2583         (+[WebCoreMotionManager sharedManager]):
2584         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2585         (WebVideoFullscreenModelVideoElement::updateForEventName):
2586         * platform/ios/wak/WKContentObservation.cpp:
2587         (WebThreadGetObservedContentModifiers):
2588         * platform/mac/DragImageMac.mm:
2589         (WebCore::fontFromNSFont):
2590         * platform/mac/ThemeMac.mm:
2591         (WebCore::platformTheme):
2592         * platform/mac/ThreadCheck.mm:
2593         (WebCoreReportThreadViolation):
2594         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2595         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2596         (WebCore::AVCaptureDeviceManager::singleton):
2597         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2598         (WebCore::RealtimeMediaSourceCenter::platformCenter):
2599         * platform/mock/mediasource/MockBox.cpp:
2600         (WebCore::MockTrackBox::type):
2601         (WebCore::MockInitializationBox::type):
2602         (WebCore::MockSampleBox::type):
2603         * platform/network/HTTPParsers.cpp:
2604         (WebCore::parseXSSProtectionHeader):
2605         * platform/network/ResourceHandle.cpp:
2606         (WebCore::builtinResourceHandleConstructorMap):
2607         (WebCore::builtinResourceHandleSynchronousLoaderMap):
2608         * platform/network/cf/ResourceHandleCFNet.cpp:
2609         (WebCore::allowsAnyHTTPSCertificateHosts):
2610         (WebCore::clientCerts):
2611         * platform/text/AtomicStringKeyedMRUCache.h:
2612         (WebCore::AtomicStringKeyedMRUCache::get):
2613         * platform/text/cf/HyphenationCF.cpp:
2614         (WebCore::cfLocaleCache):
2615         * rendering/RenderBlock.cpp:
2616         (WebCore::continuationOutlineTable):
2617         * rendering/RenderCounter.cpp:
2618         (WebCore::counterMaps):
2619         * rendering/RenderDeprecatedFlexibleBox.cpp:
2620         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2621         * rendering/RenderLayer.cpp:
2622         (WebCore::RenderLayer::drawPlatformResizerImage):
2623         * rendering/RenderScrollbarTheme.cpp:
2624         (WebCore::RenderScrollbarTheme::renderScrollbarTheme):
2625         * rendering/RenderTheme.cpp:
2626         (WebCore::customFocusRingColor):
2627         * rendering/RenderWidget.cpp:
2628         (WebCore::WidgetHierarchyUpdatesSuspensionScope::widgetNewParentMap):
2629         * rendering/shapes/ShapeOutsideInfo.h:
2630         * rendering/style/RenderStyle.cpp:
2631         (WebCore::RenderStyle::hyphenString):
2632         (WebCore::RenderStyle::textEmphasisMarkString):
2633         (WebCore::RenderStyle::initialDashboardRegions):
2634         (WebCore::RenderStyle::noneDashboardRegions):
2635         * rendering/style/RenderStyle.h:
2636         * rendering/svg/RenderSVGPath.cpp:
2637         (WebCore::RenderSVGPath::zeroLengthLinecapPath):
2638         * rendering/svg/RenderSVGShape.cpp:
2639         (WebCore::RenderSVGShape::nonScalingStrokePath):
2640         * rendering/svg/SVGRenderingContext.cpp:
2641         (WebCore::currentContentTransformation):
2642         * rendering/svg/SVGResources.cpp:
2643         (WebCore::clipperFilterMaskerTags):
2644         (WebCore::markerTags):
2645         (WebCore::fillAndStrokeTags):
2646         (WebCore::chainableResourceTags):
2647         * svg/SVGAngle.cpp:
2648         (WebCore::SVGAngle::valueAsString):
2649         * svg/SVGAnimateColorElement.cpp:
2650         (WebCore::attributeValueIsCurrentColor):
2651         * svg/SVGAnimateMotionElement.cpp:
2652         (WebCore::SVGAnimateMotionElement::rotateMode):
2653         * svg/SVGAnimationElement.cpp:
2654         (WebCore::SVGAnimationElement::setCalcMode):
2655         (WebCore::SVGAnimationElement::setAttributeType):
2656         (WebCore::SVGAnimationElement::isAdditive):
2657         (WebCore::SVGAnimationElement::isAccumulated):
2658         (WebCore::inheritsFromProperty):
2659         * svg/SVGFEConvolveMatrixElement.cpp:
2660         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier):
2661         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier):
2662         (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier):
2663         (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier):
2664         * svg/SVGFEDiffuseLightingElement.cpp:
2665         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier):
2666         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier):
2667         * svg/SVGFEDropShadowElement.cpp:
2668         (WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier):
2669         (WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier):
2670         * svg/SVGFEGaussianBlurElement.cpp:
2671         (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier):
2672         (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier):
2673         * svg/SVGFEMorphologyElement.cpp:
2674         (WebCore::SVGFEMorphologyElement::radiusXIdentifier):
2675         (WebCore::SVGFEMorphologyElement::radiusYIdentifier):
2676         * svg/SVGFESpecularLightingElement.cpp:
2677         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier):
2678         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier):
2679         * svg/SVGFETurbulenceElement.cpp:
2680         (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier):
2681         (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier):
2682         * svg/SVGFilterElement.cpp:
2683         (WebCore::SVGFilterElement::filterResXIdentifier):
2684         (WebCore::SVGFilterElement::filterResYIdentifier):
2685         * svg/SVGGlyphMap.h:
2686         (WebCore::SVGGlyphMap::svgGlyphForGlyph):
2687         * svg/SVGLangSpace.cpp:
2688         (WebCore::SVGLangSpace::xmlspace):
2689         (WebCore::SVGLangSpace::addSupportedAttributes):
2690         * svg/SVGMarkerElement.cpp:
2691         (WebCore::SVGMarkerElement::orientTypeIdentifier):
2692         (WebCore::SVGMarkerElement::orientAngleIdentifier):
2693         (WebCore::SVGMarkerElement::synchronizeOrientType):
2694         * svg/SVGStyleElement.cpp:
2695         (WebCore::SVGStyleElement::type):
2696         (WebCore::SVGStyleElement::media):
2697         * svg/SVGTransform.cpp:
2698         (WebCore::SVGTransform::transformTypePrefixForParsing):
2699         * svg/SVGViewSpec.cpp:
2700         (WebCore::SVGViewSpec::viewBoxIdentifier):
2701         (WebCore::SVGViewSpec::preserveAspectRatioIdentifier):
2702         (WebCore::SVGViewSpec::transformIdentifier):
2703         * svg/animation/SVGSMILElement.cpp:
2704         (WebCore::SVGSMILElement::parseClockValue):
2705         (WebCore::SVGSMILElement::isSupportedAttribute):
2706         (WebCore::SVGSMILElement::restart):
2707         (WebCore::SVGSMILElement::fill):
2708         (WebCore::SVGSMILElement::repeatCount):
2709         (WebCore::SVGSMILElement::notifyDependentsIntervalChanged):
2710
2711 2016-01-08  Zalan Bujtas  <zalan@apple.com>
2712
2713         Absolute positioning -webkit-search-cancel-button crashes Safari.
2714         https://bugs.webkit.org/show_bug.cgi?id=152847
2715         <rdar://problem/24112087>
2716
2717         Reviewed by Simon Fraser.
2718
2719         Do not call offsetFromContainer while resolving the painting position for the search/cancel button renderer.
2720         It skips the static positioned parent input renderer, when the search/cancel renderer is absolute positioned.
2721         This patch also fixes a rendering glitch when the margin-right is > 0.
2722
2723         Test: fast/forms/absolute-positioned-custom-search-cancel-crash.html
2724
2725         * rendering/RenderTheme.h:
2726         (WebCore::RenderTheme::paintSearchFieldCancelButton):
2727         (WebCore::RenderTheme::paintSearchFieldResultsDecorationPart):
2728         (WebCore::RenderTheme::paintSearchFieldResultsButton):
2729         * rendering/RenderThemeMac.h:
2730         * rendering/RenderThemeMac.mm:
2731         (WebCore::convertToPaintingPosition):
2732         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2733         (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
2734         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
2735         (WebCore::RenderThemeMac::convertToPaintingRect): Deleted.
2736
2737 2016-01-08  Simon Fraser  <simon.fraser@apple.com>
2738
2739         Add display-list drawing hooks to platform-specific GraphicsContext files
2740         https://bugs.webkit.org/show_bug.cgi?id=152940
2741
2742         Reviewed by Zalan Bujtas.
2743
2744         Call into the display list recorder for top-level entrypoints implemented in platform-specific
2745         files.
2746         
2747         The convention is that if a function begins with "platform", it's not a top-level
2748         entry point, and should only be called when there's a platform context (i.e. not
2749         recording, and not paintingDisabled).
2750         
2751         A few instances are stubbed out until we have a more complete display list implementation.
2752
2753         * platform/graphics/GraphicsContext.cpp:
2754         (WebCore::GraphicsContext::drawText):
2755         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2756         (WebCore::GraphicsContext::getCTM):
2757         (WebCore::GraphicsContext::savePlatformState):
2758         (WebCore::GraphicsContext::restorePlatformState):
2759         (WebCore::GraphicsContext::drawRect):
2760         (WebCore::GraphicsContext::drawNativeImage):
2761         (WebCore::GraphicsContext::drawLine):
2762         (WebCore::GraphicsContext::drawEllipse):
2763         (WebCore::GraphicsContext::drawConvexPolygon):
2764         (WebCore::GraphicsContext::clipConvexPolygon):
2765         (WebCore::GraphicsContext::fillPath):
2766         (WebCore::GraphicsContext::strokePath):
2767         (WebCore::GraphicsContext::fillRect):
2768         (WebCore::GraphicsContext::clip):
2769         (WebCore::GraphicsContext::clipPath):
2770         (WebCore::GraphicsContext::clipBounds):
2771         (WebCore::GraphicsContext::drawLinesForText):
2772         (WebCore::GraphicsContext::roundToDevicePixels):
2773         (WebCore::GraphicsContext::translate):
2774         (WebCore::GraphicsContext::setPlatformStrokeThickness):
2775         (WebCore::GraphicsContext::setPlatformStrokeStyle):
2776         (WebCore::GraphicsContext::concatCTM):
2777         (WebCore::GraphicsContext::setCTM):
2778         (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
2779         (WebCore::GraphicsContext::endPlatformTransparencyLayer):
2780         (WebCore::GraphicsContext::clearRect):
2781         (WebCore::GraphicsContext::strokeRect):
2782         (WebCore::GraphicsContext::setLineCap):
2783         (WebCore::GraphicsContext::setLineDash):
2784         (WebCore::GraphicsContext::setLineJoin):
2785         (WebCore::GraphicsContext::clipOut):
2786         (WebCore::GraphicsContext::rotate):
2787         (WebCore::GraphicsContext::scale):
2788         (WebCore::GraphicsContext::platformFillRoundedRect):
2789         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2790         (WebCore::GraphicsContext::drawPattern):
2791         (WebCore::GraphicsContext::setPlatformShouldAntialias):
2792         (WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
2793         (WebCore::GraphicsContext::isAcceleratedContext):
2794         * platform/graphics/cg/GraphicsContextCG.cpp:
2795         (WebCore::GraphicsContext::savePlatformState):
2796         (WebCore::GraphicsContext::restorePlatformState):
2797         (WebCore::GraphicsContext::drawNativeImage):
2798         (WebCore::GraphicsContext::drawPattern):
2799         (WebCore::GraphicsContext::drawRect):
2800         (WebCore::GraphicsContext::drawLine):
2801         (WebCore::GraphicsContext::drawEllipse):
2802         (WebCore::GraphicsContext::drawConvexPolygon):
2803         (WebCore::GraphicsContext::clipConvexPolygon):
2804         (WebCore::GraphicsContext::applyStrokePattern):
2805         (WebCore::GraphicsContext::applyFillPattern):
2806         (WebCore::GraphicsContext::drawPath):
2807         (WebCore::GraphicsContext::fillPath):
2808         (WebCore::GraphicsContext::strokePath):
2809         (WebCore::GraphicsContext::fillRect):
2810         (WebCore::GraphicsContext::platformFillRoundedRect):
2811         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2812         (WebCore::GraphicsContext::clip):
2813         (WebCore::GraphicsContext::clipOut):
2814         (WebCore::GraphicsContext::clipPath):
2815         (WebCore::GraphicsContext::clipBounds):
2816         (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
2817         (WebCore::GraphicsContext::endPlatformTransparencyLayer):
2818         (WebCore::GraphicsContext::setPlatformShadow):
2819         (WebCore::GraphicsContext::setMiterLimit):
2820         (WebCore::GraphicsContext::clearRect):
2821         (WebCore::GraphicsContext::strokeRect):
2822         (WebCore::GraphicsContext::setLineCap):
2823         (WebCore::GraphicsContext::setLineDash):
2824         (WebCore::GraphicsContext::setLineJoin):
2825         (WebCore::GraphicsContext::scale):
2826         (WebCore::GraphicsContext::rotate):
2827         (WebCore::GraphicsContext::translate):
2828         (WebCore::GraphicsContext::concatCTM):
2829         (WebCore::GraphicsContext::setCTM):
2830         (WebCore::GraphicsContext::getCTM):
2831         (WebCore::GraphicsContext::roundToDevicePixels):
2832         (WebCore::GraphicsContext::drawLinesForText):
2833         (WebCore::GraphicsContext::setURLForRect):
2834         (WebCore::GraphicsContext::setIsCALayerContext):
2835         (WebCore::GraphicsContext::isCALayerContext):
2836         (WebCore::GraphicsContext::setIsAcceleratedContext):
2837         (WebCore::GraphicsContext::isAcceleratedContext):
2838         (WebCore::GraphicsContext::setPlatformTextDrawingMode):
2839         (WebCore::GraphicsContext::setPlatformStrokeColor):
2840         (WebCore::GraphicsContext::setPlatformStrokeThickness):
2841         (WebCore::GraphicsContext::setPlatformFillColor):
2842         (WebCore::GraphicsContext::setPlatformShouldAntialias):
2843         (WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
2844         (WebCore::GraphicsContext::setPlatformAlpha):
2845         (WebCore::GraphicsContext::setPlatformCompositeOperation):
2846         (WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
2847         (WebCore::GraphicsContext::platformFillEllipse):
2848         (WebCore::GraphicsContext::platformStrokeEllipse):
2849
2850 2016-01-08  Simon Fraser  <simon.fraser@apple.com>
2851
2852         Add DisplayList hooks into GraphicsContext
2853         https://bugs.webkit.org/show_bug.cgi?id=152932
2854
2855         Reviewed by Zalan Bujtas.
2856
2857         Add the hooks into GraphicsContext that call into the DisplayListRecorder if there
2858         is one.
2859         
2860         Rename size() to something less ambiguous.
2861         
2862         Out-of-line some DisplayList functions so that the header doesn't need to see
2863         DisplayListItems.h.
2864
2865         * platform/graphics/GraphicsContext.cpp:
2866         (WebCore::GraphicsContext::save):
2867         (WebCore::GraphicsContext::restore):
2868         (WebCore::GraphicsContext::setStrokeThickness):
2869         (WebCore::GraphicsContext::setStrokeStyle):
2870         (WebCore::GraphicsContext::setStrokeColor):
2871         (WebCore::GraphicsContext::setShadow):
2872         (WebCore::GraphicsContext::setLegacyShadow):
2873         (WebCore::GraphicsContext::clearShadow):
2874         (WebCore::GraphicsContext::setFillColor):
2875         (WebCore::GraphicsContext::setShadowsIgnoreTransforms):
2876         (WebCore::GraphicsContext::setShouldAntialias):
2877         (WebCore::GraphicsContext::setShouldSmoothFonts):
2878         (WebCore::GraphicsContext::setShouldSubpixelQuantizeFonts):
2879         (WebCore::GraphicsContext::setImageInterpolationQuality):
2880         (WebCore::GraphicsContext::setAntialiasedFontDilationEnabled):
2881         (WebCore::GraphicsContext::setStrokePattern):
2882         (WebCore::GraphicsContext::setFillPattern):
2883         (WebCore::GraphicsContext::setStrokeGradient):
2884         (WebCore::GraphicsContext::setFillRule):
2885         (WebCore::GraphicsContext::setFillGradient):
2886         (WebCore::GraphicsContext::beginTransparencyLayer):
2887         (WebCore::GraphicsContext::endTransparencyLayer):
2888         (WebCore::GraphicsContext::drawGlyphs):
2889         (WebCore::GraphicsContext::drawImage):
2890         (WebCore::GraphicsContext::drawTiledImage):
2891         (WebCore::GraphicsContext::setTextDrawingMode):
2892         (WebCore::GraphicsContext::fillRect):
2893         (WebCore::GraphicsContext::fillRoundedRect):
2894         (WebCore::GraphicsContext::setAlpha):
2895         (WebCore::GraphicsContext::setCompositeOperation):
2896         (WebCore::GraphicsContext::setDrawLuminanceMask):
2897         (WebCore::GraphicsContext::applyDeviceScaleFactor):
2898         (WebCore::GraphicsContext::applyState):
2899         * platform/graphics/GraphicsContext.h:
2900         (WebCore::GraphicsContext::setDisplayListRecorder):
2901         (WebCore::GraphicsContext::isRecording):
2902         (WebCore::GraphicsContext::setFillRule): Deleted.
2903         (WebCore::GraphicsContext::setShadowsIgnoreTransforms): Deleted.
2904         (WebCore::GraphicsContext::setShouldSubpixelQuantizeFonts): Deleted.
2905         (WebCore::GraphicsContext::setDrawLuminanceMask): Deleted.
2906         * platform/graphics/displaylists/DisplayList.cpp:
2907         (WebCore::DisplayList::DisplayList::clear):
2908         (WebCore::DisplayList::DisplayList::removeItemsFromIndex):
2909         * platform/graphics/displaylists/DisplayList.h:
2910         (WebCore::DisplayList::DisplayList::itemCount):
2911         (WebCore::DisplayList::DisplayList::clear): Deleted.
2912         (WebCore::DisplayList::DisplayList::size): Deleted.
2913         (WebCore::DisplayList::DisplayList::removeItemsFromIndex): Deleted.
2914         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2915         (WebCore::DisplayList::Recorder::save):
2916         (WebCore::DisplayList::Recorder::restore):
2917         * platform/graphics/displaylists/DisplayListRecorder.h:
2918         (WebCore::DisplayList::Recorder::itemCount):
2919         (WebCore::DisplayList::Recorder::size): Deleted.
2920         * platform/graphics/displaylists/DisplayListReplayer.cpp:
2921         (WebCore::DisplayList::Replayer::replay):
2922
2923 2016-01-08  Brady Eidson  <beidson@apple.com>
2924
2925         Modern IDB: imported/w3c/indexeddb/keyorder.htm times out.
2926         https://bugs.webkit.org/show_bug.cgi?id=152929
2927
2928         Reviewed by Alex Christensen.
2929
2930         No new tests (Existing test now runs in the test harness).
2931
2932         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2933         (WebCore::IDBClient::IDBCursor::setGetResult):
2934
2935 2016-01-08  Simon Fraser  <simon.fraser@apple.com>
2936
2937         Consider painting to be disabled on a GraphicsContext with no platform data, and make updatingControlTints() immutable state
2938         https://bugs.webkit.org/show_bug.cgi?id=152927
2939
2940         Reviewed by Tim Horton.
2941
2942         GraphicsContext had setters for paintingDisabled and updatingControlTints, but neither
2943         were changed dynamically.
2944         
2945         We can eliminate paintingDisabled by simply considering a GraphicsContext that was
2946         created with no platform context to be paint-disabled.
2947         
2948         We make updatingControlTints immutable state by providing a constructor that takes
2949         a "NonPaintingReasons" enum, and doesn't create platform data.
2950         
2951         More functions in platform code were protected by if (paintingDisabled())...
2952
2953         * page/FrameView.cpp:
2954         (WebCore::FrameView::paintControlTints):
2955         * platform/graphics/GraphicsContext.cpp:
2956         (WebCore::GraphicsContext::GraphicsContext):
2957         (WebCore::GraphicsContext::fillRoundedRect):
2958         (WebCore::GraphicsContext::setUpdatingControlTints): Deleted.
2959         (WebCore::GraphicsContext::clip): Deleted.
2960         * platform/graphics/GraphicsContext.h:
2961         (WebCore::GraphicsContext::paintingDisabled):
2962         (WebCore::GraphicsContext::updatingControlTints):
2963         (WebCore::GraphicsContextState::GraphicsContextState): Deleted.
2964         (WebCore::GraphicsContext::setPaintingDisabled): Deleted.
2965         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2966         (WebCore::GraphicsContext::GraphicsContext):
2967         (WebCore::GraphicsContext::platformInit):
2968         * platform/graphics/cg/GraphicsContextCG.cpp:
2969         (WebCore::GraphicsContext::platformInit):
2970         (WebCore::GraphicsContext::savePlatformState):
2971         (WebCore::GraphicsContext::restorePlatformState):
2972         (WebCore::GraphicsContext::drawNativeImage):
2973         (WebCore::GraphicsContext::drawPattern):
2974         (WebCore::GraphicsContext::drawRect):
2975         (WebCore::GraphicsContext::applyStrokePattern):
2976         (WebCore::GraphicsContext::applyFillPattern):
2977         (WebCore::GraphicsContext::clip):
2978         (WebCore::GraphicsContext::clipBounds):
2979         (WebCore::GraphicsContext::setLineDash):
2980         (WebCore::GraphicsContext::roundToDevicePixels):
2981         (WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
2982         (WebCore::GraphicsContext::setIsCALayerContext):
2983         (WebCore::GraphicsContext::isCALayerContext):
2984         (WebCore::GraphicsContext::setIsAcceleratedContext):
2985         (WebCore::GraphicsContext::isAcceleratedContext):
2986         (WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
2987         * platform/graphics/win/GraphicsContextCGWin.cpp:
2988         (WebCore::GraphicsContext::platformInit):
2989         (WebCore::GraphicsContext::GraphicsContext): Deleted.
2990         * platform/graphics/win/GraphicsContextCairoWin.cpp:
2991         (WebCore::GraphicsContext::platformInit):
2992         (WebCore::GraphicsContext::GraphicsContext): Deleted.
2993
2994 2016-01-08  Anders Carlsson  <andersca@apple.com>
2995
2996         InputType::findClosestTickMarkValue should return an Optional<Decimal>
2997         https://bugs.webkit.org/show_bug.cgi?id=152931
2998
2999         Reviewed by Andreas Kling.
3000
3001         This will make it possible to get rid of the notion of infinity from Decimal, allowing for more code simplification.
3002
3003         * html/HTMLInputElement.cpp:
3004         (WebCore::HTMLInputElement::findClosestTickMarkValue):
3005         * html/HTMLInputElement.h:
3006         * html/InputType.cpp:
3007         (WebCore::InputType::findClosestTickMarkValue):
3008         * html/InputType.h:
3009         * html/RangeInputType.cpp:
3010         (WebCore::RangeInputType::findClosestTickMarkValue):
3011         * html/RangeInputType.h:
3012         * html/shadow/SliderThumbElement.cpp:
3013         (WebCore::SliderThumbElement::setPositionFromPoint):
3014
3015 2016-01-08  Brady Eidson  <beidson@apple.com>
3016
3017         Modern IDB: IDBBindingUtilities chokes on unicode strings for get/set.
3018         https://bugs.webkit.org/show_bug.cgi?id=152921
3019
3020         Reviewed by Alex Christensen.
3021
3022         No new tests (Covered by existing tests).
3023
3024         * bindings/js/IDBBindingUtilities.cpp:
3025         (WebCore::get): Don't do a potentially lossy utf8() conversion on the string.
3026         (WebCore::set): Ditto.
3027
3028 2016-01-08  Per Arne Vollan  <peavo@outlook.com>
3029
3030         [WinCairo] Support more video formats.
3031         https://bugs.webkit.org/show_bug.cgi?id=152890
3032
3033         Reviewed by Alex Christensen.
3034
3035         Use MediaFoundation api to detect all supported video/audio formats.
3036
3037         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3038         (WebCore::MediaPlayerPrivateMediaFoundation::getSupportedTypes):
3039         (WebCore::MediaPlayerPrivateMediaFoundation::supportsType):
3040
3041 2016-01-08  Brady Eidson  <beidson@apple.com>
3042
3043         Modern IDB: Blocked event can fire on a delete request even after the last open connection has closed.
3044         https://bugs.webkit.org/show_bug.cgi?id=152896
3045
3046         Reviewed by Alex Christensen.
3047
3048         No new tests (Progression in many tests).
3049
3050         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
3051         (WebCore::IDBClient::IDBFactory::deleteDatabase):
3052         
3053         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3054         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation): Allow for handling 2+ delete operations in a row.
3055         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore): Ditto.
3056         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient): Call "notifyCurrentRequestConnectionClosedOrFiredVersionChangeEvent"
3057           after the connection is actually removed from the set of open connections.
3058         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3059
3060 2016-01-08  Zalan Bujtas  <zalan@apple.com>
3061
3062         Hovering link on http://help.apple.com/appletv/#/ does not show text underline.
3063         https://bugs.webkit.org/show_bug.cgi?id=152906
3064         <rdar://problem/23339617>
3065
3066         Reviewed by Simon Fraser.
3067
3068         GraphicsContext::computeLineBoundsAndAntialiasingModeForText() always integral ceils the origin y position to offset underline text.
3069         This additional visual overflow offset is not taken into account by visualOverflowForDecorations().
3070         Unfortunately we can't compute the exact same offset value while collecting repaint rects, because
3071         computeLineBoundsAndAntialiasingModeForText() uses CTM scaling before adjusting the offset position.
3072         Use 1px (css) bottom offset to cover this underling overflow.
3073
3074         Test: fast/css3-text/css3-text-decoration/text-underline-position/underline-visual-overflow-with-subpixel-position.html
3075
3076         * platform/graphics/GraphicsContext.cpp:
3077         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
3078         * rendering/SimpleLineLayoutResolver.cpp: Add visual overflow to simple line layout.
3079         (WebCore::SimpleLineLayout::RunResolver::Run::rect):
3080         (WebCore::SimpleLineLayout::RunResolver::RunResolver):
3081         * rendering/SimpleLineLayoutResolver.h:
3082         * style/InlineTextBoxStyle.cpp:
3083         (WebCore::visualOverflowForDecorations):
3084
3085 2016-01-08  Brady Eidson  <beidson@apple.com>
3086
3087         Modern IDB: imported/w3c/indexeddb/idbobjectstore_createIndex6-event_order.htm fails.
3088         https://bugs.webkit.org/show_bug.cgi?id=152891
3089
3090         Reviewed by Alex Christensen.
3091
3092         No new tests (At least two failing tests now pass).
3093
3094         * Modules/indexeddb/client/IDBRequestImpl.cpp:
3095         (WebCore::IDBClient::IDBRequest::dispatchEvent): Whenever we add the IDBTransaction as an event target,
3096           also add the IDBDatabase.
3097
3098 2016-01-07  Antti Koivisto  <antti@apple.com>
3099
3100         Enable selector filtering for shadow trees
3101         https://bugs.webkit.org/show_bug.cgi?id=152831
3102
3103         Reviewed by Simon Fraser.
3104
3105         Selector filtering doesn't currently work in shadow trees making style resolve for them slow.
3106         This is because SelectorFilter is not in "consistent" state.
3107
3108         This patch moves SelectorFilter ownership from StyleResolver to TreeResolver and guarantees
3109         it is always upadated consistently. It eliminates a bunch of now unnecessary consistency checks
3110         and special cases.
3111
3112         * css/ElementRuleCollector.cpp:
3113         (WebCore::ElementRuleCollector::ElementRuleCollector):
3114
3115             Assert for consistency instead of testing for it.
3116
3117         (WebCore::ElementRuleCollector::matchedResult):
3118         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
3119
3120             Selector filter can now be used if it exists.
3121
3122         * css/ElementRuleCollector.h:
3123         (WebCore::ElementRuleCollector::ElementRuleCollector): Deleted.
3124         * css/RuleSet.cpp:
3125         (WebCore::RuleSet::addRule):
3126
3127             Disable selector filtering for custom shadow pseudo rules. They are resolved by shadow DOM resolver
3128             but may contain components matching the normal DOM.
3129
3130         * css/RuleSet.h:
3131         (WebCore::RuleData::descendantSelectorIdentifierHashes):
3132         (WebCore::RuleData::disableSelectorFiltering):
3133         (WebCore::RuleData::compilationStatus):
3134         (WebCore::RuleData::compiledSelectorCodeRef):
3135         * css/SelectorFilter.cpp:
3136         (WebCore::collectElementIdentifierHashes):
3137         (WebCore::SelectorFilter::parentStackIsConsistent):
3138
3139             New consistency conditions. This is now used for asserts only.
3140
3141         (WebCore::SelectorFilter::pushParentStackFrame):
3142         (WebCore::SelectorFilter::popParentStackFrame):
3143
3144             Selector filter only filters the current tree context, replace parentOrShadowHostElement with parentElement.
3145
3146         (WebCore::SelectorFilter::setupParentStack): Deleted.
3147
3148             No longer needed.
3149
3150         (WebCore::SelectorFilter::pushParent):
3151
3152             Remove consistency check. These cases no longer happen.
3153
3154         * css/SelectorFilter.h:
3155         (WebCore::SelectorFilter::popParent):
3156         (WebCore::SelectorFilter::parentStackIsEmpty):
3157         (WebCore::SelectorFilter::fastRejectSelector):
3158         (WebCore::SelectorFilter::parentStackIsConsistent): Deleted.
3159         * css/StyleInvalidationAnalysis.cpp:
3160         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
3161         (WebCore::StyleInvalidationAnalysis::invalidateStyle):
3162         * css/StyleResolver.cpp:
3163         (WebCore::StyleResolver::appendAuthorStyleSheets):
3164         (WebCore::StyleResolver::addKeyframeStyle):
3165         (WebCore::StyleResolver::initElement):
3166         (WebCore::StyleResolver::State::initForStyleResolve):
3167
3168             We no longer owner the selector filter. Move it to State.
3169
3170         (WebCore::StyleResolver::styleSharingCandidateMatchesRuleSet):
3171         (WebCore::isAtShadowBoundary):
3172         (WebCore::StyleResolver::styleForElement):
3173         (WebCore::StyleResolver::pseudoStyleForElement):
3174         (WebCore::StyleResolver::pseudoStyleRulesForElement):
3175         (WebCore::StyleResolver::pushParentElement): Deleted.
3176         (WebCore::StyleResolver::popParentElement): Deleted.
3177
3178             No need for this logic.
3179
3180         * css/StyleResolver.h:
3181         (WebCore::StyleResolver::ruleSets):
3182         (WebCore::StyleResolver::mediaQueryEvaluator):
3183         (WebCore::StyleResolver::State::document):
3184         (WebCore::StyleResolver::State::setAuthorRollback):
3185         (WebCore::StyleResolver::State::setUserRollback):
3186         (WebCore::StyleResolver::State::selectorFilter):
3187         (WebCore::StyleResolver::state):
3188         (WebCore::checkRegionSelector):
3189         (WebCore::StyleResolver::selectorFilter): Deleted.
3190         (WebCore::StyleResolverParentPusher::StyleResolverParentPusher): Deleted.
3191         (WebCore::StyleResolverParentPusher::push): Deleted.
3192         (WebCore::StyleResolverParentPusher::~StyleResolverParentPusher): Deleted.
3193         * style/StyleTreeResolver.cpp:
3194
3195             This now owns the selector filter for a tree context.
3196
3197         (WebCore::Style::SelectorFilterPusher::SelectorFilterPusher):
3198         (WebCore::Style::SelectorFilterPusher::push):
3199         (WebCore::Style::SelectorFilterPusher::~SelectorFilterPusher):
3200         (WebCore::Style::TreeResolver::TreeResolver):
3201         (WebCore::Style::TreeResolver::styleForElement):
3202         (WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees):
3203         (WebCore::Style::TreeResolver::createRenderTreeRecursively):
3204         (WebCore::Style::TreeResolver::resolveChildren):
3205         (WebCore::Style::TreeResolver::resolveRecursively):
3206
3207             Push the filter in a few more places to keep it consistent in shadow trees.
3208
3209         * style/StyleTreeResolver.h:
3210
3211 2016-01-07  Zalan Bujtas  <zalan@apple.com>
3212
3213         Move computeLineBoundsForText from GraphicsContext* to GraphicsContext.
3214         https://bugs.webkit.org/show_bug.cgi?id=152882
3215
3216         Reviewed by Simon Fraser.
3217
3218         There is nothing platform specific about it.
3219
3220         No change in functionality.
3221
3222         * platform/graphics/GraphicsContext.cpp:
3223         (WebCore::GraphicsContext::computeUnderlineBoundsForText): Rename to reflect its usage.
3224         * platform/graphics/GraphicsContext.h:
3225         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3226         (WebCore::GraphicsContext::computeLineBoundsForText): Deleted.
3227         * platform/graphics/cg/GraphicsContextCG.cpp:
3228         (WebCore::GraphicsContext::drawLinesForText):
3229         (WebCore::GraphicsContext::computeLineBoundsForText): Deleted.
3230         * rendering/TextDecorationPainter.cpp:
3231         (WebCore::drawSkipInkUnderline):
3232
3233 2016-01-07  Brady Eidson  <beidson@apple.com>
3234
3235         Modern IDB: Success-after-open event should only have the IDBOpenDBRequest as its target.
3236         https://bugs.webkit.org/show_bug.cgi?id=152875
3237
3238         Reviewed by Alex Christensen.
3239
3240         No new tests (At least 2 failing tests now pass).
3241
3242         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
3243         (WebCore::IDBClient::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
3244
3245         * Modules/indexeddb/client/IDBRequestImpl.cpp:
3246         (WebCore::IDBClient::IDBRequest::dispatchEvent): Only add the transaction and database as potential
3247           targets for this event if it is *not* the success-after-open event.
3248         * Modules/indexeddb/client/IDBRequestImpl.h:
3249
3250 2016-01-07  Brent Fulgham  <bfulgham@apple.com>
3251
3252         Correct missing EXT_sRGB Format Handling
3253         https://bugs.webkit.org/show_bug.cgi?id=152876
3254         <rdar://problem/23284389>
3255
3256         Reviewed by Alex Christensen.
3257
3258         Tested by WebGL 1.0.4 suite.
3259
3260         * platform/graphics/GraphicsContext3D.cpp:
3261         (getDataFormat): Handle missing SRGB and SRGB_ALPHA cases.
3262         * platform/graphics/GraphicsContext3D.h: Add missing SRGB_ALPHA value from the Khronos standard.
3263         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
3264         (WebCore::GraphicsContext3D::texImage2D): Add an assertion that we are not being handed
3265         an internal format to a method that works with normal formats.
3266
3267 2016-01-07  Simon Fraser  <simon.fraser@apple.com>
3268
3269         Use an appropriate buffer format for swipe snapshots
3270         https://bugs.webkit.org/show_bug.cgi?id=152880
3271         rdar://problem/23728299
3272
3273         Reviewed by Tim Horton.
3274
3275         Choose an appropriate buffer format for swipe snapshots, and avoid converting
3276         them to YUV422.
3277
3278         * platform/graphics/cocoa/IOSurface.h:
3279         * platform/graphics/cocoa/IOSurface.mm:
3280         (IOSurface::allowConversionFromFormatToFormat):
3281
3282 2016-01-07  Jer Noble  <jer.noble@apple.com>
3283
3284         [EME] Secure stop information not written to disk
3285         https://bugs.webkit.org/show_bug.cgi?id=152855
3286
3287         Reviewed by Eric Carlson.
3288
3289         Two separate bugs for the two APIs provided by AVFoundation. For the AVStreamSession path,
3290         we were not calling the lazy-creation function which creates the AVStreamSession, and were
3291         rather accessing the ivar directly. For the AVContentKeySession, we were not creating the
3292         intermediate paths containing the secure stop database.
3293
3294         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3295         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
3296         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3297         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
3298
3299 2016-01-07  Zalan Bujtas  <zalan@apple.com>
3300
3301         Use wavy offset for decoration painting when line style is TextDecorationStyleWavy.
3302         https://bugs.webkit.org/show_bug.cgi?id=152856
3303
3304         Reviewed by Simon Fraser.
3305
3306         No change in functionality.
3307
3308         * rendering/TextDecorationPainter.cpp:
3309         (WebCore::TextDecorationPainter::paintTextDecoration):
3310
3311 2016-01-07  Brady Eidson  <beidson@apple.com>
3312
3313         Modern IDB: Various imported/w3c/indexeddb tests fail due to expecting the wrong exception.
3314         https://bugs.webkit.org/show_bug.cgi?id=152866
3315
3316         Reviewed by Alex Christensen.
3317
3318         No new tests (5 skipped tests now pass).
3319
3320         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
3321         (WebCore::IDBClient::IDBObjectStore::putOrAdd): Reorder the exceptions, violating the spec but matching
3322           a vast majority of browsers.
3323         (WebCore::IDBClient::IDBObjectStore::deleteFunction): Ditto.
3324         (WebCore::IDBClient::IDBObjectStore::clear): Ditto.
3325         (WebCore::IDBClient::IDBObjectStore::doCount): Ditto.
3326
3327 2016-01-07  Zalan Bujtas  <zalan@apple.com>
3328
3329         Remove unused shouldAntialias parameter from GraphicsContext::computeLineBoundsAndAntialiasingModeForText()
3330         https://bugs.webkit.org/show_bug.cgi?id=152859
3331
3332         Reviewed by Simon Fraser.
3333
3334         No change in functionality.
3335
3336         * platform/graphics/GraphicsContext.cpp:
3337         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
3338         * platform/graphics/GraphicsContext.h:
3339         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3340         (WebCore::GraphicsContext::computeLineBoundsForText):
3341         (WebCore::GraphicsContext::drawLinesForText):
3342         * platform/graphics/cg/GraphicsContextCG.cpp:
3343         (WebCore::GraphicsContext::computeLineBoundsForText):
3344         (WebCore::GraphicsContext::drawLinesForText):
3345
3346 2016-01-07  Brady Eidson  <beidson@apple.com>
3347
3348         Modern IDB: imported/w3c/indexeddb/idbcursor-continue.htm fails.
3349         https://bugs.webkit.org/show_bug.cgi?id=152849
3350
3351         Reviewed by Alex Christensen.
3352
3353         No new tests (At least one failing test now passes).
3354
3355         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
3356         (WebCore::IDBServer::MemoryIndexCursor::iterate): Don't allow returning an iterator outside of
3357           the cursor's assigned range.
3358
3359 2016-01-07  Zalan Bujtas  <zalan@apple.com>
3360
3361         Incorrect position: fixed; rendering when child of position:relative/sticky.
3362         https://bugs.webkit.org/show_bug.cgi?id=147284
3363
3364         Reviewed by Simon Fraser and David Hyatt.
3365
3366         Computing logical left for positioned objects should take the relative positioned ancestors' offset
3367         into account.
3368
3369         Tests: fast/block/positioning/fixed-container-with-relative-parent.html
3370                fast/block/positioning/fixed-container-with-sticky-parent.html
3371
3372         * rendering/RenderBox.cpp:
3373         (WebCore::computeInlineStaticDistance):
3374
3375 2016-01-06  Simon Fraser  <simon.fraser@apple.com>
3376
3377         Initial implementation files for display-list recording and playback
3378         https://bugs.webkit.org/show_bug.cgi?id=152816
3379
3380         Reviewed by Zalan Bujtas.
3381
3382         Add files for:
3383         - DisplayList, a class that holds a vector of display items, and in the future will hold metadata
3384           on the list for optimizations etc.
3385         - DisplayList::Recorder, the outward-facing recording API which GraphicsContext will
3386           call into.
3387         - DisplayList::Replayer, which plays back a DisplayList, possibly applying optimizations.
3388         - Various DisplayList::Items, one type for each display list operation. They cover most of the
3389           GraphicsContext functionality, other than clipping to an image buffer. Text drawing is stubbed
3390           out for now.
3391
3392         Added a "DisplayLists" log channel.
3393
3394         Added GraphicsContextState functions for tracking state deltas with change bits. It may
3395         make sense to combine GraphicsContextStateChange and GraphicsContextState, and use the
3396         dirty bits in non-display-list drawing as well.
3397
3398         * CMakeLists.txt:
3399         * WebCore.xcodeproj/project.pbxproj:
3400         * platform/Logging.h:
3401         * platform/graphics/GraphicsContext.h:
3402         * platform/graphics/displaylists/DisplayList.cpp: Added.
3403         (WebCore::DisplayList::DisplayList::description):
3404         (WebCore::DisplayList::DisplayList::dump):
3405         (WebCore::operator<<):
3406         * platform/graphics/displaylists/DisplayListItems.cpp: Added.
3407         * platform/graphics/displaylists/DisplayListItems.h: Added.
3408         * platform/graphics/displaylists/DisplayListRecorder.cpp: Added.
3409         * platform/graphics/displaylists/DisplayListRecorder.h: Added.
3410         * platform/graphics/displaylists/DisplayListReplayer.cpp: Added.
3411         (WebCore::DisplayList::Replayer::Replayer):
3412         (WebCore::DisplayList::Replayer::~Replayer):
3413         (WebCore::DisplayList::Replayer::replay):
3414         * platform/graphics/displaylists/DisplayListReplayer.h: Added.
3415
3416 2016-01-07  Chris Dumez  <cdumez@apple.com>