#NEWLINE# @ register_computer ( 'border-top-width' ) #NEWLINE# @ register_computer ( 'border-right-width' ) #NEWLINE# @ register_computer ( 'border-left-width' ) #NEWLINE# @ register_computer ( 'border-bottom-width' ) #NEWLINE# @ register_computer ( 'outline-width' ) #NEWLINE# def border_width( computer , name , value ) : #NEWLINE# #INDENT# 'Compute the ``border-*-width`` properties.' #NEWLINE# style = computer . computed [ name . replace ( 'width' , 'style' ) ] #NEWLINE# if ( name in ( 'none' , 'hidden' ) ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# if ( value in BORDER_WIDTH_KEYWORDS ) : #NEWLINE# #INDENT# return BORDER_WIDTH_KEYWORDS [ value ] #NEWLINE# #UNINDENT# if isinstance ( value , int ) : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# return length ( computer , name , value , pixels_only = True )