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