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

Side by Side Diff: Source/WebCore/rendering/RenderScrollbar.cpp

Issue 7945004: Merge 95074 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 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
« no previous file with comments | « LayoutTests/scrollbars/scrollbar-part-created-with-no-parent-crash-expected.txt ('k') | no next file » | 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) 2008, 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } else if (this->orientation() == HorizontalScrollbar) 57 } else if (this->orientation() == HorizontalScrollbar)
58 width = this->width(); 58 width = this->width();
59 else 59 else
60 height = this->height(); 60 height = this->height();
61 61
62 setFrameRect(IntRect(0, 0, width, height)); 62 setFrameRect(IntRect(0, 0, width, height));
63 } 63 }
64 64
65 RenderScrollbar::~RenderScrollbar() 65 RenderScrollbar::~RenderScrollbar()
66 { 66 {
67 ASSERT(m_parts.isEmpty()); 67 if (!m_parts.isEmpty()) {
68 // When a scrollbar is detached from its parent (causing all parts remov al) and
69 // ready to be destroyed, its destruction can be delayed because of RefP tr
70 // maintained in other classes such as EventHandler (m_lastScrollbarUnde rMouse).
71 // Meanwhile, we can have a call to updateScrollbarPart which recreates the
72 // scrollbar part. So, we need to destroy these parts since we don't wan t them
73 // to call on a destroyed scrollbar. See webkit bug 68009.
74 updateScrollbarParts(true);
75 }
68 } 76 }
69 77
70 RenderBox* RenderScrollbar::owningRenderer() const 78 RenderBox* RenderScrollbar::owningRenderer() const
71 { 79 {
72 if (m_owningFrame) { 80 if (m_owningFrame) {
73 RenderBox* currentRenderer = m_owningFrame->ownerRenderer(); 81 RenderBox* currentRenderer = m_owningFrame->ownerRenderer();
74 return currentRenderer; 82 return currentRenderer;
75 } 83 }
76 return m_owner; 84 return m_owner;
77 } 85 }
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 int RenderScrollbar::minimumThumbLength() 366 int RenderScrollbar::minimumThumbLength()
359 { 367 {
360 RenderScrollbarPart* partRenderer = m_parts.get(ThumbPart); 368 RenderScrollbarPart* partRenderer = m_parts.get(ThumbPart);
361 if (!partRenderer) 369 if (!partRenderer)
362 return 0; 370 return 0;
363 partRenderer->layout(); 371 partRenderer->layout();
364 return orientation() == HorizontalScrollbar ? partRenderer->width() : partRe nderer->height(); 372 return orientation() == HorizontalScrollbar ? partRenderer->width() : partRe nderer->height();
365 } 373 }
366 374
367 } 375 }
OLDNEW
« no previous file with comments | « LayoutTests/scrollbars/scrollbar-part-created-with-no-parent-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698