mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Merge autoland to mozilla-central a=merge
This commit is contained in:
commit
6866d3a650
@ -577,7 +577,7 @@ support-files = file_bug871161-1.html file_bug871161-2.html
|
|||||||
[test_bug1013316.html]
|
[test_bug1013316.html]
|
||||||
[test_window_open_close.html]
|
[test_window_open_close.html]
|
||||||
tags = openwindow
|
tags = openwindow
|
||||||
skip-if = (toolkit == "android" && debug && !is_fennec) || (webrender && os == "linux") || (os == "windows" && debug && bits == 64) # Bug 1533759
|
skip-if = (toolkit == "android" && debug && !is_fennec) || (webrender && os == "linux") || (os == "win" && debug && bits == 64) # Bug 1533759
|
||||||
[test_viewport_resize.html]
|
[test_viewport_resize.html]
|
||||||
[test_image_clone_load.html]
|
[test_image_clone_load.html]
|
||||||
[test_bug1203668.html]
|
[test_bug1203668.html]
|
||||||
|
@ -42,3 +42,7 @@ CompositorAnimationWarningHasRenderingObserver=Animation cannot be run on the co
|
|||||||
|
|
||||||
## LOCALIZATION NOTE: Do not translate zoom, calc(), "transform", "transform-origin: 0 0"
|
## LOCALIZATION NOTE: Do not translate zoom, calc(), "transform", "transform-origin: 0 0"
|
||||||
ZoomPropertyWarning=This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”.
|
ZoomPropertyWarning=This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”.
|
||||||
|
|
||||||
|
## LOCALIZATION NOTE(PrincipalWritingModePropagationWarning):
|
||||||
|
## Do not translate <html>, <body>, CSS, "writing-mode", "direction", "text-orientation", :root, and "The Principal Writing Mode" because they are technical terms.
|
||||||
|
PrincipalWritingModePropagationWarning=When rendering the <html> element, the used values of CSS properties “writing-mode”, “direction”, and “text-orientation” on the <html> element are taken from the computed values of the <body> element, not from the <html> element’s own values. Consider setting these properties on the :root CSS pseudo-class. For more information see “The Principal Writing Mode” in https://www.w3.org/TR/css-writing-modes-3/#principal-flow
|
||||||
|
@ -2333,8 +2333,17 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame(
|
|||||||
Element* body = mDocument->GetBodyElement();
|
Element* body = mDocument->GetBodyElement();
|
||||||
if (body) {
|
if (body) {
|
||||||
RefPtr<ComputedStyle> bodyStyle = ResolveComputedStyle(body);
|
RefPtr<ComputedStyle> bodyStyle = ResolveComputedStyle(body);
|
||||||
|
WritingMode bodyWM(bodyStyle);
|
||||||
|
|
||||||
|
if (bodyWM != mDocElementContainingBlock->GetWritingMode()) {
|
||||||
|
nsContentUtils::ReportToConsole(
|
||||||
|
nsIScriptError::warningFlag, NS_LITERAL_CSTRING("Layout"),
|
||||||
|
mDocument, nsContentUtils::eLAYOUT_PROPERTIES,
|
||||||
|
"PrincipalWritingModePropagationWarning");
|
||||||
|
}
|
||||||
|
|
||||||
mDocElementContainingBlock->PropagateWritingModeToSelfAndAncestors(
|
mDocElementContainingBlock->PropagateWritingModeToSelfAndAncestors(
|
||||||
WritingMode(bodyStyle));
|
bodyWM);
|
||||||
} else {
|
} else {
|
||||||
mDocElementContainingBlock->PropagateWritingModeToSelfAndAncestors(
|
mDocElementContainingBlock->PropagateWritingModeToSelfAndAncestors(
|
||||||
mDocElementContainingBlock->GetWritingMode());
|
mDocElementContainingBlock->GetWritingMode());
|
||||||
|
@ -719,9 +719,16 @@ nscoord nsComboboxControlFrame::GetIntrinsicISize(
|
|||||||
|
|
||||||
const bool isContainSize = StyleDisplay()->IsContainSize();
|
const bool isContainSize = StyleDisplay()->IsContainSize();
|
||||||
nscoord displayISize = 0;
|
nscoord displayISize = 0;
|
||||||
if (MOZ_LIKELY(mDisplayFrame) && !isContainSize) {
|
if (MOZ_LIKELY(mDisplayFrame)) {
|
||||||
displayISize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
if (isContainSize) {
|
||||||
mDisplayFrame, aType);
|
// Note: the "h" in "hPadding" here really means "inline-axis".
|
||||||
|
// Its struct uses "h" prefixes for historical reasons, but they're all
|
||||||
|
// for the inline-axis, not (necessarily) the horizontal axis.
|
||||||
|
displayISize = mDisplayFrame->IntrinsicISizeOffsets().hPadding;
|
||||||
|
} else {
|
||||||
|
displayISize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||||
|
mDisplayFrame, aType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mDropdownFrame) {
|
if (mDropdownFrame) {
|
||||||
@ -988,9 +995,16 @@ void nsComboboxControlFrame::HandleRedisplayTextEvent() {
|
|||||||
void nsComboboxControlFrame::ActuallyDisplayText(bool aNotify) {
|
void nsComboboxControlFrame::ActuallyDisplayText(bool aNotify) {
|
||||||
RefPtr<nsTextNode> displayContent = mDisplayContent;
|
RefPtr<nsTextNode> displayContent = mDisplayContent;
|
||||||
if (mDisplayedOptionTextOrPreview.IsEmpty()) {
|
if (mDisplayedOptionTextOrPreview.IsEmpty()) {
|
||||||
// Have to use a non-breaking space for line-block-size calculations
|
// Have to use a space character of some sort for line-block-size
|
||||||
// to be right
|
// calculations to be right. Also, the space character must be zero-width
|
||||||
static const char16_t space = 0xA0;
|
// in order for the the inline-size calculations to be consistent between
|
||||||
|
// size-contained comboboxes vs. empty comboboxes.
|
||||||
|
//
|
||||||
|
// XXXdholbert Does this space need to be "non-breaking"? I'm not sure
|
||||||
|
// if it matters, but we previously had a comment here (added in 2002)
|
||||||
|
// saying "Have to use a non-breaking space for line-height calculations
|
||||||
|
// to be right". So I'll stick with a non-breaking space for now...
|
||||||
|
static const char16_t space = 0xFEFF;
|
||||||
displayContent->SetText(&space, 1, aNotify);
|
displayContent->SetText(&space, 1, aNotify);
|
||||||
} else {
|
} else {
|
||||||
displayContent->SetText(mDisplayedOptionTextOrPreview, aNotify);
|
displayContent->SetText(mDisplayedOptionTextOrPreview, aNotify);
|
||||||
|
@ -7521,7 +7521,8 @@ void nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
0, col, std::move(colTrackPositions), std::move(colTrackSizes),
|
0, col, std::move(colTrackPositions), std::move(colTrackSizes),
|
||||||
std::move(colTrackStates), std::move(colRemovedRepeatTracks),
|
std::move(colTrackStates), std::move(colRemovedRepeatTracks),
|
||||||
gridReflowInput.mColFunctions.mRepeatAutoStart,
|
gridReflowInput.mColFunctions.mRepeatAutoStart,
|
||||||
colLineNameMap.GetResolvedLineNamesForComputedGridTrackInfo());
|
colLineNameMap.GetResolvedLineNamesForComputedGridTrackInfo(),
|
||||||
|
IsSubgrid(eLogicalAxisInline));
|
||||||
SetProperty(GridColTrackInfo(), colInfo);
|
SetProperty(GridColTrackInfo(), colInfo);
|
||||||
|
|
||||||
const auto* subgridRowRange = subgrid && IsSubgrid(eLogicalAxisBlock)
|
const auto* subgridRowRange = subgrid && IsSubgrid(eLogicalAxisBlock)
|
||||||
@ -7561,7 +7562,8 @@ void nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
std::move(rowTrackSizes), std::move(rowTrackStates),
|
std::move(rowTrackSizes), std::move(rowTrackStates),
|
||||||
std::move(rowRemovedRepeatTracks),
|
std::move(rowRemovedRepeatTracks),
|
||||||
gridReflowInput.mRowFunctions.mRepeatAutoStart,
|
gridReflowInput.mRowFunctions.mRepeatAutoStart,
|
||||||
rowLineNameMap.GetResolvedLineNamesForComputedGridTrackInfo());
|
rowLineNameMap.GetResolvedLineNamesForComputedGridTrackInfo(),
|
||||||
|
IsSubgrid(eLogicalAxisBlock));
|
||||||
SetProperty(GridRowTrackInfo(), rowInfo);
|
SetProperty(GridRowTrackInfo(), rowInfo);
|
||||||
|
|
||||||
if (prevInFlow) {
|
if (prevInFlow) {
|
||||||
@ -7590,7 +7592,8 @@ void nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
|
|||||||
std::move(priorRowInfo->mSizes), std::move(priorRowInfo->mStates),
|
std::move(priorRowInfo->mSizes), std::move(priorRowInfo->mStates),
|
||||||
std::move(priorRowInfo->mRemovedRepeatTracks),
|
std::move(priorRowInfo->mRemovedRepeatTracks),
|
||||||
priorRowInfo->mRepeatFirstTrack,
|
priorRowInfo->mRepeatFirstTrack,
|
||||||
std::move(priorRowInfo->mResolvedLineNames));
|
std::move(priorRowInfo->mResolvedLineNames),
|
||||||
|
priorRowInfo->mIsSubgrid);
|
||||||
prevInFlow->SetProperty(GridRowTrackInfo(), revisedPriorRowInfo);
|
prevInFlow->SetProperty(GridRowTrackInfo(), revisedPriorRowInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,8 @@ struct ComputedGridTrackInfo {
|
|||||||
nsTArray<nscoord>&& aPositions, nsTArray<nscoord>&& aSizes,
|
nsTArray<nscoord>&& aPositions, nsTArray<nscoord>&& aSizes,
|
||||||
nsTArray<uint32_t>&& aStates, nsTArray<bool>&& aRemovedRepeatTracks,
|
nsTArray<uint32_t>&& aStates, nsTArray<bool>&& aRemovedRepeatTracks,
|
||||||
uint32_t aRepeatFirstTrack,
|
uint32_t aRepeatFirstTrack,
|
||||||
nsTArray<nsTArray<StyleCustomIdent>>&& aResolvedLineNames)
|
nsTArray<nsTArray<StyleCustomIdent>>&& aResolvedLineNames,
|
||||||
|
bool aIsSubgrid)
|
||||||
: mNumLeadingImplicitTracks(aNumLeadingImplicitTracks),
|
: mNumLeadingImplicitTracks(aNumLeadingImplicitTracks),
|
||||||
mNumExplicitTracks(aNumExplicitTracks),
|
mNumExplicitTracks(aNumExplicitTracks),
|
||||||
mStartFragmentTrack(aStartFragmentTrack),
|
mStartFragmentTrack(aStartFragmentTrack),
|
||||||
@ -54,8 +55,9 @@ struct ComputedGridTrackInfo {
|
|||||||
mSizes(aSizes),
|
mSizes(aSizes),
|
||||||
mStates(aStates),
|
mStates(aStates),
|
||||||
mRemovedRepeatTracks(aRemovedRepeatTracks),
|
mRemovedRepeatTracks(aRemovedRepeatTracks),
|
||||||
|
mResolvedLineNames(std::move(aResolvedLineNames)),
|
||||||
mRepeatFirstTrack(aRepeatFirstTrack),
|
mRepeatFirstTrack(aRepeatFirstTrack),
|
||||||
mResolvedLineNames(std::move(aResolvedLineNames)) {}
|
mIsSubgrid(aIsSubgrid) {}
|
||||||
uint32_t mNumLeadingImplicitTracks;
|
uint32_t mNumLeadingImplicitTracks;
|
||||||
uint32_t mNumExplicitTracks;
|
uint32_t mNumExplicitTracks;
|
||||||
uint32_t mStartFragmentTrack;
|
uint32_t mStartFragmentTrack;
|
||||||
@ -64,8 +66,9 @@ struct ComputedGridTrackInfo {
|
|||||||
nsTArray<nscoord> mSizes;
|
nsTArray<nscoord> mSizes;
|
||||||
nsTArray<uint32_t> mStates;
|
nsTArray<uint32_t> mStates;
|
||||||
nsTArray<bool> mRemovedRepeatTracks;
|
nsTArray<bool> mRemovedRepeatTracks;
|
||||||
uint32_t mRepeatFirstTrack;
|
|
||||||
nsTArray<nsTArray<StyleCustomIdent>> mResolvedLineNames;
|
nsTArray<nsTArray<StyleCustomIdent>> mResolvedLineNames;
|
||||||
|
uint32_t mRepeatFirstTrack;
|
||||||
|
bool mIsSubgrid;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ComputedGridLineInfo {
|
struct ComputedGridLineInfo {
|
||||||
|
@ -36,7 +36,7 @@ fuzzy-if(webrender&&winWidget,0-24,0-2) == contain-size-inline-flex-001.html con
|
|||||||
== contain-size-multicol-002.html contain-size-multicol-002-ref.html
|
== contain-size-multicol-002.html contain-size-multicol-002-ref.html
|
||||||
== contain-size-multicol-003.html contain-size-multicol-003-ref.html
|
== contain-size-multicol-003.html contain-size-multicol-003-ref.html
|
||||||
fuzzy-if(Android,0-4,0-4) == contain-size-select-elem-001.html contain-size-select-elem-001-ref.html # bug 1480862
|
fuzzy-if(Android,0-4,0-4) == contain-size-select-elem-001.html contain-size-select-elem-001-ref.html # bug 1480862
|
||||||
fails-if(!gtkWidget) == contain-size-select-elem-002.html contain-size-select-elem-002-ref.html # bug 1562057
|
fails-if(Android) == contain-size-select-elem-002.html contain-size-select-elem-002-ref.html # bug 1588212
|
||||||
== contain-size-select-elem-003.html contain-size-select-elem-003-ref.html
|
== contain-size-select-elem-003.html contain-size-select-elem-003-ref.html
|
||||||
== contain-size-select-elem-004.html contain-size-select-elem-004-ref.html
|
== contain-size-select-elem-004.html contain-size-select-elem-004-ref.html
|
||||||
== contain-size-select-elem-005.html contain-size-select-elem-005-ref.html
|
== contain-size-select-elem-005.html contain-size-select-elem-005-ref.html
|
||||||
|
@ -1547,263 +1547,194 @@ already_AddRefed<nsROCSSPrimitiveValue> nsComputedDOMStyle::GetGridTrackSize(
|
|||||||
|
|
||||||
already_AddRefed<CSSValue> nsComputedDOMStyle::GetGridTemplateColumnsRows(
|
already_AddRefed<CSSValue> nsComputedDOMStyle::GetGridTemplateColumnsRows(
|
||||||
const StyleGridTemplateComponent& aTrackList,
|
const StyleGridTemplateComponent& aTrackList,
|
||||||
const ComputedGridTrackInfo* aTrackInfo) {
|
const ComputedGridTrackInfo& aTrackInfo) {
|
||||||
if (aTrackList.IsSubgrid()) {
|
if (aTrackInfo.mIsSubgrid) {
|
||||||
// XXX TODO: add support for repeat(auto-fill) for 'subgrid' (bug 1234311)
|
|
||||||
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
|
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
|
||||||
|
|
||||||
auto& subgrid = *aTrackList.AsSubgrid();
|
|
||||||
|
|
||||||
RefPtr<nsROCSSPrimitiveValue> subgridKeyword = new nsROCSSPrimitiveValue;
|
RefPtr<nsROCSSPrimitiveValue> subgridKeyword = new nsROCSSPrimitiveValue;
|
||||||
subgridKeyword->SetIdent(eCSSKeyword_subgrid);
|
subgridKeyword->SetIdent(eCSSKeyword_subgrid);
|
||||||
valueList->AppendCSSValue(subgridKeyword.forget());
|
valueList->AppendCSSValue(subgridKeyword.forget());
|
||||||
|
for (const auto& lineNames : aTrackInfo.mResolvedLineNames) {
|
||||||
auto names = subgrid.names.AsSpan();
|
AppendGridLineNames(valueList, lineNames, /*aSuppressEmptyList*/ false);
|
||||||
for (auto i : IntegerRange(names.Length())) {
|
}
|
||||||
if (MOZ_UNLIKELY(i == subgrid.fill_idx)) {
|
uint32_t line = aTrackInfo.mResolvedLineNames.Length();
|
||||||
RefPtr<nsROCSSPrimitiveValue> start = new nsROCSSPrimitiveValue;
|
uint32_t lastLine = aTrackInfo.mNumExplicitTracks + 1;
|
||||||
start->SetString(NS_LITERAL_STRING("repeat(auto-fill,"));
|
const Span<const StyleCustomIdent> empty;
|
||||||
valueList->AppendCSSValue(start.forget());
|
for (; line < lastLine; ++line) {
|
||||||
}
|
AppendGridLineNames(valueList, empty, /*aSuppressEmptyList*/ false);
|
||||||
AppendGridLineNames(valueList, names[i].AsSpan(),
|
|
||||||
/*aSuppressEmptyList*/ false);
|
|
||||||
if (MOZ_UNLIKELY(i == subgrid.fill_idx)) {
|
|
||||||
RefPtr<nsROCSSPrimitiveValue> end = new nsROCSSPrimitiveValue;
|
|
||||||
end->SetString(NS_LITERAL_STRING(")"));
|
|
||||||
valueList->AppendCSSValue(end.forget());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return valueList.forget();
|
return valueList.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t numSizes = aTrackInfo.mSizes.Length();
|
||||||
|
if (!numSizes && !aTrackList.HasRepeatAuto()) {
|
||||||
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
|
val->SetIdent(eCSSKeyword_none);
|
||||||
|
return val.forget();
|
||||||
|
}
|
||||||
|
|
||||||
|
// We've done layout on the grid and have resolved the sizes of its tracks,
|
||||||
|
// so we'll return those sizes here. The grid spec says we MAY use
|
||||||
|
// repeat(<positive-integer>, Npx) here for consecutive tracks with the same
|
||||||
|
// size, but that doesn't seem worth doing since even for repeat(auto-*)
|
||||||
|
// the resolved size might differ for the repeated tracks.
|
||||||
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
|
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
|
||||||
if (aTrackInfo) {
|
const nsTArray<nscoord>& trackSizes = aTrackInfo.mSizes;
|
||||||
uint32_t numSizes = aTrackInfo->mSizes.Length();
|
const uint32_t numExplicitTracks = aTrackInfo.mNumExplicitTracks;
|
||||||
if (!numSizes && !aTrackList.HasRepeatAuto()) {
|
const uint32_t numLeadingImplicitTracks =
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
aTrackInfo.mNumLeadingImplicitTracks;
|
||||||
val->SetIdent(eCSSKeyword_none);
|
MOZ_ASSERT(numSizes >= numLeadingImplicitTracks + numExplicitTracks);
|
||||||
return val.forget();
|
|
||||||
|
// Add any leading implicit tracks.
|
||||||
|
for (uint32_t i = 0; i < numLeadingImplicitTracks; ++i) {
|
||||||
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
|
val->SetAppUnits(trackSizes[i]);
|
||||||
|
valueList->AppendCSSValue(val.forget());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Then add any explicit tracks and removed auto-fit tracks.
|
||||||
|
if (numExplicitTracks || aTrackList.HasRepeatAuto()) {
|
||||||
|
uint32_t endOfRepeat = 0; // first index after any repeat() tracks
|
||||||
|
int32_t offsetToLastRepeat = 0;
|
||||||
|
if (aTrackList.HasRepeatAuto()) {
|
||||||
|
// offsetToLastRepeat is -1 if all repeat(auto-fit) tracks are empty
|
||||||
|
offsetToLastRepeat =
|
||||||
|
numExplicitTracks + 1 - aTrackInfo.mResolvedLineNames.Length();
|
||||||
|
endOfRepeat = aTrackInfo.mRepeatFirstTrack + offsetToLastRepeat + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We've done layout on the grid and have resolved the sizes of its tracks,
|
auto* autoRepeatValue = aTrackList.GetRepeatAutoValue();
|
||||||
// so we'll return those sizes here. The grid spec says we MAY use
|
auto beforeAutoRepeat =
|
||||||
// repeat(<positive-integer>, Npx) here for consecutive tracks with the same
|
autoRepeatValue ? autoRepeatValue->line_names.AsSpan()[0].AsSpan()
|
||||||
// size, but that doesn't seem worth doing since even for repeat(auto-*)
|
: Span<StyleCustomIdent>();
|
||||||
// the resolved size might differ for the repeated tracks.
|
auto afterAutoRepeat =
|
||||||
const nsTArray<nscoord>& trackSizes = aTrackInfo->mSizes;
|
autoRepeatValue ? autoRepeatValue->line_names.AsSpan()[1].AsSpan()
|
||||||
const uint32_t numExplicitTracks = aTrackInfo->mNumExplicitTracks;
|
: Span<StyleCustomIdent>();
|
||||||
const uint32_t numLeadingImplicitTracks =
|
uint32_t repeatIndex = 0;
|
||||||
aTrackInfo->mNumLeadingImplicitTracks;
|
uint32_t numRepeatTracks = aTrackInfo.mRemovedRepeatTracks.Length();
|
||||||
MOZ_ASSERT(numSizes >= numLeadingImplicitTracks + numExplicitTracks);
|
enum LinePlacement { LinesPrecede, LinesFollow, LinesBetween };
|
||||||
|
auto AppendRemovedAutoFits =
|
||||||
|
[&aTrackInfo, &valueList, aTrackList, beforeAutoRepeat, afterAutoRepeat,
|
||||||
|
&repeatIndex, numRepeatTracks](LinePlacement aPlacement) {
|
||||||
|
// Add in removed auto-fit tracks and lines here, if necessary
|
||||||
|
bool atLeastOneTrackReported = false;
|
||||||
|
while (repeatIndex < numRepeatTracks &&
|
||||||
|
aTrackInfo.mRemovedRepeatTracks[repeatIndex]) {
|
||||||
|
if ((aPlacement == LinesPrecede) ||
|
||||||
|
((aPlacement == LinesBetween) && atLeastOneTrackReported)) {
|
||||||
|
// Precede it with the lines between repeats.
|
||||||
|
AppendGridLineNames(valueList, afterAutoRepeat, beforeAutoRepeat);
|
||||||
|
}
|
||||||
|
|
||||||
// Add any leading implicit tracks.
|
// Removed 'auto-fit' tracks are reported as 0px.
|
||||||
for (uint32_t i = 0; i < numLeadingImplicitTracks; ++i) {
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
val->SetAppUnits(0);
|
||||||
val->SetAppUnits(trackSizes[i]);
|
valueList->AppendCSSValue(val.forget());
|
||||||
valueList->AppendCSSValue(val.forget());
|
atLeastOneTrackReported = true;
|
||||||
}
|
|
||||||
|
|
||||||
// Then add any explicit tracks and removed auto-fit tracks.
|
if (aPlacement == LinesFollow) {
|
||||||
if (numExplicitTracks || aTrackList.HasRepeatAuto()) {
|
// Follow it with the lines between repeats.
|
||||||
uint32_t endOfRepeat = 0; // first index after any repeat() tracks
|
AppendGridLineNames(valueList, afterAutoRepeat, beforeAutoRepeat);
|
||||||
int32_t offsetToLastRepeat = 0;
|
}
|
||||||
if (aTrackList.HasRepeatAuto()) {
|
repeatIndex++;
|
||||||
// offsetToLastRepeat is -1 if all repeat(auto-fit) tracks are empty
|
|
||||||
offsetToLastRepeat =
|
|
||||||
numExplicitTracks + 1 - aTrackInfo->mResolvedLineNames.Length();
|
|
||||||
endOfRepeat = aTrackInfo->mRepeatFirstTrack + offsetToLastRepeat + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto* autoRepeatValue = aTrackList.GetRepeatAutoValue();
|
|
||||||
auto beforeAutoRepeat =
|
|
||||||
autoRepeatValue ? autoRepeatValue->line_names.AsSpan()[0].AsSpan()
|
|
||||||
: Span<StyleCustomIdent>();
|
|
||||||
auto afterAutoRepeat =
|
|
||||||
autoRepeatValue ? autoRepeatValue->line_names.AsSpan()[1].AsSpan()
|
|
||||||
: Span<StyleCustomIdent>();
|
|
||||||
uint32_t repeatIndex = 0;
|
|
||||||
uint32_t numRepeatTracks = aTrackInfo->mRemovedRepeatTracks.Length();
|
|
||||||
enum LinePlacement { LinesPrecede, LinesFollow, LinesBetween };
|
|
||||||
auto AppendRemovedAutoFits = [aTrackInfo, &valueList, aTrackList,
|
|
||||||
beforeAutoRepeat, afterAutoRepeat,
|
|
||||||
&repeatIndex,
|
|
||||||
numRepeatTracks](LinePlacement aPlacement) {
|
|
||||||
// Add in removed auto-fit tracks and lines here, if necessary
|
|
||||||
bool atLeastOneTrackReported = false;
|
|
||||||
while (repeatIndex < numRepeatTracks &&
|
|
||||||
aTrackInfo->mRemovedRepeatTracks[repeatIndex]) {
|
|
||||||
if ((aPlacement == LinesPrecede) ||
|
|
||||||
((aPlacement == LinesBetween) && atLeastOneTrackReported)) {
|
|
||||||
// Precede it with the lines between repeats.
|
|
||||||
AppendGridLineNames(valueList, afterAutoRepeat, beforeAutoRepeat);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Removed 'auto-fit' tracks are reported as 0px.
|
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
|
||||||
val->SetAppUnits(0);
|
|
||||||
valueList->AppendCSSValue(val.forget());
|
|
||||||
atLeastOneTrackReported = true;
|
|
||||||
|
|
||||||
if (aPlacement == LinesFollow) {
|
|
||||||
// Follow it with the lines between repeats.
|
|
||||||
AppendGridLineNames(valueList, afterAutoRepeat, beforeAutoRepeat);
|
|
||||||
}
|
}
|
||||||
repeatIndex++;
|
repeatIndex++;
|
||||||
}
|
};
|
||||||
repeatIndex++;
|
|
||||||
};
|
|
||||||
|
|
||||||
for (uint32_t i = 0;; i++) {
|
for (uint32_t i = 0;; i++) {
|
||||||
if (aTrackList.HasRepeatAuto()) {
|
if (aTrackList.HasRepeatAuto()) {
|
||||||
if (i == aTrackInfo->mRepeatFirstTrack) {
|
if (i == aTrackInfo.mRepeatFirstTrack) {
|
||||||
const nsTArray<StyleCustomIdent>& lineNames =
|
|
||||||
aTrackInfo->mResolvedLineNames[i];
|
|
||||||
if (i == endOfRepeat) {
|
|
||||||
// All auto-fit tracks are empty, but we report them anyway.
|
|
||||||
AppendGridLineNames(valueList, lineNames);
|
|
||||||
|
|
||||||
AppendRemovedAutoFits(LinesBetween);
|
|
||||||
|
|
||||||
AppendGridLineNames(valueList,
|
|
||||||
aTrackInfo->mResolvedLineNames[i + 1]);
|
|
||||||
} else {
|
|
||||||
AppendGridLineNames(valueList, lineNames);
|
|
||||||
AppendRemovedAutoFits(LinesFollow);
|
|
||||||
}
|
|
||||||
} else if (i == endOfRepeat) {
|
|
||||||
// Before appending the last line, finish off any removed auto-fits.
|
|
||||||
AppendRemovedAutoFits(LinesPrecede);
|
|
||||||
|
|
||||||
const nsTArray<StyleCustomIdent>& lineNames =
|
|
||||||
aTrackInfo
|
|
||||||
->mResolvedLineNames[aTrackInfo->mRepeatFirstTrack + 1];
|
|
||||||
AppendGridLineNames(valueList, lineNames);
|
|
||||||
} else if (i > aTrackInfo->mRepeatFirstTrack && i < endOfRepeat) {
|
|
||||||
AppendGridLineNames(valueList, afterAutoRepeat, beforeAutoRepeat);
|
|
||||||
AppendRemovedAutoFits(LinesFollow);
|
|
||||||
} else {
|
|
||||||
uint32_t j = i > endOfRepeat ? i - offsetToLastRepeat : i;
|
|
||||||
const nsTArray<StyleCustomIdent>& lineNames =
|
|
||||||
aTrackInfo->mResolvedLineNames[j];
|
|
||||||
AppendGridLineNames(valueList, lineNames);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const nsTArray<StyleCustomIdent>& lineNames =
|
const nsTArray<StyleCustomIdent>& lineNames =
|
||||||
aTrackInfo->mResolvedLineNames[i];
|
aTrackInfo.mResolvedLineNames[i];
|
||||||
|
if (i == endOfRepeat) {
|
||||||
|
// All auto-fit tracks are empty, but we report them anyway.
|
||||||
|
AppendGridLineNames(valueList, lineNames);
|
||||||
|
|
||||||
|
AppendRemovedAutoFits(LinesBetween);
|
||||||
|
|
||||||
|
AppendGridLineNames(valueList,
|
||||||
|
aTrackInfo.mResolvedLineNames[i + 1]);
|
||||||
|
} else {
|
||||||
|
AppendGridLineNames(valueList, lineNames);
|
||||||
|
AppendRemovedAutoFits(LinesFollow);
|
||||||
|
}
|
||||||
|
} else if (i == endOfRepeat) {
|
||||||
|
// Before appending the last line, finish off any removed auto-fits.
|
||||||
|
AppendRemovedAutoFits(LinesPrecede);
|
||||||
|
|
||||||
|
const nsTArray<StyleCustomIdent>& lineNames =
|
||||||
|
aTrackInfo.mResolvedLineNames[aTrackInfo.mRepeatFirstTrack + 1];
|
||||||
|
AppendGridLineNames(valueList, lineNames);
|
||||||
|
} else if (i > aTrackInfo.mRepeatFirstTrack && i < endOfRepeat) {
|
||||||
|
AppendGridLineNames(valueList, afterAutoRepeat, beforeAutoRepeat);
|
||||||
|
AppendRemovedAutoFits(LinesFollow);
|
||||||
|
} else {
|
||||||
|
uint32_t j = i > endOfRepeat ? i - offsetToLastRepeat : i;
|
||||||
|
const nsTArray<StyleCustomIdent>& lineNames =
|
||||||
|
aTrackInfo.mResolvedLineNames[j];
|
||||||
AppendGridLineNames(valueList, lineNames);
|
AppendGridLineNames(valueList, lineNames);
|
||||||
}
|
}
|
||||||
if (i == numExplicitTracks) {
|
} else {
|
||||||
break;
|
const nsTArray<StyleCustomIdent>& lineNames =
|
||||||
}
|
aTrackInfo.mResolvedLineNames[i];
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
AppendGridLineNames(valueList, lineNames);
|
||||||
val->SetAppUnits(trackSizes[i + numLeadingImplicitTracks]);
|
|
||||||
valueList->AppendCSSValue(val.forget());
|
|
||||||
}
|
}
|
||||||
}
|
if (i == numExplicitTracks) {
|
||||||
|
|
||||||
// Add any trailing implicit tracks.
|
|
||||||
for (uint32_t i = numLeadingImplicitTracks + numExplicitTracks;
|
|
||||||
i < numSizes; ++i) {
|
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
|
||||||
val->SetAppUnits(trackSizes[i]);
|
|
||||||
valueList->AppendCSSValue(val.forget());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (aTrackList.IsNone()) {
|
|
||||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
|
||||||
val->SetIdent(eCSSKeyword_none);
|
|
||||||
return val.forget();
|
|
||||||
}
|
|
||||||
// We don't have a frame. So, we'll just return a serialization of
|
|
||||||
// the tracks from the style (without resolved sizes).
|
|
||||||
auto& trackList = *aTrackList.AsTrackList();
|
|
||||||
auto nameLists = trackList.line_names.AsSpan();
|
|
||||||
auto values = trackList.values.AsSpan();
|
|
||||||
uint32_t numSizes = values.Length();
|
|
||||||
for (uint32_t i = 0;; i++) {
|
|
||||||
auto names = nameLists[i].AsSpan();
|
|
||||||
if (!names.IsEmpty()) {
|
|
||||||
AppendGridLineNames(valueList, names);
|
|
||||||
}
|
|
||||||
if (i == numSizes) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
auto& value = values[i];
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
if (value.IsTrackRepeat()) {
|
val->SetAppUnits(trackSizes[i + numLeadingImplicitTracks]);
|
||||||
auto& repeat = value.AsTrackRepeat();
|
valueList->AppendCSSValue(val.forget());
|
||||||
nsAutoString string;
|
|
||||||
string.AppendLiteral("repeat(");
|
|
||||||
if (repeat.count.IsNumber()) {
|
|
||||||
nsStyleUtil::AppendCSSNumber(repeat.count.AsNumber(), string);
|
|
||||||
} else if (repeat.count.IsAutoFit()) {
|
|
||||||
string.AppendLiteral("auto-fit");
|
|
||||||
} else {
|
|
||||||
MOZ_ASSERT(repeat.count.IsAutoFill());
|
|
||||||
string.AppendLiteral("auto-fill");
|
|
||||||
}
|
|
||||||
string.AppendLiteral(",");
|
|
||||||
|
|
||||||
auto repeat_names = repeat.line_names.AsSpan();
|
|
||||||
auto repeat_sizes = repeat.track_sizes.AsSpan();
|
|
||||||
MOZ_ASSERT(repeat_names.Length() == repeat_sizes.Length() ||
|
|
||||||
repeat_names.Length() == repeat_sizes.Length() + 1);
|
|
||||||
for (auto i : IntegerRange(repeat_sizes.Length())) {
|
|
||||||
auto names = repeat_names[i];
|
|
||||||
if (!names.IsEmpty()) {
|
|
||||||
string.Append(' ');
|
|
||||||
AppendGridLineNames(string, names.AsSpan(), Brackets::Yes);
|
|
||||||
}
|
|
||||||
string.Append(' ');
|
|
||||||
RefPtr<nsROCSSPrimitiveValue> size =
|
|
||||||
GetGridTrackSize(repeat_sizes[i]);
|
|
||||||
nsAutoString tmp;
|
|
||||||
size->GetCssText(tmp);
|
|
||||||
string.Append(tmp);
|
|
||||||
}
|
|
||||||
if (repeat_names.Length() == repeat_sizes.Length() + 1) {
|
|
||||||
auto lastList = repeat_names[repeat_sizes.Length()].AsSpan();
|
|
||||||
if (!lastList.IsEmpty()) {
|
|
||||||
string.Append(' ');
|
|
||||||
AppendGridLineNames(string, lastList, Brackets::Yes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
string.Append(')');
|
|
||||||
RefPtr<nsROCSSPrimitiveValue> value = new nsROCSSPrimitiveValue;
|
|
||||||
value->SetString(string);
|
|
||||||
valueList->AppendCSSValue(value.forget());
|
|
||||||
} else {
|
|
||||||
valueList->AppendCSSValue(GetGridTrackSize(value.AsTrackSize()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add any trailing implicit tracks.
|
||||||
|
for (uint32_t i = numLeadingImplicitTracks + numExplicitTracks; i < numSizes;
|
||||||
|
++i) {
|
||||||
|
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||||
|
val->SetAppUnits(trackSizes[i]);
|
||||||
|
valueList->AppendCSSValue(val.forget());
|
||||||
|
}
|
||||||
|
|
||||||
return valueList.forget();
|
return valueList.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetGridTemplateColumns() {
|
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetGridTemplateColumns() {
|
||||||
const ComputedGridTrackInfo* info = nullptr;
|
|
||||||
|
|
||||||
nsGridContainerFrame* gridFrame =
|
nsGridContainerFrame* gridFrame =
|
||||||
nsGridContainerFrame::GetGridFrameWithComputedInfo(mInnerFrame);
|
nsGridContainerFrame::GetGridFrameWithComputedInfo(mInnerFrame);
|
||||||
|
if (!gridFrame) {
|
||||||
if (gridFrame) {
|
// The element doesn't have a box - return the computed value.
|
||||||
info = gridFrame->GetComputedTemplateColumns();
|
// https://drafts.csswg.org/css-grid/#resolved-track-list
|
||||||
|
nsAutoString string;
|
||||||
|
Servo_GetPropertyValue(mComputedStyle, eCSSProperty_grid_template_columns,
|
||||||
|
&string);
|
||||||
|
RefPtr<nsROCSSPrimitiveValue> value = new nsROCSSPrimitiveValue;
|
||||||
|
value->SetString(string);
|
||||||
|
return value.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetGridFrameWithComputedInfo() above ensures that this returns non-null:
|
||||||
|
const ComputedGridTrackInfo* info = gridFrame->GetComputedTemplateColumns();
|
||||||
return GetGridTemplateColumnsRows(StylePosition()->mGridTemplateColumns,
|
return GetGridTemplateColumnsRows(StylePosition()->mGridTemplateColumns,
|
||||||
info);
|
*info);
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetGridTemplateRows() {
|
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetGridTemplateRows() {
|
||||||
const ComputedGridTrackInfo* info = nullptr;
|
|
||||||
|
|
||||||
nsGridContainerFrame* gridFrame =
|
nsGridContainerFrame* gridFrame =
|
||||||
nsGridContainerFrame::GetGridFrameWithComputedInfo(mInnerFrame);
|
nsGridContainerFrame::GetGridFrameWithComputedInfo(mInnerFrame);
|
||||||
|
if (!gridFrame) {
|
||||||
if (gridFrame) {
|
// The element doesn't have a box - return the computed value.
|
||||||
info = gridFrame->GetComputedTemplateRows();
|
// https://drafts.csswg.org/css-grid/#resolved-track-list
|
||||||
|
nsAutoString string;
|
||||||
|
Servo_GetPropertyValue(mComputedStyle, eCSSProperty_grid_template_rows,
|
||||||
|
&string);
|
||||||
|
RefPtr<nsROCSSPrimitiveValue> value = new nsROCSSPrimitiveValue;
|
||||||
|
value->SetString(string);
|
||||||
|
return value.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetGridTemplateColumnsRows(StylePosition()->mGridTemplateRows, info);
|
// GetGridFrameWithComputedInfo() above ensures that this returns non-null:
|
||||||
|
const ComputedGridTrackInfo* info = gridFrame->GetComputedTemplateRows();
|
||||||
|
return GetGridTemplateColumnsRows(StylePosition()->mGridTemplateRows, *info);
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetPaddingTop() {
|
already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetPaddingTop() {
|
||||||
|
@ -197,7 +197,7 @@ class nsComputedDOMStyle final : public nsDOMCSSDeclaration,
|
|||||||
const mozilla::StyleTrackBreadth&);
|
const mozilla::StyleTrackBreadth&);
|
||||||
already_AddRefed<CSSValue> GetGridTemplateColumnsRows(
|
already_AddRefed<CSSValue> GetGridTemplateColumnsRows(
|
||||||
const mozilla::StyleGridTemplateComponent& aTrackList,
|
const mozilla::StyleGridTemplateComponent& aTrackList,
|
||||||
const mozilla::ComputedGridTrackInfo* aTrackInfo);
|
const mozilla::ComputedGridTrackInfo& aTrackInfo);
|
||||||
|
|
||||||
bool GetLineHeightCoord(nscoord& aCoord);
|
bool GetLineHeightCoord(nscoord& aCoord);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
[contain-size-select-001.html]
|
[contain-size-select-001.html]
|
||||||
expected: FAIL
|
expected:
|
||||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1562057
|
if os == "android": FAIL
|
||||||
|
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1588212
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
[contain-size-select-002.html]
|
[contain-size-select-002.html]
|
||||||
expected: FAIL
|
expected:
|
||||||
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1562057
|
if os == "android": FAIL
|
||||||
|
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1588212
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[contain-size-select-elem-002.html]
|
[contain-size-select-elem-002.html]
|
||||||
expected:
|
expected:
|
||||||
if os == "linux": PASS
|
if os == "android": FAIL
|
||||||
FAIL
|
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1588212
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
[text-transform.html]
|
|
||||||
expected:
|
|
||||||
if os == "android": FAIL
|
|
@ -38,5 +38,20 @@ x { background: grey; }
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const expectedResults = [
|
||||||
|
"subgrid [] [] [] []",
|
||||||
|
];
|
||||||
|
[...document.querySelectorAll('.subgrid')].forEach(function(subgrid, i) {
|
||||||
|
let actual = window.getComputedStyle(subgrid)['grid-template-columns'];
|
||||||
|
let expected = expectedResults[i];
|
||||||
|
if (actual != expected) {
|
||||||
|
let err = "Unexpected getComputedStyle value for subgrid " + i + " with className '" + subgrid.className + "':" +
|
||||||
|
" Actual: \"" + actual + "\", Expected: \"" + expected + "\"";
|
||||||
|
document.body.appendChild(document.createTextNode(err));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -50,5 +50,20 @@ x { background: grey; }
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const expectedResults = [
|
||||||
|
"subgrid [x] [b] [] [] [b]",
|
||||||
|
];
|
||||||
|
[...document.querySelectorAll('.subgrid')].forEach(function(subgrid, i) {
|
||||||
|
let actual = window.getComputedStyle(subgrid)['grid-template-columns'];
|
||||||
|
let expected = expectedResults[i];
|
||||||
|
if (actual != expected) {
|
||||||
|
let err = "Unexpected getComputedStyle value for subgrid " + i + " with className '" + subgrid.className + "':" +
|
||||||
|
" Actual: \"" + actual + "\", Expected: \"" + expected + "\"";
|
||||||
|
document.body.appendChild(document.createTextNode(err));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -151,5 +151,32 @@ x {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const expectedResults = [
|
||||||
|
"subgrid [] [] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [b] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [b] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [b] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [b] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [b] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [b] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [] [] [] [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [] [] []",
|
||||||
|
];
|
||||||
|
[...document.querySelectorAll('div > div')].forEach(function(subgrid, i) {
|
||||||
|
let actual = window.getComputedStyle(subgrid)['grid-template-columns'];
|
||||||
|
let expected = expectedResults[i];
|
||||||
|
if (actual != expected) {
|
||||||
|
let err = "Unexpected getComputedStyle value for subgrid " + i + " with className '" + subgrid.className + "':" +
|
||||||
|
" Actual: \"" + actual + "\", Expected: \"" + expected + "\"";
|
||||||
|
document.body.appendChild(document.createTextNode(err));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -390,5 +390,44 @@ html,body {
|
|||||||
<div style="grid-column:y -5"></div>
|
<div style="grid-column:y -5"></div>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const expectedResults = [
|
||||||
|
"subgrid [z] [z] [z] [z] [z]",
|
||||||
|
"subgrid [x] [z] [z] [z] [z]",
|
||||||
|
"subgrid [x] [x] [z] [z] [z]",
|
||||||
|
"subgrid [x] [x] [x] [z] [z]",
|
||||||
|
"subgrid [x] [x] [x] [x] [z]",
|
||||||
|
"subgrid [x] [x] [x] [x] [x]",
|
||||||
|
"subgrid [x] [x] [x] [x] [x]",
|
||||||
|
"subgrid [x] [x] [x] [x] [x]",
|
||||||
|
"subgrid [x] [x] [x] [x] [x]",
|
||||||
|
"subgrid [x] [x] [x] [x] [x]",
|
||||||
|
"subgrid [y] [z] [z] [z] [z]",
|
||||||
|
"subgrid [x] [y] [z] [z] [z]",
|
||||||
|
"subgrid [x] [x] [y] [z] [z]",
|
||||||
|
"subgrid [x] [x] [x] [y] [z]",
|
||||||
|
"subgrid [x] [x] [x] [x] [y]",
|
||||||
|
"subgrid [y] [y] [z] [z] [z]",
|
||||||
|
"subgrid [x] [y] [y] [z] [z]",
|
||||||
|
"subgrid [x] [x] [y] [y] [z]",
|
||||||
|
"subgrid [x] [x] [x] [y] [y]",
|
||||||
|
"subgrid [y] [y] [y] [z] [z]",
|
||||||
|
"subgrid [x] [y] [y] [y] [z]",
|
||||||
|
"subgrid [x] [x] [y] [y] [y]",
|
||||||
|
"subgrid [y] [y] [y] [y] [z]",
|
||||||
|
"subgrid [x] [y] [y] [y] [y]",
|
||||||
|
"subgrid [y] [y] [y] [y] [y]",
|
||||||
|
];
|
||||||
|
[...document.querySelectorAll('.subgrid')].forEach(function(subgrid, i) {
|
||||||
|
let actual = window.getComputedStyle(subgrid)['grid-template-columns'];
|
||||||
|
let expected = expectedResults[i];
|
||||||
|
if (actual != expected) {
|
||||||
|
let err = "Unexpected getComputedStyle value for subgrid " + i + " with className '" + subgrid.className + "':" +
|
||||||
|
" Actual: \"" + actual + "\", Expected: \"" + expected + "\"";
|
||||||
|
document.body.appendChild(document.createTextNode(err));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -165,5 +165,40 @@ item {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const expectedResults = [
|
||||||
|
"subgrid [] [] [] [] [x]",
|
||||||
|
"subgrid [] [] [] [] [x]",
|
||||||
|
"subgrid [] [] [] [] []",
|
||||||
|
"subgrid [x] [x] [] [] [x]",
|
||||||
|
"subgrid [x] [x] [] [x] []",
|
||||||
|
"subgrid [x] [x] [x] [x] []",
|
||||||
|
"subgrid [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [x] []",
|
||||||
|
"subgrid [] [] [] [] [x]",
|
||||||
|
"subgrid [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [] []",
|
||||||
|
"subgrid [] [] [] [] [x]",
|
||||||
|
"subgrid [x] [x] [] [] [x]",
|
||||||
|
"subgrid [x] [x] [x] [] []",
|
||||||
|
"subgrid [] [] [] [] [x]",
|
||||||
|
"subgrid [] [] [] [] [x]",
|
||||||
|
"subgrid [] [] [] [] [x]",
|
||||||
|
"subgrid [] [] [] [] [x]",
|
||||||
|
"subgrid [] [] [] [] [x]",
|
||||||
|
"subgrid [] [] [] [] [x]",
|
||||||
|
"subgrid [] [] [] [] []",
|
||||||
|
];
|
||||||
|
[...document.querySelectorAll('.subgrid')].forEach(function(subgrid, i) {
|
||||||
|
let actual = window.getComputedStyle(subgrid)['grid-template-rows'];
|
||||||
|
let expected = expectedResults[i];
|
||||||
|
if (actual != expected) {
|
||||||
|
let err = "Unexpected getComputedStyle value for subgrid " + i + " with className '" + subgrid.className + "':" +
|
||||||
|
" Actual: \"" + actual + "\", Expected: \"" + expected + "\"";
|
||||||
|
document.body.appendChild(document.createTextNode(err));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -0,0 +1,59 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Reference for sizing of select elements, with wide vs. empty option selected</title>
|
||||||
|
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||||
|
<style>
|
||||||
|
select {
|
||||||
|
color: transparent;
|
||||||
|
margin: 1px;
|
||||||
|
}
|
||||||
|
div.customBorder > select {
|
||||||
|
/* This class is to let us test select elements *without* native theming
|
||||||
|
(for browsers that have both native and non-native controls): */
|
||||||
|
border: 3px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- This is the same as above, but now with a custom border on the
|
||||||
|
select elements: -->
|
||||||
|
<div class="customBorder">
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,77 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Test for sizing of select elements, with wide vs. empty option selected</title>
|
||||||
|
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
|
||||||
|
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#list-box">
|
||||||
|
<link rel="match" href="select-sizing-001-ref.html">
|
||||||
|
<style>
|
||||||
|
select {
|
||||||
|
color: transparent;
|
||||||
|
margin: 1px;
|
||||||
|
}
|
||||||
|
div.customBorder > select {
|
||||||
|
/* This class is to let us test select elements *without* native theming
|
||||||
|
(for browsers that have both native and non-native controls): */
|
||||||
|
border: 3px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
<!-- Wide thing is 2nd, and not selected: -->
|
||||||
|
<select>
|
||||||
|
<option></option>
|
||||||
|
<option>some wide option</option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<!-- Wide thing is 2nd, and selected: -->
|
||||||
|
<select>
|
||||||
|
<option></option>
|
||||||
|
<option selected>some wide option</option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<!-- Wide thing is 1st, and selected (implicitly): -->
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
<option></option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<!-- Wide thing is 1st, and not selected: -->
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
<option selected></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- This is the same as above, but now with a custom border on the
|
||||||
|
select elements: -->
|
||||||
|
<div class="customBorder">
|
||||||
|
<!-- Wide thing is 2nd, and not selected: -->
|
||||||
|
<select>
|
||||||
|
<option></option>
|
||||||
|
<option>some wide option</option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<!-- Wide thing is 2nd, and selected: -->
|
||||||
|
<select>
|
||||||
|
<option></option>
|
||||||
|
<option selected>some wide option</option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<!-- Wide thing is 1st, and selected (implicitly): -->
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
<option></option>
|
||||||
|
</select>
|
||||||
|
<br>
|
||||||
|
<!-- Wide thing is 1st, and not selected: -->
|
||||||
|
<select>
|
||||||
|
<option>some wide option</option>
|
||||||
|
<option selected></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -73,7 +73,6 @@ skip-if = headless # Bug 1405872
|
|||||||
skip-if = os == 'android' # bug 1369440
|
skip-if = os == 'android' # bug 1369440
|
||||||
[test_ext_contentscript_cache.html]
|
[test_ext_contentscript_cache.html]
|
||||||
skip-if = (os == 'linux' && debug) || (toolkit == 'android' && debug) # bug 1348241
|
skip-if = (os == 'linux' && debug) || (toolkit == 'android' && debug) # bug 1348241
|
||||||
fail-if = fission
|
|
||||||
[test_ext_contentscript_canvas.html]
|
[test_ext_contentscript_canvas.html]
|
||||||
skip-if =
|
skip-if =
|
||||||
(verify && debug && (os == 'linux')) ||
|
(verify && debug && (os == 'linux')) ||
|
||||||
|
@ -15,11 +15,13 @@
|
|||||||
// This file defines content scripts.
|
// This file defines content scripts.
|
||||||
/* eslint-env mozilla/frame-script */
|
/* eslint-env mozilla/frame-script */
|
||||||
|
|
||||||
|
const BASE = "http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest";
|
||||||
|
|
||||||
add_task(async function test_contentscript_cache() {
|
add_task(async function test_contentscript_cache() {
|
||||||
let extension = ExtensionTestUtils.loadExtension({
|
let extension = ExtensionTestUtils.loadExtension({
|
||||||
manifest: {
|
manifest: {
|
||||||
content_scripts: [{
|
content_scripts: [{
|
||||||
"matches": ["http://example.com/"],
|
"matches": ["http://mochi.test/*/file_sample.html"],
|
||||||
"js": ["content_script.js"],
|
"js": ["content_script.js"],
|
||||||
"run_at": "document_start",
|
"run_at": "document_start",
|
||||||
}],
|
}],
|
||||||
@ -52,7 +54,7 @@ add_task(async function test_contentscript_cache() {
|
|||||||
ext.staticScripts.expiryTimeout = 3000;
|
ext.staticScripts.expiryTimeout = 3000;
|
||||||
is(ext.staticScripts.size, 0, "Should have no cached scripts");
|
is(ext.staticScripts.size, 0, "Should have no cached scripts");
|
||||||
|
|
||||||
let win = window.open("http://example.com/");
|
let win = window.open(`${BASE}/file_sample.html`);
|
||||||
await extension.awaitMessage("content-script-loaded");
|
await extension.awaitMessage("content-script-loaded");
|
||||||
|
|
||||||
if (AppConstants.platform !== "android") {
|
if (AppConstants.platform !== "android") {
|
||||||
@ -91,8 +93,7 @@ add_task(async function test_contentscript_cache() {
|
|||||||
|
|
||||||
win.close();
|
win.close();
|
||||||
|
|
||||||
|
win = window.open(`${BASE}/file_sample.html`);
|
||||||
win = window.open("http://example.com/");
|
|
||||||
await extension.awaitMessage("content-script-loaded");
|
await extension.awaitMessage("content-script-loaded");
|
||||||
|
|
||||||
is(ext.staticScripts.size, 1, "Should have one cached script");
|
is(ext.staticScripts.size, 1, "Should have one cached script");
|
||||||
|
Loading…
Reference in New Issue
Block a user