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