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

Unified Diff: Source/core/editing/TextIterator.cpp

Issue 757583002: Revert of Use Shadow DOM to display fallback content for images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | « Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp ('k') | Source/core/html/HTMLElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/TextIterator.cpp
diff --git a/Source/core/editing/TextIterator.cpp b/Source/core/editing/TextIterator.cpp
index 0f865c7441888808cf54c4a19b0f253c43b4d142..1d48170e7aa3272f8888b8d105b82f80d9d9a487 100644
--- a/Source/core/editing/TextIterator.cpp
+++ b/Source/core/editing/TextIterator.cpp
@@ -38,8 +38,6 @@
#include "core/editing/htmlediting.h"
#include "core/frame/FrameView.h"
#include "core/html/HTMLElement.h"
-#include "core/html/HTMLImageElement.h"
-#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLTextFormControlElement.h"
#include "core/rendering/InlineTextBox.h"
#include "core/rendering/RenderImage.h"
@@ -472,7 +470,6 @@
|| (m_node && m_node->isHTMLElement()
&& (isHTMLFormControlElement(toHTMLElement(*m_node))
|| isHTMLLegendElement(toHTMLElement(*m_node))
- || isHTMLImageElement(toElement(*m_node))
|| isHTMLMeterElement(toHTMLElement(*m_node))
|| isHTMLProgressElement(toHTMLElement(*m_node)))))) {
handledNode = handleReplacedElement();
@@ -832,8 +829,8 @@
m_positionEndOffset = 1;
m_singleCharacterBuffer = 0;
- if (m_emitsImageAltText) {
- m_text = toHTMLElement(m_node)->altText();
+ if (m_emitsImageAltText && renderer->isImage() && renderer->isRenderImage()) {
+ m_text = toRenderImage(renderer)->altText();
if (!m_text.isEmpty()) {
m_textLength = m_text.length();
m_lastCharacter = m_text[m_textLength - 1];
@@ -1414,7 +1411,7 @@
// FIXME: What about CDATA_SECTION_NODE?
if (renderer->style()->visibility() == VISIBLE && m_offset > 0)
m_handledNode = handleTextNode();
- } else if (renderer && (isHTMLImageElement(toElement(*m_node)) || isHTMLInputElement(toElement(*m_node)) || renderer->isRenderPart())) {
+ } else if (renderer && (renderer->isImage() || renderer->isRenderPart())) {
if (renderer->style()->visibility() == VISIBLE && m_offset > 0)
m_handledNode = handleReplacedElement();
} else {
« no previous file with comments | « Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp ('k') | Source/core/html/HTMLElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698