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

Side by Side Diff: java/org/chromium/distiller/webdocument/ElementAction.java

Issue 1190343004: Process ordered list items as a single WebText (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | javatests/org/chromium/distiller/ContentExtractorTest.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.distiller.webdocument; 5 package org.chromium.distiller.webdocument;
6 6
7 import org.chromium.distiller.DomUtil; 7 import org.chromium.distiller.DomUtil;
8 import org.chromium.distiller.labels.DefaultLabels; 8 import org.chromium.distiller.labels.DefaultLabels;
9 9
10 import com.google.gwt.core.client.JavaScriptObject; 10 import com.google.gwt.core.client.JavaScriptObject;
(...skipping 14 matching lines...) Expand all
25 public static ElementAction getForElement(Element element) { 25 public static ElementAction getForElement(Element element) {
26 Style style = DomUtil.getComputedStyle(element); 26 Style style = DomUtil.getComputedStyle(element);
27 ElementAction action = new ElementAction(); 27 ElementAction action = new ElementAction();
28 switch (style.getDisplay()) { 28 switch (style.getDisplay()) {
29 case "inline": 29 case "inline":
30 break; 30 break;
31 case "inline-block": 31 case "inline-block":
32 case "inline-flex": 32 case "inline-flex":
33 action.changesTagLevel = true; 33 action.changesTagLevel = true;
34 break; 34 break;
35 case "list-item":
36 Element parentElement = element.getParentElement();
37 if (parentElement == null || !parentElement.getTagName().equals( "OL")) {
38 action.flush = true;
39 action.changesTagLevel = true;
40 }
41 break;
35 // See http://www.w3.org/TR/CSS2/tables.html#table-display 42 // See http://www.w3.org/TR/CSS2/tables.html#table-display
36 // and http://www.w3.org/TR/css-flexbox-1/#flex-containers 43 // and http://www.w3.org/TR/css-flexbox-1/#flex-containers
37 // The default case includes the following display types: 44 // The default case includes the following display types:
38 // block 45 // block
39 // list-item 46 // list-item
40 // inline-table 47 // inline-table
41 // table-row 48 // table-row
42 // table-row-group 49 // table-row-group
43 // table-header-group 50 // table-header-group
44 // table-footer-group 51 // table-footer-group
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 action.isAnchor = true; 98 action.isAnchor = true;
92 } 99 }
93 break; 100 break;
94 } 101 }
95 } 102 }
96 return action; 103 return action;
97 } 104 }
98 105
99 private ElementAction() {} 106 private ElementAction() {}
100 } 107 }
OLDNEW
« 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