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

Unified Diff: java/org/chromium/distiller/webdocument/ElementAction.java

Issue 1793583002: Handle drop cap letters (Closed) Base URL: git@github.com:chromium/dom-distiller.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | javatests/org/chromium/distiller/ContentExtractorTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: java/org/chromium/distiller/webdocument/ElementAction.java
diff --git a/java/org/chromium/distiller/webdocument/ElementAction.java b/java/org/chromium/distiller/webdocument/ElementAction.java
index 1dbc88baf240b81966e47218812187858c63a1fd..4f46c3c822d845155de0ebd7dc96184eab3a55af 100644
--- a/java/org/chromium/distiller/webdocument/ElementAction.java
+++ b/java/org/chromium/distiller/webdocument/ElementAction.java
@@ -25,6 +25,7 @@ public class ElementAction {
public static ElementAction getForElement(Element element) {
Style style = DomUtil.getComputedStyle(element);
ElementAction action = new ElementAction();
+ String tagName = element.getTagName();
switch (style.getDisplay()) {
case "inline":
break;
@@ -32,10 +33,17 @@ public class ElementAction {
case "inline-flex":
action.changesTagLevel = true;
break;
+ case "block":
mdjones 2016/03/14 16:58:27 Please add a comment outlining that the float prop
wychen 2016/03/15 20:47:59 Done.
+ // Special casing for drop cap letter with "float".
+ // Ref: http://crbug.com/593128
+ if (!"none".equals(style.getProperty("float")) &&
+ "SPAN".equals(tagName)) {
+ break;
+ }
+ // Intentional fall through.
// See http://www.w3.org/TR/CSS2/tables.html#table-display
// and http://www.w3.org/TR/css-flexbox-1/#flex-containers
// The default case includes the following display types:
- // block
// list-item
// inline-table
// table-row
@@ -53,7 +61,6 @@ public class ElementAction {
break;
}
- String tagName = element.getTagName();
if (!"HTML".equals(tagName) && !"BODY".equals(tagName)) {
String className = element.getAttribute("class");
int classCount = DomUtil.getClassList(element).length();
« no previous file with comments | « no previous file | javatests/org/chromium/distiller/ContentExtractorTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698