Bug 1171419 part 6 - Move nsBlockFrame::AttributeChanged <ol> handling to nsContainerFrame so that it works not just for blocks. r=xidorn

This commit is contained in:
Mats Palmgren 2016-09-01 17:36:22 +02:00
Родитель a09260b96b
Коммит 0d83513904
3 изменённых файлов: 30 добавлений и 15 удалений

Просмотреть файл

@ -2925,22 +2925,10 @@ nsBlockFrame::AttributeChanged(int32_t aNameSpaceID,
{
nsresult rv = nsContainerFrame::AttributeChanged(aNameSpaceID,
aAttribute, aModType);
if (NS_FAILED(rv)) {
return rv;
}
if (nsGkAtoms::start == aAttribute ||
(nsGkAtoms::reversed == aAttribute &&
mContent->IsHTMLElement(nsGkAtoms::ol))) {
// XXX Not sure if this is necessary anymore
if (RenumberLists()) {
PresContext()->PresShell()->
FrameNeedsReflow(this, nsIPresShell::eStyleChange,
NS_FRAME_HAS_DIRTY_CHILDREN);
}
}
else if (nsGkAtoms::value == aAttribute) {
if (nsGkAtoms::value == aAttribute) {
const nsStyleDisplay* styleDisplay = StyleDisplay();
if (NS_STYLE_DISPLAY_LIST_ITEM == styleDisplay->mDisplay) {
// Search for the closest ancestor that's a block frame. We
@ -2961,7 +2949,6 @@ nsBlockFrame::AttributeChanged(int32_t aNameSpaceID,
}
}
}
return rv;
}

Просмотреть файл

@ -1981,6 +1981,30 @@ nsContainerFrame::RenumberChildFrames(int32_t* aOrdinal,
return renumbered;
}
nsresult
nsContainerFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
{
nsresult rv = nsSplittableFrame::AttributeChanged(aNameSpaceID,
aAttribute, aModType);
if (NS_FAILED(rv)) {
return rv;
}
if (nsGkAtoms::start == aAttribute ||
(nsGkAtoms::reversed == aAttribute &&
mContent->IsHTMLElement(nsGkAtoms::ol))) {
// XXX Not sure if this is necessary anymore
if (RenumberLists()) {
PresContext()->PresShell()->
FrameNeedsReflow(this, nsIPresShell::eStyleChange,
NS_FRAME_HAS_DIRTY_CHILDREN);
}
}
return rv;
}
nsOverflowContinuationTracker::nsOverflowContinuationTracker(nsContainerFrame* aFrame,
bool aWalkOOFFrames,
bool aSkipOverflowContainerChildren)

Просмотреть файл

@ -69,7 +69,11 @@ public:
virtual FrameSearchResult PeekOffsetNoAmount(bool aForward, int32_t* aOffset) override;
virtual FrameSearchResult PeekOffsetCharacter(bool aForward, int32_t* aOffset,
bool aRespectClusters = true) override;
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType) override;
#ifdef DEBUG_FRAME_DUMP
void List(FILE* out = stderr, const char* aPrefix = "", uint32_t aFlags = 0) const override;
#endif