OLD | NEW |
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; | 5 package org.chromium.distiller; |
6 | 6 |
7 import com.google.gwt.core.client.JsArray; | 7 import com.google.gwt.core.client.JsArray; |
8 import com.google.gwt.dom.client.Document; | 8 import com.google.gwt.dom.client.Document; |
9 import com.google.gwt.dom.client.Element; | 9 import com.google.gwt.dom.client.Element; |
10 import com.google.gwt.dom.client.Node; | 10 import com.google.gwt.dom.client.Node; |
(...skipping 20 matching lines...) Expand all Loading... |
31 mRoot.removeAttribute(attrs.get(i).getNodeName()); | 31 mRoot.removeAttribute(attrs.get(i).getNodeName()); |
32 } | 32 } |
33 NodeList<Node> children = mRoot.getChildNodes(); | 33 NodeList<Node> children = mRoot.getChildNodes(); |
34 for (int i = children.getLength() - 1; i >= 0; i--) { | 34 for (int i = children.getLength() - 1; i >= 0; i--) { |
35 children.getItem(i).removeFromParent(); | 35 children.getItem(i).removeFromParent(); |
36 } | 36 } |
37 mHead = Document.get().createElement("head"); | 37 mHead = Document.get().createElement("head"); |
38 mRoot.appendChild(mHead); | 38 mRoot.appendChild(mHead); |
39 mBody = Document.get().createElement("body"); | 39 mBody = Document.get().createElement("body"); |
40 mRoot.appendChild(mBody); | 40 mRoot.appendChild(mBody); |
| 41 // With this, the width of chrome window won't affect the layout. |
| 42 mRoot.getStyle().setProperty("width", "800px"); |
41 } | 43 } |
42 } | 44 } |
OLD | NEW |