summaryrefslogtreecommitdiff
path: root/src/Nodes
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2018-10-31 23:33:14 +0000
committerAndres Rey <[email protected]>2018-10-31 23:33:14 +0000
commit4b7c108a76d26b0ebe0dd557805700a2f89109b7 (patch)
tree53d56ef804257bfc25415447c6c0d8bc426fd2b8 /src/Nodes
parent194c3917d5f7780823df2286bfc605ec5900c67a (diff)
Look for classes names when checking visibility
Diffstat (limited to 'src/Nodes')
-rw-r--r--src/Nodes/NodeTrait.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Nodes/NodeTrait.php b/src/Nodes/NodeTrait.php
index e811c12..08aa794 100644
--- a/src/Nodes/NodeTrait.php
+++ b/src/Nodes/NodeTrait.php
@@ -485,12 +485,12 @@ trait NodeTrait
{
/*
* In the original JS project they check if the node has the style display=none, which unfortunately
- * in our case we have no way of knowing that. So we just check for the attribute hidden.
+ * in our case we have no way of knowing that. So we just check for the attribute hidden or "display: none".
*
* Might be a good idea to check for classes or other attributes like 'aria-hidden'
*/
- return !$this->hasAttribute('hidden');
+ return !preg_match('/display:( )?none/', $this->getAttribute('style')) && !$this->hasAttribute('hidden');
}
public function isWhitespace()