зеркало из https://github.com/mozilla/gecko-dev.git
Add a null-check to wallpaper bug 411582. b=411582 r+sr=bzbarsky a=mtschrep
This commit is contained in:
Родитель
4bd37c6d77
Коммит
dab7469f77
|
@ -0,0 +1,6 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"><!-- no body element, intentionally --><div style="display: table-column-group;"/><svg:symbol id="s"/><script>
|
||||
|
||||
document.documentElement.offsetHeight;
|
||||
document.getElementById("s").style.display = "table-column-group";
|
||||
|
||||
</script></html>
|
|
@ -40,3 +40,4 @@ load 399209-1.xhtml
|
|||
load 403249-1.html
|
||||
load 403579-1.html
|
||||
load 404301-1.xhtml
|
||||
load 411582.xhtml
|
||||
|
|
|
@ -2290,37 +2290,39 @@ nsTableFrame::InsertFrames(nsIAtom* aListName,
|
|||
pseudoFrame = pseudoFrame->GetFirstChild(nsnull);
|
||||
}
|
||||
nsCOMPtr<nsIContent> container = content->GetParent();
|
||||
PRInt32 newIndex = container->IndexOf(content);
|
||||
nsIFrame* kidFrame;
|
||||
PRBool isColGroup = (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP ==
|
||||
display->mDisplay);
|
||||
if (isColGroup) {
|
||||
kidFrame = mColGroups.FirstChild();
|
||||
}
|
||||
else {
|
||||
kidFrame = mFrames.FirstChild();
|
||||
}
|
||||
// Important: need to start at a value smaller than all valid indices
|
||||
PRInt32 lastIndex = -1;
|
||||
while (kidFrame) {
|
||||
if (NS_LIKELY(container)) { // XXX need this null-check, see bug 411823.
|
||||
PRInt32 newIndex = container->IndexOf(content);
|
||||
nsIFrame* kidFrame;
|
||||
PRBool isColGroup = (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP ==
|
||||
display->mDisplay);
|
||||
if (isColGroup) {
|
||||
nsTableColGroupType groupType =
|
||||
((nsTableColGroupFrame *)kidFrame)->GetColType();
|
||||
if (eColGroupAnonymousCell == groupType) {
|
||||
continue;
|
||||
kidFrame = mColGroups.FirstChild();
|
||||
}
|
||||
else {
|
||||
kidFrame = mFrames.FirstChild();
|
||||
}
|
||||
// Important: need to start at a value smaller than all valid indices
|
||||
PRInt32 lastIndex = -1;
|
||||
while (kidFrame) {
|
||||
if (isColGroup) {
|
||||
nsTableColGroupType groupType =
|
||||
((nsTableColGroupFrame *)kidFrame)->GetColType();
|
||||
if (eColGroupAnonymousCell == groupType) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
pseudoFrame = kidFrame;
|
||||
while (pseudoFrame && (parentContent ==
|
||||
(content = pseudoFrame->GetContent()))) {
|
||||
pseudoFrame = pseudoFrame->GetFirstChild(nsnull);
|
||||
}
|
||||
PRInt32 index = container->IndexOf(content);
|
||||
if (index > lastIndex && index < newIndex) {
|
||||
lastIndex = index;
|
||||
aPrevFrame = kidFrame;
|
||||
}
|
||||
kidFrame = kidFrame->GetNextSibling();
|
||||
}
|
||||
pseudoFrame = kidFrame;
|
||||
while (pseudoFrame && (parentContent ==
|
||||
(content = pseudoFrame->GetContent()))) {
|
||||
pseudoFrame = pseudoFrame->GetFirstChild(nsnull);
|
||||
}
|
||||
PRInt32 index = container->IndexOf(content);
|
||||
if (index > lastIndex && index < newIndex) {
|
||||
lastIndex = index;
|
||||
aPrevFrame = kidFrame;
|
||||
}
|
||||
kidFrame = kidFrame->GetNextSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче