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