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