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