Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1223)

Side by Side Diff: Source/core/rendering/RenderMarquee.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderListMarker.cpp ('k') | Source/core/rendering/RenderMenuList.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 , m_totalLoops(0) 65 , m_totalLoops(0)
66 , m_timer(this, &RenderMarquee::timerFired) 66 , m_timer(this, &RenderMarquee::timerFired)
67 , m_start(0) 67 , m_start(0)
68 , m_end(0) 68 , m_end(0)
69 , m_speed(0) 69 , m_speed(0)
70 , m_reset(false) 70 , m_reset(false)
71 , m_suspended(false) 71 , m_suspended(false)
72 , m_stopped(false) 72 , m_stopped(false)
73 , m_direction(MAUTO) 73 , m_direction(MAUTO)
74 { 74 {
75 UseCounter::count(document(), UseCounter::HTMLMarqueeElement); 75 UseCounter::count(&document(), UseCounter::HTMLMarqueeElement);
76 } 76 }
77 77
78 RenderMarquee::~RenderMarquee() 78 RenderMarquee::~RenderMarquee()
79 { 79 {
80 } 80 }
81 81
82 int RenderMarquee::marqueeSpeed() const 82 int RenderMarquee::marqueeSpeed() const
83 { 83 {
84 int result = style()->marqueeSpeed(); 84 int result = style()->marqueeSpeed();
85 if (Node* node = this->node()) { 85 if (Node* node = this->node()) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 } 161 }
162 162
163 void RenderMarquee::start() 163 void RenderMarquee::start()
164 { 164 {
165 if (m_timer.isActive() || style()->marqueeIncrement().isZero()) 165 if (m_timer.isActive() || style()->marqueeIncrement().isZero())
166 return; 166 return;
167 167
168 // We may end up propagating a scroll event. It is important that we suspend events until 168 // We may end up propagating a scroll event. It is important that we suspend events until
169 // the end of the function since they could delete the layer, including the marquee. 169 // the end of the function since they could delete the layer, including the marquee.
170 FrameView* frameView = document()->view(); 170 FrameView* frameView = document().view();
171 if (frameView) 171 if (frameView)
172 frameView->pauseScheduledEvents(); 172 frameView->pauseScheduledEvents();
173 173
174 if (!m_suspended && !m_stopped) { 174 if (!m_suspended && !m_stopped) {
175 if (isHorizontal()) 175 if (isHorizontal())
176 layer()->scrollToOffset(IntSize(m_start, 0)); 176 layer()->scrollToOffset(IntSize(m_start, 0));
177 else 177 else
178 layer()->scrollToOffset(IntSize(0, m_start)); 178 layer()->scrollToOffset(IntSize(0, m_start));
179 } 179 }
180 else { 180 else {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 m_reset = true; 331 m_reset = true;
332 } 332 }
333 333
334 if (isHorizontal()) 334 if (isHorizontal())
335 layer()->scrollToXOffset(newPos); 335 layer()->scrollToXOffset(newPos);
336 else 336 else
337 layer()->scrollToYOffset(newPos); 337 layer()->scrollToYOffset(newPos);
338 } 338 }
339 339
340 } // namespace WebCore 340 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderListMarker.cpp ('k') | Source/core/rendering/RenderMenuList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698