Refactor "is attribute allowed"#385
Conversation
|
I have been thinking it might be cleaner to add a new algorithm like is attribute allowed. This might also be useful for whatwg/html#12533, because we could use it like "is attribute allowed |
Done. Please take another look. |
|
Should we move the |
Done. |
|
Sorry, I just realized that this won't really work for my idea of using this for implementing a manual |
|
@otherdaniel Can I help getting this done? |
Please give it another look. Apologies for being a bit late with this. |
| «[|elementName|, |attrName|]» and |attr|'s | ||
| [=get an attribute value|value=] [=string/is=] "`href`" or | ||
| "`xlink:href`", then [=/remove an attribute|remove=] |attribute|. | ||
| 1. Let |attrName| be a {{SanitizerAttributeNamespace}} with |attribute|'s |
There was a problem hiding this comment.
Let's move this before is attribute allowed, and then call it with |attrName|.
There was a problem hiding this comment.
Done. (Also calling it with |elementName| for consistency.)
There was a problem hiding this comment.
The error in the preview script seems unrelated to this change. If I've traced it correctly, bikeshed seems to expect boilerplate files in bikeshed/spec-data/boilerplate, but they're actually installed in bikeshed/spec-data/readonly/boilerplate. No idea why...
…, rather then DOM nodes.
| 1. Otherwise: | ||
| 1. If |elementWithLocalAttributes|["{{SanitizerElementNamespaceWithAttributes/attributes}}"] | ||
| [=map/exists=] and |elementWithLocalAttributes|["{{SanitizerElementNamespaceWithAttributes/attributes}}"] does not [=SanitizerConfig/contain=] |attrName|: | ||
| 1. Return [=/blocked=]. |
There was a problem hiding this comment.
You seem to have dropped the check for SanitizerConfig/removeAttributes?
There was a problem hiding this comment.
You're right! Should now be fixed.
|
@noamr fyi for upstreaming |
|
Since this is editorial perhaps upstreaming this change can be a follow up? It's getting difficult to keep track of the giant upstreaming PR |
…milio Implements WICG/sanitizer-api#385 Differential Revision: https://phabricator.services.mozilla.com/D301303
…milio Implements WICG/sanitizer-api#385 Differential Revision: https://phabricator.services.mozilla.com/D301303 UltraBlame original commit: 30574364f047793f130880bf86201326e0da72c6
…milio Implements WICG/sanitizer-api#385 Differential Revision: https://phabricator.services.mozilla.com/D301303 UltraBlame original commit: 30574364f047793f130880bf86201326e0da72c6
…milio Implements WICG/sanitizer-api#385 Differential Revision: https://phabricator.services.mozilla.com/D301303 UltraBlame original commit: 30574364f047793f130880bf86201326e0da72c6
Split the dreaded multi-line condition into several subclauses, assign each to an appropriately named boolean, and then test those bools.
That's more verbose than I usually go for, but it's surely more readable than the old version.
Fix: #380
Preview | Diff