-
Notifications
You must be signed in to change notification settings - Fork 33
Conversation
var globalElement = | ||
(document.body && document.body.hasAttribute('dir')) | ||
? document.body | ||
: document.documentElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is documentElement ever null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it html
? the og comment promised we also look at html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
document.documentElement
is the <HTML>
node and should never be null in any reasonable circumstance AFAIK.
* html elements (measured on document.body or document.documentElement as | ||
* available). | ||
*/ | ||
useGlobalRtlAttribute: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhhh maybe RTL to match __targetIsRT
? 🚲🏡
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you spell that as an attribute for me? :)
|
||
suite('and dir="rtl" on <html>', function() { | ||
setup(function() { | ||
document.documentElement.setAttribute('dir', 'rtl'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe call out html
explicitly? is there a document.html or am i smoking crack?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 definitely crack
Is this considered solving #57? |
RTL detection based on CSS styles in subtrees has timing issues. In some circumstances, the value of the
direction
style property will be empty string while an element is booting up even though it should probably read as"rtl"
.This change proposes a fix where an addition configuration (
use-global-rtl-attribute
) of the iconset tells it to use the value of thedir
attribute on either<body>
or<html>
, whichever is available.Fixes #64