[webkit-dev] bit field error on wince

Maciej Stachowiak mjs at apple.com
Tue Jan 22 15:22:09 PST 2008


On Jan 21, 2008, at 10:35 PM, ledwinka wrote:

> During my work on porting s60 webcore to wince, I found there is a  
> css bug
> in render_style.h file, here is the struct define

You're probably better off basing a port on something more recent  
(like trunk or the Safari 3 branch) since many windows platform/ 
compiler issues like this have already been resolved.

  - Maciej

>
>
>    struct NonInheritedFlags {
>        bool operator==( const NonInheritedFlags &other ) const {
>            return (_effectiveDisplay == other._effectiveDisplay) &&
>            (_originalDisplay == other._originalDisplay) &&
>            (_bg_repeat == other._bg_repeat) &&
>            (_overflow == other._overflow) &&
> #if NOKIA_CHANGES
>            (_inputRequired == other._inputRequired) &&
> #endif
>            (_vertical_align == other._vertical_align) &&
>            (_clear == other._clear) &&
>            (_position == other._position) &&
>            (_floating == other._floating) &&
>            (_table_layout == other._table_layout) &&
>            (_page_break_before == other._page_break_before) &&
>            (_page_break_after == other._page_break_after) &&
>            (_styleType == other._styleType) &&
>            (_affectedByHover == other._affectedByHover) &&
>            (_affectedByActive == other._affectedByActive) &&
>            (_affectedByDrag == other._affectedByDrag) &&
>            (_pseudoBits == other._pseudoBits) &&
>            (_unicodeBidi == other._unicodeBidi);
>  }
>
>        bool operator!=( const NonInheritedFlags &other ) const {
>            return !(*this == other);
>        }
>
>        EDisplay _effectiveDisplay : 5;
>        EDisplay _originalDisplay : 5;
>        EBackgroundRepeat _bg_repeat : 2;
>        EOverflow _overflow : 4 ;
> #if NOKIA_CHANGES
>        bool _inputRequired : 1 ;
> #endif
>        EVerticalAlign _vertical_align : 4;
>        EClear _clear : 2;
>        EPosition _position : 2;
>        EFloat _floating : 2;
>        ETableLayout _table_layout : 1;
>
>        EPageBreak _page_break_before : 2;
>        EPageBreak _page_break_after : 2;
>
>        PseudoId _styleType : 3;
>        bool _affectedByHover : 1;
>        bool _affectedByActive : 1;
>        bool _affectedByDrag : 1;
>        int _pseudoBits : 6;
>        EUnicodeBidi _unicodeBidi : 2;
>    } noninherited_flags;
>
> On wince platform , any code access to bit field in this struct ,  
> such as
>
> EDisplay _effectiveDisplay : 5;
>
> will produce asm code like this
>
> EDisplay dis = noninherited_flags. effectiveDisplay;
>
> mov r3 lsl #27
> mov r3 asr #27
> str r3 [sp]  // write to stack variable
>
> this problem is the ASR instruction. If _effectiveDisplay contain a  
> value
> big than 0x0f, such as 0x1x, the ASR instruction will cause the high  
> bits
> fill with 1 , for example, if _effectiveDisplay equal EDisplay::NONE  
> or
> EDisplay::INLINEBOX,  EDisplay dis will EQUALS -14 or -13, not a valid
> value.
>
> How to solve this problem? thanks a lot!
>
>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-dev



More information about the webkit-dev mailing list