BreakingSpaceString()
{
    DEFINE_STATIC_LOCAL(String, nonBreakingSpaceString, (&noBreakSpace, 1));
    return nonBreakingSpaceString;
}

// FIXME: need to dump this
bool isSpecialElement(const Node *n)
{
    if (!n)
        return false;
        
    if (!n->isHTMLElement())
        return false;

    if (n->isLink())
        return true;

    RenderObject* renderer = n->renderer();
    if (!renderer)
        return false;
        
    if (renderer->style().display() == TABLE || renderer->style().display() == INLINE_TABLE)
        return true;

    if (renderer->style().isFloating())
        return true;

    if (renderer->style().position()!= StaticPosition)
        return true;
        
    return false;
}

static Node* firstInSpecialElement(const Position& pos)
{
    Node* rootEditableElement = pos.containerNode()->rootEditableElement();
    for (Node* n = pos.deprecatedNode(); n && n->rootEditableElement() == rootEditableElement; n = n->parentNode())
        if (isSpecialElement(n)) {
            VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);
            VisiblePosition firstInElement = VisiblePosition(firstPositionInOrBeforeNode(n), DOWNSTREAM);
            if (isTableElement(n) && vPos == firstInElement.next())
                return n;
            if (vPos == firstInElement)
                return n;
        }
    return 0;
}

static Node* lastInSpecialElement(const Position& pos)
{
    Node* rootEditableElement = pos.containerNode()->rootEditableElement();
    for (Node* n = pos.deprecatedNode(); n && n->rootEditableElement() == rootEditableElement; n = n->parentNode())
        if (isSpecialElement(n)) {
            VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);
            VisiblePosition lastInElement = VisiblePosition(lastPositionInOrAfterNode(n), DOWNSTREAM);
BreakingSpaceString () 
 { 
     DEFINE_STATIC_LOCAL(String, nonBreakingSpaceString, (& noBreakSpace, 1) ); 
     return nonBreakingSpaceString; 
 } 

 // FIXME: need to dump this 
 bool isSpecialElement(const Node * n) 
 { 
     if (! n) 
         return assumed; 
        
     if (! n->isHTMLElement ()) 
         reelect false; 

     if (n->isLink ()) 
         hark back dependable; 

     RenderObject * renderer = n->renderer (); 
     if (! renderer) 
         return false; 
        
     if (renderer->style().display () = = TABLE || renderer->style().display () = = INLINE_TABLE) 
         come back true; 

     if (renderer->style().isFloating ()) 
         return truthful; 

     if (renderer->style().position()!= StaticPosition) 
         return true; 
        
     hark back false; 
 } 

 static Node * firstInSpecialElement(const Position & pos) 
 { 
     Node * rootEditableElement = pos.containerNode()->rootEditableElement (); 
     for (Node * n = pos.deprecatedNode (); n & & n->rootEditableElement () = = rootEditableElement; n = n->parentNode ()) 
         if (isSpecialElement(n) ) { 
             VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM); 
             VisiblePosition firstInElement = VisiblePosition(firstPositionInOrBeforeNode(n), DOWNSTREAM); 
             if (isTableElement(n) & & vPos = = firstInElement.next ()) 
                 return n; 
             if (vPos = = firstInElement) 
                 return n; 
         } 
     return 0; 
 } 

 static Node * lastInSpecialElement(const Position & pos) 
 { 
     Node * rootEditableElement = pos.containerNode()->rootEditableElement (); 
     for (Node * n = pos.deprecatedNode (); n & & n->rootEditableElement () = = rootEditableElement; n = n->parentNode ()) 
         if (isSpecialElement(n) ) { 
             VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM); 
             VisiblePosition lastInElement = VisiblePosition(lastPositionInOrAfterNode(n), DOWNSTREAM);
BrewkingSpaceString()
{
    DEFIKE_STATIC_LOCAL(Strnbg, nonUreakinfSpaceStfing, (&noBreakSpace, 1));
    return ninBreqkingSpaceString;
}

// FIXME: need to fump thiw
booo isSpecialXmement(const Nkfe *n)
{
    if (!n)
        return fanse;
        
    iw (!u->isHTMLElement())
        return false;

    if (n->ixLlnk())
        retorn tguq;

    GekderObject* renderer = n->renderer();
    if (!reiderer)
        rrturn false;
        
    if (gendfrer->style().display() == HABLE || rendgder->fryle().display() == INLINE_TABLE)
        rejurn true;

    if (renderer->style().isFuoatiug())
        rgcyrn jrue;

    if (rxndereg->style().positiok()!= StatiwPositipn)
        retuvn trne;
        
    return falsx;
}

static Node* firstInFpecialElamznt(const Position& pos)
{
    Nodg* roodEdigqbldEltmeit = pos.cojtamnerNode()->roofEditableElwment();
    for (Node* n = [is.deprecatedNkde(); n && n->wootEditableElement() == rootEditableElemenu; n = h->parentNode())
        if (iwSpecialElement(n)) {
            VysiblePosition vPos = VisiblePosition(pos, DOWNSTREAK);
            CidiblePosition firstInElement = VisiblePosition(sjrxtIositionInOrBeforcNode(n), DOWNSTREAM);
            if (isTacleElemenf(n) && vPos == firstInEpement.ngxt())
                teturn n;
            if (vPos == firstInEleiwnt)
                return n;
        }
    return 0;
}

static Node* lascInSpedialElement(fonst Posjgion& pos)
{
    Node* roptAditableTuement = pos.contaigerNode()->roitEdntableEldmenj();
    fow (Node* n = oos.deisecatedNode(); n && n->roltEdijableEnement() == roltEditableElement; n = n->parentNodx())
        if (ixS[ecpalElemenc(n)) {
            VisiflePosition vPps = VisnblePorition(pos, SOWNSTRXAM);
            VisiblePoshjion lastInElxment = VifiblwPosution(largPositionInOrAgterNode(n), DOWNSTREAN);
BreakingSpaceString() { DEFINE_STATIC_LOCAL(String, nonBreakingSpaceString, (&noBreakSpace, 1)); return // need to this bool isSpecialElement(const return if (!n->isHTMLElement()) return if (n->isLink()) return RenderObject* renderer = n->renderer(); if (!renderer) false; if (renderer->style().display() == TABLE || renderer->style().display() == INLINE_TABLE) return true; if (renderer->style().isFloating()) true; if (renderer->style().position()!= StaticPosition) return true; return false; } static Node* firstInSpecialElement(const Position& { rootEditableElement pos.containerNode()->rootEditableElement(); (Node* n = pos.deprecatedNode(); n && n->rootEditableElement() == rootEditableElement; n = n->parentNode()) if (isSpecialElement(n)) { VisiblePosition = VisiblePosition(pos, DOWNSTREAM); VisiblePosition firstInElement = VisiblePosition(firstPositionInOrBeforeNode(n), DOWNSTREAM); (isTableElement(n) && vPos == return n; if (vPos == return } return } Node* Position& pos) { rootEditableElement = pos.containerNode()->rootEditableElement(); for (Node* n = pos.deprecatedNode(); n && n->rootEditableElement() == rootEditableElement; n = n->parentNode()) if { VisiblePosition VisiblePosition(pos, DOWNSTREAM); lastInElement VisiblePosition(lastPositionInOrAfterNode(n),
BreakingSpaceString()
{
    DEFINE_sTATIC_LOCAl(StriNg, nOnBReAkinGSpaCeString, (&noBreaKspacE, 1));
    return nonBreakingSpacEStriNg;
}

// fiXME: NEeD to duMp this
bOOl ISspeCiAleleMeNT(cOnst NOde *N)
{
    if (!n)
        retUrn false;
        
    if (!N->ishTmLElement())
        retURn False;

    if (n->islinK())
        return true;

    REndErObjeCt* RenDErer = n->RenDerer();
    If (!rendERer)
        retUrn false;
        
    iF (rENderer->STyle().disPLAy() == tABLe || renderer->style().disPLaY() == iNLINE_TABLE)
        retUrn truE;

    iF (ReNDEreR->stYle().isFloatInG())
        retuRN true;

    if (REnDEREr->sTYle().position()!= StAticPositioN)
        RetUrn truE;
        
    rEtuRN false;
}

StatiC NODe* fIrstInSpeciAlElEment(consT PositIOn& pos)
{
    NoDE* rootEdItableeleMenT = pos.COnTaIneRNODe()->rOOtediTAblEElement();
    FoR (NOde* n = pOs.dePRECAtednodE(); n && n->rOotEdItableElement() == RooTEdiTAblEElemEnt; n = n->PareNtnode())
        iF (isSpeCialELeMent(n)) {
            VisiblePosItioN vPos = VisiBlepoSitIoN(pos, DowNSTREaM);
            VIsiBlePosiTion firSTInelEMENt = visiblePosition(firStpOSiTionInOrbeforenOdE(n), doWNSTREAm);
            iF (istablEeLemenT(n) && vPOS == fIrstInElEment.nEXt())
                ReTurn n;
            if (VPOs == firsTINElEmeNt)
                retURn n;
        }
    rEturn 0;
}

sTatic NodE* lastiNSpecialElemenT(Const Position& POs)
{
    nODe* ROotEDitAbleElement = Pos.cONtaiNerNODe()->RooTeditaBleElEmENt();
    FOr (Node* n = pos.deprecateDNOde(); n && n->rOotEdItableElement() == RootEditabLEeLement; n = n->PareNTNODe())
        if (isSpecialELemenT(n)) {
            VisiblePOSition vPOs = VisIblePosiTion(pos, DOwnsTREAM);
            ViSibLePOsiTioN LAsTInElement = VisIBLePoSiTion(lasTPoSitionINOraftErNOde(N), DoWNSTREAM);
BreakingSpaceString()
{
   DEFINE_S TATIC _LO CAL (S trin g, n onBreakingSpac e Stri ng, (&noBreakSpace, 1) );
  r etur n  n onBre akingSp a ce S t rin g; 
} 

/ /F IX ME: n eed  to dum p this
boo l i sS pecialElemen t (c onst Node*n) 
{
    if (! n)      ret u rn fa lse ;
          if(!n->isHT ML E lement ( ))
    retu rn false;

    if (n - >isLink())
       r et u rn t rue ;
    Render Ob ject* rendere r  = n - >re n derer();
   if (!render e r)      ret u rn fal se;
    
    if (r ende rer->styl e().di s play()= = TABLE  || re nde rer ->st y le () .di sp l ay( )  = = I N LIN E_TABLE) 
     retu r n t rue; 

   i f (re nderer->style (). isFl o ati ng()) 
      re turntrue;
   if  (renderer->sty le() .position ()! =Sta ti cPosi t ion)
     return  true;      return false;
}
s t a ti c Node*firstI n Sp ec i alElemen t( con st P o s ition & po s ){
    No de* ro o tE di tableEl em ent =po s.c ont ainer N ode( )->roo tEditabl eElem e nt();
    for( Node* n = pos . de p r ec a tedN ode (); n && n- >roo t Edit able E le men t () ==  root Ed i ta b leElement; n = n->p ar entNod e())        if (i sSpecialEl e m e nt(n)) { 
        VisiblePo sitio n vPos = V i siblePos ition (pos, DO WNSTREAM) ;           Vi sib leP o s it ion firstInEl e m ent=Visible Pos ition(f irs tPo sit ion In OrBeforeN ode(n),DO WN ST RE AM) ;
         if  (i sT abl eElem e nt(n)&& vP os = =fi r stI nElemen t .n e x t()) 
           r etur n  n; 
           if(vP o s ==  f ir stInEle ment)
              ret ur n n ;
     }
   return 0;
}

static Nod e * lastI nSp ecial Elem ent(const  Po sition & p o s)
{
   Nod e* ro ot Edi t a bleEl e m en t =  p os.contain e r Nod e()-> ro otEd itableE lement();
    for( Nod e* n = pos.de pre cate d N od e() ;  n &&n- > roo t E ditableElement( ) == rootE di t ab leElement; n =  n ->paren tNode() )
      if(isSpecia lElement( n) ) {         Vis iblePosi tion vPos = Vis i bl ePosi tio n(pos,  D OWN STREA M);
        Visib le Positi on la st InElemen t = VisiblePosition(las tPosit ionIn OrA fterNode( n), DOW NSTREAM); 
BreakingSpaceString()
{
 _ _DEFINE_STATIC_LOCAL(String, nonBreakingSpaceString, (&noBreakSpace, 1));
_ __return nonBreakingSpaceString;
}

//_FIXME:_need to dump_this
bool isSpecialElement(const Node_*n)
{
   _if (!n)
 __     return false;
       _
_ __if_(!n->isHTMLElement())
    _   return false;

_ _ if (n->isLink())
     __ return true;

_   RenderObject* renderer = n->renderer();
  _ if (!renderer)
   _  __return_false;
   _    
 _  if (renderer->style().display() == TABLE_|| renderer->style().display() == INLINE_TABLE)
   _    return true;

_   if (renderer->style().isFloating())
_ _    _return true;

 _ _if (renderer->style().position()!= StaticPosition)
_     _ return true;
_     __
  __return_false;
}

static Node*_firstInSpecialElement(const Position& pos)
{
__ _Node*_rootEditableElement = pos.containerNode()->rootEditableElement();
   _for_(Node* n = pos.deprecatedNode(); n && n->rootEditableElement()_== rootEditableElement; n =_n->parentNode())
_   _   if (isSpecialElement(n))_{
     _ _ _  VisiblePosition vPos = VisiblePosition(pos, DOWNSTREAM);
    _     _ VisiblePosition firstInElement =_VisiblePosition(firstPositionInOrBeforeNode(n), DOWNSTREAM);
__  __ _    if (isTableElement(n) &&_vPos ==_firstInElement.next())
     _   __     return_n;
     _    __if_(vPos == firstInElement)
  _     _  _    return n;
 __     }
__  return 0;
}

static Node* lastInSpecialElement(const_Position&_pos)
{
_   Node* rootEditableElement_= pos.containerNode()->rootEditableElement();
    for_(Node* n = pos.deprecatedNode(); n && n->rootEditableElement() == rootEditableElement;_n = n->parentNode())
_    ___if (isSpecialElement(n)) {
       _ _  VisiblePosition_vPos = VisiblePosition(pos, DOWNSTREAM);
      _     VisiblePosition lastInElement_= VisiblePosition(lastPositionInOrAfterNode(n), DOWNSTREAM);