original_string: public function get_floats_inside(Page $root)
      {
          $floating_frames = $root->get_floating_frames();
  
          if (count($floating_frames) == 0) {
              return $floating_frames;
          }
  
          // Find nearest floating element
          $p = $this->_block_frame;
          while ($p->get_style()->float === "none") {
              $parent = $p->get_parent();
  
              if (!$parent) {
                  break;
              }
  
              $p = $parent;
          }
  
          if ($p == $root) {
              return $floating_frames;
          }
  
          $parent = $p;
  
          $childs = array();
  
          foreach ($floating_frames as $_floating) {
              $p = $_floating->get_parent();
  
              while (($p = $p->get_parent()) && $p !== $parent);
  
              if ($p) {
                  $childs[] = $p;
              }
          }
  
          return $childs;
      }
code: public function get_floats_inside(Page $root)
      {
          $floating_frames = $root->get_floating_frames();
  
          if (count($floating_frames) == 0) {
              return $floating_frames;
          }
  
          // Find nearest floating element
          $p = $this->_block_frame;
          while ($p->get_style()->float === "none") {
              $parent = $p->get_parent();
  
              if (!$parent) {
                  break;
              }
  
              $p = $parent;
          }
  
          if ($p == $root) {
              return $floating_frames;
          }
  
          $parent = $p;
  
          $childs = array();
  
          foreach ($floating_frames as $_floating) {
              $p = $_floating->get_parent();
  
              while (($p = $p->get_parent()) && $p !== $parent);
  
              if ($p) {
                  $childs[] = $p;
              }
          }
  
          return $childs;
      }
code_tokens: public function get_floats_inside ( Page $ root ) { $ floating_frames = $ root -> get_floating_frames ( ) ; if ( count ( $ floating_frames ) == 0 ) { return $ floating_frames ; } // Find nearest floating element $ p = $ this -> _block_frame ; while ( $ p -> get_style ( ) -> float === "none" ) { $ parent = $ p -> get_parent ( ) ; if ( ! $ parent ) { break ; } $ p = $ parent ; } if ( $ p == $ root ) { return $ floating_frames ; } $ parent = $ p ; $ childs = array ( ) ; foreach ( $ floating_frames as $ _floating ) { $ p = $ _floating -> get_parent ( ) ; while ( ( $ p = $ p -> get_parent ( ) ) && $ p !== $ parent ) ; if ( $ p ) { $ childs [ ] = $ p ; } } return $ childs ; }
docstring: Returns the floating elements inside the first floating parent
  
  @param Page $root
  
  @return Frame[]
docstring_tokens: Returns the floating elements inside the first floating parent