Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Unified Diff: trunk/Source/core/rendering/RenderBlock.cpp

Issue 25713009: Revert 158496 "Update the first letter when the first line is ch..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/LayoutTests/fast/css/first-letter-block-change-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/core/rendering/RenderBlock.cpp
===================================================================
--- trunk/Source/core/rendering/RenderBlock.cpp (revision 158773)
+++ trunk/Source/core/rendering/RenderBlock.cpp (working copy)
@@ -28,7 +28,6 @@
#include "core/accessibility/AXObjectCache.h"
#include "core/dom/Document.h"
#include "core/dom/Element.h"
-#include "core/dom/Text.h"
#include "core/events/OverflowEvent.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/editing/Editor.h"
@@ -5814,6 +5813,8 @@
if (style()->styleType() == FIRST_LETTER)
return;
+ // FIXME: We need to destroy the first-letter object if it is no longer the first child. Need to find
+ // an efficient way to check for that situation though before implementing anything.
RenderObject* firstLetterBlock = findFirstLetterBlock(this);
if (!firstLetterBlock)
return;
@@ -5844,24 +5845,9 @@
if (!currChild)
return;
+ // If the child already has style, then it has already been created, so we just want
+ // to update it.
if (currChild->parent()->style()->styleType() == FIRST_LETTER) {
- // Destroy the first-letter object if it is no longer the first child.
- RenderObject* remainingText = currChild->parent()->nextSibling();
- if (remainingText && currChild->node() != remainingText->node()) {
- if (!remainingText->isText() || remainingText->isBR())
- return;
-
- LayoutStateDisabler layoutStateDisabler(view());
-
- if (RenderObject* oldRemainingText = toRenderBoxModelObject(currChild->parent())->firstLetterRemainingText())
joone 2013/10/03 18:25:32 What do you think about changing the code as follo
- toRenderText(oldRemainingText)->setText(toText(oldRemainingText->node())->data().impl());
-
- createFirstLetterRenderer(firstLetterBlock, remainingText);
- return;
- }
-
- // If the child already has style, then it has already been created, so we just want
- // to update it.
updateFirstLetterStyle(firstLetterBlock, currChild);
return;
}
« no previous file with comments | « trunk/LayoutTests/fast/css/first-letter-block-change-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698