Changeset 59247 in webkit
- Timestamp:
- May 12, 2010 12:03:58 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r59245 r59247 1 2010-05-12 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Darin Adler. 4 5 https://bugs.webkit.org/show_bug.cgi?id=38891 6 7 First-letter had a number of bugs that were exposed by my attempt to optimize the setting of styles when updating first-letter. 8 The code that drills down to find the first-letter child stopped if it hit an element that didn't need layout. This means it could 9 return random incorrect results (and cause the first-letter object to not be found). 10 11 In addition when the first-letter was floated/positioned, the text child was not correctly returned, but the container itself was 12 returned instead. 13 14 Finally, the updating code was leaving the box that wrapped the first letter text with a stale style. The old code happened to work because 15 it made new styles for the text elements instead of using the enclosing box style. The regression was caused by my change to make the 16 text children simply share style with their parent (thus making the bug that the parent had the wrong style become more prominent). 17 18 No new tests, since there's a timing component to reproducing the issue. 19 20 * rendering/RenderBlock.cpp: 21 (WebCore::RenderBlock::updateFirstLetter): 22 1 23 2010-05-12 Enrica Casucci <enrica@apple.com> 2 24 -
trunk/WebCore/rendering/RenderBlock.cpp
r59245 r59247 4650 4650 // Drill into inlines looking for our first text child. 4651 4651 RenderObject* currChild = firstLetterBlock->firstChild(); 4652 while (currChild && currChild->needsLayout() &&((!currChild->isReplaced() && !currChild->isRenderButton() && !currChild->isMenuList()) || currChild->isFloatingOrPositioned()) && !currChild->isText()) {4652 while (currChild && ((!currChild->isReplaced() && !currChild->isRenderButton() && !currChild->isMenuList()) || currChild->isFloatingOrPositioned()) && !currChild->isText()) { 4653 4653 if (currChild->isFloatingOrPositioned()) { 4654 if (currChild->style()->styleType() == FIRST_LETTER) 4654 if (currChild->style()->styleType() == FIRST_LETTER) { 4655 currChild = currChild->firstChild(); 4655 4656 break; 4657 } 4656 4658 currChild = currChild->nextSibling(); 4657 4659 } else … … 4670 4672 // If the child already has style, then it has already been created, so we just want 4671 4673 // to update it. 4672 if ( currChild->style()->styleType() == FIRST_LETTER) {4674 if (firstLetterContainer->style()->styleType() == FIRST_LETTER) { 4673 4675 RenderStyle* pseudo = firstLetterBlock->getCachedPseudoStyle(FIRST_LETTER, 4674 firstLetterContainer-> firstLineStyle());4675 currChild->setStyle(pseudo);4676 for (RenderObject* genChild = currChild->firstChild(); genChild; genChild = genChild->nextSibling()) {4676 firstLetterContainer->parent()->firstLineStyle()); 4677 firstLetterContainer->setStyle(pseudo); 4678 for (RenderObject* genChild = firstLetterContainer->firstChild(); genChild; genChild = genChild->nextSibling()) { 4677 4679 if (genChild->isText()) 4678 4680 genChild->setStyle(pseudo);
Note: See TracChangeset
for help on using the changeset viewer.