[Bug 15938] New: Attaching events to content flows

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

           Summary: Attaching events to content flows
           Product: CSS
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Regions
        AssignedTo: vhardy@adobe.com
        ReportedBy: vhardy@adobe.com
         QAContact: public-css-bugzilla@w3.org
                CC: eoconnor@apple.com


(Some feedback on regions for those interested…)

I've written a little framework for dividing content up into "pages" (regions)
using the CSSOM APIs. I'm happy with the way it turned out, but the way I had
to go about doing it was more complicate than what I was hoping for. In fact, I
tried every other method I could think of for detecting overflow before finally
resorting to attaching webkitRegionLayoutUpdate events to regions.

>From Christian Cantrell (Adobe):

====
[...] something that should work is attaching the webkitRegionLayoutUpdate
event listener to the flow itself rather than individual regions. For instance:

var storyFlow = document.webkitGetFlowByName('story');
storyFlow.addEventListener('webkitRegionLayoutUpdate', function(e) {
    if (storyFlow.overflow) {
        // add another region
    }
});

This would be a great way to know if additional regions were needed, however it
wouldn't be enough to tell whether regions needed to be taken away. In that
case, the flow would need an additional property like emptyRegions. Something
like this would be nice:

var storyFlow = document.webkitGetFlowByName('story');
storyFlow.addEventListener('webkitRegionLayoutUpdate', function(e) {
    if (storyFlow.overflow) {
        // add another region
    } else if (storyFlow. emptyRegions.length > 0) {
        for (var i = 0; i < storyFlow.emptyRegions.length; ++i) {
           
document.getElementById('pageContainer').removeChild(storyFlow.emptyRegions[i]);
        }
    }
});

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 8 February 2012 22:02:39 UTC