Skip to content

Commit

Permalink
fix attrib index handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Nov 22, 2024
1 parent e44f628 commit 736d2b8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/org/htmlunit/html/DomAttr.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ public String getTextContent() {
*/
@Override
public void setTextContent(final String textContent) {
final boolean mappedElement =
getOwnerDocument() instanceof HtmlPage
&& (DomElement.NAME_ATTRIBUTE.equals(getName()) || DomElement.ID_ATTRIBUTE.equals(getName()));
if (mappedElement) {
((HtmlPage) getPage()).removeMappedElement(getOwnerElement(), false, false);
}
setValue(textContent);
if (mappedElement) {
((HtmlPage) getPage()).addMappedElement(getOwnerElement(), false);
}
}
}

0 comments on commit 736d2b8

Please sign in to comment.