Ticket #2527764 (closed defect)

Reporter


iancrowther
Opened: 03/4/09
Last modified: 09/14/09
Status: closed
Type: defect
Resolution: fixed

Owner


Luke Smith
Target Release: 2.8.0
Priority: P3 (normal)
Summary: StyleSheet Utility - StyleSheet-debug.js _deleteRule
Description:

Hi All,

I have been debugging StyleSheet-debug.js and have found that one of the methods needs to be re-ordered.

_deleteRule returns as undefined currently. I have included a code snippet to help.

Thanks

Ian Crowther

// 3. Initialize the cssRules map from the node
// xdomain link nodes forbid access to the cssRules collection, so this
// will throw an error.
// TODO: research alternate stylesheet, @media
for (i = sheet[_rules].length - 1; i >= 0; --i) {
r = sheet[_rules][i];
sel = r.selectorText;

if (cssRules[sel]) {
cssRules[sel].style.cssText += ';' + r.style.cssText;
_deleteRule(i);
} else {
cssRules[sel] = r;
}
}

// 4. The method to remove a rule from the stylesheet
// IE supports removeRule
_deleteRule = ('deleteRule' in sheet) ?
function (i) { sheet.deleteRule(i); } :
function (i) { sheet.removeRule(i); };

// 5. The method to add a new rule to the stylesheet
// IE supports addRule with different signature
_insertRule = ('insertRule' in sheet) ?
function (sel,css,i) { sheet.insertRule(sel+' {'+css+'}',i); } :
function (sel,css,i) { sheet.addRule(sel,css,i); };

Type: defect Observed in Version: 2.7.0
Component: StyleSheet Severity: S3 (normal)
Assigned To: Luke Smith Target Release: 2.8.0
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: All
URL:
Test Information:

Change History

Luke Smith

YUI Contributor

Posted: 03/5/09
  • browser changed from IE 8.x to All
  • status changed from new to accepted

Good catch, thanks.

Luke Smith

YUI Contributor

Posted: 03/5/09
  • status changed from accepted to checkedin

George

YUI Developer

Posted: 07/10/09
  • milestone changed to 2.8.0

Luke Smith

YUI Contributor

Posted: 07/31/09

Ticket #2528263 was marked as a duplicate of this ticket.

George

YUI Developer

Posted: 09/14/09
  • status changed from checkedin to closed

2.8.0 has been released. All "checkedin" items are available for download in the official release. Status of "checkedin" items is being set to closed.

George

YUI Developer

Posted: 09/14/09
  • resolution changed to fixed