e10f3814af790dea0d4f8c6c12ba0a62f34ff7b3
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-01-15  Brent Fulgham  <bfulgham@apple.com>
2
3         RenderLayerCompositor: Strange comparison of opacity (float) to boolean.
4         https://bugs.webkit.org/show_bug.cgi?id=140477.
5
6         Reviewed by Simon Fraser.
7
8         * rendering/RenderLayerCompositor.cpp:
9         (WebCore::styleChangeRequiresLayerRebuild): Add a cast to make the meaning of this
10         code clearer.
11
12 2015-01-15  Joseph Pecoraro  <pecoraro@apple.com>
13
14         Unreviewed, rolling out r178531.
15
16         Caused LayoutTest ASSERTs/CRASHs on Debug Yosemite build-bot.
17
18         Reverted changeset:
19
20         "Layers need to be already updated before we call adjustViewSize."
21         https://bugs.webkit.org/show_bug.cgi?id=135514
22         http://trac.webkit.org/changeset/178531
23
24         * page/FrameView.cpp:
25         (WebCore::FrameView::layout):
26         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
27         (WebCore::FrameView::paintContents):
28         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange): Deleted.
29         * page/FrameView.h:
30         * platform/ScrollView.cpp:
31         (WebCore::ScrollView::scrollTo):
32         (WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange): Deleted.
33         * platform/ScrollView.h:
34         (WebCore::ScrollView::shouldDeferScrollUpdateAfterContentSizeChange): Deleted.
35
36 2015-01-15  Chris Dumez  <cdumez@apple.com>
37
38         [WK2] Wire diagnostic logging messages through the UIProcess
39         https://bugs.webkit.org/show_bug.cgi?id=140486
40
41         Reviewed by Sam Weinig.
42
43         Wire diagnostic logging messages through the UIProcess.
44         Eventually, the corresponding bundle API should go away.
45
46         * WebCore.vcxproj/WebCore.vcxproj:
47         * WebCore.vcxproj/WebCore.vcxproj.filters:
48         Add page/DiagnosticLoggingResultType.h to Windows project.
49
50         * WebCore.xcodeproj/project.pbxproj:
51         Add page/DiagnosticLoggingResultType.h to XCode project.
52
53         * html/HTMLMediaElement.cpp:
54         * loader/EmptyClients.h:
55         * loader/FrameLoader.cpp:
56         * page/DiagnosticLoggingClient.h:
57         * page/DiagnosticLoggingResultType.h: Copied from Source/WebCore/page/DiagnosticLoggingClient.h.
58         Use new DiagnosticLoggingResultType enum instead of old
59         DiagnosticLoggingClient::LogType one.
60
61 2015-01-15  Zalan Bujtas  <zalan@apple.com>
62
63         Reduce LayoutRect::infiniteRect() usage.
64         https://bugs.webkit.org/show_bug.cgi?id=140511
65
66         Reviewed by Simon Fraser.
67
68         This is in preparation to get rid of LayoutRect/FloatRect::infiniteRect().
69
70         No change in functionality.
71
72         * platform/graphics/LayoutRect.h:
73         (WebCore::LayoutRect::isInfinite):
74         * rendering/ClipRect.h:
75         (WebCore::ClipRect::reset):
76         (WebCore::ClipRect::isEmpty):
77         (WebCore::ClipRect::isInfinite):
78         (WebCore::ClipRect::setRect): Deleted.
79         * rendering/PaintInfo.h:
80         (WebCore::PaintInfo::applyTransform):
81         * rendering/RenderLayer.cpp:
82         (WebCore::RenderLayer::calculateClipRects):
83         * rendering/RenderLayer.h:
84         (WebCore::ClipRects::reset):
85         * rendering/RenderLayerBacking.cpp:
86         (WebCore::RenderLayerBacking::updateGeometry):
87         * rendering/RenderLayerCompositor.cpp:
88         (WebCore::RenderLayerCompositor::clippedByAncestor):
89
90 2015-01-15  Chris Dumez  <cdumez@apple.com>
91
92         Intermittent WebCore build failures - CSSPropertyNames.gperf: No keywords in input file! calling gperf failed: 256 at WebCore/css/makeprop.pl line 901
93         https://bugs.webkit.org/show_bug.cgi?id=140521
94
95         Reviewed by Alexey Proskuryakov.
96
97         Close the CSSPropertyNames.gperf file before calling gperf on it
98         to make sure the content we wrote was flushed. This was causing
99         intermittent build failures.
100
101         * css/makeprop.pl:
102
103 2015-01-15  Zalan Bujtas  <zalan@apple.com>
104
105         LayerFragment should be able to intersect with ClipRect.
106         https://bugs.webkit.org/show_bug.cgi?id=140498
107
108         Reviewed by Simon Fraser.
109
110         No change in functionality.
111
112         * rendering/LayerFragment.h:
113         (WebCore::LayerFragment::intersect):
114         * rendering/RenderLayer.cpp:
115         (WebCore::RenderLayer::collectFragments):
116
117 2015-01-15  Zalan Bujtas  <zalan@apple.com>
118
119         Move ClipRects and ClipRectsCache classes to RenderLayer.cpp.
120         https://bugs.webkit.org/show_bug.cgi?id=140461
121
122         Reviewed by Simon Fraser.
123
124         Move classes only used by RenderLayer to RenderLayer.cpp.
125
126         No change in functionality.
127
128         * rendering/RenderLayer.cpp:
129         (WebCore::ClipRects::create):
130         (WebCore::ClipRects::reset):
131         (WebCore::ClipRects::overflowClipRect):
132         (WebCore::ClipRects::setOverflowClipRect):
133         (WebCore::ClipRects::fixedClipRect):
134         (WebCore::ClipRects::setFixedClipRect):
135         (WebCore::ClipRects::posClipRect):
136         (WebCore::ClipRects::setPosClipRect):
137         (WebCore::ClipRects::fixed):
138         (WebCore::ClipRects::setFixed):
139         (WebCore::ClipRects::ref):
140         (WebCore::ClipRects::deref):
141         (WebCore::ClipRects::operator==):
142         (WebCore::ClipRects::operator=):
143         (WebCore::ClipRects::ClipRects):
144         (WebCore::ClipRectsCache::ClipRectsCache):
145         (WebCore::ClipRectsCache::getClipRects):
146         (WebCore::ClipRectsCache::setClipRects):
147         (WebCore::ClipRectsCache::getIndex):
148         (WebCore::RenderLayer::clipRects):
149         (WebCore::RenderLayer::calculateClipRects):
150         * rendering/RenderLayer.h:
151         (WebCore::ClipRects::create): Deleted.
152         (WebCore::ClipRects::ClipRects): Deleted.
153         (WebCore::ClipRects::reset): Deleted.
154         (WebCore::ClipRects::overflowClipRect): Deleted.
155         (WebCore::ClipRects::setOverflowClipRect): Deleted.
156         (WebCore::ClipRects::fixedClipRect): Deleted.
157         (WebCore::ClipRects::setFixedClipRect): Deleted.
158         (WebCore::ClipRects::posClipRect): Deleted.
159         (WebCore::ClipRects::setPosClipRect): Deleted.
160         (WebCore::ClipRects::fixed): Deleted.
161         (WebCore::ClipRects::setFixed): Deleted.
162         (WebCore::ClipRects::ref): Deleted.
163         (WebCore::ClipRects::deref): Deleted.
164         (WebCore::ClipRects::operator==): Deleted.
165         (WebCore::ClipRects::operator=): Deleted.
166         (WebCore::ClipRectsCache::ClipRectsCache): Deleted.
167         (WebCore::ClipRectsCache::getClipRects): Deleted.
168         (WebCore::ClipRectsCache::setClipRects): Deleted.
169         (WebCore::ClipRectsCache::getIndex): Deleted.
170
171 2015-01-15  Dhi Aurrahman  <diorahman@rockybars.com>
172
173         Canonicalization of :lang() should preserve the :lang()'s arguments representations
174         https://bugs.webkit.org/show_bug.cgi?id=139928
175
176         Reviewed by Benjamin Poulain.
177
178         Preserve the representation of IDENT and STRING when serializing the 
179         :lang(). For example, :lang(foo,"bar"   ,baz) should be serialized as 
180         :lang(foo, "bar", baz) instead of :lang(foo, bar, baz).
181
182         Rename CSSParserSelector::setArgumentList, CSSSelector::setArgumentList
183         and CSSSelector::argumentList to CSSParserSelector::setLangArgumentList,
184         CSSSelector::setLangArgumentList and CSSSelector::langArgumentList 
185         respectively, since those methods are being exclusively used in respect
186         with :lang().
187
188         Update the test of serializing :lang() with IDENT and STRING arguments.
189
190         * css/CSSGrammar.y.in:
191         * css/CSSParserValues.cpp:
192         (WebCore::CSSParserSelector::setLangArgumentList):
193         (WebCore::CSSParserSelector::setArgumentList): Deleted.
194         * css/CSSParserValues.h:
195         (WebCore::CSSParserString::init):
196         (WebCore::CSSParserString::clear):
197         (WebCore::CSSParserString::isParsedFromString):
198         (WebCore::CSSParserString::setParsedFromString):
199         * css/CSSSelector.cpp:
200         (WebCore::appendLangArgumentList):
201         (WebCore::CSSSelector::selectorText):
202         (WebCore::CSSSelector::setLangArgumentList):
203         (WebCore::appendArgumentList): Deleted.
204         (WebCore::CSSSelector::setArgumentList): Deleted.
205         * css/CSSSelector.h:
206         (WebCore::CSSSelector::langArgumentList):
207         (WebCore::CSSSelector::langArgumentParsedFromStringFlagList):
208         (WebCore::CSSSelector::argumentList): Deleted.
209         * css/SelectorChecker.cpp:
210         (WebCore::SelectorChecker::checkOne):
211
212 2015-01-15  Brent Fulgham  <bfulgham@apple.com>
213
214         Layers need to be already updated before we call adjustViewSize
215         https://bugs.webkit.org/show_bug.cgi?id=135514
216
217         Reviewed by Simon Fraser.
218
219         Tested by 'fast/dynamic/layer-no-longer-paginated.html'
220
221         Defer updating scrollbars until we have finished layout. This
222         has a couple of benefits:
223         (1) We do not attempt to modify render layers during layout.
224         (2) In WK1 we do not attempt to paint during layout.
225
226         Add a new virtual predicate to ScrollView indicating when we are in
227         layout so that calls to setContentsSize do not attempt
228         to adjust scrollbars.
229
230         Modify FrameView to set its ScrollView state to block drawing
231         scrollbar updates during layout. Also add a post-layout
232         handler to complete the scrollbar updates after layout is
233         finished.
234
235         * page/FrameView.cpp:
236         (WebCore::FrameView::layout):
237         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange): Added.
238         * page/FrameView.h:
239         * platform/ScrollView.cpp:
240         (WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange): Added.
241         (WebCore::ScrollView::scrollTo): If we should defer painting, cache the
242         the scroll delta and apply it after the layout is complete.
243         * platform/ScrollView.h:
244         (WebCore::ScrollView::shouldDeferScrollUpdateAfterContentSizeChange): Added.
245
246 2015-01-15  Benjamin Poulain  <benjamin@webkit.org>
247
248         When building the NFA of the global disjunction, share the prefix subgraph of existing subpatterns
249         https://bugs.webkit.org/show_bug.cgi?id=140465
250
251         Reviewed by Andreas Kling.
252
253         This patch updates the parser to produce smaller graphs when multiple patterns
254         of the rule list share a common prefix.
255
256         Previously, GraphBuilder would generate subgraph in place of each parsed
257         atom. We now only create subgraph if an atom does not appear in the prefix tree.
258
259         We accumulate the parsing information into small uint16_t named TrivialAtom.
260         When generating the subgraph for an new atom, we first check if the prefix tree already
261         has a corresponding subgraph for that atom. If it does, we do not generate anything and we extend the existing
262         graph. If there is no existing prefix, we create the subgraph and extend the prefix tree.
263
264         Sharing prefix subtrees slows down the subtree generation a bit but the resulting graph is much
265         simpler for many kind of inputs.
266
267         * WebCore.xcodeproj/project.pbxproj:
268         * contentextensions/ContentExtensionsBackend.cpp:
269         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
270         The URLFilterParser now maintains states (the prefix tree) between patterns.
271
272         * contentextensions/DFA.cpp:
273         (WebCore::ContentExtensions::DFA::debugPrintDot):
274         * contentextensions/DFANode.h:
275         Fix a typo :)
276
277         * contentextensions/NFA.cpp:
278         (WebCore::ContentExtensions::NFA::createNode):
279         (WebCore::ContentExtensions::NFA::setFinal):
280         (WebCore::ContentExtensions::NFA::restoreToGraphSize):
281         (WebCore::ContentExtensions::NFA::addRuleId):
282         (WebCore::ContentExtensions::NFA::debugPrintDot):
283         * contentextensions/NFA.h:
284         (WebCore::ContentExtensions::NFA::addRuleId):
285         * contentextensions/NFANode.cpp: Removed.
286         * contentextensions/NFANode.h:
287         NFA nodes from two patterns are now "merged" by construction, thus we need
288         to keep track of multiple rules per node.
289
290         * contentextensions/NFAToDFA.cpp:
291         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
292         * contentextensions/URLFilterParser.cpp:
293         (WebCore::ContentExtensions::trivialAtomFromAsciiCharacter):
294         (WebCore::ContentExtensions::quantifyTrivialAtom):
295         (WebCore::ContentExtensions::trivialAtomForNewlineClassIDBuiltin):
296         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
297         (WebCore::ContentExtensions::GraphBuilder::m_LastPrefixTreeEntry):
298         (WebCore::ContentExtensions::GraphBuilder::finalize):
299         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
300         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
301         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
302         (WebCore::ContentExtensions::GraphBuilder::fail):
303         (WebCore::ContentExtensions::GraphBuilder::generateTransition):
304         (WebCore::ContentExtensions::GraphBuilder::sinkTrivialAtom):
305         (WebCore::ContentExtensions::GraphBuilder::sinkPendingAtomIfNecessary):
306         (WebCore::ContentExtensions::URLFilterParser::URLFilterParser):
307         (WebCore::ContentExtensions::URLFilterParser::addPattern):
308         (WebCore::ContentExtensions::GraphBuilder::m_lastAtom): Deleted.
309         (WebCore::ContentExtensions::URLFilterParser::parse): Deleted.
310         * contentextensions/URLFilterParser.h:
311         (WebCore::ContentExtensions::URLFilterParser::hasError): Deleted.
312         (WebCore::ContentExtensions::URLFilterParser::errorMessage): Deleted.
313
314 2015-01-14  Alexey Proskuryakov  <ap@apple.com>
315
316         Web Inspector and regular console use different source code locations for messages
317         https://bugs.webkit.org/show_bug.cgi?id=140478
318
319         Reviewed by Brian Burg.
320
321         We now create a ConsoleMessage object in a place where we can look at it and use
322         the source location it computed in a client call.
323
324         * inspector/InspectorConsoleInstrumentation.h:
325         (WebCore::InspectorInstrumentation::addMessageToConsole):
326         * inspector/InspectorInstrumentation.cpp:
327         (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
328         * inspector/InspectorInstrumentation.h:
329         * inspector/WebConsoleAgent.cpp:
330         (WebCore::WebConsoleAgent::didFinishXHRLoading):
331         (WebCore::WebConsoleAgent::didReceiveResponse):
332         (WebCore::WebConsoleAgent::didFailLoading):
333         * page/PageConsoleClient.cpp:
334         (WebCore::PageConsoleClient::addMessage):
335         (WebCore::PageConsoleClient::messageWithTypeAndLevel):
336         * workers/WorkerGlobalScope.cpp:
337         (WebCore::WorkerGlobalScope::addMessageToWorkerConsole):
338
339 2015-01-15  Brent Fulgham  <bfulgham@apple.com>
340
341         [Win] Unreviewed Windows build fix.
342
343         More missing Font->FontCascade changes.
344
345         * platform/win/WebCoreTextRenderer.cpp:
346         (WebCore::WebCoreSetAlwaysUsesComplexTextCodePath):
347         (WebCore::WebCoreAlwaysUsesComplexTextCodePath):
348
349 2015-01-15  Antti Koivisto  <antti@apple.com>
350
351         REGRESSION(r178133): Membuster regressed ~4%
352         https://bugs.webkit.org/show_bug.cgi?id=140495
353
354         Reviewed by Andreas Kling.
355
356         * platform/graphics/FontCache.cpp:
357         (WebCore::FontCache::purgeInactiveFontData):
358
359             Fonts may ref other fonts. Keep clearing until there are no changes.
360
361 2015-01-15  Brent Fulgham  <bfulgham@apple.com>
362
363         [Win] Unreviewed build fix.
364
365         * platform/graphics/win/FontCacheWin.cpp:
366         * platform/win/DragImageWin.cpp:
367         * platform/win/WebCoreTextRenderer.h:
368
369 2015-01-15  Antti Koivisto  <antti@apple.com>
370
371         Try to fix windows build.
372
373         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
374         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
375         (PlatformCALayerWinInternal::displayCallback):
376         * platform/win/DragImageWin.cpp:
377         (WebCore::dragLabelFont):
378         (WebCore::createDragImageForLink):
379         * platform/win/PopupMenuWin.cpp:
380         (WebCore::PopupMenuWin::calculatePositionAndSize):
381         (WebCore::PopupMenuWin::paint):
382         * platform/win/WebCoreTextRenderer.cpp:
383         (WebCore::doDrawTextAtPoint):
384         (WebCore::WebCoreDrawDoubledTextAtPoint):
385         (WebCore::WebCoreTextFloatWidth):
386         (WebCore::WebCoreSetAlwaysUsesComplexTextCodePath):
387         (WebCore::WebCoreAlwaysUsesComplexTextCodePath):
388         * rendering/RenderThemeSafari.cpp:
389         (WebCore::RenderThemeSafari::setFontFromControlSize):
390
391 2015-01-15  Antti Koivisto  <antti@apple.com>
392
393         Unreviewed, rolling out r178518.
394
395         Didn't mean to commit some of this
396
397         Reverted changeset:
398
399         "Try to fix windows build."
400         http://trac.webkit.org/changeset/178518
401
402 2015-01-15  Antti Koivisto  <antti@apple.com>
403
404         Try to fix windows build.
405
406         * platform/graphics/Font.cpp: Copied from Source/WebCore/platform/graphics/SimpleFontData.cpp.
407         * platform/graphics/Font.h: Copied from Source/WebCore/platform/graphics/SimpleFontData.h.
408         * platform/graphics/FontCascadeFastPath.cpp: Copied from Source/WebCore/platform/graphics/FontFastPath.cpp.
409         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
410         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
411         (PlatformCALayerWinInternal::displayCallback):
412         * platform/graphics/ios/FontIOS.mm: Copied from Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm.
413         * platform/graphics/mac/FontCascadeComplexTextMac.cpp: Copied from Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp.
414         * platform/graphics/mac/FontCascadeMac.mm: Copied from Source/WebCore/platform/graphics/mac/FontMac.mm.
415         * platform/graphics/mac/FontCoreText.cpp: Copied from Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp.
416         * platform/graphics/mac/FontMac.mm: Replaced with Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm.
417         * platform/win/DragImageWin.cpp:
418         (WebCore::dragLabelFont):
419         (WebCore::createDragImageForLink):
420         * platform/win/PopupMenuWin.cpp:
421         (WebCore::PopupMenuWin::calculatePositionAndSize):
422         (WebCore::PopupMenuWin::paint):
423         * platform/win/WebCoreTextRenderer.cpp:
424         (WebCore::doDrawTextAtPoint):
425         (WebCore::WebCoreDrawDoubledTextAtPoint):
426         (WebCore::WebCoreTextFloatWidth):
427         (WebCore::WebCoreSetAlwaysUsesComplexTextCodePath):
428         (WebCore::WebCoreAlwaysUsesComplexTextCodePath):
429         * rendering/RenderThemeSafari.cpp:
430         (WebCore::RenderThemeSafari::setFontFromControlSize):
431
432 2015-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
433
434         http/tests/misc/acid3.html is flakey on Mavericks
435         https://bugs.webkit.org/show_bug.cgi?id=140253
436
437         Reviewed by Alexey Proskuryakov.
438
439         CoreText has a bug <rdar://problem/19433490> in which kerning is not applied for a font
440         if a CTTypesetter is created using that font before a call to CTFontTransformGlyphs. We
441         often create typesetters in the complex code path, so it's not obvious when this bug
442         might present itself. This patch simply makes a dummy invocation of
443         CTFontTransformGlyphs() when creating a SimpleFontData.
444
445         No new tests because this is covered by http/tests/misc/acid3.html.
446
447         * platform/graphics/mac/SimpleFontDataMac.mm:
448         (WebCore::SimpleFontData::platformInit):
449
450 2015-01-15  Chris Dumez  <cdumez@apple.com>
451
452         Get rid of custom StyleBuilder code for 'line-height' CSS property
453         https://bugs.webkit.org/show_bug.cgi?id=140462
454
455         Reviewed by Antti Koivisto.
456
457         Get rid of custom StyleBuilder code for 'line-height' CSS property by
458         using a conditional converter.
459
460         * css/CSSPropertyNames.in:
461         * css/StyleBuilderConverter.h:
462         (WebCore::StyleBuilderConverter::convertLineHeight):
463         * css/StyleBuilderCustom.h:
464         (WebCore::StyleBuilderCustom::applyValueLineHeight):
465         (WebCore::StyleBuilderCustom::convertLineHeight): Deleted.
466
467 2015-01-15  Antti Koivisto  <antti@apple.com>
468
469         Rename Font to FontCascade
470         https://bugs.webkit.org/show_bug.cgi?id=140442
471
472         Reviewed by Darin Adler.
473
474         We can then rename SimpleFontData to Font. This will match the usual definition of a "font".
475
476 2015-01-15  Mihnea Ovidenie  <mihnea@adobe.com>
477
478         [CSSRegions] Assert failure in RenderBlock::locateFlowThreadContainingBlock when showing the render tree debug info
479         https://bugs.webkit.org/show_bug.cgi?id=140441
480
481         Reviewed by Andrei Bucur.
482
483         When showing the render tree debug information for an element inside a flow thread,
484         we will display the region range information for all the render boxes. To avoid
485         computation of flow thread containing block in these situations, we will use
486         only the cached flow thread containing block information.
487
488         No new tests as this code path is only touched when using showRenderTree* methods.
489
490         * rendering/RenderObject.cpp:
491         (WebCore::flowThreadContainingBlockFromRenderer):
492         (WebCore::RenderObject::showRegionsInformation):
493
494 2015-01-14  Simon Fraser  <simon.fraser@apple.com>
495
496         Graphics corruption after Find on some pages
497         https://bugs.webkit.org/show_bug.cgi?id=140489
498
499         Reviewed by Zalan Bujtas.
500         
501         After doing a Find on http://shop.outlier.cc/shop/retail/chino.html,
502         garbage could appear on some parts of the page. This is caused by creating
503         a compositing layer which is marked as opaque, yet failing to paint the entire
504         layer contents.
505         
506         This was caused by a bug in RenderBox::computeBackgroundIsKnownToBeObscured()
507         logic. On the page in question, doing a Find could cause overflow:hidden sections
508         to get scrolled (since Find can reveal the selection by scrolling overflow).
509         However, the render tree walking under RenderBox::foregroundIsKnownToBeOpaqueInRect()
510         fails to take overflow scrolling into account, so gives the wrong answer
511         in some content configurations. As a result, we'd think that the background
512         is obscured, and never paint it.
513         
514         Conservative fix is to have isCandidateForOpaquenessTest() return false
515         when the content has any non-zero scroll offset.
516
517         Tests: compositing/contents-opaque/opaque-with-scrolled.html
518                fast/backgrounds/opaque-scrolled-paint-background.html
519
520         * rendering/RenderBox.cpp:
521         (WebCore::isCandidateForOpaquenessTest):
522
523 2015-01-14  Jer Noble  <jer.noble@apple.com>
524
525         [Mac][MSE] Stalled YouTube playback does not allow display to sleep.
526         https://bugs.webkit.org/show_bug.cgi?id=140468
527         rdar://problem/19171162
528
529         Reviewed by Eric Carlson.
530
531         Test: media/media-source/media-source-stalled-holds-sleep-assertion.html
532
533         The unstated convention of MediaPlayerPrivate::paused() is that implementations should 
534         return 'true' if the playback rate is 0. However, MediaPlayerPrivateMediaSourceAVFObjC
535         was returning 'false' if it was supposed to be playing, regardless of the actual rate.
536         This caused a check in HTMLMediaElement of whether to release the sleep assertion token
537         to fail, thinking the media engine was still playing.
538
539         Add some testing infrastructure to allow us to test whether the media element is disabling
540         display sleep from within layout tests.
541
542         * html/HTMLMediaElement.h:
543         (WebCore::HTMLMediaElement::isDisablingSleep):
544         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
545         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paused):
546         * testing/Internals.cpp:
547         (WebCore::Internals::elementIsBlockingDisplaySleep):
548         * testing/Internals.h:
549         * testing/Internals.idl:
550
551 2015-01-14  Zalan Bujtas  <zalan@apple.com>
552
553         Move LayoutFragment and ClipRect to their own files.
554         https://bugs.webkit.org/show_bug.cgi?id=140457
555
556         Reviewed by Simon Fraser.
557
558         Move these classes to their own files to to make RenderLayer.h less heavy.
559
560         No change in functionality.
561
562         * WebCore.xcodeproj/project.pbxproj:
563         * rendering/ClipRect.cpp: Added.
564         (WebCore::ClipRect::intersects):
565         * rendering/ClipRect.h: Added.
566         (WebCore::ClipRect::ClipRect):
567         (WebCore::ClipRect::rect):
568         (WebCore::ClipRect::setRect):
569         (WebCore::ClipRect::affectedByRadius):
570         (WebCore::ClipRect::setAffectedByRadius):
571         (WebCore::ClipRect::operator==):
572         (WebCore::ClipRect::operator!=):
573         (WebCore::ClipRect::intersect):
574         (WebCore::ClipRect::move):
575         (WebCore::ClipRect::moveBy):
576         (WebCore::ClipRect::isEmpty):
577         (WebCore::ClipRect::intersects):
578         (WebCore::ClipRect::inflateX):
579         (WebCore::ClipRect::inflateY):
580         (WebCore::ClipRect::inflate):
581         (WebCore::intersection):
582         * rendering/LayerFragment.h: Added.
583         (WebCore::LayerFragment::setRects):
584         (WebCore::LayerFragment::moveBy):
585         (WebCore::LayerFragment::intersect):
586         * rendering/RenderFlowThread.h:
587         * rendering/RenderLayer.cpp:
588         (WebCore::ClipRect::intersects): Deleted.
589         * rendering/RenderLayer.h:
590         (WebCore::ClipRect::ClipRect): Deleted.
591         (WebCore::ClipRect::rect): Deleted.
592         (WebCore::ClipRect::setRect): Deleted.
593         (WebCore::ClipRect::affectedByRadius): Deleted.
594         (WebCore::ClipRect::setAffectedByRadius): Deleted.
595         (WebCore::ClipRect::operator==): Deleted.
596         (WebCore::ClipRect::operator!=): Deleted.
597         (WebCore::ClipRect::intersect): Deleted.
598         (WebCore::ClipRect::move): Deleted.
599         (WebCore::ClipRect::moveBy): Deleted.
600         (WebCore::ClipRect::isEmpty): Deleted.
601         (WebCore::ClipRect::intersects): Deleted.
602         (WebCore::ClipRect::inflateX): Deleted.
603         (WebCore::ClipRect::inflateY): Deleted.
604         (WebCore::ClipRect::inflate): Deleted.
605         (WebCore::intersection): Deleted.
606         (WebCore::LayerFragment::LayerFragment): Deleted.
607         (WebCore::LayerFragment::setRects): Deleted.
608         (WebCore::LayerFragment::moveBy): Deleted.
609         (WebCore::LayerFragment::intersect): Deleted.
610         * rendering/RenderMultiColumnSet.h:
611         * rendering/RenderRegion.h:
612         * rendering/RenderTreeAsText.cpp:
613
614 2015-01-14  Commit Queue  <commit-queue@webkit.org>
615
616         Unreviewed, rolling out r178438.
617         https://bugs.webkit.org/show_bug.cgi?id=140484
618
619         Broke a few MediaSource tests (Requested by JoePeck on
620         #webkit).
621
622         Reverted changeset:
623
624         "[MSE] Implement per TrackBuffer buffered."
625         https://bugs.webkit.org/show_bug.cgi?id=139813
626         http://trac.webkit.org/changeset/178438
627
628 2015-01-14  Enrica Casucci  <enrica@apple.com>
629
630         REGRESSION (r165385): Crash when applying autocorrection exceeds maximum text area length.
631         https://bugs.webkit.org/show_bug.cgi?id=137902
632         rdar://problem/18568864
633
634         Reviewed by Darin Adler.
635
636         Test: editing/text-iterator/invalid-subrange.html
637
638         characterSubrange should check the iterator position after each advance.
639         This changed adds a new method to the Internals object to be able to test this.
640
641         * editing/TextIterator.cpp:
642         (WebCore::characterSubrange):
643         (WebCore::TextIterator::subrange):
644         (WebCore::findPlainText):
645         * testing/Internals.cpp:
646         (WebCore::Internals::subrange):
647         * testing/Internals.h:
648         * testing/Internals.idl:
649
650 2015-01-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
651
652         REGRESSION (r154769): Wrong <title> taken as a tooltip for SVG element.
653         https://bugs.webkit.org/show_bug.cgi?id=139690.
654
655         Reviewed by Daniel Bates.
656
657         Before r154769, we were calling Traversal<SVGTitleElement>::firstWithin(), which returns
658         the first immediate SVGTitleElement child. In r154769, Traversal<SVGTitleElement>::firstWithin()
659         was replaced by descendantsOfType<SVGTitleElement> which returns all descendants SVGTitleElements.
660         Then we were returning the first element of these descendants, which may not be an immediate
661         child of the element, as the title of the SVGElement. This was the reason of this bug. The
662         fix is to use childrenOfType<SVGTitleElement>() instead, which returns the immediate SVGTitleElement
663         children of an SVGElement.
664
665         Also we were not following exactly the specs for the rootmost SVG element's title value.
666         According to the W3C specs, for stand-alone SVG documents only, the rootmost SVG element
667         should not return a title. But we were not returning a title for the rootmost SVG element
668         always. The fix is to return a empty title for the rootmost SVG element only if topDocument()
669         of the element isSVGDocument().
670         
671         NOTE: The main SVG specs http://www.w3.org/TR/SVG/interact.html#hit-testing (W3C Recommendation
672         16 August 2011) and http://www.w3.org/TR/SVG/struct.html#DescriptionAndTitleElements (W3C
673         Recommendation 16 August 2011) do not say how the tooltip of an SVG element is calculated. But
674         the SVG tiny specs http://www.w3.org/TR/SVGTiny12/struct.html#uiTitleDescBehavior (W3C
675         Recommendation 22 December 2008) however explains well the tooltip calculation for the embedded
676         and the stand-alone SVG cases. And it seems this what we should rely on.
677
678         Test: svg/hittest/svg-standalone-tooltip.svg
679               svg/hittest/svg-embedded-tooltip.html
680
681         * WebCore.exp.in:
682         * rendering/HitTestResult.h:
683         Make HitTestResult::setInnerNode be WEBCORE_EXPORT
684         
685         * svg/SVGElement.cpp:
686         (WebCore::SVGElement::title):
687         Replace descendantsOfType<SVGTitleElement>() by childrenOfType<SVGTitleElement>().
688         Fix the title value of the rootmost SVG element.
689         
690         * testing/Internals.cpp:
691         (WebCore::Internals::toolTipFromElement):
692         * testing/Internals.h:
693         * testing/Internals.idl:
694         Add a new internal function toolTipFromElement() which returns the tooltip text for a
695         given element.
696
697 2015-01-14  Csaba Osztrogonác  <ossy@webkit.org>
698
699         Buildfix after r178434
700         https://bugs.webkit.org/show_bug.cgi?id=140467
701
702         Reviewed by Chris Dumez.
703
704         * css/StyleBuilderConverter.h:
705         (WebCore::StyleBuilderConverter::convertPerspective):
706
707 2015-01-14  Benjamin Poulain  <bpoulain@apple.com>
708
709         Build fix for NFAToDFA on ARM
710
711         * contentextensions/NFAToDFA.cpp:
712         (WebCore::ContentExtensions::UniqueNodeIdSet::UniqueNodeIdSet):
713         (WebCore::ContentExtensions::UniqueNodeIdSet::isDeletedValue):
714
715 2015-01-14  Bartlomiej Gajda  <b.gajda@samsung.com>
716
717         [MSE] Implement per TrackBuffer buffered.
718         https://bugs.webkit.org/show_bug.cgi?id=139813.
719
720         Reviewed by Jer Noble.
721
722         Added implementation of SourceBuffer buffered() algorithm as per specification,
723         and caching mechanism called when samples are added, removed, or MediaSource
724         readyState is changed.
725
726         Tests: media/media-source/media-source-multiple-trackBuffers-buffered-in-ended-state.html
727                media/media-source/media-source-multiple-trackBuffers-buffered.html
728
729         * Modules/mediasource/MediaSource.cpp:
730         (WebCore::MediaSource::setReadyState):
731         * Modules/mediasource/SourceBuffer.cpp:
732         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
733         (WebCore::SourceBuffer::SourceBuffer):
734         (WebCore::SourceBuffer::buffered):
735         (WebCore::SourceBuffer::invalidateBuffered):
736         (WebCore::SourceBuffer::recalculateBuffered):
737         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
738         (WebCore::SourceBuffer::removeCodedFrames):
739         (WebCore::SourceBuffer::evictCodedFrames):
740         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
741         (WebCore::SourceBuffer::bufferedAccountingForEndOfStream):
742         (WebCore::SourceBuffer::hasCurrentTime):
743         * Modules/mediasource/SourceBuffer.h:
744
745 2015-01-14  Benjamin Poulain  <benjamin@webkit.org>
746
747         Do not create new set for every sub-operation when converting a NFA to DFA
748         https://bugs.webkit.org/show_bug.cgi?id=140380
749
750         Reviewed by Andreas Kling.
751
752         This is the first step toward making the NFA-to-DFA conversion more scalable: instead
753         of creating new sets for each step of the algorithm, we use two kinds of sets
754         and never do any copy.
755
756         The first new tool to do that is UniqueNodeIdSetImpl. It represents a set of NFA state corresponding to a DFA
757         state. It is unique per DFA state.
758
759         HashableNodeIdSet is a helper tool storing a UniqueNodeIdSetImpl.
760
761         The creation of new sets now goes like this:
762         1) Get a NodeIdSet for each possible transition.
763         2) For each transition:
764            2a) Extend the NodeIdSet in place with its epsilon closure.
765            2b) Get the UniqueNodeIdSetImpl corresponding to the new set we discovered.
766            2c) If the UniqueNodeIdSetImpl is new, queue it for processing.
767
768         * WebCore.xcodeproj/project.pbxproj:
769         * contentextensions/ContentExtensionsDebugging.h: Copied from Source/WebCore/contentextensions/DFANode.h.
770         * contentextensions/ContentExtensionsBackend.cpp:
771         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
772         * contentextensions/ContentExtensionsManager.cpp:
773         (WebCore::ContentExtensions::ExtensionsManager::loadExtension):
774         Added some logging to inspect more easily what the clients are sending.
775
776         * contentextensions/DFA.cpp:
777         * contentextensions/DFA.h:
778         * contentextensions/DFANode.h:
779         * contentextensions/NFA.cpp:
780         * contentextensions/NFA.h:
781         * contentextensions/NFAToDFA.cpp:
782
783         (WebCore::ContentExtensions::epsilonClosure):
784         Instead of returning a new HashSet, extend the input HashSet.
785
786         (WebCore::ContentExtensions::UniqueNodeIdSetImpl::buffer):
787         (WebCore::ContentExtensions::UniqueNodeIdSet::UniqueNodeIdSet):
788         (WebCore::ContentExtensions::UniqueNodeIdSet::operator=):
789         (WebCore::ContentExtensions::UniqueNodeIdSet::~UniqueNodeIdSet):
790         (WebCore::ContentExtensions::UniqueNodeIdSet::operator==):
791         (WebCore::ContentExtensions::UniqueNodeIdSet::impl):
792         (WebCore::ContentExtensions::UniqueNodeIdSet::hash):
793         (WebCore::ContentExtensions::UniqueNodeIdSet::isEmptyValue):
794         (WebCore::ContentExtensions::UniqueNodeIdSet::isDeletedValue):
795         (WebCore::ContentExtensions::UniqueNodeIdSetHash::hash):
796         (WebCore::ContentExtensions::UniqueNodeIdSetHash::equal):
797         UniqueNodeIdSetImpl is a compact representation of a NodeIdSet corresponding to a DFA node.
798
799         It is never built directly, it is only built on demand through NodeIdSetToUniqueNodeIdSetTranslator
800         from a NodeIdSet.
801
802         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
803         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::hash):
804         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::equal):
805         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
806         (WebCore::ContentExtensions::SetTransitionsExcludingEpsilon::operator[]):
807         (WebCore::ContentExtensions::SetTransitionsExcludingEpsilon::size):
808         (WebCore::ContentExtensions::SetTransitionsExcludingEpsilon::begin):
809         (WebCore::ContentExtensions::SetTransitionsExcludingEpsilon::end):
810         (WebCore::ContentExtensions::populateTransitionsExcludingEpsilon):
811         (WebCore::ContentExtensions::NFAToDFA::convert):
812         (WebCore::ContentExtensions::setTransitionsExcludingEpsilon): Deleted.
813         (WebCore::ContentExtensions::HashableNodeIdSet::HashableNodeIdSet): Deleted.
814         (WebCore::ContentExtensions::HashableNodeIdSet::operator=): Deleted.
815         (WebCore::ContentExtensions::HashableNodeIdSet::isEmptyValue): Deleted.
816         (WebCore::ContentExtensions::HashableNodeIdSet::isDeletedValue): Deleted.
817         (WebCore::ContentExtensions::HashableNodeIdSet::nodeIdSet): Deleted.
818         (WebCore::ContentExtensions::HashableNodeIdSetHash::hash): Deleted.
819         (WebCore::ContentExtensions::HashableNodeIdSetHash::equal): Deleted.
820         (WebCore::ContentExtensions::addDFAState): Deleted.
821
822 2015-01-14  Chris Dumez  <cdumez@apple.com>
823
824         Make 'TypeName' parameter unnecessary in CSSPropertyNames.in
825         https://bugs.webkit.org/show_bug.cgi?id=140347
826
827         Reviewed by Darin Adler.
828
829         Make 'TypeName' parameter unnecessary in CSSPropertyNames.in by:
830         - Removing the static_cast to the destination type in the generated
831           StyleBuilder code and let compiler implicitly convert the
832           CSSPrimitiveValue to the setter's argument type.
833         - Updating conditional converters to return a WTF::Optional<>
834           instead of returning a boolean and having an output argument
835           passed by reference. This way, we can use "auto" in the generated
836           StyleBuilder code to deduce the return type.
837
838         * css/CSSPropertyNames.in:
839         Drop TypeName parameter from all properties as it is no longer needed.
840
841         * css/StyleBuilderConverter.h:
842         (WebCore::StyleBuilderConverter::convertGridTrackSize):
843         (WebCore::StyleBuilderConverter::convertGridPosition):
844         (WebCore::StyleBuilderConverter::convertWordSpacing):
845         (WebCore::StyleBuilderConverter::convertPerspective):
846         (WebCore::StyleBuilderConverter::convertMarqueeIncrement):
847         (WebCore::StyleBuilderConverter::convertFilterOperations):
848         (WebCore::StyleBuilderConverter::convertMaskImageOperations):
849         Update conditional converters to return an Optional<>.
850
851         * css/makeprop.pl:
852         (generateValueSetter):
853         Drop support for TypeName, stop using static_cast to destination
854         type and update the generated code now that the conditional
855         converters return an Optional.
856
857         * platform/efl/RenderThemeEfl.cpp:
858         (WebCore::RenderThemeEfl::systemFont):
859         * platform/graphics/Font.cpp:
860         (WebCore::Font::Font):
861         * platform/graphics/FontDescription.h:
862         (WebCore::FontDescription::setIsItalic):
863         (WebCore::FontDescription::setIsSmallCaps):
864         (WebCore::FontDescription::setItalic): Deleted.
865         (WebCore::FontDescription::setSmallCaps): Deleted.
866         * rendering/RenderThemeGtk.cpp:
867         (WebCore::RenderThemeGtk::systemFont):
868         * rendering/RenderThemeIOS.mm:
869         (WebCore::RenderThemeIOS::systemFont):
870         * rendering/RenderThemeMac.mm:
871         (WebCore::RenderThemeMac::systemFont):
872         * rendering/RenderThemeSafari.cpp:
873         (WebCore::RenderThemeSafari::systemFont):
874         * rendering/RenderThemeWin.cpp:
875         (WebCore::fillFontDescription):
876         * rendering/mathml/RenderMathMLToken.cpp:
877         (WebCore::RenderMathMLToken::updateStyle):
878         Now that we call the RenderStyle setters with a CSSPrimitiveValue
879         and let it be implicitly converted to the right type, instead of
880         doing an explicit static_cast, two setters on FontDescription
881         were ambiguous: setItalic() / setSmallCaps(). Rename the overloads
882         taking a boolean in argument to setIsItalic() / setIsSmallCaps()
883         to resolve the ambiguity.
884
885 2015-01-14  Jer Noble  <jer.noble@apple.com>
886
887         Null-deref crash when seeking immediately before looping.
888         https://bugs.webkit.org/show_bug.cgi?id=140394
889
890         Reviewed by Eric Carlson.
891
892         It is possible for finishSeek() to be called when a seek() has caused a pending seek task
893         to be scheduled, but before that pending seek task is run. In this case, if a seek request
894         is issued, the existing pending seek task will not be cancelled, which will cause a crash
895         when the pending seek task is run.
896
897         When checking whether an existing seek task needs to be cancelled, check the actual timer,
898         rather than the m_seeking boolean, so that this case is covered.
899
900         Test: media/video-ended-seek-crash.html
901
902         * html/HTMLMediaElement.cpp:
903         (WebCore::HTMLMediaElement::seekWithTolerance):
904
905 2015-01-14  Brent Fulgham  <bfulgham@apple.com>
906
907         [Win] Layout Test fast/css/crash-on-custom-cursor-when-loading.html is failing
908         https://bugs.webkit.org/show_bug.cgi?id=140425
909
910         Reviewed by Anders Carlsson.
911
912         * platform/win/CursorWin.cpp:
913         (WebCore::createSharedCursor): Return nullptr when operating system
914         cannot support the requested icon specification.
915         (WebCore::Cursor::ensurePlatformCursor): Check for 'createSharedCursor'
916         returning nullptr, and fall back to the default icon construction.
917
918 2015-01-14  Carlos Garcia Campos  <cgarcia@igalia.com>
919
920         REGRESSION(r178367): [GStreamer] Several media tests time out after r178367
921         https://bugs.webkit.org/show_bug.cgi?id=140437
922
923         Reviewed by Philippe Normand.
924
925         Add implementation for MediaPlayerPrivate::rate() to GStreamer
926         media backend.
927
928         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
929         (WebCore::MediaPlayerPrivateGStreamer::rate):
930         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
931
932 2015-01-13  Commit Queue  <commit-queue@webkit.org>
933
934         Unreviewed, rolling out r178390, r178392, r178398, r178400,
935         r178402, and r178410.
936         https://bugs.webkit.org/show_bug.cgi?id=140431
937
938         Way too many failures to skip (Requested by ap_ on #webkit).
939
940         Reverted changesets:
941
942         "WebGL2: Support webgl2 context creation."
943         https://bugs.webkit.org/show_bug.cgi?id=126408
944         http://trac.webkit.org/changeset/178390
945
946         "Unreviewed iOS build fix after r178390."
947         http://trac.webkit.org/changeset/178392
948
949         "[Unreviewed] Windows build fix after r178390."
950         http://trac.webkit.org/changeset/178398
951
952         "[Unreviewed] Speculative test fix after r178390."
953         http://trac.webkit.org/changeset/178400
954
955         "[Unreviewed] Skip webgl tests for temporarily."
956         https://bugs.webkit.org/show_bug.cgi?id=140423
957         http://trac.webkit.org/changeset/178402
958
959         "[EFL] Fix build after r178390"
960         https://bugs.webkit.org/show_bug.cgi?id=140424
961         http://trac.webkit.org/changeset/178410
962
963 2015-01-13  Hunseop Jeong  <hs85.jeong@samsung.com>
964
965         [EFL] Fix build after r178390 
966         https://bugs.webkit.org/show_bug.cgi?id=140424
967
968         Reviewed by Csaba Osztrogonác.
969
970         * CMakeLists.txt: 
971
972 2015-01-13  Zalan Bujtas  <zalan@apple.com>
973
974         Simple line layout: Refactor TextFragment class.
975         https://bugs.webkit.org/show_bug.cgi?id=140417
976
977         Reviewed by Andreas Kling.
978
979         Introduce text fragment type and use class member initializers.
980
981         No change in functionality.
982
983         * rendering/SimpleLineLayout.cpp:
984         (WebCore::SimpleLineLayout::TextFragment::TextFragment):
985         (WebCore::SimpleLineLayout::LineState::addUncommitted):
986         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
987         (WebCore::SimpleLineLayout::nextFragment):
988         (WebCore::SimpleLineLayout::createLineRuns):
989
990 2015-01-13  Commit Queue  <commit-queue@webkit.org>
991
992         Unreviewed, rolling out r178400.
993         https://bugs.webkit.org/show_bug.cgi?id=140422
994
995         Test fix breaks build (Requested by rfong on #webkit).
996
997         Reverted changeset:
998
999         "[Unreviewed] Speculative test fix after r178390."
1000         http://trac.webkit.org/changeset/178400
1001
1002 2015-01-13  Roger Fong  <roger_fong@apple.com>
1003
1004         [Unreviewed] Speculative test fix after r178390.
1005
1006         * html/canvas/WebGL1RenderingContext.idl:
1007
1008 2015-01-13  Roger Fong  <roger_fong@apple.com>
1009
1010         [Unreviewed] Windows build fix after r178390.
1011
1012         * DerivedSources.cpp:
1013         * WebCore.vcxproj/WebCore.vcxproj:
1014         * WebCore.vcxproj/WebCore.vcxproj.filters:
1015         * bindings/js/JSBindingsAllInOne.cpp:
1016         * html/canvas/WebGLRenderingContextBase.cpp:
1017         (WebCore::WebGLRenderingContextBase::create):
1018
1019 2015-01-13  Joseph Pecoraro  <pecoraro@apple.com>
1020
1021         NSButtonCell leak allocated under WebCore::paintToggleButton
1022         https://bugs.webkit.org/show_bug.cgi?id=137014
1023
1024         Reviewed by Alexey Proskuryakov.
1025
1026         * platform/mac/ThemeMac.mm:
1027         (WebCore::createToggleButtonCell):
1028         Immediately adopt the NSButtonCell allocation.
1029
1030         (WebCore::sharedRadioCell):
1031         (WebCore::sharedCheckboxCell):
1032         Move from the RetainPtr into the static variable.
1033
1034         (WebCore::paintToggleButton):
1035         Use RetainPtr logic to better manage lifetimes.
1036
1037 2015-01-13  Zalan Bujtas  <zalan@apple.com>
1038
1039         Simple line layout: Refactor SimpleLineLayout::nextFragment().
1040         https://bugs.webkit.org/show_bug.cgi?id=140407
1041
1042         Reviewed by Andreas Kling.
1043
1044         Simplify the code by using content specific branches with early returns.
1045
1046         No change in functionality.
1047
1048         * rendering/SimpleLineLayout.cpp:
1049         (WebCore::SimpleLineLayout::nextFragment):
1050
1051 2015-01-13  Chris Dumez  <cdumez@apple.com>
1052
1053         Unreviewed iOS build fix after r178390.
1054
1055         * html/canvas/CanvasRenderingContext2D.cpp:
1056         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
1057         m_type is undeclared.
1058
1059         * html/canvas/WebGLContextGroup.h:
1060         Fix bad include.
1061
1062 2015-01-13  Roger Fong  <roger_fong@apple.com>
1063
1064         WebGL2: Support webgl2 context creation.
1065         https://bugs.webkit.org/show_bug.cgi?id=126408
1066         <rdar://problem/15002170>
1067
1068         Reviewed by Dean Jackson.
1069
1070         Tests covered by existing Khronos tests for WebGL 1.0 conformance.
1071
1072         Create a WebGLRenderingContextBase class that extends to a WebGL1RenderingContext and WebGL2RenderingContext.
1073         Replace all previous instances of WebGLRenderingContext usages with WebGLRenderingContextBase usages for now.
1074         As the first step, the WebGL1 and WebGL2 contexts will have the exact same functionality.
1075
1076         * CMakeLists.txt:
1077         * DerivedSources.make:
1078         * WebCore.xcodeproj/project.pbxproj:
1079         * bindings/js/JSCanvasRenderingContextCustom.cpp:
1080         (WebCore::toJS):
1081         * bindings/js/JSDocumentCustom.cpp:
1082         * bindings/js/JSHTMLCanvasElementCustom.cpp:
1083         * bindings/js/JSWebGL1RenderingContextCustom.cpp: Copied from Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp.
1084         * bindings/js/JSWebGL2RenderingContextCustom.cpp: Added.
1085         (WebCore::JSWebGL2RenderingContext::visitAdditionalChildren):
1086         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp: Added.
1087         * bindings/js/JSWebGLRenderingContextCustom.cpp: Removed.
1088         * bindings/scripts/CodeGeneratorJS.pm:
1089         (GenerateImplementation):
1090         * html/HTMLCanvasElement.cpp:
1091         (WebCore::HTMLCanvasElement::getContext):
1092         (WebCore::HTMLCanvasElement::is3dType):
1093         (WebCore::HTMLCanvasElement::reset):
1094         (WebCore::HTMLCanvasElement::paint):
1095         (WebCore::HTMLCanvasElement::getImageData):
1096         * html/canvas/ANGLEInstancedArrays.cpp:
1097         (WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays):
1098         (WebCore::ANGLEInstancedArrays::supported):
1099         * html/canvas/ANGLEInstancedArrays.h:
1100         * html/canvas/CanvasRenderingContext.h:
1101         (WebCore::CanvasRenderingContext::type):
1102         * html/canvas/CanvasRenderingContext2D.cpp:
1103         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
1104         * html/canvas/EXTBlendMinMax.cpp:
1105         (WebCore::EXTBlendMinMax::EXTBlendMinMax):
1106         * html/canvas/EXTBlendMinMax.h:
1107         * html/canvas/EXTFragDepth.cpp:
1108         (WebCore::EXTFragDepth::EXTFragDepth):
1109         * html/canvas/EXTFragDepth.h:
1110         * html/canvas/EXTShaderTextureLOD.cpp:
1111         (WebCore::EXTShaderTextureLOD::EXTShaderTextureLOD):
1112         * html/canvas/EXTShaderTextureLOD.h:
1113         * html/canvas/EXTTextureFilterAnisotropic.cpp:
1114         (WebCore::EXTTextureFilterAnisotropic::EXTTextureFilterAnisotropic):
1115         * html/canvas/EXTTextureFilterAnisotropic.h:
1116         * html/canvas/EXTsRGB.cpp:
1117         (WebCore::EXTsRGB::EXTsRGB):
1118         * html/canvas/EXTsRGB.h:
1119         * html/canvas/OESElementIndexUint.cpp:
1120         (WebCore::OESElementIndexUint::OESElementIndexUint):
1121         * html/canvas/OESElementIndexUint.h:
1122         * html/canvas/OESStandardDerivatives.cpp:
1123         (WebCore::OESStandardDerivatives::OESStandardDerivatives):
1124         * html/canvas/OESStandardDerivatives.h:
1125         * html/canvas/OESTextureFloat.cpp:
1126         (WebCore::OESTextureFloat::OESTextureFloat):
1127         * html/canvas/OESTextureFloat.h:
1128         * html/canvas/OESTextureFloatLinear.cpp:
1129         (WebCore::OESTextureFloatLinear::OESTextureFloatLinear):
1130         * html/canvas/OESTextureFloatLinear.h:
1131         * html/canvas/OESTextureHalfFloat.cpp:
1132         (WebCore::OESTextureHalfFloat::OESTextureHalfFloat):
1133         * html/canvas/OESTextureHalfFloat.h:
1134         * html/canvas/OESTextureHalfFloatLinear.cpp:
1135         (WebCore::OESTextureHalfFloatLinear::OESTextureHalfFloatLinear):
1136         * html/canvas/OESTextureHalfFloatLinear.h:
1137         * html/canvas/OESVertexArrayObject.cpp:
1138         (WebCore::OESVertexArrayObject::OESVertexArrayObject):
1139         * html/canvas/OESVertexArrayObject.h:
1140         * html/canvas/WebGL1RenderingContext.cpp: Copied from Source/WebCore/html/canvas/WebGLRenderingContext.cpp.
1141         * html/canvas/WebGL1RenderingContext.h: Copied from Source/WebCore/html/canvas/WebGLRenderingContext.h.
1142         * html/canvas/WebGL1RenderingContext.idl: Copied from Source/WebCore/html/canvas/WebGLRenderingContext.idl.
1143         * html/canvas/WebGL2RenderingContext.cpp: Added.
1144         (WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
1145         * html/canvas/WebGL2RenderingContext.h: Added.
1146         * html/canvas/WebGL2RenderingContext.idl: Added.
1147         * html/canvas/WebGLBuffer.cpp:
1148         (WebCore::WebGLBuffer::create):
1149         (WebCore::WebGLBuffer::WebGLBuffer):
1150         * html/canvas/WebGLBuffer.h:
1151         * html/canvas/WebGLCompressedTextureATC.cpp:
1152         (WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC):
1153         (WebCore::WebGLCompressedTextureATC::supported):
1154         * html/canvas/WebGLCompressedTextureATC.h:
1155         * html/canvas/WebGLCompressedTexturePVRTC.cpp:
1156         (WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC):
1157         (WebCore::WebGLCompressedTexturePVRTC::supported):
1158         * html/canvas/WebGLCompressedTexturePVRTC.h:
1159         * html/canvas/WebGLCompressedTextureS3TC.cpp:
1160         (WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC):
1161         (WebCore::WebGLCompressedTextureS3TC::supported):
1162         * html/canvas/WebGLCompressedTextureS3TC.h:
1163         * html/canvas/WebGLContextGroup.cpp:
1164         (WebCore::WebGLContextGroup::getAGraphicsContext3D):
1165         (WebCore::WebGLContextGroup::addContext):
1166         (WebCore::WebGLContextGroup::removeContext):
1167         (WebCore::WebGLContextGroup::loseContextGroup):
1168         * html/canvas/WebGLContextGroup.h:
1169         * html/canvas/WebGLContextObject.cpp:
1170         (WebCore::WebGLContextObject::WebGLContextObject):
1171         * html/canvas/WebGLContextObject.h:
1172         (WebCore::WebGLContextObject::context):
1173         * html/canvas/WebGLDebugRendererInfo.cpp:
1174         (WebCore::WebGLDebugRendererInfo::WebGLDebugRendererInfo):
1175         * html/canvas/WebGLDebugRendererInfo.h:
1176         * html/canvas/WebGLDebugShaders.cpp:
1177         (WebCore::WebGLDebugShaders::WebGLDebugShaders):
1178         * html/canvas/WebGLDebugShaders.h:
1179         * html/canvas/WebGLDepthTexture.cpp:
1180         (WebCore::WebGLDepthTexture::WebGLDepthTexture):
1181         * html/canvas/WebGLDepthTexture.h:
1182         * html/canvas/WebGLDrawBuffers.cpp:
1183         (WebCore::WebGLDrawBuffers::WebGLDrawBuffers):
1184         (WebCore::WebGLDrawBuffers::supported):
1185         (WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
1186         * html/canvas/WebGLDrawBuffers.h:
1187         * html/canvas/WebGLExtension.cpp:
1188         (WebCore::WebGLExtension::WebGLExtension):
1189         * html/canvas/WebGLExtension.h:
1190         (WebCore::WebGLExtension::context):
1191         * html/canvas/WebGLFramebuffer.cpp:
1192         (WebCore::WebGLFramebuffer::create):
1193         (WebCore::WebGLFramebuffer::WebGLFramebuffer):
1194         * html/canvas/WebGLFramebuffer.h:
1195         * html/canvas/WebGLLoseContext.cpp:
1196         (WebCore::WebGLLoseContext::WebGLLoseContext):
1197         (WebCore::WebGLLoseContext::loseContext):
1198         * html/canvas/WebGLLoseContext.h:
1199         * html/canvas/WebGLObject.cpp:
1200         (WebCore::WebGLObject::WebGLObject):
1201         * html/canvas/WebGLObject.h:
1202         * html/canvas/WebGLProgram.cpp:
1203         (WebCore::WebGLProgram::create):
1204         (WebCore::WebGLProgram::WebGLProgram):
1205         * html/canvas/WebGLProgram.h:
1206         * html/canvas/WebGLRenderbuffer.cpp:
1207         (WebCore::WebGLRenderbuffer::create):
1208         (WebCore::WebGLRenderbuffer::WebGLRenderbuffer):
1209         * html/canvas/WebGLRenderbuffer.h:
1210         * html/canvas/WebGLRenderingContext.cpp: Removed.
1211         * html/canvas/WebGLRenderingContext.h: Removed.
1212         * html/canvas/WebGLRenderingContext.idl: Removed.
1213         * html/canvas/WebGLRenderingContextBase.cpp: Added.
1214         * html/canvas/WebGLRenderingContextBase.h: Added.
1215         * html/canvas/WebGLRenderingContextBase.idl: Added.
1216         * html/canvas/WebGLShader.cpp:
1217         (WebCore::WebGLShader::create):
1218         (WebCore::WebGLShader::WebGLShader):
1219         * html/canvas/WebGLShader.h:
1220         * html/canvas/WebGLSharedObject.cpp:
1221         (WebCore::WebGLSharedObject::WebGLSharedObject):
1222         * html/canvas/WebGLSharedObject.h:
1223         * html/canvas/WebGLTexture.cpp:
1224         (WebCore::WebGLTexture::create):
1225         (WebCore::WebGLTexture::WebGLTexture):
1226         * html/canvas/WebGLTexture.h:
1227         * html/canvas/WebGLVertexArrayObjectOES.cpp:
1228         (WebCore::WebGLVertexArrayObjectOES::create):
1229         (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
1230         * html/canvas/WebGLVertexArrayObjectOES.h:
1231
1232 2015-01-13  Chris Dumez  <cdumez@apple.com>
1233
1234         Unreviewed, fix Mac build after r178388
1235
1236         FontRanges::isEmpty() -> FontRanges::isNull().
1237
1238         * platform/graphics/mac/FontComplexTextMac.cpp:
1239         (WebCore::Font::fontDataForCombiningCharacterSequence):
1240
1241 2015-01-13  Antti Koivisto  <antti@apple.com>
1242
1243         Devirtualize FontData
1244         https://bugs.webkit.org/show_bug.cgi?id=140390
1245
1246         Reviewed by Andreas Kling.
1247
1248         This patch removes the FontData base class and turns SegmentedFontData into a non-virtual FontRanges type.
1249
1250         SimpleFontData remains as is (without the base) and it can be renamed later to something more sensible.
1251
1252         * WebCore.exp.in:
1253         * WebCore.xcodeproj/project.pbxproj:
1254         * css/CSSFontSelector.cpp:
1255         (WebCore::CSSFontSelector::fontRangesForFamily):
1256         (WebCore::CSSFontSelector::fallbackFontDataAt):
1257         (WebCore::CSSFontSelector::getFontData): Deleted.
1258         (WebCore::CSSFontSelector::getFallbackFontData): Deleted.
1259         * css/CSSFontSelector.h:
1260         * css/CSSSegmentedFontFace.cpp:
1261         (WebCore::CSSSegmentedFontFace::pruneTable):
1262         (WebCore::appendFontDataWithInvalidUnicodeRangeIfLoading):
1263         (WebCore::CSSSegmentedFontFace::fontRanges):
1264         (WebCore::CSSSegmentedFontFace::loadFont):
1265         (WebCore::CSSSegmentedFontFace::getFontData): Deleted.
1266         * css/CSSSegmentedFontFace.h:
1267         * platform/graphics/Font.h:
1268         (WebCore::Font::fallbackRangesAt):
1269         (WebCore::Font::fontDataAt): Deleted.
1270         * platform/graphics/FontData.cpp: Removed.
1271         * platform/graphics/FontData.h: Removed.
1272         * platform/graphics/FontGlyphs.cpp:
1273         (WebCore::FontGlyphs::FontGlyphs):
1274         (WebCore::FontGlyphs::determinePitch):
1275         (WebCore::FontGlyphs::isLoadingCustomFonts):
1276         (WebCore::realizeNextFallback):
1277         (WebCore::FontGlyphs::realizeFallbackRangesAt):
1278         (WebCore::FontGlyphs::glyphDataForSystemFallback):
1279         (WebCore::FontGlyphs::glyphDataForVariant):
1280         (WebCore::FontGlyphs::glyphDataForNormalVariant):
1281         (WebCore::glyphPageFromFontRanges):
1282         (WebCore::FontGlyphs::glyphDataForCharacter):
1283         (WebCore::realizeNextFamily): Deleted.
1284         (WebCore::FontGlyphs::realizeFontDataAt): Deleted.
1285         (WebCore::glyphPageFromFontData): Deleted.
1286         * platform/graphics/FontGlyphs.h:
1287         (WebCore::FontGlyphs::primarySimpleFontData):
1288         * platform/graphics/FontRanges.cpp: Copied from Source/WebCore/platform/graphics/SegmentedFontData.cpp.
1289         (WebCore::FontRanges::FontRanges):
1290         (WebCore::FontRanges::~FontRanges):
1291         (WebCore::FontRanges::fontDataForCharacter):
1292         (WebCore::FontRanges::fontDataForFirstRange):
1293         (WebCore::FontRanges::isLoading):
1294         (WebCore::SegmentedFontData::SegmentedFontData): Deleted.
1295         (WebCore::SegmentedFontData::~SegmentedFontData): Deleted.
1296         (WebCore::SegmentedFontData::simpleFontDataForCharacter): Deleted.
1297         (WebCore::SegmentedFontData::simpleFontDataForFirstRange): Deleted.
1298         (WebCore::SegmentedFontData::isCustomFont): Deleted.
1299         (WebCore::SegmentedFontData::isLoading): Deleted.
1300         (WebCore::SegmentedFontData::isSegmented): Deleted.
1301         (WebCore::SegmentedFontData::description): Deleted.
1302         * platform/graphics/FontRanges.h: Copied from Source/WebCore/platform/graphics/SegmentedFontData.h.
1303         (WebCore::FontRanges::Range::Range):
1304         (WebCore::FontRanges::Range::from):
1305         (WebCore::FontRanges::Range::to):
1306         (WebCore::FontRanges::Range::fontData):
1307         (WebCore::FontRanges::isEmpty):
1308         (WebCore::FontRanges::appendRange):
1309         (WebCore::FontRanges::size):
1310         (WebCore::FontRanges::rangeAt):
1311         (WebCore::FontDataRange::FontDataRange): Deleted.
1312         (WebCore::FontDataRange::from): Deleted.
1313         (WebCore::FontDataRange::to): Deleted.
1314         (WebCore::FontDataRange::fontData): Deleted.
1315         (WebCore::SegmentedFontData::create): Deleted.
1316         (WebCore::SegmentedFontData::appendRange): Deleted.
1317         (WebCore::SegmentedFontData::numRanges): Deleted.
1318         (WebCore::SegmentedFontData::rangeAt): Deleted.
1319         (isType): Deleted.
1320         * platform/graphics/FontSelector.h:
1321         * platform/graphics/SegmentedFontData.cpp: Removed.
1322         * platform/graphics/SegmentedFontData.h: Removed.
1323         * platform/graphics/SimpleFontData.cpp:
1324         (WebCore::SimpleFontData::simpleFontDataForCharacter): Deleted.
1325         (WebCore::SimpleFontData::simpleFontDataForFirstRange): Deleted.
1326         (WebCore::SimpleFontData::isSegmented): Deleted.
1327         * platform/graphics/SimpleFontData.h:
1328         (WebCore::SimpleFontData::isCustomFont):
1329         (WebCore::SimpleFontData::isLoading):
1330         (isType): Deleted.
1331         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1332         (-[WebCascadeList initWithFont:character:]):
1333         (-[WebCascadeList objectAtIndex:]):
1334         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1335         * platform/graphics/mac/FontComplexTextMac.cpp:
1336         (WebCore::Font::fontDataForCombiningCharacterSequence):
1337
1338 2015-01-13  Dean Jackson  <dino@apple.com>
1339
1340         Filters aren't applied to elements in columns after the first
1341         https://bugs.webkit.org/show_bug.cgi?id=140331
1342
1343         Reviewed by Simon Fraser.
1344
1345         The important bits of this change came from Simon.
1346
1347         Filters and clipping were not taking columns into
1348         account when using their offset rectangles. The fix
1349         is to recalculate the rects if you're in such a
1350         situation.
1351
1352         Tests: fast/multicol/clip-in-columns.html
1353                fast/multicol/filter-in-columns.html
1354
1355         * rendering/RenderLayer.cpp:
1356         (WebCore::RenderLayer::hasFilterThatIsPainting): New method used
1357         to check if we're about to paint a filter.
1358         (WebCore::RenderLayer::setupFilters): Use the new helper if possible.
1359         (WebCore::RenderLayer::paintLayerContents): If we're in columns,
1360         and we either have a clip or a filter, recalculate the offset rectangles.
1361         * rendering/RenderLayer.h:
1362
1363 2015-01-13  Beth Dakin  <bdakin@apple.com>
1364
1365         Should disable immediate actions for iTunes
1366         https://bugs.webkit.org/show_bug.cgi?id=140405
1367         -and corresponding-
1368         rdar://problem/19461358
1369
1370         Reviewed by Tim Horton.
1371
1372         * WebCore.exp.in:
1373
1374 2015-01-13  Anders Carlsson  <andersca@apple.com>
1375
1376         Remove pure virtual functions from DatabaseBackendBase
1377         https://bugs.webkit.org/show_bug.cgi?id=140402
1378
1379         Reviewed by Sam Weinig.
1380
1381         Also change DatabaseBackendBase to Database in a couple of places.
1382
1383         * Modules/webdatabase/DatabaseBackendBase.cpp:
1384         (WebCore::DatabaseBackendBase::closeDatabase):
1385         (WebCore::DoneCreatingDatabaseOnExitCaller::~DoneCreatingDatabaseOnExitCaller):
1386         (WebCore::DatabaseBackendBase::performOpenAndVerify):
1387         (WebCore::DatabaseBackendBase::maximumSize):
1388         * Modules/webdatabase/DatabaseBackendBase.h:
1389         * Modules/webdatabase/DatabaseServer.cpp:
1390         (WebCore::DatabaseServer::createDatabase):
1391         * Modules/webdatabase/DatabaseTracker.cpp:
1392         (WebCore::DatabaseTracker::getMaxSizeForDatabase):
1393         (WebCore::DatabaseTracker::doneCreatingDatabase):
1394         (WebCore::DatabaseTracker::addOpenDatabase):
1395         (WebCore::DatabaseTracker::removeOpenDatabase):
1396         (WebCore::DatabaseTracker::getOpenDatabases):
1397         (WebCore::DatabaseTracker::deleteDatabaseFile):
1398         * Modules/webdatabase/DatabaseTracker.h:
1399
1400 2015-01-13  Joseph Pecoraro  <pecoraro@apple.com>
1401
1402         Web Inspector: Remove unused ResizeImage and DecodeImageData timeline events
1403         https://bugs.webkit.org/show_bug.cgi?id=140404
1404
1405         Reviewed by Timothy Hatcher.
1406
1407         * inspector/InspectorTimelineAgent.cpp:
1408         (WebCore::toProtocol):
1409         * inspector/InspectorTimelineAgent.h:
1410         * inspector/TimelineRecordFactory.cpp:
1411         (WebCore::TimelineRecordFactory::createDecodeImageData): Deleted.
1412         (WebCore::TimelineRecordFactory::createResizeImageData): Deleted.
1413         * inspector/TimelineRecordFactory.h:
1414
1415 2015-01-13  Jer Noble  <jer.noble@apple.com>
1416
1417         defaultPlaybackRate not respected when set before source is loaded
1418         https://bugs.webkit.org/show_bug.cgi?id=140282
1419
1420         Reviewed by Eric Carlson.
1421
1422         Test: media/video-defaultplaybackrate-before-load.html
1423
1424         When the HTMLMediaElement is notified that the media player's rate has changed, it asks
1425         for the rate from MediaPlayer. However, MediaPlayer never requests the playback rate
1426         from the underlying MediaPlayerPrivate; it just returns the last rate which was set, or
1427         1 if no rate was set. HTMLMediaElement then sets its playbackRate to the returned
1428         value. So the end result is that the value from defaultPlaybackRate is overwritten by
1429         the default value of 1 in MediaPlayer.
1430
1431         Rather than caching the requested rate in MediaPlayer, cache the value reported by
1432         MediaPlayer inside HTMLMediaElement. And instead of returning the reported playback
1433         rate from HTMLMediaElement.playbackRate, just return the last value set. The reported
1434         value is still used for estimating the current time during playback.
1435
1436         Add MediaPlayerPrivate interface method to return the current playback rate.
1437
1438         * html/HTMLMediaElement.cpp:
1439         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_reportedPlaybackRate.
1440         (WebCore::HTMLMediaElement::effectivePlaybackRate): Return m_reportedPlaybackRate.
1441         (WebCore::HTMLMediaElement::requestedPlaybackRate): Return m_playbackRate.
1442         (WebCore::HTMLMediaElement::updatePlaybackRate): Use requestedPlaybackRate() instead
1443             of effectivePlaybackRate();
1444         (WebCore::HTMLMediaElement::ended): Ditto.
1445         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Ditto.
1446         (WebCore::HTMLMediaElement::endedPlayback): Ditto.
1447         (WebCore::HTMLMediaElement::updatePlayState): Ditto.
1448         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
1449         (WebCore::HTMLMediaElement::mediaPlayerRateChanged): Set m_reportedPlaybackRate.
1450         (WebCore::HTMLMediaElement::mediaPlayerRequestedPlaybackRate): Return
1451             requestedPlaybackRate() if playing and 0 if not.
1452         * html/HTMLMediaElement.h:
1453         * platform/graphics/MediaPlayer.cpp:
1454         (WebCore::MediaPlayer::MediaPlayer): Removed m_rate.
1455         (WebCore::MediaPlayer::rate): Pass to MediaPlayerPrivate.
1456         (WebCore::MediaPlayer::setRate): Do not cache the rate.
1457         (WebCore::MediaPlayer::requestedRate): Added; ask HTMLMediaElement.
1458         * platform/graphics/MediaPlayer.h:
1459         (WebCore::MediaPlayerClient::mediaPlayerRequestedPlaybackRate): Added.
1460         * platform/graphics/MediaPlayerPrivate.h:
1461         (WebCore::MediaPlayerPrivateInterface::rate): Added.
1462         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1463         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
1464             Do not cache the requested rate.
1465         (WebCore::MediaPlayerPrivateAVFoundation::requestedRate): Pass to MediaPlayer.
1466         (WebCore::MediaPlayerPrivateAVFoundation::setRate): Deleted.
1467         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1468         (WebCore::MediaPlayerPrivateAVFoundation::requestedRate): Deleted.
1469         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1470         (WebCore::MediaPlayerPrivateAVFoundationCF::setRate): Renamed from updateRate.
1471         (WebCore::MediaPlayerPrivateAVFoundationCF::rate): Fetch the rate from the player.
1472         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1473         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1474         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1475         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble): Renamed from updateRate.
1476         (WebCore::MediaPlayerPrivateAVFoundationObjC::rate): Fetch the rate from the player.
1477         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1478         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1479         (WebCore::MediaPlayerPrivateQTKit::rate): Fetch the rate from the QTMovie.
1480
1481 2015-01-13  Andreas Kling  <akling@apple.com>
1482
1483         Element::normalizeAttributes() needs to handle arbitrary JS executing between loop iterations.
1484         <https://webkit.org/b/140379>
1485         <rdar://problem/19446901>
1486
1487         Reviewed by Benjamin Poulain.
1488
1489         Since DOM mutation events may arise below the call to Node::normalize(),
1490         have the loop in Element::normalizeAttributes() make a copy of the Attr nodes
1491         beforehand, to guard against mutations.
1492
1493         Based on a patch by Chris "Chris Dumez" Dumez.
1494
1495         Test: fast/dom/Element/normalize-crash2.html
1496
1497         * dom/Element.cpp:
1498         (WebCore::Element::normalizeAttributes):
1499
1500 2015-01-13  Shivakumar JM  <shiva.jm@samsung.com>
1501
1502         Fix Debug Build Error in Webcore module.
1503         https://bugs.webkit.org/show_bug.cgi?id=140383
1504
1505         Reviewed by Csaba Osztrogonác.
1506
1507         No new tests because there is no visible behavior change.
1508
1509         * platform/linux/MemoryPressureHandlerLinux.cpp:
1510         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
1511
1512 2015-01-12  Benjamin Poulain  <benjamin@webkit.org>
1513
1514         Fix a typo in r178313
1515
1516         * contentextensions/URLFilterParser.cpp:
1517         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
1518
1519 2015-01-12  Benjamin Poulain  <benjamin@webkit.org>
1520
1521         Add basic pattern matching support to the url filters
1522         https://bugs.webkit.org/show_bug.cgi?id=140283
1523
1524         Reviewed by Andreas Kling.
1525
1526         This patch adds some basic generic pattern support for the url filters
1527         of ContentExtensions.
1528
1529         Instead of writting a new parser, I re-used Gavin's parser for JavaScript
1530         RegExp.
1531
1532         This patch only implements the very basic stuffs: transition on any character
1533         and repetition.
1534
1535         * WebCore.xcodeproj/project.pbxproj:
1536         * contentextensions/ContentExtensionsBackend.cpp:
1537         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
1538         Use the new parser.
1539
1540         * contentextensions/DFA.cpp:
1541         (WebCore::ContentExtensions::DFA::DFA):
1542         (WebCore::ContentExtensions::printRange):
1543         (WebCore::ContentExtensions::printTransition):
1544         (WebCore::ContentExtensions::DFA::debugPrintDot):
1545         * contentextensions/NFA.cpp:
1546         (WebCore::ContentExtensions::printRange):
1547         (WebCore::ContentExtensions::printTransition):
1548         (WebCore::ContentExtensions::NFA::debugPrintDot):
1549         The graphs generated with the extended patterns are vastly more complicated
1550         than the old prefix matcher.
1551         I changed the debug output to have a single link between any two nodes
1552         instead of one per transition. This makes the graph a little more manageable.
1553
1554         * contentextensions/NFA.cpp:
1555         (WebCore::ContentExtensions::NFA::addTransition):
1556         (WebCore::ContentExtensions::NFA::addEpsilonTransition):
1557         (WebCore::ContentExtensions::NFA::graphSize):
1558         (WebCore::ContentExtensions::NFA::restoreToGraphSize):
1559         * contentextensions/NFA.h:
1560         * contentextensions/NFANode.h:
1561         (WebCore::ContentExtensions::epsilonClosure):
1562         The new parser can generate transitions back to the root node of index zero.
1563         All the hash structures had to be updated to support this kind of key.
1564
1565         * contentextensions/NFAToDFA.cpp:
1566         (WebCore::ContentExtensions::HashableNodeIdSetHash::hash):
1567         Two tiny improvements:
1568         -Don't hash zero to zero, it causes more conflicts that needed.
1569         -The hash operation must use a commutative operation, otherwise the order
1570          of elements can affect the hash, which is undesired for a set.
1571         I'll improve this further later.
1572
1573         (WebCore::ContentExtensions::NFAToDFA::convert):
1574
1575         * contentextensions/URLFilterParser.cpp: Added.
1576         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
1577         (WebCore::ContentExtensions::GraphBuilder::m_lastAtom):
1578         (WebCore::ContentExtensions::GraphBuilder::finalize):
1579         (WebCore::ContentExtensions::GraphBuilder::errorMessage):
1580         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
1581         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
1582         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
1583         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
1584         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
1585         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
1586         (WebCore::ContentExtensions::GraphBuilder::assertionEOL):
1587         (WebCore::ContentExtensions::GraphBuilder::assertionWordBoundary):
1588         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBegin):
1589         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
1590         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
1591         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassEnd):
1592         (WebCore::ContentExtensions::GraphBuilder::atomParenthesesSubpatternBegin):
1593         (WebCore::ContentExtensions::GraphBuilder::atomParentheticalAssertionBegin):
1594         (WebCore::ContentExtensions::GraphBuilder::atomParenthesesEnd):
1595         (WebCore::ContentExtensions::GraphBuilder::disjunction):
1596         (WebCore::ContentExtensions::GraphBuilder::hasError):
1597         (WebCore::ContentExtensions::GraphBuilder::fail):
1598         (WebCore::ContentExtensions::URLFilterParser::parse):
1599         * contentextensions/URLFilterParser.h:
1600         (WebCore::ContentExtensions::URLFilterParser::hasError):
1601         (WebCore::ContentExtensions::URLFilterParser::errorMessage):
1602
1603 2015-01-11  Sam Weinig  <sam@webkit.org>
1604
1605         Remove support for SharedWorkers
1606         https://bugs.webkit.org/show_bug.cgi?id=140344
1607
1608         Reviewed by Anders Carlsson.
1609
1610         * CMakeLists.txt:
1611         * Configurations/FeatureDefines.xcconfig:
1612         * DerivedSources.cpp:
1613         * DerivedSources.make:
1614         * PlatformGTK.cmake:
1615         * PlatformMac.cmake:
1616         * WebCore.vcxproj/WebCore.vcxproj:
1617         * WebCore.vcxproj/WebCore.vcxproj.filters:
1618         * WebCore.xcodeproj/project.pbxproj:
1619         * bindings/generic/RuntimeEnabledFeatures.cpp:
1620         (WebCore::RuntimeEnabledFeatures::sharedWorkerEnabled): Deleted.
1621         * bindings/generic/RuntimeEnabledFeatures.h:
1622         * bindings/js/JSBindingsAllInOne.cpp:
1623         * bindings/js/JSDOMWindowCustom.cpp:
1624         * bindings/js/JSSharedWorkerCustom.cpp: Removed.
1625         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1626         (WebCore::toJSWorkerGlobalScope):
1627         (WebCore::toJSSharedWorkerGlobalScope): Deleted.
1628         * bindings/js/JSWorkerGlobalScopeBase.h:
1629         * bindings/js/WorkerScriptController.cpp:
1630         (WebCore::WorkerScriptController::initScript):
1631         * bindings/scripts/IDLAttributes.txt:
1632         * bindings/scripts/preprocess-idls.pl:
1633         * dom/Document.cpp:
1634         (WebCore::Document::prepareForDestruction):
1635         * dom/EventTarget.h:
1636         * dom/EventTargetFactory.in:
1637         * history/PageCache.cpp:
1638         (WebCore::logCanCacheFrameDecision):
1639         (WebCore::PageCache::canCachePageContainingThisFrame):
1640         * loader/FrameLoader.cpp:
1641         * page/SecurityOrigin.h:
1642         (WebCore::SecurityOrigin::canAccessLocalStorage):
1643         (WebCore::SecurityOrigin::canAccessSharedWorkers): Deleted.
1644         * platform/FeatureCounterKeys.h:
1645         * platform/PlatformStrategies.h:
1646         (WebCore::PlatformStrategies::PlatformStrategies):
1647         (WebCore::PlatformStrategies::sharedWorkerStrategy): Deleted.
1648         * workers/DefaultSharedWorkerRepository.cpp: Removed.
1649         * workers/DefaultSharedWorkerRepository.h: Removed.
1650         * workers/SharedWorker.cpp: Removed.
1651         * workers/SharedWorker.h: Removed.
1652         * workers/SharedWorker.idl: Removed.
1653         * workers/SharedWorkerGlobalScope.cpp: Removed.
1654         * workers/SharedWorkerGlobalScope.h: Removed.
1655         * workers/SharedWorkerGlobalScope.idl: Removed.
1656         * workers/SharedWorkerRepository.cpp: Removed.
1657         * workers/SharedWorkerRepository.h: Removed.
1658         * workers/SharedWorkerStrategy.h: Removed.
1659         * workers/SharedWorkerThread.cpp: Removed.
1660         * workers/SharedWorkerThread.h: Removed.
1661         * workers/WorkerGlobalScope.h:
1662         (WebCore::WorkerGlobalScope::isSharedWorkerGlobalScope): Deleted.
1663
1664 2015-01-12  Byungseon Shin  <sun.shin@lge.com>
1665
1666         REGRESSION(r178029): [GTK][EFL] Caused no-backing-for-clip-overlap test failures
1667         https://bugs.webkit.org/show_bug.cgi?id=140336
1668
1669         Reviewed by Simon Fraser.
1670
1671         Avoid creating childClippingMaskLayer when renderer has not border radius nor clip path.
1672
1673         * rendering/RenderLayerBacking.cpp:
1674         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
1675
1676 2015-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
1677
1678         [Apple] Squelch stderr log regarding negative stroke thickness
1679         https://bugs.webkit.org/show_bug.cgi?id=140372
1680         <rdar://problem/19426485>
1681
1682         Reviewed by Eric Carlson.
1683
1684         No new tests because there is no visible behavior change.
1685
1686         * platform/graphics/cg/GraphicsContextCG.cpp:
1687         (WebCore::GraphicsContext::setPlatformStrokeThickness):
1688
1689 2015-01-12  Timothy Horton  <timothy_horton@apple.com>
1690
1691         Get rid of unnecessary reimplementations of CGFloor/Ceiling
1692         https://bugs.webkit.org/show_bug.cgi?id=140375
1693
1694         Reviewed by Simon Fraser.
1695
1696         * platform/mac/DragImageMac.mm:
1697         (WebCore::widthWithFont):
1698         (WebCore::drawAtPoint):
1699         (WebCore::webkit_CGCeiling): Deleted.
1700         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1701         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
1702         (webkit_CGFloor): Deleted.
1703         Delete unnecessary code, use the real CGFloor/Ceiling instead.
1704
1705 2015-01-12  Timothy Horton  <timothy_horton@apple.com>
1706
1707         REGRESSION (r177656): Text in find-in-page yellow bouncy rectangle is not crisp
1708         https://bugs.webkit.org/show_bug.cgi?id=140373
1709         <rdar://problem/19447156>
1710
1711         Reviewed by Simon Fraser.
1712
1713         * page/mac/TextIndicatorWindow.mm:
1714         (WebCore::TextIndicatorWindow::setTextIndicator):
1715         Expand the window margin to the nearest integer.
1716         The window was already being pixel-snapped, but then we'd translate by
1717         the non-integral margin when building up the layer tree.
1718         It's OK to do this on 2x because it's fine to have the margin be bigger
1719         than needed.
1720
1721         * platform/spi/cg/CoreGraphicsSPI.h:
1722         Add a CGCeiling to match CGFloor.
1723
1724 2015-01-12  Andreas Kling  <akling@apple.com>
1725
1726         Guard web thread stuff with USE(WEB_THREAD) instead of PLATFORM(IOS).
1727
1728         Dan pointed out that we should guard WebThreadIsLockedOrDisabled() with
1729         USE(WEB_THREAD) to communicate our ambitions to someday have an iOS
1730         build of WebKit that doesn't need any of that.
1731
1732         * Modules/geolocation/Geolocation.cpp:
1733         (WebCore::Geolocation::resume):
1734
1735 2015-01-12  Andreas Kling  <akling@apple.com>
1736
1737         Fix build for non-iOS platforms. :|
1738
1739         * Modules/geolocation/Geolocation.cpp:
1740         (WebCore::Geolocation::resume):
1741
1742 2015-01-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1743
1744         [Freetype] Don't use non-scalable fonts.
1745         https://bugs.webkit.org/show_bug.cgi?id=31931
1746
1747         Reviewed by Martin Robinson.
1748
1749         No new tests needed.
1750
1751         * platform/graphics/freetype/FontCacheFreeType.cpp:
1752         (WebCore::FontCache::createFontPlatformData): Prefer scalable fonts.
1753
1754 2015-01-12  Andreas Kling  <akling@apple.com>
1755
1756         Geolocation objects shouldn't prevent page caching.
1757         <https://webkit.org/b/140369>
1758
1759         Reviewed by Joseph Pecoraro.
1760
1761         Enable the code for suspend/resume of Geolocation objects on all platforms
1762         instead of just iOS. This allows pages using geolocation to use page cache
1763         instead of reloading on back/forward navigation.
1764
1765         Test: fast/history/page-cache-geolocation.html
1766
1767         * Modules/geolocation/Geolocation.cpp:
1768         (WebCore::Geolocation::Geolocation):
1769         (WebCore::Geolocation::resetAllGeolocationPermission):
1770         (WebCore::Geolocation::stop):
1771         (WebCore::Geolocation::setIsAllowed):
1772         (WebCore::Geolocation::positionChanged):
1773         (WebCore::Geolocation::setError):
1774         * Modules/geolocation/Geolocation.h:
1775
1776 2015-01-12  Chris Dumez  <cdumez@apple.com>
1777
1778         Log navigation types using DiagnosticLoggingClient
1779         https://bugs.webkit.org/show_bug.cgi?id=140323
1780
1781         Reviewed by Darin Adler.
1782
1783         Log navigation types using DiagnosticLoggingClient to help us understand
1784         what types of navigations are common and give us an estimate on the
1785         total number of navigations.
1786
1787         * loader/FrameLoader.cpp:
1788         (WebCore::logNavigation):
1789         (WebCore::FrameLoader::loadWithDocumentLoader):
1790         (WebCore::logNavigationWithFeatureCounter): Deleted.
1791         * page/DiagnosticLoggingKeys.cpp:
1792         (WebCore::DiagnosticLoggingKeys::navigationKey):
1793         * page/DiagnosticLoggingKeys.h:
1794
1795 2015-01-12  Brian J. Burg  <burg@cs.washington.edu>
1796
1797         Web Inspector: ASSERT under WebCore::InspectorResourceAgent::loadResource
1798         https://bugs.webkit.org/show_bug.cgi?id=140367
1799
1800         Reviewed by Andreas Kling.
1801
1802         * inspector/InspectorResourceAgent.cpp:
1803         (WebCore::InspectorResourceAgent::loadResource): use copyRef() instead of move(),
1804         since we check the callback after giving it to the loader client.
1805
1806 2015-01-12  Anders Carlsson  <andersca@apple.com>
1807
1808         Move DatabaseBackend functions back to Database
1809         https://bugs.webkit.org/show_bug.cgi?id=140368
1810
1811         Reviewed by Sam Weinig.
1812
1813         * Modules/webdatabase/Database.cpp:
1814         (WebCore::Database::openAndVerifyVersion):
1815         (WebCore::Database::close):
1816         (WebCore::Database::performOpenAndVerify):
1817         (WebCore::Database::scheduleTransaction):
1818         (WebCore::Database::runTransaction):
1819         (WebCore::Database::scheduleTransactionStep):
1820         (WebCore::Database::inProgressTransactionCompleted):
1821         (WebCore::Database::transactionClient):
1822         (WebCore::Database::transactionCoordinator):
1823         * Modules/webdatabase/Database.h:
1824         * Modules/webdatabase/DatabaseBackend.cpp:
1825         (WebCore::DatabaseBackend::openAndVerifyVersion): Deleted.
1826         (WebCore::DatabaseBackend::performOpenAndVerify): Deleted.
1827         (WebCore::DatabaseBackend::close): Deleted.
1828         (WebCore::DatabaseBackend::runTransaction): Deleted.
1829         (WebCore::DatabaseBackend::inProgressTransactionCompleted): Deleted.
1830         (WebCore::DatabaseBackend::scheduleTransaction): Deleted.
1831         (WebCore::DatabaseBackend::scheduleTransactionStep): Deleted.
1832         (WebCore::DatabaseBackend::transactionClient): Deleted.
1833         (WebCore::DatabaseBackend::transactionCoordinator): Deleted.
1834         * Modules/webdatabase/DatabaseBackend.h:
1835         * Modules/webdatabase/DatabaseThread.cpp:
1836         (WebCore::DatabaseThread::recordDatabaseOpen):
1837         (WebCore::DatabaseThread::recordDatabaseClosed):
1838         (WebCore::SameDatabasePredicate::SameDatabasePredicate):
1839         (WebCore::DatabaseThread::unscheduleDatabaseTasks):
1840         * Modules/webdatabase/DatabaseThread.h:
1841         * Modules/webdatabase/SQLTransactionBackend.cpp:
1842         (WebCore::SQLTransactionBackend::create):
1843         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
1844         * Modules/webdatabase/SQLTransactionBackend.h:
1845         (WebCore::SQLTransactionBackend::database):
1846
1847 2015-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
1848
1849         Addressing post-review comment after r178292
1850         https://bugs.webkit.org/show_bug.cgi?id=136769
1851
1852         Unreviewed.
1853
1854         * loader/cache/CachedFont.cpp:
1855         (WebCore::CachedFont::ensureCustomFontData):
1856
1857 2015-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
1858
1859         Allow targetting the SVG->OTF font converter with ENABLE(SVG_OTF_CONVERTER)
1860         https://bugs.webkit.org/show_bug.cgi?id=136769
1861
1862         Reviewed by Antti Koivisto.
1863
1864         If ENABLE(SVG_OTF_CONVERTER) is defined, use the converter. It can be defined at the same
1865         time as ENABLE(SVG_FONTS) but, if so, the SVG font code will be dead code.
1866
1867         No new tests because the define is off by default. Tests will come soon, I promise.
1868
1869         * Configurations/FeatureDefines.xcconfig:
1870         * css/CSSFontFaceSource.cpp:
1871         (WebCore::CSSFontFaceSource::getFontData): When creating a font, if the ENABLE is on,
1872         do the transcode and take the non-SVG path.
1873         (WebCore::CSSFontFaceSource::ensureFontData): Pass extra arguments to
1874         CachedFont::ensureCustomFontData()
1875         * css/CSSFontFaceSource.h: For the case of in-document SVG fonts, keep the transcoded
1876         bytes around.
1877         * loader/cache/CachedFont.cpp:
1878         (WebCore::CachedFont::ensureCustomFontData): For out-of-document SVG fonts, do the
1879         transcode if the ENABLE is on, then treat as if the font is any old webfont.
1880         (WebCore::CachedFont::getSVGFontById): This function looks up the relevant <font>
1881         element. Modify it to take a pointer to a (possibly external) document within which
1882         to search.
1883         * loader/cache/CachedFont.h: Extra arguments to CachedFont::ensureCustomFontData()
1884         and CachedFont::getSVGFontById()
1885
1886 2015-01-12  Zan Dobersek  <zdobersek@igalia.com>
1887
1888         Clean up FrameTree::traverseNext() traversals of main frames
1889         https://bugs.webkit.org/show_bug.cgi?id=140338
1890
1891         Reviewed by Andreas Kling.
1892
1893         There's no reason to pass the main frame as the stayWithin parameter
1894         to FrameTree::traverseNext() when traversing over that same main frame.
1895
1896         * inspector/InspectorApplicationCacheAgent.cpp:
1897         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
1898         * inspector/InspectorPageAgent.cpp:
1899         (WebCore::InspectorPageAgent::getCookies):
1900         (WebCore::InspectorPageAgent::deleteCookie):
1901         (WebCore::InspectorPageAgent::searchInResources):
1902         * replay/SerializationMethods.cpp:
1903         (WebCore::frameIndexFromFrame):
1904         (WebCore::frameFromFrameIndex):
1905
1906 2015-01-12  Timothy Horton  <timothy_horton@apple.com>
1907
1908         Multi-rect TextIndicators are vertically flipped in WebKit1
1909         https://bugs.webkit.org/show_bug.cgi?id=140350
1910         <rdar://problem/19441243>
1911
1912         Reviewed by Beth Dakin.
1913
1914         * page/TextIndicator.cpp:
1915         (WebCore::TextIndicator::createWithSelectionInFrame):
1916         (WebCore::TextIndicator::TextIndicator):
1917         * page/TextIndicator.h:
1918         (WebCore::TextIndicator::selectionRectInRootViewCoordinates):
1919         (WebCore::TextIndicator::textBoundingRectInRootViewCoordinates):
1920         (WebCore::TextIndicator::selectionRectInWindowCoordinates): Deleted.
1921         (WebCore::TextIndicator::textBoundingRectInWindowCoordinates): Deleted.
1922         * page/mac/TextIndicatorWindow.mm:
1923         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
1924         (WebCore::TextIndicatorWindow::setTextIndicator):
1925         Compute, store, and use TextIndicator's selectionRect and textBoundingRect
1926         in root view coordinates instead of window coordinates; this way, each
1927         WebKit can do the conversion itself, and the rootView vs. window flipping
1928         isn't wrongly factored into textRectsInBoundingRectCoordinates.
1929
1930 2015-01-12  Commit Queue  <commit-queue@webkit.org>
1931
1932         Unreviewed, rolling out r178281.
1933         https://bugs.webkit.org/show_bug.cgi?id=140366
1934
1935         Broke many media tests (Requested by ap on #webkit).
1936
1937         Reverted changeset:
1938
1939         "defaultPlaybackRate not respected when set before source is
1940         loaded"
1941         https://bugs.webkit.org/show_bug.cgi?id=140282
1942         http://trac.webkit.org/changeset/178281
1943
1944 2015-01-12  Anders Carlsson  <andersca@apple.com>
1945
1946         Merge DatabaseBackendContext into DatabaseContext
1947         https://bugs.webkit.org/show_bug.cgi?id=140365
1948
1949         Reviewed by Antti Koivisto.
1950
1951         * CMakeLists.txt:
1952         * Modules/webdatabase/AbstractDatabaseServer.h:
1953         * Modules/webdatabase/Database.cpp:
1954         (WebCore::Database::Database):
1955         * Modules/webdatabase/Database.h:
1956         * Modules/webdatabase/DatabaseBackend.cpp:
1957         (WebCore::DatabaseBackend::DatabaseBackend):
1958         * Modules/webdatabase/DatabaseBackend.h:
1959         * Modules/webdatabase/DatabaseBackendBase.cpp:
1960         (WebCore::DatabaseBackendBase::DatabaseBackendBase):
1961         * Modules/webdatabase/DatabaseBackendBase.h:
1962         (WebCore::DatabaseBackendBase::databaseContext):
1963         * Modules/webdatabase/DatabaseBackendContext.cpp: Removed.
1964         * Modules/webdatabase/DatabaseBackendContext.h: Removed.
1965         * Modules/webdatabase/DatabaseContext.cpp:
1966         (WebCore::DatabaseContext::securityOrigin):
1967         (WebCore::DatabaseContext::isContextThread):
1968         (WebCore::DatabaseContext::backend): Deleted.
1969         * Modules/webdatabase/DatabaseContext.h:
1970         * Modules/webdatabase/DatabaseManager.cpp:
1971         (WebCore::DatabaseManager::openDatabaseBackend):
1972         (WebCore::DatabaseManager::interruptAllDatabasesForContext):
1973         * Modules/webdatabase/DatabaseServer.cpp:
1974         (WebCore::DatabaseServer::interruptAllDatabasesForContext):
1975         (WebCore::DatabaseServer::openDatabase):
1976         (WebCore::DatabaseServer::createDatabase):
1977         * Modules/webdatabase/DatabaseServer.h:
1978         * Modules/webdatabase/DatabaseTracker.cpp:
1979         (WebCore::DatabaseTracker::canEstablishDatabase):
1980         (WebCore::DatabaseTracker::retryCanEstablishDatabase):
1981         (WebCore::DatabaseTracker::interruptAllDatabasesForContext):
1982         * Modules/webdatabase/DatabaseTracker.h:
1983         * Modules/webdatabase/SQLTransactionBackend.cpp:
1984         * Modules/webdatabase/SQLTransactionClient.cpp:
1985         * WebCore.vcxproj/WebCore.vcxproj:
1986         * WebCore.vcxproj/WebCore.vcxproj.filters:
1987         * WebCore.xcodeproj/project.pbxproj:
1988
1989 2015-01-12  Jer Noble  <jer.noble@apple.com>
1990
1991         defaultPlaybackRate not respected when set before source is loaded
1992         https://bugs.webkit.org/show_bug.cgi?id=140282
1993
1994         Reviewed by Eric Carlson.
1995
1996         Test: media/video-defaultplaybackrate-before-load.html
1997
1998         When the HTMLMediaElement is notified that the media player's rate has changed, it asks
1999         for the rate from MediaPlayer. However, MediaPlayer never requests the playback rate
2000         from the underlying MediaPlayerPrivate; it just returns the last rate which was set, or
2001         1 if no rate was set. HTMLMediaElement then sets its playbackRate to the returned
2002         value. So the end result is that the value from defaultPlaybackRate is overwritten by
2003         the default value of 1 in MediaPlayer.
2004
2005         Rather than caching the requested rate in MediaPlayer, cache the value reported by
2006         MediaPlayer inside HTMLMediaElement. And instead of returning the reported playback
2007         rate from HTMLMediaElement.playbackRate, just return the last value set. The reported
2008         value is still used for estimating the current time during playback.
2009
2010         Add MediaPlayerPrivate interface method to return the current playback rate.
2011
2012         * html/HTMLMediaElement.cpp:
2013         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_reportedPlaybackRate.
2014         (WebCore::HTMLMediaElement::effectivePlaybackRate): Return m_reportedPlaybackRate.
2015         (WebCore::HTMLMediaElement::requestedPlaybackRate): Return m_playbackRate.
2016         (WebCore::HTMLMediaElement::updatePlaybackRate): Use requestedPlaybackRate() instead
2017             of effectivePlaybackRate();
2018         (WebCore::HTMLMediaElement::ended): Ditto.
2019         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Ditto.
2020         (WebCore::HTMLMediaElement::endedPlayback): Ditto.
2021         (WebCore::HTMLMediaElement::updatePlayState): Ditto.
2022         (WebCore::HTMLMediaElement::mediaPlayerRateChanged): Set m_reportedPlaybackRate.
2023         (WebCore::HTMLMediaElement::mediaPlayerRequestedPlaybackRate): Return
2024             requestedPlaybackRate() if playing and 0 if not.
2025         * html/HTMLMediaElement.h:
2026         * platform/graphics/MediaPlayer.cpp:
2027         (WebCore::MediaPlayer::MediaPlayer): Removed m_rate.
2028         (WebCore::MediaPlayer::rate): Pass to MediaPlayerPrivate.
2029         (WebCore::MediaPlayer::setRate): Do not cache the rate.
2030         (WebCore::MediaPlayer::requestedRate): Added; ask HTMLMediaElement.
2031         * platform/graphics/MediaPlayer.h:
2032         (WebCore::MediaPlayerClient::mediaPlayerRequestedPlaybackRate): Added.
2033         * platform/graphics/MediaPlayerPrivate.h:
2034         (WebCore::MediaPlayerPrivateInterface::rate): Added.
2035         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2036         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
2037             Do not cache the requested rate.
2038         (WebCore::MediaPlayerPrivateAVFoundation::requestedRate): Pass to MediaPlayer.
2039         (WebCore::MediaPlayerPrivateAVFoundation::setRate): Deleted.
2040         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2041         (WebCore::MediaPlayerPrivateAVFoundation::requestedRate): Deleted.
2042         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2043         (WebCore::MediaPlayerPrivateAVFoundationCF::setRate): Renamed from updateRate.
2044         (WebCore::MediaPlayerPrivateAVFoundationCF::rate): Fetch the rate from the player.
2045         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2046         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2047         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2048         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble): Renamed from updateRate.
2049         (WebCore::MediaPlayerPrivateAVFoundationObjC::rate): Fetch the rate from the player.
2050         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2051         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2052         (WebCore::MediaPlayerPrivateQTKit::rate): Fetch the rate from the QTMovie.
2053
2054 2015-01-11  Anders Carlsson  <andersca@apple.com>
2055
2056         Merge DatabaseBase into Database
2057         https://bugs.webkit.org/show_bug.cgi?id=140345
2058
2059         Reviewed by Antti Koivisto.
2060
2061         * CMakeLists.txt:
2062         * Modules/webdatabase/Database.cpp:
2063         (WebCore::Database::Database):
2064         (WebCore::Database::runTransaction):
2065         (WebCore::Database::logErrorMessage):
2066         * Modules/webdatabase/Database.h:
2067         (WebCore::Database::scriptExecutionContext):
2068         * Modules/webdatabase/DatabaseBackendBase.cpp:
2069         * Modules/webdatabase/DatabaseBackendBase.h:
2070         (WebCore::DatabaseBackendBase::setFrontend):
2071         * Modules/webdatabase/DatabaseBase.cpp: Removed.
2072         * Modules/webdatabase/DatabaseBase.h: Removed.
2073         * WebCore.vcxproj/WebCore.vcxproj:
2074         * WebCore.vcxproj/WebCore.vcxproj.filters:
2075         * WebCore.xcodeproj/project.pbxproj:
2076
2077 2015-01-12  Darin Adler  <darin@apple.com>
2078
2079         Modernize and streamline HTMLTokenizer
2080         https://bugs.webkit.org/show_bug.cgi?id=140166
2081
2082         Reviewed by Sam Weinig.
2083
2084         * html/parser/AtomicHTMLToken.h:
2085         (WebCore::AtomicHTMLToken::initializeAttributes): Removed unneeded assertions
2086         based on fields I removed.
2087
2088         * html/parser/HTMLDocumentParser.cpp:
2089         (WebCore::HTMLDocumentParser::HTMLDocumentParser): Change to use updateStateFor
2090         to set the initial state when parsing a fragment, since it implements the same
2091         rule taht the tokenizerStateForContextElement function did.
2092         (WebCore::HTMLDocumentParser::pumpTokenizer): Updated to use the revised
2093         interfaces for HTMLSourceTracker and HTMLTokenizer.
2094         (WebCore::HTMLDocumentParser::constructTreeFromHTMLToken): Changed to take a
2095         TokenPtr instead of an HTMLToken, so we can clear out the TokenPtr earlier
2096         for non-character tokens, and let them get cleared later for character tokens.
2097         (WebCore::HTMLDocumentParser::insert): Pass references.
2098         (WebCore::HTMLDocumentParser::append): Ditto.
2099         (WebCore::HTMLDocumentParser::appendCurrentInputStreamToPreloadScannerAndScan): Ditto.
2100
2101         * html/parser/HTMLDocumentParser.h: Updated argument type for constructTreeFromHTMLToken
2102         and removed now-unneeded m_token data members.
2103
2104         * html/parser/HTMLEntityParser.cpp: Removed unneeded uses of the inline keyword.
2105         (WebCore::HTMLEntityParser::consumeNamedEntity): Replaced two uses of
2106         advanceAndASSERT with just plain advance; there's really no need to assert the
2107         character is the one we just got out of the string.
2108
2109         * html/parser/HTMLInputStream.h: Moved the include of TextPosition.h here from
2110         its old location since this class has two data members that are OrdinalNumber.
2111
2112         * html/parser/HTMLMetaCharsetParser.cpp:
2113         (WebCore::HTMLMetaCharsetParser::HTMLMetaCharsetParser): Removed most of the
2114         initialization, since it's now done by defaults.
2115         (WebCore::extractCharset): Rewrote this to be a non-member function, and to
2116         use a for loop, and to handle quote marks in a simpler way. Also changed it
2117         to return a StringView so we don't have to allocate a new string.
2118         (WebCore::HTMLMetaCharsetParser::processMeta): Use a modern for loop, and
2119         also take a token argument since it's no longer a data member.
2120         (WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes): Use a modern for
2121         loop, StringView instead of string, and don't bother naming the local enum.
2122         (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Updated for the new
2123         way of getting tokens from the tokenizer.
2124
2125         * html/parser/HTMLMetaCharsetParser.h: Got rid of some data members and
2126         tightened up the formatting a little. Don't bother allocating the tokenizer
2127         on the heap.
2128
2129         * html/parser/HTMLPreloadScanner.cpp:
2130         (WebCore::TokenPreloadScanner::TokenPreloadScanner): Removed unneeded
2131         initialization.
2132         (WebCore::HTMLPreloadScanner::HTMLPreloadScanner): Ditto.
2133         (WebCore::HTMLPreloadScanner::scan): Changed to take a reference.
2134
2135         * html/parser/HTMLPreloadScanner.h: Removed unneeded includes, typedefs,
2136         and forward declarations. Removed explicit declaration of the destructor,
2137         since the default one works. Removed unused createCheckpoint and rewindTo
2138         functions. Gave initial values for various data members. Marked the device
2139         scale factor const beacuse it's set in the constructor and never changed.
2140         Also removed the unneeded isSafeToSendToAnotherThread.
2141
2142         * html/parser/HTMLResourcePreloader.cpp:
2143         (WebCore::PreloadRequest::isSafeToSendToAnotherThread): Deleted.
2144
2145         * html/parser/HTMLResourcePreloader.h:
2146         (WebCore::PreloadRequest::PreloadRequest): Removed unneeded calls to
2147         isolatedCopy. Also removed isSafeToSendToAnotherThread.
2148
2149         * html/parser/HTMLSourceTracker.cpp:
2150         (WebCore::HTMLSourceTracker::startToken): Renamed. Changed to keep state
2151          in the source tracker itself, not the token.
2152         (WebCore::HTMLSourceTracker::endToken): Ditto.
2153         (WebCore::HTMLSourceTracker::source): Renamed. Changed to use the state
2154         from the source tracker.
2155
2156         * html/parser/HTMLSourceTracker.h: Removed unneeded include of HTMLToken.h.
2157         Renamed functions, removed now-unneeded comment.
2158
2159         * html/parser/HTMLToken.h: Cut down on the fields used by the source tracker.
2160         It only needs to know the start and end of each attribute, not each part of
2161         each attribute. Removed setBaseOffset, setEndOffset, length, addNewAttribute,
2162         beginAttributeName, endAttributeName, beginAttributeValue, endAttributeValue,
2163         m_baseOffset and m_length. Added beginAttribute and endAttribute.
2164         (WebCore::HTMLToken::clear): No need to zero m_length or m_baseOffset any more.
2165         (WebCore::HTMLToken::length): Deleted.
2166         (WebCore::HTMLToken::setBaseOffset): Deleted.
2167         (WebCore::HTMLToken::setEndOffset): Deleted.
2168         (WebCore::HTMLToken::beginStartTag): Only null out m_currentAttribute if we
2169         are compiling in assertions.
2170         (WebCore::HTMLToken::beginEndTag): Ditto.
2171         (WebCore::HTMLToken::addNewAttribute): Deleted.
2172         (WebCore::HTMLToken::beginAttribute): Moved the code from addNewAttribute in
2173         here and set the start offset.
2174         (WebCore::HTMLToken::beginAttributeName): Deleted.
2175         (WebCore::HTMLToken::endAttributeName): Deleted.
2176         (WebCore::HTMLToken::beginAttributeValue): Deleted.
2177         (WebCore::HTMLToken::endAttributeValue): Deleted.
2178
2179         * html/parser/HTMLTokenizer.cpp:
2180         (WebCore::HTMLToken::endAttribute): Added. Sets the end offset.
2181         (WebCore::HTMLToken::appendToAttributeName): Updated assertion.
2182         (WebCore::HTMLToken::appendToAttributeValue): Ditto.
2183         (WebCore::convertASCIIAlphaToLower): Renamed from toLowerCase and changed
2184         so it's legal to call on lower case letters too.
2185         (WebCore::vectorEqualsString): Changed to take a string literal rather than
2186         a WTF::String.
2187         (WebCore::HTMLTokenizer::inEndTagBufferingState): Made this a member function.
2188         (WebCore::HTMLTokenizer::HTMLTokenizer): Updated for data member changes.
2189         (WebCore::HTMLTokenizer::bufferASCIICharacter): Added. Optimized version of
2190         bufferCharacter for the common case where we know the character is ASCII.
2191         (WebCore::HTMLTokenizer::bufferCharacter): Moved this function here from the
2192         header since it's only used inside the class.
2193         (WebCore::HTMLTokenizer::emitAndResumeInDataState): Moved this here, renamed
2194         it and removed the state argument.
2195         (WebCore::HTMLTokenizer::emitAndReconsumeInDataState): Ditto.
2196         (WebCore::HTMLTokenizer::emitEndOfFile): More of the same.
2197         (WebCore::HTMLTokenizer::saveEndTagNameIfNeeded): Ditto.
2198         (WebCore::HTMLTokenizer::haveBufferedCharacterToken): Ditto.
2199         (WebCore::HTMLTokenizer::flushBufferedEndTag): Updated since m_token is now
2200         the actual token, not just a pointer.
2201         (WebCore::HTMLTokenizer::flushEmitAndResumeInDataState): Renamed this and
2202         removed the state argument.
2203         (WebCore::HTMLTokenizer::processToken): This function, formerly nextToken,
2204         is now the internal function used by nextToken. Updated its contents to use
2205         simpler macros, changed code to set m_state when returning, rather than
2206         constantly setting it when cycling through states, switched style to use
2207         early return/goto rather than lots of else statements, took out unneeded
2208         braces now that BEGIN/END_STATE handles the braces, collapsed upper and
2209         lower case letter handling in many states, changed lookAhead call sites to
2210         use the new advancePast function instead.
2211         (WebCore::HTMLTokenizer::updateStateFor): Set m_state directly instead of
2212         calling a setstate function.
2213         (WebCore::HTMLTokenizer::appendToTemporaryBuffer): Moved here from header.
2214         (WebCore::HTMLTokenizer::temporaryBufferIs): Changed argument type to
2215         a literal instead of a WTF::String.
2216         (WebCore::HTMLTokenizer::appendToPossibleEndTag): Renamed and changed type
2217         to be a UChar instead of LChar, although all characters will be ASCII.
2218         (WebCore::HTMLTokenizer::isAppropriateEndTag): Marked const, and changed
2219         type from size_t to unsigned.
2220
2221         * html/parser/HTMLTokenizer.h: Changed interface of nextToken so it returns
2222         a TokenPtr so code doesn't have to understand special rules about when to
2223         work with an HTMLToken and when to clear it. Made most functions private,
2224         and made the State enum private as well. Replaced the state and setState
2225         functions with more specific functions for the few states we need to deal
2226         with outside the class. Moved function bodies outside the class definition
2227         so it's easier to read the class definition.
2228
2229         * html/parser/HTMLTreeBuilder.cpp:
2230         (WebCore::HTMLTreeBuilder::processStartTagForInBody): Updated to use the
2231         new set state functions instead of setState.
2232         (WebCore::HTMLTreeBuilder::processEndTag): Ditto.
2233         (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag): Ditto.
2234         (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag): Ditto.
2235         (WebCore::HTMLTreeBuilder::processScriptStartTag): Ditto.
2236
2237         * html/parser/InputStreamPreprocessor.h: Marked the constructor explicit,
2238         and mde it take a reference rather than a pointer.
2239
2240         * html/parser/TextDocumentParser.cpp:
2241         (WebCore::TextDocumentParser::insertFakePreElement): Updated to use the
2242         new set state functions instead of setState.
2243
2244         * html/parser/XSSAuditor.cpp:
2245         (WebCore::XSSAuditor::decodedSnippetForName): Updated for name change.
2246         (WebCore::XSSAuditor::decodedSnippetForAttribute): Updated for changes to
2247         attribute range tracking.
2248         (WebCore::XSSAuditor::decodedSnippetForJavaScript): Updated for name change.
2249         (WebCore::XSSAuditor::isSafeToSendToAnotherThread): Deleted.
2250
2251         * html/parser/XSSAuditor.h: Deleted isSafeToSendToAnotherThread.
2252
2253         * html/track/WebVTTTokenizer.cpp: Removed the local state variable from
2254         WEBVTT_ADVANCE_TO; there is no need for it.
2255         (WebCore::WebVTTTokenizer::WebVTTTokenizer): Use a reference instead of a
2256         pointer for the preprocessor.
2257         (WebCore::WebVTTTokenizer::nextToken): Ditto. Also removed the state local
2258         variable and the switch statement, replacing with labels instead since we
2259         go between states with goto.
2260
2261         * platform/text/SegmentedString.cpp:
2262         (WebCore::SegmentedString::operator=): Changed the return type to be non-const
2263         to match normal C++ design rules.
2264         (WebCore::SegmentedString::pushBack): Renamed from prepend since this is not a
2265         general purpose prepend function. Also fixed assertions to not use the strangely
2266         named "escaped" function, since we are deleting it.
2267         (WebCore::SegmentedString::append): Ditto.
2268         (WebCore::SegmentedString::advancePastNonNewlines): Renamed from advance, since
2269         the function only works for non-newlines.
2270         (WebCore::SegmentedString::currentColumn): Got rid of unneeded local variable.
2271         (WebCore::SegmentedString::advancePastSlowCase): Moved here from header and
2272         renamed. This function now consumes the characters if they match.
2273
2274         * platform/text/SegmentedString.h: Made the changes mentioned above.
2275         (WebCore::SegmentedString::excludeLineNumbers): Deleted.
2276         (WebCore::SegmentedString::advancePast): Renamed from lookAhead. Also changed
2277         behavior so the characters are consumed.
2278         (WebCore::SegmentedString::advancePastIgnoringCase): Ditto.
2279         (WebCore::SegmentedString::advanceAndASSERT): Deleted.
2280         (WebCore::SegmentedString::advanceAndASSERTIgnoringCase): Deleted.
2281         (WebCore::SegmentedString::escaped): Deleted.
2282
2283         * xml/parser/CharacterReferenceParserInlines.h:
2284         (WebCore::isHexDigit): Deleted.
2285         (WebCore::unconsumeCharacters): Updated for name change.
2286         (WebCore::consumeCharacterReference): Removed unneeded name for local enum,
2287         renamed local variable "cc" to character. Changed code to use helpers like
2288         isASCIIAlpha and toASCIIHexValue. Removed unneeded use of advanceAndASSERT,
2289         since we don't really need to assert the character we just extracted.
2290
2291         * xml/parser/MarkupTokenizerInlines.h:
2292         (WebCore::isTokenizerWhitespace): Renamed argument to character.
2293         (WebCore::advanceStringAndASSERTIgnoringCase): Deleted.
2294         (WebCore::advanceStringAndASSERT): Deleted.
2295         Changed all the macro implementations so they set m_state only when
2296         returning from the function and just use goto inside the state machine.
2297
2298 2015-01-11  Andreas Kling  <akling@apple.com>
2299
2300         Enable Vector bounds checking for ElementDescendantIterator.
2301         <https://webkit.org/b/140346>
2302
2303         Reviewed by Sam Weinig.
2304
2305         I had originally disabled Vector bounds checking for
2306         ElementDescendantIterator's internal ancestor stack, but upon
2307         re-running performance benchmarks, it appears to have little-to-no
2308         measurable benefit.
2309
2310         This change adds back the bounds checking.
2311
2312         * dom/ElementDescendantIterator.h:
2313
2314 2015-01-11  Chris Dumez  <cdumez@apple.com>
2315
2316         Drop legacy SVGCSSStyleSelector.cpp
2317         https://bugs.webkit.org/show_bug.cgi?id=140342
2318
2319         Reviewed by Antti Koivisto.
2320
2321         Drop legacy SVGCSSStyleSelector.cpp by porting the remaining SVG CSS
2322         properties to the generated StyleBuilder. This patch also removes
2323         support for the "LegacyStyleBuilder" option in CSSPropertyNames.in
2324         as all properties have now been ported over.
2325
2326         * CMakeLists.txt:
2327         * WebCore.vcxproj/WebCore.vcxproj:
2328         * WebCore.vcxproj/WebCore.vcxproj.filters:
2329         * WebCore.xcodeproj/project.pbxproj:
2330         Drop SVGCSSStyleSelector.cpp file as it was removed.
2331
2332         * css/CSSPropertyNames.in:
2333         * css/SVGCSSStyleSelector.cpp: Removed.
2334         * css/StyleBuilder.h:
2335         StyleBuilder::applyProperty() no longer need to return a boolean as
2336         it now handles ALL CSS properties.
2337
2338         * css/StyleBuilderCustom.h:
2339         (WebCore::StyleBuilderCustom::applyValueBaselineShift):
2340         (WebCore::StyleBuilderCustom::applyInitialFill):
2341         (WebCore::StyleBuilderCustom::applyInheritFill):
2342         (WebCore::StyleBuilderCustom::applyValueFill):
2343         (WebCore::StyleBuilderCustom::applyInitialStroke):
2344         (WebCore::StyleBuilderCustom::applyInheritStroke):
2345         (WebCore::StyleBuilderCustom::applyValueStroke):
2346         (WebCore::StyleBuilderCustom::applyInitialWebkitSvgShadow):
2347         (WebCore::StyleBuilderCustom::applyInheritWebkitSvgShadow):
2348         (WebCore::StyleBuilderCustom::applyValueWebkitSvgShadow):
2349         Move 'fill', 'stroke' and '-webkit-svg-shadow' to the new
2350         StyleBuilder.
2351
2352         * css/StyleResolver.cpp:
2353         (WebCore::StyleResolver::applyProperty):
2354         * css/makeprop.pl:
2355
2356 2015-01-11  Antti Koivisto  <antti@apple.com>
2357
2358         Remove FontCachePurgePreventer
2359         https://bugs.webkit.org/show_bug.cgi?id=139628
2360
2361         Reviewed by Anders Carlsson.
2362
2363         This stack type is bug prone and invasive. A missing FontCachePurgePreventer in a code that touches fonts is always
2364         a hard-to-detect bug and there are many places that need it. Instead purge the font cache on top of the runloop.
2365
2366         The purge timer could in principle fire in a nested runloop. However we should never have unreferenced
2367         SimpleFontData objects in the stack in such case (GlyphData objects don't currently ref the font) because those
2368         only occur during layout and painting. Layout and painting can't trigger a nested runloops as there would be
2369         bigger problems.
2370
2371         Purging may also be triggered synchronously by a memory notification. That case won't have any GlyphDatas in the stack either.
2372
2373         * html/canvas/CanvasRenderingContext2D.cpp:
2374         (WebCore::CanvasRenderingContext2D::measureText):
2375         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2376         * page/FrameView.cpp:
2377         (WebCore::FrameView::layout):
2378         (WebCore::FrameView::paintContents):
2379         * platform/graphics/FontCache.cpp:
2380         (WebCore::FontCache::FontCache):
2381         (WebCore::FontCache::fontForFamily):
2382         (WebCore::FontCache::purgeTimerFired):
2383         (WebCore::FontCache::purgeInactiveFontData):
2384         * platform/graphics/FontCache.h:
2385         (WebCore::FontCache::disablePurging): Deleted.
2386         (WebCore::FontCache::enablePurging): Deleted.
2387         (WebCore::FontCachePurgePreventer::FontCachePurgePreventer): Deleted.
2388         (WebCore::FontCachePurgePreventer::~FontCachePurgePreventer): Deleted.
2389         * platform/graphics/FontFastPath.cpp:
2390         (WebCore::Font::emphasisMarkAscent):
2391         (WebCore::Font::emphasisMarkDescent):
2392         (WebCore::Font::emphasisMarkHeight):
2393         (WebCore::Font::drawEmphasisMarks):
2394         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2395         (PlatformCALayerWinInternal::displayCallback):
2396         * platform/mac/DragImageMac.mm:
2397         (WebCore::widthWithFont):
2398         (WebCore::drawAtPoint):
2399         (WebCore::createDragImageForLink):
2400         * platform/win/DragImageWin.cpp:
2401         (WebCore::createDragImageForLink):
2402         * platform/win/WebCoreTextRenderer.cpp:
2403         (WebCore::doDrawTextAtPoint):
2404         (WebCore::WebCoreTextFloatWidth):
2405         * rendering/InlineTextBox.cpp:
2406         (WebCore::InlineTextBox::localSelectionRect):
2407         (WebCore::InlineTextBox::offsetForPosition):
2408         (WebCore::InlineTextBox::positionForOffset):
2409         * rendering/RenderImage.cpp:
2410         (WebCore::RenderImage::setImageSizeForAltText):
2411         * rendering/RenderLayerBacking.cpp:
2412         (WebCore::RenderLayerBacking::paintIntoLayer):
2413         * rendering/RenderListBox.cpp:
2414         (WebCore::RenderListBox::updateFromElement):
2415         (WebCore::RenderListBox::paintItemForeground):
2416         * rendering/RenderMenuList.cpp:
2417         (RenderMenuList::updateOptionsWidth):
2418         * rendering/RenderThemeIOS.mm:
2419         (WebCore::adjustInputElementButtonStyle):
2420         * rendering/mathml/RenderMathMLOperator.cpp:
2421         (WebCore::RenderMathMLOperator::updateStyle):
2422         * rendering/svg/RenderSVGText.cpp:
2423         (WebCore::RenderSVGText::subtreeChildWasAdded):
2424         (WebCore::RenderSVGText::subtreeStyleDidChange):
2425         (WebCore::RenderSVGText::subtreeTextDidChange):
2426         (WebCore::RenderSVGText::removeChild):
2427         * rendering/svg/SVGInlineTextBox.cpp:
2428         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
2429
2430 2015-01-11  Myles C. Maxfield  <mmaxfield@apple.com>
2431
2432         [SVG -> OTF Converter] Implement ligatures
2433         https://bugs.webkit.org/show_bug.cgi?id=137094
2434
2435         Reviewed by Dan Bernstein.
2436
2437         Use the "liga" OpenType feature to implement ligatures inside the GSUB table.
2438
2439         Tests: svg/W3C-SVG-1.1/fonts-glyph-04-t.svg
2440                svg/W3C-SVG-1.1/text-text-06-t.svg
2441                svg/text/kerning.svg
2442                svg/text/multichar-glyph.svg
2443
2444         * svg/SVGToOTFFontConversion.cpp:
2445         (WebCore::SVGToOTFFontConverter::grow):
2446         (WebCore::SVGToOTFFontConverter::appendCMAPTable): Use StringView::codePoints().
2447         (WebCore::SVGToOTFFontConverter::firstGlyph): Returns the first element of the input
2448         vector, along with some ASSERTs.
2449         (WebCore::SVGToOTFFontConverter::appendLigatureSubtable):
2450         (WebCore::SVGToOTFFontConverter::appendScriptSubtable): Used inside appendGSUBTable.
2451         (WebCore::SVGToOTFFontConverter::appendGSUBTable): Updating for ligatures.
2452         (WebCore::codepointToString): Wrapper around U16_APPEND().
2453         (WebCore::SVGToOTFFontConverter::glyphsForCodepoint): Call codepointToString and look
2454         in internal map.
2455         (WebCore::SVGToOTFFontConverter::addCodepointRanges): Use glyphsForCodepoint().
2456         (WebCore::SVGToOTFFontConverter::appendLigatureGlyphs): Ligatures are implemented as
2457         mapping a sequence of glyphs to another glyph inside OpenType. However, SVG models
2458         ligatures as mapping a sequence of codepoints to a glyph. This function makes dummy
2459         glyphs for all the codepoints that we don't have glyphs for and appends them to
2460         m_glyphs.
2461         (WebCore::SVGToOTFFontConverter::compareCodepointsLexicographically):
2462         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Use appendEmptyGlyph() and
2463         call appendLigatureGlyphs().
2464
2465 2015-01-11  Chris Dumez  <cdumez@apple.com>
2466
2467         Move more SVG CSS properties to the new StyleBuilder
2468         https://bugs.webkit.org/show_bug.cgi?id=140340
2469
2470         Reviewed by Antti Koivisto.
2471
2472         Move more SVG CSS properties to the new StyleBuilder by introducing
2473         the necessary converters in StyleBuilderConverter.
2474
2475         * css/CSSPropertyNames.in:
2476         * css/SVGCSSStyleSelector.cpp:
2477         (WebCore::StyleResolver::applySVGProperty):
2478         (WebCore::roundToNearestGlyphOrientationAngle): Deleted.
2479         (WebCore::angleToGlyphOrientation): Deleted.
2480         (WebCore::colorFromSVGColorCSSValue): Deleted.
2481         * css/StyleBuilderConverter.h:
2482         (WebCore::StyleBuilderConverter::convertNumber):
2483         (WebCore::StyleBuilderConverter::convertNumberOrAuto):
2484         (WebCore::StyleBuilderConverter::convertOpacity):
2485         (WebCore::StyleBuilderConverter::convertSVGURIReference):
2486         (WebCore::StyleBuilderConverter::convertSVGColor):
2487         (WebCore::StyleBuilderConverter::convertGlyphOrientation):
2488         (WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
2489         * rendering/style/RenderStyle.h:
2490
2491 2015-01-10  Csaba Osztrogonác  <ossy@webkit.org>
2492
2493         Unreviewed buildfix for !ENABLE(INSPECTOR) builds after r178201.
2494
2495         * inspector/InspectorInstrumentation.h:
2496         (WebCore::InspectorInstrumentation::willReceiveResourceResponse):
2497
2498 2015-01-10  Chris Dumez  <cdumez@apple.com>
2499
2500         Move 'kerning' / 'paint-order' / 'stroke-dasharray' SVG CSS properties to the new StyleBuilder
2501         https://bugs.webkit.org/show_bug.cgi?id=140327
2502
2503         Reviewed by Sam Weinig.
2504
2505         Move 'kerning' / 'paint-order' / 'stroke-dasharray' SVG CSS properties
2506         to the new StyleBuilder by introducing the necessary converters in
2507         StyleBuilderConverter.
2508
2509         * css/CSSPropertyNames.in:
2510         * css/SVGCSSStyleSelector.cpp:
2511         (WebCore::StyleResolver::applySVGProperty):
2512         * css/StyleBuilderConverter.h:
2513         (WebCore::StyleBuilderConverter::convertSVGLength):
2514         (WebCore::StyleBuilderConverter::convertSVGLengthVector):
2515         (WebCore::StyleBuilderConverter::convertStrokeDashArray):
2516         (WebCore::StyleBuilderConverter::convertPaintOrder):
2517         * svg/SVGLength.cpp:
2518         (WebCore::SVGLength::fromCSSPrimitiveValue):
2519         * svg/SVGLength.h:
2520
2521 2015-01-09  Andreas Kling  <akling@apple.com>
2522
2523         CTTE: GeolocationController always has a client.
2524         <https://webkit.org/b/140330>
2525
2526         Reviewed by Anders Carlsson.
2527
2528         Change GeolocationController::m_client to be a reference and remove
2529         a whole bunch of unnecessary null checks.
2530
2531         * Modules/geolocation/GeolocationController.cpp:
2532         (WebCore::GeolocationController::GeolocationController):
2533         (WebCore::GeolocationController::~GeolocationController):
2534         (WebCore::GeolocationController::addObserver):
2535         (WebCore::GeolocationController::removeObserver):
2536         (WebCore::GeolocationController::requestPermission):
2537         (WebCore::GeolocationController::cancelPermissionRequest):
2538         (WebCore::GeolocationController::lastPosition):
2539         (WebCore::GeolocationController::viewStateDidChange):
2540         (WebCore::provideGeolocationTo):
2541         * Modules/geolocation/GeolocationController.h:
2542         (WebCore::GeolocationController::client):
2543
2544 2015-01-09  Zalan Bujtas  <zalan@apple.com>
2545
2546         Calling clearSelection on a detached RenderObject leads to segfault.
2547         https://bugs.webkit.org/show_bug.cgi?id=140275
2548
2549         Reviewed by Simon Fraser.
2550
2551         We collect selection rects and compute selection gaps in order to
2552         paint/clear selection. With certain content, we need to be able
2553         to walk the tree up to a particular container to compute the selection rect.
2554         However this container might not be available when the selection is part of a detached tree.
2555         This is a null-check fix to ensure we don't crash in such cases, but in the long run
2556         selection gaps and rect should be cached between two layouts so that we don't need to
2557         keep collecting/recomputing them. Tracked here: webkit.org/b/140321
2558
2559         Test: editing/selection/clearselection-on-detached-subtree-crash.html
2560
2561         * rendering/RenderBox.cpp:
2562         (WebCore::RenderBox::containingBlockLogicalWidthForContent):
2563         (WebCore::RenderBox::containingBlockLogicalHeightForContent):
2564         * rendering/RenderView.cpp:
2565         (WebCore::RenderView::clearSelection):
2566
2567 2015-01-09  Anders Carlsson  <andersca@apple.com>
2568
2569         Remove more sync database code
2570         https://bugs.webkit.org/show_bug.cgi?id=140328
2571
2572         Reviewed by Sam Weinig.
2573
2574         * Modules/webdatabase/AbstractDatabaseServer.h:
2575         * Modules/webdatabase/DatabaseBackend.cpp:
2576         (WebCore::DatabaseBackend::DatabaseBackend):
2577         * Modules/webdatabase/DatabaseBackendBase.cpp:
2578         (WebCore::DatabaseBackendBase::DatabaseBackendBase):
2579         * Modules/webdatabase/DatabaseBackendBase.h:
2580         (WebCore::DatabaseBackendBase::isSyncDatabase): Deleted.
2581         * Modules/webdatabase/DatabaseBasicTypes.h:
2582         * Modules/webdatabase/DatabaseManager.cpp:
2583         (WebCore::DatabaseManager::openDatabaseBackend):
2584         (WebCore::DatabaseManager::openDatabase):
2585         * Modules/webdatabase/DatabaseManager.h:
2586         * Modules/webdatabase/DatabaseServer.cpp:
2587         (WebCore::DatabaseServer::openDatabase):
2588         (WebCore::DatabaseServer::createDatabase):
2589         * Modules/webdatabase/DatabaseServer.h:
2590
2591 2015-01-09  Daniel Bates  <dabates@apple.com>
2592
2593         Fix the iOS build after <http://trac.webkit.org/changeset/178213>
2594         (https://bugs.webkit.org/show_bug.cgi?id=140310)
2595
2596         * platform/spi/cocoa/CoreTextSPI.h:
2597         * rendering/RenderThemeIOS.mm:
2598         (WebCore::RenderThemeIOS::systemFont):
2599
2600 2015-01-09  Chris Dumez  <cdumez@apple.com>
2601
2602         Get rid of legacy StyleBuilder switch in StyleResolver.cpp
2603         https://bugs.webkit.org/show_bug.cgi?id=140315
2604
2605         Reviewed by Sam Weinig.
2606
2607         Get rid of legacy StyleBuilder switch in StyleResolver.cpp now that most
2608         properties have been ported to the new generated StyleBuilder in previous
2609         patches. The properties that remained in this switch were shorthand
2610         properties or other properties that do not require any handling in the
2611         StyleBuilder.
2612
2613         To achieve this, this patch introduces 2 parameters in
2614         CSSPropertyNames.in:
2615         - SkipBuilder: Indicates that no StyleBuilder code should be generated
2616           for this property.
2617         - Shorthand: Indicates that this is a shorthand property, which therefore
2618           does not use the StyleBuilder. makeprop.pl will merely generate
2619           assertions for such properties, to validate that this is a shorthand
2620           property and that the StyleBuilder code is never reached.
2621
2622         * css/CSSPropertyNames.in:
2623         * css/SVGCSSStyleSelector.cpp:
2624         (WebCore::StyleResolver::applySVGProperty):
2625         * css/StyleResolver.cpp:
2626         (WebCore::StyleResolver::applyProperty):
2627         * css/makeprop.pl:
2628
2629 2015-01-09  Brent Fulgham  <bfulgham@apple.com>
2630
2631         [Win] Build fix after r178219.
2632
2633         * WebCore.vcxproj/WebCore.vcxproj: Remove PaintHooks.asm references in project file.
2634         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2635
2636 2015-01-09  Andreas Kling  <akling@apple.com>
2637
2638         Log which ActiveDOMObject(s) can't be suspended for PageCache.
2639         <https://webkit.org/b/139697>
2640
2641         Reviewed by Chris Dumez.
2642
2643         Give ActiveDOMObject a pure virtual activeDOMObjectName() so we can
2644         find their names.
2645
2646         Dump the names of all the ActiveDOMObjects that fail to suspend when
2647         we're trying to put a page into PageCache.
2648
2649         * Modules/encryptedmedia/MediaKeySession.h:
2650         * Modules/geolocation/Geolocation.h:
2651         * Modules/indexeddb/IDBDatabase.h:
2652         * Modules/indexeddb/IDBRequest.h:
2653         * Modules/indexeddb/IDBTransaction.h:
2654         * Modules/mediasource/MediaSource.h:
2655         * Modules/mediasource/SourceBuffer.h:
2656         * Modules/mediastream/MediaStreamTrack.h:
2657         * Modules/mediastream/RTCDTMFSender.h:
2658         * Modules/mediastream/RTCPeerConnection.h:
2659         * Modules/mediastream/RTCSessionDescriptionRequestImpl.h:
2660         * Modules/mediastream/RTCStatsRequestImpl.h:
2661         * Modules/mediastream/RTCVoidRequestImpl.h:
2662         * Modules/notifications/Notification.h:
2663         * Modules/notifications/NotificationCenter.h:
2664         * Modules/webaudio/AudioContext.h:
2665         * Modules/webdatabase/DatabaseContext.h:
2666         * Modules/websockets/WebSocket.h:
2667         * WebCore.exp.in:
2668         * css/FontLoader.h:
2669         * dom/ActiveDOMObject.h:
2670         * dom/ScriptExecutionContext.cpp:
2671         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects):
2672         * dom/ScriptExecutionContext.h:
2673         * fileapi/FileReader.h:
2674         * history/PageCache.cpp:
2675         (WebCore::logCanCacheFrameDecision):
2676         * html/HTMLMarqueeElement.h:
2677         * html/HTMLMediaElement.h:
2678         * html/PublicURLManager.h:
2679         * html/canvas/WebGLRenderingContext.h:
2680         * page/EventSource.h:
2681         * page/SuspendableTimer.h:
2682         * workers/AbstractWorker.h:
2683         * xml/XMLHttpRequest.h:
2684
2685 2015-01-09  Anders Carlsson  <andersca@apple.com>
2686
2687         Get rid of the database strategy
2688         https://bugs.webkit.org/show_bug.cgi?id=140322
2689
2690         Reviewed by Sam Weinig.
2691
2692         * CMakeLists.txt:
2693         * Modules/webdatabase/DatabaseManager.cpp:
2694         (WebCore::DatabaseManager::ProposedDatabase::ProposedDatabase):
2695         (WebCore::DatabaseManager::DatabaseManager):
2696         * WebCore.exp.in:
2697         * WebCore.vcxproj/WebCore.vcxproj:
2698         * WebCore.vcxproj/WebCore.vcxproj.filters:
2699         * WebCore.xcodeproj/project.pbxproj:
2700         * platform/DatabaseStrategy.cpp: Removed.
2701         * platform/DatabaseStrategy.h: Removed.
2702         * platform/PlatformStrategies.h:
2703         (WebCore::PlatformStrategies::PlatformStrategies):
2704         (WebCore::PlatformStrategies::databaseStrategy): Deleted.
2705
2706 2015-01-06  Anders Carlsson  <andersca@apple.com>
2707
2708         Move the Windows only plug-in code to WebKit/win
2709         https://bugs.webkit.org/show_bug.cgi?id=140133
2710
2711         Reviewed by Darin Adler.
2712
2713         * WebCore.vcxproj/WebCore.vcxproj:
2714         * WebCore.vcxproj/WebCore.vcxproj.filters:
2715
2716 2015-01-09  Anders Carlsson  <andersca@apple.com>
2717
2718         Another Windows build fix.
2719
2720         * DerivedSources.cpp:
2721
2722 2015-01-09  Enrica Casucci  <enrica@apple.com>
2723
2724         [iOS] Support additional text styles.
2725         https://bugs.webkit.org/show_bug.cgi?id=140310
2726         rdar://problem/18568864
2727
2728         Reviewed by Joseph Pecoraro.
2729
2730         Add support for three new text styles.
2731
2732         * css/CSSValueKeywords.in:
2733         * rendering/RenderThemeIOS.mm:
2734         (WebCore::RenderThemeIOS::systemFont):
2735
2736 2015-01-09  Anders Carlsson  <andersca@apple.com>
2737
2738         Fix Windows build.
2739
2740         * bindings/js/JSBindingsAllInOne.cpp:
2741
2742 2015-01-09  Anders Carlsson  <andersca@apple.com>
2743
2744         Remove more worker database code
2745         https://bugs.webkit.org/show_bug.cgi?id=140320
2746
2747         Reviewed by Tim Horton.
2748
2749         * workers/WorkerThread.cpp:
2750         (WebCore::WorkerThread::stop):
2751
2752 2015-01-09  Anders Carlsson  <andersca@apple.com>
2753
2754         Remove more sync database code
2755         https://bugs.webkit.org/show_bug.cgi?id=140318
2756
2757         Reviewed by Sam Weinig.
2758
2759         * CMakeLists.txt:
2760         * DerivedSources.make:
2761         * Modules/webdatabase/DatabaseBackendSync.cpp: Removed.
2762         * Modules/webdatabase/DatabaseBackendSync.h: Removed.
2763         * Modules/webdatabase/DatabaseCallback.h:
2764         * Modules/webdatabase/DatabaseCallback.idl:
2765         * Modules/webdatabase/DatabaseManager.cpp:
2766         (WebCore::DatabaseManager::openDatabaseSync): Deleted.
2767         * Modules/webdatabase/DatabaseManager.h:
2768         * Modules/webdatabase/DatabaseServer.cpp:
2769         (WebCore::DatabaseServer::createDatabase):
2770         * Modules/webdatabase/DatabaseSync.cpp: Removed.
2771         * Modules/webdatabase/DatabaseSync.h: Removed.
2772         * Modules/webdatabase/DatabaseSync.idl: Removed.
2773         * Modules/webdatabase/SQLStatementSync.cpp: Removed.
2774         * Modules/webdatabase/SQLStatementSync.h: Removed.
2775         * Modules/webdatabase/SQLTransactionBackendSync.cpp: Removed.
2776         * Modules/webdatabase/SQLTransactionBackendSync.h: Removed.
2777         * Modules/webdatabase/SQLTransactionSync.cpp: Removed.
2778         * Modules/webdatabase/SQLTransactionSync.h: Removed.
2779         * Modules/webdatabase/SQLTransactionSync.idl: Removed.
2780         * Modules/webdatabase/SQLTransactionSyncCallback.h: Removed.
2781         * Modules/webdatabase/SQLTransactionSyncCallback.idl: Removed.
2782         * WebCore.vcxproj/WebCore.vcxproj:
2783         * WebCore.vcxproj/WebCore.vcxproj.filters:
2784         * WebCore.xcodeproj/project.pbxproj:
2785         * bindings/js/JSSQLTransactionSyncCustom.cpp: Removed.
2786
2787 2015-01-09  Joseph Pecoraro  <pecoraro@apple.com>
2788
2789         Web Inspector: Remove or use TimelineAgent Resource related event types
2790         https://bugs.webkit.org/show_bug.cgi?id=140155
2791
2792         Reviewed by Timothy Hatcher.
2793
2794         Remove unused timeline events. The frontend was ignoring these events
2795         and was often already getting nearly identical data from the Network domain.
2796
2797         * WebCore.exp.in:
2798         * inspector/InspectorInstrumentation.cpp:
2799         (WebCore::InspectorInstrumentation::willSendRequestImpl):
2800         (WebCore::InspectorInstrumentation::willReceiveResourceResponseImpl):
2801         (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
2802         (WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl):
2803         (WebCore::InspectorInstrumentation::didFinishLoadingImpl):
2804         (WebCore::InspectorInstrumentation::didFailLoadingImpl):
2805         (WebCore::InspectorInstrumentation::didScheduleResourceRequestImpl): Deleted.
2806         (WebCore::InspectorInstrumentation::willReceiveResourceDataImpl): Deleted.
2807         (WebCore::InspectorInstrumentation::didReceiveResourceDataImpl): Deleted.
2808         * inspector/InspectorInstrumentation.h:
2809         (WebCore::InspectorInstrumentation::willReceiveResourceResponse):
2810         (WebCore::InspectorInstrumentation::didScheduleResourceRequest): Deleted.
2811         (WebCore::InspectorInstrumentation::willReceiveResourceData): Deleted.
2812         (WebCore::InspectorInstrumentation::didReceiveResourceData): Deleted.
2813         * inspector/InspectorTimelineAgent.cpp:
2814         (WebCore::toProtocol):
2815         (WebCore::InspectorTimelineAgent::didScheduleResourceRequest): Deleted.
2816         (WebCore::InspectorTimelineAgent::willSendResourceRequest): Deleted.
2817         (WebCore::InspectorTimelineAgent::willReceiveResourceData): Deleted.
2818         (WebCore::InspectorTimelineAgent::didReceiveResourceData): Deleted.
2819         (WebCore::InspectorTimelineAgent::willReceiveResourceResponse): Deleted.
2820         (WebCore::InspectorTimelineAgent::didReceiveResourceResponse): Deleted.
2821         (WebCore::InspectorTimelineAgent::didFinishLoadingResource): Deleted.
2822         * inspector/InspectorTimelineAgent.h:
2823         * inspector/TimelineRecordFactory.cpp:
2824         (WebCore::TimelineRecordFactory::createScheduleResourceRequestData): Deleted.
2825         (WebCore::TimelineRecordFactory::createResourceSendRequestData): Deleted.
2826         (WebCore::TimelineRecordFactory::createResourceReceiveResponseData): Deleted.
2827         (WebCore::TimelineRecordFactory::createResourceFinishData): Deleted.
2828         (WebCore::TimelineRecordFactory::createReceiveResourceData): Deleted.
2829         * inspector/TimelineRecordFactory.h:
2830         * loader/DocumentThreadableLoader.cpp:
2831         (WebCore::DocumentThreadableLoader::didReceiveResponse):
2832         * loader/ResourceLoadNotifier.cpp:
2833         (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
2834         * loader/ResourceLoadScheduler.cpp:
2835         (WebCore::ResourceLoadScheduler::scheduleLoad):
2836         (WebCore::ResourceLoadScheduler::notifyDidScheduleResourceRequest): Deleted.
2837         * loader/ResourceLoadScheduler.h:
2838         * loader/ResourceLoader.cpp:
2839         (WebCore::ResourceLoader::didReceiveData):
2840         (WebCore::ResourceLoader::didReceiveBuffer):
2841         * loader/appcache/ApplicationCacheGroup.cpp:
2842         (WebCore::ApplicationCacheGroup::didReceiveResponse):
2843         * loader/mac/ResourceLoaderMac.mm:
2844         (WebCore::ResourceLoader::didReceiveDataArray):
2845
2846 2015-01-09  Benjamin Poulain  <bpoulain@apple.com>
2847
2848         Update r177745, one of the review comments was not integrated
2849
2850         * css/SelectorCheckerTestFunctions.h:
2851         (WebCore::matchesLangPseudoClass):
2852         I cq+ before Dhi could make an update and this was left out.
2853
2854 2015-01-09  Benjamin Poulain  <benjamin@webkit.org>
2855
2856         Fix error handling of ContentExtensionsManager when the top level input is unusable
2857         https://bugs.webkit.org/show_bug.cgi?id=140284
2858
2859         Reviewed by Andreas Kling.
2860
2861         There are a couple of ways the WebProcess would crash if the input
2862         is really really bad:
2863         -If the JSON is unreadable, we can have an exception or decodedRules can be null.
2864         -On any of the error, we cannot return immediately or we will skip vm.clear().
2865
2866         This patch adds a branch to fix the first issue.
2867
2868         For the second issue, a new function, loadEncodedRules(), encapsulate all the early
2869         returns to make sure we execute the end of loadExtension().
2870
2871         * contentextensions/ContentExtensionsManager.cpp:
2872         (WebCore::ContentExtensions::ExtensionsManager::loadEncodedRules):
2873         (WebCore::ContentExtensions::ExtensionsManager::loadExtension):
2874
2875 2015-01-09  Bem Jones-Bey  <bjonesbe@adobe.com>
2876
2877         Simplify LineWidth::wrapNextToShapeOutside()
2878         https://bugs.webkit.org/show_bug.cgi?id=140304
2879
2880         Reviewed by Zoltan Horvath.
2881
2882         This function used to manually check to see if the entire height of
2883         the line would have enough space next to the float. However, the code
2884         to compute the offsets will do this automatically (and probably a lot
2885         faster), if the line height is passed in. This patch does just that.
2886
2887         No new tests, no behavior change.
2888
2889         * rendering/line/LineWidth.cpp:
2890         (WebCore::availableWidthAtOffset): Remove now unused override, allow
2891             passing in lineHeight.
2892         (WebCore::LineWidth::wrapNextToShapeOutside): Pass the lineHeight
2893             when computing the available width, so we don't need to check
2894             isWholeLineFit anymore.
2895         (WebCore::isWholeLineFit): Deleted.
2896
2897 2015-01-09  Bem Jones-Bey  <bjonesbe@adobe.com>
2898
2899         [CSS Shapes] content inside second shape area when two floats interact
2900         https://bugs.webkit.org/show_bug.cgi?id=137702
2901
2902         Reviewed by Zalan Bujtas.
2903
2904         If a float has a shape-outside, we cannot assume that it has a uniform
2905         width for the height of the float, so we cannot use simple line
2906         layout.
2907
2908         Test: fast/shapes/shape-outside-floats/shape-outside-text-overlap-float.html
2909
2910         * rendering/SimpleLineLayout.cpp:
2911         (WebCore::SimpleLineLayout::canUseFor): Don't use simple line layout
2912             if we have shape-outside. Also, rename floatRenderer to
2913             floatingObject, since the variable doesn't contain a renderer.
2914
2915 2015-01-09  Chris Dumez  <cdumez@apple.com>
2916
2917         Allow HTTPS + 'Cache-control: no-store' sub-frames into the page cache
2918         https://bugs.webkit.org/show_bug.cgi?id=140302
2919
2920         Reviewed by Andreas Kling.
2921
2922         Allow HTTPS + 'Cache-control: no-store' sub-frames into the page cache.
2923         We already restore 'no-store' sub-resources on history navigation from
2924         the memory cache so there is no reason for our page cache policy to be
2925         more restrictive.
2926
2927         We should align our memory cache / history navigation policy with our
2928         page cache policy.
2929
2930         For now, 'no-store' main resources are not restored from either cache
2931         (memory cache / page cache) on history navigation though. This behavior
2932         does not change.
2933
2934         Test: http/tests/navigation/https-no-store-subframe-in-page-cache.html
2935
2936         * history/PageCache.cpp:
2937         (WebCore::logCanCacheFrameDecision):
2938         (WebCore::PageCache::canCachePageContainingThisFrame):
2939
2940 2015-01-09  Anders Carlsson  <andersca@apple.com>
2941
2942         Try to trigger a rebuild of generated JS bindings.
2943
2944         * bindings/scripts/CodeGeneratorJS.pm:
2945
2946 2015-01-09  Chris Dumez  <cdumez@apple.com>
2947
2948         Add support for SVG CSS Properties to the new StyleBuilder
2949         https://bugs.webkit.org/show_bug.cgi?id=140277
2950
2951         Reviewed by Andreas Kling.
2952
2953         Update the new StyleBuilder generator to add support for SVG CSS
2954         Properties whose methods are on SVGRenderStyle instead of RenderStyle.
2955
2956         A new "SVG" parameter is now supported by makeprop.pl to correctly
2957         generate such properties.
2958
2959         * CMakeLists.txt:
2960         * DerivedSources.make:
2961         * WebCore.xcodeproj/project.pbxproj:
2962         * css/CSSPropertyNames.in:
2963         * css/SVGCSSPropertyNames.in: Removed.
2964         Merged SVG CSS properties into CSSPropertyNames.in. I personally don't
2965         think having a separate file for SVG CSS properties is really helpful.
2966
2967         * css/SVGCSSStyleSelector.cpp:
2968         (WebCore::StyleResolver::applySVGProperty):
2969         Drop legacy StyleBuilder code for several SVG properties and generate
2970         them instead. Those are trivial and do not require any custom code or
2971         converter.
2972
2973         * css/StyleResolver.cpp:
2974         Update the id of the first low-priority property.
2975
2976         * css/makeprop.pl:
2977         Add support for SVG CSS Properties whose methods are on SVGRenderStyle
2978         instead of RenderStyle.
2979
2980 2015-01-08  Anders Carlsson  <andersca@apple.com>
2981
2982         Start removing Web Database support from workers
2983         https://bugs.webkit.org/show_bug.cgi?id=140271
2984
2985         Reviewed by Sam Weinig.
2986
2987         Remove WorkerGlobalScopeWebDatabase which is the entry point for web database in workers.
2988
2989         * CMakeLists.txt:
2990         * DerivedSources.make:
2991         * Modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp: Removed.
2992         * Modules/webdatabase/WorkerGlobalScopeWebDatabase.h: Removed.
2993         * Modules/webdatabase/WorkerGlobalScopeWebDatabase.idl: Removed.
2994         * WebCore.vcxproj/WebCore.vcxproj:
2995         * WebCore.vcxproj/WebCore.vcxproj.filters:
2996         * WebCore.xcodeproj/project.pbxproj:
2997
2998 2015-01-09  Brent Fulgham  <bfulgham@apple.com>
2999
3000         [Win] Layout Test fast/canvas/canvas-path-addPath.html is failing
3001         https://bugs.webkit.org/show_bug.cgi?id=140303
3002         <rdar://problem/19428865>
3003
3004         Reviewed by Simon Fraser.
3005
3006         Although the code clearly states that CG doesn't allow adding a path to itself,
3007         and branches to handle this case, it simply uses the branch to try adding the
3008         path to itself (ignoring the copy it just made)!
3009
3010         Fix this copy/paste bug so that we use the copy and avoid violating the CG 
3011         API contract.
3012
3013         * platform/graphics/cg/PathCG.cpp:
3014         (WebCore::Path::addPath): Fix path used.
3015
3016 2015-01-09  Andreas Kling  <akling@apple.com>
3017
3018         [Cocoa] Make decoded image data purgeable ASAP.
3019         <https://webkit.org/b/140298>
3020
3021         Reviewed by Antti Koivisto.
3022
3023         Mark decoded images as "transient" which makes CoreGraphics mark
3024         the backing stores as purgeable shortly after they're used.
3025
3026         The decoded representation will remain in CoreGraphics's caches
3027         indefinitely unless the kernel gets starved and needs the pages.
3028
3029         Most resources will now reach a state where the encoded data is
3030         mmap'ed from disk cache (once the entire resource is downloaded)
3031         and the decoded data is purgeable.
3032
3033         This also has the side effect of making the MemoryCache more
3034         palatial since the decoded data cost can be deducted for images,
3035         allowing us to cache more resources.
3036
3037         Note that the worst case for this new behavior would be something
3038         like hovering below 100% memory utilization and constantly having
3039         to drop and re-decode images. While churny, it still beats
3040         crashing the process, plus there's tiling to remove many of the
3041         reasons we'd need the decoded data.
3042
3043         * platform/graphics/cg/ImageSourceCG.cpp:
3044         (WebCore::ImageSource::createFrameAtIndex):
3045
3046 2015-01-09  Gwang Yoon Hwang  <yoon@igalia.com>
3047
3048         Rename GraphicsLayerAnimation to TextureMapperAnimation
3049         https://bugs.webkit.org/show_bug.cgi?id=140296
3050
3051         Reviewed by Martin Robinson.
3052
3053         GraphicsLayerAnimation is only used by TextureMapper and CoordinatedGraphics.
3054         This should be placed in the platform/graphics/texmap.
3055         And this patch also changes its name to TextureMapperAnimation to remove ambiguity.
3056
3057         No new tests because this is a simply refactoring.
3058
3059         * CMakeLists.txt:
3060         * WebCore.vcxproj/WebCore.vcxproj:
3061         * WebCore.vcxproj/WebCore.vcxproj.filters:
3062         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3063         (WebCore::GraphicsLayerTextureMapper::addAnimation):
3064         (WebCore::GraphicsLayerTextureMapper::setAnimations):
3065         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3066         * platform/graphics/texmap/TextureMapperAnimation.cpp: Renamed from Source/WebCore/platform/graphics/GraphicsLayerAnimation.cpp.
3067         * platform/graphics/texmap/TextureMapperAnimation.h: Renamed from Source/WebCore/platform/graphics/GraphicsLayerAnimation.h.
3068         * platform/graphics/texmap/TextureMapperLayer.cpp:
3069         (WebCore::TextureMapperLayer::setAnimations):
3070         * platform/graphics/texmap/TextureMapperLayer.h:
3071         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3072         (WebCore::CoordinatedGraphicsLayer::addAnimation):
3073         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3074         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3075
3076 2015-01-09  Antti Koivisto  <antti@apple.com>
3077
3078         FontCache should only deal with SimpleFontData
3079         https://bugs.webkit.org/show_bug.cgi?id=140293
3080
3081         Reviewed by Andreas Kling.
3082
3083         FontCache::fontForFamilyAtIndex hands out FontData objects and calls to FontSelector. That sort
3084         of code does not belong to the cache layer. Move the functionality up to FontGlyphs.
3085
3086         * platform/graphics/Font.cpp:
3087         (WebCore::Font::operator==):
3088         (WebCore::Font::drawText):
3089         (WebCore::Font::drawEmphasisMarks):
3090         (WebCore::Font::isLoadingCustomFonts):
3091         * platform/graphics/Font.h:
3092         (WebCore::Font::loadingCustomFonts): Deleted.
3093         * platform/graphics/FontCache.cpp:
3094         (WebCore::FontCache::similarFontPlatformData):
3095
3096             Generic null implementation to reduce #ifs.
3097
3098         (WebCore::FontCache::fontForFamilyAtIndex): Deleted.
3099         * platform/graphics/FontCache.h:
3100
3101             Unfriend FontGlyphs.
3102
3103         * platform/graphics/FontGlyphs.cpp:
3104         (WebCore::FontGlyphs::FontGlyphs):
3105         (WebCore::FontGlyphs::isLoadingCustomFonts):
3106
3107             We can figure thus out cheaply without caching a bit.
3108
3109         (WebCore::realizeNextFamily):
3110         (WebCore::FontGlyphs::realizeFontDataAt):
3111
3112             Reorganize a bit to make the logic clearer.
3113             Get rid of the strange cAllFamiliesScanned constant.
3114
3115         (WebCore::FontGlyphs::glyphDataForVariant):
3116         (WebCore::FontGlyphs::glyphDataForNormalVariant):
3117
3118             Loop until null, that always works.
3119
3120         * platform/graphics/FontGlyphs.h:
3121         (WebCore::FontGlyphs::loadingCustomFonts): Deleted.
3122         * platform/graphics/ios/FontCacheIOS.mm:
3123         (WebCore::FontCache::similarFontPlatformData):
3124         * platform/graphics/mac/FontCacheMac.mm:
3125         (WebCore::FontCache::similarFontPlatformData):
3126         * platform/graphics/mac/FontMac.mm:
3127         (WebCore::Font::dashesForIntersectionsWithRect):
3128
3129 2015-01-09  Csaba Osztrogonác  <ossy@webkit.org>
3130
3131         REGRESSION(r177925): It broke the !ENABLE(INSPECTOR) build
3132         https://bugs.webkit.org/show_bug.cgi?id=140098
3133
3134         Reviewed by Brian Burg.
3135
3136         * inspector/InspectorInstrumentationCookie.cpp: Removed ENABLE(INSPECTOR) guard,
3137         becaue InspectorInstrumentationCookie is used everywhere unconditionally.
3138         * inspector/InspectorInstrumentationCookie.h: Removed ENABLE(INSPECTOR) guard.
3139         * loader/appcache/ApplicationCacheGroup.h: Removed ENABLE(INSPECTOR) guard around
3140         m_currentResourceIdentifier, because it is used unconditionally in the cpp.
3141
3142 2015-01-09  Byungseon Shin  <sun.shin@lge.com>
3143
3144         [EFL] Fix crash introduced in r178029
3145         https://bugs.webkit.org/show_bug.cgi?id=140289
3146
3147         Reviewed by Martin Robinson.
3148
3149         Clearing childClippingMaskLayer of CoordinatedGraphics should be called
3150         before clearing childClippingLayer.
3151
3152         No new tests, covered by existing tests.
3153
3154         * rendering/RenderLayerBacking.cpp:
3155         (WebCore::RenderLayerBacking::~RenderLayerBacking):
3156
3157 2015-01-08  Enrica Casucci  <enrica@apple.com>
3158
3159         [iOS] Cannot paste an image URL in a plain text field in a page.
3160         https://bugs.webkit.org/show_bug.cgi?id=140274
3161         rdar://problem/18590809
3162
3163         Reviewed by Alexey Proskuryakov.
3164
3165         When we want to get plain text from the pasteboard, we
3166         should also try kUTTypeURL if there is no kUTTypeText available.
3167
3168         * WebCore.exp.in:
3169         * platform/ios/PasteboardIOS.mm:
3170         (WebCore::Pasteboard::read):
3171         * platform/ios/PlatformPasteboardIOS.mm:
3172         (WebCore::PlatformPasteboard::readString):
3173
3174 2015-01-09  Commit Queue  <commit-queue@webkit.org>
3175
3176         Unreviewed, rolling out r178154, r178163, and r178164.
3177         https://bugs.webkit.org/show_bug.cgi?id=140292
3178
3179         Still multiple assertion failures on tests (Requested by ap on
3180         #webkit).
3181
3182         Reverted changesets:
3183
3184         "Modernize and streamline HTMLTokenizer"
3185         https://bugs.webkit.org/show_bug.cgi?id=140166
3186         http://trac.webkit.org/changeset/178154
3187
3188         "Unreviewed speculative buildfix after r178154."
3189         http://trac.webkit.org/changeset/178163
3190
3191         "One more unreviewed speculative buildfix after r178154."
3192         http://trac.webkit.org/changeset/178164
3193
3194 2015-01-09  Bartlomiej Gajda  <b.gajda@samsung.com>
3195
3196         [MSE] Implement Append Window support.
3197         https://bugs.webkit.org/show_bug.cgi?id=139861
3198
3199         Reviewed by Jer Noble.
3200
3201         Implement Append Windows support for SourceBuffer as per spec.
3202         Also change order in idl to match spec order.
3203
3204         Test: media/media-source/media-source-append-buffer-with-append-window.html
3205
3206         * Modules/mediasource/SourceBuffer.cpp:
3207         (WebCore::SourceBuffer::SourceBuffer):
3208         (WebCore::SourceBuffer::appendWindowStart):
3209         (WebCore::SourceBuffer::setAppendWindowStart):
3210         (WebCore::SourceBuffer::appendWindowEnd):
3211         (WebCore::SourceBuffer::setAppendWindowEnd):
3212         (WebCore::SourceBuffer::abort):
3213         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3214         * Modules/mediasource/SourceBuffer.h:
3215         * Modules/mediasource/SourceBuffer.idl:
3216
3217 2015-01-09  Chris Fleizach  <cfleizach@apple.com>
3218
3219         AX: Crash at -[WebAccessibilityObjectWrapperBase accessibilityTitle] + 31
3220         https://bugs.webkit.org/show_bug.cgi?id=140286
3221
3222         Reviewed by Mario Sanchez Prada.
3223
3224         This is crashing because AppKit is checking if certain method names like "accessibilityTitle" exist,
3225         and then it bypasses accessibilityAttributeValue: to call directly into those methods.
3226
3227         That bypasses are safety checks. I think a safe way to avoid this is rename our methods.
3228
3229         No new tests, problem only occurs when triggered through AppKit.
3230
3231         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3232         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
3233         (-[WebAccessibilityObjectWrapper accessibilityHint]):
3234         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
3235         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3236         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
3237         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
3238         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
3239         (-[WebAccessibilityObjectWrapperBase accessibilityTitle]): Deleted.
3240         (-[WebAccessibilityObjectWrapperBase accessibilityDescription]): Deleted.
3241         (-[WebAccessibilityObjectWrapperBase accessibilityHelpText]): Deleted.
3242         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3243         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3244
3245 2015-01-06  Philippe Normand  <pnormand@igalia.com>
3246
3247         [GStreamer][MSE] ASSERT in MediaSourceClientGStreamer::addSourceBuffer
3248         https://bugs.webkit.org/show_bug.cgi?id=140119
3249
3250         Reviewed by Carlos Garcia Campos.
3251
3252         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
3253         (WebCore::MediaSourceClientGStreamer::addSourceBuffer): Use a raw
3254         pointer for the ghost pad, its reference is then taken once attached
3255         to the parent element.
3256
3257 2015-01-09  Zan Dobersek  <zdobersek@igalia.com>
3258
3259         After r178166, ANGLE's EGL/GLES/GLES2 headers are included before the
3260         system-default headers because the Source/ThirdParty/ANGLE/include
3261         directory is searched through. This shouldn't be the case for ports
3262         which want to use system-default headers and are searching for them
3263         explicitly. To avoid that, OPENGL_INCLUDE_DIR or OPENGLES2_INCLUDE_DIR
3264         should be added to WebCore_INCLUDE_DIRECTORIES before ANGLE directories.
3265
3266         Rubber-stamped by Carlos Garcia Campos.
3267
3268         * CMakeLists.txt:
3269
3270 2015-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3271
3272         Use angle-bracket form to include external headers in WebCore
3273         https://bugs.webkit.org/show_bug.cgi?id=140288
3274
3275         Reviewed by Žan Doberšek.
3276
3277         * CMakeLists.txt:
3278         * platform/graphics/GraphicsContext.cpp:
3279         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3280         * platform/graphics/harfbuzz/HarfBuzzFace.cpp:
3281         * platform/graphics/harfbuzz/HarfBuzzFaceCoreText.cpp:
3282         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3283         * platform/graphics/mac/GraphicsContext3DMac.mm:
3284         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
3285         * platform/graphics/win/GraphicsContext3DWin.cpp:
3286         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
3287         * platform/image-decoders/png/PNGImageDecoder.cpp:
3288         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
3289         * platform/image-encoders/JPEGImageEncoder.cpp:
3290         * platform/image-encoders/PNGImageEncoder.cpp:
3291         * platform/text/TextEncodingDetectorICU.cpp:
3292
3293 2015-01-09  Csaba Osztrogonác  <ossy@webkit.org>
3294
3295         One more unreviewed speculative buildfix after r178154.
3296
3297         * xml/parser/CharacterReferenceParserInlines.h:
3298         (WebCore::consumeCharacterReference): Remove highestValidCharacter too, it became unused after r178163.
3299
3300 2015-01-08  Csaba Osztrogonác  <ossy@webkit.org>
3301
3302         Unreviewed speculative buildfix after r178154.
3303
3304         * xml/parser/CharacterReferenceParserInlines.h:
3305         (WebCore::consumeCharacterReference): Remove unused overflow variable.
3306
3307 2015-01-08  Darin Adler  <darin@apple.com>
3308
3309         Remove strange CharacterData::dataImpl function
3310         https://bugs.webkit.org/show_bug.cgi?id=140115
3311
3312         Reviewed by Anders Carlsson.
3313
3314         Every call site could just use the data function instead.
3315
3316         * dom/CharacterData.h:
3317         (WebCore::CharacterData::dataImpl): Deleted.
3318
3319         * dom/Text.cpp:
3320         (WebCore::Text::splitText): Use data instead of dataImpl.
3321         (WebCore::Text::createTextRenderer): Ditto.
3322
3323         * rendering/RenderCombineText.cpp:
3324         (WebCore::RenderCombineText::RenderCombineText): Updated to take
3325         const String&. We missed this class when RenderText changed.
3326         * rendering/RenderCombineText.h: Ditto.
3327
3328         * style/StyleResolveTree.cpp:
3329         (WebCore::Style::updateTextRendererAfterContentChange): Use data.
3330
3331 2015-01-08  Chris Dumez  <cdumez@apple.com>
3332
3333         ASSERTION FAILED: !valueWithCalculation.calculation() in WebCore::CSSParser::validateCalculationUnit
3334         https://bugs.webkit.org/show_bug.cgi?id=140251
3335
3336         Reviewed by Darin Adler.
3337
3338         Using a calculated value for text-shadow's blur-radius was hitting an
3339         assertion in CSSParser::validateCalculationUnit() because validUnit()
3340         is called twice, first with 'FLength' unit, then more stricly with
3341         'FLength|FNonNeg' if parsing the blur-radius as it cannot be negative
3342         as per the specification:
3343         - http://dev.w3.org/csswg/css-text-decor-3/#text-shadow-property
3344         - http://dev.w3.org/csswg/css-backgrounds-3/#shadow
3345
3346         On the second call, the ValueWithCalculation's m_calculation member
3347         was already initialized and the code did not handle this. This patch
3348         updates validateCalculationUnit() to teach it to reuse the previously
3349         parsed calculation in this case. All it needs to do is to update the
3350         existing CSSCalcValue's range to allow negative values or not.
3351
3352         When writing the layout test for this, I also noticed that the CSS
3353         parser was not rejecting negative calculated values for blur-radius
3354         (only negative non-calculated ones). This is because
3355         validateCalculationUnit() was ignoring FNonNeg if the calculated
3356         value is a Length. This patch also addresses the issue.
3357
3358         Test: fast/css/text-shadow-calc-value.html
3359
3360         * css/CSSCalculationValue.h:
3361         (WebCore::CSSCalcValue::setPermittedValueRange):
3362         Add a setter to update the CSSCalculationValue's permitted value range
3363         so that the CSS parser does not need to fully reparse the calculation
3364         only to update the permitted value range.
3365
3366         * css/CSSParser.cpp:
3367         (WebCore::CSSParser::validateCalculationUnit):
3368         - Teach the code to reuse the previously parsed calculation value.
3369         - Do the FNonNeg check for Length calculations as well.
3370
3371 2015-01-08  Darin Adler  <darin@apple.com>
3372
3373         Modernize and streamline HTMLTokenizer
3374         https://bugs.webkit.org/show_bug.cgi?id=140166
3375
3376         Reviewed by Sam Weinig.
3377
3378         * html/parser/AtomicHTMLToken.h:
3379         (WebCore::AtomicHTMLToken::initializeAttributes): Removed unneeded assertions
3380         based on fields I removed.
3381
3382         * html/parser/HTMLDocumentParser.cpp:
3383         (WebCore::HTMLDocumentParser::HTMLDocumentParser): Change to use updateStateFor
3384         to set the initial state when parsing a fragment, since it implements the same
3385         rule taht the tokenizerStateForContextElement function did.
3386         (WebCore::HTMLDocumentParser::pumpTokenizer): Updated to use the revised
3387         interfaces for HTMLSourceTracker and HTMLTokenizer.
3388         (WebCore::HTMLDocumentParser::constructTreeFromHTMLToken): Changed to take a
3389         TokenPtr instead of an HTMLToken, so we can clear out the TokenPtr earlier
3390         for non-character tokens, and let them get cleared later for character tokens.
3391         (WebCore::HTMLDocumentParser::insert): Pass references.
3392         (WebCore::HTMLDocumentParser::append): Ditto.
3393         (WebCore::HTMLDocumentParser::appendCurrentInputStreamToPreloadScannerAndScan): Ditto.
3394
3395         * html/parser/HTMLDocumentParser.h: Updated argument type for constructTreeFromHTMLToken
3396         and removed now-unneeded m_token data members.
3397
3398         * html/parser/HTMLEntityParser.cpp: Removed unneeded uses of the inline keyword.
3399         (WebCore::HTMLEntityParser::consumeNamedEntity): Replaced two uses of
3400         advanceAndASSERT with just plain advance; there's really no need to assert the
3401         character is the one we just got out of the string.
3402
3403         * html/parser/HTMLInputStream.h: Moved the include of TextPosition.h here from
3404         its old location since this class has two data members that are OrdinalNumber.
3405
3406         * html/parser/HTMLMetaCharsetParser.cpp:
3407         (WebCore::HTMLMetaCharsetParser::HTMLMetaCharsetParser): Removed most of the
3408         initialization, since it's now done by defaults.
3409         (WebCore::extractCharset): Rewrote this to be a non-member function, and to
3410         use a for loop, and to handle quote marks in a simpler way. Also changed it
3411         to return a StringView so we don't have to allocate a new string.
3412         (WebCore::HTMLMetaCharsetParser::processMeta): Use a modern for loop, and
3413         also take a token argument since it's no longer a data member.
3414         (WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes): Use a modern for
3415         loop, StringView instead of string, and don't bother naming the local enum.
3416         (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Updated for the new
3417         way of getting tokens from the tokenizer.
3418
3419         * html/parser/HTMLMetaCharsetParser.h: Got rid of some data members and
3420         tightened up the formatting a little. Don't bother allocating the tokenizer
3421         on the heap.
3422
3423         * html/parser/HTMLPreloadScanner.cpp:
3424         (WebCore::TokenPreloadScanner::TokenPreloadScanner): Removed unneeded
3425         initialization.
3426         (WebCore::HTMLPreloadScanner::HTMLPreloadScanner): Ditto.
3427         (WebCore::HTMLPreloadScanner::scan): Changed to take a reference.
3428
3429         * html/parser/HTMLPreloadScanner.h: Removed unneeded includes, typedefs,
3430         and forward declarations. Removed explicit declaration of the destructor,
3431         since the default one works. Removed unused createCheckpoint and rewindTo
3432         functions. Gave initial values for various data members. Marked the device
3433         scale factor const beacuse it's set in the constructor and never changed.
3434         Also removed the unneeded isSafeToSendToAnotherThread.
3435
3436         * html/parser/HTMLResourcePreloader.cpp:
3437         (WebCore::PreloadRequest::isSafeToSendToAnotherThread): Deleted.
3438
3439         * html/parser/HTMLResourcePreloader.h:
3440         (WebCore::PreloadRequest::PreloadRequest): Removed unneeded calls to
3441         isolatedCopy. Also removed isSafeToSendToAnotherThread.
3442
3443         * html/parser/HTMLSourceTracker.cpp:
3444         (WebCore::HTMLSourceTracker::startToken): Renamed. Changed to keep state
3445          in the source tracker itself, not the token.
3446         (WebCore::HTMLSourceTracker::endToken): Ditto.
3447         (WebCore::HTMLSourceTracker::source): Renamed. Changed to use the state
3448         from the source tracker.
3449
3450         * html/parser/HTMLSourceTracker.h: Removed unneeded include of HTMLToken.h.
3451         Renamed functions, removed now-unneeded comment.
3452
3453         * html/parser/HTMLToken.h: Cut down on the fields used by the source tracker.
3454         It only needs to know the start and end of each attribute, not each part of
3455         each attribute. Removed setBaseOffset, setEndOffset, length, addNewAttribute,
3456         beginAttributeName, endAttributeName, beginAttributeValue, endAttributeValue,
3457         m_baseOffset and m_length. Added beginAttribute and endAttribute.
3458         (WebCore::HTMLToken::clear): No need to zero m_length or m_baseOffset any more.
3459         (WebCore::HTMLToken::length): Deleted.
3460         (WebCore::HTMLToken::setBaseOffset): Deleted.
3461         (WebCore::HTMLToken::setEndOffset): Deleted.
3462         (WebCore::HTMLToken::beginStartTag): Only null out m_currentAttribute if we
3463         are compiling in assertions.
3464         (WebCore::HTMLToken::beginEndTag): Ditto.
3465         (WebCore::HTMLToken::addNewAttribute): Deleted.
3466         (WebCore::HTMLToken::beginAttribute): Moved the code from addNewAttribute in
3467         here and set the start offset.
3468         (WebCore::HTMLToken::beginAttributeName): Deleted.
3469         (WebCore::HTMLToken::endAttributeName): Deleted.
3470         (WebCore::HTMLToken::beginAttributeValue): Deleted.
3471         (WebCore::HTMLToken::endAttributeValue): Deleted.
3472
3473         * html/parser/HTMLTokenizer.cpp:
3474         (WebCore::HTMLToken::endAttribute): Added. Sets the end offset.
3475         (WebCore::HTMLToken::appendToAttributeName): Updated assertion.
3476         (WebCore::HTMLToken::appendToAttributeValue): Ditto.
3477         (WebCore::convertASCIIAlphaToLower): Renamed from toLowerCase and changed
3478         so it's legal to call on lower case letters too.
3479         (WebCore::vectorEqualsString): Changed to take a string literal rather than
3480         a WTF::String.
3481         (WebCore::HTMLTokenizer::inEndTagBufferingState): Made this a member function.
3482         (WebCore::HTMLTokenizer::HTMLTokenizer): Updated for data member changes.
3483         (WebCore::HTMLTokenizer::bufferASCIICharacter): Added. Optimized version of
3484         bufferCharacter for the common case where we know the character is ASCII.
3485         (WebCore::HTMLTokenizer::bufferCharacter): Moved this function here from the
3486         header since it's only used inside the class.
3487         (WebCore::HTMLTokenizer::emitAndResumeInDataState): Moved this here, renamed
3488         it and removed the state argument.
3489         (WebCore::HTMLTokenizer::emitAndReconsumeInDataState): Ditto.
3490         (WebCore::HTMLTokenizer::emitEndOfFile): More of the same.
3491         (WebCore::HTMLTokenizer::saveEndTagNameIfNeeded): Ditto.
3492         (WebCore::HTMLTokenizer::haveBufferedCharacterToken): Ditto.
3493         (WebCore::HTMLTokenizer::flushBufferedEndTag): Updated since m_token is now
3494         the actual token, not just a pointer.
3495         (WebCore::HTMLTokenizer::flushEmitAndResumeInDataState): Renamed this and
3496         removed the state argument.
3497         (WebCore::HTMLTokenizer::processToken): This function, formerly nextToken,
3498         is now the internal function used by nextToken. Updated its contents to use
3499         simpler macros, changed code to set m_state when returning, rather than
3500         constantly setting it when cycling through states, switched style to use
3501         early return/goto rather than lots of else statements, took out unneeded
3502         braces now that BEGIN/END_STATE handles the braces, collapsed upper and
3503         lower case letter handling in many states, changed lookAhead call sites to
3504         use the new advancePast function instead.
3505         (WebCore::HTMLTokenizer::updateStateFor): Set m_state directly instead of
3506         calling a setstate function.
3507         (WebCore::HTMLTokenizer::appendToTemporaryBuffer): Moved here from header.
3508         (WebCore::HTMLTokenizer::temporaryBufferIs): Changed argument type to
3509         a literal instead of a WTF::String.
3510         (WebCore::HTMLTokenizer::appendToPossibleEndTag): Renamed and changed type
3511         to be a UChar instead of LChar, although all characters will be ASCII.
3512         (WebCore::HTMLTokenizer::isAppropriateEndTag): Marked const, and changed
3513         type from size_t to unsigned.
3514
3515         * html/parser/HTMLTokenizer.h: Changed interface of nextToken so it returns
3516         a TokenPtr so code doesn't have to understand special rules about when to
3517         work with an HTMLToken and when to clear it. Made most functions private,
3518         and made the State enum private as well. Replaced the state and setState
3519         functions with more specific functions for the few states we need to deal
3520         with outside the class. Moved function bodies outside the class definition
3521         so it's easier to read the class definition.
3522
3523         * html/parser/HTMLTreeBuilder.cpp:
3524         (WebCore::HTMLTreeBuilder::processStartTagForInBody): Updated to use the
3525         new set state functions instead of setState.
3526         (WebCore::HTMLTreeBuilder::processEndTag): Ditto.
3527         (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag): Ditto.
3528         (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag): Ditto.
3529         (WebCore::HTMLTreeBuilder::processScriptStartTag): Ditto.
3530
3531         * html/parser/InputStreamPreprocessor.h: Marked the constructor explicit,
3532         and mde it take a reference rather than a pointer.
3533
3534         * html/parser/TextDocumentParser.cpp:
3535         (WebCore::TextDocumentParser::insertFakePreElement): Updated to use the
3536         new set state functions instead of setState.
3537
3538         * html/parser/XSSAuditor.cpp:
3539         (WebCore::XSSAuditor::decodedSnippetForName): Updated for name change.
3540         (WebCore::XSSAuditor::decodedSnippetForAttribute): Updated for changes to
3541         attribute range tracking.
3542         (WebCore::XSSAuditor::decodedSnippetForJavaScript): Updated for name change.
3543         (WebCore::XSSAuditor::isSafeToSendToAnotherThread): Deleted.
3544
3545         * html/parser/XSSAuditor.h: Deleted isSafeToSendToAnotherThread.
3546
3547         * html/track/WebVTTTokenizer.cpp: Removed the local state variable from
3548         WEBVTT_ADVANCE_TO; there is no need for it.
3549         (WebCore::WebVTTTokenizer::WebVTTTokenizer): Use a reference instead of a
3550         pointer for the preprocessor.
3551         (WebCore::WebVTTTokenizer::nextToken): Ditto. Also removed the state local
3552         variable and the switch statement, replacing with labels instead since we
3553         go between states with goto.
3554
3555         * platform/text/SegmentedString.cpp:
3556         (WebCore::SegmentedString::operator=): Changed the return type to be non-const
3557         to match normal C++ design rules.
3558         (WebCore::SegmentedString::pushBack): Renamed from prepend since this is not a
3559         general purpose prepend function. Also fixed assertions to not use the strangely
3560         named "escaped" function, since we are deleting it.
3561         (WebCore::SegmentedString::append): Ditto.
3562         (WebCore::SegmentedString::advancePastNonNewlines): Renamed from advance, since
3563         the function only works for non-newlines.
3564         (WebCore::SegmentedString::currentColumn): Got rid of unneeded local variable.
3565         (WebCore::SegmentedString::advancePastSlowCase): Moved here from header and
3566         renamed. This function now consumes the characters if they match.
3567
3568         * platform/text/SegmentedString.h: Made the changes mentioned above.
3569         (WebCore::SegmentedString::excludeLineNumbers): Deleted.
3570         (WebCore::SegmentedString::advancePast): Renamed from lookAhead. Also changed
3571         behavior so the characters are consumed.
3572         (WebCore::SegmentedString::advancePastIgnoringCase): Ditto.
3573         (WebCore::SegmentedString::advanceAndASSERT): Deleted.
3574         (WebCore::SegmentedString::advanceAndASSERTIgnoringCase): Deleted.
3575         (WebCore::SegmentedString::escaped): Deleted.
3576
3577         * xml/parser/CharacterReferenceParserInlines.h:
3578         (WebCore::isHexDigit): Deleted.
3579         (WebCore::unconsumeCharacters): Updated for name change.
3580         (WebCore::consumeCharacterReference): Removed unneeded name for local enum,
3581         renamed local variable "cc" to character. Changed code to use helpers like
3582         isASCIIAlpha and toASCIIHexValue. Removed unneeded use of advanceAndASSERT,
3583         since we don't really need to assert the character we just extracted.
3584
3585         * xml/parser/MarkupTokenizerInlines.h:
3586         (WebCore::isTokenizerWhitespace): Renamed argument to character.
3587         (WebCore::advanceStringAndASSERTIgnoringCase): Deleted.
3588         (WebCore::advanceStringAndASSERT): Deleted.
3589         Changed all the macro implementations so they set m_state only when
3590         returning from the function and just use goto inside the state machine.
3591
3592 2015-01-08  Benjamin Poulain  <benjamin@webkit.org>
3593
3594         Build fix after r178151
3595
3596         * contentextensions/DFA.cpp:
3597         (WebCore::ContentExtensions::DFA::actions):
3598
3599 2015-01-08  Benjamin Poulain  <benjamin@webkit.org>
3600
3601         [WK2] Start a prototype for declarative site specific extensions
3602         https://bugs.webkit.org/show_bug.cgi?id=140160
3603
3604         Reviewed by Andreas Kling.
3605
3606         Currently, clients have various ways to execute custom code for certain URLs.
3607         Each of those mechanism implies messaging the UIProcess, executing some code
3608         calling back to the WebProcess, then actually load the resource.
3609         All this back and forth introduces delays before we actually load resources.
3610
3611         Since the set of actions is done per site is actually simple and limited,
3612         it may be possible to do everything in WebCore and shortcut the defered loading.
3613
3614         This patch provides the starting point for this idea. The "rules" (currently just blocking)
3615         are be passed to WebCore in a JSON format. In WebCore, we create a state
3616         machine to match the rules and we execute the action when the state machine tells
3617         us to.
3618
3619         * WebCore.exp.in:
3620         * WebCore.xcodeproj/project.pbxproj:
3621         * contentextensions/ContentExtensionRule.cpp: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3622         (WebCore::ContentExtensions::ContentExtensionRule::ContentExtensionRule):
3623         * contentextensions/ContentExtensionRule.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3624         (WebCore::ContentExtensions::ContentExtensionRule::trigger):
3625         (WebCore::ContentExtensions::ContentExtensionRule::action):
3626         * contentextensions/ContentExtensionsBackend.cpp: Added.
3627         (WebCore::ContentExtensions::ContentExtensionsBackend::sharedInstance):
3628         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
3629         (WebCore::ContentExtensions::ContentExtensionsBackend::removeRuleList):
3630         (WebCore::ContentExtensions::ContentExtensionsBackend::shouldBlockURL):
3631         * contentextensions/ContentExtensionsBackend.h: Added.
3632         * contentextensions/ContentExtensionsInterface.cpp: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3633         (WebCore::ContentExtensions::shouldBlockURL):
3634         * contentextensions/ContentExtensionsInterface.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3635         * contentextensions/ContentExtensionsManager.cpp: Added.
3636         (WebCore::ContentExtensions::ExtensionsManager::loadTrigger):
3637         (WebCore::ContentExtensions::ExtensionsManager::loadAction):
3638         (WebCore::ContentExtensions::ExtensionsManager::loadRule):
3639         (WebCore::ContentExtensions::ExtensionsManager::loadExtension):
3640         * contentextensions/ContentExtensionsManager.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3641         * contentextensions/DFA.cpp: Added.
3642         (WebCore::ContentExtensions::DFA::DFA):
3643         (WebCore::ContentExtensions::DFA::operator=):
3644         (WebCore::ContentExtensions::DFA::nextState):
3645         (WebCore::ContentExtensions::DFA::actions):
3646         (WebCore::ContentExtensions::DFA::debugPrintDot):
3647         * contentextensions/DFA.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3648         (WebCore::ContentExtensions::DFA::root):
3649         * contentextensions/DFANode.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3650         * contentextensions/NFA.cpp: Added.
3651         (WebCore::ContentExtensions::NFA::NFA):
3652         (WebCore::ContentExtensions::NFA::createNode):
3653         (WebCore::ContentExtensions::NFA::addTransition):
3654         (WebCore::ContentExtensions::NFA::addEpsilonTransition):
3655         (WebCore::ContentExtensions::NFA::setFinal):
3656         (WebCore::ContentExtensions::NFA::debugPrintDot):
3657         * contentextensions/NFA.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3658         (WebCore::ContentExtensions::NFA::root):
3659         * contentextensions/NFANode.cpp: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3660         (WebCore::ContentExtensions::NFANode::NFANode):
3661         * contentextensions/NFANode.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3662         * contentextensions/NFAToDFA.cpp: Added.
3663         (WebCore::ContentExtensions::epsilonClosure):
3664         (WebCore::ContentExtensions::setTransitionsExcludingEpsilon):
3665         (WebCore::ContentExtensions::HashableNodeIdSet::HashableNodeIdSet):
3666         (WebCore::ContentExtensions::HashableNodeIdSet::operator=):
3667         (WebCore::ContentExtensions::HashableNodeIdSet::isEmptyValue):
3668         (WebCore::ContentExtensions::HashableNodeIdSet::isDeletedValue):
3669         (WebCore::ContentExtensions::HashableNodeIdSet::nodeIdSet):
3670         (WebCore::ContentExtensions::HashableNodeIdSetHash::hash):
3671         (WebCore::ContentExtensions::HashableNodeIdSetHash::equal):
3672         (WebCore::ContentExtensions::addDFAState):
3673         (WebCore::ContentExtensions::NFAToDFA::convert):
3674         * contentextensions/NFAToDFA.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
3675         * loader/cache/CachedResourceLoader.cpp:
3676         (WebCore::CachedResourceLoader::requestResource):
3677
3678 2015-01-08  Benjamin Poulain  <bpoulain@apple.com>
3679
3680         Make better use of the stack when compiling selectors
3681         https://bugs.webkit.org/show_bug.cgi?id=139615
3682         rdar://problem/19226482
3683
3684         Reviewed by Andreas Kling.
3685
3686         Selectors used to be only on one level. To avoid memory allocations, we were allocating
3687         a lot of stack upfront and we were using that to create all the intermediary objects
3688         used by the code generator.
3689
3690         Then, selectors became multilevel. We now support arbitrary nesting of selector lists.
3691
3692         We did not adapt any of the structures and the creation of the intermediary object is recursive.
3693         This resulted in over 1k of stack allocation at every level, quickly accumulating to unreasonable
3694         numbers.
3695
3696         This patch fixes this problem by making each stack frame of the recursion much lighter.
3697         We no longer allocate the big objects (SelectorFragment and SelectorFragmentList) on the stack.
3698
3699         In each case where we would have used a Stack allocated SelectorFragment or SelectorFragmentList,
3700         we now allocate the memory directly into the target vector.
3701
3702         In the cases where the object should not be on the vector, we simply remove it. Those are uncommon
3703         cases so that should not be too bad.
3704
3705         Tests: fast/selectors/matches-selector-list-ending-with-never-matching-selectors.html
3706                fast/selectors/not-selector-list-ending-with-never-matching-selectors.html
3707                fast/selectors/nth-child-of-selector-list-ending-with-never-matching-selectors.html
3708                fast/selectors/nth-last-child-of-selector-list-ending-with-never-matching-selectors.html
3709
3710         * cssjit/SelectorCompiler.cpp:
3711         SelectorFragmentList is also used for nested lists. Keeping 32 SelectorFragment preallocated
3712         for each nested list is way too big.
3713
3714         (WebCore::SelectorCompiler::addPseudoClassType):
3715         There are three cases of nested selector lists supported by the compiler: :matches(), :not()
3716         and :nth-child(). For those 3 cases, use the target vector memory instead of the stack.
3717
3718         (WebCore::SelectorCompiler::constructFragmentsInternal):
3719         (WebCore::SelectorCompiler::constructFragments):
3720         Make sure we do not modify the input list on failure since it may be reused.
3721
3722         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
3723         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesMatchesPseudoClass):
3724         I changed the handling of :nth-child(An+B of selectorList) to not generate empty filters.
3725         With that we can generalize the assertion to generateElementMatchesSelectorList() and simplify
3726         the flow of selector lists a bit.
3727
3728 2015-01-08  Chris Dumez  <cdumez@apple.com>
3729
3730         Move '-webkit-font-feature-settings' CSS property to the new StyleBuilder
3731         https://bugs.webkit.org/show_bug.cgi?id=140267
3732
3733         Reviewed by Andreas Kling.
3734
3735         Move '-webkit-font-feature-settings' CSS property to the new
3736         StyleBuilder.
3737
3738         * css/CSSPropertyNames.in:
3739         * css/StyleBuilderConverter.h:
3740         (WebCore::StyleBuilderConverter::convertFontFeatureSettings):
3741         * css/StyleBuilderCustom.h:
3742         (WebCore::StyleBuilderCustom::applyInitialWebkitFontFeatureSettings):
3743         (WebCore::StyleBuilderCustom::applyInheritWebkitFontFeatureSettings):
3744         * css/StyleResolver.cpp:
3745         (WebCore::StyleResolver::applyProperty):
3746         * platform/graphics/FontDescription.cpp:
3747         (WebCore::FontDescription::makeNormalFeatureSettings): Deleted.
3748         * platform/graphics/FontDescription.h:
3749
3750 2015-01-08  Brent Fulgham  <bfulgham@apple.com>
3751
3752         [Win] Build fix after r178133.
3753
3754         * platform/graphics/FontCache.h: Correct declaration of fontDataFromDescriptionAndLogFont
3755         * platform/graphics/SimpleFontData.h: We still need 'platformDestroy'
3756         * platform/graphics/mac/SimpleFontDataMac.mm:
3757         (WebCore::SimpleFontData::platformDestroy): Add stub back to prevent build break.
3758         * platform/graphics/win/FontCacheWin.cpp:
3759         (WebCore::FontCache::fontDataFromDescriptionAndLogFont): Correct signature.
3760         (WebCore::FontCache::lastResortFallbackFont): Correct '::' syntax.
3761         (WebCore::FontCache:lastResortFallbackFont): Deleted.
3762
3763 2015-01-08  Antti Koivisto  <antti@apple.com>
3764
3765         Remove the concept of "retained" font
3766         https://bugs.webkit.org/show_bug.cgi?id=140246
3767
3768         Reviewed by Darin Adler.
3769
3770         FontCache currently maintains a secondary refcount for SimpleFontDatas. This is used to decide whether
3771         a font is considered inactive and is eligible for purging. This is confusing and complex.
3772
3773         The new scheme in this patch considers fonts in font cache inactive if their refcount is 1 (they are
3774         owned by the cache only). This simplifies the code and gives similar behavior. Types that "retained" the
3775         font this way always also ref it.
3776
3777         We also avoid unnecessarily removing fonts that wouldn't get deleted from the cache.
3778
3779         Also modernized some names and code.
3780
3781         * WebCore.exp.in:
3782         * css/CSSFontFaceSource.cpp:
3783         (WebCore::CSSFontFaceSource::getFontData):
3784         * css/CSSFontSelector.cpp:
3785         (WebCore::CSSFontSelector::getFontData):
3786         (WebCore::CSSFontSelector::getFallbackFontData):
3787         * platform/graphics/FontCache.cpp:
3788         (WebCore::fontPlatformDataCache):
3789         (WebCore::FontCache::getCachedFontPlatformData):
3790         (WebCore::cachedFonts):
3791         (WebCore::FontCache::fontForFamily):
3792         (WebCore::FontCache::fontDataForPlatformData):
3793         (WebCore::FontCache::purgeInactiveFontDataIfNeeded):
3794         (WebCore::FontCache::purgeInactiveFontData):
3795         (WebCore::FontCache::fontDataCount):
3796         (WebCore::FontCache::inactiveFontDataCount):
3797         (WebCore::FontCache::fontForFamilyAtIndex):
3798         (WebCore::FontCache::invalidate):
3799         (WebCore::FontCache::getCachedFontData): Deleted.
3800         (WebCore::FontCache::getNonRetainedLastResortFallbackFont): Deleted.
3801         (WebCore::FontCache::releaseFontData): Deleted.
3802         (WebCore::FontCache::getFontData): Deleted.
3803         * platform/graphics/FontCache.h:
3804         * platform/graphics/FontGlyphs.cpp:
3805         (WebCore::FontGlyphs::FontGlyphs):
3806         (WebCore::FontGlyphs::~FontGlyphs):
3807         (WebCore::FontGlyphs::realizeFontDataAt):
3808         (WebCore::FontGlyphs::releaseFontData): Deleted.
3809         * platform/graphics/FontGlyphs.h:
3810         (WebCore::FontGlyphs::~FontGlyphs): Deleted.
3811         * platform/graphics/SimpleFontData.cpp:
3812         (WebCore::SimpleFontData::~SimpleFontData):
3813         * platform/graphics/SimpleFontData.h:
3814         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
3815         (WebCore::SimpleFontData::platformDestroy): Deleted.
3816         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3817         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3818         * platform/graphics/mac/FontCacheMac.mm:
3819         (WebCore::FontCache::systemFallbackForCharacters):
3820         (WebCore::FontCache::similarFontPlatformData):
3821         (WebCore::FontCache::lastResortFallbackFont):
3822         (WebCore::FontCache::getLastResortFallbackFont): Deleted.
3823         * platform/graphics/mac/SimpleFontDataMac.mm:
3824         (WebCore::SimpleFontData::platformCreateScaledFontData):
3825         (WebCore::SimpleFontData::platformDestroy): Deleted.
3826
3827 2015-01-08  Anders Carlsson  <andersca@apple.com>
3828
3829         Remove AbstractSQLTransaction
3830         https://bugs.webkit.org/show_bug.cgi?id=140265
3831
3832         Reviewed by Tim Horton.
3833
3834         * Modules/webdatabase/AbstractSQLTransaction.h: Removed.
3835         * Modules/webdatabase/DatabaseBackend.cpp:
3836         * Modules/webdatabase/SQLTransaction.cpp:
3837         (WebCore::SQLTransaction::~SQLTransaction):
3838         * Modules/webdatabase/SQLTransaction.h:
3839         * Modules/webdatabase/SQLTransactionBackend.cpp:
3840         (WebCore::SQLTransactionBackend::create):
3841         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
3842         * Modules/webdatabase/SQLTransactionBackend.h:
3843         * WebCore.xcodeproj/project.pbxproj:
3844
3845 2015-01-08  Brent Fulgham  <bfulgham@apple.com>
3846
3847         [Win] Unreviewed build fix after r178124.
3848
3849         Remove uses of the removed applicationChromeMode method.
3850
3851         * rendering/RenderThemeWin.cpp:
3852         (WebCore::RenderThemeWin::getThemeData):
3853         (WebCore::RenderThemeWin::paintMenuList):
3854
3855 2015-01-08  Anders Carlsson  <andersca@apple.com>
3856
3857         Remove AbstractSQLTransactionBackend
3858         https://bugs.webkit.org/show_bug.cgi?id=140227
3859
3860         Reviewed by Darin Adler.
3861
3862         * Modules/webdatabase/AbstractSQLTransaction.h:
3863         * Modules/webdatabase/AbstractSQLTransactionBackend.h: Removed.
3864         * Modules/webdatabase/SQLStatementBackend.cpp:
3865         * Modules/webdatabase/SQLTransaction.cpp:
3866         (WebCore::SQLTransaction::setBackend):
3867         * Modules/webdatabase/SQLTransaction.h:
3868         * Modules/webdatabase/SQLTransactionBackend.h:
3869         * WebCore.xcodeproj/project.pbxproj:
3870
3871 2015-01-08  Darin Adler  <darin@apple.com>
3872
3873         ASSERTION FAILED: character != kEndOfFileMarker in WebCore::HTMLTokenizer::bufferCharacter
3874         https://bugs.webkit.org/show_bug.cgi?id=140179
3875
3876         Reviewed by Anders Carlsson.
3877
3878         Test: fast/parser/numeric-entities.html
3879
3880         * html/parser/HTMLEntityParser.cpp:
3881         (WebCore::HTMLEntityParser::legalEntityFor): Merged adjustEntity logic in here.
3882         Since the type UChar32 is a signed integer, need to check for <= 0, not just 0.
3883         This <= change alone would have fixed the bug.
3884
3885         * xml/parser/CharacterReferenceParserInlines.h:
3886         (WebCore::consumeCharacterReference): Added overflow checking when parsing hex
3887         and decimal character references. This change alone would also have fixed the
3888         bug, but in addition it makes overflow cases reliably generate replacement
3889         characters rather than ignoring the overflow and producing seemingly random
3890         characters. Test cases cover the original reported bug and other overflow cases.
3891
3892 2015-01-08  Dean Jackson  <dino@apple.com>
3893
3894         Text not drawn or white-on-white for "Close Page"/"Go Back" button on safe browsing warning page
3895         https://bugs.webkit.org/show_bug.cgi?id=140232
3896         <rdar://problem/19371010>
3897
3898         Reviewed by Anders Carlsson.
3899
3900         We need to support default button styling even when application chrome
3901         mode is not enabled (it was a bit weird that this was exposed as a Setting
3902         anyway). We should render as a default button whenever content sets
3903         the proprietary -webkit-appearance. This means we don't need the
3904         applicationChromeMode setting.
3905
3906         For normal Web content there should be no change in behavior.
3907
3908         * page/Settings.in: Remove applicationChromeMode
3909         * rendering/RenderTheme.cpp:
3910         (WebCore::RenderTheme::isDefault): Don't test for the setting.
3911
3912 2015-01-08  Chris Dumez  <cdumez@apple.com>
3913
3914         Unfriend StyleResolver and StyleBuilderCustom
3915         https://bugs.webkit.org/show_bug.cgi?id=140247
3916
3917         Reviewed by Darin Adler.
3918
3919         Stop marking StyleBuilderCustom as a friend of StyleResolver by
3920         refactoring the code a bit.
3921
3922         * css/StyleBuilderCustom.h:
3923         (WebCore::StyleBuilderCustom::applyValueFont):
3924         * css/StyleResolver.cpp:
3925         (WebCore::StyleResolver::applyFont):
3926         * css/StyleResolver.h:
3927         (WebCore::StyleResolver::documentSettings):
3928
3929 2015-01-08  Gwang Yoon Hwang  <yoon@igalia.com>
3930
3931         [CoordinatedGraphics] Update fixedVisibleContentRect only it is actually changed
3932         https://bugs.webkit.org/show_bug.cgi?id=140244
3933
3934         Reviewed by Martin Robinson.
3935
3936         CompositingCoordinator::setVisibleContentsRect already knows whether the
3937         rect has been changed. Therefore, there is no need to call
3938         FrameView::setFixedVisibleContentRect every time.
3939
3940         No new tests, covered by existing tests.
3941
3942         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
3943         (WebCore::CompositingCoordinator::setVisibleContentsRect):
3944
3945 2015-01-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3946
3947         REGRESSION(r177637) [HarfBuzz][GTK][EFL] It made 3 performance tests crash and +24 layout tests crashes/failures
3948         https://bugs.webkit.org/show_bug.cgi?id=139905
3949
3950         Reviewed by Antti Koivisto.
3951
3952         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3953         (WebCore::HarfBuzzShaper::collectHarfBuzzRuns): Fallback to
3954         primary font data for missing glyphs.
3955
3956 2015-01-08  Myles C. Maxfield  <mmaxfield@apple.com>
3957
3958         Borders inside box-decoration-break: clone after a br do not contribute to line breaking
3959         https://bugs.webkit.org/show_bug.cgi?id=140238
3960
3961         Reviewed by Darin Adler.
3962
3963         When we iterate through renderers for line breaking, we determine which of the renderers
3964         is responsible for inserting its parent's border width. However, this determination didn't
3965         take a <br> and box-decoration-break: clone into account.
3966
3967         Test: fast/box-decoration-break/box-decoration-break-clone-line-break.html
3968
3969         * rendering/line/BreakingContextInlineHeaders.h:
3970         (WebCore::shouldAddBorderPaddingMargin):
3971         (WebCore::previousInFlowSibling): Clean up to use a do / while block.
3972
3973 2015-01-08  Gwang Yoon Hwang  <yoon@igalia.com>
3974
3975         [GTK] Seperate updateBackingStore from flushCompositingState.
3976         https://bugs.webkit.org/show_bug.cgi?id=136887
3977
3978         Reviewed by Žan Doberšek.
3979
3980         When LayerTreeHostGtk flushes pending layer changes, it updates backing
3981         stores using same loop. This makes requesting layer flush during
3982         flushing in certain condition which causes a assertion failure.
3983
3984         Animated GIF's animations are drived by the painting cycle,
3985         GraphicsLayerTextureMapper::updateBackingStoreIfNeeded would request
3986         scheduleLayerFlush during flushing layers, if animated GIF needs to
3987         advance its frame immediately. It doesn't mean the advanced frame should
3988         be painted in this painting phase. This frame advancing happens after
3989         painting a current frame to the backing store. It means the advanced
3990         frame should be painted ASAP without using its frame timer.
3991
3992         This patch seperates updateBackingStore from flushCompositingState
3993         to avoid above behavior.
3994
3995         No new tests. The bug is timing-dependent.
3996
3997         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3998         (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
3999      &nbs