Changeset 15881 for lang/actionscript
- Timestamp:
- 07/16/08 03:24:11 (4 months ago)
- Location:
- lang/actionscript/ascss/src
- Files:
-
- 6 modified
-
KyotoDemo.as (modified) (2 diffs)
-
KyotoDemo.swf (modified) (previous)
-
css/CSSStyleSelector.as (modified) (2 diffs)
-
cssdom/IASCSSElement.as (modified) (1 diff)
-
cssdom/XMLElementWrapper.as (modified) (3 diffs)
-
kyotodemo/XMLDocument.as (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/ascss/src/KyotoDemo.as
r15869 r15881 348 348 349 349 350 private static const rxStartTag:RegExp = / <[-_a-zA-Z0-9]+[^>]*>/351 private static const rxEndTag:RegExp = / <\/[-_a-zA-Z0-9]+[^>]*>/350 private static const rxStartTag:RegExp = /^<[-_a-zA-Z0-9]+[^>]*>/ 351 private static const rxEndTag:RegExp = /^<\/[-_a-zA-Z0-9]+[^>]*>/ 352 352 private static const rxEmptyTag:RegExp = /\/[ \t]*>/ 353 353 354 private static const rxCommentStart:RegExp = / <!--/354 private static const rxCommentStart:RegExp = /^<!--/ 355 355 private static const rxCommentEnd:RegExp = /-->/ 356 356 … … 374 374 var fwd:String; 375 375 for (;;) { 376 curpos = src.indexOf('<', curpos); 377 if (curpos < 0) break; 378 376 379 fwd = src.substring(curpos); 377 380 -
lang/actionscript/ascss/src/css/CSSStyleSelector.as
r15869 r15881 584 584 break; 585 585 } 586 587 case CSSSelector.PseudoLastChild: 588 { 589 // last-child matches the last child that is an element 590 if (e.parentNode && e.parentNode.isElementNode) { 591 result = false; 592 // if (parentNode->isFinishedParsingChildren()) { 593 n = e.nextSibling; 594 while (n && !n.isElementNode) 595 n = n.nextSibling; 596 if (!n) 597 result = true; 598 // } 599 /* 600 if (!m_collectRulesOnly) { 601 RenderStyle* childStyle = (m_element == e) ? m_style : e->renderStyle(); 602 RenderStyle* parentStyle = (m_element == e) ? m_parentStyle : parentNode->renderStyle(); 603 if (parentStyle) 604 parentStyle->setChildrenAffectedByLastChildRules(); 605 if (result && childStyle) 606 childStyle->setLastChildState(); 607 } 608 */ 609 return result; 610 } 611 break; 612 } 586 613 } 587 614 return false; … … 589 616 590 617 return true; 618 } 619 620 public static function matchNth(count:int, a:int, b:int):Boolean 621 { 622 if (a == 0) 623 return count == b; 624 else if (a > 0) { 625 if (count < b) 626 return false; 627 return (count - b) % a == 0; 628 } else { 629 if (count > b) 630 return false; 631 return (b - count) % (-a) == 0; 632 } 591 633 } 592 634 -
lang/actionscript/ascss/src/cssdom/IASCSSElement.as
r15869 r15881 12 12 function get parentNode():IASCSSElement; 13 13 function get previousSibling():IASCSSElement; 14 function get nextSibling():IASCSSElement; 14 15 function getAttributeQ(qn:QualifiedName):String 15 16 function get document():IASCSSDocument -
lang/actionscript/ascss/src/cssdom/XMLElementWrapper.as
r15869 r15881 12 12 private var mElement:XML; 13 13 private var mParent:XMLElementWrapper; 14 private var mPreviousSibling:XMLElementWrapper; 14 private var mPreviousSibling:XMLElementWrapper = null; 15 private var mNextSibling:XMLElementWrapper = null; 15 16 private var mChildren:Array; 16 17 private var mClassNames:ClassNames; … … 83 84 var ch_w:XMLElementWrapper = createFor(ch, d); 84 85 ch_w.parent = wrapper; 85 ch_w.setPreviousSibling(prev); 86 if (prev) 87 prev.chainNextSibling(ch_w); 86 88 87 89 if (!wrapper.mChildren) … … 138 140 } 139 141 140 public function setPreviousSibling(s:XMLElementWrapper):void 141 { 142 mPreviousSibling = s; 142 public function get nextSibling():IASCSSElement 143 { 144 return mNextSibling; 145 } 146 147 public function chainNextSibling(nxt:XMLElementWrapper):void 148 { 149 nxt.mPreviousSibling = this; 150 mNextSibling = nxt; 143 151 } 144 152 -
lang/actionscript/ascss/src/kyotodemo/XMLDocument.as
r15869 r15881 77 77 if (chdata) 78 78 { 79 chdata.wrapper.setPreviousSibling(prevsib_chdata ? prevsib_chdata.wrapper : null); 79 if (prevsib_chdata) 80 prevsib_chdata.wrapper.chainNextSibling(chdata.wrapper); 80 81 prevsib_chdata = chdata; 81 82 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)