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

Side by Side Diff: Source/core/rendering/RenderFlowThread.cpp

Issue 207223003: Make LayoutState members private (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixing debug build issues Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderInline.cpp » ('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) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. 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 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 565
566 return 0; 566 return 0;
567 } 567 }
568 568
569 void RenderFlowThread::pushFlowThreadLayoutState(const RenderObject& object) 569 void RenderFlowThread::pushFlowThreadLayoutState(const RenderObject& object)
570 { 570 {
571 if (const RenderBox* currentBoxDescendant = currentStatePusherRenderBox()) { 571 if (const RenderBox* currentBoxDescendant = currentStatePusherRenderBox()) {
572 LayoutState* layoutState = currentBoxDescendant->view()->layoutState(); 572 LayoutState* layoutState = currentBoxDescendant->view()->layoutState();
573 if (layoutState && layoutState->isPaginated()) { 573 if (layoutState && layoutState->isPaginated()) {
574 ASSERT(layoutState->renderer() == currentBoxDescendant); 574 ASSERT(layoutState->renderer() == currentBoxDescendant);
575 LayoutSize offsetDelta = layoutState->m_layoutOffset - layoutState-> m_pageOffset; 575 LayoutSize offsetDelta = layoutState->layoutOffset() - layoutState-> pageOffset();
576 setOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant, currentBo xDescendant->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.widt h()); 576 setOffsetFromLogicalTopOfFirstRegion(currentBoxDescendant, currentBo xDescendant->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.widt h());
577 } 577 }
578 } 578 }
579 579
580 m_statePusherObjectsStack.add(&object); 580 m_statePusherObjectsStack.add(&object);
581 } 581 }
582 582
583 void RenderFlowThread::popFlowThreadLayoutState() 583 void RenderFlowThread::popFlowThreadLayoutState()
584 { 584 {
585 m_statePusherObjectsStack.removeLast(); 585 m_statePusherObjectsStack.removeLast();
(...skipping 12 matching lines...) Expand all
598 LayoutUnit offset; 598 LayoutUnit offset;
599 if (cachedOffsetFromLogicalTopOfFirstRegion(currentBlock, offset)) 599 if (cachedOffsetFromLogicalTopOfFirstRegion(currentBlock, offset))
600 return offset; 600 return offset;
601 601
602 // If it's the current box being laid out, use the layout state. 602 // If it's the current box being laid out, use the layout state.
603 const RenderBox* currentBoxDescendant = currentStatePusherRenderBox(); 603 const RenderBox* currentBoxDescendant = currentStatePusherRenderBox();
604 if (currentBlock == currentBoxDescendant) { 604 if (currentBlock == currentBoxDescendant) {
605 LayoutState* layoutState = view()->layoutState(); 605 LayoutState* layoutState = view()->layoutState();
606 ASSERT(layoutState->renderer() == currentBlock); 606 ASSERT(layoutState->renderer() == currentBlock);
607 ASSERT(layoutState && layoutState->isPaginated()); 607 ASSERT(layoutState && layoutState->isPaginated());
608 LayoutSize offsetDelta = layoutState->m_layoutOffset - layoutState->m_pa geOffset; 608 LayoutSize offsetDelta = layoutState->layoutOffset() - layoutState->page Offset();
609 return currentBoxDescendant->isHorizontalWritingMode() ? offsetDelta.hei ght() : offsetDelta.width(); 609 return currentBoxDescendant->isHorizontalWritingMode() ? offsetDelta.hei ght() : offsetDelta.width();
610 } 610 }
611 611
612 // As a last resort, take the slow path. 612 // As a last resort, take the slow path.
613 LayoutRect blockRect(0, 0, currentBlock->width(), currentBlock->height()); 613 LayoutRect blockRect(0, 0, currentBlock->width(), currentBlock->height());
614 while (currentBlock && !currentBlock->isRenderFlowThread()) { 614 while (currentBlock && !currentBlock->isRenderFlowThread()) {
615 RenderBlock* containerBlock = currentBlock->containingBlock(); 615 RenderBlock* containerBlock = currentBlock->containingBlock();
616 ASSERT(containerBlock); 616 ASSERT(containerBlock);
617 if (!containerBlock) 617 if (!containerBlock)
618 return 0; 618 return 0;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 { 670 {
671 if (!m_renderFlowThread) 671 if (!m_renderFlowThread)
672 return; 672 return;
673 RenderView* view = m_renderFlowThread->view(); 673 RenderView* view = m_renderFlowThread->view();
674 ASSERT(view->flowThreadController()->currentRenderFlowThread() == m_renderFl owThread); 674 ASSERT(view->flowThreadController()->currentRenderFlowThread() == m_renderFl owThread);
675 view->flowThreadController()->setCurrentRenderFlowThread(m_previousRenderFlo wThread); 675 view->flowThreadController()->setCurrentRenderFlowThread(m_previousRenderFlo wThread);
676 } 676 }
677 677
678 678
679 } // namespace WebCore 679 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698