org.apache.shindig.gadgets.rewrite
Class StyleAdjacencyVisitor

java.lang.Object
  extended by org.apache.shindig.gadgets.rewrite.StyleAdjacencyVisitor
All Implemented Interfaces:
DomWalker.Visitor

public class StyleAdjacencyVisitor
extends Object
implements DomWalker.Visitor

Visitor that pulls all stylesheet nodes in a document to head, in the order they were found in the document. This maintains CSS semantics in all but the most pathological (JS manipulating CSS through stylesheets in an order-dependent way) cases while reducing browser reflows and making CSS concatenated-proxying more likely.

Since:
2.0.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.shindig.gadgets.rewrite.DomWalker.Visitor
DomWalker.Visitor.VisitStatus
 
Constructor Summary
StyleAdjacencyVisitor()
           
 
Method Summary
 boolean revisit(Gadget gadget, List<Node> nodes)
          Revisit a node in the DOM that was marked by the visit(Gadget, Node) as reserved during DOM traversal.
 DomWalker.Visitor.VisitStatus visit(Gadget gadget, Node node)
          Visit a particular Node in the DOM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StyleAdjacencyVisitor

public StyleAdjacencyVisitor()
Method Detail

visit

public DomWalker.Visitor.VisitStatus visit(Gadget gadget,
                                           Node node)
                                    throws RewritingException
Description copied from interface: DomWalker.Visitor
Visit a particular Node in the DOM.

Specified by:
visit in interface DomWalker.Visitor
Parameters:
gadget - Context for the request.
node - Node being visited.
Returns:
Status, see VisitStatus
Throws:
RewritingException

revisit

public boolean revisit(Gadget gadget,
                       List<Node> nodes)
                throws RewritingException
Description copied from interface: DomWalker.Visitor
Revisit a node in the DOM that was marked by the visit(Gadget, Node) as reserved during DOM traversal.

Specified by:
revisit in interface DomWalker.Visitor
Parameters:
gadget - Context for the request.
nodes - Nodes being revisited, previously marked as reserved.
Returns:
True if any node modified, false otherwise.
Throws:
RewritingException


Copyright © 2007-2012. All Rights Reserved.