Skip to content

css align 3 #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions org/w3c/css/properties/CSS3Properties.properties
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,27 @@ grid-auto-flow: org.w3c.css.properties.css3.CssGridAutoF
grid-auto-rows: org.w3c.css.properties.css3.CssGridAutoRows
grid-column: org.w3c.css.properties.css3.CssGridColumn
grid-column-end: org.w3c.css.properties.css3.CssGridColumnEnd
grid-column-gap: org.w3c.css.properties.css3.CssGridColumnGap
grid-column-gap: org.w3c.css.properties.css3.CssColumnGap
grid-column-start: org.w3c.css.properties.css3.CssGridColumnStart
grid-gap: org.w3c.css.properties.css3.CssGridGap
grid-gap: org.w3c.css.properties.css3.CssGap
grid-row: org.w3c.css.properties.css3.CssGridRow
grid-row-end: org.w3c.css.properties.css3.CssGridRowEnd
grid-row-gap: org.w3c.css.properties.css3.CssGridRowGap
grid-row-gap: org.w3c.css.properties.css3.CssRowGap
grid-row-start: org.w3c.css.properties.css3.CssGridRowStart
grid-template: org.w3c.css.properties.css3.CssGridTemplate
grid-template-areas: org.w3c.css.properties.css3.CssGridTemplateAreas
grid-template-columns: org.w3c.css.properties.css3.CssGridTemplateColumns
grid-template-rows: org.w3c.css.properties.css3.CssGridTemplateRows

# align
row-gap: org.w3c.css.properties.css3.CssRowGap
gap: org.w3c.css.properties.css3.CssGap
justify-items: org.w3c.css.properties.css3.CssJustifyItems
justify-self: org.w3c.css.properties.css3.CssJustifySelf
place-content: org.w3c.css.properties.css3.CssPlaceContent
place-items: org.w3c.css.properties.css3.CssPlaceItems
place-self: org.w3c.css.properties.css3.CssPlaceSelf

# text properties

text-shadow: org.w3c.css.properties.css3.CssTextShadow
Expand Down
15 changes: 12 additions & 3 deletions org/w3c/css/properties/CSS3SVGProperties.properties
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,27 @@ grid-auto-flow: org.w3c.css.properties.css3.CssGridAutoF
grid-auto-rows: org.w3c.css.properties.css3.CssGridAutoRows
grid-column: org.w3c.css.properties.css3.CssGridColumn
grid-column-end: org.w3c.css.properties.css3.CssGridColumnEnd
grid-column-gap: org.w3c.css.properties.css3.CssGridColumnGap
grid-column-gap: org.w3c.css.properties.css3.CssColumnGap
grid-column-start: org.w3c.css.properties.css3.CssGridColumnStart
grid-gap: org.w3c.css.properties.css3.CssGridGap
grid-gap: org.w3c.css.properties.css3.CssGap
grid-row: org.w3c.css.properties.css3.CssGridRow
grid-row-end: org.w3c.css.properties.css3.CssGridRowEnd
grid-row-gap: org.w3c.css.properties.css3.CssGridRowGap
grid-row-gap: org.w3c.css.properties.css3.CssRowGap
grid-row-start: org.w3c.css.properties.css3.CssGridRowStart
grid-template: org.w3c.css.properties.css3.CssGridTemplate
grid-template-areas: org.w3c.css.properties.css3.CssGridTemplateAreas
grid-template-columns: org.w3c.css.properties.css3.CssGridTemplateColumns
grid-template-rows: org.w3c.css.properties.css3.CssGridTemplateRows

# align
row-gap: org.w3c.css.properties.css3.CssRowGap
gap: org.w3c.css.properties.css3.CssGap
justify-items: org.w3c.css.properties.css3.CssJustifyItems
justify-self: org.w3c.css.properties.css3.CssJustifySelf
place-content: org.w3c.css.properties.css3.CssPlaceContent
place-items: org.w3c.css.properties.css3.CssPlaceItems
place-self: org.w3c.css.properties.css3.CssPlaceSelf

# text properties

text-shadow: org.w3c.css.properties.css3.CssTextShadow
Expand Down
118 changes: 118 additions & 0 deletions org/w3c/css/properties/css/CssGap.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
//
// Author: Yves Lafon <ylafon@w3.org>
//
// COPYRIGHT (c) 2018 World Wide Web Consortium, (MIT, ERCIM, Keio, Beihang)
// Please first read the full copyright statement in file COPYRIGHT.html

package org.w3c.css.properties.css;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css3.Css3Style;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;

/**
* @since CSS3
*/

public class CssGap extends CssProperty {

private static final String propertyName = "gap";

public CssValue value;

/**
* Create a new CssGap
*/
public CssGap() {
}

/**
* Create a new CssGap
*/
public CssGap(ApplContext ac, CssExpression expression,
boolean check) throws InvalidParamException {

throw new InvalidParamException("unrecognize", ac);
}

public CssGap(ApplContext ac, CssExpression expression)
throws InvalidParamException {
this(ac, expression, false);
}

/**
* Add this property to the CssStyle.
*
* @param style The CssStyle
*/
public void addToStyle(ApplContext ac, CssStyle style) {
if (((Css3Style) style).cssGap != null)
style.addRedefinitionWarning(ac, this);
((Css3Style) style).cssGap = this;

}

/**
* Get this property in the style.
*
* @param style The style where the property is
* @param resolve if true, resolve the style to find this property
*/
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
if (resolve) {
return ((Css3Style) style).getGap();
} else {
return ((Css3Style) style).cssGap;
}
}

/**
* Compares two properties for equality.
*
* @param property The other property.
*/
public boolean equals(CssProperty property) {
return (property instanceof CssGap &&
value.equals(((CssGap) property).value));
}

/**
* Returns the name of this property
*/
public final String getPropertyName() {
return propertyName;
}

/**
* Returns the value of this property
*/
public Object get() {
return value;
}

/**
* Returns true if this property is "softly" inherited
*/
public boolean isSoftlyInherited() {
return (inherit == value);
}

/**
* Returns a string representation of the object
*/
public String toString() {
return value.toString();
}

/**
* Is the value of this property a default value
* It is used by all macro for the function <code>print</code>
*/
public boolean isDefault() {
return false;
}

}
116 changes: 116 additions & 0 deletions org/w3c/css/properties/css/CssJustifyItems.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
//
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM, Keio, Beihang, 2018.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css3.Css3Style;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;

/**
* @since CSS3
*/
public class CssJustifyItems extends CssProperty {

public CssValue value;

/**
* Create a new CssJustifyItems
*/
public CssJustifyItems() {
}

/**
* Creates a new CssJustifyItems
*
* @param expression The expression for this property
* @throws org.w3c.css.util.InvalidParamException
* Expressions are incorrect
*/
public CssJustifyItems(ApplContext ac, CssExpression expression, boolean check)
throws InvalidParamException {
throw new InvalidParamException("value",
expression.getValue().toString(),
getPropertyName(), ac);
}

public CssJustifyItems(ApplContext ac, CssExpression expression)
throws InvalidParamException {
this(ac, expression, false);
}

/**
* Returns the value of this property
*/
public Object get() {
return value;
}


/**
* Returns the name of this property
*/
public final String getPropertyName() {
return "justify-items";
}

/**
* Returns true if this property is "softly" inherited
* e.g. his value is equals to inherit
*/
public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
* @param style The CssStyle
*/
public void addToStyle(ApplContext ac, CssStyle style) {
Css3Style s = (Css3Style) style;
if (s.cssJustifyItems != null) {
style.addRedefinitionWarning(ac, this);
}
s.cssJustifyItems = this;
}


/**
* Compares two properties for equality.
*
* @param property The other property.
*/
public boolean equals(CssProperty property) {
return (property instanceof CssJustifyItems &&
value.equals(((CssJustifyItems) property).value));
}


/**
* Get this property in the style.
*
* @param style The style where the property is
* @param resolve if true, resolve the style to find this property
*/
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
if (resolve) {
return ((Css3Style) style).getJustifyItems();
} else {
return ((Css3Style) style).cssJustifyItems;
}
}
}

Loading