Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Setting textContent can leave dir=auto content in wrong directionality
https://bugs.webkit.org/show_bug.cgi?id=244446 Reviewed by Darin Adler. This patch addresses three different bugs leading to the directionality of text not getting reset when setting textContent: 1. setHasDirAutoFlagRecursively skips any element with dir content attribute regardless of whether the value is valid or not. 2. setHasDirAutoFlagRecursively prematurely stops setting SelfOrPrecedingNodesAffectDirAuto flag when it encounters a node with the matching value. This could occur when there is a node between `firstNode` and newly inserted content. 3. HTMLElement::dirAttributeChanged erroneously clears SelfOrPrecedingNodesAffectDirAuto flag when an invalid dir content attribute is specified. In this case, dir content attribute has no effect and the strongly directional content within the element can continue to affect the directionality of the dir=auto element. * Source/WebCore/html/HTMLElement.cpp: (WebCore::isValidDirValue): Moved. (WebCore::elementAffectsDirectionality): Addresses (1). (WebCore::setHasDirAutoFlagRecursively): Addresses (2). (WebCore::HTMLElement::dirAttributeChanged): Addresses (3). Canonical link: https://commits.webkit.org/253881@main
- Loading branch information