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

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: Address comments from Daniel 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 } 226 }
227 227
228 void FrameView::init() 228 void FrameView::init()
229 { 229 {
230 reset(); 230 reset();
231 231
232 m_size = LayoutSize(); 232 m_size = LayoutSize();
233 233
234 // Propagate the marginwidth/height and scrolling modes to the view. 234 // Propagate the marginwidth/height and scrolling modes to the view.
235 // FIXME: Do we need to do this for OOPI? 235 if (m_frame->owner() && m_frame->owner()->scrollingMode() == ScrollbarAlways Off)
236 Element* ownerElement = m_frame->deprecatedLocalOwner(); 236 setCanHaveScrollbars(false);
237 if (ownerElement && (isHTMLFrameElement(*ownerElement) || isHTMLIFrameElemen t(*ownerElement))) {
238 HTMLFrameElementBase* frameElt = toHTMLFrameElementBase(ownerElement);
239 if (frameElt->scrollingMode() == ScrollbarAlwaysOff)
240 setCanHaveScrollbars(false);
241 }
242 } 237 }
243 238
244 void FrameView::dispose() 239 void FrameView::dispose()
245 { 240 {
246 RELEASE_ASSERT(!isInPerformLayout()); 241 RELEASE_ASSERT(!isInPerformLayout());
247 242
248 if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) 243 if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
249 scrollAnimator->cancelAnimations(); 244 scrollAnimator->cancelAnimations();
250 cancelProgrammaticScrollAnimation(); 245 cancelProgrammaticScrollAnimation();
251 246
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 545
551 void FrameView::calculateScrollbarModes(ScrollbarMode& hMode, ScrollbarMode& vMo de, ScrollbarModesCalculationStrategy strategy) 546 void FrameView::calculateScrollbarModes(ScrollbarMode& hMode, ScrollbarMode& vMo de, ScrollbarModesCalculationStrategy strategy)
552 { 547 {
553 #define RETURN_SCROLLBAR_MODE(mode) \ 548 #define RETURN_SCROLLBAR_MODE(mode) \
554 { \ 549 { \
555 hMode = vMode = mode; \ 550 hMode = vMode = mode; \
556 return; \ 551 return; \
557 } 552 }
558 553
559 // Setting scrolling="no" on an iframe element disables scrolling. 554 // Setting scrolling="no" on an iframe element disables scrolling.
560 // FIXME: Handle this for OOPI? 555 if (m_frame->owner() && m_frame->owner()->scrollingMode() == ScrollbarAlways Off)
561 if (const HTMLFrameOwnerElement* owner = m_frame->deprecatedLocalOwner()) { 556 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
562 if (owner->scrollingMode() == ScrollbarAlwaysOff)
563 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
564 }
565 557
566 // Framesets can't scroll. 558 // Framesets can't scroll.
567 Node* body = m_frame->document()->body(); 559 Node* body = m_frame->document()->body();
568 if (isHTMLFrameSetElement(body) && body->layoutObject()) 560 if (isHTMLFrameSetElement(body) && body->layoutObject())
569 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff); 561 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
570 562
571 // Scrollbars can be disabled by FrameView::setCanHaveScrollbars. 563 // Scrollbars can be disabled by FrameView::setCanHaveScrollbars.
572 if (!m_canHaveScrollbars && strategy != RulesFromWebContentOnly) 564 if (!m_canHaveScrollbars && strategy != RulesFromWebContentOnly)
573 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff); 565 RETURN_SCROLLBAR_MODE(ScrollbarAlwaysOff);
574 566
(...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after
3938 3930
3939 if (!graphicsLayer) 3931 if (!graphicsLayer)
3940 return; 3932 return;
3941 3933
3942 PaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentLayoutObjec t(), paintInvalidationContainer, viewRect); 3934 PaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentLayoutObjec t(), paintInvalidationContainer, viewRect);
3943 3935
3944 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); 3936 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect)));
3945 } 3937 }
3946 3938
3947 } // namespace blink 3939 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698