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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1307013004: Propagate scrolling/marginwidth/marginheight property values to child frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content_unittests compile fix Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 248 }
249 } 249 }
250 250
251 void FrameView::init() 251 void FrameView::init()
252 { 252 {
253 reset(); 253 reset();
254 254
255 m_size = LayoutSize(); 255 m_size = LayoutSize();
256 256
257 // Propagate the marginwidth/height and scrolling modes to the view. 257 // Propagate the marginwidth/height and scrolling modes to the view.
258 // FIXME: Do we need to do this for OOPI? 258 if (m_frame->owner() && m_frame->owner()->scrollingMode() == ScrollbarAlways Off)
259 Element* ownerElement = m_frame->deprecatedLocalOwner(); 259 setCanHaveScrollbars(false);
260 if (ownerElement && (isHTMLFrameElement(*ownerElement) || isHTMLIFrameElemen t(*ownerElement))) {
261 HTMLFrameElementBase* frameElt = toHTMLFrameElementBase(ownerElement);
262 if (frameElt->scrollingMode() == ScrollbarAlwaysOff)
263 setCanHaveScrollbars(false);
264 }
265 } 260 }
266 261
267 void FrameView::dispose() 262 void FrameView::dispose()
268 { 263 {
269 RELEASE_ASSERT(!isInPerformLayout()); 264 RELEASE_ASSERT(!isInPerformLayout());
270 265
271 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) 266 if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator())
272 scrollAnimator->cancelAnimations(); 267 scrollAnimator->cancelAnimations();
273 cancelProgrammaticScrollAnimation(); 268 cancelProgrammaticScrollAnimation();
274 269
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 569
575 void FrameView::calculateScrollbarModes(ScrollbarMode& hMode, ScrollbarMode& vMo de, ScrollbarModesCalculationStrategy strategy) 570 void FrameView::calculateScrollbarModes(ScrollbarMode& hMode, ScrollbarMode& vMo de, ScrollbarModesCalculationStrategy strategy)
576 { 571 {
577 #define RETURN_SCROLLBAR_MODE(mode) \ 572 #define RETURN_SCROLLBAR_MODE(mode) \
578 { \ 573 { \
579 hMode = vMode = mode; \ 574 hMode = vMode = mode; \
580 return; \ 575 return; \
581 } 576 }
582 577
583 // Setting scrolling="no" on an iframe element disables scrolling. 578 // Setting scrolling="no" on an iframe element disables scrolling.
584 // FIXME: Handle this for OOPI? 579 if (m_frame->owner() && m_frame->owner()->scrollingMode() == ScrollbarAlways Off)
585 if (const HTMLFrameOwnerElement* owner = m_frame->deprecatedLocalOwner()) { 580 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
586 if (owner->scrollingMode() == ScrollbarAlwaysOff)
587 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
588 }
589 581
590 // Framesets can't scroll. 582 // Framesets can't scroll.
591 Node* body = m_frame->document()->body(); 583 Node* body = m_frame->document()->body();
592 if (isHTMLFrameSetElement(body) && body->layoutObject()) 584 if (isHTMLFrameSetElement(body) && body->layoutObject())
593 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff); 585 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
594 586
595 // Scrollbars can be disabled by FrameView::setCanHaveScrollbars. 587 // Scrollbars can be disabled by FrameView::setCanHaveScrollbars.
596 if (!m_canHaveScrollbars && strategy != RulesFromWebContentOnly) 588 if (!m_canHaveScrollbars && strategy != RulesFromWebContentOnly)
597 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff); 589 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
598 590
(...skipping 3487 matching lines...) Expand 10 before | Expand all | Expand 10 after
4086 } 4078 }
4087 4079
4088 bool FrameView::canThrottleRendering() const 4080 bool FrameView::canThrottleRendering() const
4089 { 4081 {
4090 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4082 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4091 return false; 4083 return false;
4092 return m_hiddenForThrottling && m_crossOriginForThrottling; 4084 return m_hiddenForThrottling && m_crossOriginForThrottling;
4093 } 4085 }
4094 4086
4095 } // namespace blink 4087 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameOwner.h ('k') | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698