OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 // scroll-behavior | 1350 // scroll-behavior |
1351 static ScrollBehavior InitialScrollBehavior() { return kScrollBehaviorAuto; } | 1351 static ScrollBehavior InitialScrollBehavior() { return kScrollBehaviorAuto; } |
1352 ScrollBehavior GetScrollBehavior() const { | 1352 ScrollBehavior GetScrollBehavior() const { |
1353 return static_cast<ScrollBehavior>( | 1353 return static_cast<ScrollBehavior>( |
1354 rare_non_inherited_data_->scroll_behavior_); | 1354 rare_non_inherited_data_->scroll_behavior_); |
1355 } | 1355 } |
1356 void SetScrollBehavior(ScrollBehavior b) { | 1356 void SetScrollBehavior(ScrollBehavior b) { |
1357 SET_VAR(rare_non_inherited_data_, scroll_behavior_, b); | 1357 SET_VAR(rare_non_inherited_data_, scroll_behavior_, b); |
1358 } | 1358 } |
1359 | 1359 |
1360 // scroll-snap-coordinate | 1360 // scroll-snap-type |
1361 static Vector<LengthPoint> InitialScrollSnapCoordinate() { | 1361 static ScrollSnapType InitialScrollSnapType() { return ScrollSnapType(); } |
1362 return Vector<LengthPoint>(); | 1362 ScrollSnapType GetScrollSnapType() const { |
| 1363 return rare_non_inherited_data_->scroll_snap_data_->type_; |
1363 } | 1364 } |
1364 const Vector<LengthPoint>& ScrollSnapCoordinate() const { | 1365 void SetScrollSnapType(const ScrollSnapType& b) { |
1365 return rare_non_inherited_data_->scroll_snap_data_->coordinates_; | 1366 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, type_, b); |
1366 } | |
1367 void SetScrollSnapCoordinate(const Vector<LengthPoint>& b) { | |
1368 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, coordinates_, | |
1369 b); | |
1370 } | 1367 } |
1371 | 1368 |
1372 // scroll-snap-destination | 1369 // Scroll Padding properties |
1373 static LengthPoint InitialScrollSnapDestination() { | 1370 static Length InitialScrollPadding() { return Length(); } |
1374 return LengthPoint(Length(0, kFixed), Length(0, kFixed)); | 1371 |
| 1372 // scroll-padding-top |
| 1373 const Length& ScrollPaddingTop() const { |
| 1374 return rare_non_inherited_data_->scroll_snap_data_->padding_.top; |
1375 } | 1375 } |
1376 const LengthPoint& ScrollSnapDestination() const { | 1376 void SetScrollPaddingTop(const Length& v) { |
1377 return rare_non_inherited_data_->scroll_snap_data_->destination_; | 1377 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, padding_.top, |
1378 } | 1378 v); |
1379 void SetScrollSnapDestination(const LengthPoint& b) { | |
1380 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, destination_, | |
1381 b); | |
1382 } | 1379 } |
1383 | 1380 |
1384 // scroll-snap-points-x | 1381 // scroll-padding-bottom |
1385 static ScrollSnapPoints InitialScrollSnapPointsX() { | 1382 const Length& ScrollPaddingBottom() const { |
1386 return ScrollSnapPoints(); | 1383 return rare_non_inherited_data_->scroll_snap_data_->padding_.bottom; |
1387 } | 1384 } |
1388 const ScrollSnapPoints& ScrollSnapPointsX() const { | 1385 void SetScrollPaddingBottom(const Length& v) { |
1389 return rare_non_inherited_data_->scroll_snap_data_->x_points_; | 1386 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, padding_.bottom, |
1390 } | 1387 v); |
1391 void SetScrollSnapPointsX(const ScrollSnapPoints& b) { | |
1392 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, x_points_, b); | |
1393 } | 1388 } |
1394 | 1389 |
1395 // scroll-snap-points-y | 1390 // scroll-padding-left |
1396 static ScrollSnapPoints InitialScrollSnapPointsY() { | 1391 const Length& ScrollPaddingLeft() const { |
1397 return ScrollSnapPoints(); | 1392 return rare_non_inherited_data_->scroll_snap_data_->padding_.left; |
1398 } | 1393 } |
1399 const ScrollSnapPoints& ScrollSnapPointsY() const { | 1394 void SetScrollPaddingLeft(const Length& v) { |
1400 return rare_non_inherited_data_->scroll_snap_data_->y_points_; | 1395 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, padding_.left, |
1401 } | 1396 v); |
1402 void SetScrollSnapPointsY(const ScrollSnapPoints& b) { | |
1403 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, y_points_, b); | |
1404 } | 1397 } |
1405 | 1398 |
1406 // scroll-snap-type | 1399 // scroll-padding-right |
1407 static ScrollSnapType InitialScrollSnapType() { return kScrollSnapTypeNone; } | 1400 const Length& ScrollPaddingRight() const { |
1408 ScrollSnapType GetScrollSnapType() const { | 1401 return rare_non_inherited_data_->scroll_snap_data_->padding_.right; |
1409 return static_cast<ScrollSnapType>( | |
1410 rare_non_inherited_data_->scroll_snap_type_); | |
1411 } | 1402 } |
1412 void SetScrollSnapType(ScrollSnapType b) { | 1403 void SetScrollPaddingRight(const Length& v) { |
1413 SET_VAR(rare_non_inherited_data_, scroll_snap_type_, b); | 1404 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, padding_.right, |
| 1405 v); |
| 1406 } |
| 1407 |
| 1408 // scroll-padding-block-start |
| 1409 const Length& ScrollPaddingBlockStart() const { |
| 1410 return IsHorizontalWritingMode() ? ScrollPaddingTop() : ScrollPaddingLeft(); |
| 1411 } |
| 1412 void SetScrollPaddingBlockStart(const Length& v) { |
| 1413 if (IsHorizontalWritingMode()) |
| 1414 SetScrollPaddingTop(v); |
| 1415 else |
| 1416 SetScrollPaddingLeft(v); |
| 1417 } |
| 1418 |
| 1419 // scroll-padding-block-end |
| 1420 const Length& ScrollPaddingBlockEnd() const { |
| 1421 return IsHorizontalWritingMode() ? ScrollPaddingBottom() |
| 1422 : ScrollPaddingRight(); |
| 1423 } |
| 1424 void SetScrollPaddingBlockEnd(const Length& v) { |
| 1425 if (IsHorizontalWritingMode()) |
| 1426 SetScrollPaddingBottom(v); |
| 1427 else |
| 1428 SetScrollPaddingRight(v); |
| 1429 } |
| 1430 |
| 1431 // scroll-padding-inline-start |
| 1432 const Length& ScrollPaddingInlineStart() const { |
| 1433 return IsHorizontalWritingMode() ? ScrollPaddingLeft() : ScrollPaddingTop(); |
| 1434 } |
| 1435 void SetScrollPaddingInlineStart(const Length& v) { |
| 1436 if (IsHorizontalWritingMode()) |
| 1437 SetScrollPaddingLeft(v); |
| 1438 else |
| 1439 SetScrollPaddingTop(v); |
| 1440 } |
| 1441 |
| 1442 // scroll-padding-inline-end |
| 1443 const Length& ScrollPaddingInlineEnd() const { |
| 1444 return IsHorizontalWritingMode() ? ScrollPaddingRight() |
| 1445 : ScrollPaddingBottom(); |
| 1446 } |
| 1447 void SetScrollPaddingInlineEnd(const Length& v) { |
| 1448 if (IsHorizontalWritingMode()) |
| 1449 SetScrollPaddingRight(v); |
| 1450 else |
| 1451 SetScrollPaddingBottom(v); |
| 1452 } |
| 1453 |
| 1454 // scroll-snap-margin |
| 1455 static Length InitialScrollSnapMargin() { return Length(); } |
| 1456 |
| 1457 // scroll-snap-margin-top |
| 1458 const Length& ScrollSnapMarginTop() const { |
| 1459 return rare_non_inherited_data_->scroll_snap_data_->margin_.top; |
| 1460 } |
| 1461 void SetScrollSnapMarginTop(const Length& v) { |
| 1462 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, margin_.top, v); |
| 1463 } |
| 1464 |
| 1465 // scroll-snap-margin-bottom |
| 1466 const Length& ScrollSnapMarginBottom() const { |
| 1467 return rare_non_inherited_data_->scroll_snap_data_->margin_.bottom; |
| 1468 } |
| 1469 void SetScrollSnapMarginBottom(const Length& v) { |
| 1470 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, margin_.bottom, |
| 1471 v); |
| 1472 } |
| 1473 |
| 1474 // scroll-snap-margin-left |
| 1475 const Length& ScrollSnapMarginLeft() const { |
| 1476 return rare_non_inherited_data_->scroll_snap_data_->margin_.left; |
| 1477 } |
| 1478 void SetScrollSnapMarginLeft(const Length& v) { |
| 1479 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, margin_.left, |
| 1480 v); |
| 1481 } |
| 1482 |
| 1483 // scroll-snap-margin-right |
| 1484 const Length& ScrollSnapMarginRight() const { |
| 1485 return rare_non_inherited_data_->scroll_snap_data_->margin_.right; |
| 1486 } |
| 1487 void SetScrollSnapMarginRight(const Length& v) { |
| 1488 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, margin_.right, |
| 1489 v); |
| 1490 } |
| 1491 |
| 1492 // scroll-snap-margin-block-start |
| 1493 const Length& ScrollSnapMarginBlockStart() const { |
| 1494 return IsHorizontalWritingMode() ? ScrollSnapMarginTop() |
| 1495 : ScrollSnapMarginLeft(); |
| 1496 } |
| 1497 void SetScrollSnapMarginBlockStart(const Length& v) { |
| 1498 if (IsHorizontalWritingMode()) |
| 1499 SetScrollSnapMarginTop(v); |
| 1500 else |
| 1501 SetScrollSnapMarginLeft(v); |
| 1502 } |
| 1503 |
| 1504 // scroll-snap-margin-block-end |
| 1505 const Length& ScrollSnapMarginBlockEnd() const { |
| 1506 return IsHorizontalWritingMode() ? ScrollSnapMarginBottom() |
| 1507 : ScrollSnapMarginRight(); |
| 1508 } |
| 1509 void SetScrollSnapMarginBlockEnd(const Length& v) { |
| 1510 if (IsHorizontalWritingMode()) |
| 1511 SetScrollSnapMarginBottom(v); |
| 1512 else |
| 1513 SetScrollSnapMarginRight(v); |
| 1514 } |
| 1515 |
| 1516 // scroll-snap-margin-inline-start |
| 1517 const Length& ScrollSnapMarginInlineStart() const { |
| 1518 return IsHorizontalWritingMode() ? ScrollSnapMarginLeft() |
| 1519 : ScrollSnapMarginTop(); |
| 1520 } |
| 1521 void SetScrollSnapMarginInlineStart(const Length& v) { |
| 1522 if (IsHorizontalWritingMode()) |
| 1523 SetScrollSnapMarginLeft(v); |
| 1524 else |
| 1525 SetScrollSnapMarginTop(v); |
| 1526 } |
| 1527 |
| 1528 // scroll-snap-margin-inline-end |
| 1529 const Length& ScrollSnapMarginInlineEnd() const { |
| 1530 return IsHorizontalWritingMode() ? ScrollSnapMarginRight() |
| 1531 : ScrollSnapMarginBottom(); |
| 1532 } |
| 1533 void SetScrollSnapMarginInlineEnd(const Length& v) { |
| 1534 if (IsHorizontalWritingMode()) |
| 1535 SetScrollSnapMarginRight(v); |
| 1536 else |
| 1537 SetScrollSnapMarginBottom(v); |
| 1538 } |
| 1539 |
| 1540 // scroll-snap-align |
| 1541 static ScrollSnapAlign InitialScrollSnapAlign() { return ScrollSnapAlign(); } |
| 1542 ScrollSnapAlign GetScrollSnapAlign() const { |
| 1543 return rare_non_inherited_data_->scroll_snap_data_->align_; |
| 1544 } |
| 1545 void SetScrollSnapAlign(const ScrollSnapAlign& b) { |
| 1546 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, align_, b); |
1414 } | 1547 } |
1415 | 1548 |
1416 // shape-image-threshold (aka -webkit-shape-image-threshold) | 1549 // shape-image-threshold (aka -webkit-shape-image-threshold) |
1417 static float InitialShapeImageThreshold() { return 0; } | 1550 static float InitialShapeImageThreshold() { return 0; } |
1418 float ShapeImageThreshold() const { | 1551 float ShapeImageThreshold() const { |
1419 return rare_non_inherited_data_->shape_image_threshold_; | 1552 return rare_non_inherited_data_->shape_image_threshold_; |
1420 } | 1553 } |
1421 void SetShapeImageThreshold(float shape_image_threshold) { | 1554 void SetShapeImageThreshold(float shape_image_threshold) { |
1422 float clamped_shape_image_threshold = | 1555 float clamped_shape_image_threshold = |
1423 clampTo<float>(shape_image_threshold, 0, 1); | 1556 clampTo<float>(shape_image_threshold, 0, 1); |
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3617 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3750 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
3618 } | 3751 } |
3619 | 3752 |
3620 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3753 inline bool ComputedStyle::HasPseudoElementStyle() const { |
3621 return PseudoBitsInternal() & kElementPseudoIdMask; | 3754 return PseudoBitsInternal() & kElementPseudoIdMask; |
3622 } | 3755 } |
3623 | 3756 |
3624 } // namespace blink | 3757 } // namespace blink |
3625 | 3758 |
3626 #endif // ComputedStyle_h | 3759 #endif // ComputedStyle_h |
OLD | NEW |