diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /layout/base/nsCSSFrameConstructor.cpp | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/base/nsCSSFrameConstructor.cpp')
-rw-r--r-- | layout/base/nsCSSFrameConstructor.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index c0f35c278d..ba43eb70b9 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -1537,12 +1537,11 @@ already_AddRefed<nsIContent> nsCSSFrameConstructor::CreateGenConTextNode( void nsCSSFrameConstructor::CreateGeneratedContent( nsFrameConstructorState& aState, Element& aOriginatingElement, - ComputedStyle& aPseudoStyle, uint32_t aContentIndex, - const FunctionRef<void(nsIContent*)> aAddChild) { + ComputedStyle& aPseudoStyle, const StyleContentItem& aItem, + size_t aContentIndex, const FunctionRef<void(nsIContent*)> aAddChild) { using Type = StyleContentItem::Tag; // Get the content value - const auto& item = aPseudoStyle.StyleContent()->ContentAt(aContentIndex); - const Type type = item.tag; + const Type type = aItem.tag; switch (type) { case Type::Image: { @@ -1552,7 +1551,7 @@ void nsCSSFrameConstructor::CreateGeneratedContent( } case Type::String: { - const auto string = item.AsString().AsString(); + const auto string = aItem.AsString().AsString(); if (string.IsEmpty()) { return; } @@ -1563,7 +1562,7 @@ void nsCSSFrameConstructor::CreateGeneratedContent( } case Type::Attr: { - const auto& attr = item.AsAttr(); + const auto& attr = aItem.AsAttr(); RefPtr<nsAtom> attrName = attr.attribute.AsAtom(); int32_t attrNameSpace = kNameSpaceID_None; RefPtr<nsAtom> ns = attr.namespace_url.AsAtom(); @@ -1592,11 +1591,11 @@ void nsCSSFrameConstructor::CreateGeneratedContent( CounterStylePtr ptr; nsString separator; if (type == Type::Counter) { - auto& counter = item.AsCounter(); + auto& counter = aItem.AsCounter(); name = counter._0.AsAtom(); ptr = CounterStylePtr::FromStyle(counter._1); } else { - auto& counters = item.AsCounters(); + auto& counters = aItem.AsCounters(); name = counters._0.AsAtom(); CopyUTF8toUTF16(counters._1.AsString(), separator); ptr = CounterStylePtr::FromStyle(counters._2); @@ -1947,13 +1946,14 @@ void nsCSSFrameConstructor::CreateGeneratedContentItem( mPresShell->StyleSet()->StyleNewSubtree(childElement); } }; - const uint32_t contentCount = pseudoStyle->StyleContent()->ContentCount(); - for (uint32_t contentIndex = 0; contentIndex < contentCount; contentIndex++) { - CreateGeneratedContent(aState, aOriginatingElement, *pseudoStyle, - contentIndex, AppendChild); + auto items = pseudoStyle->StyleContent()->NonAltContentItems(); + size_t index = 0; + for (const auto& item : items) { + CreateGeneratedContent(aState, aOriginatingElement, *pseudoStyle, item, + index++, AppendChild); } // If a ::marker has no 'content' then generate it from its 'list-style-*'. - if (contentCount == 0 && aPseudoElement == PseudoStyleType::marker) { + if (index == 0 && aPseudoElement == PseudoStyleType::marker) { CreateGeneratedContentFromListStyle(aState, aOriginatingElement, *pseudoStyle, AppendChild); } @@ -5283,7 +5283,7 @@ void nsCSSFrameConstructor::AddFrameConstructionItemsInternal( aFlags.contains(ItemFlag::AllowPageBreak) && aState.mPresContext->IsPaginated() && !display.IsAbsolutelyPositionedStyle() && - !(aParentFrame && aParentFrame->IsGridContainerFrame()) && + !(aParentFrame && aParentFrame->IsFlexOrGridContainer()) && !(bits & FCDATA_IS_TABLE_PART) && !(bits & FCDATA_IS_SVG_TEXT); if (canHavePageBreak && display.BreakBefore()) { AppendPageBreakItem(aContent, aItems); |