Permalink
Browse files

[CSS] Fix not to render inline-block boxes twice; cf. css-003.html

(StackingContext::addBase) : Fix a bug
testdata/css-003.html : New
  • Loading branch information...
ShikiOkasaka committed May 31, 2013
1 parent 6800297 commit b8607952161fde86e424398c24be902f573b241c
Showing with 34 additions and 3 deletions.
  1. +13 −3 src/css/StackingContext.cpp
  2. +21 −0 testdata/css-003.html
@@ -355,10 +355,20 @@ void StackingContext::renderFloats(ViewCSSImp* view, Box* last, Box* current)
void StackingContext::addBase(Box* box)
{
#ifndef NDEBUG
for (Box* i = firstBase; i; i = i->nextBase)
Box* prev = 0;
for (Box* i = firstBase; i; prev = i, i = i->nextBase) {
assert(box != i);
#endif
if (i->parentBox == box) { // This happens with positioned inline-level boxes
if (prev)
prev->nextBase = box;
else
firstBase = box;
box->nextBase = i->nextBase;
if (lastBase == i)
lastBase = box;
return;
}
}
if (!firstBase)
firstBase = lastBase = box;
else {
View
@@ -0,0 +1,21 @@
<html>
<head>
<style>
#test {
display: inline-block;
overflow: hidden;
position: relative;
}
.float {
float: left;
}
</style>
</head>
<body>
<div class="float">
<div id="test">
<div class="float">PASS</div>
</div>
</div>
</body>
</html>

0 comments on commit b860795

Please sign in to comment.