Live CSS: Show the Matched CSS header even if no rules match

This commit is contained in:
Kovid Goyal 2014-08-02 09:48:58 +05:30
parent 0e3460d709
commit b58cd915f6
2 changed files with 2 additions and 1 deletions

Binary file not shown.

View File

@ -344,7 +344,8 @@ class PreviewIntegration
is_ancestor = false
while target and target.ownerDocument
css = get_matched_css(target, is_ancestor, all_properties)
if css.length > 0
# We want to show the Matched CSS rules header even if no rules matched
if css.length > 0 or not is_ancestor
ans['nodes'].push({'name':target.tagName?.toLowerCase(), 'css':css, 'is_ancestor':is_ancestor, 'sourceline':target.getAttribute('data-lnum')})
target = target.parentNode
is_ancestor = true