import changes from `dev' branch of rmottola/Arctic-Fox:

- Tests for bug 645642, r=dbaron (aec12ff85)
- Bug 645642: implement text-align: match-parent, r=dbaron (8fa823a0c)
- Bug 1156222 - Check frame type instead of display type for ruby and simplify code. r=dholbert (69c93595e)
- Bug 1149009 - Suppress line break inside text frame if it is directly contained by ruby content box. r=dbaron (3ed20e1af)
- Bug 645642: use text-align: match-parent in list items, options and file inputs, r=dbaron (61b6b6ce2)
- Move reftests for bug 645642 to w3-css/submitted and add CSS test metadata (75f0ec152)
- Bug 1028716 part 1 - Remove the 'auto' value of the -moz-orient property, and add 'inline' (new initial value) and 'block'. r=dbaron (ac4be32f0)
- Bug 1028716 part 2 - Handle the new orient values in <progress> and <meter> layout. r=smontagu (a5c7978a0)
- Bug 1028716 part 3 - Widget updates to support the extended set of -moz-orient values. r=roc (7d8a90f9d)
- Bug 1028716 - Reftests for <progress> and <meter> with various writing-mode and -moz-orient combinations. r=dbaron (3c0b7910b)
- Bug 1028716 - Adjust the OSX fails-if condition for progress-orient-vertical.html to only apply to 10.6. (bd4e1665f)
- Bug 1166584 - Always export HelpersCairo.h. r=jrmuizel (db3c2551f)
This commit is contained in:
2021-01-28 07:46:35 +08:00
parent 38a2cf9203
commit 126891b203
75 changed files with 639 additions and 76 deletions
+1 -1
View File
@@ -24,6 +24,7 @@ EXPORTS.mozilla.gfx += [
'DrawTargetTiled.h',
'Filters.h',
'Helpers.h',
'HelpersCairo.h',
'Logging.h',
'Matrix.h',
'NumericTools.h',
@@ -79,7 +80,6 @@ if CONFIG['MOZ_ENABLE_SKIA']:
'image_operations.cpp', # Uses _USE_MATH_DEFINES
]
EXPORTS.mozilla.gfx += [
'HelpersCairo.h',
'HelpersSkia.h',
]
+5 -9
View File
@@ -1051,7 +1051,8 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
if (nsGkAtoms::textFrame == frameType) {
if (content != aBpd->mPrevContent) {
aBpd->mPrevContent = content;
if (!frame->StyleText()->NewlineIsSignificant(frame)) {
if (!frame->StyleText()->NewlineIsSignificant(
static_cast<nsTextFrame*>(frame))) {
content->AppendTextTo(aBpd->mBuffer);
} else {
/*
@@ -1427,11 +1428,7 @@ nsBidiPresUtils::RepositionRubyFrame(
const LogicalMargin& aBorderPadding)
{
nsIAtom* frameType = aFrame->GetType();
MOZ_ASSERT(frameType == nsGkAtoms::rubyFrame ||
frameType == nsGkAtoms::rubyBaseFrame ||
frameType == nsGkAtoms::rubyTextFrame ||
frameType == nsGkAtoms::rubyBaseContainerFrame ||
frameType == nsGkAtoms::rubyTextContainerFrame);
MOZ_ASSERT(RubyUtils::IsRubyBox(frameType));
nscoord icoord = 0;
WritingMode frameWM = aFrame->GetWritingMode();
@@ -1568,7 +1565,7 @@ nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame,
}
icoord += reverseDir ?
borderPadding.IStart(frameWM) : borderPadding.IEnd(frameWM);
} else if (aFrame->StyleDisplay()->IsRubyDisplayType()) {
} else if (RubyUtils::IsRubyBox(aFrame->GetType())) {
icoord += RepositionRubyFrame(aFrame, aContinuationStates,
aContainerWM, borderPadding);
} else {
@@ -1610,8 +1607,7 @@ nsBidiPresUtils::InitContinuationStates(nsIFrame* aFrame,
state->mFirstVisualFrame = nullptr;
state->mFrameCount = 0;
if (!IsBidiLeaf(aFrame) ||
aFrame->StyleDisplay()->IsRubyDisplayType()) {
if (!IsBidiLeaf(aFrame) || RubyUtils::IsRubyBox(aFrame->GetType())) {
// Continue for child frames
nsIFrame* frame;
for (frame = aFrame->GetFirstPrincipalChild();
+3 -4
View File
@@ -64,6 +64,7 @@
#include "nsBoxLayout.h"
#include "nsFlexContainerFrame.h"
#include "nsGridContainerFrame.h"
#include "RubyUtils.h"
#include "nsRubyFrame.h"
#include "nsRubyBaseFrame.h"
#include "nsRubyBaseContainerFrame.h"
@@ -9325,8 +9326,7 @@ nsCSSFrameConstructor::MaybeRecreateContainerForFrameRemoval(nsIFrame* aFrame,
// Check ruby containers
nsIAtom* parentType = parent->GetType();
if (parentType == nsGkAtoms::rubyFrame ||
parentType == nsGkAtoms::rubyBaseContainerFrame ||
parentType == nsGkAtoms::rubyTextContainerFrame) {
RubyUtils::IsRubyContainerBox(parentType)) {
// In ruby containers, pseudo frames may be created from
// whitespaces or even nothing. There are two cases we actually
// need to handle here, but hard to check exactly:
@@ -12067,8 +12067,7 @@ nsCSSFrameConstructor::WipeContainingBlock(nsFrameConstructorState& aState,
nsIAtom* frameType = aFrame->GetType();
if (IsRubyPseudo(aFrame) ||
frameType == nsGkAtoms::rubyFrame ||
frameType == nsGkAtoms::rubyBaseContainerFrame ||
frameType == nsGkAtoms::rubyTextContainerFrame) {
RubyUtils::IsRubyContainerBox(frameType)) {
// We want to optimize it better, and avoid reframing as much as
// possible. But given the cases above, and the fact that a ruby
// usually won't be very large, it should be fine to reframe it.
+8 -9
View File
@@ -141,7 +141,7 @@ nsMeterFrame::ReflowBarFrame(nsIFrame* aBarFrame,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
bool vertical = StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL;
bool vertical = ResolvedOrientationIsVertical();
WritingMode wm = aBarFrame->GetWritingMode();
LogicalSize availSize = aReflowState.ComputedSize(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
@@ -164,7 +164,7 @@ nsMeterFrame::ReflowBarFrame(nsIFrame* aBarFrame,
size = NSToCoordRound(size * position);
if (!vertical && StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) {
if (!vertical && (wm.IsVertical() ? wm.IsVerticalRL() : !wm.IsBidiLTR())) {
xoffset += aReflowState.ComputedWidth() - size;
}
@@ -236,7 +236,7 @@ nsMeterFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
LogicalSize autoSize(wm);
autoSize.BSize(wm) = autoSize.ISize(wm) = fontMet->Font().size; // 1em
if (StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL) {
if (ResolvedOrientationIsVertical()) {
autoSize.Height(wm) *= 5; // 5em
} else {
autoSize.Width(wm) *= 5; // 5em
@@ -252,15 +252,14 @@ nsMeterFrame::GetMinISize(nsRenderingContext *aRenderingContext)
NS_ENSURE_SUCCESS(
nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet)), 0);
nscoord minWidth = fontMet->Font().size; // 1em
nscoord minISize = fontMet->Font().size; // 1em
if (StyleDisplay()->mOrient == NS_STYLE_ORIENT_AUTO ||
StyleDisplay()->mOrient == NS_STYLE_ORIENT_HORIZONTAL) {
// The orientation is horizontal
minWidth *= 5; // 5em
if (ResolvedOrientationIsVertical() == GetWritingMode().IsVertical()) {
// The orientation is inline
minISize *= 5; // 5em
}
return minWidth;
return minISize;
}
nscoord
+8 -9
View File
@@ -145,7 +145,7 @@ nsProgressFrame::ReflowBarFrame(nsIFrame* aBarFrame,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
bool vertical = StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL;
bool vertical = ResolvedOrientationIsVertical();
WritingMode wm = aBarFrame->GetWritingMode();
LogicalSize availSize = aReflowState.ComputedSize(wm);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
@@ -164,7 +164,7 @@ nsProgressFrame::ReflowBarFrame(nsIFrame* aBarFrame,
size *= position;
}
if (!vertical && StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) {
if (!vertical && (wm.IsVertical() ? wm.IsVerticalRL() : !wm.IsBidiLTR())) {
xoffset += aReflowState.ComputedWidth() - size;
}
@@ -242,7 +242,7 @@ nsProgressFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
NSToCoordRound(StyleFont()->mFont.size *
nsLayoutUtils::FontSizeInflationFor(this)); // 1em
if (StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL) {
if (ResolvedOrientationIsVertical()) {
autoSize.Height(wm) *= 10; // 10em
} else {
autoSize.Width(wm) *= 10; // 10em
@@ -258,15 +258,14 @@ nsProgressFrame::GetMinISize(nsRenderingContext *aRenderingContext)
NS_ENSURE_SUCCESS(
nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet)), 0);
nscoord minWidth = fontMet->Font().size; // 1em
nscoord minISize = fontMet->Font().size; // 1em
if (StyleDisplay()->mOrient == NS_STYLE_ORIENT_AUTO ||
StyleDisplay()->mOrient == NS_STYLE_ORIENT_HORIZONTAL) {
// The orientation is horizontal
minWidth *= 10; // 10em
if (ResolvedOrientationIsVertical() == GetWritingMode().IsVertical()) {
// The orientation is inline
minISize *= 10; // 10em
}
return minWidth;
return minISize;
}
nscoord
+19 -4
View File
@@ -53,13 +53,28 @@ namespace mozilla {
class RubyUtils
{
public:
static inline bool IsRubyContentBox(nsIAtom* aFrameType)
{
return aFrameType == nsGkAtoms::rubyBaseFrame ||
aFrameType == nsGkAtoms::rubyTextFrame;
}
static inline bool IsRubyContainerBox(nsIAtom* aFrameType)
{
return aFrameType == nsGkAtoms::rubyBaseContainerFrame ||
aFrameType == nsGkAtoms::rubyTextContainerFrame;
}
static inline bool IsRubyBox(nsIAtom* aFrameType)
{
return aFrameType == nsGkAtoms::rubyFrame ||
IsRubyContentBox(aFrameType) || IsRubyContainerBox(aFrameType);
}
static inline bool IsExpandableRubyBox(nsIFrame* aFrame)
{
nsIAtom* type = aFrame->GetType();
return type == nsGkAtoms::rubyBaseFrame ||
type == nsGkAtoms::rubyTextFrame ||
type == nsGkAtoms::rubyBaseContainerFrame ||
type == nsGkAtoms::rubyTextContainerFrame;
return IsRubyContentBox(type) || IsRubyContainerBox(type);
}
static void SetReservedISize(nsIFrame* aFrame, nscoord aISize);
+6
View File
@@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<div><span dir="rtl"></span><audio style="display: ruby-base;"></audio></div>
</body>
</html>
@@ -588,6 +588,7 @@ asserts(0-3) load 1134667.html
load 1146103.html
load 1146107.html
load 1146114.html
load 1156222.html
load 1222783.xhtml
load details-display-none-summary-1.html
load details-display-none-summary-2.html
+18
View File
@@ -1674,6 +1674,24 @@ nsContainerFrame::PullNextInFlowChild(ContinuationTraversingState& aState)
return frame;
}
bool
nsContainerFrame::ResolvedOrientationIsVertical()
{
uint8_t orient = StyleDisplay()->mOrient;
switch (orient) {
case NS_STYLE_ORIENT_HORIZONTAL:
return false;
case NS_STYLE_ORIENT_VERTICAL:
return true;
case NS_STYLE_ORIENT_INLINE:
return GetWritingMode().IsVertical();
case NS_STYLE_ORIENT_BLOCK:
return !GetWritingMode().IsVertical();
}
NS_NOTREACHED("unexpected -moz-orient value");
return false;
}
nsOverflowContinuationTracker::nsOverflowContinuationTracker(nsContainerFrame* aFrame,
bool aWalkOOFFrames,
bool aSkipOverflowContainerChildren)
+6
View File
@@ -609,6 +609,12 @@ protected:
// ==========================================================================
// Helper used by Progress and Meter frames. Returns true if the bar should
// be rendered vertically, based on writing-mode and -moz-orient properties.
bool ResolvedOrientationIsVertical();
// ==========================================================================
nsFrameList mFrames;
};
+4 -2
View File
@@ -59,6 +59,7 @@
#include "FrameLayerBuilder.h"
#include "nsBidiPresUtils.h"
#include "RubyUtils.h"
// For triple-click pref
#include "imgIContainer.h"
@@ -485,10 +486,11 @@ IsFontSizeInflationContainer(nsIFrame* aFrame,
}
nsIContent *content = aFrame->GetContent();
nsIAtom* frameType = aFrame->GetType();
bool isInline = (aFrame->GetDisplay() == NS_STYLE_DISPLAY_INLINE ||
aFrame->StyleDisplay()->IsRubyDisplayType() ||
RubyUtils::IsRubyBox(frameType) ||
(aFrame->IsFloating() &&
aFrame->GetType() == nsGkAtoms::letterFrame) ||
frameType == nsGkAtoms::letterFrame) ||
// Given multiple frames for the same node, only the
// outer one should be considered a container.
// (Important, e.g., for nsSelectsAreaFrame.)
+7 -7
View File
@@ -680,7 +680,7 @@ static bool IsSpaceCombiningSequenceTail(const nsTextFragment* aFrag, uint32_t a
// Check whether aPos is a space for CSS 'word-spacing' purposes
static bool
IsCSSWordSpacingSpace(const nsTextFragment* aFrag, uint32_t aPos,
nsIFrame* aFrame, const nsStyleText* aStyleText)
nsTextFrame* aFrame, const nsStyleText* aStyleText)
{
NS_ASSERTION(aPos < aFrag->GetLength(), "No text for IsSpace!");
@@ -1942,7 +1942,7 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer)
textFlags |= GetSpacingFlags(WordSpacing(f));
nsTextFrameUtils::CompressionMode compression =
GetCSSWhitespaceToCompressionMode(f, textStyle);
if ((enabledJustification || f->StyleContext()->ShouldSuppressLineBreak()) &&
if ((enabledJustification || f->ShouldSuppressLineBreak()) &&
!textStyle->WhiteSpaceIsSignificant() && !isSVG) {
textFlags |= gfxTextRunFactory::TEXT_ENABLE_SPACING;
}
@@ -2816,9 +2816,9 @@ static int32_t FindChar(const nsTextFragment* frag,
return -1;
}
static bool IsChineseOrJapanese(nsIFrame* aFrame)
static bool IsChineseOrJapanese(nsTextFrame* aFrame)
{
if (aFrame->StyleContext()->ShouldSuppressLineBreak()) {
if (aFrame->ShouldSuppressLineBreak()) {
// Always treat ruby as CJ language so that those characters can
// be expanded properly even when surrounded by other language.
return true;
@@ -8372,7 +8372,7 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
(GetStateBits() & TEXT_IS_IN_TOKEN_MATHML);
gfxBreakPriority breakPriority = aLineLayout.LastOptionalBreakPriority();
gfxTextRun::SuppressBreak suppressBreak = gfxTextRun::eNoSuppressBreak;
if (StyleContext()->ShouldSuppressLineBreak()) {
if (ShouldSuppressLineBreak()) {
suppressBreak = gfxTextRun::eSuppressAllBreaks;
} else if (!aLineLayout.LineIsBreakable()) {
suppressBreak = gfxTextRun::eSuppressInitialBreak;
@@ -8583,7 +8583,7 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
bool emptyTextAtStartOfLine = atStartOfLine && length == 0;
if (!breakAfter && charsFit == length && !emptyTextAtStartOfLine &&
transformedOffset + transformedLength == mTextRun->GetLength() &&
!StyleContext()->ShouldSuppressLineBreak() &&
!ShouldSuppressLineBreak() &&
(mTextRun->GetFlags() & nsTextFrameUtils::TEXT_HAS_TRAILING_BREAK)) {
// We placed all the text in the textrun and we have a break opportunity at
// the end of the textrun. We need to record it because the following
@@ -8647,7 +8647,7 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
if (!textStyle->WhiteSpaceIsSignificant() &&
(lineContainer->StyleText()->mTextAlign == NS_STYLE_TEXT_ALIGN_JUSTIFY ||
lineContainer->StyleText()->mTextAlignLast == NS_STYLE_TEXT_ALIGN_JUSTIFY ||
StyleContext()->ShouldSuppressLineBreak()) &&
ShouldSuppressLineBreak()) &&
!lineContainer->IsSVGText()) {
AddStateBits(TEXT_JUSTIFICATION_ENABLED);
provider.ComputeJustification(offset, charsFit);
+13
View File
@@ -16,6 +16,7 @@
#include "gfxTextRun.h"
#include "nsDisplayList.h"
#include "JustificationUtils.h"
#include "RubyUtils.h"
// Undo the windows.h damage
#if defined(XP_WIN) && defined(DrawText)
@@ -139,6 +140,18 @@ public:
nsIFrame::eLineParticipant));
}
bool ShouldSuppressLineBreak() const
{
// If the parent frame of the text frame is ruby content box, it must
// suppress line break inside. This check is necessary, because when
// a whitespace is only contained by pseudo ruby frames, its style
// context won't have SuppressLineBreak bit set.
if (mozilla::RubyUtils::IsRubyContentBox(GetParent()->GetType())) {
return true;
}
return StyleContext()->ShouldSuppressLineBreak();
}
virtual void InvalidateFrame(uint32_t aDisplayItemKey = 0) override;
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) override;
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bug 1149009 - Line break suppression on whitespaces wrapped but not contained in ruby boxes</title>
</head>
<body>
<span style="white-space: pre"><rb>a</rb><rb>
</rb><rb>b</rb></span>
</body>
</html>
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bug 1149009 - Line break suppression on whitespaces wrapped but not contained in ruby boxes</title>
</head>
<body>
<span style="white-space: pre"><rb>a</rb>
<rb>b</rb></span>
</body>
</html>
+1
View File
@@ -29,6 +29,7 @@ test-pref(dom.meta-viewport.enabled,true) test-pref(font.size.inflation.emPerLin
== line-break-suppression-1.html line-break-suppression-1-ref.html
== line-break-suppression-2.html line-break-suppression-2-ref.html
== line-break-suppression-3.html line-break-suppression-3-ref.html
== line-break-suppression-4.html line-break-suppression-4-ref.html
== line-height-1.html line-height-1-ref.html
== line-height-2.html line-height-2-ref.html
== line-height-3.html line-height-3-ref.html
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="-moz-orient:block" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="-moz-orient:horizontal" max=100 value=70 dir=rtl>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="-moz-orient:horizontal" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="-moz-orient:inline" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="-moz-orient:vertical" max=100 value=70 dir=rtl>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="-moz-orient:vertical" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="writing-mode:vertical-lr;-moz-orient:block" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="writing-mode:vertical-lr;-moz-orient:horizontal" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="writing-mode:vertical-lr;-moz-orient:inline" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="writing-mode:vertical-lr;-moz-orient:vertical" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="writing-mode:vertical-lr" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="writing-mode:vertical-rl;-moz-orient:block" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="writing-mode:vertical-rl;-moz-orient:horizontal" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="writing-mode:vertical-rl;-moz-orient:inline" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="writing-mode:vertical-rl;-moz-orient:vertical" max=100 value=70>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<meter style="writing-mode:vertical-rl" max=100 value=70>
+19
View File
@@ -25,3 +25,22 @@ include default-style/reftest.list
== block-invalidate.html block-invalidate-ref.html
== in-cells.html in-cells-ref.html
== max-height.html max-height-ref.html
# Tests for block and inline orientation in combination with writing-mode
# XXX Remove default-preferences setting here after bug 1138384 makes
# it the default for all channels
default-preferences pref(layout.css.vertical-text.enabled,true)
!= meter-orient-vertical.html meter-orient-horizontal.html
!= meter-orient-horizontal.html meter-orient-horizontal-rtl.html
== meter-orient-block.html meter-orient-vertical.html
== meter-orient-inline.html meter-orient-horizontal.html
== meter-vlr.html meter-orient-vertical.html
== meter-vlr-orient-block.html meter-orient-horizontal.html
== meter-vlr-orient-inline.html meter-orient-vertical.html
== meter-vlr-orient-horizontal.html meter-orient-horizontal.html
== meter-vlr-orient-vertical.html meter-orient-vertical.html
== meter-vrl.html meter-orient-vertical-rtl.html
== meter-vrl-orient-block.html meter-orient-horizontal-rtl.html
== meter-vrl-orient-inline.html meter-orient-vertical-rtl.html
== meter-vrl-orient-horizontal.html meter-orient-horizontal-rtl.html
== meter-vrl-orient-vertical.html meter-orient-vertical-rtl.html
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="-moz-orient:block" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="-moz-orient:horizontal" max=100 value=0 dir=rtl>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="-moz-orient:horizontal" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="-moz-orient:inline" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="-moz-orient:vertical" max=100 value=0 dir=rtl>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="-moz-orient:vertical" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="writing-mode:vertical-lr;-moz-orient:block" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="writing-mode:vertical-lr;-moz-orient:horizontal" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="writing-mode:vertical-lr;-moz-orient:inline" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="writing-mode:vertical-lr;-moz-orient:vertical" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="writing-mode:vertical-lr" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="writing-mode:vertical-rl;-moz-orient:block" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="writing-mode:vertical-rl;-moz-orient:horizontal" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="writing-mode:vertical-rl;-moz-orient:inline" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="writing-mode:vertical-rl;-moz-orient:vertical" max=100 value=0>
@@ -0,0 +1,3 @@
<!DOCTYPE html>
<html>
<progress style="writing-mode:vertical-rl" max=100 value=0>
@@ -24,3 +24,22 @@ skip-if(B2G||Mulet) == bar-pseudo-element-vertical.html bar-pseudo-element-verti
== block-invalidate.html block-invalidate-ref.html
== in-cells.html in-cells-ref.html
== max-height.html max-height-ref.html
# Tests for block and inline orientation in combination with writing-mode
# XXX Remove default-preferences setting here after bug 1138384 makes
# it the default for all channels
default-preferences pref(layout.css.vertical-text.enabled,true)
!= progress-orient-horizontal.html progress-orient-vertical.html
fails-if(!cocoaWidget||OSX==1010) != progress-orient-vertical.html progress-orient-vertical-rtl.html # only OS X currently has direction-dependent rendering here
== progress-orient-block.html progress-orient-vertical.html
== progress-orient-inline.html progress-orient-horizontal.html
== progress-vlr.html progress-orient-vertical.html
== progress-vlr-orient-block.html progress-orient-horizontal.html
== progress-vlr-orient-inline.html progress-orient-vertical.html
== progress-vlr-orient-horizontal.html progress-orient-horizontal.html
== progress-vlr-orient-vertical.html progress-orient-vertical.html
== progress-vrl.html progress-orient-vertical-rtl.html
== progress-vrl-orient-block.html progress-orient-horizontal-rtl.html
== progress-vrl-orient-inline.html progress-orient-vertical-rtl.html
== progress-vrl-orient-horizontal.html progress-orient-horizontal-rtl.html
== progress-vrl-orient-vertical.html progress-orient-vertical-rtl.html
@@ -44,7 +44,7 @@ include ruby/reftest.list
# include selectors4/reftest.list
# Text Level 3
# include text3/reftest.list
include text3/reftest.list
# Text Decoration Level 3
include text-decor-3/reftest.list
@@ -0,0 +1,6 @@
== text-align-match-parent-01.html text-align-match-parent-ref.html
== text-align-match-parent-02.html text-align-match-parent-ref.html
== text-align-match-parent-03.html text-align-match-parent-ref.html
== text-align-match-parent-04.html text-align-match-parent-ref.html
== text-align-match-parent-root-ltr.html text-align-match-parent-root-ltr-ref.html
== text-align-match-parent-root-rtl.html text-align-match-parent-root-rtl-ref.html
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text: text-align: match-parent</title>
<link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
<link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
<meta name="assert" content="Text checks that an element with
text-align: match-parent inherits its parent's value and calculates
'start' and 'end' with respect to its parent's direction"
<link rel="match" href="text-align-match-parent-ref.html">
<style type="text/css">
div.start { text-align: start; }
div.end { text-align: end; }
div.left { text-align: left; }
div.right { text-align: right; }
div > div { text-align: match-parent; }
</style>
</head>
<body>
<div>Test passes if each line that says "Left" is aligned left and
each line that says "Right" is aligned right</div>
<div class="start" dir="ltr"><div dir="ltr">Left</div></div>
<div class="start" dir="ltr"><div dir="rtl">Left</div></div>
<div class="start" dir="rtl"><div dir="ltr">Right</div></div>
<div class="start" dir="rtl"><div dir="rtl">Right</div></div>
<div class="end" dir="ltr"><div dir="ltr">Right</div></div>
<div class="end" dir="ltr"><div dir="rtl">Right</div></div>
<div class="end" dir="rtl"><div dir="ltr">Left</div></div>
<div class="end" dir="rtl"><div dir="rtl">Left</div></div>
<div class="left" dir="ltr"><div dir="ltr">Left</div></div>
<div class="left" dir="ltr"><div dir="rtl">Left</div></div>
<div class="left" dir="rtl"><div dir="ltr">Left</div></div>
<div class="left" dir="rtl"><div dir="rtl">Left</div></div>
<div class="right" dir="ltr"><div dir="ltr">Right</div></div>
<div class="right" dir="ltr"><div dir="rtl">Right</div></div>
<div class="right" dir="rtl"><div dir="ltr">Right</div></div>
<div class="right" dir="rtl"><div dir="rtl">Right</div></div>
</body>
</html>
@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<title>CSS Text: text-align: match-parent</title>
<link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
<link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
<meta name="flags" content="dom">
<meta name="assert" content="Text checks that an element with
text-align: match-parent still aligns correctly if the parent's
dir attribute is changed">
<link rel="match" href="text-align-match-parent-ref.html">
<style type="text/css">
div.start { text-align: start; }
div.end { text-align: end; }
div.left { text-align: left; }
div.right { text-align: right; }
div > div { text-align: match-parent; }
</style>
<script type="text/javascript">
function changeParentDir()
{
for (parent = 0; parent < 16; ++parent) {
var parentDiv = document.getElementById("d" + parent);
if (parentDiv.dir == "rtl") {
parentDiv.dir = "ltr";
} else {
parentDiv.dir = "rtl";
}
}
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="changeParentDir()">
<div>Test passes if each line that says "Left" is aligned left and
each line that says "Right" is aligned right</div>
<div id="d0" class="start" dir="rtl"><div dir="ltr">Left</div></div>
<div id="d1" class="start" dir="rtl"><div dir="rtl">Left</div></div>
<div id="d2" class="start" dir="ltr"><div dir="ltr">Right</div></div>
<div id="d3" class="start" dir="ltr"><div dir="rtl">Right</div></div>
<div id="d4" class="end" dir="rtl"><div dir="ltr">Right</div></div>
<div id="d5" class="end" dir="rtl"><div dir="rtl">Right</div></div>
<div id="d6" class="end" dir="ltr"><div dir="ltr">Left</div></div>
<div id="d7" class="end" dir="ltr"><div dir="rtl">Left</div></div>
<div id="d8" class="left" dir="rtl"><div dir="ltr">Left</div></div>
<div id="d9" class="left" dir="rtl"><div dir="rtl">Left</div></div>
<div id="d10" class="left" dir="ltr"><div dir="ltr">Left</div></div>
<div id="d11" class="left" dir="ltr"><div dir="rtl">Left</div></div>
<div id="d12" class="right" dir="rtl"><div dir="ltr">Right</div></div>
<div id="d13" class="right" dir="rtl"><div dir="rtl">Right</div></div>
<div id="d14" class="right" dir="ltr"><div dir="ltr">Right</div></div>
<div id="d15" class="right" dir="ltr"><div dir="rtl">Right</div></div>
</body>
</html>
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<title>CSS Text: text-align: match-parent</title>
<link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
<link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
<meta name="flags" content="dom">
<meta name="assert" content="Text checks that an element whose
text-align property is changed to match-parent aligns correctly">
<link rel="match" href="text-align-match-parent-ref.html">
<style type="text/css">
div.start { text-align: start; }
div.end { text-align: end; }
div.left { text-align: left; }
div.right { text-align: right; }
div.center { text-align: center; }
div.match { text-align: match-parent; }
</style>
<script type="text/javascript">
function changeChildAlign()
{
for (child = 0; child < 16; ++child) {
var childDiv = document.getElementById("d" + child);
childDiv.className = "match";
}
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="changeChildAlign()">
<div>Test passes if each line that says "Left" is aligned left and
each line that says "Right" is aligned right</div>
<div class="start" dir="ltr"><div id="d0" class="center" dir="ltr">Left</div></div>
<div class="start" dir="ltr"><div id="d1" class="center" dir="rtl">Left</div></div>
<div class="start" dir="rtl"><div id="d2" class="center" dir="ltr">Right</div></div>
<div class="start" dir="rtl"><div id="d3" class="center" dir="rtl">Right</div></div>
<div class="end" dir="ltr"><div id="d4" class="center" dir="ltr">Right</div></div>
<div class="end" dir="ltr"><div id="d5" class="center" dir="rtl">Right</div></div>
<div class="end" dir="rtl"><div id="d6" class="center" dir="ltr">Left</div></div>
<div class="end" dir="rtl"><div id="d7" class="center" dir="rtl">Left</div></div>
<div class="left" dir="ltr"><div id="d8" class="center" dir="ltr">Left</div></div>
<div class="left" dir="ltr"><div id="d9" class="center" dir="rtl">Left</div></div>
<div class="left" dir="rtl"><div id="d10" class="center" dir="ltr">Left</div></div>
<div class="left" dir="rtl"><div id="d11" class="center" dir="rtl">Left</div></div>
<div class="right" dir="ltr"><div id="d12" class="center" dir="ltr">Right</div></div>
<div class="right" dir="ltr"><div id="d13" class="center" dir="rtl">Right</div></div>
<div class="right" dir="rtl"><div id="d14" class="center" dir="ltr">Right</div></div>
<div class="right" dir="rtl"><div id="d15" class="center" dir="rtl">Right</div></div>
</body>
</html>
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<title>CSS Text: text-align: match-parent</title>
<link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
<link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
<meta name="flags" content="dom">
<meta name="assert" content="Text checks that an element with
text-align: match-parent still aligns correctly if the parent's
width is changed">
<link rel="match" href="text-align-match-parent-ref.html">
<style type="text/css">
div.start { text-align: start; }
div.end { text-align: end; }
div.left { text-align: left; }
div.right { text-align: right; }
div > div { text-align: match-parent; }
</style>
<script type="text/javascript">
function changeParentWidth()
{
for (parent = 0; parent < 16; ++parent) {
var parentDiv = document.getElementById("d" + parent);
parentDiv.style.width = "";
}
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="changeParentWidth()">
<div>Test passes if each line that says "Left" is aligned left and
each line that says "Right" is aligned right</div>
<div id="d0" style="width: 50%;" class="start" dir="ltr"><div dir="ltr">Left</div></div>
<div id="d1" style="width: 50%;" class="start" dir="ltr"><div dir="rtl">Left</div></div>
<div id="d2" style="width: 50%;" class="start" dir="rtl"><div dir="ltr">Right</div></div>
<div id="d3" style="width: 50%;" class="start" dir="rtl"><div dir="rtl">Right</div></div>
<div id="d4" style="width: 50%;" class="end" dir="ltr"><div dir="ltr">Right</div></div>
<div id="d5" style="width: 50%;" class="end" dir="ltr"><div dir="rtl">Right</div></div>
<div id="d6" style="width: 50%;" class="end" dir="rtl"><div dir="ltr">Left</div></div>
<div id="d7" style="width: 50%;" class="end" dir="rtl"><div dir="rtl">Left</div></div>
<div id="d8" style="width: 50%;" class="left" dir="ltr"><div dir="ltr">Left</div></div>
<div id="d9" style="width: 50%;" class="left" dir="ltr"><div dir="rtl">Left</div></div>
<div id="d10" style="width: 50%;" class="left" dir="rtl"><div dir="ltr">Left</div></div>
<div id="d11" style="width: 50%;" class="left" dir="rtl"><div dir="rtl">Left</div></div>
<div id="d12" style="width: 50%;" class="right" dir="ltr"><div dir="ltr">Right</div></div>
<div id="d13" style="width: 50%;" class="right" dir="ltr"><div dir="rtl">Right</div></div>
<div id="d14" style="width: 50%;" class="right" dir="rtl"><div dir="ltr">Right</div></div>
<div id="d15" style="width: 50%;" class="right" dir="rtl"><div dir="rtl">Right</div></div>
</body>
</html>
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
<style type="text/css">
div.left { text-align: left; }
div.right { text-align: right; }
</style>
</head>
<body>
<div>Test passes if each line that says "Left" is aligned left and
each line that says "Right" is aligned right</div>
<div class="left">Left</div>
<div class="left">Left</div>
<div class="right">Right</div>
<div class="right">Right</div>
<div class="right">Right</div>
<div class="right">Right</div>
<div class="left">Left</div>
<div class="left">Left</div>
<div class="left">Left</div>
<div class="left">Left</div>
<div class="left">Left</div>
<div class="left">Left</div>
<div class="right">Right</div>
<div class="right">Right</div>
<div class="right">Right</div>
<div class="right">Right</div>
</body>
</html>
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
<style type="text/css">
html { text-align: start; }
</style>
</head>
<body>
<p>This line should be aligned left</p>
</body>
</html>
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<title>CSS Text: text-align: match-parent</title>
<link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
<link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
<meta name="assert" content="Text checks that
text-align: match-parent on a root element with dir=ltr is
equivalent to text-align: start">
<link rel="match" href="text-align-match-parent-root-ltr-ref.html">
<style type="text/css">
html { text-align: match-parent; }
</style>
</head>
<body>
<p>This line should be aligned left</p>
</body>
</html>
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html dir="rtl">
<head>
<meta charset="utf-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
<style type="text/css">
html { text-align: start; }
</style>
</head>
<body>
<p>This line should be aligned right</p>
</body>
</html>
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html dir="rtl">
<head>
<title>CSS Text: text-align: match-parent</title>
<link rel="author" title="Simon Montagu" href="mailto:smontagu@mozilla.com">
<link rel="help" href="http://www.w3.org/TR/css-text-3/#text-align-property">
<meta name="assert" content="Text checks that
text-align: match-parent on a root element with dir=rtl is
equivalent to text-align: start">
<link rel="match" href="text-align-match-parent-root-rtl-ref.html">
<style type="text/css">
html { text-align: match-parent; }
</style>
</head>
<body>
<p>This line should be aligned right</p>
</body>
</html>
+4 -2
View File
@@ -322,6 +322,7 @@ option {
text-indent: 0;
white-space: nowrap !important;
word-wrap: normal !important;
text-align: match-parent;
}
select > option {
@@ -462,6 +463,7 @@ input[type="file"] {
input[type="file"] > xul|label {
min-inline-size: 12em;
-moz-padding-start: 5px;
text-align: match-parent;
color: inherit;
font-size: inherit;
@@ -496,11 +498,11 @@ input[type="color"]:-moz-system-metric(color-picker-available)::-moz-color-swatc
}
/* Try to make RTL <input type='file'> look nicer. */
/* TODO: use text-align: match-parent when bug 645642 is fixed. */
/* TODO: find a better solution than forcing direction: ltr on all file
input labels and remove this override -- bug 1161482 */
input[type="file"]:-moz-dir(rtl) > xul|label {
-moz-padding-start: 0px;
-moz-padding-end: 5px;
text-align: right;
}
/* radio buttons */
+1
View File
@@ -589,6 +589,7 @@ ol {
li {
display: list-item;
text-align: match-parent;
}
/* nested lists have no top/bottom margins */
+1
View File
@@ -352,6 +352,7 @@ CSS_KEY(manipulation, manipulation)
CSS_KEY(manual, manual)
CSS_KEY(margin-box, margin_box)
CSS_KEY(markers, markers)
CSS_KEY(match-parent, match_parent)
CSS_KEY(matrix, matrix)
CSS_KEY(matrix3d, matrix3d)
CSS_KEY(max-content, max_content)
+3 -1
View File
@@ -1544,9 +1544,10 @@ const KTableValue nsCSSProps::kObjectFitKTable[] = {
};
const KTableValue nsCSSProps::kOrientKTable[] = {
eCSSKeyword_inline, NS_STYLE_ORIENT_INLINE,
eCSSKeyword_block, NS_STYLE_ORIENT_BLOCK,
eCSSKeyword_horizontal, NS_STYLE_ORIENT_HORIZONTAL,
eCSSKeyword_vertical, NS_STYLE_ORIENT_VERTICAL,
eCSSKeyword_auto, NS_STYLE_ORIENT_AUTO,
eCSSKeyword_UNKNOWN, -1
};
@@ -1736,6 +1737,7 @@ KTableValue nsCSSProps::kTextAlignKTable[] = {
eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_DEFAULT,
eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END,
eCSSKeyword_unsafe, NS_STYLE_TEXT_ALIGN_UNSAFE,
eCSSKeyword_match_parent, NS_STYLE_TEXT_ALIGN_MATCH_PARENT,
eCSSKeyword_UNKNOWN,-1
};
+27 -3
View File
@@ -1793,8 +1793,9 @@ CheckTextCallback(const nsRuleData* aRuleData,
{
const nsCSSValue* textAlignValue = aRuleData->ValueForTextAlign();
if (textAlignValue->GetUnit() == eCSSUnit_Enumerated &&
textAlignValue->GetIntValue() ==
NS_STYLE_TEXT_ALIGN_MOZ_CENTER_OR_INHERIT) {
(textAlignValue->GetIntValue() ==
NS_STYLE_TEXT_ALIGN_MOZ_CENTER_OR_INHERIT ||
textAlignValue->GetIntValue() == NS_STYLE_TEXT_ALIGN_MATCH_PARENT)) {
// Promote reset to mixed since we have something that depends on
// the parent.
if (aResult == nsRuleNode::eRulePartialReset)
@@ -4198,6 +4199,29 @@ nsRuleNode::ComputeTextData(void* aStartStruct,
uint8_t parentAlign = parentText->mTextAlign;
text->mTextAlign = (NS_STYLE_TEXT_ALIGN_DEFAULT == parentAlign) ?
NS_STYLE_TEXT_ALIGN_CENTER : parentAlign;
} else if (eCSSUnit_Enumerated == textAlignValue->GetUnit() &&
NS_STYLE_TEXT_ALIGN_MATCH_PARENT ==
textAlignValue->GetIntValue()) {
canStoreInRuleTree = false;
nsStyleContext* parent = aContext->GetParent();
if (parent) {
uint8_t parentAlign = parentText->mTextAlign;
uint8_t parentDirection = parent->StyleVisibility()->mDirection;
switch (parentAlign) {
case NS_STYLE_TEXT_ALIGN_DEFAULT:
text->mTextAlign = parentDirection == NS_STYLE_DIRECTION_RTL ?
NS_STYLE_TEXT_ALIGN_RIGHT : NS_STYLE_TEXT_ALIGN_LEFT;
break;
case NS_STYLE_TEXT_ALIGN_END:
text->mTextAlign = parentDirection == NS_STYLE_DIRECTION_RTL ?
NS_STYLE_TEXT_ALIGN_LEFT : NS_STYLE_TEXT_ALIGN_RIGHT;
break;
default:
text->mTextAlign = parentAlign;
}
}
} else {
if (eCSSUnit_Pair == textAlignValue->GetUnit()) {
// Two values were specified, one must be 'true'.
@@ -5618,7 +5642,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
display->mOrient, canStoreInRuleTree,
SETDSC_ENUMERATED | SETDSC_UNSET_INITIAL,
parentDisplay->mOrient,
NS_STYLE_ORIENT_AUTO, 0, 0, 0, 0);
NS_STYLE_ORIENT_INLINE, 0, 0, 0, 0);
COMPUTE_END_RESET(Display, display)
}
+14 -12
View File
@@ -148,9 +148,10 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
#define NS_STYLE_BOX_ORIENT_VERTICAL 1
// orient
#define NS_STYLE_ORIENT_HORIZONTAL 0
#define NS_STYLE_ORIENT_VERTICAL 1
#define NS_STYLE_ORIENT_AUTO 2
#define NS_STYLE_ORIENT_INLINE 0
#define NS_STYLE_ORIENT_BLOCK 1
#define NS_STYLE_ORIENT_HORIZONTAL 2
#define NS_STYLE_ORIENT_VERTICAL 3
#define NS_RADIUS_FARTHEST_SIDE 0
#define NS_RADIUS_CLOSEST_SIDE 1
@@ -795,6 +796,7 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
// is never present in stylesheets or computed data.
#define NS_STYLE_TEXT_ALIGN_MOZ_CENTER_OR_INHERIT 11
#define NS_STYLE_TEXT_ALIGN_UNSAFE 12
#define NS_STYLE_TEXT_ALIGN_MATCH_PARENT 13
// Note: make sure that the largest NS_STYLE_TEXT_ALIGN_* value is smaller than
// the smallest NS_STYLE_VERTICAL_ALIGN_* value below!
@@ -851,15 +853,15 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
// Note: these values pickup after the text-align values because there
// are a few html cases where an object can have both types of
// alignment applied with a single attribute
#define NS_STYLE_VERTICAL_ALIGN_BASELINE 13
#define NS_STYLE_VERTICAL_ALIGN_SUB 14
#define NS_STYLE_VERTICAL_ALIGN_SUPER 15
#define NS_STYLE_VERTICAL_ALIGN_TOP 16
#define NS_STYLE_VERTICAL_ALIGN_TEXT_TOP 17
#define NS_STYLE_VERTICAL_ALIGN_MIDDLE 18
#define NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM 19
#define NS_STYLE_VERTICAL_ALIGN_BOTTOM 20
#define NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE 21
#define NS_STYLE_VERTICAL_ALIGN_BASELINE 14
#define NS_STYLE_VERTICAL_ALIGN_SUB 15
#define NS_STYLE_VERTICAL_ALIGN_SUPER 16
#define NS_STYLE_VERTICAL_ALIGN_TOP 17
#define NS_STYLE_VERTICAL_ALIGN_TEXT_TOP 18
#define NS_STYLE_VERTICAL_ALIGN_MIDDLE 19
#define NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM 20
#define NS_STYLE_VERTICAL_ALIGN_BOTTOM 21
#define NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE 22
// See nsStyleVisibility
#define NS_STYLE_VISIBILITY_HIDDEN 0
+2
View File
@@ -150,6 +150,8 @@ public:
// as if nowrap is set, <br> is suppressed, and blocks are inlinized.
// This bit is propogated to all children of line partitipants. It is
// currenlty used by ruby to make its content frames unbreakable.
// NOTE: for nsTextFrame, use nsTextFrame::ShouldSuppressLineBreak()
// instead of this method.
bool ShouldSuppressLineBreak() const
{ return !!(mBits & NS_STYLE_SUPPRESS_LINEBREAK); }
+1 -1
View File
@@ -2738,7 +2738,7 @@ nsStyleDisplay::nsStyleDisplay()
mOverflowClipBox = NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX;
mResize = NS_STYLE_RESIZE_NONE;
mOpacity = 1.0f;
mOrient = NS_STYLE_ORIENT_AUTO;
mOrient = NS_STYLE_ORIENT_INLINE;
mMixBlendMode = NS_STYLE_BLEND_NORMAL;
mIsolation = NS_STYLE_ISOLATION_AUTO;
mTouchAction = NS_STYLE_TOUCH_ACTION_AUTO;
+2 -1
View File
@@ -30,6 +30,7 @@
#include "CounterStyleManager.h"
class nsIFrame;
class nsTextFrame;
class nsIURI;
class nsStyleContext;
class imgIContainer;
@@ -1553,7 +1554,7 @@ struct nsStyleText {
// style struct is for. If the frame is for SVG text or inside ruby,
// the return value will be massaged to be something that makes sense
// for those cases.
inline bool NewlineIsSignificant(const nsIFrame* aContextFrame) const;
inline bool NewlineIsSignificant(const nsTextFrame* aContextFrame) const;
inline bool WhiteSpaceCanWrap(const nsIFrame* aContextFrame) const;
inline bool WordCanWrap(const nsIFrame* aContextFrame) const;
};
+3 -2
View File
@@ -14,6 +14,7 @@
#include "nsIFrame.h"
#include "nsStyleStruct.h"
#include "nsIContent.h" // for GetParent()
#include "nsTextFrame.h" // for nsTextFrame::ShouldSuppressLineBreak
inline void
nsStyleImage::SetSubImage(uint8_t aIndex, imgIContainer* aSubImage) const
@@ -57,11 +58,11 @@ nsStyleText::GetTextShadow() const
}
bool
nsStyleText::NewlineIsSignificant(const nsIFrame* aContextFrame) const
nsStyleText::NewlineIsSignificant(const nsTextFrame* aContextFrame) const
{
NS_ASSERTION(aContextFrame->StyleText() == this, "unexpected aContextFrame");
return NewlineIsSignificantStyle() &&
!aContextFrame->StyleContext()->ShouldSuppressLineBreak();
!aContextFrame->ShouldSuppressLineBreak();
}
bool
+3 -3
View File
@@ -3039,8 +3039,8 @@ var gCSSProperties = {
domProp: "MozOrient",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
other_values: [ "horizontal", "vertical" ],
initial_values: [ "inline" ],
other_values: [ "horizontal", "vertical", "block" ],
invalid_values: [ "none" ]
},
"orphans": {
@@ -3314,7 +3314,7 @@ var gCSSProperties = {
type: CSS_TYPE_LONGHAND,
// don't know whether left and right are same as start
initial_values: [ "start" ],
other_values: [ "center", "justify", "end" ],
other_values: [ "center", "justify", "end", "match-parent" ],
invalid_values: [ "true", "true true" ]
},
"-moz-text-align-last": {
+1 -1
View File
@@ -2657,7 +2657,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
}
}
DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame, eventState),
aFrame->StyleDisplay()->mOrient != NS_STYLE_ORIENT_VERTICAL,
!IsVerticalProgress(aFrame),
value, maxValue, aFrame);
break;
}
+1 -1
View File
@@ -609,7 +609,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
EventStates eventStates = GetContentState(stateFrame, aWidgetType);
aGtkWidgetType = IsIndeterminateProgress(stateFrame, eventStates)
? (stateFrame->StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL)
? IsVerticalProgress(stateFrame)
? MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE
: MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE
: MOZ_GTK_PROGRESS_CHUNK;
+16 -3
View File
@@ -557,15 +557,28 @@ nsNativeTheme::IsIndeterminateProgress(nsIFrame* aFrame,
bool
nsNativeTheme::IsVerticalProgress(nsIFrame* aFrame)
{
return aFrame &&
aFrame->StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL;
if (!aFrame) {
return false;
}
return IsVerticalMeter(aFrame);
}
bool
nsNativeTheme::IsVerticalMeter(nsIFrame* aFrame)
{
NS_PRECONDITION(aFrame, "You have to pass a non-null aFrame");
return aFrame->StyleDisplay()->mOrient == NS_STYLE_ORIENT_VERTICAL;
switch (aFrame->StyleDisplay()->mOrient) {
case NS_STYLE_ORIENT_HORIZONTAL:
return false;
case NS_STYLE_ORIENT_VERTICAL:
return true;
case NS_STYLE_ORIENT_INLINE:
return aFrame->GetWritingMode().IsVertical();
case NS_STYLE_ORIENT_BLOCK:
return !aFrame->GetWritingMode().IsVertical();
}
NS_NOTREACHED("unexpected -moz-orient value");
return false;
}
// menupopup: