-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorg to add other safehtml bits. JRE tests pass, gwt not yet
- Loading branch information
Showing
51 changed files
with
3,663 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
target/ | ||
.project | ||
.classpath | ||
.settings/ | ||
*.iml | ||
atlassian-ide-plugin.xml |
6 changes: 0 additions & 6 deletions
6
processor/src/main/java/com/google/gwt/safehtml/apt/UnableToCompleteException.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 16 additions & 1 deletion
17
.../gwt/safehtml/apt/ParsedHtmlTemplate.java → ...ject/safehtml/apt/ParsedHtmlTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/gwt/safehtml/apt/SafeHtmlProcessor.java → ...oject/safehtml/apt/SafeHtmlProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
processor/src/main/java/org/gwtproject/safehtml/apt/UnableToCompleteException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2017 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package org.gwtproject.safehtml.apt; | ||
|
||
/** | ||
* TODO kill this class | ||
*/ | ||
public class UnableToCompleteException extends Exception { | ||
} |
3 changes: 1 addition & 2 deletions
3
processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
com.google.gwt.safehtml.apt.SafeHtmlProcessor | ||
com.programmaticallyspeaking.aptdemo.AnnotationProcessor | ||
org.gwtproject.safehtml.apt.SafeHtmlProcessor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
shared/src/main/java/org/gwtproject/safehtml/client/HasSafeHtml.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2010 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package org.gwtproject.safehtml.client; | ||
|
||
import org.gwtproject.safehtml.shared.SafeHtml; | ||
|
||
/** | ||
* An object that implements this interface contains text with HTML markup, | ||
* which can be set with the Cross-Site-Scripting-safe HTML markup encapsulated | ||
* in a {@link org.gwtproject.safehtml.shared.SafeHtml} object. | ||
*/ | ||
public interface HasSafeHtml { | ||
|
||
/** | ||
* Sets this object's contents via known-safe HTML. | ||
* | ||
* <p> | ||
* The object will behave exactly the same as when a widget's | ||
* {@code com.google.gwt.user.client.ui.HasHTML#setHTML(String)} method is | ||
* invoked; however the {@link SafeHtml} passed to this method observes the | ||
* contract that it can be used in an HTML context without causing unsafe | ||
* script execution. Thus, unlike | ||
* {@code com.google.gwt.user.client.ui.HasHTML#setHTML(String)}, using this | ||
* method cannot result in Cross-Site Scripting security vulnerabilities. | ||
* | ||
* @param html the object's new HTML, represented as a {@link SafeHtml} object | ||
*/ | ||
void setHTML(SafeHtml html); | ||
} |
Oops, something went wrong.