summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderText.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-12-17 10:00:51 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-17 10:00:51 -0800
commitbc0688665b65cce4fec4a58f289e8fbac55af976 (patch)
tree36882563e661afd21008ad31d761f1e5a170f9eb /WebCore/rendering/RenderText.cpp
parent9443700060dfd3b488a3bdf30cfa547135478a7f (diff)
parentb880d713c04257ca40abfef97c300afdead423b8 (diff)
downloadexternal_webkit-bc0688665b65cce4fec4a58f289e8fbac55af976.zip
external_webkit-bc0688665b65cce4fec4a58f289e8fbac55af976.tar.gz
external_webkit-bc0688665b65cce4fec4a58f289e8fbac55af976.tar.bz2
am b880d713: am 643ca787: Merge webkit.org at r51976 : Initial merge by git.
Merge commit 'b880d713c04257ca40abfef97c300afdead423b8' * commit 'b880d713c04257ca40abfef97c300afdead423b8': Merge webkit.org at r51976 : Initial merge by git.
Diffstat (limited to 'WebCore/rendering/RenderText.cpp')
-rw-r--r--WebCore/rendering/RenderText.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp
index 40c3d75..95aa277 100644
--- a/WebCore/rendering/RenderText.cpp
+++ b/WebCore/rendering/RenderText.cpp
@@ -757,6 +757,17 @@ void RenderText::calcPrefWidths(int leadWidth, HashSet<const SimpleFontData*>& f
setPrefWidthsDirty(false);
}
+bool RenderText::isAllCollapsibleWhitespace()
+{
+ int length = textLength();
+ const UChar* text = characters();
+ for (int i = 0; i < length; i++) {
+ if (!style()->isCollapsibleWhiteSpace(text[i]))
+ return false;
+ }
+ return true;
+}
+
bool RenderText::containsOnlyWhitespace(unsigned from, unsigned len) const
{
unsigned currPos;
@@ -813,7 +824,9 @@ void RenderText::setSelectionState(SelectionState state)
}
}
- containingBlock()->setSelectionState(state);
+ // The returned value can be null in case of an orphaned tree.
+ if (RenderBlock* cb = containingBlock())
+ cb->setSelectionState(state);
}
void RenderText::setTextWithOffset(PassRefPtr<StringImpl> text, unsigned offset, unsigned len, bool force)