mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1155478 - Use smart pointers for three members of nsIPresShell; r=roc (5ebb5e433)
- Bug 1150614: place floats correctly in vertical writing modes with dir="rtl", r=jfkthame (020ca8893)
- Tests for bug 1150614, r=jfkthame (edba1ffeb)
- Fix test regressions from bug 1150614, r=jfkthame (a68607adc)
- Bug 1162485 - Ensure the vertical-text.enabled pref is set for reftests that involve vertical writing modes. r=smontagu (948cb3a80)
- Bug 1167930 - Handle direction:rtl in vertical modes when converting a LogicalMargin to physical. r=smontagu (0ca0afe6e)
- Bug 1180643 - Fix the SetY() method on LogicalPoint to update the correct field. r=smontagu (3071253fd)
- Bug 1181087 - part 1 - Eliminate the few callers of physical-coordinate setters on the logical-coordinate geometry classes. r=smontagu (3462b41a8)
- Bug 1181087 - part 2 - Remove the unused physical setter methods on logical-coordinate classes. r=smontagu (0715086a8)
- Bug 1145218 - Make the float manager's writing-mode field debug-only, and assert that it matches what callers are passing in. r=smontagu (ee625acd2)
- Bug 756984 - Collapse the selection on the last text node on the line, skipping br and inline frames when clicking past the end of line; r=roc,ehsan (c4dcea1d6)
- Bug 1131451 part 1 - Replace containerWidth with containerSize in logical-coordinate classes and APIs, frame classes, etc. r=dholbert (ad4b55deb)
- Bug 1173646 part 1: Add reftest with flex items whose writing-mode differs from their flex container. r=mats (3dd3d7f97)
- Bug 1173646 part2: Add reftest variants with different writing-mode values on flex container. (no review) (0c82aad87)
- Bug 1173646 part 3: Make FlexItems cache their WritingMode, for quick access. r=mats (7398c33a6)
- Bug 1173646 part 4: Convert isize/bsize into flex container's writing-mode in flexbox macros that aim to pick a main-axis or cross-axis value. r=mats (80ebd414e)
- Bug 1155488 - Mark nsIPresShell::mHiddenInvalidationObserverRefreshDriver as MOZ_UNSAFE_REF; r=roc (10c98ad8f)
- Bug 1156008 - Convert CapturingContentInfo::mContent to StaticRefPtr; r=roc (9ffee3ef4)
- Bug 1177690 - part 3 - Reftests for bevelled corners on collapsed table border. r=dholbert (26e3aff00)
- Bug 1131451 part 2 - Respect the container height when converting vertical-RTL inline-direction coordinates. r=dholbert (594340514)
- Bug 1131451 followup - Remove one more bidi-in-vertical-mode hack that is no longer required. r=dholbert (696b0194f)
- Bug 1183896. Don't assume that relatively positioned table cells actually have positioned offsets computed, because in the case of position:sticky they don't. r=dholbert (remaining parts of rev c87f3d591) (f868b8a64)
This commit is contained in:
@@ -531,15 +531,9 @@ const knownFailures = {
|
||||
"S-Proposed-SM:e.f.w_TEXT-1_SIR-3-dM": true,
|
||||
"S-Proposed-SM:e.f.w_TEXT-1_SIR-3-body": true,
|
||||
"S-Proposed-SM:e.f.w_TEXT-1_SIR-3-div": true,
|
||||
"S-Proposed-SM:e.f.lb_BR.BR-1_SC-1-dM": true,
|
||||
"S-Proposed-SM:e.f.lb_BR.BR-1_SC-1-body": true,
|
||||
"S-Proposed-SM:e.f.lb_BR.BR-1_SC-1-div": true,
|
||||
"S-Proposed-SM:e.f.lb_BR.BR-1_SI-1-dM": true,
|
||||
"S-Proposed-SM:e.f.lb_BR.BR-1_SI-1-body": true,
|
||||
"S-Proposed-SM:e.f.lb_BR.BR-1_SI-1-div": true,
|
||||
"S-Proposed-SM:e.f.lb_BR.BR-1_SM-1-dM": true,
|
||||
"S-Proposed-SM:e.f.lb_BR.BR-1_SM-1-body": true,
|
||||
"S-Proposed-SM:e.f.lb_BR.BR-1_SM-1-div": true,
|
||||
"S-Proposed-SM:e.f.lb_P.P.P-1_SI-1-dM": true,
|
||||
"S-Proposed-SM:e.f.lb_P.P.P-1_SI-1-body": true,
|
||||
"S-Proposed-SM:e.f.lb_P.P.P-1_SI-1-div": true,
|
||||
|
||||
@@ -171,9 +171,9 @@ function execTests() {
|
||||
testSelectCommand("cmd_selectCharNext", node(0), 1);
|
||||
|
||||
doCommand("cmd_moveTop");
|
||||
testMoveCommand("cmd_endLine", body, 1);
|
||||
testMoveCommand("cmd_endLine", node(0), 1);
|
||||
testMoveCommand("cmd_beginLine", node(0), 0);
|
||||
testSelectCommand("cmd_selectEndLine", body, 1);
|
||||
testSelectCommand("cmd_selectEndLine", node(0), 1);
|
||||
doCommand("cmd_moveBottom");
|
||||
testSelectCommand("cmd_selectBeginLine", node(22), 0);
|
||||
|
||||
|
||||
@@ -413,6 +413,9 @@ RestyleManager::RecomputePosition(nsIFrame* aFrame)
|
||||
if (display->IsInnerTableStyle()) {
|
||||
// We don't currently support sticky positioning of inner table
|
||||
// elements (bug 975644). Bail.
|
||||
//
|
||||
// When this is fixed, remove the null-check for the computed
|
||||
// offsets in nsTableRowFrame::ReflowChildren.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1449,10 +1449,11 @@ nsBidiPresUtils::RepositionRubyContentFrame(
|
||||
|
||||
// When ruby-align is not "start", if the content does not fill this
|
||||
// frame, we need to center the children.
|
||||
const nsSize dummyContainerSize;
|
||||
for (nsIFrame* child : childList) {
|
||||
LogicalRect rect = child->GetLogicalRect(aFrameWM, 0);
|
||||
LogicalRect rect = child->GetLogicalRect(aFrameWM, dummyContainerSize);
|
||||
rect.IStart(aFrameWM) += residualISize / 2;
|
||||
child->SetRect(aFrameWM, rect, 0);
|
||||
child->SetRect(aFrameWM, rect, dummyContainerSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1602,28 +1603,23 @@ nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame,
|
||||
frameWM.IsOrthogonalTo(aContainerWM) ? aFrame->BSize() : frameISize;
|
||||
}
|
||||
|
||||
// LogicalRect doesn't correctly calculate the vertical position
|
||||
// in vertical writing modes with right-to-left direction (Bug 1131451).
|
||||
// This does the correct calculation ad hoc pending the fix for that.
|
||||
nsRect rect = aFrame->GetRect();
|
||||
|
||||
LogicalMargin margin = frameMargin.ConvertTo(aContainerWM, frameWM);
|
||||
// In the following variables, if aContainerReverseDir is true, i.e.
|
||||
// the container is positioning its children in reverse of its logical
|
||||
// direction, the "StartOrEnd" refers to the distance from the frame
|
||||
// to the inline end edge of the container, elsewise, it refers to the
|
||||
// distance to the inline start edge.
|
||||
nscoord marginStartOrEnd = aContainerReverseDir ?
|
||||
margin.IEnd(aContainerWM) : margin.IStart(aContainerWM);
|
||||
const LogicalMargin margin = frameMargin.ConvertTo(aContainerWM, frameWM);
|
||||
nscoord marginStartOrEnd =
|
||||
aContainerReverseDir ? margin.IEnd(aContainerWM)
|
||||
: margin.IStart(aContainerWM);
|
||||
nscoord frameStartOrEnd = aStartOrEnd + marginStartOrEnd;
|
||||
// Whether we are placing frames from right to left.
|
||||
// e.g. If the frames are placed reversely in LTR mode, they are
|
||||
// actually placed from right to left.
|
||||
bool orderingRTL = aContainerReverseDir == aContainerWM.IsBidiLTR();
|
||||
(aContainerWM.IsVertical() ? rect.y : rect.x) = orderingRTL ?
|
||||
lineSize - (frameStartOrEnd + icoord) : frameStartOrEnd;
|
||||
(aContainerWM.IsVertical() ? rect.height : rect.width) = icoord;
|
||||
aFrame->SetRect(rect);
|
||||
|
||||
LogicalRect rect = aFrame->GetLogicalRect(aContainerWM, aContainerSize);
|
||||
rect.ISize(aContainerWM) = icoord;
|
||||
rect.IStart(aContainerWM) =
|
||||
aContainerReverseDir ? lineSize - frameStartOrEnd - icoord
|
||||
: frameStartOrEnd;
|
||||
aFrame->SetRect(aContainerWM, rect, aContainerSize);
|
||||
|
||||
return icoord + margin.IStartEnd(aContainerWM);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
#include "gfxPoint.h"
|
||||
#include "nsTHashtable.h"
|
||||
@@ -135,7 +136,7 @@ typedef struct CapturingContentInfo {
|
||||
bool mPointerLock;
|
||||
bool mRetargetToElement;
|
||||
bool mPreventDrag;
|
||||
nsIContent* mContent;
|
||||
mozilla::StaticRefPtr<nsIContent> mContent;
|
||||
} CapturingContentInfo;
|
||||
|
||||
// a7ef8bb3-d628-4965-80f3-a326e089fb7f
|
||||
@@ -1683,18 +1684,21 @@ protected:
|
||||
|
||||
// These are the same Document and PresContext owned by the DocViewer.
|
||||
// we must share ownership.
|
||||
nsIDocument* mDocument; // [STRONG]
|
||||
nsPresContext* mPresContext; // [STRONG]
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
nsRefPtr<nsPresContext> mPresContext;
|
||||
nsStyleSet* mStyleSet; // [OWNS]
|
||||
nsCSSFrameConstructor* mFrameConstructor; // [OWNS]
|
||||
nsViewManager* mViewManager; // [WEAK] docViewer owns it so I don't have to
|
||||
nsPresArena mFrameArena;
|
||||
nsFrameSelection* mSelection;
|
||||
nsRefPtr<nsFrameSelection> mSelection;
|
||||
// Pointer into mFrameConstructor - this is purely so that FrameManager() and
|
||||
// GetRootFrame() can be inlined:
|
||||
nsFrameManagerBase* mFrameManager;
|
||||
mozilla::WeakPtr<nsDocShell> mForwardingContainer;
|
||||
nsRefreshDriver* mHiddenInvalidationObserverRefreshDriver;
|
||||
nsRefreshDriver* MOZ_UNSAFE_REF("These two objects hold weak references "
|
||||
"to each other, and the validity of this "
|
||||
"member is ensured by the logic in nsIPresShell.")
|
||||
mHiddenInvalidationObserverRefreshDriver;
|
||||
#ifdef ACCESSIBILITY
|
||||
mozilla::a11y::DocAccessible* mDocAccessible;
|
||||
#endif
|
||||
|
||||
@@ -5741,7 +5741,7 @@ nsLayoutUtils::GetFirstLinePosition(WritingMode aWM,
|
||||
// kid might be a legend frame here, but that's ok.
|
||||
if (GetFirstLinePosition(aWM, kid, &kidPosition)) {
|
||||
*aResult = kidPosition +
|
||||
kid->GetLogicalNormalPosition(aWM, aFrame->GetSize().width).B(aWM);
|
||||
kid->GetLogicalNormalPosition(aWM, aFrame->GetSize()).B(aWM);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -5761,9 +5761,9 @@ nsLayoutUtils::GetFirstLinePosition(WritingMode aWM,
|
||||
//XXX Not sure if this is the correct value to use for container
|
||||
// width here. It will only be used in vertical-rl layout,
|
||||
// which we don't have full support and testing for yet.
|
||||
nscoord containerWidth = line->mContainerWidth;
|
||||
const nsSize& containerSize = line->mContainerSize;
|
||||
*aResult = kidPosition +
|
||||
kid->GetLogicalNormalPosition(aWM, containerWidth).B(aWM);
|
||||
kid->GetLogicalNormalPosition(aWM, containerSize).B(aWM);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
@@ -5796,16 +5796,16 @@ nsLayoutUtils::GetLastLineBaseline(WritingMode aWM,
|
||||
if (line->IsBlock()) {
|
||||
nsIFrame *kid = line->mFirstChild;
|
||||
nscoord kidBaseline;
|
||||
nscoord containerWidth = line->mContainerWidth;
|
||||
const nsSize& containerSize = line->mContainerSize;
|
||||
if (GetLastLineBaseline(aWM, kid, &kidBaseline)) {
|
||||
// Ignore relative positioning for baseline calculations
|
||||
*aResult = kidBaseline +
|
||||
kid->GetLogicalNormalPosition(aWM, containerWidth).B(aWM);
|
||||
kid->GetLogicalNormalPosition(aWM, containerSize).B(aWM);
|
||||
return true;
|
||||
} else if (kid->GetType() == nsGkAtoms::scrollFrame) {
|
||||
// Use the bottom of the scroll frame.
|
||||
// XXX CSS2.1 really doesn't say what to do here.
|
||||
*aResult = kid->GetLogicalNormalPosition(aWM, containerWidth).B(aWM) +
|
||||
*aResult = kid->GetLogicalNormalPosition(aWM, containerSize).B(aWM) +
|
||||
kid->BSize(aWM);
|
||||
return true;
|
||||
}
|
||||
@@ -5833,9 +5833,9 @@ CalculateBlockContentBEnd(WritingMode aWM, nsBlockFrame* aFrame)
|
||||
line != line_end; ++line) {
|
||||
if (line->IsBlock()) {
|
||||
nsIFrame* child = line->mFirstChild;
|
||||
nscoord containerWidth = line->mContainerWidth;
|
||||
const nsSize& containerSize = line->mContainerSize;
|
||||
nscoord offset =
|
||||
child->GetLogicalNormalPosition(aWM, containerWidth).B(aWM);
|
||||
child->GetLogicalNormalPosition(aWM, containerSize).B(aWM);
|
||||
contentBEnd =
|
||||
std::max(contentBEnd,
|
||||
nsLayoutUtils::CalculateContentBEnd(aWM, child) + offset);
|
||||
@@ -5875,7 +5875,7 @@ nsLayoutUtils::CalculateContentBEnd(WritingMode aWM, nsIFrame* aFrame)
|
||||
nsIFrame* child = childFrames.get();
|
||||
nscoord offset =
|
||||
child->GetLogicalNormalPosition(aWM,
|
||||
aFrame->GetSize().width).B(aWM);
|
||||
aFrame->GetSize()).B(aWM);
|
||||
contentBEnd = std::max(contentBEnd,
|
||||
CalculateContentBEnd(aWM, child) + offset);
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ using namespace mozilla::layout;
|
||||
|
||||
CapturingContentInfo nsIPresShell::gCaptureInfo =
|
||||
{ false /* mAllowed */, false /* mPointerLock */, false /* mRetargetToElement */,
|
||||
false /* mPreventDrag */, nullptr /* mContent */ };
|
||||
false /* mPreventDrag */ };
|
||||
nsIContent* nsIPresShell::gKeyDownTarget;
|
||||
nsClassHashtable<nsUint32HashKey, nsIPresShell::PointerCaptureInfo>* nsIPresShell::gPointerCaptureList;
|
||||
nsClassHashtable<nsUint32HashKey, nsIPresShell::PointerInfo>* nsIPresShell::gActivePointersIds;
|
||||
@@ -760,7 +760,6 @@ PresShell::BeforeAfterKeyboardEventEnabled()
|
||||
PresShell::PresShell()
|
||||
: mMouseLocation(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE)
|
||||
{
|
||||
mSelection = nullptr;
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
mReflowCountMgr = new ReflowCountMgr();
|
||||
mReflowCountMgr->SetPresContext(mPresContext);
|
||||
@@ -847,10 +846,6 @@ PresShell::~PresShell()
|
||||
delete mFrameConstructor;
|
||||
|
||||
mCurrentEventContent = nullptr;
|
||||
|
||||
NS_IF_RELEASE(mPresContext);
|
||||
NS_IF_RELEASE(mDocument);
|
||||
NS_IF_RELEASE(mSelection);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -876,7 +871,6 @@ PresShell::Init(nsIDocument* aDocument,
|
||||
}
|
||||
|
||||
mDocument = aDocument;
|
||||
NS_ADDREF(mDocument);
|
||||
mViewManager = aViewManager;
|
||||
|
||||
// Create our frame constructor.
|
||||
@@ -889,7 +883,6 @@ PresShell::Init(nsIDocument* aDocument,
|
||||
|
||||
// Bind the context to the presentation shell.
|
||||
mPresContext = aPresContext;
|
||||
NS_ADDREF(mPresContext);
|
||||
aPresContext->SetShell(this);
|
||||
|
||||
// Now we can initialize the style set.
|
||||
@@ -922,7 +915,7 @@ PresShell::Init(nsIDocument* aDocument,
|
||||
mAccessibleCaretEventHub = new AccessibleCaretEventHub();
|
||||
}
|
||||
|
||||
NS_ADDREF(mSelection = new nsFrameSelection());
|
||||
mSelection = new nsFrameSelection();
|
||||
|
||||
mSelection->Init(this, nullptr);
|
||||
|
||||
@@ -3881,7 +3874,7 @@ PresShell::ClearMouseCaptureOnView(nsView* aView)
|
||||
if (view) {
|
||||
do {
|
||||
if (view == aView) {
|
||||
NS_RELEASE(gCaptureInfo.mContent);
|
||||
gCaptureInfo.mContent = nullptr;
|
||||
// the view containing the captured content likely disappeared so
|
||||
// disable capture for now.
|
||||
gCaptureInfo.mAllowed = false;
|
||||
@@ -3896,7 +3889,7 @@ PresShell::ClearMouseCaptureOnView(nsView* aView)
|
||||
}
|
||||
}
|
||||
|
||||
NS_RELEASE(gCaptureInfo.mContent);
|
||||
gCaptureInfo.mContent = nullptr;
|
||||
}
|
||||
|
||||
// disable mouse capture until the next mousedown as a dialog has opened
|
||||
@@ -3915,20 +3908,20 @@ nsIPresShell::ClearMouseCapture(nsIFrame* aFrame)
|
||||
|
||||
// null frame argument means clear the capture
|
||||
if (!aFrame) {
|
||||
NS_RELEASE(gCaptureInfo.mContent);
|
||||
gCaptureInfo.mContent = nullptr;
|
||||
gCaptureInfo.mAllowed = false;
|
||||
return;
|
||||
}
|
||||
|
||||
nsIFrame* capturingFrame = gCaptureInfo.mContent->GetPrimaryFrame();
|
||||
if (!capturingFrame) {
|
||||
NS_RELEASE(gCaptureInfo.mContent);
|
||||
gCaptureInfo.mContent = nullptr;
|
||||
gCaptureInfo.mAllowed = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (nsLayoutUtils::IsAncestorFrameCrossDoc(aFrame, capturingFrame)) {
|
||||
NS_RELEASE(gCaptureInfo.mContent);
|
||||
gCaptureInfo.mContent = nullptr;
|
||||
gCaptureInfo.mAllowed = false;
|
||||
}
|
||||
}
|
||||
@@ -6379,14 +6372,14 @@ nsIPresShell::SetCapturingContent(nsIContent* aContent, uint8_t aFlags)
|
||||
return;
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(gCaptureInfo.mContent);
|
||||
gCaptureInfo.mContent = nullptr;
|
||||
|
||||
// only set capturing content if allowed or the CAPTURE_IGNOREALLOWED or
|
||||
// CAPTURE_POINTERLOCK flags are used.
|
||||
if ((aFlags & CAPTURE_IGNOREALLOWED) || gCaptureInfo.mAllowed ||
|
||||
(aFlags & CAPTURE_POINTERLOCK)) {
|
||||
if (aContent) {
|
||||
NS_ADDREF(gCaptureInfo.mContent = aContent);
|
||||
gCaptureInfo.mContent = aContent;
|
||||
}
|
||||
// CAPTURE_POINTERLOCK is the same as CAPTURE_RETARGETTOELEMENT & CAPTURE_IGNOREALLOWED
|
||||
gCaptureInfo.mRetargetToElement = ((aFlags & CAPTURE_RETARGETTOELEMENT) != 0) ||
|
||||
|
||||
@@ -458,19 +458,20 @@ nsComboboxControlFrame::ReflowDropdown(nsPresContext* aPresContext,
|
||||
|
||||
//XXX Can this be different from the dropdown's writing mode?
|
||||
// That would be odd!
|
||||
// Note that we don't need to pass the true frame position or container width
|
||||
// Note that we don't need to pass the true frame position or container size
|
||||
// to ReflowChild or FinishReflowChild here; it will be positioned as needed
|
||||
// by AbsolutelyPositionDropDown().
|
||||
WritingMode outerWM = GetWritingMode();
|
||||
const nsSize dummyContainerSize;
|
||||
nsHTMLReflowMetrics desiredSize(aReflowState);
|
||||
nsReflowStatus ignoredStatus;
|
||||
ReflowChild(mDropdownFrame, aPresContext, desiredSize,
|
||||
kidReflowState, outerWM, LogicalPoint(outerWM), 0,
|
||||
flags, ignoredStatus);
|
||||
kidReflowState, outerWM, LogicalPoint(outerWM),
|
||||
dummyContainerSize, flags, ignoredStatus);
|
||||
|
||||
// Set the child's width and height to its desired size
|
||||
FinishReflowChild(mDropdownFrame, aPresContext, desiredSize, &kidReflowState,
|
||||
outerWM, LogicalPoint(outerWM), 0, flags);
|
||||
outerWM, LogicalPoint(outerWM), dummyContainerSize, flags);
|
||||
}
|
||||
|
||||
nsPoint
|
||||
@@ -570,16 +571,19 @@ nsComboboxControlFrame::GetAvailableDropdownSpace(WritingMode aWM,
|
||||
// Normal frame geometry (eg GetOffsetTo, mRect) doesn't include transforms.
|
||||
// In the special case that our transform is only a 2D translation we
|
||||
// introduce this hack so that the dropdown will show up in the right place.
|
||||
*aTranslation = LogicalPoint(aWM, GetCSSTransformTranslation(), 0);
|
||||
// Use null container size when converting a vector from logical to physical.
|
||||
const nsSize nullContainerSize;
|
||||
*aTranslation = LogicalPoint(aWM, GetCSSTransformTranslation(),
|
||||
nullContainerSize);
|
||||
*aBefore = 0;
|
||||
*aAfter = 0;
|
||||
|
||||
nsRect screen = nsFormControlFrame::GetUsableScreenRect(PresContext());
|
||||
nscoord containerWidth = screen.width;
|
||||
LogicalRect logicalScreen(aWM, screen, containerWidth);
|
||||
nsSize containerSize = screen.Size();
|
||||
LogicalRect logicalScreen(aWM, screen, containerSize);
|
||||
if (mLastDropDownAfterScreenBCoord == nscoord_MIN) {
|
||||
LogicalRect thisScreenRect(aWM, GetScreenRectInAppUnits(),
|
||||
containerWidth);
|
||||
containerSize);
|
||||
mLastDropDownAfterScreenBCoord = thisScreenRect.BEnd(aWM) +
|
||||
aTranslation->B(aWM);
|
||||
mLastDropDownBeforeScreenBCoord = thisScreenRect.BEnd(aWM) +
|
||||
@@ -592,7 +596,7 @@ nsComboboxControlFrame::GetAvailableDropdownSpace(WritingMode aWM,
|
||||
if (root) {
|
||||
minBCoord = LogicalRect(aWM,
|
||||
root->GetScreenRectInAppUnits(),
|
||||
containerWidth).BStart(aWM);
|
||||
containerSize).BStart(aWM);
|
||||
if (mLastDropDownAfterScreenBCoord < minBCoord) {
|
||||
// Don't allow the drop-down to be placed before the content area.
|
||||
return;
|
||||
@@ -664,12 +668,12 @@ nsComboboxControlFrame::AbsolutelyPositionDropDown()
|
||||
|
||||
// Don't position the view unless the position changed since it might cause
|
||||
// a call to NotifyGeometryChange() and an infinite loop here.
|
||||
nscoord containerWidth = GetRect().width;
|
||||
nsSize containerSize = GetSize();
|
||||
const LogicalPoint currentPos =
|
||||
mDropdownFrame->GetLogicalPosition(containerWidth);
|
||||
mDropdownFrame->GetLogicalPosition(containerSize);
|
||||
const LogicalPoint newPos = dropdownPosition + translation;
|
||||
if (currentPos != newPos) {
|
||||
mDropdownFrame->SetPosition(wm, newPos, containerWidth);
|
||||
mDropdownFrame->SetPosition(wm, newPos, containerSize);
|
||||
nsContainerFrame::PositionFrameView(mDropdownFrame);
|
||||
}
|
||||
return eDropDownPositionFinal;
|
||||
@@ -861,9 +865,8 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
// The button should occupy the same space as a scrollbar
|
||||
WritingMode wm = aReflowState.GetWritingMode();
|
||||
nscoord containerWidth =
|
||||
aReflowState.ComputedSizeAsContainerIfConstrained().width;
|
||||
LogicalRect buttonRect = mButtonFrame->GetLogicalRect(containerWidth);
|
||||
nsSize containerSize = aReflowState.ComputedSizeAsContainerIfConstrained();
|
||||
LogicalRect buttonRect = mButtonFrame->GetLogicalRect(containerSize);
|
||||
|
||||
buttonRect.IStart(wm) =
|
||||
aReflowState.ComputedLogicalBorderPadding().IStartEnd(wm) +
|
||||
@@ -876,7 +879,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
buttonRect.BSize(wm) = mDisplayFrame->BSize(wm) +
|
||||
this->GetLogicalUsedPadding(wm).BStartEnd(wm);
|
||||
|
||||
mButtonFrame->SetRect(buttonRect, containerWidth);
|
||||
mButtonFrame->SetRect(buttonRect, containerSize);
|
||||
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
|
||||
!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
|
||||
|
||||
@@ -55,13 +55,13 @@ nsFieldSetFrame::VisualBorderRectRelativeToSelf() const
|
||||
css::Side legendSide = wm.PhysicalSide(eLogicalSideBStart);
|
||||
nscoord legendBorder = StyleBorder()->GetComputedBorderWidth(legendSide);
|
||||
LogicalRect r(wm, LogicalPoint(wm, 0, 0), GetLogicalSize(wm));
|
||||
nscoord containerWidth = r.Width(wm);
|
||||
nsSize containerSize = r.Size(wm).GetPhysicalSize(wm);
|
||||
if (legendBorder < mLegendRect.BSize(wm)) {
|
||||
nscoord off = (mLegendRect.BSize(wm) - legendBorder) / 2;
|
||||
r.BStart(wm) += off;
|
||||
r.BSize(wm) -= off;
|
||||
}
|
||||
return r.GetPhysicalRect(wm, containerWidth);
|
||||
return r.GetPhysicalRect(wm, containerSize);
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
@@ -237,11 +237,11 @@ nsFieldSetFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||
|
||||
// Use the rect of the legend frame, not mLegendRect, so we draw our
|
||||
// border under the legend's inline-start and -end margins.
|
||||
LogicalRect legendRect(wm, legend->GetRect() + aPt, rect.width);
|
||||
LogicalRect legendRect(wm, legend->GetRect() + aPt, rect.Size());
|
||||
|
||||
// Compute clipRect using logical coordinates, so that the legend space
|
||||
// will be clipped out of the appropriate physical side depending on mode.
|
||||
LogicalRect clipRect = LogicalRect(wm, rect, rect.width);
|
||||
LogicalRect clipRect = LogicalRect(wm, rect, rect.Size());
|
||||
DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
|
||||
gfxContext* gfx = aRenderingContext.ThebesContext();
|
||||
int32_t appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
|
||||
@@ -251,33 +251,32 @@ nsFieldSetFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
|
||||
clipRect.BSize(wm) = legendBorderWidth;
|
||||
|
||||
gfx->Save();
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.width),
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.Size()),
|
||||
appUnitsPerDevPixel, *drawTarget));
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext);
|
||||
gfx->Restore();
|
||||
|
||||
// draw inline-end portion of the block-start side of the border
|
||||
clipRect = LogicalRect(wm, rect, rect.width);
|
||||
clipRect = LogicalRect(wm, rect, rect.Size());
|
||||
clipRect.ISize(wm) = clipRect.IEnd(wm) - legendRect.IEnd(wm);
|
||||
clipRect.IStart(wm) = legendRect.IEnd(wm);
|
||||
clipRect.BSize(wm) = legendBorderWidth;
|
||||
|
||||
gfx->Save();
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.width),
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.Size()),
|
||||
appUnitsPerDevPixel, *drawTarget));
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext);
|
||||
gfx->Restore();
|
||||
|
||||
// draw remainder of the border (omitting the block-start side)
|
||||
clipRect = LogicalRect(wm, rect, rect.width);
|
||||
clipRect = LogicalRect(wm, rect, rect.Size());
|
||||
clipRect.BStart(wm) += legendBorderWidth;
|
||||
clipRect.BSize(wm) =
|
||||
GetLogicalRect(rect.width).BSize(wm) - (off + legendBorderWidth);
|
||||
clipRect.BSize(wm) = BSize(wm) - (off + legendBorderWidth);
|
||||
|
||||
gfx->Save();
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.width),
|
||||
gfx->Clip(NSRectToSnappedRect(clipRect.GetPhysicalRect(wm, rect.Size()),
|
||||
appUnitsPerDevPixel, *drawTarget));
|
||||
nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
|
||||
aDirtyRect, rect, mStyleContext);
|
||||
@@ -449,8 +448,12 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
if (reflowLegend) {
|
||||
nsHTMLReflowMetrics legendDesiredSize(aReflowState);
|
||||
|
||||
// We'll move the legend to its proper place later, so the position
|
||||
// and containerSize passed here are unimportant.
|
||||
const nsSize dummyContainerSize;
|
||||
ReflowChild(legend, aPresContext, legendDesiredSize, *legendReflowState,
|
||||
wm, LogicalPoint(wm), 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
|
||||
wm, LogicalPoint(wm), dummyContainerSize,
|
||||
NS_FRAME_NO_MOVE_FRAME, aStatus);
|
||||
#ifdef NOISY_REFLOW
|
||||
printf(" returned (%d, %d)\n",
|
||||
legendDesiredSize.Width(), legendDesiredSize.Height());
|
||||
@@ -477,10 +480,9 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
reflowInner = true;
|
||||
}
|
||||
|
||||
// We'll move the legend to its proper place later.
|
||||
FinishReflowChild(legend, aPresContext, legendDesiredSize,
|
||||
legendReflowState.ptr(), wm, LogicalPoint(wm), 0,
|
||||
NS_FRAME_NO_MOVE_FRAME);
|
||||
legendReflowState.ptr(), wm, LogicalPoint(wm),
|
||||
dummyContainerSize, NS_FRAME_NO_MOVE_FRAME);
|
||||
} else if (!legend) {
|
||||
mLegendRect.SetEmpty();
|
||||
mLegendSpace = 0;
|
||||
@@ -490,8 +492,10 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
legendMargin = legend->GetLogicalUsedMargin(wm);
|
||||
}
|
||||
|
||||
nscoord containerWidth = (wm.IsVertical() ? mLegendSpace : 0) +
|
||||
border.LeftRight(wm);
|
||||
// This containerSize is incomplete as yet: it does not include the size
|
||||
// of the |inner| frame itself.
|
||||
nsSize containerSize = (LogicalSize(wm, 0, mLegendSpace) +
|
||||
border.Size(wm)).GetPhysicalSize(wm);
|
||||
// reflow the content frame only if needed
|
||||
if (reflowInner) {
|
||||
nsHTMLReflowState kidReflowState(aPresContext, aReflowState, inner,
|
||||
@@ -525,26 +529,31 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
"Margins on anonymous fieldset child not supported!");
|
||||
LogicalPoint pt(wm, border.IStart(wm), border.BStart(wm) + mLegendSpace);
|
||||
|
||||
// We don't know the correct containerSize until we have reflowed |inner|,
|
||||
// so we use a dummy value for now; FinishReflowChild will fix the position
|
||||
// if necessary.
|
||||
const nsSize dummyContainerSize;
|
||||
ReflowChild(inner, aPresContext, kidDesiredSize, kidReflowState,
|
||||
wm, pt, containerWidth, 0, aStatus);
|
||||
wm, pt, dummyContainerSize, 0, aStatus);
|
||||
|
||||
// update the container width after reflowing the inner frame
|
||||
// Update containerSize to account for size of the inner frame, so that
|
||||
// FinishReflowChild can position it correctly.
|
||||
containerSize += kidDesiredSize.PhysicalSize();
|
||||
FinishReflowChild(inner, aPresContext, kidDesiredSize,
|
||||
&kidReflowState, wm, pt,
|
||||
containerWidth + kidDesiredSize.Width(), 0);
|
||||
&kidReflowState, wm, pt, containerSize, 0);
|
||||
NS_FRAME_TRACE_REFLOW_OUT("FieldSet::Reflow", aStatus);
|
||||
}
|
||||
|
||||
if (inner) {
|
||||
containerWidth += inner->GetSize().width;
|
||||
} else if (inner) {
|
||||
// |inner| didn't need to be reflowed but we do need to include its size
|
||||
// in containerSize.
|
||||
containerSize += inner->GetSize();
|
||||
}
|
||||
|
||||
LogicalRect contentRect(wm);
|
||||
if (inner) {
|
||||
// We don't support margins on inner, so our content rect is just the
|
||||
// inner's border-box. We don't care about container-width at this point,
|
||||
// as we'll figure out the actual positioning later.
|
||||
contentRect = inner->GetLogicalRect(wm, containerWidth);
|
||||
// inner's border-box. (We don't really care about container size at this
|
||||
// point, as we'll figure out the actual positioning later.)
|
||||
contentRect = inner->GetLogicalRect(wm, containerSize);
|
||||
}
|
||||
|
||||
// Our content rect must fill up the available width
|
||||
@@ -607,9 +616,9 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
|
||||
ConvertTo(wm, legendReflowState->GetWritingMode());
|
||||
nsHTMLReflowState::ApplyRelativePositioning(legend, wm, offsets,
|
||||
&actualLegendPos,
|
||||
containerWidth);
|
||||
containerSize);
|
||||
|
||||
legend->SetPosition(wm, actualLegendPos, containerWidth);
|
||||
legend->SetPosition(wm, actualLegendPos, containerSize);
|
||||
nsContainerFrame::PositionFrameView(legend);
|
||||
nsContainerFrame::PositionChildViews(legend);
|
||||
}
|
||||
@@ -682,6 +691,6 @@ nscoord
|
||||
nsFieldSetFrame::GetLogicalBaseline(WritingMode aWritingMode) const
|
||||
{
|
||||
nsIFrame* inner = GetInner();
|
||||
return inner->BStart(aWritingMode, GetParent()->GetSize().width) +
|
||||
return inner->BStart(aWritingMode, GetParent()->GetSize()) +
|
||||
inner->GetLogicalBaseline(aWritingMode);
|
||||
}
|
||||
|
||||
@@ -320,11 +320,12 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
childPos.B(wm) = 0; // This will be set properly later, after reflowing the
|
||||
// child to determine its size.
|
||||
|
||||
// We just pass 0 for containerWidth here, as the child will be repositioned
|
||||
// later by FinishReflowChild.
|
||||
// We just pass a dummy containerSize here, as the child will be
|
||||
// repositioned later by FinishReflowChild.
|
||||
nsSize dummyContainerSize;
|
||||
ReflowChild(aFirstKid, aPresContext,
|
||||
contentsDesiredSize, contentsReflowState,
|
||||
wm, childPos, 0, 0, contentsReflowStatus);
|
||||
wm, childPos, dummyContainerSize, 0, contentsReflowStatus);
|
||||
MOZ_ASSERT(NS_FRAME_IS_COMPLETE(contentsReflowStatus),
|
||||
"We gave button-contents frame unconstrained available height, "
|
||||
"so it should be complete");
|
||||
@@ -373,12 +374,13 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
|
||||
// its focus-padding rect:
|
||||
childPos.B(wm) += focusPadding.BStart(wm) + clbp.BStart(wm);
|
||||
|
||||
nscoord containerWidth = buttonContentBox.Width(wm) + clbp.LeftRight(wm);
|
||||
nsSize containerSize =
|
||||
(buttonContentBox + clbp.Size(wm)).GetPhysicalSize(wm);
|
||||
|
||||
// Place the child
|
||||
FinishReflowChild(aFirstKid, aPresContext,
|
||||
contentsDesiredSize, &contentsReflowState,
|
||||
wm, childPos, containerWidth, 0);
|
||||
wm, childPos, containerSize, 0);
|
||||
|
||||
// Make sure we have a useful 'ascent' value for the child
|
||||
if (contentsDesiredSize.BlockStartAscent() ==
|
||||
|
||||
@@ -236,10 +236,10 @@ nsMeterFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
LogicalSize autoSize(wm);
|
||||
autoSize.BSize(wm) = autoSize.ISize(wm) = fontMet->Font().size; // 1em
|
||||
|
||||
if (ResolvedOrientationIsVertical()) {
|
||||
autoSize.Height(wm) *= 5; // 5em
|
||||
if (ResolvedOrientationIsVertical() == wm.IsVertical()) {
|
||||
autoSize.ISize(wm) *= 5; // 5em
|
||||
} else {
|
||||
autoSize.Width(wm) *= 5; // 5em
|
||||
autoSize.BSize(wm) *= 5; // 5em
|
||||
}
|
||||
|
||||
return autoSize.ConvertTo(aWM, wm);
|
||||
|
||||
@@ -175,8 +175,12 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
wrapperMargin.BStart(myWM));
|
||||
|
||||
nsReflowStatus childStatus;
|
||||
// We initially reflow the child with a dummy containerSize; positioning
|
||||
// will be fixed later.
|
||||
const nsSize dummyContainerSize;
|
||||
ReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
||||
wrapperReflowState, myWM, wrapperOffset, 0, 0, childStatus);
|
||||
wrapperReflowState, myWM, wrapperOffset, dummyContainerSize, 0,
|
||||
childStatus);
|
||||
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
|
||||
"We gave our child unconstrained available block-size, "
|
||||
"so it should be complete");
|
||||
@@ -208,18 +212,21 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
|
||||
wrapperOffset.B(myWM) += std::max(0, extraSpace / 2);
|
||||
|
||||
// Needed in FinishReflowChild, for logical-to-physical conversion:
|
||||
nscoord borderBoxWidth = myWM.IsVertical() ?
|
||||
borderBoxBSize : borderBoxISize;
|
||||
nsSize borderBoxSize = LogicalSize(myWM, borderBoxISize, borderBoxBSize).
|
||||
GetPhysicalSize(myWM);
|
||||
|
||||
// Place the child
|
||||
FinishReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
|
||||
&wrapperReflowState, myWM, wrapperOffset,
|
||||
borderBoxWidth, 0);
|
||||
borderBoxSize, 0);
|
||||
|
||||
nsSize contentBoxSize =
|
||||
LogicalSize(myWM, contentBoxISize, contentBoxBSize).
|
||||
GetPhysicalSize(myWM);
|
||||
aDesiredSize.SetBlockStartAscent(
|
||||
wrappersDesiredSize.BlockStartAscent() +
|
||||
outerWrapperFrame->BStart(aReflowState.GetWritingMode(),
|
||||
contentBoxISize));
|
||||
contentBoxSize));
|
||||
}
|
||||
|
||||
LogicalSize logicalDesiredSize(myWM, borderBoxISize, borderBoxBSize);
|
||||
|
||||
@@ -242,10 +242,10 @@ nsProgressFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
NSToCoordRound(StyleFont()->mFont.size *
|
||||
nsLayoutUtils::FontSizeInflationFor(this)); // 1em
|
||||
|
||||
if (ResolvedOrientationIsVertical()) {
|
||||
autoSize.Height(wm) *= 10; // 10em
|
||||
if (ResolvedOrientationIsVertical() == wm.IsVertical()) {
|
||||
autoSize.ISize(wm) *= 10; // 10em
|
||||
} else {
|
||||
autoSize.Width(wm) *= 10; // 10em
|
||||
autoSize.BSize(wm) *= 10; // 10em
|
||||
}
|
||||
|
||||
return autoSize.ConvertTo(aWM, wm);
|
||||
|
||||
@@ -216,11 +216,12 @@ nsTextControlFrame::CalcIntrinsicSize(nsRenderingContext* aRenderingContext,
|
||||
NS_ASSERTION(scrollableFrame, "Child must be scrollable");
|
||||
|
||||
if (scrollableFrame) {
|
||||
nsMargin scrollbarSizes =
|
||||
scrollableFrame->GetDesiredScrollbarSizes(PresContext(), aRenderingContext);
|
||||
LogicalMargin scrollbarSizes(aWM,
|
||||
scrollableFrame->GetDesiredScrollbarSizes(PresContext(),
|
||||
aRenderingContext));
|
||||
|
||||
aIntrinsicSize.Width(aWM) += scrollbarSizes.LeftRight();
|
||||
aIntrinsicSize.Height(aWM) += scrollbarSizes.TopBottom();
|
||||
aIntrinsicSize.ISize(aWM) += scrollbarSizes.IStartEnd(aWM);
|
||||
aIntrinsicSize.BSize(aWM) += scrollbarSizes.BStartEnd(aWM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -263,11 +263,11 @@ TextOverflow::TextOverflow(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aBlockFrame)
|
||||
: mContentArea(aBlockFrame->GetWritingMode(),
|
||||
aBlockFrame->GetContentRectRelativeToSelf(),
|
||||
aBlockFrame->GetRect().width)
|
||||
aBlockFrame->GetSize())
|
||||
, mBuilder(aBuilder)
|
||||
, mBlock(aBlockFrame)
|
||||
, mScrollableFrame(nsLayoutUtils::GetScrollableFrameFor(aBlockFrame))
|
||||
, mBlockWidth(aBlockFrame->GetRect().width)
|
||||
, mBlockSize(aBlockFrame->GetSize())
|
||||
, mBlockWM(aBlockFrame->GetWritingMode())
|
||||
, mAdjustForPixelSnapping(false)
|
||||
{
|
||||
@@ -296,9 +296,12 @@ TextOverflow::TextOverflow(nsDisplayListBuilder* aBuilder,
|
||||
// to pixel snapping behaviour in our scrolling code.
|
||||
mAdjustForPixelSnapping = mCanHaveInlineAxisScrollbar;
|
||||
}
|
||||
// Use a null containerSize to convert a vector from logical to physical.
|
||||
const nsSize nullContainerSize;
|
||||
mContentArea.MoveBy(mBlockWM,
|
||||
LogicalPoint(mBlockWM,
|
||||
mScrollableFrame->GetScrollPosition(), 0));
|
||||
mScrollableFrame->GetScrollPosition(),
|
||||
nullContainerSize));
|
||||
nsIFrame* scrollFrame = do_QueryFrame(mScrollableFrame);
|
||||
scrollFrame->AddStateBits(NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL);
|
||||
}
|
||||
@@ -394,7 +397,7 @@ TextOverflow::AnalyzeMarkerEdges(nsIFrame* aFrame,
|
||||
LogicalRect borderRect(mBlockWM,
|
||||
nsRect(aFrame->GetOffsetTo(mBlock),
|
||||
aFrame->GetSize()),
|
||||
mBlockWidth);
|
||||
mBlockSize);
|
||||
nscoord istartOverlap = std::max(
|
||||
aInsideMarkersArea.IStart(mBlockWM) - borderRect.IStart(mBlockWM), 0);
|
||||
nscoord iendOverlap = std::max(
|
||||
@@ -468,9 +471,9 @@ TextOverflow::ExamineLineFrames(nsLineBox* aLine,
|
||||
bool suppressIEnd = mIEnd.mStyle->mType == NS_STYLE_TEXT_OVERFLOW_CLIP;
|
||||
if (mCanHaveInlineAxisScrollbar) {
|
||||
LogicalPoint pos(mBlockWM, mScrollableFrame->GetScrollPosition(),
|
||||
mBlockWidth);
|
||||
mBlockSize);
|
||||
LogicalRect scrollRange(mBlockWM, mScrollableFrame->GetScrollRange(),
|
||||
mBlockWidth);
|
||||
mBlockSize);
|
||||
// No ellipsing when nothing to scroll to on that side (this includes
|
||||
// overflow:auto that doesn't trigger a horizontal scrollbar).
|
||||
if (pos.I(mBlockWM) <= scrollRange.IStart(mBlockWM)) {
|
||||
@@ -487,7 +490,7 @@ TextOverflow::ExamineLineFrames(nsLineBox* aLine,
|
||||
InflateIStart(mBlockWM, &contentArea, scrollAdjust);
|
||||
InflateIEnd(mBlockWM, &contentArea, scrollAdjust);
|
||||
LogicalRect lineRect(mBlockWM, aLine->GetScrollableOverflowArea(),
|
||||
mBlockWidth);
|
||||
mBlockSize);
|
||||
const bool istartOverflow =
|
||||
!suppressIStart && lineRect.IStart(mBlockWM) < contentArea.IStart(mBlockWM);
|
||||
const bool iendOverflow =
|
||||
@@ -760,8 +763,8 @@ TextOverflow::CreateMarkers(const nsLineBox* aLine,
|
||||
aLine->BStart(), mIStart.mIntrinsicISize, aLine->BSize());
|
||||
nsPoint offset = mBuilder->ToReferenceFrame(mBlock);
|
||||
nsRect markerRect =
|
||||
markerLogicalRect.GetPhysicalRect(mBlockWM, mBlockWidth) + offset;
|
||||
ClipMarker(mContentArea.GetPhysicalRect(mBlockWM, mBlockWidth) + offset,
|
||||
markerLogicalRect.GetPhysicalRect(mBlockWM, mBlockSize) + offset;
|
||||
ClipMarker(mContentArea.GetPhysicalRect(mBlockWM, mBlockSize) + offset,
|
||||
markerRect, clipState);
|
||||
nsDisplayItem* marker = new (mBuilder)
|
||||
nsDisplayTextOverflowMarker(mBuilder, mBlock, markerRect,
|
||||
@@ -777,8 +780,8 @@ TextOverflow::CreateMarkers(const nsLineBox* aLine,
|
||||
mIEnd.mIntrinsicISize, aLine->BSize());
|
||||
nsPoint offset = mBuilder->ToReferenceFrame(mBlock);
|
||||
nsRect markerRect =
|
||||
markerLogicalRect.GetPhysicalRect(mBlockWM, mBlockWidth) + offset;
|
||||
ClipMarker(mContentArea.GetPhysicalRect(mBlockWM, mBlockWidth) + offset,
|
||||
markerLogicalRect.GetPhysicalRect(mBlockWM, mBlockSize) + offset;
|
||||
ClipMarker(mContentArea.GetPhysicalRect(mBlockWM, mBlockSize) + offset,
|
||||
markerRect, clipState);
|
||||
nsDisplayItem* marker = new (mBuilder)
|
||||
nsDisplayTextOverflowMarker(mBuilder, mBlock, markerRect,
|
||||
|
||||
@@ -117,7 +117,7 @@ class TextOverflow {
|
||||
return LogicalRect(mBlockWM,
|
||||
aFrame->GetScrollableOverflowRect() +
|
||||
aFrame->GetOffsetTo(mBlock),
|
||||
mBlockWidth);
|
||||
mBlockSize);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,7 +210,7 @@ class TextOverflow {
|
||||
nsIFrame* mBlock;
|
||||
nsIScrollableFrame* mScrollableFrame;
|
||||
nsDisplayList mMarkerList;
|
||||
nscoord mBlockWidth;
|
||||
nsSize mBlockSize;
|
||||
WritingMode mBlockWM;
|
||||
bool mCanHaveInlineAxisScrollbar;
|
||||
bool mAdjustForPixelSnapping;
|
||||
|
||||
+78
-195
@@ -641,27 +641,29 @@ public:
|
||||
{ }
|
||||
|
||||
// Construct from a writing mode and a physical point, within a given
|
||||
// containing rectangle's width (defining the conversion between LTR
|
||||
// and RTL coordinates).
|
||||
// containing rectangle's size (defining the conversion between LTR
|
||||
// and RTL coordinates, and between TTB and BTT coordinates).
|
||||
LogicalPoint(WritingMode aWritingMode,
|
||||
const nsPoint& aPoint,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
#ifdef DEBUG
|
||||
: mWritingMode(aWritingMode)
|
||||
#endif
|
||||
{
|
||||
if (aWritingMode.IsVertical()) {
|
||||
I() = aPoint.y;
|
||||
B() = aWritingMode.IsVerticalLR() ? aPoint.x : aContainerWidth - aPoint.x;
|
||||
I() = aWritingMode.IsBidiLTR() ? aPoint.y
|
||||
: aContainerSize.height - aPoint.y;
|
||||
B() = aWritingMode.IsVerticalLR() ? aPoint.x
|
||||
: aContainerSize.width - aPoint.x;
|
||||
} else {
|
||||
I() = aWritingMode.IsBidiLTR() ? aPoint.x : aContainerWidth - aPoint.x;
|
||||
I() = aWritingMode.IsBidiLTR() ? aPoint.x
|
||||
: aContainerSize.width - aPoint.x;
|
||||
B() = aPoint.y;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read-only (const) access to the coordinates, in both logical
|
||||
* and physical terms.
|
||||
* Read-only (const) access to the logical coordinates.
|
||||
*/
|
||||
nscoord I(WritingMode aWritingMode) const // inline-axis
|
||||
{
|
||||
@@ -674,21 +676,6 @@ public:
|
||||
return mPoint.y;
|
||||
}
|
||||
|
||||
nscoord X(WritingMode aWritingMode, nscoord aContainerWidth) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
return aWritingMode.IsVerticalLR() ? B() : aContainerWidth - B();
|
||||
} else {
|
||||
return aWritingMode.IsBidiLTR() ? I() : aContainerWidth - I();
|
||||
}
|
||||
}
|
||||
nscoord Y(WritingMode aWritingMode) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ? I() : B();
|
||||
}
|
||||
|
||||
/**
|
||||
* These non-const accessors return a reference (lvalue) that can be
|
||||
* assigned to by callers.
|
||||
@@ -704,41 +691,22 @@ public:
|
||||
return mPoint.y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setters for the physical coordinates.
|
||||
*/
|
||||
void SetX(WritingMode aWritingMode, nscoord aX, nscoord aContainerWidth)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
B() = aWritingMode.IsVerticalLR() ? aX : aContainerWidth - aX;
|
||||
} else {
|
||||
I() = aWritingMode.IsBidiLTR() ? aX : aContainerWidth - aX;
|
||||
}
|
||||
}
|
||||
void SetY(WritingMode aWritingMode, nscoord aY)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
B() = aY;
|
||||
} else {
|
||||
I() = aY;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a physical point corresponding to our logical coordinates,
|
||||
* converted according to our writing mode.
|
||||
*/
|
||||
nsPoint GetPhysicalPoint(WritingMode aWritingMode,
|
||||
nscoord aContainerWidth) const
|
||||
const nsSize& aContainerSize) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
return nsPoint(aWritingMode.IsVerticalLR() ? B() : aContainerWidth - B(),
|
||||
I());
|
||||
return nsPoint(aWritingMode.IsVerticalLR()
|
||||
? B() : aContainerSize.width - B(),
|
||||
aWritingMode.IsBidiLTR()
|
||||
? I() : aContainerSize.height - I());
|
||||
} else {
|
||||
return nsPoint(aWritingMode.IsBidiLTR() ? I() : aContainerWidth - I(),
|
||||
return nsPoint(aWritingMode.IsBidiLTR()
|
||||
? I() : aContainerSize.width - I(),
|
||||
B());
|
||||
}
|
||||
}
|
||||
@@ -747,13 +715,13 @@ public:
|
||||
* Return the equivalent point in a different writing mode.
|
||||
*/
|
||||
LogicalPoint ConvertTo(WritingMode aToMode, WritingMode aFromMode,
|
||||
nscoord aContainerWidth) const
|
||||
const nsSize& aContainerSize) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aFromMode);
|
||||
return aToMode == aFromMode ?
|
||||
*this : LogicalPoint(aToMode,
|
||||
GetPhysicalPoint(aFromMode, aContainerWidth),
|
||||
aContainerWidth);
|
||||
GetPhysicalPoint(aFromMode, aContainerSize),
|
||||
aContainerSize);
|
||||
}
|
||||
|
||||
bool operator==(const LogicalPoint& aOther) const
|
||||
@@ -929,7 +897,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Writable references to the logical and physical dimensions
|
||||
* Writable references to the logical dimensions
|
||||
*/
|
||||
nscoord& ISize(WritingMode aWritingMode) // inline-size
|
||||
{
|
||||
@@ -942,17 +910,6 @@ public:
|
||||
return mSize.height;
|
||||
}
|
||||
|
||||
nscoord& Width(WritingMode aWritingMode)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ? BSize() : ISize();
|
||||
}
|
||||
nscoord& Height(WritingMode aWritingMode)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ? ISize() : BSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an nsSize containing our physical dimensions
|
||||
*/
|
||||
@@ -978,7 +935,7 @@ public:
|
||||
// optimization for non-DEBUG builds where LogicalSize doesn't store
|
||||
// the writing mode
|
||||
return (aToMode == aFromMode || !aToMode.IsOrthogonalTo(aFromMode))
|
||||
? *this : LogicalSize(aToMode, BSize(), ISize());
|
||||
? *this : LogicalSize(aToMode, BSize(), ISize());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1241,49 +1198,23 @@ public:
|
||||
mMargin.SizeTo(aBStart, aIEnd, aBEnd, aIStart);
|
||||
}
|
||||
|
||||
nscoord& Top(WritingMode aWritingMode)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ?
|
||||
(aWritingMode.IsBidiLTR() ? IStart() : IEnd()) : BStart();
|
||||
}
|
||||
|
||||
nscoord& Bottom(WritingMode aWritingMode)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ?
|
||||
(aWritingMode.IsBidiLTR() ? IEnd() : IStart()) : BEnd();
|
||||
}
|
||||
|
||||
nscoord& Left(WritingMode aWritingMode)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ?
|
||||
(aWritingMode.IsVerticalLR() ? BStart() : BEnd()) :
|
||||
(aWritingMode.IsBidiLTR() ? IStart() : IEnd());
|
||||
}
|
||||
|
||||
nscoord& Right(WritingMode aWritingMode)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ?
|
||||
(aWritingMode.IsVerticalLR() ? BEnd() : BStart()) :
|
||||
(aWritingMode.IsBidiLTR() ? IEnd() : IStart());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an nsMargin containing our physical coordinates
|
||||
*/
|
||||
nsMargin GetPhysicalMargin(WritingMode aWritingMode) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ?
|
||||
(aWritingMode.IsVerticalLR() ?
|
||||
nsMargin(IStart(), BEnd(), IEnd(), BStart()) :
|
||||
nsMargin(IStart(), BStart(), IEnd(), BEnd())) :
|
||||
(aWritingMode.IsBidiLTR() ?
|
||||
nsMargin(BStart(), IEnd(), BEnd(), IStart()) :
|
||||
nsMargin(BStart(), IStart(), BEnd(), IEnd()));
|
||||
return aWritingMode.IsVertical()
|
||||
? (aWritingMode.IsVerticalLR()
|
||||
? (aWritingMode.IsBidiLTR()
|
||||
? nsMargin(IStart(), BEnd(), IEnd(), BStart())
|
||||
: nsMargin(IEnd(), BEnd(), IStart(), BStart()))
|
||||
: (aWritingMode.IsBidiLTR()
|
||||
? nsMargin(IStart(), BStart(), IEnd(), BEnd())
|
||||
: nsMargin(IEnd(), BStart(), IStart(), BEnd())))
|
||||
: (aWritingMode.IsBidiLTR()
|
||||
? nsMargin(BStart(), IEnd(), BEnd(), IStart())
|
||||
: nsMargin(BStart(), IStart(), BEnd(), IEnd()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1442,28 +1373,23 @@ public:
|
||||
|
||||
LogicalRect(WritingMode aWritingMode,
|
||||
const nsRect& aRect,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
#ifdef DEBUG
|
||||
: mWritingMode(aWritingMode)
|
||||
#endif
|
||||
{
|
||||
if (aWritingMode.IsVertical()) {
|
||||
if (aWritingMode.IsVerticalLR()) {
|
||||
mRect.y = aRect.x;
|
||||
} else {
|
||||
mRect.y = aContainerWidth - aRect.XMost();
|
||||
}
|
||||
mRect.y = aWritingMode.IsVerticalLR()
|
||||
? aRect.x : aContainerSize.width - aRect.XMost();
|
||||
mRect.x = aWritingMode.IsBidiLTR()
|
||||
? aRect.y : aContainerSize.height - aRect.YMost();
|
||||
mRect.height = aRect.width;
|
||||
mRect.x = aRect.y;
|
||||
mRect.width = aRect.height;
|
||||
} else {
|
||||
if (aWritingMode.IsBidiLTR()) {
|
||||
mRect.x = aRect.x;
|
||||
} else {
|
||||
mRect.x = aContainerWidth - aRect.XMost();
|
||||
}
|
||||
mRect.width = aRect.width;
|
||||
mRect.x = aWritingMode.IsBidiLTR()
|
||||
? aRect.x : aContainerSize.width - aRect.XMost();
|
||||
mRect.y = aRect.y;
|
||||
mRect.width = aRect.width;
|
||||
mRect.height = aRect.height;
|
||||
}
|
||||
}
|
||||
@@ -1531,25 +1457,27 @@ public:
|
||||
/**
|
||||
* Accessors for line-relative coordinates
|
||||
*/
|
||||
nscoord LineLeft(WritingMode aWritingMode, nscoord aContainerWidth) const
|
||||
nscoord LineLeft(WritingMode aWritingMode,
|
||||
const nsSize& aContainerSize) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
return IStart(); // sideways-left will require aContainerHeight
|
||||
} else {
|
||||
return aWritingMode.IsBidiLTR() ? IStart()
|
||||
: aContainerWidth - IEnd();
|
||||
if (aWritingMode.IsBidiLTR()) {
|
||||
return IStart();
|
||||
}
|
||||
nscoord containerISize =
|
||||
aWritingMode.IsVertical() ? aContainerSize.height : aContainerSize.width;
|
||||
return containerISize - IEnd();
|
||||
}
|
||||
nscoord LineRight(WritingMode aWritingMode, nscoord aContainerWidth) const
|
||||
nscoord LineRight(WritingMode aWritingMode,
|
||||
const nsSize& aContainerSize) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
return IEnd(); // sideways-left will require aContainerHeight
|
||||
} else {
|
||||
return aWritingMode.IsBidiLTR() ? IEnd()
|
||||
: aContainerWidth - IStart();
|
||||
if (aWritingMode.IsBidiLTR()) {
|
||||
return IEnd();
|
||||
}
|
||||
nscoord containerISize =
|
||||
aWritingMode.IsVertical() ? aContainerSize.height : aContainerSize.width;
|
||||
return containerISize - IStart();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1567,37 +1495,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SetX(WritingMode aWritingMode, nscoord aX, nscoord aContainerWidth)
|
||||
nscoord Y(WritingMode aWritingMode, nscoord aContainerHeight) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
if (aWritingMode.IsVerticalLR()) {
|
||||
BStart() = aX;
|
||||
} else {
|
||||
BStart() = aContainerWidth - aX - BSize();
|
||||
}
|
||||
return aWritingMode.IsBidiLTR() ? mRect.X()
|
||||
: aContainerHeight - mRect.XMost();
|
||||
} else {
|
||||
if (aWritingMode.IsBidiLTR()) {
|
||||
IStart() = aX;
|
||||
} else {
|
||||
IStart() = aContainerWidth - aX - ISize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nscoord Y(WritingMode aWritingMode) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ? mRect.X() : mRect.Y();
|
||||
}
|
||||
|
||||
void SetY(WritingMode aWritingMode, nscoord aY)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
IStart() = aY;
|
||||
} else {
|
||||
BStart() = aY;
|
||||
return mRect.Y();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1607,41 +1512,12 @@ public:
|
||||
return aWritingMode.IsVertical() ? mRect.Height() : mRect.Width();
|
||||
}
|
||||
|
||||
// When setting the Width of a rect, we keep its physical X-coord fixed
|
||||
// and modify XMax. This means that in the RTL case, we'll be moving
|
||||
// the IStart, so that IEnd remains constant.
|
||||
void SetWidth(WritingMode aWritingMode, nscoord aWidth)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
if (!aWritingMode.IsVerticalLR()) {
|
||||
BStart() = BStart() + BSize() - aWidth;
|
||||
}
|
||||
BSize() = aWidth;
|
||||
} else {
|
||||
if (!aWritingMode.IsBidiLTR()) {
|
||||
IStart() = IStart() + ISize() - aWidth;
|
||||
}
|
||||
ISize() = aWidth;
|
||||
}
|
||||
}
|
||||
|
||||
nscoord Height(WritingMode aWritingMode) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ? mRect.Width() : mRect.Height();
|
||||
}
|
||||
|
||||
void SetHeight(WritingMode aWritingMode, nscoord aHeight)
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
ISize() = aHeight;
|
||||
} else {
|
||||
BSize() = aHeight;
|
||||
}
|
||||
}
|
||||
|
||||
nscoord XMost(WritingMode aWritingMode, nscoord aContainerWidth) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
@@ -1654,10 +1530,15 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
nscoord YMost(WritingMode aWritingMode) const
|
||||
nscoord YMost(WritingMode aWritingMode, nscoord aContainerHeight) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
return aWritingMode.IsVertical() ? mRect.XMost() : mRect.YMost();
|
||||
if (aWritingMode.IsVertical()) {
|
||||
return aWritingMode.IsBidiLTR() ? mRect.XMost()
|
||||
: aContainerHeight - mRect.x;
|
||||
} else {
|
||||
return mRect.YMost();
|
||||
}
|
||||
}
|
||||
|
||||
bool IsEmpty() const
|
||||
@@ -1759,19 +1640,21 @@ public:
|
||||
|
||||
/**
|
||||
* Return an nsRect containing our physical coordinates within the given
|
||||
* container width
|
||||
* container size.
|
||||
*/
|
||||
nsRect GetPhysicalRect(WritingMode aWritingMode,
|
||||
nscoord aContainerWidth) const
|
||||
const nsSize& aContainerSize) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aWritingMode);
|
||||
if (aWritingMode.IsVertical()) {
|
||||
return nsRect(aWritingMode.IsVerticalLR() ?
|
||||
BStart() : aContainerWidth - BEnd(),
|
||||
IStart(), BSize(), ISize());
|
||||
return nsRect(aWritingMode.IsVerticalLR()
|
||||
? BStart() : aContainerSize.width - BEnd(),
|
||||
aWritingMode.IsBidiLTR()
|
||||
? IStart() : aContainerSize.height - IEnd(),
|
||||
BSize(), ISize());
|
||||
} else {
|
||||
return nsRect(aWritingMode.IsBidiLTR() ?
|
||||
IStart() : aContainerWidth - IEnd(),
|
||||
return nsRect(aWritingMode.IsBidiLTR()
|
||||
? IStart() : aContainerSize.width - IEnd(),
|
||||
BStart(), ISize(), BSize());
|
||||
}
|
||||
}
|
||||
@@ -1780,12 +1663,12 @@ public:
|
||||
* Return a LogicalRect representing this rect in a different writing mode
|
||||
*/
|
||||
LogicalRect ConvertTo(WritingMode aToMode, WritingMode aFromMode,
|
||||
nscoord aContainerWidth) const
|
||||
const nsSize& aContainerSize) const
|
||||
{
|
||||
CHECK_WRITING_MODE(aFromMode);
|
||||
return aToMode == aFromMode ?
|
||||
*this : LogicalRect(aToMode, GetPhysicalRect(aFromMode, aContainerWidth),
|
||||
aContainerWidth);
|
||||
*this : LogicalRect(aToMode, GetPhysicalRect(aFromMode, aContainerSize),
|
||||
aContainerSize);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -408,7 +408,7 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
||||
// Don't split if told not to (e.g. for fixed frames)
|
||||
&& (aDelegatingFrame->GetType() != nsGkAtoms::inlineFrame)
|
||||
//XXX we don't handle splitting frames for inline absolute containing blocks yet
|
||||
&& (aKidFrame->GetLogicalRect(aContainingBlock.width).BStart(wm) <=
|
||||
&& (aKidFrame->GetLogicalRect(aContainingBlock.Size()).BStart(wm) <=
|
||||
aReflowState.AvailableBSize());
|
||||
// Don't split things below the fold. (Ideally we shouldn't *have*
|
||||
// anything totally below the fold, but we can't position frames
|
||||
@@ -468,12 +468,8 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
|
||||
margin.BStart(outerWM),
|
||||
kidSize.ISize(outerWM), kidSize.BSize(outerWM));
|
||||
nsRect r =
|
||||
rect.GetPhysicalRect(outerWM, logicalCBSize.Width(wm) +
|
||||
border.LeftRight(outerWM));
|
||||
// XXX hack to correct for lack of bidi support in vertical mode
|
||||
if (outerWM.IsVertical() && !outerWM.IsBidiLTR()) {
|
||||
r.y = logicalCBSize.Height(wm) + border.TopBottom(outerWM) - r.YMost();
|
||||
}
|
||||
rect.GetPhysicalRect(outerWM, logicalCBSize.GetPhysicalSize(wm) +
|
||||
border.Size(outerWM).GetPhysicalSize(outerWM));
|
||||
|
||||
// Offset the frame rect by the given origin of the absolute containing block.
|
||||
// If the frame is auto-positioned on both sides of an axis, it will be
|
||||
|
||||
@@ -1277,9 +1277,9 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
// bullets that are placed next to a child block (bug 92896)
|
||||
|
||||
// Tall bullets won't look particularly nice here...
|
||||
LogicalRect bbox = bullet->GetLogicalRect(wm, metrics.Width());
|
||||
LogicalRect bbox = bullet->GetLogicalRect(wm, metrics.PhysicalSize());
|
||||
bbox.BStart(wm) = position.mBaseline - metrics.BlockStartAscent();
|
||||
bullet->SetRect(wm, bbox, metrics.Width());
|
||||
bullet->SetRect(wm, bbox, metrics.PhysicalSize());
|
||||
}
|
||||
// Otherwise just leave the bullet where it is, up against our
|
||||
// block-start padding.
|
||||
@@ -1292,12 +1292,11 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
ComputeFinalSize(*reflowState, state, aMetrics, &blockEndEdgeOfChildren);
|
||||
|
||||
// If the block direction is right-to-left, we need to update the bounds of
|
||||
// lines that were placed relative to mContainerWidth during reflow, as
|
||||
// we typically do not know the true container width (block-dir size of the
|
||||
// finished paragraph/block) until we've reflowed all its children. So we
|
||||
// use a "fake" mContainerWidth during reflow (see nsBlockReflowState's
|
||||
// constructor) and then fix up the positions of the lines here, once the
|
||||
// final block size is known.
|
||||
// lines that were placed relative to mContainerSize during reflow, as
|
||||
// we typically do not know the true container size until we've reflowed all
|
||||
// its children. So we use a dummy mContainerSize during reflow (see
|
||||
// nsBlockReflowState's constructor) and then fix up the positions of the
|
||||
// lines here, once the final block size is known.
|
||||
//
|
||||
// Note that writing-mode:vertical-rl is the only case where the block
|
||||
// logical direction progresses in a negative physical direction, and
|
||||
@@ -1305,12 +1304,12 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
// of the coordinate space in order to translate between the logical and
|
||||
// physical origins.
|
||||
if (wm.IsVerticalRL()) {
|
||||
nscoord containerWidth = aMetrics.Width();
|
||||
nscoord deltaX = containerWidth - state.ContainerWidth();
|
||||
if (deltaX) {
|
||||
nsSize containerSize = aMetrics.PhysicalSize();
|
||||
nscoord deltaX = containerSize.width - state.ContainerSize().width;
|
||||
if (deltaX != 0) {
|
||||
for (line_iterator line = begin_lines(), end = end_lines();
|
||||
line != end; line++) {
|
||||
UpdateLineContainerWidth(line, containerWidth);
|
||||
UpdateLineContainerSize(line, containerSize);
|
||||
}
|
||||
for (nsIFrame* f : mFloats) {
|
||||
nsPoint physicalDelta(deltaX, 0);
|
||||
@@ -1966,9 +1965,9 @@ nsBlockFrame::PropagateFloatDamage(nsBlockReflowState& aState,
|
||||
// Scrollable overflow should be sufficient for things that affect
|
||||
// layout.
|
||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
||||
nscoord containerWidth = aState.ContainerWidth();
|
||||
nsSize containerSize = aState.ContainerSize();
|
||||
LogicalRect overflow = aLine->GetOverflowArea(eScrollableOverflow, wm,
|
||||
containerWidth);
|
||||
containerSize);
|
||||
nscoord lineBCoordCombinedBefore = overflow.BStart(wm) + aDeltaBCoord;
|
||||
nscoord lineBCoordCombinedAfter = lineBCoordCombinedBefore +
|
||||
overflow.BSize(wm);
|
||||
@@ -2209,11 +2208,11 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
|
||||
PropagateFloatDamage(aState, line, deltaBCoord);
|
||||
}
|
||||
|
||||
// If the container width has changed reset the container width. If the
|
||||
// If the container size has changed, reset mContainerSize. If the
|
||||
// line's writing mode is not ltr, or if the line is not left-aligned, also
|
||||
// mark the line dirty.
|
||||
if (aState.ContainerWidth() != line->mContainerWidth) {
|
||||
line->mContainerWidth = aState.ContainerWidth();
|
||||
if (aState.ContainerSize() != line->mContainerSize) {
|
||||
line->mContainerSize = aState.ContainerSize();
|
||||
|
||||
bool isLastLine = line == mLines.back() &&
|
||||
!GetNextInFlow() &&
|
||||
@@ -2850,26 +2849,26 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
|
||||
NS_PRECONDITION(aDeltaBCoord != 0, "why slide a line nowhere?");
|
||||
|
||||
// Adjust line state
|
||||
aLine->SlideBy(aDeltaBCoord, aState.ContainerWidth());
|
||||
aLine->SlideBy(aDeltaBCoord, aState.ContainerSize());
|
||||
|
||||
// Adjust the frames in the line
|
||||
MoveChildFramesOfLine(aLine, aDeltaBCoord);
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::UpdateLineContainerWidth(nsLineBox* aLine,
|
||||
nscoord aNewContainerWidth)
|
||||
nsBlockFrame::UpdateLineContainerSize(nsLineBox* aLine,
|
||||
const nsSize& aNewContainerSize)
|
||||
{
|
||||
if (aNewContainerWidth == aLine->mContainerWidth) {
|
||||
if (aNewContainerSize == aLine->mContainerSize) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Adjust line state
|
||||
nscoord widthDelta = aLine->UpdateContainerWidth(aNewContainerWidth);
|
||||
nsSize sizeDelta = aLine->UpdateContainerSize(aNewContainerSize);
|
||||
|
||||
// Changing container width only matters if writing mode is vertical-rl
|
||||
if (GetWritingMode().IsVerticalRL()) {
|
||||
MoveChildFramesOfLine(aLine, widthDelta);
|
||||
MoveChildFramesOfLine(aLine, sizeDelta.width);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3828,7 +3827,7 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState,
|
||||
WritingMode lineWM = GetWritingMode(aLine->mFirstChild);
|
||||
LogicalRect lineRect =
|
||||
aFloatAvailableSpace.mRect.ConvertTo(lineWM, outerWM,
|
||||
aState.ContainerWidth());
|
||||
aState.ContainerSize());
|
||||
|
||||
nscoord iStart = lineRect.IStart(lineWM);
|
||||
nscoord availISize = lineRect.ISize(lineWM);
|
||||
@@ -6301,14 +6300,14 @@ nsBlockFrame::ReflowPushedFloats(nsBlockReflowState& aState,
|
||||
|
||||
void
|
||||
nsBlockFrame::RecoverFloats(nsFloatManager& aFloatManager, WritingMode aWM,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
// Recover our own floats
|
||||
nsIFrame* stop = nullptr; // Stop before we reach pushed floats that
|
||||
// belong to our next-in-flow
|
||||
for (nsIFrame* f = mFloats.FirstChild(); f && f != stop; f = f->GetNextSibling()) {
|
||||
LogicalRect region = nsFloatManager::GetRegionFor(aWM, f, aContainerWidth);
|
||||
aFloatManager.AddFloat(f, region, aWM, aContainerWidth);
|
||||
LogicalRect region = nsFloatManager::GetRegionFor(aWM, f, aContainerSize);
|
||||
aFloatManager.AddFloat(f, region, aWM, aContainerSize);
|
||||
if (!stop && f->GetNextInFlow())
|
||||
stop = f->GetNextInFlow();
|
||||
}
|
||||
@@ -6316,13 +6315,13 @@ nsBlockFrame::RecoverFloats(nsFloatManager& aFloatManager, WritingMode aWM,
|
||||
// Recurse into our overflow container children
|
||||
for (nsIFrame* oc = GetFirstChild(kOverflowContainersList);
|
||||
oc; oc = oc->GetNextSibling()) {
|
||||
RecoverFloatsFor(oc, aFloatManager, aWM, aContainerWidth);
|
||||
RecoverFloatsFor(oc, aFloatManager, aWM, aContainerSize);
|
||||
}
|
||||
|
||||
// Recurse into our normal children
|
||||
for (nsBlockFrame::line_iterator line = begin_lines(); line != end_lines(); ++line) {
|
||||
if (line->IsBlock()) {
|
||||
RecoverFloatsFor(line->mFirstChild, aFloatManager, aWM, aContainerWidth);
|
||||
RecoverFloatsFor(line->mFirstChild, aFloatManager, aWM, aContainerSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6331,7 +6330,7 @@ void
|
||||
nsBlockFrame::RecoverFloatsFor(nsIFrame* aFrame,
|
||||
nsFloatManager& aFloatManager,
|
||||
WritingMode aWM,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
NS_PRECONDITION(aFrame, "null frame");
|
||||
// Only blocks have floats
|
||||
@@ -6344,11 +6343,11 @@ nsBlockFrame::RecoverFloatsFor(nsIFrame* aFrame,
|
||||
// accordingly so that we consider relatively positioned frames
|
||||
// at their original position.
|
||||
|
||||
LogicalRect rect(aWM, block->GetNormalRect(), aContainerWidth);
|
||||
nscoord lineLeft = rect.LineLeft(aWM, aContainerWidth);
|
||||
LogicalRect rect(aWM, block->GetNormalRect(), aContainerSize);
|
||||
nscoord lineLeft = rect.LineLeft(aWM, aContainerSize);
|
||||
nscoord blockStart = rect.BStart(aWM);
|
||||
aFloatManager.Translate(lineLeft, blockStart);
|
||||
block->RecoverFloats(aFloatManager, aWM, aContainerWidth);
|
||||
block->RecoverFloats(aFloatManager, aWM, aContainerSize);
|
||||
aFloatManager.Translate(-lineLeft, -blockStart);
|
||||
}
|
||||
}
|
||||
@@ -7204,7 +7203,7 @@ nsBlockFrame::ReflowBullet(nsIFrame* aBulletFrame,
|
||||
aBulletFrame->SetRect(wm, LogicalRect(wm, iStart, bStart,
|
||||
aMetrics.ISize(wm),
|
||||
aMetrics.BSize(wm)),
|
||||
aState.ContainerWidth());
|
||||
aState.ContainerSize());
|
||||
aBulletFrame->DidReflow(aState.mPresContext, &aState.mReflowState,
|
||||
nsDidReflowStatus::FINISHED);
|
||||
}
|
||||
|
||||
@@ -412,10 +412,10 @@ protected:
|
||||
void SlideLine(nsBlockReflowState& aState,
|
||||
nsLineBox* aLine, nscoord aDeltaBCoord);
|
||||
|
||||
void UpdateLineContainerWidth(nsLineBox* aLine,
|
||||
nscoord aNewContainerWidth);
|
||||
void UpdateLineContainerSize(nsLineBox* aLine,
|
||||
const nsSize& aNewContainerSize);
|
||||
|
||||
// helper for SlideLine and UpdateLineContainerWidth
|
||||
// helper for SlideLine and UpdateLineContainerSize
|
||||
void MoveChildFramesOfLine(nsLineBox* aLine, nscoord aDeltaBCoord);
|
||||
|
||||
void ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
||||
@@ -492,7 +492,7 @@ public:
|
||||
static void RecoverFloatsFor(nsIFrame* aFrame,
|
||||
nsFloatManager& aFloatManager,
|
||||
mozilla::WritingMode aWM,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
|
||||
/**
|
||||
* Determine if we have any pushed floats from a previous continuation.
|
||||
@@ -564,7 +564,7 @@ protected:
|
||||
*/
|
||||
void RecoverFloats(nsFloatManager& aFloatManager,
|
||||
mozilla::WritingMode aWM,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
|
||||
/** Reflow pushed floats
|
||||
*/
|
||||
|
||||
@@ -233,7 +233,7 @@ nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
||||
{
|
||||
mFrame = aFrameRS.frame;
|
||||
mWritingMode = aState.mReflowState.GetWritingMode();
|
||||
mContainerWidth = aState.ContainerWidth();
|
||||
mContainerSize = aState.ContainerSize();
|
||||
mSpace = aSpace;
|
||||
|
||||
if (!aIsAdjacentWithBStart) {
|
||||
@@ -283,7 +283,7 @@ nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
||||
usedMargin.IStartEnd(mWritingMode),
|
||||
mSpace.BSize(mWritingMode) -
|
||||
usedMargin.BStartEnd(mWritingMode));
|
||||
tI = space.LineLeft(mWritingMode, mContainerWidth);
|
||||
tI = space.LineLeft(mWritingMode, mContainerSize);
|
||||
tB = mBCoord;
|
||||
|
||||
if ((mFrame->GetStateBits() & NS_BLOCK_FLOAT_MGR) == 0)
|
||||
@@ -433,22 +433,23 @@ nsBlockReflowContext::PlaceBlock(const nsHTMLReflowState& aReflowState,
|
||||
aLine->SetBounds(mWritingMode,
|
||||
mICoord, mBCoord - backupContainingBlockAdvance,
|
||||
mMetrics.ISize(mWritingMode), mMetrics.BSize(mWritingMode),
|
||||
mContainerWidth);
|
||||
mContainerSize);
|
||||
|
||||
WritingMode frameWM = mFrame->GetWritingMode();
|
||||
LogicalPoint logPos =
|
||||
LogicalPoint(mWritingMode, mICoord, mBCoord).
|
||||
ConvertTo(frameWM, mWritingMode, mContainerWidth - mMetrics.Width());
|
||||
ConvertTo(frameWM, mWritingMode,
|
||||
mContainerSize - mMetrics.PhysicalSize());
|
||||
|
||||
// ApplyRelativePositioning in right-to-left writing modes needs to
|
||||
// know the updated frame width
|
||||
mFrame->SetSize(mWritingMode, mMetrics.Size(mWritingMode));
|
||||
aReflowState.ApplyRelativePositioning(&logPos, mContainerWidth);
|
||||
aReflowState.ApplyRelativePositioning(&logPos, mContainerSize);
|
||||
|
||||
// Now place the frame and complete the reflow process
|
||||
nsContainerFrame::FinishReflowChild(mFrame, mPresContext, mMetrics,
|
||||
&aReflowState, frameWM, logPos,
|
||||
mContainerWidth, 0);
|
||||
mContainerSize, 0);
|
||||
|
||||
aOverflowAreas = mMetrics.mOverflowAreas + mFrame->GetPosition();
|
||||
|
||||
|
||||
@@ -83,7 +83,8 @@ protected:
|
||||
nsIFrame* mFrame;
|
||||
mozilla::LogicalRect mSpace;
|
||||
|
||||
nscoord mICoord, mBCoord, mContainerWidth;
|
||||
nscoord mICoord, mBCoord;
|
||||
nsSize mContainerSize;
|
||||
mozilla::WritingMode mWritingMode;
|
||||
nsHTMLReflowMetrics mMetrics;
|
||||
nsCollapsingMargin mBStartMargin;
|
||||
|
||||
@@ -349,7 +349,7 @@ nsBlockReflowState::GetFloatAvailableSpaceWithState(
|
||||
nsFlowAreaRect result =
|
||||
mFloatManager->GetFlowArea(wm, aBCoord, nsFloatManager::BAND_FROM_POINT,
|
||||
blockSize, mContentArea, aState,
|
||||
ContainerWidth());
|
||||
ContainerSize());
|
||||
// Keep the inline size >= 0 for compatibility with nsSpaceManager.
|
||||
if (result.mRect.ISize(wm) < 0) {
|
||||
result.mRect.ISize(wm) = 0;
|
||||
@@ -382,7 +382,7 @@ nsBlockReflowState::GetFloatAvailableSpaceForBSize(
|
||||
#endif
|
||||
nsFlowAreaRect result =
|
||||
mFloatManager->GetFlowArea(wm, aBCoord, nsFloatManager::WIDTH_WITHIN_HEIGHT,
|
||||
aBSize, mContentArea, aState, ContainerWidth());
|
||||
aBSize, mContentArea, aState, ContainerSize());
|
||||
// Keep the width >= 0 for compatibility with nsSpaceManager.
|
||||
if (result.mRect.ISize(wm) < 0) {
|
||||
result.mRect.ISize(wm) = 0;
|
||||
@@ -506,7 +506,7 @@ nsBlockReflowState::RecoverFloats(nsLineList::iterator aLine,
|
||||
tI, tB, mFloatManagerI, mFloatManagerB);
|
||||
nsFrame::ListTag(stdout, floatFrame);
|
||||
LogicalRect region = nsFloatManager::GetRegionFor(wm, floatFrame,
|
||||
ContainerWidth());
|
||||
ContainerSize());
|
||||
printf(" aDeltaBCoord=%d region={%d,%d,%d,%d}\n",
|
||||
aDeltaBCoord, region.IStart(wm), region.BStart(wm),
|
||||
region.ISize(wm), region.BSize(wm));
|
||||
@@ -514,13 +514,13 @@ nsBlockReflowState::RecoverFloats(nsLineList::iterator aLine,
|
||||
#endif
|
||||
mFloatManager->AddFloat(floatFrame,
|
||||
nsFloatManager::GetRegionFor(wm, floatFrame,
|
||||
ContainerWidth()),
|
||||
wm, ContainerWidth());
|
||||
ContainerSize()),
|
||||
wm, ContainerSize());
|
||||
fc = fc->Next();
|
||||
}
|
||||
} else if (aLine->IsBlock()) {
|
||||
nsBlockFrame::RecoverFloatsFor(aLine->mFirstChild, *mFloatManager, wm,
|
||||
ContainerWidth());
|
||||
ContainerSize());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -727,7 +727,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
|
||||
// The float's old region, so we can propagate damage.
|
||||
LogicalRect oldRegion = nsFloatManager::GetRegionFor(wm, aFloat,
|
||||
ContainerWidth());
|
||||
ContainerSize());
|
||||
|
||||
// Enforce CSS2 9.5.1 rule [2], i.e., make sure that a float isn't
|
||||
// ``above'' another float that preceded it in the flow.
|
||||
@@ -877,7 +877,9 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
// LineLeft() and LineRight() here, because we would only have to
|
||||
// convert the result back into this block's writing mode.
|
||||
LogicalPoint floatPos(wm);
|
||||
if ((NS_STYLE_FLOAT_LEFT == floatDisplay->mFloats) == wm.IsBidiLTR()) {
|
||||
bool leftFloat = NS_STYLE_FLOAT_LEFT == floatDisplay->mFloats;
|
||||
|
||||
if (leftFloat == wm.IsBidiLTR()) {
|
||||
floatPos.I(wm) = floatAvailableSpace.mRect.IStart(wm);
|
||||
}
|
||||
else {
|
||||
@@ -952,14 +954,14 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
|
||||
// If float is relatively positioned, factor that in as well
|
||||
nsHTMLReflowState::ApplyRelativePositioning(aFloat, wm, floatOffsets,
|
||||
&origin, ContainerWidth());
|
||||
&origin, ContainerSize());
|
||||
|
||||
// Position the float and make sure and views are properly
|
||||
// positioned. We need to explicitly position its child views as
|
||||
// well, since we're moving the float after flowing it.
|
||||
bool moved = aFloat->GetLogicalPosition(wm, ContainerWidth()) != origin;
|
||||
bool moved = aFloat->GetLogicalPosition(wm, ContainerSize()) != origin;
|
||||
if (moved) {
|
||||
aFloat->SetPosition(wm, origin, ContainerWidth());
|
||||
aFloat->SetPosition(wm, origin, ContainerSize());
|
||||
nsContainerFrame::PositionFrameView(aFloat);
|
||||
nsContainerFrame::PositionChildViews(aFloat);
|
||||
}
|
||||
@@ -973,7 +975,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
// calculate region
|
||||
LogicalRect region =
|
||||
nsFloatManager::CalculateRegionFor(wm, aFloat, floatMargin,
|
||||
ContainerWidth());
|
||||
ContainerSize());
|
||||
// if the float split, then take up all of the vertical height
|
||||
if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus) &&
|
||||
(NS_UNCONSTRAINEDSIZE != ContentBSize())) {
|
||||
@@ -981,10 +983,10 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
ContentBSize() - floatPos.B(wm));
|
||||
}
|
||||
DebugOnly<nsresult> rv = mFloatManager->AddFloat(aFloat, region, wm,
|
||||
ContainerWidth());
|
||||
ContainerSize());
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv), "bad float placement");
|
||||
// store region
|
||||
nsFloatManager::StoreRegionFor(wm, aFloat, region, ContainerWidth());
|
||||
nsFloatManager::StoreRegionFor(wm, aFloat, region, ContainerSize());
|
||||
|
||||
// If the float's dimensions have changed, note the damage in the
|
||||
// float manager.
|
||||
|
||||
@@ -233,8 +233,7 @@ public:
|
||||
|
||||
// Physical size. Use only for physical <-> logical coordinate conversion.
|
||||
nsSize mContainerSize;
|
||||
nscoord ContainerWidth() const { return mContainerSize.width; }
|
||||
nscoord ContainerHeight() const { return mContainerSize.height; }
|
||||
const nsSize& ContainerSize() const { return mContainerSize; }
|
||||
|
||||
// Continuation out-of-flow float frames that need to move to our
|
||||
// next in flow are placed here during reflow. It's a pointer to
|
||||
|
||||
@@ -661,20 +661,20 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
WritingMode wm = aReflowState.GetWritingMode();
|
||||
WritingMode kidWM = kidReflowState.GetWritingMode();
|
||||
nscoord containerWidth = aReflowState.ComputedWidth();
|
||||
nsSize containerSize = aReflowState.ComputedPhysicalSize();
|
||||
|
||||
LogicalMargin margin = kidReflowState.ComputedLogicalMargin();
|
||||
LogicalPoint kidPt(kidWM, margin.IStart(kidWM), margin.BStart(kidWM));
|
||||
|
||||
kidReflowState.ApplyRelativePositioning(&kidPt, containerWidth);
|
||||
kidReflowState.ApplyRelativePositioning(&kidPt, containerSize);
|
||||
|
||||
// Reflow the frame
|
||||
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState,
|
||||
kidWM, kidPt, containerWidth, 0, aStatus);
|
||||
kidWM, kidPt, containerSize, 0, aStatus);
|
||||
|
||||
// Complete the reflow and position and size the child frame
|
||||
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, &kidReflowState,
|
||||
kidWM, kidPt, containerWidth, 0);
|
||||
kidWM, kidPt, containerSize, 0);
|
||||
|
||||
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
|
||||
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
|
||||
|
||||
@@ -360,13 +360,13 @@ nsColumnSetFrame::ReflowColumns(nsHTMLReflowMetrics& aDesiredSize,
|
||||
}
|
||||
|
||||
static void MoveChildTo(nsIFrame* aChild, LogicalPoint aOrigin,
|
||||
WritingMode aWM, nscoord aContainerWidth)
|
||||
WritingMode aWM, const nsSize& aContainerSize)
|
||||
{
|
||||
if (aChild->GetLogicalPosition(aWM, aContainerWidth) == aOrigin) {
|
||||
if (aChild->GetLogicalPosition(aWM, aContainerSize) == aOrigin) {
|
||||
return;
|
||||
}
|
||||
|
||||
aChild->SetPosition(aWM, aOrigin, aContainerWidth);
|
||||
aChild->SetPosition(aWM, aOrigin, aContainerSize);
|
||||
nsContainerFrame::PlaceFrameView(aChild);
|
||||
}
|
||||
|
||||
@@ -488,10 +488,11 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
||||
nsIFrame* child = mFrames.FirstChild();
|
||||
LogicalPoint childOrigin(wm, borderPadding.IStart(wm),
|
||||
borderPadding.BStart(wm));
|
||||
// In vertical-rl mode we can't use the computed width as the
|
||||
// container width because it may be NS_UNCONSTRAINEDSIZE, so we use 0
|
||||
// for now and reposition the columns after reflowing them all.
|
||||
nscoord containerWidth = wm.IsVerticalRL() ? 0 : aReflowState.ComputedWidth();
|
||||
// In vertical-rl mode, columns will not be correctly placed if the
|
||||
// reflowState's ComputedWidth() is UNCONSTRAINED (in which case we'll get
|
||||
// a containerSize.width of zero here). In that case, the column positions
|
||||
// will be adjusted later, after our correct contentSize is known.
|
||||
nsSize containerSize = aReflowState.ComputedSizeAsContainerIfConstrained();
|
||||
|
||||
// For RTL, since the columns might not fill the frame exactly, we
|
||||
// need to account for the slop. Otherwise we'll waste time moving the
|
||||
@@ -506,7 +507,8 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
||||
availISize = aReflowState.ComputedISize();
|
||||
}
|
||||
if (availISize != NS_INTRINSICSIZE) {
|
||||
childOrigin.I(wm) = containerWidth - borderPadding.Left(wm) - availISize;
|
||||
childOrigin.I(wm) = containerSize.width - borderPadding.Left(wm) -
|
||||
availISize;
|
||||
#ifdef DEBUG_roc
|
||||
printf("*** childOrigin.iCoord = %d\n", childOrigin.I(wm));
|
||||
#endif
|
||||
@@ -567,7 +569,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
||||
nscoord childContentBEnd = 0;
|
||||
if (!reflowNext && (skipIncremental || skipResizeBSizeShrink)) {
|
||||
// This child does not need to be reflowed, but we may need to move it
|
||||
MoveChildTo(child, childOrigin, wm, containerWidth);
|
||||
MoveChildTo(child, childOrigin, wm, containerSize);
|
||||
|
||||
// If this is the last frame then make sure we get the right status
|
||||
nsIFrame* kidNext = child->GetNextSibling();
|
||||
@@ -634,7 +636,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
||||
childOrigin.B(wm) +
|
||||
kidReflowState.ComputedLogicalMargin().BStart(wm));
|
||||
ReflowChild(child, PresContext(), kidDesiredSize, kidReflowState,
|
||||
wm, origin, containerWidth, 0, aStatus);
|
||||
wm, origin, containerSize, 0, aStatus);
|
||||
|
||||
reflowNext = (aStatus & NS_FRAME_REFLOW_NEXTINFLOW) != 0;
|
||||
|
||||
@@ -649,7 +651,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
||||
*aCarriedOutBEndMargin = kidDesiredSize.mCarriedOutBEndMargin;
|
||||
|
||||
FinishReflowChild(child, PresContext(), kidDesiredSize,
|
||||
&kidReflowState, wm, childOrigin, containerWidth, 0);
|
||||
&kidReflowState, wm, childOrigin, containerSize, 0);
|
||||
|
||||
childContentBEnd = nsLayoutUtils::CalculateContentBEnd(wm, child);
|
||||
if (childContentBEnd > aConfig.mColMaxBSize) {
|
||||
@@ -801,17 +803,17 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
||||
aDesiredSize.mOverflowAreas = overflowRects;
|
||||
aDesiredSize.UnionOverflowAreasWithDesiredBounds();
|
||||
|
||||
// In vertical-rl mode, make a second pass to reposition the columns
|
||||
// with the correct container width
|
||||
if (wm.IsVerticalRL()) {
|
||||
child = mFrames.FirstChild();
|
||||
while (child) {
|
||||
// Get the logical position as set before with containerWidth=0
|
||||
// and reset with the correct container width (which is the block
|
||||
// size in vertical modes).
|
||||
child->SetPosition(wm, child->GetLogicalPosition(wm, 0),
|
||||
contentSize.BSize(wm));
|
||||
child = child->GetNextSibling();
|
||||
// In vertical-rl mode, make a second pass if necessary to reposition the
|
||||
// columns with the correct container width. (In other writing modes,
|
||||
// correct containerSize was not required for column positioning so we don't
|
||||
// need this fixup.)
|
||||
if (wm.IsVerticalRL() && containerSize.width != contentSize.Width(wm)) {
|
||||
const nsSize finalContainerSize = aDesiredSize.PhysicalSize();
|
||||
for (nsIFrame* child : mFrames) {
|
||||
// Get the logical position as set previously using a provisional or
|
||||
// dummy containerSize, and reset with the correct container size.
|
||||
child->SetPosition(wm, child->GetLogicalPosition(wm, containerSize),
|
||||
finalContainerSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -974,20 +974,20 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
const WritingMode& aWM,
|
||||
const LogicalPoint& aPos,
|
||||
nscoord aContainerWidth,
|
||||
const nsSize& aContainerSize,
|
||||
uint32_t aFlags,
|
||||
nsReflowStatus& aStatus,
|
||||
nsOverflowContinuationTracker* aTracker)
|
||||
{
|
||||
NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state");
|
||||
if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
|
||||
NS_ASSERTION(aContainerWidth != NS_UNCONSTRAINEDSIZE,
|
||||
NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
|
||||
"ReflowChild with unconstrained container width!");
|
||||
}
|
||||
|
||||
// Position the child frame and its view if requested.
|
||||
if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
|
||||
aKidFrame->SetPosition(aWM, aPos, aContainerWidth);
|
||||
aKidFrame->SetPosition(aWM, aPos, aContainerSize);
|
||||
}
|
||||
|
||||
if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
|
||||
@@ -1114,11 +1114,11 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
const WritingMode& aWM,
|
||||
const LogicalPoint& aPos,
|
||||
nscoord aContainerWidth,
|
||||
const nsSize& aContainerSize,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
if (aWM.IsVerticalRL() || (!aWM.IsVertical() && !aWM.IsBidiLTR())) {
|
||||
NS_ASSERTION(aContainerWidth != NS_UNCONSTRAINEDSIZE,
|
||||
NS_ASSERTION(aContainerSize.width != NS_UNCONSTRAINEDSIZE,
|
||||
"FinishReflowChild with unconstrained container width!");
|
||||
}
|
||||
|
||||
@@ -1129,7 +1129,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
|
||||
|
||||
if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
|
||||
aKidFrame->SetRect(aWM, LogicalRect(aWM, aPos, convertedSize),
|
||||
aContainerWidth);
|
||||
aContainerSize);
|
||||
} else {
|
||||
aKidFrame->SetSize(aWM, convertedSize);
|
||||
}
|
||||
@@ -1261,8 +1261,8 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
||||
NS_ASSERTION(frame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER,
|
||||
"overflow container frame must have overflow container bit set");
|
||||
WritingMode wm = frame->GetWritingMode();
|
||||
nscoord containerWidth = aReflowState.AvailableSize(wm).Width(wm);
|
||||
LogicalRect prevRect = prevInFlow->GetLogicalRect(wm, containerWidth);
|
||||
nsSize containerSize = aReflowState.AvailableSize(wm).GetPhysicalSize(wm);
|
||||
LogicalRect prevRect = prevInFlow->GetLogicalRect(wm, containerSize);
|
||||
|
||||
// Initialize reflow params
|
||||
LogicalSize availSpace(wm, prevRect.ISize(wm),
|
||||
@@ -1275,11 +1275,11 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
||||
// Reflow
|
||||
LogicalPoint pos(wm, prevRect.IStart(wm), 0);
|
||||
ReflowChild(frame, aPresContext, desiredSize, frameState,
|
||||
wm, pos, containerWidth, aFlags, frameStatus, &tracker);
|
||||
wm, pos, containerSize, aFlags, frameStatus, &tracker);
|
||||
//XXXfr Do we need to override any shrinkwrap effects here?
|
||||
// e.g. desiredSize.Width() = prevRect.width;
|
||||
FinishReflowChild(frame, aPresContext, desiredSize, &frameState,
|
||||
wm, pos, containerWidth, aFlags);
|
||||
wm, pos, containerSize, aFlags);
|
||||
|
||||
// Handle continuations
|
||||
if (!NS_FRAME_IS_FULLY_COMPLETE(frameStatus)) {
|
||||
@@ -1321,7 +1321,7 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
||||
if (aReflowState.mFloatManager) {
|
||||
nsBlockFrame::RecoverFloatsFor(frame, *aReflowState.mFloatManager,
|
||||
aReflowState.GetWritingMode(),
|
||||
aReflowState.ComputedWidth());
|
||||
aReflowState.ComputedPhysicalSize());
|
||||
}
|
||||
}
|
||||
ConsiderChildOverflow(aOverflowRects, frame);
|
||||
|
||||
@@ -241,7 +241,7 @@ public:
|
||||
* If the reflow status after reflowing the child is FULLY_COMPLETE then any
|
||||
* next-in-flows are deleted using DeleteNextInFlowChild().
|
||||
*
|
||||
* @param aContainerWidth width of the border-box of the containing frame
|
||||
* @param aContainerSize size of the border-box of the containing frame
|
||||
*
|
||||
* Flags:
|
||||
* NS_FRAME_NO_MOVE_VIEW - don't position the frame's view. Set this if you
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
const mozilla::WritingMode& aWM,
|
||||
const mozilla::LogicalPoint& aPos,
|
||||
nscoord aContainerWidth,
|
||||
const nsSize& aContainerSize,
|
||||
uint32_t aFlags,
|
||||
nsReflowStatus& aStatus,
|
||||
nsOverflowContinuationTracker* aTracker = nullptr);
|
||||
@@ -270,7 +270,7 @@ public:
|
||||
* - sets the view's visibility, opacity, content transparency, and clip
|
||||
* - invoked the DidReflow() function
|
||||
*
|
||||
* @param aContainerWidth width of the border-box of the containing frame
|
||||
* @param aContainerSize size of the border-box of the containing frame
|
||||
*
|
||||
* Flags:
|
||||
* NS_FRAME_NO_MOVE_FRAME - don't move the frame. aPos is ignored in this
|
||||
@@ -285,7 +285,7 @@ public:
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
const mozilla::WritingMode& aWM,
|
||||
const mozilla::LogicalPoint& aPos,
|
||||
nscoord aContainerWidth,
|
||||
const nsSize& aContainerSize,
|
||||
uint32_t aFlags);
|
||||
|
||||
//XXX temporary: hold on to a copy of the old physical versions of
|
||||
|
||||
@@ -152,11 +152,13 @@ PhysicalCoordFromFlexRelativeCoord(nscoord aFlexRelativeCoord,
|
||||
(axisTracker_).IsCrossAxisHorizontal() ? (width_) : (height_)
|
||||
|
||||
// Logical versions of helper-macros above:
|
||||
#define GET_MAIN_COMPONENT_LOGICAL(axisTracker_, isize_, bsize_) \
|
||||
(axisTracker_).IsRowOriented() ? (isize_) : (bsize_)
|
||||
#define GET_MAIN_COMPONENT_LOGICAL(axisTracker_, wm_, isize_, bsize_) \
|
||||
wm_.IsOrthogonalTo(axisTracker_.GetWritingMode()) != \
|
||||
(axisTracker_).IsRowOriented() ? (isize_) : (bsize_)
|
||||
|
||||
#define GET_CROSS_COMPONENT_LOGICAL(axisTracker_, inline_, block_) \
|
||||
(axisTracker_).IsRowOriented() ? (block_) : (inline_)
|
||||
#define GET_CROSS_COMPONENT_LOGICAL(axisTracker_, wm_, isize_, bsize_) \
|
||||
wm_.IsOrthogonalTo(axisTracker_.GetWritingMode()) != \
|
||||
(axisTracker_).IsRowOriented() ? (bsize_) : (isize_)
|
||||
|
||||
// Encapsulates our flex container's main & cross axes.
|
||||
class MOZ_STACK_CLASS nsFlexContainerFrame::FlexboxAxisTracker {
|
||||
@@ -180,6 +182,9 @@ public:
|
||||
}
|
||||
// XXXdholbert [END DEPRECATED]
|
||||
|
||||
// Returns the flex container's writing mode.
|
||||
WritingMode GetWritingMode() const { return mWM; }
|
||||
|
||||
// Returns true if our main axis is in the reverse direction of our
|
||||
// writing mode's corresponding axis. (From 'flex-direction: *-reverse')
|
||||
bool IsMainAxisReversed() const {
|
||||
@@ -343,7 +348,11 @@ public:
|
||||
const FlexboxAxisTracker& aAxisTracker);
|
||||
|
||||
// Simplified constructor, to be used only for generating "struts":
|
||||
FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize);
|
||||
// (NOTE: This "strut" constructor uses the *container's* writing mode, which
|
||||
// we'll use on this FlexItem instead of the child frame's real writing mode.
|
||||
// This is fine - it doesn't matter what writing mode we use for a
|
||||
// strut, since it won't render any content and we already know its size.)
|
||||
FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize, WritingMode aContainerWM);
|
||||
|
||||
// Accessors
|
||||
nsIFrame* Frame() const { return mFrame; }
|
||||
@@ -376,10 +385,9 @@ public:
|
||||
// will matter more (& can be expanded/tested) once we officially support
|
||||
// logical directions & vertical writing-modes in flexbox, in bug 1079155
|
||||
// or a dependency.
|
||||
WritingMode wm = mFrame->GetWritingMode();
|
||||
// Use GetFirstLineBaseline(), or just GetBaseline() if that fails.
|
||||
if (!nsLayoutUtils::GetFirstLineBaseline(wm, mFrame, &mAscent)) {
|
||||
mAscent = mFrame->GetLogicalBaseline(wm);
|
||||
if (!nsLayoutUtils::GetFirstLineBaseline(mWM, mFrame, &mAscent)) {
|
||||
mAscent = mFrame->GetLogicalBaseline(mWM);
|
||||
}
|
||||
}
|
||||
return mAscent;
|
||||
@@ -431,6 +439,7 @@ public:
|
||||
// visibility:collapse.
|
||||
bool IsStrut() const { return mIsStrut; }
|
||||
|
||||
WritingMode GetWritingMode() const { return mWM; }
|
||||
uint8_t GetAlignSelf() const { return mAlignSelf; }
|
||||
|
||||
// Returns the flex factor (flex-grow or flex-shrink), depending on
|
||||
@@ -720,6 +729,7 @@ protected:
|
||||
// Does this item need to resolve a min-[width|height]:auto (in main-axis).
|
||||
bool mNeedsMinSizeAutoResolution;
|
||||
|
||||
const WritingMode mWM; // The flex item's writing mode.
|
||||
uint8_t mAlignSelf; // My "align-self" computed value (with "auto"
|
||||
// swapped out for parent"s "align-items" value,
|
||||
// in our constructor).
|
||||
@@ -1082,16 +1092,17 @@ nsFlexContainerFrame::GenerateFlexItemForChild(
|
||||
const nsStylePosition* stylePos = aChildFrame->StylePosition();
|
||||
float flexGrow = stylePos->mFlexGrow;
|
||||
float flexShrink = stylePos->mFlexShrink;
|
||||
WritingMode childWM = childRS.GetWritingMode();
|
||||
|
||||
// MAIN SIZES (flex base size, min/max size)
|
||||
// -----------------------------------------
|
||||
nscoord flexBaseSize = GET_MAIN_COMPONENT_LOGICAL(aAxisTracker,
|
||||
nscoord flexBaseSize = GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, childWM,
|
||||
childRS.ComputedISize(),
|
||||
childRS.ComputedBSize());
|
||||
nscoord mainMinSize = GET_MAIN_COMPONENT_LOGICAL(aAxisTracker,
|
||||
nscoord mainMinSize = GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, childWM,
|
||||
childRS.ComputedMinISize(),
|
||||
childRS.ComputedMinBSize());
|
||||
nscoord mainMaxSize = GET_MAIN_COMPONENT_LOGICAL(aAxisTracker,
|
||||
nscoord mainMaxSize = GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, childWM,
|
||||
childRS.ComputedMaxISize(),
|
||||
childRS.ComputedMaxBSize());
|
||||
// This is enforced by the nsHTMLReflowState where these values come from:
|
||||
@@ -1103,15 +1114,15 @@ nsFlexContainerFrame::GenerateFlexItemForChild(
|
||||
// or we might resolve it to something else in SizeItemInCrossAxis(); hence,
|
||||
// it's tentative. See comment under "Cross Size Determination" for more.
|
||||
nscoord tentativeCrossSize =
|
||||
GET_CROSS_COMPONENT_LOGICAL(aAxisTracker,
|
||||
GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, childWM,
|
||||
childRS.ComputedISize(),
|
||||
childRS.ComputedBSize());
|
||||
nscoord crossMinSize =
|
||||
GET_CROSS_COMPONENT_LOGICAL(aAxisTracker,
|
||||
GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, childWM,
|
||||
childRS.ComputedMinISize(),
|
||||
childRS.ComputedMinBSize());
|
||||
nscoord crossMaxSize =
|
||||
GET_CROSS_COMPONENT_LOGICAL(aAxisTracker,
|
||||
GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, childWM,
|
||||
childRS.ComputedMaxISize(),
|
||||
childRS.ComputedMaxBSize());
|
||||
|
||||
@@ -1232,7 +1243,7 @@ CrossSizeToUseWithRatio(const FlexItem& aFlexItem,
|
||||
|
||||
if (IsCrossSizeDefinite(aItemReflowState, aAxisTracker)) {
|
||||
// Definite cross size.
|
||||
return GET_CROSS_COMPONENT_LOGICAL(aAxisTracker,
|
||||
return GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
|
||||
aItemReflowState.ComputedISize(),
|
||||
aItemReflowState.ComputedBSize());
|
||||
}
|
||||
@@ -1240,7 +1251,7 @@ CrossSizeToUseWithRatio(const FlexItem& aFlexItem,
|
||||
if (aMinSizeFallback) {
|
||||
// Indefinite cross-size, and we're resolving main min-size, so we'll fall
|
||||
// back to ussing the cross min-size (which should be definite).
|
||||
return GET_CROSS_COMPONENT_LOGICAL(aAxisTracker,
|
||||
return GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
|
||||
aItemReflowState.ComputedMinISize(),
|
||||
aItemReflowState.ComputedMinBSize());
|
||||
}
|
||||
@@ -1301,7 +1312,7 @@ PartiallyResolveAutoMinSize(const FlexItem& aFlexItem,
|
||||
|
||||
// * the computed max-width (max-height), if that value is definite:
|
||||
nscoord maxSize =
|
||||
GET_MAIN_COMPONENT_LOGICAL(aAxisTracker,
|
||||
GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, aFlexItem.GetWritingMode(),
|
||||
aItemReflowState.ComputedMaxISize(),
|
||||
aItemReflowState.ComputedMaxBSize());
|
||||
if (maxSize != NS_UNCONSTRAINEDSIZE) {
|
||||
@@ -1404,7 +1415,7 @@ nsFlexContainerFrame::
|
||||
// XXXdholbert Maybe this should share logic with ComputeCrossSize()...
|
||||
// Alternately, maybe tentative container cross size should be passed down.
|
||||
nscoord containerCrossSize =
|
||||
GET_CROSS_COMPONENT_LOGICAL(aAxisTracker,
|
||||
GET_CROSS_COMPONENT_LOGICAL(aAxisTracker, aAxisTracker.GetWritingMode(),
|
||||
flexContainerRS->ComputedISize(),
|
||||
flexContainerRS->ComputedBSize());
|
||||
// Is container's cross size "definite"?
|
||||
@@ -1576,6 +1587,7 @@ FlexItem::FlexItem(nsHTMLReflowState& aFlexItemReflowState,
|
||||
mIsStretched(false),
|
||||
mIsStrut(false),
|
||||
// mNeedsMinSizeAutoResolution is initialized in CheckForMinSizeAuto()
|
||||
mWM(aFlexItemReflowState.GetWritingMode()),
|
||||
mAlignSelf(aFlexItemReflowState.mStylePosition->mAlignSelf)
|
||||
{
|
||||
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
|
||||
@@ -1627,7 +1639,8 @@ FlexItem::FlexItem(nsHTMLReflowState& aFlexItemReflowState,
|
||||
// Simplified constructor for creating a special "strut" FlexItem, for a child
|
||||
// with visibility:collapse. The strut has 0 main-size, and it only exists to
|
||||
// impose a minimum cross size on whichever FlexLine it ends up in.
|
||||
FlexItem::FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize)
|
||||
FlexItem::FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize,
|
||||
WritingMode aContainerWM)
|
||||
: mFrame(aChildFrame),
|
||||
mFlexGrow(0.0f),
|
||||
mFlexShrink(0.0f),
|
||||
@@ -1652,6 +1665,7 @@ FlexItem::FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize)
|
||||
mIsStretched(false),
|
||||
mIsStrut(true), // (this is the constructor for making struts, after all)
|
||||
mNeedsMinSizeAutoResolution(false),
|
||||
mWM(aContainerWM),
|
||||
mAlignSelf(NS_STYLE_ALIGN_ITEMS_FLEX_START)
|
||||
{
|
||||
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
|
||||
@@ -3178,7 +3192,7 @@ nsFlexContainerFrame::GenerateFlexLines(
|
||||
// least wrap when we hit its max main-size.
|
||||
if (wrapThreshold == NS_UNCONSTRAINEDSIZE) {
|
||||
const nscoord flexContainerMaxMainSize =
|
||||
GET_MAIN_COMPONENT_LOGICAL(aAxisTracker,
|
||||
GET_MAIN_COMPONENT_LOGICAL(aAxisTracker, aAxisTracker.GetWritingMode(),
|
||||
aReflowState.ComputedMaxISize(),
|
||||
aReflowState.ComputedMaxBSize());
|
||||
|
||||
@@ -3214,7 +3228,8 @@ nsFlexContainerFrame::GenerateFlexLines(
|
||||
aStruts[nextStrutIdx].mItemIdx == itemIdxInContainer) {
|
||||
|
||||
// Use the simplified "strut" FlexItem constructor:
|
||||
item = new FlexItem(childFrame, aStruts[nextStrutIdx].mStrutCrossSize);
|
||||
item = new FlexItem(childFrame, aStruts[nextStrutIdx].mStrutCrossSize,
|
||||
aReflowState.GetWritingMode());
|
||||
nextStrutIdx++;
|
||||
} else {
|
||||
item = GenerateFlexItemForChild(aPresContext, childFrame,
|
||||
@@ -3899,9 +3914,12 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
||||
containerBP.IStart(flexWM),
|
||||
containerBP.BStart(flexWM));
|
||||
|
||||
nscoord containerWidth = aAxisTracker.IsMainAxisHorizontal() ?
|
||||
aContentBoxMainSize : contentBoxCrossSize;
|
||||
containerWidth += aReflowState.ComputedPhysicalBorderPadding().LeftRight();
|
||||
// Determine flex container's border-box size (used in positioning children):
|
||||
LogicalSize logSize =
|
||||
aAxisTracker.LogicalSizeFromFlexRelativeSizes(aContentBoxMainSize,
|
||||
contentBoxCrossSize);
|
||||
logSize += aReflowState.ComputedLogicalBorderPadding().Size(flexWM);
|
||||
nsSize containerSize = logSize.GetPhysicalSize(flexWM);
|
||||
|
||||
// FINAL REFLOW: Give each child frame another chance to reflow, now that
|
||||
// we know its final size and position.
|
||||
@@ -3944,13 +3962,13 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
||||
// position.
|
||||
itemNeedsReflow = false;
|
||||
MoveFlexItemToFinalPosition(aReflowState, *item, framePos,
|
||||
containerWidth);
|
||||
containerSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (itemNeedsReflow) {
|
||||
ReflowFlexItem(aPresContext, aAxisTracker, aReflowState,
|
||||
*item, framePos, containerWidth);
|
||||
*item, framePos, containerSize);
|
||||
}
|
||||
|
||||
// If this is our first child and we haven't established a baseline for
|
||||
@@ -4035,7 +4053,7 @@ nsFlexContainerFrame::MoveFlexItemToFinalPosition(
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
const FlexItem& aItem,
|
||||
LogicalPoint& aFramePos,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
WritingMode outerWM = aReflowState.GetWritingMode();
|
||||
|
||||
@@ -4051,8 +4069,8 @@ nsFlexContainerFrame::MoveFlexItemToFinalPosition(
|
||||
}
|
||||
nsHTMLReflowState::ApplyRelativePositioning(aItem.Frame(), outerWM,
|
||||
logicalOffsets, &aFramePos,
|
||||
aContainerWidth);
|
||||
aItem.Frame()->SetPosition(outerWM, aFramePos, aContainerWidth);
|
||||
aContainerSize);
|
||||
aItem.Frame()->SetPosition(outerWM, aFramePos, aContainerSize);
|
||||
PositionChildViews(aItem.Frame());
|
||||
}
|
||||
|
||||
@@ -4062,7 +4080,7 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
const FlexItem& aItem,
|
||||
LogicalPoint& aFramePos,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
WritingMode outerWM = aReflowState.GetWritingMode();
|
||||
WritingMode wm = aItem.Frame()->GetWritingMode();
|
||||
@@ -4136,7 +4154,7 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
||||
nsReflowStatus childReflowStatus;
|
||||
ReflowChild(aItem.Frame(), aPresContext,
|
||||
childDesiredSize, childReflowState,
|
||||
outerWM, aFramePos, aContainerWidth,
|
||||
outerWM, aFramePos, aContainerSize,
|
||||
0, childReflowStatus);
|
||||
|
||||
// XXXdholbert Once we do pagination / splitting, we'll need to actually
|
||||
@@ -4151,11 +4169,11 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
||||
childReflowState.ComputedLogicalOffsets().ConvertTo(outerWM, wm);
|
||||
nsHTMLReflowState::ApplyRelativePositioning(aItem.Frame(), outerWM,
|
||||
offsets, &aFramePos,
|
||||
aContainerWidth);
|
||||
aContainerSize);
|
||||
|
||||
FinishReflowChild(aItem.Frame(), aPresContext,
|
||||
childDesiredSize, &childReflowState,
|
||||
outerWM, aFramePos, aContainerWidth, 0);
|
||||
outerWM, aFramePos, aContainerSize, 0);
|
||||
|
||||
// Save the first child's ascent; it may establish container's baseline.
|
||||
if (aItem.Frame() == mFrames.FirstChild()) {
|
||||
|
||||
@@ -183,13 +183,13 @@ protected:
|
||||
* @param aItem The flex item whose frame should be moved.
|
||||
* @param aFramePos The position where the flex item's frame should
|
||||
* be placed. (pre-relative positioning)
|
||||
* @param aContainerWidth The flex container's width (required by some methods
|
||||
* @param aContainerSize The flex container's size (required by some methods
|
||||
* that we call, to interpret aFramePos correctly).
|
||||
*/
|
||||
void MoveFlexItemToFinalPosition(const nsHTMLReflowState& aReflowState,
|
||||
const FlexItem& aItem,
|
||||
mozilla::LogicalPoint& aFramePos,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
/**
|
||||
* Helper-function to reflow a child frame, at its final position determined
|
||||
* by flex layout.
|
||||
@@ -200,7 +200,7 @@ protected:
|
||||
* @param aItem The flex item to be reflowed.
|
||||
* @param aFramePos The position where the flex item's frame should
|
||||
* be placed. (pre-relative positioning)
|
||||
* @param aContainerWidth The flex container's width (required by some methods
|
||||
* @param aContainerSize The flex container's size (required by some methods
|
||||
* that we call, to interpret aFramePos correctly).
|
||||
*/
|
||||
void ReflowFlexItem(nsPresContext* aPresContext,
|
||||
@@ -208,7 +208,7 @@ protected:
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
const FlexItem& aItem,
|
||||
mozilla::LogicalPoint& aFramePos,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
|
||||
bool mChildrenHaveBeenReordered; // Have we ever had to reorder our kids
|
||||
// to satisfy their 'order' values?
|
||||
|
||||
@@ -39,7 +39,10 @@ PSArenaFreeCB(size_t aSize, void* aPtr, void* aClosure)
|
||||
|
||||
nsFloatManager::nsFloatManager(nsIPresShell* aPresShell,
|
||||
mozilla::WritingMode aWM)
|
||||
: mWritingMode(aWM),
|
||||
:
|
||||
#ifdef DEBUG
|
||||
mWritingMode(aWM),
|
||||
#endif
|
||||
mLineLeft(0), mBlockStart(0),
|
||||
mFloatDamage(PSArenaAllocCB, PSArenaFreeCB, aPresShell),
|
||||
mPushedLeftFloatPastBreak(false),
|
||||
@@ -111,12 +114,17 @@ void nsFloatManager::Shutdown()
|
||||
sCachedFloatManagerCount = -1;
|
||||
}
|
||||
|
||||
#define CHECK_BLOCK_DIR(aWM) \
|
||||
NS_ASSERTION(aWM.GetBlockDir() == mWritingMode.value.GetBlockDir(), \
|
||||
"incompatible writing modes")
|
||||
|
||||
nsFlowAreaRect
|
||||
nsFloatManager::GetFlowArea(WritingMode aWM, nscoord aBOffset,
|
||||
BandInfoType aInfoType, nscoord aBSize,
|
||||
LogicalRect aContentArea, SavedState* aState,
|
||||
nscoord aContainerWidth) const
|
||||
const nsSize& aContainerSize) const
|
||||
{
|
||||
CHECK_BLOCK_DIR(aWM);
|
||||
NS_ASSERTION(aBSize >= 0, "unexpected max block size");
|
||||
NS_ASSERTION(aContentArea.ISize(aWM) >= 0,
|
||||
"unexpected content area inline size");
|
||||
@@ -161,8 +169,8 @@ nsFloatManager::GetFlowArea(WritingMode aWM, nscoord aBOffset,
|
||||
blockEnd = nscoord_MAX;
|
||||
}
|
||||
}
|
||||
nscoord lineLeft = mLineLeft + aContentArea.LineLeft(aWM, aContainerWidth);
|
||||
nscoord lineRight = mLineLeft + aContentArea.LineRight(aWM, aContainerWidth);
|
||||
nscoord lineLeft = mLineLeft + aContentArea.LineLeft(aWM, aContainerSize);
|
||||
nscoord lineRight = mLineLeft + aContentArea.LineRight(aWM, aContainerSize);
|
||||
if (lineRight < lineLeft) {
|
||||
NS_WARNING("bad value");
|
||||
lineRight = lineLeft;
|
||||
@@ -234,9 +242,10 @@ nsFloatManager::GetFlowArea(WritingMode aWM, nscoord aBOffset,
|
||||
nscoord blockSize = (blockEnd == nscoord_MAX) ?
|
||||
nscoord_MAX : (blockEnd - blockStart);
|
||||
// convert back from LineLeft/Right to IStart
|
||||
nscoord inlineStart = aWM.IsVertical() || aWM.IsBidiLTR()
|
||||
? lineLeft - mLineLeft
|
||||
: mLineLeft + aContainerWidth - lineRight;
|
||||
nscoord inlineStart = aWM.IsBidiLTR()
|
||||
? lineLeft - mLineLeft
|
||||
: mLineLeft - lineRight +
|
||||
LogicalSize(aWM, aContainerSize).ISize(aWM);
|
||||
|
||||
return nsFlowAreaRect(aWM, inlineStart, blockStart - mBlockStart,
|
||||
lineRight - lineLeft, blockSize, haveFloats);
|
||||
@@ -244,13 +253,14 @@ nsFloatManager::GetFlowArea(WritingMode aWM, nscoord aBOffset,
|
||||
|
||||
nsresult
|
||||
nsFloatManager::AddFloat(nsIFrame* aFloatFrame, const LogicalRect& aMarginRect,
|
||||
WritingMode aWM, nscoord aContainerWidth)
|
||||
WritingMode aWM, const nsSize& aContainerSize)
|
||||
{
|
||||
CHECK_BLOCK_DIR(aWM);
|
||||
NS_ASSERTION(aMarginRect.ISize(aWM) >= 0, "negative inline size!");
|
||||
NS_ASSERTION(aMarginRect.BSize(aWM) >= 0, "negative block size!");
|
||||
|
||||
FloatInfo info(aFloatFrame,
|
||||
aMarginRect.LineLeft(aWM, aContainerWidth) + mLineLeft,
|
||||
aMarginRect.LineLeft(aWM, aContainerSize) + mLineLeft,
|
||||
aMarginRect.BStart(aWM) + mBlockStart,
|
||||
aMarginRect.ISize(aWM),
|
||||
aMarginRect.BSize(aWM));
|
||||
@@ -284,12 +294,12 @@ LogicalRect
|
||||
nsFloatManager::CalculateRegionFor(WritingMode aWM,
|
||||
nsIFrame* aFloat,
|
||||
const LogicalMargin& aMargin,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
// We consider relatively positioned frames at their original position.
|
||||
LogicalRect region(aWM, nsRect(aFloat->GetNormalPosition(),
|
||||
aFloat->GetSize()),
|
||||
aContainerWidth);
|
||||
aContainerSize);
|
||||
|
||||
// Float region includes its margin
|
||||
region.Inflate(aWM, aMargin);
|
||||
@@ -315,9 +325,9 @@ NS_DECLARE_FRAME_PROPERTY(FloatRegionProperty, DeleteValue<nsMargin>)
|
||||
|
||||
LogicalRect
|
||||
nsFloatManager::GetRegionFor(WritingMode aWM, nsIFrame* aFloat,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
LogicalRect region = aFloat->GetLogicalRect(aWM, aContainerWidth);
|
||||
LogicalRect region = aFloat->GetLogicalRect(aWM, aContainerSize);
|
||||
void* storedRegion = aFloat->Properties().Get(FloatRegionProperty());
|
||||
if (storedRegion) {
|
||||
nsMargin margin = *static_cast<nsMargin*>(storedRegion);
|
||||
@@ -329,9 +339,9 @@ nsFloatManager::GetRegionFor(WritingMode aWM, nsIFrame* aFloat,
|
||||
void
|
||||
nsFloatManager::StoreRegionFor(WritingMode aWM, nsIFrame* aFloat,
|
||||
const LogicalRect& aRegion,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
nsRect region = aRegion.GetPhysicalRect(aWM, aContainerWidth);
|
||||
nsRect region = aRegion.GetPhysicalRect(aWM, aContainerSize);
|
||||
nsRect rect = aFloat->GetRect();
|
||||
FrameProperties props = aFloat->Properties();
|
||||
if (region.IsEqualEdges(rect)) {
|
||||
@@ -405,7 +415,6 @@ nsFloatManager::PushState(SavedState* aState)
|
||||
// reflow. In the typical case A and C will be the same, but not always.
|
||||
// Allowing mFloatDamage to accumulate the damage incurred during both
|
||||
// reflows ensures that nothing gets missed.
|
||||
aState->mWritingMode = mWritingMode;
|
||||
aState->mLineLeft = mLineLeft;
|
||||
aState->mBlockStart = mBlockStart;
|
||||
aState->mPushedLeftFloatPastBreak = mPushedLeftFloatPastBreak;
|
||||
@@ -420,7 +429,6 @@ nsFloatManager::PopState(SavedState* aState)
|
||||
{
|
||||
NS_PRECONDITION(aState, "No state to restore?");
|
||||
|
||||
mWritingMode = aState->mWritingMode;
|
||||
mLineLeft = aState->mLineLeft;
|
||||
mBlockStart = aState->mBlockStart;
|
||||
mPushedLeftFloatPastBreak = aState->mPushedLeftFloatPastBreak;
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
*/
|
||||
static mozilla::LogicalRect GetRegionFor(mozilla::WritingMode aWM,
|
||||
nsIFrame* aFloatFrame,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
/**
|
||||
* Calculate the float region for this frame using aMargin and the
|
||||
* frame's mRect. The region includes the margins around the float,
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
mozilla::WritingMode aWM,
|
||||
nsIFrame* aFloatFrame,
|
||||
const mozilla::LogicalMargin& aMargin,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
/**
|
||||
* Store the float region on the frame. The region is stored
|
||||
* as a delta against the mRect, so repositioning the frame will
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
static void StoreRegionFor(mozilla::WritingMode aWM,
|
||||
nsIFrame* aFloat,
|
||||
const mozilla::LogicalRect& aRegion,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
|
||||
// Structure that stores the current state of a frame manager for
|
||||
// Save/Restore purposes.
|
||||
@@ -88,7 +88,6 @@ public:
|
||||
explicit SavedState() {}
|
||||
private:
|
||||
uint32_t mFloatInfoCount;
|
||||
mozilla::WritingMode mWritingMode;
|
||||
nscoord mLineLeft, mBlockStart;
|
||||
bool mPushedLeftFloatPastBreak;
|
||||
bool mPushedRightFloatPastBreak;
|
||||
@@ -163,7 +162,8 @@ public:
|
||||
nsFlowAreaRect GetFlowArea(mozilla::WritingMode aWM,
|
||||
nscoord aBCoord, BandInfoType aInfoType,
|
||||
nscoord aBSize, mozilla::LogicalRect aContentArea,
|
||||
SavedState* aState, nscoord mContainerWidth) const;
|
||||
SavedState* aState,
|
||||
const nsSize& aContainerSize) const;
|
||||
|
||||
/**
|
||||
* Add a float that comes after all floats previously added. Its
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
*/
|
||||
nsresult AddFloat(nsIFrame* aFloatFrame,
|
||||
const mozilla::LogicalRect& aMarginRect,
|
||||
mozilla::WritingMode aWM, nscoord aContainerWidth);
|
||||
mozilla::WritingMode aWM, const nsSize& aContainerSize);
|
||||
|
||||
/**
|
||||
* Notify that we tried to place a float that could not fit at all and
|
||||
@@ -287,8 +287,7 @@ public:
|
||||
|
||||
void AssertStateMatches(SavedState *aState) const
|
||||
{
|
||||
NS_ASSERTION(aState->mWritingMode == mWritingMode &&
|
||||
aState->mLineLeft == mLineLeft &&
|
||||
NS_ASSERTION(aState->mLineLeft == mLineLeft &&
|
||||
aState->mBlockStart == mBlockStart &&
|
||||
aState->mPushedLeftFloatPastBreak ==
|
||||
mPushedLeftFloatPastBreak &&
|
||||
@@ -343,7 +342,7 @@ private:
|
||||
nsRect mRect;
|
||||
};
|
||||
|
||||
mozilla::WritingMode mWritingMode;
|
||||
mozilla::DebugOnly<mozilla::WritingMode> mWritingMode;
|
||||
|
||||
// Translation from local to global coordinate space.
|
||||
nscoord mLineLeft, mBlockStart;
|
||||
|
||||
+49
-18
@@ -3586,13 +3586,19 @@ static FrameTarget GetSelectionClosestFrameForLine(
|
||||
nsIFrame *closestFromIStart = nullptr, *closestFromIEnd = nullptr;
|
||||
nscoord closestIStart = aLine->IStart(), closestIEnd = aLine->IEnd();
|
||||
WritingMode wm = aLine->mWritingMode;
|
||||
LogicalPoint pt(wm, aPoint, aLine->mContainerWidth);
|
||||
LogicalPoint pt(wm, aPoint, aLine->mContainerSize);
|
||||
bool canSkipBr = false;
|
||||
for (int32_t n = aLine->GetChildCount(); n;
|
||||
--n, frame = frame->GetNextSibling()) {
|
||||
if (!SelfIsSelectable(frame, aFlags) || frame->IsEmpty())
|
||||
// Skip brFrames. Can only skip if the line contains at least
|
||||
// one selectable and non-empty frame before
|
||||
if (!SelfIsSelectable(frame, aFlags) || frame->IsEmpty() ||
|
||||
(canSkipBr && frame->GetType() == nsGkAtoms::brFrame)) {
|
||||
continue;
|
||||
}
|
||||
canSkipBr = true;
|
||||
LogicalRect frameRect = LogicalRect(wm, frame->GetRect(),
|
||||
aLine->mContainerWidth);
|
||||
aLine->mContainerSize);
|
||||
if (pt.I(wm) >= frameRect.IStart(wm)) {
|
||||
if (pt.I(wm) < frameRect.IEnd(wm)) {
|
||||
return GetSelectionClosestFrameForChild(frame, aPoint, aFlags);
|
||||
@@ -3650,7 +3656,7 @@ static FrameTarget GetSelectionClosestFrameForBlock(nsIFrame* aFrame,
|
||||
nsBlockFrame::line_iterator closestLine = end;
|
||||
// Convert aPoint into a LogicalPoint in the writing-mode of this block
|
||||
WritingMode wm = curLine->mWritingMode;
|
||||
LogicalPoint pt(wm, aPoint, curLine->mContainerWidth);
|
||||
LogicalPoint pt(wm, aPoint, curLine->mContainerSize);
|
||||
while (curLine != end) {
|
||||
// Check to see if our point lies within the line's block-direction bounds
|
||||
nscoord BCoord = pt.B(wm) - curLine->BStart();
|
||||
@@ -4366,20 +4372,20 @@ nsFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
GetMinimumWidgetSize(presContext, this, disp->mAppearance,
|
||||
&widget, &canOverride);
|
||||
|
||||
// Dimensions from themed widgets are applied physically...
|
||||
nsSize size;
|
||||
size.width = presContext->DevPixelsToAppUnits(widget.width);
|
||||
size.height = presContext->DevPixelsToAppUnits(widget.height);
|
||||
// Convert themed widget's physical dimensions to logical coords
|
||||
LogicalSize size(aWM,
|
||||
nsSize(presContext->DevPixelsToAppUnits(widget.width),
|
||||
presContext->DevPixelsToAppUnits(widget.height)));
|
||||
|
||||
// GMWS() returns border-box; we need content-box
|
||||
size.width -= aBorder.Width(aWM) + aPadding.Width(aWM);
|
||||
size.height -= aBorder.Height(aWM) + aPadding.Height(aWM);
|
||||
size.ISize(aWM) -= aBorder.ISize(aWM) + aPadding.ISize(aWM);
|
||||
size.BSize(aWM) -= aBorder.BSize(aWM) + aPadding.BSize(aWM);
|
||||
|
||||
if (size.height > result.Height(aWM) || !canOverride) {
|
||||
result.Height(aWM) = size.height;
|
||||
if (size.BSize(aWM) > result.BSize(aWM) || !canOverride) {
|
||||
result.BSize(aWM) = size.BSize(aWM);
|
||||
}
|
||||
if (size.width > result.Width(aWM) || !canOverride) {
|
||||
result.Width(aWM) = size.width;
|
||||
if (size.ISize(aWM) > result.ISize(aWM) || !canOverride) {
|
||||
result.ISize(aWM) = size.ISize(aWM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5718,14 +5724,16 @@ nsIFrame::ListGeneric(nsACString& aTo, const char* aPrefix, uint32_t aFlags) con
|
||||
if (parent) {
|
||||
WritingMode pWM = parent->GetWritingMode();
|
||||
if (pWM.IsVertical() || !pWM.IsBidiLTR()) {
|
||||
nscoord cw = parent->mRect.width;
|
||||
LogicalRect lr(pWM, mRect, cw);
|
||||
aTo += nsPrintfCString(" parent wm=%s-%s,width=%d,logicalRect={%d,%d,%d,%d}",
|
||||
nsSize containerSize = parent->mRect.Size();
|
||||
LogicalRect lr(pWM, mRect, containerSize);
|
||||
aTo += nsPrintfCString(" parent wm=%s-%s, cs={%d,%d}, "
|
||||
" logicalRect={%d,%d,%d,%d}",
|
||||
pWM.IsVertical() ? pWM.IsVerticalLR()
|
||||
? "vlr" : "vrl"
|
||||
: "htb",
|
||||
wm.IsBidiLTR() ? "ltr" : "rtl",
|
||||
cw, lr.IStart(pWM), lr.BStart(pWM),
|
||||
containerSize.width, containerSize.height,
|
||||
lr.IStart(pWM), lr.BStart(pWM),
|
||||
lr.ISize(pWM), lr.BSize(pWM));
|
||||
}
|
||||
}
|
||||
@@ -6879,6 +6887,12 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
|
||||
for (int32_t count = lineFrameCount; count;
|
||||
--count, frame = frame->GetNextSibling()) {
|
||||
if (!frame->IsGeneratedContentFrame()) {
|
||||
// When jumping to the end of the line with the "end" key,
|
||||
// skip over brFrames
|
||||
if (endOfLine && lineFrameCount > 1 &&
|
||||
frame->GetType() == nsGkAtoms::brFrame) {
|
||||
continue;
|
||||
}
|
||||
baseFrame = frame;
|
||||
if (!endOfLine)
|
||||
break;
|
||||
@@ -7161,6 +7175,23 @@ nsIFrame::GetFrameFromDirection(nsDirection aDirection, bool aVisual,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Skip brFrames, but only if they are not the only frame in the line
|
||||
if (atLineEdge && aDirection == eDirPrevious &&
|
||||
traversedFrame->GetType() == nsGkAtoms::brFrame) {
|
||||
int32_t lineFrameCount;
|
||||
nsIFrame *currentBlockFrame, *currentFirstFrame;
|
||||
nsRect usedRect;
|
||||
int32_t currentLine = nsFrame::GetLineNumber(traversedFrame, aScrollViewStop, ¤tBlockFrame);
|
||||
nsAutoLineIterator iter = currentBlockFrame->GetLineIterator();
|
||||
result = iter->GetLine(currentLine, ¤tFirstFrame, &lineFrameCount, usedRect);
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
if (lineFrameCount > 1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
traversedFrame->IsSelectable(&selectable, nullptr);
|
||||
if (!selectable) {
|
||||
*aOutMovedOverNonSelectableText = true;
|
||||
|
||||
@@ -513,11 +513,12 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState,
|
||||
mHelper.mHasVerticalScrollbar = aAssumeVScroll;
|
||||
|
||||
nsReflowStatus status;
|
||||
// No need to pass a container-width to ReflowChild or
|
||||
// No need to pass a true container-size to ReflowChild or
|
||||
// FinishReflowChild, because it's only used there when positioning
|
||||
// the frame (i.e. if NS_FRAME_NO_MOVE_FRAME isn't set)
|
||||
const nsSize dummyContainerSize;
|
||||
ReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics,
|
||||
kidReflowState, wm, LogicalPoint(wm), 0,
|
||||
kidReflowState, wm, LogicalPoint(wm), dummyContainerSize,
|
||||
NS_FRAME_NO_MOVE_FRAME, status);
|
||||
|
||||
mHelper.mHasHorizontalScrollbar = didHaveHorizontalScrollbar;
|
||||
@@ -529,7 +530,8 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState,
|
||||
// which will usually be different from the scrollport height;
|
||||
// invalidating the difference will cause unnecessary repainting.
|
||||
FinishReflowChild(mHelper.mScrolledFrame, presContext,
|
||||
*aMetrics, &kidReflowState, wm, LogicalPoint(wm), 0,
|
||||
*aMetrics, &kidReflowState, wm, LogicalPoint(wm),
|
||||
dummyContainerSize,
|
||||
NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW);
|
||||
|
||||
// XXX Some frames (e.g., nsPluginFrame, nsFrameFrame, nsTextFrame) don't bother
|
||||
|
||||
@@ -1157,8 +1157,9 @@ nsGridContainerFrame::ReflowChildren(GridItemCSSOrderIterator& aIter,
|
||||
{
|
||||
WritingMode wm = aReflowState.GetWritingMode();
|
||||
const LogicalPoint gridOrigin(aContentArea.Origin(wm));
|
||||
const nscoord containerWidth = aContentArea.Width(wm) +
|
||||
aReflowState.ComputedPhysicalBorderPadding().LeftRight();
|
||||
const nsSize containerSize =
|
||||
(aContentArea.Size(wm) +
|
||||
aReflowState.ComputedLogicalBorderPadding().Size(wm)).GetPhysicalSize(wm);
|
||||
nsPresContext* pc = PresContext();
|
||||
for (; !aIter.AtEnd(); aIter.Next()) {
|
||||
nsIFrame* child = *aIter;
|
||||
@@ -1186,20 +1187,22 @@ nsGridContainerFrame::ReflowChildren(GridItemCSSOrderIterator& aIter,
|
||||
childRS.SetComputedBSize(std::max(bSize, 0));
|
||||
}
|
||||
// We need the width of the child before we can correctly convert
|
||||
// the writing-mode of its origin, so we reflow at (0, 0) and then
|
||||
// pass the correct position to FinishReflowChild.
|
||||
// the writing-mode of its origin, so we reflow at (0, 0) using a dummy
|
||||
// containerSize, and then pass the correct position to FinishReflowChild.
|
||||
nsHTMLReflowMetrics childSize(childRS);
|
||||
nsReflowStatus childStatus;
|
||||
const nsSize dummyContainerSize;
|
||||
ReflowChild(child, pc, childSize, childRS, childWM, LogicalPoint(childWM),
|
||||
0, 0, childStatus);
|
||||
dummyContainerSize, 0, childStatus);
|
||||
LogicalPoint childPos =
|
||||
cb.Origin(wm).ConvertTo(childWM, wm, containerWidth - childSize.Width() -
|
||||
margin.LeftRight(childWM));
|
||||
cb.Origin(wm).ConvertTo(childWM, wm,
|
||||
containerSize - childSize.PhysicalSize() -
|
||||
margin.Size(childWM).GetPhysicalSize(childWM));
|
||||
childPos.I(childWM) += margin.IStart(childWM);
|
||||
childPos.B(childWM) += margin.BStart(childWM);
|
||||
childRS.ApplyRelativePositioning(&childPos, containerWidth);
|
||||
childRS.ApplyRelativePositioning(&childPos, containerSize);
|
||||
FinishReflowChild(child, pc, childSize, &childRS, childWM, childPos,
|
||||
containerWidth, 0);
|
||||
containerSize, 0);
|
||||
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, child);
|
||||
// XXX deal with 'childStatus' not being COMPLETE
|
||||
}
|
||||
@@ -1229,7 +1232,7 @@ nsGridContainerFrame::ReflowChildren(GridItemCSSOrderIterator& aIter,
|
||||
cb = new nsRect;
|
||||
child->Properties().Set(GridItemContainingBlockRect(), cb);
|
||||
}
|
||||
*cb = itemCB.GetPhysicalRect(wm, containerWidth);
|
||||
*cb = itemCB.GetPhysicalRect(wm, containerSize);
|
||||
}
|
||||
// This rect isn't used at all for layout so we use it to optimize
|
||||
// away the virtual GetType() call in the callee in most cases.
|
||||
|
||||
@@ -272,6 +272,11 @@ public:
|
||||
nscoord& Width() { return mWritingMode.IsVertical() ? mBSize : mISize; }
|
||||
nscoord& Height() { return mWritingMode.IsVertical() ? mISize : mBSize; }
|
||||
|
||||
nsSize PhysicalSize()
|
||||
{
|
||||
return Size(mWritingMode).GetPhysicalSize(mWritingMode);
|
||||
}
|
||||
|
||||
void SetBlockStartAscent(nscoord aAscent)
|
||||
{
|
||||
mBlockStartAscent = aAscent;
|
||||
|
||||
@@ -1260,18 +1260,12 @@ nsHTMLReflowState::CalculateHypotheticalBox(nsPresContext* aPresContext,
|
||||
// XXXbz the placeholder is not fully reflowed yet if our containing block is
|
||||
// relatively positioned...
|
||||
WritingMode cbwm = cbrs->GetWritingMode();
|
||||
nscoord containerWidth = containingBlock->GetStateBits() & NS_FRAME_IN_REFLOW
|
||||
? cbrs->ComputedSizeAsContainerIfConstrained().width
|
||||
: containingBlock->GetSize().width;
|
||||
LogicalPoint placeholderOffset(wm, aPlaceholderFrame->GetOffsetTo(containingBlock),
|
||||
containerWidth);
|
||||
|
||||
// XXX hack to correct for lack of LogicalPoint bidi support in vertical mode
|
||||
if (wm.IsVertical() && !wm.IsBidiLTR()) {
|
||||
placeholderOffset.I(wm) = cbrs->ComputedHeight() +
|
||||
cbrs->ComputedLogicalBorderPadding().TopBottom(cbwm) -
|
||||
placeholderOffset.I(wm);
|
||||
}
|
||||
nsSize containerSize = containingBlock->GetStateBits() & NS_FRAME_IN_REFLOW
|
||||
? cbrs->ComputedSizeAsContainerIfConstrained()
|
||||
: containingBlock->GetSize();
|
||||
LogicalPoint
|
||||
placeholderOffset(wm, aPlaceholderFrame->GetOffsetTo(containingBlock),
|
||||
containerSize);
|
||||
|
||||
// First, determine the hypothetical box's mBStart. We want to check the
|
||||
// content insertion frame of containingBlock for block-ness, but make
|
||||
@@ -1280,7 +1274,11 @@ nsHTMLReflowState::CalculateHypotheticalBox(nsPresContext* aPresContext,
|
||||
nsBlockFrame* blockFrame =
|
||||
nsLayoutUtils::GetAsBlock(containingBlock->GetContentInsertionFrame());
|
||||
if (blockFrame) {
|
||||
LogicalPoint blockOffset(wm, blockFrame->GetOffsetTo(containingBlock), 0);
|
||||
// Use a null containerSize to convert a LogicalPoint functioning as a
|
||||
// vector into a physical nsPoint vector.
|
||||
const nsSize nullContainerSize;
|
||||
LogicalPoint blockOffset(wm, blockFrame->GetOffsetTo(containingBlock),
|
||||
nullContainerSize);
|
||||
bool isValid;
|
||||
nsBlockInFlowLineIterator iter(blockFrame, aPlaceholderFrame, &isValid);
|
||||
if (!isValid) {
|
||||
@@ -1296,7 +1294,7 @@ nsHTMLReflowState::CalculateHypotheticalBox(nsPresContext* aPresContext,
|
||||
// would have been inline-level or block-level
|
||||
LogicalRect lineBounds =
|
||||
lineBox->GetBounds().ConvertTo(wm, lineBox->mWritingMode,
|
||||
lineBox->mContainerWidth);
|
||||
lineBox->mContainerSize);
|
||||
if (mStyleDisplay->IsOriginalDisplayInlineOutsideStyle()) {
|
||||
// Use the block-start of the inline box which the placeholder lives in
|
||||
// as the hypothetical box's block-start.
|
||||
@@ -1409,9 +1407,10 @@ nsHTMLReflowState::CalculateHypotheticalBox(nsPresContext* aPresContext,
|
||||
// scroll, and thus avoid the resulting incremental reflow bugs.
|
||||
cbOffset = containingBlock->GetOffsetTo(cbrs->frame);
|
||||
}
|
||||
nscoord cbrsWidth = cbrs->ComputedWidth() +
|
||||
cbrs->ComputedLogicalBorderPadding().LeftRight(cbwm);
|
||||
LogicalPoint logCBOffs(wm, cbOffset, cbrsWidth - containerWidth);
|
||||
nsSize cbrsSize =
|
||||
cbrs->ComputedPhysicalSize() +
|
||||
cbrs->ComputedLogicalBorderPadding().Size(cbwm).GetPhysicalSize(cbwm);
|
||||
LogicalPoint logCBOffs(wm, cbOffset, cbrsSize - containerSize);
|
||||
aHypotheticalBox.mIStart += logCBOffs.I(wm);
|
||||
aHypotheticalBox.mIEnd += logCBOffs.I(wm);
|
||||
aHypotheticalBox.mBStart += logCBOffs.B(wm);
|
||||
@@ -1954,10 +1953,10 @@ nsHTMLReflowState::ComputeContainingBlockRectangle(
|
||||
// Note: We don't emulate this quirk for percents in calc() or in
|
||||
// vertical writing modes.
|
||||
if (!wm.IsVertical() &&
|
||||
NS_AUTOHEIGHT == cbSize.Height(wm)) {
|
||||
NS_AUTOHEIGHT == cbSize.BSize(wm)) {
|
||||
if (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
|
||||
mStylePosition->mHeight.GetUnit() == eStyleUnit_Percent) {
|
||||
cbSize.Height(wm) = CalcQuirkContainingBlockHeight(aContainingBlockRS);
|
||||
cbSize.BSize(wm) = CalcQuirkContainingBlockHeight(aContainingBlockRS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -436,6 +436,11 @@ struct nsHTMLReflowState : public nsCSSOffsetState {
|
||||
GetWritingMode());
|
||||
}
|
||||
|
||||
nsSize
|
||||
ComputedPhysicalSize() const {
|
||||
return nsSize(ComputedWidth(), ComputedHeight());
|
||||
}
|
||||
|
||||
// XXX this will need to change when we make mComputedOffsets logical;
|
||||
// we won't be able to return a reference for the physical offsets
|
||||
const nsMargin& ComputedPhysicalOffsets() const { return mComputedOffsets; }
|
||||
@@ -849,27 +854,27 @@ public:
|
||||
mozilla::WritingMode aWritingMode,
|
||||
const mozilla::LogicalMargin& aComputedOffsets,
|
||||
mozilla::LogicalPoint* aPosition,
|
||||
nscoord aContainerWidth) {
|
||||
// Subtract the width of the frame from the container width that we
|
||||
const nsSize& aContainerSize) {
|
||||
// Subtract the size of the frame from the container size that we
|
||||
// use for converting between the logical and physical origins of
|
||||
// the frame. This accounts for the fact that logical origins in RTL
|
||||
// coordinate systems are at the top right of the frame instead of
|
||||
// the top left.
|
||||
nscoord frameWidth = aFrame->GetSize().width;
|
||||
nsSize frameSize = aFrame->GetSize();
|
||||
nsPoint pos = aPosition->GetPhysicalPoint(aWritingMode,
|
||||
aContainerWidth - frameWidth);
|
||||
aContainerSize - frameSize);
|
||||
ApplyRelativePositioning(aFrame,
|
||||
aComputedOffsets.GetPhysicalMargin(aWritingMode),
|
||||
&pos);
|
||||
*aPosition = mozilla::LogicalPoint(aWritingMode, pos,
|
||||
aContainerWidth - frameWidth);
|
||||
aContainerSize - frameSize);
|
||||
}
|
||||
|
||||
void ApplyRelativePositioning(mozilla::LogicalPoint* aPosition,
|
||||
nscoord aContainerWidth) const {
|
||||
const nsSize& aContainerSize) const {
|
||||
ApplyRelativePositioning(frame, mWritingMode,
|
||||
ComputedLogicalOffsets(), aPosition,
|
||||
aContainerWidth);
|
||||
aContainerSize);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
+33
-27
@@ -659,39 +659,39 @@ public:
|
||||
* Dimensions and position in logical coordinates in the frame's writing mode
|
||||
* or another writing mode
|
||||
*/
|
||||
mozilla::LogicalRect GetLogicalRect(nscoord aContainerWidth) const {
|
||||
return GetLogicalRect(GetWritingMode(), aContainerWidth);
|
||||
mozilla::LogicalRect GetLogicalRect(const nsSize& aContainerSize) const {
|
||||
return GetLogicalRect(GetWritingMode(), aContainerSize);
|
||||
}
|
||||
mozilla::LogicalPoint GetLogicalPosition(nscoord aContainerWidth) const {
|
||||
return GetLogicalPosition(GetWritingMode(), aContainerWidth);
|
||||
mozilla::LogicalPoint GetLogicalPosition(const nsSize& aContainerSize) const {
|
||||
return GetLogicalPosition(GetWritingMode(), aContainerSize);
|
||||
}
|
||||
mozilla::LogicalSize GetLogicalSize() const {
|
||||
return GetLogicalSize(GetWritingMode());
|
||||
}
|
||||
mozilla::LogicalRect GetLogicalRect(mozilla::WritingMode aWritingMode,
|
||||
nscoord aContainerWidth) const {
|
||||
return mozilla::LogicalRect(aWritingMode, GetRect(), aContainerWidth);
|
||||
const nsSize& aContainerSize) const {
|
||||
return mozilla::LogicalRect(aWritingMode, GetRect(), aContainerSize);
|
||||
}
|
||||
mozilla::LogicalPoint GetLogicalPosition(mozilla::WritingMode aWritingMode,
|
||||
nscoord aContainerWidth) const {
|
||||
return GetLogicalRect(aWritingMode, aContainerWidth).Origin(aWritingMode);
|
||||
const nsSize& aContainerSize) const {
|
||||
return GetLogicalRect(aWritingMode, aContainerSize).Origin(aWritingMode);
|
||||
}
|
||||
mozilla::LogicalSize GetLogicalSize(mozilla::WritingMode aWritingMode) const {
|
||||
return mozilla::LogicalSize(aWritingMode, GetSize());
|
||||
}
|
||||
nscoord IStart(nscoord aContainerWidth) const {
|
||||
return IStart(GetWritingMode(), aContainerWidth);
|
||||
nscoord IStart(const nsSize& aContainerSize) const {
|
||||
return IStart(GetWritingMode(), aContainerSize);
|
||||
}
|
||||
nscoord IStart(mozilla::WritingMode aWritingMode,
|
||||
nscoord aContainerWidth) const {
|
||||
return GetLogicalPosition(aWritingMode, aContainerWidth).I(aWritingMode);
|
||||
const nsSize& aContainerSize) const {
|
||||
return GetLogicalPosition(aWritingMode, aContainerSize).I(aWritingMode);
|
||||
}
|
||||
nscoord BStart(nscoord aContainerWidth) const {
|
||||
return BStart(GetWritingMode(), aContainerWidth);
|
||||
nscoord BStart(const nsSize& aContainerSize) const {
|
||||
return BStart(GetWritingMode(), aContainerSize);
|
||||
}
|
||||
nscoord BStart(mozilla::WritingMode aWritingMode,
|
||||
nscoord aContainerWidth) const {
|
||||
return GetLogicalPosition(aWritingMode, aContainerWidth).B(aWritingMode);
|
||||
const nsSize& aContainerSize) const {
|
||||
return GetLogicalPosition(aWritingMode, aContainerSize).B(aWritingMode);
|
||||
}
|
||||
nscoord ISize() const { return ISize(GetWritingMode()); }
|
||||
nscoord ISize(mozilla::WritingMode aWritingMode) const {
|
||||
@@ -721,8 +721,9 @@ public:
|
||||
/**
|
||||
* Set this frame's rect from a logical rect in its own writing direction
|
||||
*/
|
||||
void SetRect(const mozilla::LogicalRect& aRect, nscoord aContainerWidth) {
|
||||
SetRect(GetWritingMode(), aRect, aContainerWidth);
|
||||
void SetRect(const mozilla::LogicalRect& aRect,
|
||||
const nsSize& aContainerSize) {
|
||||
SetRect(GetWritingMode(), aRect, aContainerSize);
|
||||
}
|
||||
/**
|
||||
* Set this frame's rect from a logical rect in a different writing direction
|
||||
@@ -730,8 +731,8 @@ public:
|
||||
*/
|
||||
void SetRect(mozilla::WritingMode aWritingMode,
|
||||
const mozilla::LogicalRect& aRect,
|
||||
nscoord aContainerWidth) {
|
||||
SetRect(aRect.GetPhysicalRect(aWritingMode, aContainerWidth));
|
||||
const nsSize& aContainerSize) {
|
||||
SetRect(aRect.GetPhysicalRect(aWritingMode, aContainerSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -753,12 +754,12 @@ public:
|
||||
void SetPosition(const nsPoint& aPt) { mRect.MoveTo(aPt); }
|
||||
void SetPosition(mozilla::WritingMode aWritingMode,
|
||||
const mozilla::LogicalPoint& aPt,
|
||||
nscoord aContainerWidth) {
|
||||
// We subtract mRect.width from the container width to account for
|
||||
const nsSize& aContainerSize) {
|
||||
// We subtract mRect.Size() from the container size to account for
|
||||
// the fact that logical origins in RTL coordinate systems are at
|
||||
// the top right of the frame instead of the top left.
|
||||
mRect.MoveTo(aPt.GetPhysicalPoint(aWritingMode,
|
||||
aContainerWidth - mRect.width));
|
||||
aContainerSize - mRect.Size()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -780,7 +781,12 @@ public:
|
||||
void MovePositionBy(mozilla::WritingMode aWritingMode,
|
||||
const mozilla::LogicalPoint& aTranslation)
|
||||
{
|
||||
MovePositionBy(aTranslation.GetPhysicalPoint(aWritingMode, 0));
|
||||
// The LogicalPoint represents a vector rather than a point within a
|
||||
// rectangular coordinate space, so we use a null containerSize when
|
||||
// converting logical to physical.
|
||||
const nsSize nullContainerSize;
|
||||
MovePositionBy(aTranslation.GetPhysicalPoint(aWritingMode,
|
||||
nullContainerSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -794,14 +800,14 @@ public:
|
||||
nsPoint GetNormalPosition() const;
|
||||
mozilla::LogicalPoint
|
||||
GetLogicalNormalPosition(mozilla::WritingMode aWritingMode,
|
||||
nscoord aContainerWidth) const
|
||||
const nsSize& aContainerSize) const
|
||||
{
|
||||
// Subtract the width of this frame from the container width to get
|
||||
// Subtract the size of this frame from the container size to get
|
||||
// the correct position in rtl frames where the origin is on the
|
||||
// right instead of the left
|
||||
return mozilla::LogicalPoint(aWritingMode,
|
||||
GetNormalPosition(),
|
||||
aContainerWidth - mRect.width);
|
||||
aContainerSize - mRect.Size());
|
||||
}
|
||||
|
||||
virtual nsPoint GetPositionOfChildIgnoringScrolling(nsIFrame* aChild)
|
||||
|
||||
@@ -32,7 +32,7 @@ using namespace mozilla;
|
||||
|
||||
nsLineBox::nsLineBox(nsIFrame* aFrame, int32_t aCount, bool aIsBlock)
|
||||
: mFirstChild(aFrame)
|
||||
, mContainerWidth(-1)
|
||||
, mContainerSize(-1, -1)
|
||||
, mBounds(WritingMode()) // mBounds will be initialized with the correct
|
||||
// writing mode when it is set
|
||||
// NOTE: memory is already zeroed since we allocate with AllocateByObjectID.
|
||||
@@ -80,7 +80,7 @@ NS_NewLineBox(nsIPresShell* aPresShell, nsLineBox* aFromLine,
|
||||
{
|
||||
nsLineBox* newLine = new (aPresShell) nsLineBox(aFrame, aCount, false);
|
||||
newLine->NoteFramesMovedFrom(aFromLine);
|
||||
newLine->mContainerWidth = aFromLine->mContainerWidth;
|
||||
newLine->mContainerSize = aFromLine->mContainerSize;
|
||||
return newLine;
|
||||
}
|
||||
|
||||
@@ -249,13 +249,13 @@ nsLineBox::List(FILE* out, const char* aPrefix, uint32_t aFlags) const
|
||||
str += nsPrintfCString("{%d,%d,%d,%d} ",
|
||||
bounds.x, bounds.y, bounds.width, bounds.height);
|
||||
if (mWritingMode.IsVertical() || !mWritingMode.IsBidiLTR()) {
|
||||
str += nsPrintfCString("{%s-%s: %d,%d,%d,%d; cw=%d} ",
|
||||
str += nsPrintfCString("{%s-%s: %d,%d,%d,%d; cs=%d,%d} ",
|
||||
mWritingMode.IsVertical()
|
||||
? mWritingMode.IsVerticalLR() ? "vlr" : "vrl"
|
||||
: "htb",
|
||||
mWritingMode.IsBidiLTR() ? "ltr" : "rtl",
|
||||
IStart(), BStart(), ISize(), BSize(),
|
||||
mContainerWidth);
|
||||
mContainerSize.width, mContainerSize.height);
|
||||
}
|
||||
if (mData &&
|
||||
(!mData->mOverflowAreas.VisualOverflow().IsEqualEdges(bounds) ||
|
||||
@@ -737,13 +737,13 @@ nsLineIterator::FindFrameAt(int32_t aLineNumber,
|
||||
nsIFrame* closestFromEnd = nullptr;
|
||||
|
||||
WritingMode wm = line->mWritingMode;
|
||||
nscoord cw = line->mContainerWidth;
|
||||
nsSize containerSize = line->mContainerSize;
|
||||
|
||||
LogicalPoint pos(wm, aPos, cw);
|
||||
LogicalPoint pos(wm, aPos, containerSize);
|
||||
|
||||
int32_t n = line->GetChildCount();
|
||||
while (n--) {
|
||||
LogicalRect rect = frame->GetLogicalRect(wm, cw);
|
||||
LogicalRect rect = frame->GetLogicalRect(wm, containerSize);
|
||||
if (rect.ISize(wm) > 0) {
|
||||
// If pos.I() is inside this frame - this is it
|
||||
if (rect.IStart(wm) <= pos.I(wm) && rect.IEnd(wm) > pos.I(wm)) {
|
||||
@@ -752,12 +752,14 @@ nsLineIterator::FindFrameAt(int32_t aLineNumber,
|
||||
}
|
||||
if (rect.IStart(wm) < pos.I(wm)) {
|
||||
if (!closestFromStart ||
|
||||
rect.IEnd(wm) > closestFromStart->GetLogicalRect(wm, cw).IEnd(wm))
|
||||
rect.IEnd(wm) > closestFromStart->
|
||||
GetLogicalRect(wm, containerSize).IEnd(wm))
|
||||
closestFromStart = frame;
|
||||
}
|
||||
else {
|
||||
if (!closestFromEnd ||
|
||||
rect.IStart(wm) < closestFromEnd->GetLogicalRect(wm, cw).IStart(wm))
|
||||
rect.IStart(wm) < closestFromEnd->
|
||||
GetLogicalRect(wm, containerSize).IStart(wm))
|
||||
closestFromEnd = frame;
|
||||
}
|
||||
}
|
||||
@@ -779,12 +781,15 @@ nsLineIterator::FindFrameAt(int32_t aLineNumber,
|
||||
*aFrameFound = closestFromStart;
|
||||
}
|
||||
else { // we're between two frames
|
||||
nscoord delta = closestFromEnd->GetLogicalRect(wm, cw).IStart(wm) -
|
||||
closestFromStart->GetLogicalRect(wm, cw).IEnd(wm);
|
||||
if (pos.I(wm) < closestFromStart->GetLogicalRect(wm, cw).IEnd(wm) + delta/2)
|
||||
nscoord delta =
|
||||
closestFromEnd->GetLogicalRect(wm, containerSize).IStart(wm) -
|
||||
closestFromStart->GetLogicalRect(wm, containerSize).IEnd(wm);
|
||||
if (pos.I(wm) < closestFromStart->
|
||||
GetLogicalRect(wm, containerSize).IEnd(wm) + delta/2) {
|
||||
*aFrameFound = closestFromStart;
|
||||
else
|
||||
} else {
|
||||
*aFrameFound = closestFromEnd;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
+39
-33
@@ -448,9 +448,9 @@ public:
|
||||
void SetOverflowAreas(const nsOverflowAreas& aOverflowAreas);
|
||||
mozilla::LogicalRect GetOverflowArea(nsOverflowType aType,
|
||||
mozilla::WritingMode aWM,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
return mozilla::LogicalRect(aWM, GetOverflowArea(aType), aContainerWidth);
|
||||
return mozilla::LogicalRect(aWM, GetOverflowArea(aType), aContainerSize);
|
||||
}
|
||||
nsRect GetOverflowArea(nsOverflowType aType) {
|
||||
return mData ? mData->mOverflowAreas.Overflow(aType) : GetPhysicalBounds();
|
||||
@@ -467,33 +467,36 @@ public:
|
||||
nsRect GetScrollableOverflowArea()
|
||||
{ return GetOverflowArea(eScrollableOverflow); }
|
||||
|
||||
void SlideBy(nscoord aDBCoord, nscoord aContainerWidth) {
|
||||
NS_ASSERTION(aContainerWidth == mContainerWidth || mContainerWidth == -1,
|
||||
"container width doesn't match");
|
||||
mContainerWidth = aContainerWidth;
|
||||
void SlideBy(nscoord aDBCoord, const nsSize& aContainerSize) {
|
||||
NS_ASSERTION(aContainerSize == mContainerSize ||
|
||||
mContainerSize == nsSize(-1, -1),
|
||||
"container size doesn't match");
|
||||
mContainerSize = aContainerSize;
|
||||
mBounds.BStart(mWritingMode) += aDBCoord;
|
||||
if (mData) {
|
||||
nsPoint physicalDelta = mozilla::LogicalPoint(mWritingMode, 0, aDBCoord).
|
||||
GetPhysicalPoint(mWritingMode, 0);
|
||||
// Use a null containerSize to convert vector from logical to physical.
|
||||
const nsSize nullContainerSize;
|
||||
nsPoint physicalDelta =
|
||||
mozilla::LogicalPoint(mWritingMode, 0, aDBCoord).
|
||||
GetPhysicalPoint(mWritingMode, nullContainerSize);
|
||||
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
|
||||
mData->mOverflowAreas.Overflow(otype) += physicalDelta;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Container-width for the line is changing (and therefore if writing mode
|
||||
// Container-size for the line is changing (and therefore if writing mode
|
||||
// was vertical-rl, the line will move physically; this is like SlideBy,
|
||||
// but it is the container width instead of the line's own logical coord
|
||||
// but it is the container size instead of the line's own logical coord
|
||||
// that is changing.
|
||||
nscoord UpdateContainerWidth(nscoord aNewContainerWidth)
|
||||
nsSize UpdateContainerSize(const nsSize aNewContainerSize)
|
||||
{
|
||||
NS_ASSERTION(mContainerWidth != -1, "container width not set");
|
||||
nscoord delta = mContainerWidth - aNewContainerWidth;
|
||||
mContainerWidth = aNewContainerWidth;
|
||||
NS_ASSERTION(mContainerSize != nsSize(-1, -1), "container size not set");
|
||||
nsSize delta = mContainerSize - aNewContainerSize;
|
||||
mContainerSize = aNewContainerSize;
|
||||
// this has a physical-coordinate effect only in vertical-rl mode
|
||||
if (mWritingMode.IsVerticalRL() && mData) {
|
||||
nsPoint physicalDelta = mozilla::LogicalPoint(mWritingMode, 0, delta).
|
||||
GetPhysicalPoint(mWritingMode, 0);
|
||||
nsPoint physicalDelta(-delta.width, 0);
|
||||
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
|
||||
mData->mOverflowAreas.Overflow(otype) += physicalDelta;
|
||||
}
|
||||
@@ -501,17 +504,19 @@ public:
|
||||
return delta;
|
||||
}
|
||||
|
||||
void IndentBy(nscoord aDICoord, nscoord aContainerWidth) {
|
||||
NS_ASSERTION(aContainerWidth == mContainerWidth || mContainerWidth == -1,
|
||||
"container width doesn't match");
|
||||
mContainerWidth = aContainerWidth;
|
||||
void IndentBy(nscoord aDICoord, const nsSize& aContainerSize) {
|
||||
NS_ASSERTION(aContainerSize == mContainerSize ||
|
||||
mContainerSize == nsSize(-1, -1),
|
||||
"container size doesn't match");
|
||||
mContainerSize = aContainerSize;
|
||||
mBounds.IStart(mWritingMode) += aDICoord;
|
||||
}
|
||||
|
||||
void ExpandBy(nscoord aDISize, nscoord aContainerWidth) {
|
||||
NS_ASSERTION(aContainerWidth == mContainerWidth || mContainerWidth == -1,
|
||||
"container width doesn't match");
|
||||
mContainerWidth = aContainerWidth;
|
||||
void ExpandBy(nscoord aDISize, const nsSize& aContainerSize) {
|
||||
NS_ASSERTION(aContainerSize == mContainerSize ||
|
||||
mContainerSize == nsSize(-1, -1),
|
||||
"container size doesn't match");
|
||||
mContainerSize = aContainerSize;
|
||||
mBounds.ISize(mWritingMode) += aDISize;
|
||||
}
|
||||
|
||||
@@ -608,8 +613,8 @@ public:
|
||||
|
||||
mozilla::WritingMode mWritingMode;
|
||||
|
||||
// Physical width. Use only for physical <-> logical coordinate conversion.
|
||||
nscoord mContainerWidth;
|
||||
// Physical size. Use only for physical <-> logical coordinate conversion.
|
||||
nsSize mContainerSize;
|
||||
|
||||
private:
|
||||
mozilla::LogicalRect mBounds;
|
||||
@@ -622,25 +627,26 @@ public:
|
||||
return nsRect(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
NS_ASSERTION(mContainerWidth != -1, "mContainerWidth not initialized");
|
||||
return mBounds.GetPhysicalRect(mWritingMode, mContainerWidth);
|
||||
NS_ASSERTION(mContainerSize != nsSize(-1, -1),
|
||||
"mContainerSize not initialized");
|
||||
return mBounds.GetPhysicalRect(mWritingMode, mContainerSize);
|
||||
}
|
||||
void SetBounds(mozilla::WritingMode aWritingMode,
|
||||
nscoord aIStart, nscoord aBStart,
|
||||
nscoord aISize, nscoord aBSize,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
mWritingMode = aWritingMode;
|
||||
mContainerWidth = aContainerWidth;
|
||||
mContainerSize = aContainerSize;
|
||||
mBounds = mozilla::LogicalRect(aWritingMode, aIStart, aBStart,
|
||||
aISize, aBSize);
|
||||
}
|
||||
void SetBounds(mozilla::WritingMode aWritingMode,
|
||||
nsRect aRect, nscoord aContainerWidth)
|
||||
nsRect aRect, const nsSize& aContainerSize)
|
||||
{
|
||||
mWritingMode = aWritingMode;
|
||||
mContainerWidth = aContainerWidth;
|
||||
mBounds = mozilla::LogicalRect(aWritingMode, aRect, aContainerWidth);
|
||||
mContainerSize = aContainerSize;
|
||||
mBounds = mozilla::LogicalRect(aWritingMode, aRect, aContainerSize);
|
||||
}
|
||||
|
||||
// mFlags.mHasHashedFrames says which one to use
|
||||
|
||||
@@ -315,7 +315,7 @@ nsLineLayout::UpdateBand(WritingMode aWM,
|
||||
// need to convert to our writing mode, because we might have a different
|
||||
// mode from the caller due to dir: auto
|
||||
LogicalRect availSpace = aNewAvailSpace.ConvertTo(lineWM, aWM,
|
||||
ContainerWidth());
|
||||
ContainerSize());
|
||||
#ifdef REALLY_NOISY_REFLOW
|
||||
printf("nsLL::UpdateBand %d, %d, %d, %d, (converted to %d, %d, %d, %d); frame=%p\n will set mImpacted to true\n",
|
||||
aNewAvailSpace.x, aNewAvailSpace.y,
|
||||
@@ -941,7 +941,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
metrics.ISize(lineWM) = nscoord(0xdeadbeef);
|
||||
metrics.BSize(lineWM) = nscoord(0xdeadbeef);
|
||||
#endif
|
||||
nscoord tI = pfd->mBounds.LineLeft(lineWM, ContainerWidth());
|
||||
nscoord tI = pfd->mBounds.LineLeft(lineWM, ContainerSize());
|
||||
nscoord tB = pfd->mBounds.BStart(lineWM);
|
||||
mFloatManager->Translate(tI, tB);
|
||||
|
||||
@@ -1070,7 +1070,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
pfd->mBounds.BSize(lineWM) = metrics.BSize(lineWM);
|
||||
|
||||
// Size the frame, but |RelativePositionFrames| will size the view.
|
||||
aFrame->SetRect(lineWM, pfd->mBounds, ContainerWidthForSpan(psd));
|
||||
aFrame->SetRect(lineWM, pfd->mBounds, ContainerSizeForSpan(psd));
|
||||
|
||||
// Tell the frame that we're done reflowing it
|
||||
aFrame->DidReflow(mPresContext,
|
||||
@@ -1250,13 +1250,16 @@ nsLineLayout::SyncAnnotationBounds(PerFrameData* aRubyFrame)
|
||||
for (PerFrameData* rtc = pfd->mNextAnnotation;
|
||||
rtc; rtc = rtc->mNextAnnotation) {
|
||||
// When the annotation container is reflowed, the width of the
|
||||
// ruby container is unknown, hence zero should be used here
|
||||
// as container width to get the correct logical rect.
|
||||
LogicalRect rtcBounds(lineWM, rtc->mFrame->GetRect(), 0);
|
||||
// ruby container is unknown so we use a dummy container size;
|
||||
// in the case of RTL block direction, the final position will be
|
||||
// fixed up later.
|
||||
const nsSize dummyContainerSize;
|
||||
LogicalRect rtcBounds(lineWM, rtc->mFrame->GetRect(),
|
||||
dummyContainerSize);
|
||||
rtc->mBounds = rtcBounds;
|
||||
nscoord rtcWidth = rtcBounds.Width(lineWM);
|
||||
nsSize rtcSize = rtcBounds.Size(lineWM).GetPhysicalSize(lineWM);
|
||||
for (PerFrameData* rt = rtc->mSpan->mFirstFrame; rt; rt = rt->mNext) {
|
||||
LogicalRect rtBounds = rt->mFrame->GetLogicalRect(lineWM, rtcWidth);
|
||||
LogicalRect rtBounds = rt->mFrame->GetLogicalRect(lineWM, rtcSize);
|
||||
MOZ_ASSERT(rt->mBounds.Size(lineWM) == rtBounds.Size(lineWM),
|
||||
"Size of the annotation should not have been changed");
|
||||
rt->mBounds.SetOrigin(lineWM, rtBounds.Origin(lineWM));
|
||||
@@ -1492,7 +1495,7 @@ nsLineLayout::AddBulletFrame(nsIFrame* aFrame,
|
||||
}
|
||||
|
||||
// Note: block-coord value will be updated during block-direction alignment
|
||||
pfd->mBounds = LogicalRect(lineWM, aFrame->GetRect(), ContainerWidth());
|
||||
pfd->mBounds = LogicalRect(lineWM, aFrame->GetRect(), ContainerSize());
|
||||
pfd->mOverflowAreas = aMetrics.mOverflowAreas;
|
||||
}
|
||||
|
||||
@@ -1508,7 +1511,7 @@ nsLineLayout::DumpPerSpanData(PerSpanData* psd, int32_t aIndent)
|
||||
nsFrame::IndentBy(stdout, aIndent+1);
|
||||
nsFrame::ListTag(stdout, pfd->mFrame);
|
||||
nsRect rect = pfd->mBounds.GetPhysicalRect(psd->mWritingMode,
|
||||
ContainerWidth());
|
||||
ContainerSize());
|
||||
printf(" %d,%d,%d,%d\n", rect.x, rect.y, rect.width, rect.height);
|
||||
if (pfd->mSpan) {
|
||||
DumpPerSpanData(pfd->mSpan, aIndent + 1);
|
||||
@@ -1597,7 +1600,7 @@ nsLineLayout::VerticalAlignLine()
|
||||
for (PerFrameData* pfd = psd->mFirstFrame; pfd; pfd = pfd->mNext) {
|
||||
if (pfd->mBlockDirAlign == VALIGN_OTHER) {
|
||||
pfd->mBounds.BStart(lineWM) += baselineBCoord;
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerWidth());
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerSize());
|
||||
}
|
||||
}
|
||||
PlaceTopBottomFrames(psd, -mBStartEdge, lineBSize);
|
||||
@@ -1608,7 +1611,7 @@ nsLineLayout::VerticalAlignLine()
|
||||
mLineBox->SetBounds(lineWM,
|
||||
psd->mIStart, mBStartEdge,
|
||||
psd->mICoord - psd->mIStart, lineBSize,
|
||||
ContainerWidth());
|
||||
ContainerSize());
|
||||
|
||||
mLineBox->SetLogicalAscent(baselineBCoord - mBStartEdge);
|
||||
#ifdef NOISY_BLOCKDIR_ALIGN
|
||||
@@ -1633,7 +1636,7 @@ nsLineLayout::PlaceTopBottomFrames(PerSpanData* psd,
|
||||
NS_ASSERTION(0xFF != pfd->mBlockDirAlign, "umr");
|
||||
#endif
|
||||
WritingMode lineWM = mRootSpan->mWritingMode;
|
||||
nscoord containerWidth = ContainerWidthForSpan(psd);
|
||||
nsSize containerSize = ContainerSizeForSpan(psd);
|
||||
switch (pfd->mBlockDirAlign) {
|
||||
case VALIGN_TOP:
|
||||
if (span) {
|
||||
@@ -1643,7 +1646,7 @@ nsLineLayout::PlaceTopBottomFrames(PerSpanData* psd,
|
||||
pfd->mBounds.BStart(lineWM) =
|
||||
-aDistanceFromStart + pfd->mMargin.BStart(lineWM);
|
||||
}
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, containerWidth);
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, containerSize);
|
||||
#ifdef NOISY_BLOCKDIR_ALIGN
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, pfd->mFrame);
|
||||
@@ -1663,7 +1666,7 @@ nsLineLayout::PlaceTopBottomFrames(PerSpanData* psd,
|
||||
pfd->mBounds.BStart(lineWM) = -aDistanceFromStart + aLineBSize -
|
||||
pfd->mMargin.BEnd(lineWM) - pfd->mBounds.BSize(lineWM);
|
||||
}
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, containerWidth);
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, containerSize);
|
||||
#ifdef NOISY_BLOCKDIR_ALIGN
|
||||
printf(" ");
|
||||
nsFrame::ListTag(stdout, pfd->mFrame);
|
||||
@@ -2232,7 +2235,7 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
||||
#endif
|
||||
}
|
||||
if (psd != mRootSpan) {
|
||||
frame->SetRect(lineWM, pfd->mBounds, ContainerWidthForSpan(psd));
|
||||
frame->SetRect(lineWM, pfd->mBounds, ContainerSizeForSpan(psd));
|
||||
}
|
||||
}
|
||||
pfd = pfd->mNext;
|
||||
@@ -2395,7 +2398,7 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
||||
while (nullptr != pfd) {
|
||||
pfd->mBounds.BStart(lineWM) -= minBCoord; // move all the children
|
||||
// back up
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerWidthForSpan(psd));
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerSizeForSpan(psd));
|
||||
pfd = pfd->mNext;
|
||||
}
|
||||
maxBCoord -= minBCoord; // since minBCoord is in the frame's own
|
||||
@@ -2473,11 +2476,11 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
|
||||
// that are direct children of the block will be updated
|
||||
// later, however, because the VerticalAlignFrames method
|
||||
// will be run after this method.
|
||||
nscoord containerWidth = ContainerWidthForSpan(childSpan);
|
||||
nsSize containerSize = ContainerSizeForSpan(childSpan);
|
||||
nsIFrame* f = pfd->mFrame;
|
||||
LogicalRect r(lineWM, f->GetRect(), containerWidth);
|
||||
LogicalRect r(lineWM, f->GetRect(), containerSize);
|
||||
r.ISize(lineWM) -= deltaISize;
|
||||
f->SetRect(lineWM, r, containerWidth);
|
||||
f->SetRect(lineWM, r, containerSize);
|
||||
}
|
||||
|
||||
// Adjust the inline end edge of the span that contains the child span
|
||||
@@ -2541,7 +2544,7 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
|
||||
// The frame was already placed during psd's
|
||||
// reflow. Update the frames rectangle now.
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds,
|
||||
ContainerWidthForSpan(psd));
|
||||
ContainerSizeForSpan(psd));
|
||||
}
|
||||
|
||||
// Adjust containing span's right edge
|
||||
@@ -2757,7 +2760,7 @@ nsLineLayout::ComputeFrameJustification(PerSpanData* aPSD,
|
||||
|
||||
void
|
||||
nsLineLayout::AdvanceAnnotationInlineBounds(PerFrameData* aPFD,
|
||||
nscoord aContainerWidth,
|
||||
const nsSize& aContainerSize,
|
||||
nscoord aDeltaICoord,
|
||||
nscoord aDeltaISize)
|
||||
{
|
||||
@@ -2795,7 +2798,7 @@ nsLineLayout::AdvanceAnnotationInlineBounds(PerFrameData* aPFD,
|
||||
// themselves properly. We only need to expand its own size here.
|
||||
aPFD->mBounds.ISize(lineWM) += aDeltaISize;
|
||||
}
|
||||
aPFD->mFrame->SetRect(lineWM, aPFD->mBounds, aContainerWidth);
|
||||
aPFD->mFrame->SetRect(lineWM, aPFD->mBounds, aContainerSize);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2809,8 +2812,8 @@ nsLineLayout::ApplyLineJustificationToAnnotations(PerFrameData* aPFD,
|
||||
{
|
||||
PerFrameData* pfd = aPFD->mNextAnnotation;
|
||||
while (pfd) {
|
||||
nscoord containerWidth = pfd->mFrame->GetParent()->GetRect().Width();
|
||||
AdvanceAnnotationInlineBounds(pfd, containerWidth,
|
||||
nsSize containerSize = pfd->mFrame->GetParent()->GetSize();
|
||||
AdvanceAnnotationInlineBounds(pfd, containerSize,
|
||||
aDeltaICoord, aDeltaISize);
|
||||
|
||||
// There are two cases where an annotation frame has siblings which
|
||||
@@ -2822,7 +2825,7 @@ nsLineLayout::ApplyLineJustificationToAnnotations(PerFrameData* aPFD,
|
||||
// need to move them so that they won't overlap other frames.
|
||||
PerFrameData* sibling = pfd->mNext;
|
||||
while (sibling && !sibling->mIsLinkedToBase) {
|
||||
AdvanceAnnotationInlineBounds(sibling, containerWidth,
|
||||
AdvanceAnnotationInlineBounds(sibling, containerSize,
|
||||
aDeltaICoord + aDeltaISize, 0);
|
||||
sibling = sibling->mNext;
|
||||
}
|
||||
@@ -2880,7 +2883,7 @@ nsLineLayout::ApplyFrameJustification(PerSpanData* aPSD,
|
||||
// excluded from the isize added to the annotation.
|
||||
ApplyLineJustificationToAnnotations(pfd, deltaICoord, dw - gapsAtEnd);
|
||||
deltaICoord += dw;
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerWidthForSpan(aPSD));
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerSizeForSpan(aPSD));
|
||||
}
|
||||
}
|
||||
return deltaICoord;
|
||||
@@ -2905,7 +2908,7 @@ FindNearestRubyBaseAncestor(nsIFrame* aFrame)
|
||||
*/
|
||||
void
|
||||
nsLineLayout::ExpandRubyBox(PerFrameData* aFrame, nscoord aReservedISize,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
WritingMode lineWM = mRootSpan->mWritingMode;
|
||||
auto rubyAlign = aFrame->mFrame->StyleText()->mRubyAlign;
|
||||
@@ -2937,7 +2940,7 @@ nsLineLayout::ExpandRubyBox(PerFrameData* aFrame, nscoord aReservedISize,
|
||||
for (PerFrameData* child = aFrame->mSpan->mFirstFrame;
|
||||
child; child = child->mNext) {
|
||||
child->mBounds.IStart(lineWM) += aReservedISize / 2;
|
||||
child->mFrame->SetRect(lineWM, child->mBounds, aContainerWidth);
|
||||
child->mFrame->SetRect(lineWM, child->mBounds, aContainerSize);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -2945,7 +2948,7 @@ nsLineLayout::ExpandRubyBox(PerFrameData* aFrame, nscoord aReservedISize,
|
||||
}
|
||||
|
||||
aFrame->mBounds.ISize(lineWM) += aReservedISize;
|
||||
aFrame->mFrame->SetRect(lineWM, aFrame->mBounds, aContainerWidth);
|
||||
aFrame->mFrame->SetRect(lineWM, aFrame->mBounds, aContainerSize);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2955,11 +2958,11 @@ nsLineLayout::ExpandRubyBox(PerFrameData* aFrame, nscoord aReservedISize,
|
||||
*/
|
||||
void
|
||||
nsLineLayout::ExpandRubyBoxWithAnnotations(PerFrameData* aFrame,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
nscoord reservedISize = RubyUtils::GetReservedISize(aFrame->mFrame);
|
||||
if (reservedISize) {
|
||||
ExpandRubyBox(aFrame, reservedISize, aContainerWidth);
|
||||
ExpandRubyBox(aFrame, reservedISize, aContainerSize);
|
||||
}
|
||||
|
||||
WritingMode lineWM = mRootSpan->mWritingMode;
|
||||
@@ -2977,7 +2980,7 @@ nsLineLayout::ExpandRubyBoxWithAnnotations(PerFrameData* aFrame,
|
||||
MOZ_ASSERT(
|
||||
rtcFrame->GetLogicalSize(lineWM) == annotation->mBounds.Size(lineWM));
|
||||
rtcFrame->SetPosition(lineWM, annotation->mBounds.Origin(lineWM),
|
||||
aContainerWidth);
|
||||
aContainerSize);
|
||||
}
|
||||
|
||||
nscoord reservedISize = RubyUtils::GetReservedISize(annotation->mFrame);
|
||||
@@ -2997,13 +3000,13 @@ nsLineLayout::ExpandRubyBoxWithAnnotations(PerFrameData* aFrame,
|
||||
computeState.mLastParticipant->mJustificationAssignment.mGapsAtEnd = 1;
|
||||
}
|
||||
nsIFrame* parentFrame = annotation->mFrame->GetParent();
|
||||
nscoord containerWidth = parentFrame->GetRect().Width();
|
||||
MOZ_ASSERT(containerWidth == aContainerWidth ||
|
||||
nsSize containerSize = parentFrame->GetSize();
|
||||
MOZ_ASSERT(containerSize == aContainerSize ||
|
||||
parentFrame->GetType() == nsGkAtoms::rubyTextContainerFrame,
|
||||
"Container width should only be different when the current "
|
||||
"annotation is a ruby text frame, whose parent is not same "
|
||||
"as its base frame.");
|
||||
ExpandRubyBox(annotation, reservedISize, containerWidth);
|
||||
ExpandRubyBox(annotation, reservedISize, containerSize);
|
||||
ExpandInlineRubyBoxes(annotation->mSpan);
|
||||
}
|
||||
}
|
||||
@@ -3015,10 +3018,10 @@ nsLineLayout::ExpandRubyBoxWithAnnotations(PerFrameData* aFrame,
|
||||
void
|
||||
nsLineLayout::ExpandInlineRubyBoxes(PerSpanData* aSpan)
|
||||
{
|
||||
nscoord containerWidth = ContainerWidthForSpan(aSpan);
|
||||
nsSize containerSize = ContainerSizeForSpan(aSpan);
|
||||
for (PerFrameData* pfd = aSpan->mFirstFrame; pfd; pfd = pfd->mNext) {
|
||||
if (RubyUtils::IsExpandableRubyBox(pfd->mFrame)) {
|
||||
ExpandRubyBoxWithAnnotations(pfd, containerWidth);
|
||||
ExpandRubyBoxWithAnnotations(pfd, containerSize);
|
||||
}
|
||||
if (pfd->mSpan) {
|
||||
ExpandInlineRubyBoxes(pfd->mSpan);
|
||||
@@ -3112,7 +3115,7 @@ nsLineLayout::TextAlignLine(nsLineBox* aLine,
|
||||
// Apply the justification, and make sure to update our linebox
|
||||
// width to account for it.
|
||||
aLine->ExpandBy(ApplyFrameJustification(psd, applyState),
|
||||
ContainerWidthForSpan(psd));
|
||||
ContainerSizeForSpan(psd));
|
||||
|
||||
MOZ_ASSERT(applyState.mGaps.mHandled == applyState.mGaps.mCount,
|
||||
"Unprocessed justification gaps");
|
||||
@@ -3164,14 +3167,14 @@ nsLineLayout::TextAlignLine(nsLineBox* aLine,
|
||||
lineWM, mContainerSize,
|
||||
psd->mIStart + mTextIndent + dx);
|
||||
if (dx) {
|
||||
aLine->IndentBy(dx, ContainerWidth());
|
||||
aLine->IndentBy(dx, ContainerSize());
|
||||
}
|
||||
} else if (dx) {
|
||||
for (PerFrameData* pfd = psd->mFirstFrame; pfd; pfd = pfd->mNext) {
|
||||
pfd->mBounds.IStart(lineWM) += dx;
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerWidthForSpan(psd));
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerSizeForSpan(psd));
|
||||
}
|
||||
aLine->IndentBy(dx, ContainerWidth());
|
||||
aLine->IndentBy(dx, ContainerSize());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3185,13 +3188,13 @@ nsLineLayout::ApplyRelativePositioning(PerFrameData* aPFD)
|
||||
|
||||
nsIFrame* frame = aPFD->mFrame;
|
||||
WritingMode frameWM = frame->GetWritingMode();
|
||||
LogicalPoint origin = frame->GetLogicalPosition(ContainerWidth());
|
||||
LogicalPoint origin = frame->GetLogicalPosition(ContainerSize());
|
||||
// right and bottom are handled by
|
||||
// nsHTMLReflowState::ComputeRelativeOffsets
|
||||
nsHTMLReflowState::ApplyRelativePositioning(frame, frameWM,
|
||||
aPFD->mOffsets, &origin,
|
||||
ContainerWidth());
|
||||
frame->SetPosition(frameWM, origin, ContainerWidth());
|
||||
ContainerSize());
|
||||
frame->SetPosition(frameWM, origin, ContainerSize());
|
||||
}
|
||||
|
||||
// This method do relative positioning for ruby annotations.
|
||||
@@ -3244,7 +3247,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflo
|
||||
// children of the block starts at the upper left corner of the
|
||||
// line and is sized to match the size of the line's bounding box
|
||||
// (the same size as the values returned from VerticalAlignFrames)
|
||||
overflowAreas.VisualOverflow() = rect.GetPhysicalRect(wm, ContainerWidth());
|
||||
overflowAreas.VisualOverflow() = rect.GetPhysicalRect(wm, ContainerSize());
|
||||
overflowAreas.ScrollableOverflow() = overflowAreas.VisualOverflow();
|
||||
}
|
||||
|
||||
|
||||
@@ -544,14 +544,15 @@ protected:
|
||||
PerSpanData* mRootSpan;
|
||||
PerSpanData* mCurrentSpan;
|
||||
|
||||
// The container width to use when converting between logical and
|
||||
// The container size to use when converting between logical and
|
||||
// physical coordinates for frames in this span. For the root span
|
||||
// this is the width of the block cached in mContainerSize.width; for
|
||||
// child spans it's the width of the root span
|
||||
nscoord ContainerWidthForSpan(PerSpanData* aPSD) {
|
||||
// this is the size of the block cached in mContainerSize; for
|
||||
// child spans it's the size of the root span.
|
||||
nsSize ContainerSizeForSpan(PerSpanData* aPSD) {
|
||||
return (aPSD == mRootSpan)
|
||||
? ContainerWidth()
|
||||
: aPSD->mFrame->mBounds.Width(mRootSpan->mWritingMode);
|
||||
? mContainerSize
|
||||
: aPSD->mFrame->mBounds.Size(mRootSpan->mWritingMode).
|
||||
GetPhysicalSize(mRootSpan->mWritingMode);
|
||||
}
|
||||
|
||||
gfxBreakPriority mLastOptionalBreakPriority;
|
||||
@@ -587,8 +588,7 @@ protected:
|
||||
|
||||
// Physical size. Use only for physical <-> logical coordinate conversion.
|
||||
nsSize mContainerSize;
|
||||
nscoord ContainerWidth() const { return mContainerSize.width; }
|
||||
nscoord ContainerHeight() const { return mContainerSize.height; }
|
||||
const nsSize& ContainerSize() const { return mContainerSize; }
|
||||
|
||||
bool mFirstLetterStyleOK : 1;
|
||||
bool mIsTopOfPage : 1;
|
||||
@@ -686,7 +686,7 @@ protected:
|
||||
JustificationComputationState& aState);
|
||||
|
||||
void AdvanceAnnotationInlineBounds(PerFrameData* aPFD,
|
||||
nscoord aContainerWidth,
|
||||
const nsSize& aContainerSize,
|
||||
nscoord aDeltaICoord,
|
||||
nscoord aDeltaISize);
|
||||
|
||||
@@ -700,10 +700,10 @@ protected:
|
||||
PerSpanData* aPSD, mozilla::JustificationApplicationState& aState);
|
||||
|
||||
void ExpandRubyBox(PerFrameData* aFrame, nscoord aReservedISize,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
|
||||
void ExpandRubyBoxWithAnnotations(PerFrameData* aFrame,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
|
||||
void ExpandInlineRubyBoxes(PerSpanData* aSpan);
|
||||
|
||||
|
||||
@@ -253,7 +253,9 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
nscoord segmentISize = baseMetrics.ISize(lineWM);
|
||||
LogicalRect baseRect = aBaseContainer->GetLogicalRect(lineWM, 0);
|
||||
const nsSize dummyContainerSize;
|
||||
LogicalRect baseRect =
|
||||
aBaseContainer->GetLogicalRect(lineWM, dummyContainerSize);
|
||||
// We need to position our rtc frames on one side or the other of the
|
||||
// base container's rect, using a coordinate space that's relative to
|
||||
// the ruby frame. Right now, the base container's rect's block-axis
|
||||
@@ -318,10 +320,11 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
|
||||
MOZ_ASSERT_UNREACHABLE("???");
|
||||
}
|
||||
}
|
||||
// Container width is set to zero here. We will fix it in
|
||||
// nsLineLayout after the whole line get reflowed.
|
||||
// Using a dummy container-size here, so child positioning may not be
|
||||
// correct. We will fix it in nsLineLayout after the whole line is
|
||||
// reflowed.
|
||||
FinishReflowChild(textContainer, aPresContext, textMetrics,
|
||||
&textReflowState, lineWM, position, 0, 0);
|
||||
&textReflowState, lineWM, position, dummyContainerSize, 0);
|
||||
}
|
||||
MOZ_ASSERT(baseRect.ISize(lineWM) == offsetRect.ISize(lineWM),
|
||||
"Annotations should only be placed on the block directions");
|
||||
|
||||
@@ -135,11 +135,14 @@ nsRubyTextContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
nscoord minBCoord = nscoord_MAX;
|
||||
nscoord maxBCoord = nscoord_MIN;
|
||||
// The container size is not yet known, so we use a dummy (0, 0) size.
|
||||
// The block-dir position will be corrected below after containerSize
|
||||
// is finalized.
|
||||
const nsSize dummyContainerSize;
|
||||
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
|
||||
nsIFrame* child = e.get();
|
||||
MOZ_ASSERT(child->GetType() == nsGkAtoms::rubyTextFrame);
|
||||
// The container width is still unknown yet.
|
||||
LogicalRect rect = child->GetLogicalRect(lineWM, 0);
|
||||
LogicalRect rect = child->GetLogicalRect(lineWM, dummyContainerSize);
|
||||
LogicalMargin margin = child->GetLogicalUsedMargin(lineWM);
|
||||
nscoord blockStart = rect.BStart(lineWM) - margin.BStart(lineWM);
|
||||
minBCoord = std::min(minBCoord, blockStart);
|
||||
@@ -155,18 +158,18 @@ nsRubyTextContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||
minBCoord = maxBCoord = 0;
|
||||
}
|
||||
size.BSize(lineWM) = maxBCoord - minBCoord;
|
||||
nscoord containerWidth = size.Width(lineWM);
|
||||
nsSize containerSize = size.GetPhysicalSize(lineWM);
|
||||
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
|
||||
nsIFrame* child = e.get();
|
||||
// We reflowed the child with container width 0, as the true width
|
||||
// We reflowed the child with a dummy container size, as the true size
|
||||
// was not yet known at that time.
|
||||
LogicalPoint pos = child->GetLogicalPosition(lineWM, 0);
|
||||
LogicalPoint pos = child->GetLogicalPosition(lineWM, dummyContainerSize);
|
||||
// Adjust block position to account for minBCoord,
|
||||
// then reposition child based on the true container width.
|
||||
pos.B(lineWM) -= minBCoord;
|
||||
// Relative positioning hasn't happened yet.
|
||||
// So MovePositionBy should not be used here.
|
||||
child->SetPosition(lineWM, pos, containerWidth);
|
||||
child->SetPosition(lineWM, pos, containerSize);
|
||||
nsContainerFrame::PlaceFrameView(child);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ support-files = bug633762_iframe.html
|
||||
[test_bug735641.html]
|
||||
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
|
||||
[test_bug748961.html]
|
||||
[test_bug756984.html]
|
||||
[test_bug784410.html]
|
||||
skip-if = buildapp == 'b2g' #Bug 931116, 1129060 no wheel events on b2g
|
||||
[test_bug785324.html]
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=756984
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 756984</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=756984">Mozilla Bug 756984</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
|
||||
<div id="div1">123<br>45678<br></div>
|
||||
<div id="div2"><font face="Arial">123</font><br><i>45678</i><br></div>
|
||||
<div id="div3"><font face="Courier"><i><strong>123</strong></i></font><br><i>45678</i><br></div>
|
||||
<div id="div4"><br>45678<br></div>
|
||||
|
||||
<pre id="test">
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 756984 **/
|
||||
/** We test that clicking beyond the end of a line terminated with <br> selects the preceding text, if any **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
SimpleTest.waitForFocus(function() {
|
||||
|
||||
var sel = window.getSelection();
|
||||
|
||||
for (i = 1; i <= 3; i++) {
|
||||
// click beyond the first line (100px to the left and 2px down), expect text
|
||||
var theDiv = document.getElementById("div" + i.toString());
|
||||
theDiv.focus();
|
||||
sel.collapse(theDiv, 0);
|
||||
synthesizeMouse(theDiv, 100, 2, {});
|
||||
var selRange = sel.getRangeAt(0);
|
||||
is(selRange.endContainer.nodeName, "#text", "selection should be in text node");
|
||||
is(selRange.endOffset, 3, "offset should be 3");
|
||||
}
|
||||
|
||||
// click beyond the first line (100px to the left and 2px down), expect DIV.
|
||||
// This is the previous behaviour which hasn't changed since the line is empty.
|
||||
// If the processing were wrong, the selection would end up in some other non-empty line.
|
||||
theDiv = document.getElementById("div4");
|
||||
theDiv.focus();
|
||||
sel.collapse(theDiv, 0);
|
||||
synthesizeMouse(theDiv, 100, 2, {});
|
||||
selRange = sel.getRangeAt(0);
|
||||
is(selRange.endContainer.nodeName, "DIV", "selection should be in DIV");
|
||||
is(selRange.endOffset, 0, "offset should be 0");
|
||||
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
@@ -70,7 +70,7 @@ function test() {
|
||||
testRight(editor.firstChild.nextSibling.nextSibling, 0);
|
||||
testRight(editor.firstChild.nextSibling.nextSibling, 1);
|
||||
testLeft(editor.firstChild.nextSibling.nextSibling, 0);
|
||||
testLeft(editor, 1);
|
||||
testLeft(editor.firstChild, 2);
|
||||
testLeft(editor.firstChild, 1);
|
||||
testLeft(editor.firstChild, 0);
|
||||
|
||||
|
||||
@@ -820,10 +820,11 @@ nsMathMLmtableOuterFrame::Reflow(nsPresContext* aPresContext,
|
||||
if (rowFrame) {
|
||||
// translate the coordinates to be relative to us and in our writing mode
|
||||
nsIFrame* frame = rowFrame;
|
||||
LogicalRect frameRect(wm, frame->GetRect(), aReflowState.ComputedWidth());
|
||||
blockSize = frameRect.BSize(wm);
|
||||
LogicalRect rect(wm, frame->GetRect(),
|
||||
aReflowState.ComputedSizeAsContainerIfConstrained());
|
||||
blockSize = rect.BSize(wm);
|
||||
do {
|
||||
dy += frameRect.BStart(wm);
|
||||
dy += rect.BStart(wm);
|
||||
frame = frame->GetParent();
|
||||
} while (frame != this);
|
||||
}
|
||||
|
||||
@@ -717,10 +717,10 @@ skip-if(B2G||Mulet) fails-if(Android) != 379461-3-container-xhtml.html 379461-3-
|
||||
== 383035-2.html about:blank
|
||||
== 383488-1.html 383488-1-ref.html
|
||||
== 383551-1.html 383551-1-ref.html
|
||||
== 383883-1.html 383883-1-ref.html
|
||||
== 383883-2.html 383883-2-ref.html
|
||||
== 383883-3.html 383883-3-ref.html
|
||||
== 383883-4.html 383883-4-ref.html
|
||||
fuzzy-if(B2G,68,26) == 383883-1.html 383883-1-ref.html
|
||||
fuzzy-if(B2G,68,26) == 383883-2.html 383883-2-ref.html
|
||||
fuzzy-if(B2G,68,26) == 383883-3.html 383883-3-ref.html
|
||||
fuzzy-if(B2G,68,26) == 383883-4.html 383883-4-ref.html
|
||||
== 383884-1.html 383884-1-ref.html
|
||||
== 383885-1.html 383885-1-ref.html
|
||||
== 384322-1.html 384322-1-ref.html
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);display:inline-block;position:relative;top:200px;"></div>
|
||||
</div>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);display:inline-block;position:relative;top:100px;"></div>
|
||||
</div>
|
||||
<div style="background:silver;padding-bottom:calc(100% - 100px);">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px" dir="rtl">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px" dir="rtl">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px" dir="rtl">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px" dir="rtl">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="rtl" style="height:300px">
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);display:inline-block;position:relative;top:0px;"></div>
|
||||
</div>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);display:inline-block;position:relative;top:100px;"></div>
|
||||
</div>
|
||||
<div style="background:silver;padding-top:200px;">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="rtl" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="rtl" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="rtl" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="rtl" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="rtl" style="inline-size:-moz-fit-content">
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:600px; direction: rtl;">
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);display:inline-block;position:relative;bottom: 200px;"></div>
|
||||
</div>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);display:inline-block;position:relative;bottom: 100px);"></div>
|
||||
</div>
|
||||
<div style="background:silver;padding-top:calc(100% - 100px);">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:600px; direction: rtl;">
|
||||
<div dir="ltr" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:600px; direction: rtl;">
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="ltr" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:600px; direction: rtl;">
|
||||
<div dir="ltr" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="ltr" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:600px; direction: rtl;">
|
||||
<div dir="ltr" style="inline-size:-moz-fit-content">
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);display:inline-block;position:relative;bottom:0px;"></div>
|
||||
</div>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);display:inline-block;position:relative;bottom:100px;"></div>
|
||||
</div>
|
||||
<div style="background:silver;padding-bottom:200px;">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="ltr" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="ltr" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="ltr" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="ltr" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vlr">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vlr {
|
||||
writing-mode: vertical-lr;
|
||||
-webkit-writing-mode: vertical-lr;
|
||||
writing-mode: tb-lr;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="ltr" style="inline-size:-moz-fit-content">
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: ltr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body dir="rtl">
|
||||
<div dir="ltr">
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);display:inline-block;position:relative;top:200px;"></div>
|
||||
</div>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);display:inline-block;position:relative;top:100px;"></div>
|
||||
</div>
|
||||
<div style="background:silver;padding-bottom:calc(100% - 100px);">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: ltr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px" dir="rtl">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: ltr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px" dir="rtl">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: ltr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px" dir="rtl">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px" dir="rtl">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: ltr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="rtl" style="height:300px">
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: ltr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);display:inline-block;position:relative;top:0px;"></div>
|
||||
</div>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);display:inline-block;position:relative;top:100px;"></div>
|
||||
</div>
|
||||
<div style="background:silver;padding-top:200px;">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: ltr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="rtl" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: ltr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="rtl" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: ltr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="rtl" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="rtl" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: ltr;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="rtl" style="inline-size:-moz-fit-content">
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:600px; direction: rtl;">
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);display:inline-block;position:relative;bottom:200px;"></div>
|
||||
</div>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);display:inline-block;position:relative;bottom:100px;"></div>
|
||||
</div>
|
||||
<div style="background:silver;padding-top:calc(100% - 100px);">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:600px; direction: rtl;">
|
||||
<div dir="ltr" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:600px; direction: rtl;">
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="ltr" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:600px; direction: rtl;">
|
||||
<div dir="ltr" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="ltr" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:600px; direction: rtl;">
|
||||
<div dir="ltr" style="inline-size:-moz-fit-content">
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:left;position:relative;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear BELOW the green and red blocks.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);display:inline-block;position:relative;bottom:0px;"></div>
|
||||
</div>
|
||||
<div style="height:0px;width:0px;overflow:visible">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);display:inline-block;position:relative;bottom:100px;"></div>
|
||||
</div>
|
||||
<div style="background:silver;padding-bottom:200px;">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="ltr" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="ltr" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="ltr" style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div dir="ltr" style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="vrl">
|
||||
<head>
|
||||
<title>Bug 1114329 testcase</title>
|
||||
<style>
|
||||
.vrl {
|
||||
writing-mode: vertical-rl;
|
||||
-webkit-writing-mode: vertical-rl;
|
||||
writing-mode: tb-rl;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div dir="ltr" style="inline-size:-moz-fit-content">
|
||||
<div style="height:300px">
|
||||
<div style="height:100px;width:120px;background:rgba(0,255,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
<div style="height:200px">
|
||||
<div style="height:100px;width:150px;background:rgba(255,0,0,0.8);float:right;position:relative;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background:silver">
|
||||
This text should appear ABOVE the red and green blocks.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -46,7 +46,46 @@ fails == 345369-2.html 345369-2-ref.html
|
||||
== bfc-displace-4.html bfc-displace-4-ref.html
|
||||
== bfc-shrink-1.html bfc-shrink-1-ref.html
|
||||
|
||||
pref(layout.css.vertical-text.enabled,true) fuzzy-if(OSX==1010,26,7) fuzzy-if(Android,16,2) == orthogonal-floats-1a.html orthogonal-floats-1-ref.html
|
||||
pref(layout.css.vertical-text.enabled,true) fuzzy-if(OSX==1010,26,7) == orthogonal-floats-1b.html orthogonal-floats-1-ref.html
|
||||
pref(layout.css.vertical-text.enabled,true) fuzzy-if(OSX==1010,103,802) fuzzy-if(winWidget,116,700) HTTP(..) == orthogonal-floats-1c.html orthogonal-floats-1-ref.html
|
||||
pref(layout.css.vertical-text.enabled,true) fuzzy-if(OSX==1010,103,802) fuzzy-if(winWidget,116,700) HTTP(..) == orthogonal-floats-1d.html orthogonal-floats-1-ref.html
|
||||
# Testcases that involve vertical writing mode.
|
||||
#
|
||||
# XXX The default-preferences setting here can be removed after the
|
||||
# pref has been made true by default for all channels (bug 1138384).
|
||||
|
||||
default-preferences pref(layout.css.vertical-text.enabled,true)
|
||||
|
||||
== float-in-rtl-vlr-1a.html float-in-rtl-vlr-1-ref.html
|
||||
== float-in-rtl-vlr-1b.html float-in-rtl-vlr-1-ref.html
|
||||
== float-in-rtl-vlr-1c.html float-in-rtl-vlr-1-ref.html
|
||||
== float-in-rtl-vlr-1d.html float-in-rtl-vlr-1-ref.html
|
||||
== float-in-rtl-vlr-2a.html float-in-rtl-vlr-2-ref.html
|
||||
== float-in-rtl-vlr-2b.html float-in-rtl-vlr-2-ref.html
|
||||
== float-in-rtl-vlr-2c.html float-in-rtl-vlr-2-ref.html
|
||||
== float-in-rtl-vlr-2d.html float-in-rtl-vlr-2-ref.html
|
||||
== float-in-rtl-vlr-3a.html float-in-rtl-vlr-3-ref.html
|
||||
== float-in-rtl-vlr-3b.html float-in-rtl-vlr-3-ref.html
|
||||
== float-in-rtl-vlr-3c.html float-in-rtl-vlr-3-ref.html
|
||||
== float-in-rtl-vlr-3d.html float-in-rtl-vlr-3-ref.html
|
||||
== float-in-rtl-vlr-4a.html float-in-rtl-vlr-4-ref.html
|
||||
== float-in-rtl-vlr-4b.html float-in-rtl-vlr-4-ref.html
|
||||
== float-in-rtl-vlr-4c.html float-in-rtl-vlr-4-ref.html
|
||||
== float-in-rtl-vlr-4d.html float-in-rtl-vlr-4-ref.html
|
||||
== float-in-rtl-vrl-1a.html float-in-rtl-vrl-1-ref.html
|
||||
== float-in-rtl-vrl-1b.html float-in-rtl-vrl-1-ref.html
|
||||
== float-in-rtl-vrl-1c.html float-in-rtl-vrl-1-ref.html
|
||||
== float-in-rtl-vrl-1d.html float-in-rtl-vrl-1-ref.html
|
||||
== float-in-rtl-vrl-2a.html float-in-rtl-vrl-2-ref.html
|
||||
== float-in-rtl-vrl-2b.html float-in-rtl-vrl-2-ref.html
|
||||
== float-in-rtl-vrl-2c.html float-in-rtl-vrl-2-ref.html
|
||||
== float-in-rtl-vrl-2d.html float-in-rtl-vrl-2-ref.html
|
||||
== float-in-rtl-vrl-3a.html float-in-rtl-vrl-3-ref.html
|
||||
== float-in-rtl-vrl-3b.html float-in-rtl-vrl-3-ref.html
|
||||
== float-in-rtl-vrl-3c.html float-in-rtl-vrl-3-ref.html
|
||||
== float-in-rtl-vrl-3d.html float-in-rtl-vrl-3-ref.html
|
||||
== float-in-rtl-vrl-4a.html float-in-rtl-vrl-4-ref.html
|
||||
== float-in-rtl-vrl-4b.html float-in-rtl-vrl-4-ref.html
|
||||
== float-in-rtl-vrl-4c.html float-in-rtl-vrl-4-ref.html
|
||||
== float-in-rtl-vrl-4d.html float-in-rtl-vrl-4-ref.html
|
||||
fuzzy-if(OSX==1010,26,7) fuzzy-if(Android,16,2) == orthogonal-floats-1a.html orthogonal-floats-1-ref.html
|
||||
fuzzy-if(OSX==1010,26,7) == orthogonal-floats-1b.html orthogonal-floats-1-ref.html
|
||||
fuzzy-if(OSX==1010,103,802) fuzzy-if(winWidget,116,700) HTTP(..) == orthogonal-floats-1c.html orthogonal-floats-1-ref.html
|
||||
fuzzy-if(OSX==1010,103,802) fuzzy-if(winWidget,116,700) HTTP(..) == orthogonal-floats-1d.html orthogonal-floats-1-ref.html
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Reftest Reference</title>
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
width: 40px;
|
||||
height: 30px;
|
||||
border: 1px solid gray;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.flexContainer > * {
|
||||
width: 20px;
|
||||
height: 15px;
|
||||
float: left;
|
||||
}
|
||||
.item1 {
|
||||
/* Note: flex items are ordered as "CMYK": cyan, magenta, yellow, black */
|
||||
background: cyan;
|
||||
}
|
||||
.item2 {
|
||||
background: magenta;
|
||||
}
|
||||
.item3 {
|
||||
background: yellow;
|
||||
}
|
||||
.item4 {
|
||||
background: black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Test: Verify that explicit sizes are honored on flex items whose writing-mode may differ from the flex container's writing-mode</title>
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#layout-algorithm">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#propdef-writing-mode">
|
||||
<link rel="match" href="flexbox-writing-mode-007-ref.html">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
width: 40px;
|
||||
height: 30px;
|
||||
border: 1px solid gray;
|
||||
margin-bottom: 5px;
|
||||
writing-mode: horizontal-tb;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.flexContainer > * {
|
||||
width: 20px;
|
||||
height: 15px;
|
||||
}
|
||||
.item1 {
|
||||
/* Note: flex items are ordered as "CMYK": cyan, magenta, yellow, black */
|
||||
background: cyan;
|
||||
}
|
||||
.item2 {
|
||||
background: magenta;
|
||||
}
|
||||
.item3 {
|
||||
background: yellow;
|
||||
}
|
||||
.item4 {
|
||||
background: black;
|
||||
}
|
||||
|
||||
/* Classes applied to flex container, to customize its children
|
||||
* (which should not affect their sizing):
|
||||
*/
|
||||
.kids_horizontal_tb > * {
|
||||
writing-mode: horizontal-tb;
|
||||
}
|
||||
.kids_vertical_lr > * {
|
||||
writing-mode: vertical-lr;
|
||||
}
|
||||
.kids_vertical_rl > * {
|
||||
writing-mode: vertical-rl;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer kids_horizontal_tb">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer kids_vertical_lr">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer kids_vertical_rl">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Reftest Reference</title>
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
width: 40px;
|
||||
height: 30px;
|
||||
border: 1px solid gray;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.flexContainer > * {
|
||||
width: 20px;
|
||||
height: 15px;
|
||||
float: left;
|
||||
}
|
||||
.item1 {
|
||||
/* Note: flex items are ordered as "CMYK": cyan, magenta, yellow, black */
|
||||
background: cyan;
|
||||
}
|
||||
.item2 {
|
||||
background: magenta;
|
||||
}
|
||||
.item3 {
|
||||
background: yellow;
|
||||
}
|
||||
.item4 {
|
||||
background: black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item3"></div>
|
||||
<div class="item2"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item3"></div>
|
||||
<div class="item2"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item3"></div>
|
||||
<div class="item2"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item3"></div>
|
||||
<div class="item2"></div><div class="item4"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Test: Verify that explicit sizes are honored on flex items whose writing-mode may differ from the flex container's writing-mode</title>
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#layout-algorithm">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#propdef-writing-mode">
|
||||
<link rel="match" href="flexbox-writing-mode-008-ref.html">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
width: 40px;
|
||||
height: 30px;
|
||||
border: 1px solid gray;
|
||||
margin-bottom: 5px;
|
||||
writing-mode: vertical-lr;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.flexContainer > * {
|
||||
width: 20px;
|
||||
height: 15px;
|
||||
}
|
||||
.item1 {
|
||||
/* Note: flex items are ordered as "CMYK": cyan, magenta, yellow, black */
|
||||
background: cyan;
|
||||
}
|
||||
.item2 {
|
||||
background: magenta;
|
||||
}
|
||||
.item3 {
|
||||
background: yellow;
|
||||
}
|
||||
.item4 {
|
||||
background: black;
|
||||
}
|
||||
|
||||
/* Classes applied to flex container, to customize its children
|
||||
* (which should not affect their sizing):
|
||||
*/
|
||||
.kids_horizontal_tb > * {
|
||||
writing-mode: horizontal-tb;
|
||||
}
|
||||
.kids_vertical_lr > * {
|
||||
writing-mode: vertical-lr;
|
||||
}
|
||||
.kids_vertical_rl > * {
|
||||
writing-mode: vertical-rl;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer kids_horizontal_tb">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer kids_vertical_lr">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer kids_vertical_rl">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Reftest Reference</title>
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
width: 40px;
|
||||
height: 30px;
|
||||
border: 1px solid gray;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.flexContainer > * {
|
||||
width: 20px;
|
||||
height: 15px;
|
||||
float: left;
|
||||
}
|
||||
.item1 {
|
||||
/* Note: flex items are ordered as "CMYK": cyan, magenta, yellow, black */
|
||||
background: cyan;
|
||||
}
|
||||
.item2 {
|
||||
background: magenta;
|
||||
}
|
||||
.item3 {
|
||||
background: yellow;
|
||||
}
|
||||
.item4 {
|
||||
background: black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer">
|
||||
<div class="item3"></div><div class="item1"></div>
|
||||
<div class="item4"></div><div class="item2"></div>
|
||||
</div>
|
||||
<div class="flexContainer">
|
||||
<div class="item3"></div><div class="item1"></div>
|
||||
<div class="item4"></div><div class="item2"></div>
|
||||
</div>
|
||||
<div class="flexContainer">
|
||||
<div class="item3"></div><div class="item1"></div>
|
||||
<div class="item4"></div><div class="item2"></div>
|
||||
</div>
|
||||
<div class="flexContainer">
|
||||
<div class="item3"></div><div class="item1"></div>
|
||||
<div class="item4"></div><div class="item2"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Test: Verify that explicit sizes are honored on flex items whose writing-mode may differ from the flex container's writing-mode</title>
|
||||
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#layout-algorithm">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#propdef-writing-mode">
|
||||
<link rel="match" href="flexbox-writing-mode-009-ref.html">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
width: 40px;
|
||||
height: 30px;
|
||||
border: 1px solid gray;
|
||||
margin-bottom: 5px;
|
||||
writing-mode: vertical-rl;
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
.flexContainer > * {
|
||||
width: 20px;
|
||||
height: 15px;
|
||||
}
|
||||
.item1 {
|
||||
/* Note: flex items are ordered as "CMYK": cyan, magenta, yellow, black */
|
||||
background: cyan;
|
||||
}
|
||||
.item2 {
|
||||
background: magenta;
|
||||
}
|
||||
.item3 {
|
||||
background: yellow;
|
||||
}
|
||||
.item4 {
|
||||
background: black;
|
||||
}
|
||||
|
||||
/* Classes applied to flex container, to customize its children
|
||||
* (which should not affect their sizing):
|
||||
*/
|
||||
.kids_horizontal_tb > * {
|
||||
writing-mode: horizontal-tb;
|
||||
}
|
||||
.kids_vertical_lr > * {
|
||||
writing-mode: vertical-lr;
|
||||
}
|
||||
.kids_vertical_rl > * {
|
||||
writing-mode: vertical-rl;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer kids_horizontal_tb">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer kids_vertical_lr">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
<div class="flexContainer kids_vertical_rl">
|
||||
<div class="item1"></div><div class="item2"></div>
|
||||
<div class="item3"></div><div class="item4"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -188,5 +188,8 @@ test-pref(layout.css.vertical-text.enabled,true) == flexbox-writing-mode-001.htm
|
||||
test-pref(layout.css.vertical-text.enabled,true) == flexbox-writing-mode-002.html flexbox-writing-mode-002-ref.html
|
||||
test-pref(layout.css.vertical-text.enabled,true) == flexbox-writing-mode-003.html flexbox-writing-mode-003-ref.html
|
||||
test-pref(layout.css.vertical-text.enabled,true) == flexbox-writing-mode-004.html flexbox-writing-mode-004-ref.html
|
||||
test-pref(layout.css.vertical-text.enabled,true) fails == flexbox-writing-mode-005.html flexbox-writing-mode-005-ref.html # bug 1131451
|
||||
test-pref(layout.css.vertical-text.enabled,true) fails == flexbox-writing-mode-006.html flexbox-writing-mode-006-ref.html # bug 1131451
|
||||
test-pref(layout.css.vertical-text.enabled,true) == flexbox-writing-mode-005.html flexbox-writing-mode-005-ref.html
|
||||
test-pref(layout.css.vertical-text.enabled,true) == flexbox-writing-mode-006.html flexbox-writing-mode-006-ref.html
|
||||
test-pref(layout.css.vertical-text.enabled,true) == flexbox-writing-mode-007.html flexbox-writing-mode-007-ref.html
|
||||
test-pref(layout.css.vertical-text.enabled,true) == flexbox-writing-mode-008.html flexbox-writing-mode-008-ref.html
|
||||
test-pref(layout.css.vertical-text.enabled,true) == flexbox-writing-mode-009.html flexbox-writing-mode-009-ref.html
|
||||
|
||||
@@ -130,9 +130,9 @@ test-pref(dom.meta-viewport.enabled,true) test-pref(font.size.inflation.emPerLin
|
||||
== 1147834-relative-overconstrained-horizontal-tb-ltr.html 1147834-bottom-right-ref.html
|
||||
== 1147834-relative-overconstrained-horizontal-tb-rtl.html 1147834-bottom-left-ref.html
|
||||
== 1147834-relative-overconstrained-vertical-lr-ltr.html 1147834-bottom-right-ref.html
|
||||
fails == 1147834-relative-overconstrained-vertical-lr-rtl.html 1147834-top-right-ref.html # bug 1131451
|
||||
== 1147834-relative-overconstrained-vertical-lr-rtl.html 1147834-top-right-ref.html
|
||||
== 1147834-relative-overconstrained-vertical-rl-ltr.html 1147834-bottom-left-ref.html
|
||||
fails == 1147834-relative-overconstrained-vertical-rl-rtl.html 1147834-top-left-ref.html # bug 1131451
|
||||
== 1147834-relative-overconstrained-vertical-rl-rtl.html 1147834-top-left-ref.html
|
||||
== 1151993-1-orthogonal-block-size.html 1151993-1-orthogonal-block-size-ref.html
|
||||
== 1152941-1-orthogonal-blocksize-overflow.html 1152941-1-orthogonal-blocksize-overflow-ref.html
|
||||
== 1156021-text-indent-percent.html 1156021-text-indent-percent-ref.html
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8>
|
||||
<style>
|
||||
table {
|
||||
margin: 10px;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
td {
|
||||
border-top: 10px solid rgba(0,0,255,0.3);
|
||||
border-right: 20px solid rgba(255,0,0,0.3);
|
||||
border-bottom: 30px solid rgba(0,255,0,0.3);
|
||||
border-left: 40px solid rgba(255,0,255,0.3);
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div>
|
||||
<table>
|
||||
<tr><td> </td></tr>
|
||||
</table>
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user