Bug 17767 - frameborder="no" on frameset is ignored if border attribute set
Summary: frameborder="no" on frameset is ignored if border attribute set
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Elliott Sprehn
URL: http://estbioinfo.stat.ub.es/apli/ser...
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2008-03-11 07:46 PDT by Gavin Sherlock
Modified: 2012-06-28 17:56 PDT (History)
4 users (show)

See Also:


Attachments
Reduction (756 bytes, text/html)
2012-06-25 16:12 PDT, Elliott Sprehn
no flags Details
Patch (4.10 KB, patch)
2012-06-25 17:55 PDT, Elliott Sprehn
no flags Details | Formatted Diff | Diff
Patch (16.43 KB, patch)
2012-06-28 13:50 PDT, Elliott Sprehn
no flags Details | Formatted Diff | Diff
Patch (16.41 KB, patch)
2012-06-28 14:19 PDT, Elliott Sprehn
no flags Details | Formatted Diff | Diff
Patch for landing (16.37 KB, patch)
2012-06-28 15:06 PDT, Elliott Sprehn
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Sherlock 2008-03-11 07:46:36 PDT
Everything on the page is shifted down, with the main content of the page being in a tiny frame on the bottom right.  Renders correctly in Firefox.  Tested with r30939 and release Safari on 10.5.2.  Have not tested if it is a regression from Safari 2.
Comment 1 Marcus 2008-04-07 06:21:26 PDT
The page has two framesets with these attributes:
framespacing="0" frameborder="NO" border="800"

IE 7 prefers framespacing="0" over border="800" and draws no border between the frames.
Safari 3.1 ignores the framespacing attribute and draws a 800-pixel wide border.
Firefox 3 also ignores the framespacing attribute but interprets frameborder="NO" to signify that no border should be drawn.
Comment 2 Jon@Chromium 2008-10-14 13:23:28 PDT
Also see Chromium bug http://code.google.com/p/chromium/issues/detail?id=1365
Comment 3 Elliott Sprehn 2012-06-25 16:12:17 PDT
Created attachment 149383 [details]
Reduction
Comment 4 Elliott Sprehn 2012-06-25 17:55:03 PDT
Created attachment 149410 [details]
Patch
Comment 5 Julien Chaffraix 2012-06-26 09:54:39 PDT
Comment on attachment 149410 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=149410&action=review

How good is our coverage of |frameborder| and |border|? I had a hard time understanding why you wouldn't break any case: checking |m_frameborder| would normally be dependent on the attribute ordering but here works because it defaults to true. If something changes, some of cases will break which why I would like you to point out or provide more coverage for those.

> Source/WebCore/html/HTMLFrameSetElement.cpp:113
>              if (!m_border)
>                  m_frameborder = false;

This should go into the "if (m_frameborder)".
Comment 6 Tony Chang 2012-06-26 10:03:10 PDT
Comment on attachment 149410 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=149410&action=review

> LayoutTests/fast/frames/frame-frameborder-overides-border.html:5
> +    WebKit doesn't ignore border="..." when frameborder is NO while all other
> +    browsers will.

I would probably use a dumpAsText test instead.  It's slightly easier to maintain than a reftest.  Also, for dumpAsText or reftests, I would include the description text in the generated output.  It might also be nice to add tests for frameborder={0,1,yes}.
Comment 7 Tony Chang 2012-06-26 11:42:42 PDT
Ah, I didn't realize order matters.  Seems like we need more test cases!
Comment 8 Elliott Sprehn 2012-06-26 13:36:55 PDT
Comment on attachment 149410 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=149410&action=review

>> LayoutTests/fast/frames/frame-frameborder-overides-border.html:5
>> +    browsers will.
> 
> I would probably use a dumpAsText test instead.  It's slightly easier to maintain than a reftest.  Also, for dumpAsText or reftests, I would include the description text in the generated output.  It might also be nice to add tests for frameborder={0,1,yes}.

So I should dump the borders using getComputedStyle?
Comment 9 Elliott Sprehn 2012-06-26 13:39:38 PDT
(In reply to comment #7)
> Ah, I didn't realize order matters.  Seems like we need more test cases!

Yeah it works because the default is true as required by IE compatibility behavior. I'll add more tests since this might not be obvious.
Comment 10 Tony Chang 2012-06-26 13:48:28 PDT
Comment on attachment 149410 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=149410&action=review

>>> LayoutTests/fast/frames/frame-frameborder-overides-border.html:5
>>> +    browsers will.
>> 
>> I would probably use a dumpAsText test instead.  It's slightly easier to maintain than a reftest.  Also, for dumpAsText or reftests, I would include the description text in the generated output.  It might also be nice to add tests for frameborder={0,1,yes}.
> 
> So I should dump the borders using getComputedStyle?

Yeah, that's what I was thinking.  Maybe that doesn't work for framesets or frames?  You could also get the clientWidth of the frames and make sure they're the right size.
Comment 11 Elliott Sprehn 2012-06-26 14:51:12 PDT
(In reply to comment #5)
> (From update of attachment 149410 [details])
> ...
> > Source/WebCore/html/HTMLFrameSetElement.cpp:113
> >              if (!m_border)
> >                  m_frameborder = false;
> 
> This should go into the "if (m_frameborder)".

They logically have the same effect but that's more nesting. Is there a reason?
Comment 12 Julien Chaffraix 2012-06-26 15:11:20 PDT
Comment on attachment 149410 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=149410&action=review

>>> Source/WebCore/html/HTMLFrameSetElement.cpp:113
>>>                  m_frameborder = false;
>> 
>> This should go into the "if (m_frameborder)".
> 
> They logically have the same effect but that's more nesting. Is there a reason?

I don't see what the issue with more nesting is. With the new logic, we don't need to run this check if m_frameborder is false (in which case m_border will be false anyway).

> LayoutTests/fast/frames/frame-frameborder-overides-border.html:14
> +    but instead you see the above with lots of white spaces around it because
> +    the frameborder still renders.
> +-->

Also this description should be dumped in the output if it doesn't make your test platform dependent (which is the case for ref-tests and dumpAsText). I also advise to add the bug title and number but other reviewers have other opinions on that. That makes tests whose output are easier to read and maintain.
Comment 13 Elliott Sprehn 2012-06-28 13:50:27 PDT
Created attachment 150005 [details]
Patch
Comment 14 Elliott Sprehn 2012-06-28 13:59:46 PDT
It turns out there was more brokeness in there like frameborder actually being parsed to an int making frameborder=yes the same as frameborder=no.

I've done a bunch of fix up on the parsing and handling of inheritance and added lots of tests.
Comment 15 Elliott Sprehn 2012-06-28 14:19:24 PDT
Created attachment 150013 [details]
Patch

Fix funky whitespace
Comment 16 Tony Chang 2012-06-28 14:35:02 PDT
Comment on attachment 150013 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=150013&action=review

> Source/WebCore/html/HTMLFrameSetElement.cpp:101
> +            } else if (equalIgnoringCase(value, "yes") || equalIgnoringCase(value, "1")) {
> +                // Default is true.

I think this comment is confusing (it's not obvious we're talking about m_border). I would just remove it.
Comment 17 Elliott Sprehn 2012-06-28 15:06:21 PDT
Created attachment 150021 [details]
Patch for landing
Comment 18 WebKit Review Bot 2012-06-28 17:56:02 PDT
Comment on attachment 150021 [details]
Patch for landing

Clearing flags on attachment: 150021

Committed r121494: <http://trac.webkit.org/changeset/121494>
Comment 19 WebKit Review Bot 2012-06-28 17:56:08 PDT
All reviewed patches have been landed.  Closing bug.