QUERYVALUE_TESTS = {
'id': 'QV',
'caption': 'queryCommandValue Tests',
'checkAttrs': False,
'checkStyle': False,
'styleWithCSS': False,
'Proposed': [
{ 'desc': '',
'tests': [
]
},
{ 'desc': '[HTML5] query bold value',
'qcvalue': 'bold',
'tests': [
{ 'id': 'B_TEXT_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'false' },
{ 'id': 'B_B-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'true' },
{ 'id': 'B_STRONG-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'true' },
{ 'id': 'B_SPANs:fw:b-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'true' },
{ 'id': 'B_SPANs:fw:n-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'false' },
{ 'id': 'B_Bs:fw:n-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'false' },
{ 'id': 'B_SPAN.b-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'true' },
{ 'id': 'B_MYB-1-SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'true' }
]
},
{ 'desc': '[HTML5] query italic value',
'qcvalue': 'italic',
'tests': [
{ 'id': 'I_TEXT_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'false' },
{ 'id': 'I_I-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'true' },
{ 'id': 'I_EM-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'true' },
{ 'id': 'I_SPANs:fs:i-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'true' },
{ 'id': 'I_SPANs:fs:n-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'false' },
{ 'id': 'I_I-SPANs:fs:n-1_SI',
'desc': 'query the "bold" value',
'pad': 'foo[bar]baz',
'expected': 'false' },
{ 'id': 'I_SPAN.i-1_SI',
'desc': 'query the "italic" value',
'pad': 'foo[bar]baz',
'expected': 'true' },
{ 'id': 'I_MYI-1-SI',
'desc': 'query the "italic" value',
'pad': 'foo[bar]baz',
'expected': 'true' }
]
},
{ 'desc': '[HTML5] query block formatting value',
'qcvalue': 'formatblock',
'tests': [
{ 'id': 'FB_TEXT-1_SC',
'desc': 'query the "formatBlock" value',
'pad': 'foobar^baz',
'expected': '',
'accept': 'normal' },
{ 'id': 'FB_H1-1_SC',
'desc': 'query the "formatBlock" value',
'pad': '
foobar^baz
',
'expected': 'h1' },
{ 'id': 'FB_PRE-1_SC',
'desc': 'query the "formatBlock" value',
'pad': 'foobar^baz
',
'expected': 'pre' },
{ 'id': 'FB_BQ-1_SC',
'desc': 'query the "formatBlock" value',
'pad': 'foobar^baz
',
'expected': 'blockquote' },
{ 'id': 'FB_ADDRESS-1_SC',
'desc': 'query the "formatBlock" value',
'pad': 'foobar^baz',
'expected': 'address' },
{ 'id': 'FB_H1-H2-1_SC',
'desc': 'query the "formatBlock" value',
'pad': 'fooba^r
baz
',
'expected': 'h2' },
{ 'id': 'FB_H1-H2-1_SL',
'desc': 'query the "formatBlock" value on oblique selection (outermost formatting expected)',
'pad': 'fo[oba]r
baz
',
'expected': 'h1' },
{ 'id': 'FB_H1-H2-1_SR',
'desc': 'query the "formatBlock" value on oblique selection (outermost formatting expected)',
'pad': 'foob[ar
ba]z
',
'expected': 'h1' },
{ 'id': 'FB_TEXT-ADDRESS-1_SL',
'desc': 'query the "formatBlock" value on oblique selection (outermost formatting expected)',
'pad': 'fo[oba]rbaz',
'expected': '',
'accept': 'normal' },
{ 'id': 'FB_TEXT-ADDRESS-1_SR',
'desc': 'query the "formatBlock" value on oblique selection (outermost formatting expected)',
'pad': 'foob[arba]z',
'expected': '',
'accept': 'normal' },
{ 'id': 'FB_H1-H2.TEXT.H2-1_SM',
'desc': 'query the "formatBlock" value on oblique selection (outermost formatting expected)',
'pad': 'fo[o
barb]az
',
'expected': 'h1' }
]
},
{ 'desc': '[MIDAS] query heading type',
'qcvalue': 'heading',
'tests': [
{ 'id': 'H_H1-1_SC',
'desc': 'query the "heading" type',
'pad': 'foobar^baz
',
'expected': 'h1',
'accept': '' },
{ 'id': 'H_H3-1_SC',
'desc': 'query the "heading" type',
'pad': 'foobar^baz
',
'expected': 'h3',
'accept': '' },
{ 'id': 'H_H1-H2-H3-H4-1_SC',
'desc': 'query the "heading" type within nested heading tags',
'pad': 'foobar^baz
',
'expected': 'h4',
'accept': '' },
{ 'id': 'H_P-1_SC',
'desc': 'query the "heading" type outside of a heading',
'pad': '
foobar^baz
',
'expected': '' }
]
},
{ 'desc': '[MIDAS] query font name',
'qcvalue': 'fontname',
'tests': [
{ 'id': 'FN_FONTf:a-1_SI',
'rte1-id': 'q-fontname-0',
'desc': 'query the "fontname" value',
'pad': 'foo[bar]baz',
'expected': 'arial' },
{ 'id': 'FN_SPANs:ff:a-1_SI',
'rte1-id': 'q-fontname-1',
'desc': 'query the "fontname" value',
'pad': 'foo[bar]baz',
'expected': 'arial' },
{ 'id': 'FN_FONTf:a.s:ff:c-1_SI',
'rte1-id': 'q-fontname-2',
'desc': 'query the "fontname" value',
'pad': 'foo[bar]baz',
'expected': 'courier' },
{ 'id': 'FN_FONTf:a-FONTf:c-1_SI',
'rte1-id': 'q-fontname-3',
'desc': 'query the "fontname" value',
'pad': 'foo[bar]baz',
'expected': 'courier' },
{ 'id': 'FN_SPANs:ff:c-FONTf:a-1_SI',
'rte1-id': 'q-fontname-4',
'desc': 'query the "fontname" value',
'pad': 'foo[bar]baz',
'expected': 'arial' },
{ 'id': 'FN_SPAN.fs18px-1_SI',
'desc': 'query the "fontname" value',
'pad': 'foo[bar]baz',
'expected': 'courier' },
{ 'id': 'FN_MYCOURIER-1-SI',
'desc': 'query the "fontname" value',
'pad': 'foo[bar]baz',
'expected': 'courier' }
]
},
{ 'desc': '[MIDAS] query font size',
'qcvalue': 'fontsize',
'tests': [
{ 'id': 'FS_FONTsz:4-1_SI',
'rte1-id': 'q-fontsize-0',
'desc': 'query the "fontsize" value',
'pad': 'foo[bar]baz',
'expected': '18px' },
{ 'id': 'FS_FONTs:fs:l-1_SI',
'desc': 'query the "fontsize" value',
'pad': 'foo[bar]baz',
'expected': '18px' },
{ 'id': 'FS_FONT.ass.s:fs:l-1_SI',
'rte1-id': 'q-fontsize-1',
'desc': 'query the "fontsize" value',
'pad': 'foo[bar]baz',
'expected': '18px' },
{ 'id': 'FS_FONTsz:1.s:fs:xl-1_SI',
'rte1-id': 'q-fontsize-2',
'desc': 'query the "fontsize" value',
'pad': 'foo[bar]baz',
'expected': '24px' },
{ 'id': 'FS_SPAN.large-1_SI',
'desc': 'query the "fontsize" value',
'pad': 'foo[bar]baz',
'expected': 'large' },
{ 'id': 'FS_SPAN.fs18px-1_SI',
'desc': 'query the "fontsize" value',
'pad': 'foo[bar]baz',
'expected': '18px' },
{ 'id': 'FA_MYLARGE-1-SI',
'desc': 'query the "fontsize" value',
'pad': 'foo[bar]baz',
'expected': 'large' },
{ 'id': 'FA_MYFS18PX-1-SI',
'desc': 'query the "fontsize" value',
'pad': 'foo[bar]baz',
'expected': '18px' }
]
},
{ 'desc': '[MIDAS] query background color',
'qcvalue': 'backcolor',
'tests': [
{ 'id': 'BC_FONTs:bc:fca-1_SI',
'rte1-id': 'q-backcolor-0',
'desc': 'query the "backcolor" value',
'pad': 'foo[bar]baz',
'expected': '#ffccaa' },
{ 'id': 'BC_SPANs:bc:abc-1_SI',
'rte1-id': 'q-backcolor-2',
'desc': 'query the "backcolor" value',
'pad': 'foo[bar]baz',
'expected': '#aabbcc' },
{ 'id': 'BC_FONTs:bc:084-SPAN-1_SI',
'desc': 'query the "backcolor" value, where the color was set on an ancestor',
'pad': 'foo[bar]baz',
'expected': '#008844' },
{ 'id': 'BC_SPANs:bc:cde-SPAN-1_SI',
'desc': 'query the "backcolor" value, where the color was set on an ancestor',
'pad': 'foo[bar]baz',
'expected': '#ccddee' },
{ 'id': 'BC_SPAN.ass.s:bc:rgb-1_SI',
'rte1-id': 'q-backcolor-1',
'desc': 'query the "backcolor" value',
'pad': 'foo[bar]baz',
'expected': '#ff0000' },
{ 'id': 'BC_SPAN.bcred-1_SI',
'desc': 'query the "backcolor" value',
'pad': 'foo[bar]baz',
'expected': 'red' },
{ 'id': 'BC_MYBCRED-1-SI',
'desc': 'query the "backcolor" value',
'pad': 'foo[bar]baz',
'expected': 'red' }
]
},
{ 'desc': '[MIDAS] query text color',
'qcvalue': 'forecolor',
'tests': [
{ 'id': 'FC_FONTc:f00-1_SI',
'rte1-id': 'q-forecolor-0',
'desc': 'query the "forecolor" value',
'pad': 'foo[bar]baz',
'expected': '#ff0000' },
{ 'id': 'FC_SPANs:c:0f0-1_SI',
'rte1-id': 'q-forecolor-1',
'desc': 'query the "forecolor" value',
'pad': 'foo[bar]baz',
'expected': '#00ff00' },
{ 'id': 'FC_FONTc:333.s:c:999-1_SI',
'rte1-id': 'q-forecolor-2',
'desc': 'query the "forecolor" value',
'pad': 'foo[bar]baz',
'expected': '#999999' },
{ 'id': 'FC_FONTc:641-SPAN-1_SI',
'desc': 'query the "forecolor" value, where the color was set on an ancestor',
'pad': 'foo[bar]baz',
'expected': '#664411' },
{ 'id': 'FC_SPANs:c:d95-SPAN-1_SI',
'desc': 'query the "forecolor" value, where the color was set on an ancestor',
'pad': 'foo[bar]baz',
'expected': '#dd9955' },
{ 'id': 'FC_SPAN.red-1_SI',
'desc': 'query the "forecolor" value',
'pad': 'foo[bar]baz',
'expected': 'red' },
{ 'id': 'FC_MYRED-1-SI',
'desc': 'query the "forecolor" value',
'pad': 'foo[bar]baz',
'expected': 'red' }
]
},
{ 'desc': '[MIDAS] query hilight color (same as background color)',
'qcvalue': 'hilitecolor',
'tests': [
{ 'id': 'HC_FONTs:bc:fc0-1_SI',
'rte1-id': 'q-hilitecolor-0',
'desc': 'query the "hilitecolor" value',
'pad': 'foo[bar]baz',
'expected': '#ffcc00' },
{ 'id': 'HC_SPANs:bc:a0c-1_SI',
'rte1-id': 'q-hilitecolor-2',
'desc': 'query the "hilitecolor" value',
'pad': 'foo[bar]baz',
'expected': '#aa00cc' },
{ 'id': 'HC_SPAN.ass.s:bc:rgb-1_SI',
'rte1-id': 'q-hilitecolor-1',
'desc': 'query the "hilitecolor" value',
'pad': 'foo[bar]baz',
'expected': '#ff0000' },
{ 'id': 'HC_FONTs:bc:83e-SPAN-1_SI',
'desc': 'query the "hilitecolor" value, where the color was set on an ancestor',
'pad': 'foo[bar]baz',
'expected': '#8833ee' },
{ 'id': 'HC_SPANs:bc:b12-SPAN-1_SI',
'desc': 'query the "hilitecolor" value, where the color was set on an ancestor',
'pad': 'foo[bar]baz',
'expected': '#bb1122' },
{ 'id': 'HC_SPAN.bcred-1_SI',
'desc': 'query the "hilitecolor" value',
'pad': 'foo[bar]baz',
'expected': 'red' },
{ 'id': 'HC_MYBCRED-1-SI',
'desc': 'query the "hilitecolor" value',
'pad': 'foo[bar]baz',
'expected': 'red' }
]
}
]
}
QUERYVALUE_TESTS_CSS = {
'id': 'QVC',
'caption': 'queryCommandValue Tests, using styleWithCSS',
'checkAttrs': False,
'checkStyle': False,
'styleWithCSS': True,
'Proposed': QUERYVALUE_TESTS['Proposed']
}