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 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 // scroll-behavior | 1338 // scroll-behavior |
1339 static ScrollBehavior InitialScrollBehavior() { return kScrollBehaviorAuto; } | 1339 static ScrollBehavior InitialScrollBehavior() { return kScrollBehaviorAuto; } |
1340 ScrollBehavior GetScrollBehavior() const { | 1340 ScrollBehavior GetScrollBehavior() const { |
1341 return static_cast<ScrollBehavior>( | 1341 return static_cast<ScrollBehavior>( |
1342 rare_non_inherited_data_->scroll_behavior_); | 1342 rare_non_inherited_data_->scroll_behavior_); |
1343 } | 1343 } |
1344 void SetScrollBehavior(ScrollBehavior b) { | 1344 void SetScrollBehavior(ScrollBehavior b) { |
1345 SET_VAR(rare_non_inherited_data_, scroll_behavior_, b); | 1345 SET_VAR(rare_non_inherited_data_, scroll_behavior_, b); |
1346 } | 1346 } |
1347 | 1347 |
1348 // scroll-snap-coordinate | 1348 // scroll-snap-type |
1349 static Vector<LengthPoint> InitialScrollSnapCoordinate() { | 1349 static ScrollSnapType InitialScrollSnapType() { return ScrollSnapType(); } |
1350 return Vector<LengthPoint>(); | 1350 ScrollSnapType GetScrollSnapType() const { |
| 1351 return rare_non_inherited_data_->scroll_snap_data_->type_; |
1351 } | 1352 } |
1352 const Vector<LengthPoint>& ScrollSnapCoordinate() const { | 1353 void SetScrollSnapType(const ScrollSnapType& b) { |
1353 return rare_non_inherited_data_->scroll_snap_data_->coordinates_; | 1354 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, type_, b); |
1354 } | |
1355 void SetScrollSnapCoordinate(const Vector<LengthPoint>& b) { | |
1356 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, coordinates_, | |
1357 b); | |
1358 } | 1355 } |
1359 | 1356 |
1360 // scroll-snap-destination | 1357 // Scroll Padding properties |
1361 static LengthPoint InitialScrollSnapDestination() { | 1358 static Length InitialScrollPadding() { return Length(kFixed); } |
1362 return LengthPoint(Length(0, kFixed), Length(0, kFixed)); | 1359 |
| 1360 // scroll-padding-top |
| 1361 const Length& ScrollPaddingTop() const { |
| 1362 return rare_non_inherited_data_->scroll_snap_data_->padding_.top; |
1363 } | 1363 } |
1364 const LengthPoint& ScrollSnapDestination() const { | 1364 void SetScrollPaddingTop(const Length& v) { |
1365 return rare_non_inherited_data_->scroll_snap_data_->destination_; | 1365 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, padding_.top, |
1366 } | 1366 v); |
1367 void SetScrollSnapDestination(const LengthPoint& b) { | |
1368 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, destination_, | |
1369 b); | |
1370 } | 1367 } |
1371 | 1368 |
1372 // scroll-snap-points-x | 1369 // scroll-padding-bottom |
1373 static ScrollSnapPoints InitialScrollSnapPointsX() { | 1370 const Length& ScrollPaddingBottom() const { |
1374 return ScrollSnapPoints(); | 1371 return rare_non_inherited_data_->scroll_snap_data_->padding_.bottom; |
1375 } | 1372 } |
1376 const ScrollSnapPoints& ScrollSnapPointsX() const { | 1373 void SetScrollPaddingBottom(const Length& v) { |
1377 return rare_non_inherited_data_->scroll_snap_data_->x_points_; | 1374 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, padding_.bottom, |
1378 } | 1375 v); |
1379 void SetScrollSnapPointsX(const ScrollSnapPoints& b) { | |
1380 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, x_points_, b); | |
1381 } | 1376 } |
1382 | 1377 |
1383 // scroll-snap-points-y | 1378 // scroll-padding-left |
1384 static ScrollSnapPoints InitialScrollSnapPointsY() { | 1379 const Length& ScrollPaddingLeft() const { |
1385 return ScrollSnapPoints(); | 1380 return rare_non_inherited_data_->scroll_snap_data_->padding_.left; |
1386 } | 1381 } |
1387 const ScrollSnapPoints& ScrollSnapPointsY() const { | 1382 void SetScrollPaddingLeft(const Length& v) { |
1388 return rare_non_inherited_data_->scroll_snap_data_->y_points_; | 1383 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, padding_.left, |
1389 } | 1384 v); |
1390 void SetScrollSnapPointsY(const ScrollSnapPoints& b) { | |
1391 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, y_points_, b); | |
1392 } | 1385 } |
1393 | 1386 |
1394 // scroll-snap-type | 1387 // scroll-padding-right |
1395 static ScrollSnapType InitialScrollSnapType() { return kScrollSnapTypeNone; } | 1388 const Length& ScrollPaddingRight() const { |
1396 ScrollSnapType GetScrollSnapType() const { | 1389 return rare_non_inherited_data_->scroll_snap_data_->padding_.right; |
1397 return static_cast<ScrollSnapType>( | |
1398 rare_non_inherited_data_->scroll_snap_type_); | |
1399 } | 1390 } |
1400 void SetScrollSnapType(ScrollSnapType b) { | 1391 void SetScrollPaddingRight(const Length& v) { |
1401 SET_VAR(rare_non_inherited_data_, scroll_snap_type_, b); | 1392 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, padding_.right, |
| 1393 v); |
| 1394 } |
| 1395 |
| 1396 // scroll-padding-block-start |
| 1397 const Length& ScrollPaddingBlockStart() const { |
| 1398 return IsHorizontalWritingMode() ? ScrollPaddingTop() : ScrollPaddingLeft(); |
| 1399 } |
| 1400 void SetScrollPaddingBlockStart(const Length& v) { |
| 1401 if (IsHorizontalWritingMode()) |
| 1402 SetScrollPaddingTop(v); |
| 1403 else |
| 1404 SetScrollPaddingLeft(v); |
| 1405 } |
| 1406 |
| 1407 // scroll-padding-block-end |
| 1408 const Length& ScrollPaddingBlockEnd() const { |
| 1409 return IsHorizontalWritingMode() ? ScrollPaddingBottom() |
| 1410 : ScrollPaddingRight(); |
| 1411 } |
| 1412 void SetScrollPaddingBlockEnd(const Length& v) { |
| 1413 if (IsHorizontalWritingMode()) |
| 1414 SetScrollPaddingBottom(v); |
| 1415 else |
| 1416 SetScrollPaddingRight(v); |
| 1417 } |
| 1418 |
| 1419 // scroll-padding-inline-start |
| 1420 const Length& ScrollPaddingInlineStart() const { |
| 1421 return IsHorizontalWritingMode() ? ScrollPaddingLeft() : ScrollPaddingTop(); |
| 1422 } |
| 1423 void SetScrollPaddingInlineStart(const Length& v) { |
| 1424 if (IsHorizontalWritingMode()) |
| 1425 SetScrollPaddingLeft(v); |
| 1426 else |
| 1427 SetScrollPaddingTop(v); |
| 1428 } |
| 1429 |
| 1430 // scroll-padding-inline-end |
| 1431 const Length& ScrollPaddingInlineEnd() const { |
| 1432 return IsHorizontalWritingMode() ? ScrollPaddingRight() |
| 1433 : ScrollPaddingBottom(); |
| 1434 } |
| 1435 void SetScrollPaddingInlineEnd(const Length& v) { |
| 1436 if (IsHorizontalWritingMode()) |
| 1437 SetScrollPaddingRight(v); |
| 1438 else |
| 1439 SetScrollPaddingBottom(v); |
| 1440 } |
| 1441 |
| 1442 // scroll-snap-margin |
| 1443 static Length InitialScrollSnapMargin() { return Length(kFixed); } |
| 1444 |
| 1445 // scroll-snap-margin-top |
| 1446 const Length& ScrollSnapMarginTop() const { |
| 1447 return rare_non_inherited_data_->scroll_snap_data_->margin_.top; |
| 1448 } |
| 1449 void SetScrollSnapMarginTop(const Length& v) { |
| 1450 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, margin_.top, v); |
| 1451 } |
| 1452 |
| 1453 // scroll-snap-margin-bottom |
| 1454 const Length& ScrollSnapMarginBottom() const { |
| 1455 return rare_non_inherited_data_->scroll_snap_data_->margin_.bottom; |
| 1456 } |
| 1457 void SetScrollSnapMarginBottom(const Length& v) { |
| 1458 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, margin_.bottom, |
| 1459 v); |
| 1460 } |
| 1461 |
| 1462 // scroll-snap-margin-left |
| 1463 const Length& ScrollSnapMarginLeft() const { |
| 1464 return rare_non_inherited_data_->scroll_snap_data_->margin_.left; |
| 1465 } |
| 1466 void SetScrollSnapMarginLeft(const Length& v) { |
| 1467 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, margin_.left, |
| 1468 v); |
| 1469 } |
| 1470 |
| 1471 // scroll-snap-margin-right |
| 1472 const Length& ScrollSnapMarginRight() const { |
| 1473 return rare_non_inherited_data_->scroll_snap_data_->margin_.right; |
| 1474 } |
| 1475 void SetScrollSnapMarginRight(const Length& v) { |
| 1476 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, margin_.right, |
| 1477 v); |
| 1478 } |
| 1479 |
| 1480 // scroll-snap-margin-block-start |
| 1481 const Length& ScrollSnapMarginBlockStart() const { |
| 1482 return IsHorizontalWritingMode() ? ScrollSnapMarginTop() |
| 1483 : ScrollSnapMarginLeft(); |
| 1484 } |
| 1485 void SetScrollSnapMarginBlockStart(const Length& v) { |
| 1486 if (IsHorizontalWritingMode()) |
| 1487 SetScrollSnapMarginTop(v); |
| 1488 else |
| 1489 SetScrollSnapMarginLeft(v); |
| 1490 } |
| 1491 |
| 1492 // scroll-snap-margin-block-end |
| 1493 const Length& ScrollSnapMarginBlockEnd() const { |
| 1494 return IsHorizontalWritingMode() ? ScrollSnapMarginBottom() |
| 1495 : ScrollSnapMarginRight(); |
| 1496 } |
| 1497 void SetScrollSnapMarginBlockEnd(const Length& v) { |
| 1498 if (IsHorizontalWritingMode()) |
| 1499 SetScrollSnapMarginBottom(v); |
| 1500 else |
| 1501 SetScrollSnapMarginRight(v); |
| 1502 } |
| 1503 |
| 1504 // scroll-snap-margin-inline-start |
| 1505 const Length& ScrollSnapMarginInlineStart() const { |
| 1506 return IsHorizontalWritingMode() ? ScrollSnapMarginLeft() |
| 1507 : ScrollSnapMarginTop(); |
| 1508 } |
| 1509 void SetScrollSnapMarginInlineStart(const Length& v) { |
| 1510 if (IsHorizontalWritingMode()) |
| 1511 SetScrollSnapMarginLeft(v); |
| 1512 else |
| 1513 SetScrollSnapMarginTop(v); |
| 1514 } |
| 1515 |
| 1516 // scroll-snap-margin-inline-end |
| 1517 const Length& ScrollSnapMarginInlineEnd() const { |
| 1518 return IsHorizontalWritingMode() ? ScrollSnapMarginRight() |
| 1519 : ScrollSnapMarginBottom(); |
| 1520 } |
| 1521 void SetScrollSnapMarginInlineEnd(const Length& v) { |
| 1522 if (IsHorizontalWritingMode()) |
| 1523 SetScrollSnapMarginRight(v); |
| 1524 else |
| 1525 SetScrollSnapMarginBottom(v); |
| 1526 } |
| 1527 |
| 1528 // scroll-snap-align |
| 1529 static ScrollSnapAlign InitialScrollSnapAlign() { return ScrollSnapAlign(); } |
| 1530 ScrollSnapAlign GetScrollSnapAlign() const { |
| 1531 return rare_non_inherited_data_->scroll_snap_data_->align_; |
| 1532 } |
| 1533 void SetScrollSnapAlign(const ScrollSnapAlign& b) { |
| 1534 SET_NESTED_VAR(rare_non_inherited_data_, scroll_snap_data_, align_, b); |
1402 } | 1535 } |
1403 | 1536 |
1404 // shape-image-threshold (aka -webkit-shape-image-threshold) | 1537 // shape-image-threshold (aka -webkit-shape-image-threshold) |
1405 static float InitialShapeImageThreshold() { return 0; } | 1538 static float InitialShapeImageThreshold() { return 0; } |
1406 float ShapeImageThreshold() const { | 1539 float ShapeImageThreshold() const { |
1407 return rare_non_inherited_data_->shape_image_threshold_; | 1540 return rare_non_inherited_data_->shape_image_threshold_; |
1408 } | 1541 } |
1409 void SetShapeImageThreshold(float shape_image_threshold) { | 1542 void SetShapeImageThreshold(float shape_image_threshold) { |
1410 float clamped_shape_image_threshold = | 1543 float clamped_shape_image_threshold = |
1411 clampTo<float>(shape_image_threshold, 0, 1); | 1544 clampTo<float>(shape_image_threshold, 0, 1); |
(...skipping 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3578 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3711 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
3579 } | 3712 } |
3580 | 3713 |
3581 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3714 inline bool ComputedStyle::HasPseudoElementStyle() const { |
3582 return PseudoBitsInternal() & kElementPseudoIdMask; | 3715 return PseudoBitsInternal() & kElementPseudoIdMask; |
3583 } | 3716 } |
3584 | 3717 |
3585 } // namespace blink | 3718 } // namespace blink |
3586 | 3719 |
3587 #endif // ComputedStyle_h | 3720 #endif // ComputedStyle_h |
OLD | NEW |