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

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

Issue 17176018: [CSS Regions] Add new regionOversetChange event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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) 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 30 matching lines...) Expand all
41 41
42 namespace WebCore { 42 namespace WebCore {
43 43
44 RenderRegion::RenderRegion(Element* element, RenderFlowThread* flowThread) 44 RenderRegion::RenderRegion(Element* element, RenderFlowThread* flowThread)
45 : RenderBlock(element) 45 : RenderBlock(element)
46 , m_flowThread(flowThread) 46 , m_flowThread(flowThread)
47 , m_parentNamedFlowThread(0) 47 , m_parentNamedFlowThread(0)
48 , m_isValid(false) 48 , m_isValid(false)
49 , m_hasCustomRegionStyle(false) 49 , m_hasCustomRegionStyle(false)
50 , m_hasAutoLogicalHeight(false) 50 , m_hasAutoLogicalHeight(false)
51 , m_regionState(RegionUndefined)
52 { 51 {
53 } 52 }
54 53
55 LayoutUnit RenderRegion::pageLogicalWidth() const 54 LayoutUnit RenderRegion::pageLogicalWidth() const
56 { 55 {
57 ASSERT(m_flowThread); 56 ASSERT(m_flowThread);
58 return m_flowThread->isHorizontalWritingMode() ? contentWidth() : contentHei ght(); 57 return m_flowThread->isHorizontalWritingMode() ? contentWidth() : contentHei ght();
59 } 58 }
60 59
61 LayoutUnit RenderRegion::pageLogicalHeight() const 60 LayoutUnit RenderRegion::pageLogicalHeight() const
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 LayoutUnit minX = isFirstPortion ? (flowThreadOverflow.x() - outlineSize ) : flowThreadPortionRect.x(); 118 LayoutUnit minX = isFirstPortion ? (flowThreadOverflow.x() - outlineSize ) : flowThreadPortionRect.x();
120 LayoutUnit maxX = isLastPortion ? max(flowThreadPortionRect.maxX(), flow ThreadOverflow.maxX()) + outlineSize : flowThreadPortionRect.maxX(); 119 LayoutUnit maxX = isLastPortion ? max(flowThreadPortionRect.maxX(), flow ThreadOverflow.maxX()) + outlineSize : flowThreadPortionRect.maxX();
121 LayoutUnit minY = clipY ? flowThreadPortionRect.y() : min(flowThreadPort ionRect.y(), (flowThreadOverflow.y() - outlineSize)); 120 LayoutUnit minY = clipY ? flowThreadPortionRect.y() : min(flowThreadPort ionRect.y(), (flowThreadOverflow.y() - outlineSize));
122 LayoutUnit maxY = clipY ? flowThreadPortionRect.maxY() : max(flowThreadP ortionRect.y(), (flowThreadOverflow.maxY() + outlineSize)); 121 LayoutUnit maxY = clipY ? flowThreadPortionRect.maxY() : max(flowThreadP ortionRect.y(), (flowThreadOverflow.maxY() + outlineSize));
123 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY); 122 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);
124 } 123 }
125 124
126 return clipRect; 125 return clipRect;
127 } 126 }
128 127
128 RegionOversetState RenderRegion::regionOversetState() const
129 {
130 if (isValid() && node() && node()->isElementNode())
131 return toElement(node())->regionOversetState();
132
133 return RegionUndefined;
134 }
135
136 void RenderRegion::setRegionOversetState(RegionOversetState state)
137 {
138 if (node() && node()->isElementNode())
139 toElement(node())->setRegionOversetState(state);
140 }
141
129 LayoutUnit RenderRegion::pageLogicalTopForOffset(LayoutUnit /* offset */) const 142 LayoutUnit RenderRegion::pageLogicalTopForOffset(LayoutUnit /* offset */) const
130 { 143 {
131 return flowThread()->isHorizontalWritingMode() ? flowThreadPortionRect().y() : flowThreadPortionRect().x(); 144 return flowThread()->isHorizontalWritingMode() ? flowThreadPortionRect().y() : flowThreadPortionRect().x();
132 } 145 }
133 146
134 bool RenderRegion::isFirstRegion() const 147 bool RenderRegion::isFirstRegion() const
135 { 148 {
136 ASSERT(isValid()); 149 ASSERT(isValid());
137 150
138 return m_flowThread->firstRegion() == this; 151 return m_flowThread->firstRegion() == this;
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 if (!hasOverrideHeight()) 633 if (!hasOverrideHeight())
621 return; 634 return;
622 635
623 LayoutUnit newLogicalHeight = overrideLogicalContentHeight() + borderAndPadd ingLogicalHeight(); 636 LayoutUnit newLogicalHeight = overrideLogicalContentHeight() + borderAndPadd ingLogicalHeight();
624 ASSERT(newLogicalHeight < LayoutUnit::max() / 2); 637 ASSERT(newLogicalHeight < LayoutUnit::max() / 2);
625 if (newLogicalHeight > logicalHeight()) 638 if (newLogicalHeight > logicalHeight())
626 setLogicalHeight(newLogicalHeight); 639 setLogicalHeight(newLogicalHeight);
627 } 640 }
628 641
629 } // namespace WebCore 642 } // namespace WebCore
OLDNEW
« Source/core/rendering/RenderFlowThread.h ('K') | « Source/core/rendering/RenderRegion.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698