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