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

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

Issue 2020403002: Add support for figure element (Closed) Base URL: https://github.com/chromium/dom-distiller.git@master
Patch Set: wychen's comments addressed Created 4 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
OLDNEW
(Empty)
1 package org.chromium.distiller.webdocument;
2
3 import com.google.gwt.dom.client.Document;
4 import com.google.gwt.dom.client.Element;
5
6 public class WebFigure extends WebImage {
7
8 private String figCaption;
9
10 public WebFigure(Element e, int w, int h, String src, String caption) {
11 super(e, w, h, src);
12 this.figCaption = caption;
13 }
14
15 @Override
16 public String generateOutput(boolean textOnly) {
17 Element fig = Document.get().createElement("FIGURE");
18 fig.setInnerHTML(super.generateOutput(textOnly));
19 if (!figCaption.isEmpty()) {
20 Element cap = Document.get().createElement("FIGCAPTION");
21 cap.setInnerHTML(figCaption);
wychen 2016/05/31 22:14:46 The caption is obtained from innerText, but set as
marcelorcorrea 2016/06/01 18:09:54 Right. We've changed to set text only since accord
22 fig.appendChild(cap);
23 }
24 return fig.getString();
25 }
26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698