[Bug 22770] New: add global onpaint, onresize attributes?

https://www.w3.org/Bugs/Public/show_bug.cgi?id=22770

            Bug ID: 22770
           Summary: add global onpaint, onresize attributes?
    Classification: Unclassified
           Product: HTML WG
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HTML5 spec
          Assignee: dave.null@w3.org
          Reporter: jmichae3@yahoo.com
        QA Contact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-admin@w3.org,
                    public-html-wg-issue-tracking@w3.org

please add:

- global onpaint="" attribute which gets activated on a browser window repaint,
with which it executes the code therein, such as a javascript function call.can
call a js function that 
Example 1:
<div id="o" style="z-index:2;" onpaint="dopaint()">yahoo!</div>
<script>
function dopaint() {
    //move an element around
    var e=document.getElementById('o');
    var old=e.style.top.toString();
    //get rid of "px off of end and get value, add 4 mod document.height
    e.style.top =
(((parseInt(old.substr(0,old.length)-2)+4)%document.height)+'px';
    //however, this code COULD be a problem, since it causes a repaint, 
    //and might be the kind of thing people try...
}
</script>
Example 2:
<p>document pixel area=<span id="t"
onpaint="document.getElementById('t').innerHTML = document.width *
document.height">????</span></p>

specifically, I needed the onpaint thing for working with a live rotating 4D
<canvas></canvas> with support for red-blue 3D glasses someday I am trying to
port from Java, which requires a paint hook do do animation using
double-buffering as fast as it can. *IF* I can do double-buffering with
canvas... this is for math folks who want to study 4D.


- window.onresize="" or global onresize="" attribute which activates when the
browser document window is resized and executes the code in the string
following the = sign. I don't know exactly in what to place this, whether as a
DOM method/property (?) or if it's more appropriate for 

this comes in handy for games, but also for regular DHTML for element
positioning and page sizing. many times a web developer will make a page
hard-coded for certain screen sizes, but knowing the document width and height,
and being able to rework the document for that could be handy for some. may get
popular. I know I could use these both.

Example:
<!--form controls for 4D-->
<div id="o2" onresize="doresize()"><canvas id="c">4D canvas</canvas></div>
<script>
function doresize() {
    var formControls=document.getElementById('f').height;
    var nw=getElementById('nnavigation').width;
    var c=document.getElementById('c');
    c.width = document.width - nw; 
    c.height = document.viewport.height - formControls.height;
}
</script>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Tuesday, 23 July 2013 10:44:49 UTC