Skip to content

Commit

Permalink
templates for hasHoverStyle
Browse files Browse the repository at this point in the history
Relevant to gngrOrg#89
  • Loading branch information
hrj committed Jan 24, 2015
1 parent 32623b7 commit 29d71e9
Showing 1 changed file with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,52 @@ private void invalidateDescendentsForHoverImpl(final HTMLElementImpl ancestor) {
}
}

//TODO: need to optimize it by checking if there is hover style for the given element
// TODO: request this feature from upstream
private static boolean isSameNodeData(final NodeData a, final NodeData b) {
final Collection<String> aProps = a.getPropertyNames();
final Collection<String> bProps = b.getPropertyNames();
if (aProps.size() == bProps.size()) {
for (final String ap : aProps) {
final Term<?> aVal = a.getValue(ap, true);
final Term<?> bVal = b.getValue(ap, true);
if (aVal != null) {
if (!aVal.equals(bVal)) {
return false;
}
}
final CSSProperty aProp = a.getProperty(ap);
final CSSProperty bProp = b.getProperty(ap);
if (!aProp.equals(bProp)) {
return false;
}
}
return true;
}
return false;
}

//TODO: GH #89 need to optimize it by checking if there is hover style for the given element
private boolean hasHoverStyle() {
return true;
/*
final NodeData newNodeData = getNodeData(null);
if (currentStyle != null) {
return !isSameNodeData(newNodeData, currentStyle.getNodeData());
} else {
return newNodeData == null;
}*/
}

//TODO: need to optimize it by checking if there is hover style for the given element
//TODO: GH #89 need to optimize it by checking if there is hover style for the given element
private boolean hasHoverStyle(final HTMLElementImpl ancestor) {
return true;
/*
final NodeData newNodeData = getNodeData(null);
if (currentStyle != null) {
return !isSameNodeData(newNodeData, currentStyle.getNodeData());
} else {
return newNodeData == null;
}*/
}

/**
Expand Down

0 comments on commit 29d71e9

Please sign in to comment.