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

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

Issue 136793014: Remove m_margins member from FrameView (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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 | « Source/core/frame/FrameView.h ('k') | Source/core/rendering/RenderEmbeddedObject.h » ('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) 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 setScrollbarModes(ScrollbarAuto, ScrollbarAuto); 293 setScrollbarModes(ScrollbarAuto, ScrollbarAuto);
294 else 294 else
295 setScrollbarModes(ScrollbarAlwaysOff, ScrollbarAlwaysOff); 295 setScrollbarModes(ScrollbarAlwaysOff, ScrollbarAlwaysOff);
296 setScrollbarsSuppressed(false); 296 setScrollbarsSuppressed(false);
297 } 297 }
298 298
299 void FrameView::init() 299 void FrameView::init()
300 { 300 {
301 reset(); 301 reset();
302 302
303 m_margins = LayoutSize(-1, -1); // undefined
304 m_size = LayoutSize(); 303 m_size = LayoutSize();
305 304
306 // Propagate the marginwidth/height and scrolling modes to the view. 305 // Propagate the marginwidth/height and scrolling modes to the view.
307 Element* ownerElement = m_frame->ownerElement(); 306 Element* ownerElement = m_frame->ownerElement();
308 if (ownerElement && (ownerElement->hasTagName(frameTag) || ownerElement->has TagName(iframeTag))) { 307 if (ownerElement && (ownerElement->hasTagName(frameTag) || ownerElement->has TagName(iframeTag))) {
309 HTMLFrameElementBase* frameElt = toHTMLFrameElementBase(ownerElement); 308 HTMLFrameElementBase* frameElt = toHTMLFrameElementBase(ownerElement);
310 if (frameElt->scrollingMode() == ScrollbarAlwaysOff) 309 if (frameElt->scrollingMode() == ScrollbarAlwaysOff)
311 setCanHaveScrollbars(false); 310 setCanHaveScrollbars(false);
312 LayoutUnit marginWidth = frameElt->marginWidth();
313 LayoutUnit marginHeight = frameElt->marginHeight();
314 if (marginWidth != -1)
315 setMarginWidth(marginWidth);
316 if (marginHeight != -1)
317 setMarginHeight(marginHeight);
318 } 311 }
319 } 312 }
320 313
321 void FrameView::prepareForDetach() 314 void FrameView::prepareForDetach()
322 { 315 {
323 RELEASE_ASSERT(!isInLayout()); 316 RELEASE_ASSERT(!isInLayout());
324 317
325 if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) 318 if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
326 scrollAnimator->cancelAnimations(); 319 scrollAnimator->cancelAnimations();
327 320
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 if (oldOverlayStyle != overlayStyle) 364 if (oldOverlayStyle != overlayStyle)
372 setScrollbarOverlayStyle(overlayStyle); 365 setScrollbarOverlayStyle(overlayStyle);
373 } 366 }
374 367
375 void FrameView::clear() 368 void FrameView::clear()
376 { 369 {
377 setCanBlitOnScroll(true); 370 setCanBlitOnScroll(true);
378 371
379 reset(); 372 reset();
380 373
381 if (RenderPart* renderer = m_frame->ownerRenderer())
382 renderer->viewCleared();
383
384 setScrollbarsSuppressed(true); 374 setScrollbarsSuppressed(true);
385 } 375 }
386 376
387 bool FrameView::didFirstLayout() const 377 bool FrameView::didFirstLayout() const
388 { 378 {
389 return !m_firstLayout; 379 return !m_firstLayout;
390 } 380 }
391 381
392 void FrameView::invalidateRect(const IntRect& rect) 382 void FrameView::invalidateRect(const IntRect& rect)
393 { 383 {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 return true; 432 return true;
443 } 433 }
444 return false; 434 return false;
445 } 435 }
446 436
447 RenderView* FrameView::renderView() const 437 RenderView* FrameView::renderView() const
448 { 438 {
449 return frame().contentRenderer(); 439 return frame().contentRenderer();
450 } 440 }
451 441
452 void FrameView::setMarginWidth(LayoutUnit w)
453 {
454 // make it update the rendering area when set
455 m_margins.setWidth(w);
456 }
457
458 void FrameView::setMarginHeight(LayoutUnit h)
459 {
460 // make it update the rendering area when set
461 m_margins.setHeight(h);
462 }
463
464 void FrameView::setCanHaveScrollbars(bool canHaveScrollbars) 442 void FrameView::setCanHaveScrollbars(bool canHaveScrollbars)
465 { 443 {
466 m_canHaveScrollbars = canHaveScrollbars; 444 m_canHaveScrollbars = canHaveScrollbars;
467 ScrollView::setCanHaveScrollbars(canHaveScrollbars); 445 ScrollView::setCanHaveScrollbars(canHaveScrollbars);
468 } 446 }
469 447
470 void FrameView::updateCanHaveScrollbars() 448 void FrameView::updateCanHaveScrollbars()
471 { 449 {
472 ScrollbarMode hMode; 450 ScrollbarMode hMode;
473 ScrollbarMode vMode; 451 ScrollbarMode vMode;
(...skipping 3004 matching lines...) Expand 10 before | Expand all | Expand 10 after
3478 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) 3456 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation)
3479 { 3457 {
3480 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); 3458 ScrollableArea::willRemoveScrollbar(scrollbar, orientation);
3481 if (AXObjectCache* cache = axObjectCache()) { 3459 if (AXObjectCache* cache = axObjectCache()) {
3482 cache->remove(scrollbar); 3460 cache->remove(scrollbar);
3483 cache->handleScrollbarUpdate(this); 3461 cache->handleScrollbarUpdate(this);
3484 } 3462 }
3485 } 3463 }
3486 3464
3487 } // namespace WebCore 3465 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/rendering/RenderEmbeddedObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698