Commit 676ab7fa authored by hyatt@apple.com's avatar hyatt@apple.com

WebCore:

2008-10-10  David Hyatt  <hyatt@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=21522

        Support increment/decrement/start/end on scrollbars.  Allows a fully functional scrollbar to be
        created.  (Just :hover/:active left to finish it up.)

        Reviewed by Adam Roben

        Added scrollbars/scrollbar-buttons.html

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::SelectorChecker::checkScrollbarPseudoClass):

LayoutTests:

2008-10-10  David Hyatt  <hyatt@apple.com>

        Add test for scrollbar buttons and track supporting increment/decrement/start/end.

        Reviewed by Adam Roben

        * platform/mac/scrollbars/scrollbar-buttons-expected.checksum: Added.
        * platform/mac/scrollbars/scrollbar-buttons-expected.png: Added.
        * platform/mac/scrollbars/scrollbar-buttons-expected.txt: Added.
        * scrollbars/scrollbar-buttons.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 12e8df61
2008-10-10 David Hyatt <hyatt@apple.com>
Add test for scrollbar buttons and track supporting increment/decrement/start/end.
Reviewed by Adam Roben
* platform/mac/scrollbars/scrollbar-buttons-expected.checksum: Added.
* platform/mac/scrollbars/scrollbar-buttons-expected.png: Added.
* platform/mac/scrollbars/scrollbar-buttons-expected.txt: Added.
* scrollbars/scrollbar-buttons.html: Added.
2008-10-09 David Hyatt <hyatt@apple.com>
Add layout test for scrollbars honoring orientation and window active state.
......
2ad89abe82cb8e797384610634af09e4
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
layer at (8,8) size 200x200 clip at (8,8) size 183x200 scrollWidth 317 scrollHeight 792
RenderBlock {DIV} at (0,0) size 200x200
RenderText {#text} at (0,0) size 35x18
text run at (0,0) width 35: "Hello"
RenderBR {BR} at (35,14) size 0x0
RenderText {#text} at (0,18) size 35x18
text run at (0,18) width 35: "Hello"
RenderBR {BR} at (35,32) size 0x0
RenderText {#text} at (0,36) size 35x18
text run at (0,36) width 35: "Hello"
RenderBR {BR} at (35,50) size 0x0
RenderText {#text} at (0,54) size 35x18
text run at (0,54) width 35: "Hello"
RenderBR {BR} at (35,68) size 0x0
RenderText {#text} at (0,72) size 35x18
text run at (0,72) width 35: "Hello"
RenderBR {BR} at (35,86) size 0x0
RenderText {#text} at (0,90) size 35x18
text run at (0,90) width 35: "Hello"
RenderBR {BR} at (35,104) size 0x0
RenderText {#text} at (0,108) size 35x18
text run at (0,108) width 35: "Hello"
RenderBR {BR} at (35,122) size 0x0
RenderText {#text} at (0,126) size 35x18
text run at (0,126) width 35: "Hello"
RenderBR {BR} at (35,140) size 0x0
RenderText {#text} at (0,144) size 35x18
text run at (0,144) width 35: "Hello"
RenderBR {BR} at (35,158) size 0x0
RenderText {#text} at (0,162) size 35x18
text run at (0,162) width 35: "Hello"
RenderBR {BR} at (35,176) size 0x0
RenderText {#text} at (0,180) size 35x18
text run at (0,180) width 35: "Hello"
RenderBR {BR} at (35,194) size 0x0
RenderText {#text} at (0,198) size 35x18
text run at (0,198) width 35: "Hello"
RenderBR {BR} at (35,212) size 0x0
RenderText {#text} at (0,216) size 35x18
text run at (0,216) width 35: "Hello"
RenderBR {BR} at (35,230) size 0x0
RenderText {#text} at (0,234) size 35x18
text run at (0,234) width 35: "Hello"
RenderBR {BR} at (35,248) size 0x0
RenderText {#text} at (0,252) size 35x18
text run at (0,252) width 35: "Hello"
RenderBR {BR} at (35,266) size 0x0
RenderText {#text} at (0,270) size 35x18
text run at (0,270) width 35: "Hello"
RenderBR {BR} at (35,284) size 0x0
RenderInline {SPAN} at (0,0) size 317x18
RenderText {#text} at (0,288) size 317x18
text run at (0,288) width 317: "Hello world this is a long string and will not wrap."
RenderText {#text} at (0,306) size 35x18
text run at (0,306) width 35: "Hello"
RenderBR {BR} at (35,320) size 0x0
RenderText {#text} at (0,324) size 35x18
text run at (0,324) width 35: "Hello"
RenderBR {BR} at (35,338) size 0x0
RenderText {#text} at (0,342) size 35x18
text run at (0,342) width 35: "Hello"
RenderBR {BR} at (35,356) size 0x0
RenderText {#text} at (0,360) size 35x18
text run at (0,360) width 35: "Hello"
RenderBR {BR} at (35,374) size 0x0
RenderText {#text} at (0,378) size 35x18
text run at (0,378) width 35: "Hello"
RenderBR {BR} at (35,392) size 0x0
RenderText {#text} at (0,396) size 35x18
text run at (0,396) width 35: "Hello"
RenderBR {BR} at (35,410) size 0x0
RenderText {#text} at (0,414) size 35x18
text run at (0,414) width 35: "Hello"
RenderBR {BR} at (35,428) size 0x0
RenderText {#text} at (0,432) size 35x18
text run at (0,432) width 35: "Hello"
RenderBR {BR} at (35,446) size 0x0
RenderText {#text} at (0,450) size 35x18
text run at (0,450) width 35: "Hello"
RenderBR {BR} at (35,464) size 0x0
RenderText {#text} at (0,468) size 35x18
text run at (0,468) width 35: "Hello"
RenderBR {BR} at (35,482) size 0x0
RenderText {#text} at (0,486) size 35x18
text run at (0,486) width 35: "Hello"
RenderBR {BR} at (35,500) size 0x0
RenderText {#text} at (0,504) size 35x18
text run at (0,504) width 35: "Hello"
RenderBR {BR} at (35,518) size 0x0
RenderText {#text} at (0,522) size 35x18
text run at (0,522) width 35: "Hello"
RenderBR {BR} at (35,536) size 0x0
RenderText {#text} at (0,540) size 35x18
text run at (0,540) width 35: "Hello"
RenderBR {BR} at (35,554) size 0x0
RenderText {#text} at (0,558) size 35x18
text run at (0,558) width 35: "Hello"
RenderBR {BR} at (35,572) size 0x0
RenderText {#text} at (0,576) size 35x18
text run at (0,576) width 35: "Hello"
RenderBR {BR} at (35,590) size 0x0
RenderText {#text} at (0,594) size 35x18
text run at (0,594) width 35: "Hello"
RenderBR {BR} at (35,608) size 0x0
RenderText {#text} at (0,612) size 35x18
text run at (0,612) width 35: "Hello"
RenderBR {BR} at (35,626) size 0x0
RenderText {#text} at (0,630) size 35x18
text run at (0,630) width 35: "Hello"
RenderBR {BR} at (35,644) size 0x0
RenderText {#text} at (0,648) size 35x18
text run at (0,648) width 35: "Hello"
RenderBR {BR} at (35,662) size 0x0
RenderText {#text} at (0,666) size 35x18
text run at (0,666) width 35: "Hello"
RenderBR {BR} at (35,680) size 0x0
RenderText {#text} at (0,684) size 35x18
text run at (0,684) width 35: "Hello"
RenderBR {BR} at (35,698) size 0x0
RenderText {#text} at (0,702) size 35x18
text run at (0,702) width 35: "Hello"
RenderBR {BR} at (35,716) size 0x0
RenderText {#text} at (0,720) size 35x18
text run at (0,720) width 35: "Hello"
RenderBR {BR} at (35,734) size 0x0
RenderText {#text} at (0,738) size 35x18
text run at (0,738) width 35: "Hello"
RenderBR {BR} at (35,752) size 0x0
RenderText {#text} at (0,756) size 35x18
text run at (0,756) width 35: "Hello"
RenderBR {BR} at (35,770) size 0x0
RenderText {#text} at (0,774) size 35x18
text run at (0,774) width 35: "Hello"
RenderBR {BR} at (35,788) size 0x0
<head>
<style>
div::-webkit-scrollbar {
width:17px;
height:17px;
}
div::-webkit-scrollbar-button {
display: block;
width: 17px;
height: 17px;
}
div::-webkit-scrollbar-button:-webkit-decrement:-webkit-start {
background-color:lightblue;
border:2px solid black;
}
div::-webkit-scrollbar-button:-webkit-increment:-webkit-start {
background-color:lightgreen;
border:2px solid black;
}
div::-webkit-scrollbar-button:-webkit-decrement:-webkit-end {
background-color:orange;
border:2px solid black;
}
div::-webkit-scrollbar-button:-webkit-increment:-webkit-end {
background-color:brown;
border:2px solid black;
}
div::-webkit-scrollbar-thumb {
min-width:20px;
min-height:20px;
background-color: navy;
border:2px solid #cccccc;
}
div::-webkit-scrollbar-track-piece:-webkit-decrement {
background-color: olive;
}
div::-webkit-scrollbar-track-piece:-webkit-increment {
background-color: pink;
}
</style>
</head>
<body>
<div style="width:200px; height:200px; overflow-y:scroll; overflow-x:hidden">
Hello<br>
Hello<br>Hello<br>Hello<br>Hello<br>Hello<br>Hello<br>Hello<br>
Hello<br>Hello<br>Hello<br>Hello<br>
Hello<br>Hello<br>Hello<br>Hello<br>
<span style="white-space:nowrap">Hello world this is a long string and will not wrap.</span>
Hello<br>Hello<br>Hello<br>Hello<br>
Hello<br>Hello<br>Hello<br>Hello<br>Hello<br>Hello<br>
Hello<br>Hello<br>Hello<br>Hello<br>
Hello<br>Hello<br>Hello<br>Hello<br>Hello<br>Hello<br>
Hello<br>Hello<br>Hello<br>Hello<br>
Hello<br>Hello<br>Hello<br>
</div>
2008-10-10 David Hyatt <hyatt@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=21522
Support increment/decrement/start/end on scrollbars. Allows a fully functional scrollbar to be
created. (Just :hover/:active left to finish it up.)
Reviewed by Adam Roben
Added scrollbars/scrollbar-buttons.html
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::SelectorChecker::checkScrollbarPseudoClass):
2008-10-10 David Hyatt <hyatt@apple.com>
Rename some pseudoclasses. Removing "-scrollbar-" from a bunch of the pseudoclasses. Renaming
......
......@@ -2383,7 +2383,8 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
bool CSSStyleSelector::SelectorChecker::checkScrollbarPseudoClass(CSSSelector* sel, RenderStyle::PseudoId& dynamicPseudo) const
{
RenderScrollbar* scrollbar = RenderScrollbar::scrollbarForStyleResolve();
ScrollbarPart part = RenderScrollbar::partForStyleResolve();
ASSERT(sel->m_match == CSSSelector::PseudoClass && scrollbar);
switch (sel->pseudoType()) {
case CSSSelector::PseudoEnabled:
......@@ -2394,6 +2395,14 @@ bool CSSStyleSelector::SelectorChecker::checkScrollbarPseudoClass(CSSSelector* s
return scrollbar->orientation() == HorizontalScrollbar;
case CSSSelector::PseudoVertical:
return scrollbar->orientation() == VerticalScrollbar;
case CSSSelector::PseudoDecrement:
return part == BackButtonStartPart || part == BackButtonEndPart || part == BackTrackPart;
case CSSSelector::PseudoIncrement:
return part == ForwardButtonStartPart || part == ForwardButtonEndPart || part == ForwardTrackPart;
case CSSSelector::PseudoStart:
return part == BackButtonStartPart || part == ForwardButtonStartPart;
case CSSSelector::PseudoEnd:
return part == BackButtonEndPart || part == ForwardButtonEndPart;
case CSSSelector::PseudoWindowInactive:
return !scrollbar->isWindowActive();
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment