File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
main/java/org/htmlunit/html
test/java/org/htmlunit/html Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -663,7 +663,10 @@ public <E extends HtmlElement> List<E> getStaticElementsByTagName(final String t
663663 for (final Iterator <HtmlElement > iterator = this .new DescendantHtmlElementsIterator (); iterator .hasNext ();) {
664664 final HtmlElement elem = iterator .next ();
665665 if (elem .getLocalName ().equalsIgnoreCase (tagName )) {
666- res .add ((E ) elem );
666+ final String prefix = elem .getPrefix ();
667+ if (prefix == null || prefix .isEmpty ()) {
668+ res .add ((E ) elem );
669+ }
667670 }
668671 }
669672 return res ;
Original file line number Diff line number Diff line change @@ -687,4 +687,24 @@ public void getElementById_AfterAppendingToNewlyCreatedElement() throws Exceptio
687687 + "</body></html>" ;
688688 loadPageVerifyTitle2 (content );
689689 }
690+
691+ /**
692+ * When looking for the refresh meta tag don't get confused by stuff with a namespace.
693+ * @throws Exception if the test fails
694+ */
695+ @ Test
696+ @ Alerts ("works" )
697+ public void metaWithNamespace () throws Exception {
698+ final String content =
699+ "<html>\n "
700+ + "<head>\n "
701+ + " <title>works\u00a7 </title>\n "
702+ + "</head>\n "
703+ + "<body>\n "
704+ + " <overheidrg:meta xmlns:overheidrg='http://standaarden.overheid.nl/cvdr/terms/'>\n "
705+ + "</body>\n "
706+ + "</html>" ;
707+
708+ loadPageVerifyTitle2 (content );
709+ }
690710}
You can’t perform that action at this time.
0 commit comments