| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.dom.client.Element; | 7 import com.google.gwt.dom.client.Element; |
| 8 import com.google.gwt.dom.client.Node; | 8 import com.google.gwt.dom.client.Node; |
| 9 | 9 |
| 10 import java.util.ArrayList; | |
| 11 import java.util.List; | 10 import java.util.List; |
| 12 | 11 |
| 13 /** | 12 /** |
| 14 * This provides a way to extract the minimal part of the DOM tree that contains
the provided list | 13 * This provides a way to extract the minimal part of the DOM tree that contains
the provided list |
| 15 * of leaf nodes (the result is still a tree). This is a faster method of genera
ting output than | 14 * of leaf nodes (the result is still a tree). This is a faster method of genera
ting output than |
| 16 * the NodeListExpander. | 15 * the NodeListExpander. |
| 17 */ | 16 */ |
| 18 public class TreeCloneBuilder { | 17 public class TreeCloneBuilder { |
| 19 /** | 18 /** |
| 20 * Clone the provided node and attempt to specify text directionality ("dir"
attribute). | 19 * Clone the provided node and attempt to specify text directionality ("dir"
attribute). |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 n = n.getParentNode(); | 88 n = n.getParentNode(); |
| 90 clone = cloneParent(clone, n); | 89 clone = cloneParent(clone, n); |
| 91 } | 90 } |
| 92 } | 91 } |
| 93 while (clone.getParentNode() != null) { | 92 while (clone.getParentNode() != null) { |
| 94 clone = clone.getParentNode(); | 93 clone = clone.getParentNode(); |
| 95 } | 94 } |
| 96 return clone; | 95 return clone; |
| 97 } | 96 } |
| 98 } | 97 } |
| OLD | NEW |