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

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: move setSandboxFlags call Created 5 years, 2 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
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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 241 }
242 } 242 }
243 243
244 void FrameView::init() 244 void FrameView::init()
245 { 245 {
246 reset(); 246 reset();
247 247
248 m_size = LayoutSize(); 248 m_size = LayoutSize();
249 249
250 // Propagate the marginwidth/height and scrolling modes to the view. 250 // Propagate the marginwidth/height and scrolling modes to the view.
251 // FIXME: Do we need to do this for OOPI? 251 if (m_frame->owner() && m_frame->owner()->scrollingMode() == ScrollbarAlways Off)
252 Element* ownerElement = m_frame->deprecatedLocalOwner(); 252 setCanHaveScrollbars(false);
253 if (ownerElement && (isHTMLFrameElement(*ownerElement) || isHTMLIFrameElemen t(*ownerElement))) {
254 HTMLFrameElementBase* frameElt = toHTMLFrameElementBase(ownerElement);
255 if (frameElt->scrollingMode() == ScrollbarAlwaysOff)
256 setCanHaveScrollbars(false);
257 }
258 } 253 }
259 254
260 void FrameView::dispose() 255 void FrameView::dispose()
261 { 256 {
262 RELEASE_ASSERT(!isInPerformLayout()); 257 RELEASE_ASSERT(!isInPerformLayout());
263 258
264 if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) 259 if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
265 scrollAnimator->cancelAnimations(); 260 scrollAnimator->cancelAnimations();
266 cancelProgrammaticScrollAnimation(); 261 cancelProgrammaticScrollAnimation();
267 262
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 562
568 void FrameView::calculateScrollbarModes(ScrollbarMode& hMode, ScrollbarMode& vMo de, ScrollbarModesCalculationStrategy strategy) 563 void FrameView::calculateScrollbarModes(ScrollbarMode& hMode, ScrollbarMode& vMo de, ScrollbarModesCalculationStrategy strategy)
569 { 564 {
570 #define RETURN_SCROLLBAR_MODE(mode) \ 565 #define RETURN_SCROLLBAR_MODE(mode) \
571 { \ 566 { \
572 hMode = vMode = mode; \ 567 hMode = vMode = mode; \
573 return; \ 568 return; \
574 } 569 }
575 570
576 // Setting scrolling="no" on an iframe element disables scrolling. 571 // Setting scrolling="no" on an iframe element disables scrolling.
577 // FIXME: Handle this for OOPI? 572 if (m_frame->owner() && m_frame->owner()->scrollingMode() == ScrollbarAlways Off)
578 if (const HTMLFrameOwnerElement* owner = m_frame->deprecatedLocalOwner()) { 573 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
579 if (owner->scrollingMode() == ScrollbarAlwaysOff)
580 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
581 }
582 574
583 // Framesets can't scroll. 575 // Framesets can't scroll.
584 Node* body = m_frame->document()->body(); 576 Node* body = m_frame->document()->body();
585 if (isHTMLFrameSetElement(body) && body->layoutObject()) 577 if (isHTMLFrameSetElement(body) && body->layoutObject())
586 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff); 578 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
587 579
588 // Scrollbars can be disabled by FrameView::setCanHaveScrollbars. 580 // Scrollbars can be disabled by FrameView::setCanHaveScrollbars.
589 if (!m_canHaveScrollbars && strategy != RulesFromWebContentOnly) 581 if (!m_canHaveScrollbars && strategy != RulesFromWebContentOnly)
590 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff); 582 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
591 583
(...skipping 3485 matching lines...) Expand 10 before | Expand all | Expand 10 after
4077 } 4069 }
4078 4070
4079 bool FrameView::canThrottleRendering() const 4071 bool FrameView::canThrottleRendering() const
4080 { 4072 {
4081 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4073 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4082 return false; 4074 return false;
4083 return m_hiddenForThrottling && m_crossOriginForThrottling; 4075 return m_hiddenForThrottling && m_crossOriginForThrottling;
4084 } 4076 }
4085 4077
4086 } // namespace blink 4078 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698