SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,053
    Mentioned
    66 Post(s)
    Tagged
    0 Thread(s)

    Random HTML thoughts...

    Small thoughts of mine this afternoon.

    HREF on any element
    One of the planned changes for XHTML 2 was to allows href to be an attribute for any element, not just <a>. It's not that huge a change, indeed backwards compatibility could be forced using javascript. Since it doesn't face the same technical challenges as other HTML 5 adjustments I wonder why it didn't make it into HTML 5.

    Where's my default inline block container?
    <div> is display: block by default. <span> is display: inline by default. Where's the default inline-block element? Also, I feel each major display type should have a corresponding element. <grid> for display: grid, <flex> for display: flex and so on. As for inline block - I'd vote for <IB> as its default container.

    Canary Mode
    Browsers will try to render anything. What if they didn't? I'd love it if I could get Chrome or Firefox to cease rendering on an error when testing my own pages. Never would be able to turn it on to browse the net at large because most pages have invalid markup, but it would be nice if browsers would at least help you learn standards instead of helpfully rendering everything thrown at them.

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    As for "Canary" well-formed constrains of XHTML when served as 'application/xhtml+xml' media type would be something close. Though basically "Canary" will never happen as a default setting because the browser manufacturers dare not for fear of losing users and they'd be a huge backlash from those that wrote less than something, which resembled HTML and legacy code. There are already some browser based debugging tools or lints. Though I agree in part, in a "ideal world" it would be nice if shoddily coded pages triggered a 'browser warning message' saying; this webmaster's code sucks, etc.

    HTML5 seem to have strange a life of it's own... so I suspect they chose the easiest path and decided most modern browser 'in the wild' already will render anchor elements so didn't progress and hence why they choose the less sensible option.

  3. #3
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Michael Morris View Post
    HREF on any element
    One of the planned changes for XHTML 2 was to allows href to be an attribute for any element, not just <a>. It's not that huge a change, indeed backwards compatibility could be forced using javascript. Since it doesn't face the same technical challenges as other HTML 5 adjustments I wonder why it didn't make it into HTML 5.
    As <a> is now allowed to wrap any elements rather than only inline elements and text, this is no longer such a big deal.

    One thought is that it may be harder to detect illegally nested links if you had href on arbitrary elements ... in other words, would validators pick up on
    HTML Code:
    <p href="/home.htm">On our home page you can read all <a href="/about.htm">about our company</a>!</p>
    If you said that any contained links effectively outranked parent links (ie, clicking on "about our company" would activate the about.htm link instead of the home.htm link, you would open the door to lots of scope for googleabuse with nested links that never appear in the output.

    You would also have a whole lot more CSS to write if you had to code for every possible element with [href] or :link (etc) attributes, whereas when it's <a> it's a whole lot easier to deal with.

    There are quite a number of issues, and I'm really not convinced that the benefits stack up.

    Where's my default inline block container?
    <div> is display: block by default. <span> is display: inline by default. Where's the default inline-block element? Also, I feel each major display type should have a corresponding element. <grid> for display: grid, <flex> for display: flex and so on. As for inline block - I'd vote for <IB> as its default container.
    There's no need for a default inline-block container. Inline-block content is usually block content, so you just use a <div> and apply display:inline-block; in the CSS. The fact that it is inline-block is just a rendering trick, in the same way as floating or positioning an element, but we don't have (and don't need) HTML elements for those.

    Canary Mode
    Browsers will try to render anything. What if they didn't? I'd love it if I could get Chrome or Firefox to cease rendering on an error when testing my own pages. Never would be able to turn it on to browse the net at large because most pages have invalid markup, but it would be nice if browsers would at least help you learn standards instead of helpfully rendering everything thrown at them.
    Yes, it would be nice – maybe if you suggest it to the open source community or to Opera they may be able to build it into a future version! Of course, running your pages through the validator is a pretty easy way to check (and Opera certainly makes this very easy, just right-click on the page and Validate is there on the context menu!) or, as Robert says, you could run them as XHTML.

  4. #4
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    HREF on any element
    Can't wait to watch developers destroy that one.

    Where's my default inline block container?
    Inputs. Depending on the browser.

    Canary Mode
    Yeah XML kicks butt in that regard. Draconian parsing FTW.

    *note: first response is a sort of sarcasm. Last one is totally straight.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stevie D View Post
    [font=verdana]One thought is that it may be harder to detect illegally nested links if you had href on arbitrary elements ... in other words, would validators pick up on
    HTML Code:
    <p href="/home.htm">On our home page you can read all <a href="/about.htm">about our company</a>!</p>
    You wouldn't have been able to do that in XHTML 2 as that markup language doesn't have an <a> tag.

    Anyway, How would that be more difficult to detect than:

    HTML Code:
    <a href="/home.htm"><p>On our home page you can read all <a href="/about.htm">about our company</a>!</p></a>
    In both cases there is an href attribute nested inside another tag that also has an href attribute - testing by the attribute is the way browsers would need to do it now since nesting <a> tags doesn't cause a problem if the inner one doesn't have that attribute.


    HTML Code:
    <a href="/home.htm"><p>On our home page you can read all <a id="about">about our company</a>!</p></a>
    
    <a href="#about">company?</a>

    As for Canary Mode it is really unfortunate that IE9 still attempts to render XHTML even after finding an error in the page and without reporting the error. At least the other browsers report the error at the spot they decided that it occurred (for example: open tag that wasn't closed in some browsers, where the close tag is identified as missing in other browsers) before possibly displaying the rest of the page content. Of course it still isn't practical to use XHTML since IE8 is still used by too many people to ignore and that browser will offer the page for download as it doesn't understand XHTML. That browser should be long dead by the time that the HTML5/XHTML5 standards are finalized so at that time you will have the choice of whether tho use HTML5 and have the browsers ignore the errors or use XHTML5 and have some browsers report the errors.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,816
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    As <a> is now allowed to wrap any elements rather than only inline elements and text, this is no longer such a big deal.
    I am torn on this one. I predict people ( amateurs and possibly desperate developers) will start nesting links... how does a UA handle that?

    eg.:
    Code:
    <a href="bbb.html"><div>
    <p>Lorem ipsum <li><a href="aaa.html">dolor</li>							 sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </div></a>
    OH.. and they will wrap As around LIs...

    Either way, there will be chaos

  7. #7
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    testing by the attribute is the way browsers would need to do it now since nesting <a> tags doesn't cause a problem if the inner one doesn't have that attribute.
    No. The HTML parser closes open <a> elements when seeing a new <a> tag without caring about the attributes.

    You can end up with nested links in XML and with scripts and even with HTML if you're creative (e.g. <a><table><a>), and it hasn't caused chaos from what I can tell. http://software.hixie.ch/utilities/j...wer/saved/2095
    Simon Pieters

  8. #8
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by zcorpan View Post
    No. The HTML parser closes open <a> elements when seeing a new <a> tag without caring about the attributes.
    That's the problem with the tag having two completely opposite meanings that wouldn't conflict if the browsers were testing on the essential difference - the href attribute. Basically you are saying that the browsers are not testing the right thing now and that's why it would be harder than it ought to be to drop the <a> tag.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  9. #9
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,882
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    I have a Canary

    Well actually it is a Firefox Addon that was created August 2007, has been revised extensively and works just like a Canary.

    The unobtrusive addon works in the background and immediately after Firefox renders the page one of three icons appear on right of the toolbar. Icons are red, orange and green indicatiing errors, warnings or successful validation repectively. Clicking on the icon pops up a window split into three resizable forms showing source, list of errors and suggestions on fixing the errors.

    http://users.skynet.be/mgueury/mozilla/index.html
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  10. #10
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Bah. I want my Canary to scream murder and explode into flames and rm -rf my system and set fire to the world when it sees I've accidentally a tag. Not squeak some little button in a corner far far away.

    Quote Originally Posted by zcorpan
    and it hasn't caused chaos from what I can tell.
    I've sure it's raised rates of death-by-bus by .00006% though. Next step is, of course, world domination.

    THE NEW ONE-WORLD GOVERNMENT SHALL BE KNOWN AS HIXONIA


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •