webengine/osswebengine/WebCore/page/symbian/WebCoreFrameBridge.cpp
changeset 15 60c5402cb945
parent 10 a359256acfc6
child 36 c711bdda59f4
equal deleted inserted replaced
11:c8a366e56285 15:60c5402cb945
   323         if (kit(m_frame->page())->pageScaler())
   323         if (kit(m_frame->page())->pageScaler())
   324             kit(m_frame->page())->pageScaler()->SetRelativePosition(0, 3, isRtl ? CPageScaler::ETopLeft : CPageScaler::ETopRight);
   324             kit(m_frame->page())->pageScaler()->SetRelativePosition(0, 3, isRtl ? CPageScaler::ETopLeft : CPageScaler::ETopRight);
   325     }
   325     }
   326 }
   326 }
   327 
   327 
   328 bool WebCoreFrameBridge::getTypeFromElement(Node* node, TBrCtlDefs::TBrCtlElementType& aElType, TRect& aFocusRect) const
   328 bool WebCoreFrameBridge::getTypeFromElement(Node* node, TBrCtlDefs::TBrCtlElementType& aElType, TRect& aFocusRect, Node*& aRNode) const
   329 { 
   329 { 
   330      
   330      
   331     if(node && m_frame) {
   331     if(node && m_frame) {
   332     
   332     
   333         // get the navigable node at this point
   333         // get the navigable node at this point
   334         for (Node* n = node; n; n = n->parentNode()) {
   334         for (Node* n = node; n; n = n->parentNode()) {
   335             if( n->isFocusable() ) {
   335             if( n->isFocusable() ) {
   336                 aElType = nodeTypeB(n, m_frame);
   336                 aElType = nodeTypeB(n, m_frame);
   337                 aFocusRect = n->getRect();
   337                 aFocusRect = n->getRect();
       
   338                 aRNode = n;
   338                 return true;
   339                 return true;
   339             }
   340             }
   340             else {
   341             else {
   341                 EventTargetNode* etn = NULL;
   342                 EventTargetNode* etn = NULL;
   342                 if (n->isEventTargetNode()) {
   343                 if (n->isEventTargetNode()) {
   345                 if( etn && (etn->getHTMLEventListener(mouseoverEvent) 
   346                 if( etn && (etn->getHTMLEventListener(mouseoverEvent) 
   346                     || etn->getHTMLEventListener(mousedownEvent)
   347                     || etn->getHTMLEventListener(mousedownEvent)
   347                     || etn->getHTMLEventListener(mouseupEvent)) ) {                
   348                     || etn->getHTMLEventListener(mouseupEvent)) ) {                
   348                     aFocusRect = n->getRect();
   349                     aFocusRect = n->getRect();
   349                     aElType = TBrCtlDefs::EElementMouseButtonListener;
   350                     aElType = TBrCtlDefs::EElementMouseButtonListener;
       
   351                     aRNode = n;
   350                     return true;
   352                     return true;
   351                 }
   353                 }
   352                 else if (n->isElementNode() && n->hasTagName(areaTag)) {
   354                 else if (n->isElementNode() && n->hasTagName(areaTag)) {
   353                     HTMLElement* e =  static_cast<HTMLElement*>(n);
   355                     HTMLElement* e =  static_cast<HTMLElement*>(n);
   354                     if(!e->getAttribute(hrefAttr).isNull()) {
   356                     if(!e->getAttribute(hrefAttr).isNull()) {
   355                         aElType = TBrCtlDefs::EElementAreaBox;
   357                         aElType = TBrCtlDefs::EElementAreaBox;
   356                         aFocusRect = n->getRect();
   358                         aFocusRect = n->getRect();
       
   359                         aRNode = n;
   357                         return true;
   360                         return true;
   358                     }
   361                     }
   359                 }
   362                 }
   360                 else if (n->isElementNode() && n->hasTagName(imgTag)) {
   363                 else if (n->isElementNode() && n->hasTagName(imgTag)) {
   361                     HTMLElement* e =  static_cast<HTMLElement*>(n);
   364                     HTMLElement* e =  static_cast<HTMLElement*>(n);
   364                         if( np->hasTagName(aTag) ) {
   367                         if( np->hasTagName(aTag) ) {
   365                             HTMLElement* ep =  static_cast<HTMLElement*>(np);
   368                             HTMLElement* ep =  static_cast<HTMLElement*>(np);
   366                             if(!ep->getAttribute(hrefAttr).isNull()) {
   369                             if(!ep->getAttribute(hrefAttr).isNull()) {
   367                                 aElType = nodeTypeB(np, m_frame);
   370                                 aElType = nodeTypeB(np, m_frame);
   368                                 aFocusRect = np->getRect();
   371                                 aFocusRect = np->getRect();
       
   372                                 aRNode = np;
   369                                 return true;
   373                                 return true;
   370                             }
   374                             }
   371                         }
   375                         }
   372                     }
   376                     }
   373                     HTMLImageElement* imageElement = static_cast<HTMLImageElement *>(n);
   377                     HTMLImageElement* imageElement = static_cast<HTMLImageElement *>(n);
   384                         else {
   388                         else {
   385                             aElType = TBrCtlDefs::EElementNone;
   389                             aElType = TBrCtlDefs::EElementNone;
   386                         }
   390                         }
   387                     }
   391                     }
   388                     aFocusRect = n->getRect().Rect();
   392                     aFocusRect = n->getRect().Rect();
       
   393                     aRNode = n;
   389                     return true;
   394                     return true;
   390                 }
   395                 }
   391                 else if (n->renderer() && n->renderer()->layer()) {
   396                 else if (n->renderer() && n->renderer()->layer()) {
   392                     /*FIXME: to be implemneted for scrollbar
   397                     /*FIXME: to be implemneted for scrollbar
   393                     Scrollbar* hbar = n->renderer()->layer()->horizontalScrollbar();
   398                     Scrollbar* hbar = n->renderer()->layer()->horizontalScrollbar();