Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow any elements to happen inside NOSCRIPT without triggering bodyInsert. #319

Merged
merged 1 commit into from
Mar 10, 2017

Conversation

kngenie
Copy link
Contributor

@kngenie kngenie commented Jul 14, 2016

This is related to #306. We encountered cases where NOSCRIPT occurs in HEAD and it contains elements as its children that don't usually happen in HEAD directly - IMG, DIV and IFRAME. Even with #307, these child elements trigger bodyInsert and break the layout.

This patch allows arbitrary elements to occur inside NOSCRIPT without triggering bodyInsert.

Original issue item: internetarchive#119

…nsert.

Squashed commit of the following:

commit cd186cd43bd939b7323470c888b025b610d5d4c8
Author: Kenji Nagahashi <kenji@archive.org>
Date:   Fri Feb 26 13:21:37 2016 -0800

    bare minimum change to allow NOSCRIPT inside HEAD to have any child elements without triggering bodyInsert.

commit 02c2d9f33bdee484764348e0b5ede0323272d0f1
Author: Kenji Nagahashi <kenji@archive.org>
Date:   Tue Feb 2 15:00:54 2016 -0800

    Add tests for ARI-4691: allow non-head elements inside NOSCRIPT (tests fail)
@kris-sigur kris-sigur added this to the 2.3.1 Bugfix release milestone Jul 14, 2016
Copy link
Contributor

@runderwood runderwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build works. Code looks good. Rebased cleanly. 👍

@@ -158,6 +164,10 @@ public void handleNode(ParseContext pContext, Node node) throws IOException {
if (tagNode.isEndTag()) {
if (tagNode.getTagName().equals("HEAD")) {
context.putData(FERRET_IN_HEAD, null);
// turn off NOSCIPT state as well. It's inside HEAD only.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny typo in this comment.

// NOSCRIPT under HEAD may contain elements that usually happen
// inside BODY. As long as they are inside NOSCRIPT, we let them go
// without inserting bodyInsert. Note this is NOSCRIPT under HEAD
// only. If <NOSCRIPT> happens before <HEAD>, non-HEAD elements in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you see NOSCRIPT tags outside of the HEAD in practice? Mostly curious. Not sure I've come across that myself.

If it does happen in practice, should we make another issue to handle that case?

@ldko ldko merged commit 782fbdc into iipc:master Mar 10, 2017
ldko added a commit that referenced this pull request Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants